(function(g){var window=this;'use strict';var E9=function(Z){g.Tp(Z,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.sQ()).toString(36));return Z},lF=function(Z,Q,z){Array.isArray(z)||(z=[String(z)]); g.M3u(Z.W,Q,z)},RwY=function(Z){if(Z instanceof g.Kh)return Z; if(typeof Z.oR=="function")return Z.oR(!1);if(g.xW(Z)){var Q=0,z=new g.Kh;z.next=function(){for(;;){if(Q>=Z.length)return g.rN;if(Q in Z)return g.bA(Z[Q++]);Q++}}; return z}throw Error("Not implemented");},C_H=function(Z,Q,z){if(g.xW(Z))g.SB(Z,Q,z); else for(Z=RwY(Z);;){var K=Z.next();if(K.done)break;Q.call(z,K.value,void 0,Z)}},pCJ=function(Z,Q){var z=[]; C_H(Q,function(K){try{var b=g.aR.prototype.j.call(this,K,!0)}catch(q){if(q=="Storage: Invalid value was encountered")return;throw q;}b===void 0?z.push(K):g.w$n(b)&&z.push(K)},Z); return z},Hmw=function(Z,Q){pCJ(Z,Q).forEach(function(z){g.aR.prototype.remove.call(this,z)},Z)},Mnm=function(Z){if(Z.jJ){if(Z.jJ.locationOverrideToken)return{locationOverrideToken:Z.jJ.locationOverrideToken}; if(Z.jJ.latitudeE7!=null&&Z.jJ.longitudeE7!=null)return{latitudeE7:Z.jJ.latitudeE7,longitudeE7:Z.jJ.longitudeE7}}return null},U7w=function(Z,Q){g.wX(Z,Q)||Z.push(Q)},Om$=function(Z){var Q=0,z; for(z in Z)Q++;return Q},oRz=function(Z,Q){return g.yE(Z,Q)},Bdz=function(Z){try{return g.OG.JSON.parse(Z)}catch(Q){}Z=String(Z); if(/^\s*$/.test(Z)?0:/^[\],:{}\s\u2028\u2029]*$/.test(Z.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("("+Z+")")}catch(Q){}throw Error("Invalid JSON string: "+Z);},ZG=function(Z){if(g.OG.JSON)try{return g.OG.JSON.parse(Z)}catch(Q){}return Bdz(Z)},Wfw=function(Z){if(Z.hg&&typeof Z.hg=="function")return Z.hg(); if(typeof Map!=="undefined"&&Z instanceof Map||typeof Set!=="undefined"&&Z instanceof Set)return Array.from(Z.values());if(typeof Z==="string")return Z.split("");if(g.xW(Z)){for(var Q=[],z=Z.length,K=0;K1){if(z%2)throw Error("Uneven number of arguments");for(var K=0;K5&&(Z=Z.slice(Z.length-5)); var Q=g.my(MtH(),function(K){return K.loungeToken}),z=g.my(Z,function(K){return K.loungeToken}); g.It(z,function(K){return!g.wX(Q,K)})&&Uam(); g.CS("yt-remote-local-screens",Z,31536E3)},Yy=function(Z){Z||(g.H6("yt-remote-session-screen-id"),g.H6("yt-remote-session-video-id")); pFo();Z=vH();g.lU(Z,gq());REo(Z)},o2z=function(){if(!X$){var Z=g.M7(); Z&&(X$=new g.N7(Z))}},BIz=function(){o2z(); return X$?!!X$.get("yt-remote-use-staging-server"):!1},Sh=function(Z,Q){g.zt[Z]=!0; var z=g.Zt();z&&z.publish.apply(z,arguments);g.zt[Z]=!1},W$z=function(){},QA=function(){if(!$y){$y=new g.Il(new W$z); var Z=g.cX("client_streamz_web_flush_count",-1);Z!==-1&&($y.S=Z)}return $y},VtY=function(){var Z=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return Z?parseInt(Z[1],10):0},kOY=function(Z){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+Z)!=-1||document.currentScript.src.indexOf("&"+Z)!=-1)},ut$=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},T8=function(Z){Z.length?xao(Z.shift(),function(){T8(Z)}):ttQ()},F$U=function(Z){return"chrome-extension://"+Z+"/cast_sender.js"},xao=function(Z,Q,z){var K=document.createElement("script"); K.onerror=Q;z&&(K.onload=z);g.WB(K,g.Js(Z));(document.head||document.documentElement).appendChild(K)},eEY=function(){var Z=VtY(),Q=[]; if(Z>1){var z=Z-1;Q.push("//www.gstatic.com/eureka/clank/"+Z+"/cast_sender.js");Q.push("//www.gstatic.com/eureka/clank/"+z+"/cast_sender.js")}return Q},ttQ=function(){var Z=ut$(); Z&&Z(!1,"No cast extension found")},E2R=function(){if(wFn){var Z=2,Q=ut$(),z=function(){Z--; Z==0&&Q&&Q(!0)}; window.__onGCastApiAvailable=z;xao("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",ttQ,z)}},lPE=function(){E2R(); var Z=eEY();Z.push("//www.gstatic.com/eureka/clank/cast_sender.js");T8(Z)},ZAm=function(){E2R(); var Z=eEY();Z.push.apply(Z,g.I(snE.map(F$U)));Z.push("//www.gstatic.com/eureka/clank/cast_sender.js");T8(Z)},fk=function(Z,Q,z){g.O.call(this); this.K=z!=null?(0,g.EG)(Z,z):Z;this.P8=Q;this.L=(0,g.EG)(this.gs,this);this.Y=!1;this.j=0;this.S=this.qb=null;this.W=[]},hS=function(Z,Q,z){g.O.call(this); this.W=z!=null?Z.bind(z):Z;this.P8=Q;this.S=null;this.Y=!1;this.j=0;this.qb=null},Qnm=function(Z){Z.qb=g.cK(function(){Z.qb=null; Z.Y&&!Z.j&&(Z.Y=!1,Qnm(Z))},Z.P8); var Q=Z.S;Z.S=null;Z.W.apply(null,Q)},Lk=function(){},zKJ=function(){g.P8.call(this,"p")},KYU=function(){g.P8.call(this,"o")},qSQ=function(){return bAE=bAE||new g.wC},rNU=function(Z){g.P8.call(this,"serverreachability",Z)},nk=function(Z){var Q=qSQ(); Q.dispatchEvent(new rNU(Q,Z))},ANE=function(Z){g.P8.call(this,"statevent",Z)},cH=function(Z){var Q=qSQ(); Q.dispatchEvent(new ANE(Q,Z))},jnX=function(Z,Q,z,K){g.P8.call(this,"timingevent",Z); this.size=Q;this.rtt=z;this.retries=K},mJ=function(Z,Q){if(typeof Z!=="function")throw Error("Fn must not be null and must be a function"); return g.OG.setTimeout(function(){Z()},Q)},IJ=function(){},JS=function(Z,Q,z,K){this.S=Z; this.W=Q;this.sA=z;this.X7=K||1;this.Qp=new g.cJ(this);this.qB=45E3;this.Vp=null;this.K=!1;this.U=this.s$=this.X=this.tG=this.P7=this.CN=this.jJ=null;this.SJ=[];this.Y=null;this.T=0;this.L=this.JG=null;this.gq=-1;this.c7=!1;this.NB=0;this.Zu=null;this.F7=this.Du=this.DI=this.KN=!1;this.j=new DiU},DiU=function(){this.S=null; this.Y="";this.j=!1},gqn=function(Z,Q,z){Z.tG=1; Z.X=E9(Q.clone());Z.U=z;Z.KN=!0;vqz(Z,null)},vqz=function(Z,Q){Z.P7=Date.now(); yA(Z);Z.s$=Z.X.clone();lF(Z.s$,"t",Z.X7);Z.T=0;var z=Z.S.tG;Z.j=new DiU;Z.Y=YSJ(Z.S,z?Q:null,!Z.U);Z.NB>0&&(Z.Zu=new hS((0,g.EG)(Z.Gm,Z,Z.Y),Z.NB));Z.Qp.listen(Z.Y,"readystatechange",Z.H3);Q=Z.Vp?g.ae(Z.Vp):{};Z.U?(Z.JG||(Z.JG="POST"),Q["Content-Type"]="application/x-www-form-urlencoded",Z.Y.send(Z.s$,Z.JG,Z.U,Q)):(Z.JG="GET",Z.Y.send(Z.s$,Z.JG,null,Q));nk(1)},SSm=function(Z){if(!XXm(Z))return g.ww(Z.Y); var Q=g.Ej(Z.Y);if(Q==="")return"";var z="",K=Q.length,b=g.FA(Z.Y)==4;if(!Z.j.S){if(typeof TextDecoder==="undefined")return dq(Z),NJ(Z),"";Z.j.S=new g.OG.TextDecoder}for(var q=0;qQ.length)return $iU;Q=Q.slice(K,K+z);Z.T=K+z;return Q},yA=function(Z){Z.CN=Date.now()+Z.qB; hKX(Z,Z.qB)},hKX=function(Z,Q){if(Z.jJ!=null)throw Error("WatchDog timer not null"); Z.jJ=mJ((0,g.EG)(Z.W3,Z),Q)},LY$=function(Z){Z.jJ&&(g.OG.clearTimeout(Z.jJ),Z.jJ=null)},NJ=function(Z){Z.S.Bx()||Z.c7||nq0(Z.S,Z)},dq=function(Z){LY$(Z); g.jR(Z.Zu);Z.Zu=null;Z.Qp.removeAll();if(Z.Y){var Q=Z.Y;Z.Y=null;Q.abort();Q.dispose()}},GrH=function(Z,Q){try{var z=Z.S; if(z.wv!=0&&(z.Y==Z||cNJ(z.j,Z)))if(!Z.Du&&cNJ(z.j,Z)&&z.wv==3){try{var K=z.Pg.Y.parse(Q)}catch(m){K=null}if(Array.isArray(K)&&K.length==3){var b=K;if(b[0]==0)a:{if(!z.X){if(z.Y)if(z.Y.P7+3E30&&(z.NB=1.5*D);K=z;var v=Z.bA();if(v){var Y=g.lq(v,"X-Client-Wire-Protocol");if(Y){var X=K.j;!X.Y&&(g.Jo(Y,"spdy")||g.Jo(Y,"quic")||g.Jo(Y,"h2"))&&(X.W=X.L,X.Y=new Set,X.j&&(JNU(X,X.j),X.j=null))}if(K.KN){var S=g.lq(v,"X-HTTP-Session-Id");S&&(K.yk=S,g.Tp(K.Vp,K.KN,S))}}z.wv=3;z.L&&z.L.YG();z.Sp&&(z.fL=Date.now()-Z.P7);K=z;var T=Z;K.A4=yNR(K,K.tG?K.X7:null,K.sA);if(T.Du){diR(K.j, T);var f=T,h=K.NB;h&&f.setTimeout(h);f.jJ&&(LY$(f),yA(f));K.Y=T}else Npz(K);z.S.length>0&&PH(z)}else q[0]!="stop"&&q[0]!="close"||aJ(z,7);else z.wv==3&&(q[0]=="stop"||q[0]=="close"?q[0]=="stop"?aJ(z,7):z.disconnect():q[0]!="noop"&&z.L&&z.L.QK(q),z.SJ=0)}nk(4)}catch(m){}},iAQ=function(Z,Q){this.Y=Z; this.map=Q;this.context=null},aXE=function(Z){this.L=Z||10; g.OG.PerformanceNavigationTiming?(Z=g.OG.performance.getEntriesByType("navigation"),Z=Z.length>0&&(Z[0].nextHopProtocol=="hq"||Z[0].nextHopProtocol=="h2")):Z=!!(g.OG.chrome&&g.OG.chrome.loadTimes&&g.OG.chrome.loadTimes()&&g.OG.chrome.loadTimes().wasFetchedViaSpdy);this.W=Z?this.L:1;this.Y=null;this.W>1&&(this.Y=new Set);this.j=null;this.S=[]},PVQ=function(Z){return Z.j?!0:Z.Y?Z.Y.size>=Z.W:!1},IXH=function(Z){return Z.j?1:Z.Y?Z.Y.size:0},cNJ=function(Z,Q){return Z.j?Z.j==Q:Z.Y?Z.Y.has(Q):!1},JNU= function(Z,Q){Z.Y?Z.Y.add(Q):Z.j=Q},diR=function(Z,Q){Z.j&&Z.j==Q?Z.j=null:Z.Y&&Z.Y.has(Q)&&Z.Y.delete(Q)},RKQ=function(Z){if(Z.j!=null)return Z.S.concat(Z.j.SJ); if(Z.Y!=null&&Z.Y.size!==0){var Q=Z.S;Z=g.n(Z.Y.values());for(var z=Z.next();!z.done;z=Z.next())Q=Q.concat(z.value.SJ);return Q}return g.QM(Z.S)},CVn=function(Z,Q){var z=new IJ; if(g.OG.Image){var K=new Image;K.onload=g.lu(RJ,z,"TestLoadImage: loaded",!0,Q,K);K.onerror=g.lu(RJ,z,"TestLoadImage: error",!1,Q,K);K.onabort=g.lu(RJ,z,"TestLoadImage: abort",!1,Q,K);K.ontimeout=g.lu(RJ,z,"TestLoadImage: timeout",!1,Q,K);g.OG.setTimeout(function(){if(K.ontimeout)K.ontimeout()},1E4); K.src=Z}else Q(!1)},pXX=function(Z,Q){var z=new IJ,K=new AbortController,b=setTimeout(function(){K.abort(); RJ(z,"TestPingServer: timeout",!1,Q)},1E4); fetch(Z,{signal:K.signal}).then(function(q){clearTimeout(b);q.ok?RJ(z,"TestPingServer: ok",!0,Q):RJ(z,"TestPingServer: server error",!1,Q)}).catch(function(){clearTimeout(b); RJ(z,"TestPingServer: error",!1,Q)})},RJ=function(Z,Q,z,K,b){try{b&&(b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null),K(z)}catch(q){}},HAz=function(){this.Y=new Lk},MLJ=function(Z,Q,z){var K=z||""; try{kCU(Z,function(b,q){var r=b;g.tn(b)&&(r=g.yU(b));Q.push(K+q+"="+encodeURIComponent(r))})}catch(b){throw Q.push(K+"type="+encodeURIComponent("_badmap")),b; }},Ck=function(Z,Q,z){return z&&z.ohf?z.ohf[Z]||Q:Q},UiQ=function(Z){this.S=[]; this.X7=this.A4=this.Vp=this.sA=this.Y=this.yk=this.KN=this.c7=this.T=this.gq=this.U=null;this.N8=this.s$=0;this.ex=Ck("failFast",!1,Z);this.Du=this.jJ=this.X=this.K=this.L=null;this.ih=!0;this.IW=this.Zu=-1;this.F7=this.SJ=this.P7=0;this.bY=Ck("baseRetryDelayMs",5E3,Z);this.y7=Ck("retryDelaySeedMs",1E4,Z);this.aC=Ck("forwardChannelMaxRetries",2,Z);this.kL=Ck("forwardChannelRequestTimeoutMs",2E4,Z);this.zJ=Z&&Z.ewN||void 0;this.YJ=Z&&Z.xD7||void 0;this.Uv=Z&&Z.ZVG||!1;this.NB=void 0;this.tG=Z&&Z.Bmp|| !1;this.W="";this.j=new aXE(Z&&Z.n3h);this.Pg=new HAz;this.Qp=Z&&Z.ylG||!1;this.CN=Z&&Z.xOG||!1;this.Qp&&this.CN&&(this.CN=!1);this.Q7=Z&&Z.RVF||!1;Z&&Z.lLI&&(this.ih=!1);this.Sp=!this.Qp&&this.ih&&Z&&Z.uwY||!1;this.De=void 0;Z&&Z.EB&&Z.EB>0&&(this.De=Z.EB);this.Ph=void 0;this.fL=0;this.qB=!1;this.DI=this.JG=null},i0=function(Z){Z.Y&&(OAz(Z),Z.Y.cancel(),Z.Y=null)},oqH=function(Z){i0(Z); Z.X&&(g.OG.clearTimeout(Z.X),Z.X=null);G8(Z);Z.j.cancel();Z.K&&(typeof Z.K==="number"&&g.OG.clearTimeout(Z.K),Z.K=null)},PH=function(Z){PVQ(Z.j)||Z.K||(Z.K=!0,g.Ae(Z.AA,Z),Z.P7=0)},WYm=function(Z,Q){if(IXH(Z.j)>=Z.j.W-(Z.K?1:0))return!1; if(Z.K)return Z.S=Q.SJ.concat(Z.S),!0;if(Z.wv==1||Z.wv==2||Z.P7>=(Z.ex?0:Z.aC))return!1;Z.K=mJ((0,g.EG)(Z.AA,Z,Q),Bpz(Z,Z.P7));Z.P7++;return!0},krn=function(Z,Q){var z; Q?z=Q.sA:z=Z.s$++;var K=Z.Vp.clone();g.Tp(K,"SID",Z.W);g.Tp(K,"RID",z);g.Tp(K,"AID",Z.Zu);pk(Z,K);Z.T&&Z.U&&g.nB(K,Z.T,Z.U);z=new JS(Z,Z.W,z,Z.P7+1);Z.T===null&&(z.Vp=Z.U);Q&&(Z.S=Q.SJ.concat(Z.S));Q=VL0(Z,z,1E3);z.setTimeout(Math.round(Z.kL*.5)+Math.round(Z.kL*.5*Math.random()));JNU(Z.j,z);gqn(z,K,Q)},pk=function(Z,Q){Z.c7&&g.fx(Z.c7,function(z,K){g.Tp(Q,K,z)}); Z.L&&kCU({},function(z,K){g.Tp(Q,K,z)})},VL0=function(Z,Q,z){z=Math.min(Z.S.length,z); var K=Z.L?(0,g.EG)(Z.L.B3,Z.L,Z):null;a:{for(var b=Z.S,q=-1;;){var r=["count="+z];q==-1?z>0?(q=b[0].Y,r.push("ofs="+q)):q=0:r.push("ofs="+q);for(var D=!0,v=0;v=3)return!1; Z.F7++;Z.X=mJ((0,g.EG)(Z.qs,Z),Bpz(Z,Z.SJ));Z.SJ++;return!0},OAz=function(Z){Z.JG!=null&&(g.OG.clearTimeout(Z.JG),Z.JG=null)},uJX=function(Z){Z.Y=new JS(Z,Z.W,"rpc",Z.F7); Z.T===null&&(Z.Y.Vp=Z.U);Z.Y.NB=0;var Q=Z.A4.clone();g.Tp(Q,"RID","rpc");g.Tp(Q,"SID",Z.W);g.Tp(Q,"AID",Z.Zu);g.Tp(Q,"CI",Z.Du?"0":"1");!Z.Du&&Z.De&&g.Tp(Q,"TO",Z.De);g.Tp(Q,"TYPE","xmlhttp");pk(Z,Q);Z.T&&Z.U&&g.nB(Q,Z.T,Z.U);Z.NB&&Z.Y.setTimeout(Z.NB);var z=Z.Y;Z=Z.X7;z.tG=1;z.X=E9(Q.clone());z.U=null;z.KN=!0;vqz(z,Z)},G8=function(Z){Z.jJ!=null&&(g.OG.clearTimeout(Z.jJ),Z.jJ=null)},nq0=function(Z,Q){var z=null; if(Z.Y==Q){G8(Z);OAz(Z);Z.Y=null;var K=2}else if(cNJ(Z.j,Q))z=Q.SJ,diR(Z.j,Q),K=1;else return;if(Z.wv!=0)if(Q.K)if(K==1){z=Q.U?Q.U.length:0;Q=Date.now()-Q.P7;var b=Z.P7;K=qSQ();K.dispatchEvent(new jnX(K,z,Q,b));PH(Z)}else Npz(Z);else{var q=Q.gq;b=Q.getLastError();if(b==3||b==0&&q>0||!(K==1&&WYm(Z,Q)||K==2&&miH(Z)))switch(z&&z.length>0&&(Q=Z.j,Q.S=Q.S.concat(z)),b){case 1:aJ(Z,5);break;case 4:aJ(Z,10);break;case 3:aJ(Z,6);break;default:aJ(Z,2)}}},Bpz=function(Z,Q){var z=Z.bY+Math.floor(Math.random()* Z.y7); Z.isActive()||(z*=2);return z*Q},aJ=function(Z,Q){if(Q==2){var z=(0,g.EG)(Z.LGu,Z),K=Z.YJ,b=!K; K=new g.jg(K||"//www.google.com/images/cleardot.gif");g.OG.location&&g.OG.location.protocol=="http"||g.D9(K,"https");E9(K);b?CVn(K.toString(),z):pXX(K.toString(),z)}else cH(2);Z.wv=0;Z.L&&Z.L.Ua(Q);xi0(Z);oqH(Z)},xi0=function(Z){Z.wv=0; Z.DI=[];if(Z.L){var Q=RKQ(Z.j);if(Q.length!=0||Z.S.length!=0)g.KG(Z.DI,Q),g.KG(Z.DI,Z.S),Z.j.S.length=0,g.QM(Z.S),Z.S.length=0;Z.L.Ck()}},tLU=function(Z){if(Z.wv==0)return Z.DI; var Q=[];g.KG(Q,RKQ(Z.j));g.KG(Q,Z.S);return Q},yNR=function(Z,Q,z){var K=g.fB(z); K.Y!=""?(Q&&g.vJ(K,Q+"."+K.Y),g.gc(K,K.S)):(K=g.OG.location,K=uBo(K.protocol,Q?Q+"."+K.hostname:K.hostname,+K.port,z));Q=Z.KN;z=Z.yk;Q&&z&&g.Tp(K,Q,z);g.Tp(K,"VER",Z.hA);pk(Z,K);return K},YSJ=function(Z,Q,z){if(Q&&!Z.tG)throw Error("Can't create secondary domain capable XhrIo object."); Q=Z.Uv&&!Z.zJ?new g.uq(new g.bT({oA:z})):new g.uq(Z.zJ);Q.T=Z.tG;return Q},FYE=function(){},eK0=function(){},MJ=function(Z,Q){g.wC.call(this); this.Y=new UiQ(Q);this.L=Z;this.j=Q&&Q.LM$||null;Z=Q&&Q.zL7||null;Q&&Q.VlJ&&(Z?Z["X-Client-Protocol"]="webchannel":Z={"X-Client-Protocol":"webchannel"});this.Y.U=Z;Z=Q&&Q.gxN||null;Q&&Q.lK&&(Z?Z["X-WebChannel-Content-Type"]=Q.lK:Z={"X-WebChannel-Content-Type":Q.lK});Q&&Q.v5&&(Z?Z["X-WebChannel-Client-Profile"]=Q.v5:Z={"X-WebChannel-Client-Profile":Q.v5});this.Y.gq=Z;(Z=Q&&Q.wMF)&&!g.IE(Z)&&(this.Y.T=Z);this.K=Q&&Q.Bmp||!1;this.W=Q&&Q.pJf||!1;(Q=Q&&Q.rGh)&&!g.IE(Q)&&(this.Y.KN=Q,g.Jl(this.j,Q)&&(Z= this.j,Q in Z&&delete Z[Q]));this.S=new HH(this)},wX0=function(Z){zKJ.call(this); Z.__headers__&&(this.headers=Z.__headers__,this.statusCode=Z.__status__,delete Z.__headers__,delete Z.__status__);var Q=Z.__sm__;Q?this.data=(this.Y=g.ca(Q))?g.GF(Q,this.Y):Q:this.data=Z},Eqm=function(Z){KYU.call(this); this.status=1;this.errorCode=Z},HH=function(Z){this.Y=Z},lXX=function(Z,Q){this.j=Z; this.Y=Q},s7X=function(Z){return tLU(Z.Y).map(function(Q){var z=Z.j; Q=Q.map;"__data__"in Q?(Q=Q.__data__,z=z.W?Bdz(Q):Q):z=Q;return z})},Uv=function(Z,Q){if(typeof Z!=="function")throw Error("Fn must not be null and must be a function"); return g.OG.setTimeout(function(){Z()},Q)},oJ=function(Z){Ov.dispatchEvent(new ZSJ(Ov,Z))},ZSJ=function(Z){g.P8.call(this,"statevent",Z)},BH=function(Z,Q,z,K){this.Y=Z; this.W=Q;this.T=z;this.K=K||1;this.j=45E3;this.S=new g.cJ(this);this.L=new g.nE;this.L.setInterval(250)},zg$=function(Z,Q,z){Z.PF=1; Z.O2=E9(Q.clone());Z.Cz=z;Z.KN=!0;Q7$(Z,null)},KCH=function(Z,Q,z,K,b){Z.PF=1; Z.O2=E9(Q.clone());Z.Cz=null;Z.KN=z;b&&(Z.UL=!1);Q7$(Z,K)},Q7$=function(Z,Q){Z.zv=Date.now(); bSw(Z);Z.HF=Z.O2.clone();lF(Z.HF,"t",Z.K);Z.BF=0;Z.rV=Z.Y.Jv(Z.Y.La()?Q:null);Z.Bq>0&&(Z.WF=new hS((0,g.EG)(Z.It,Z,Z.rV),Z.Bq));Z.S.listen(Z.rV,"readystatechange",Z.J$);Q=Z.q_?g.ae(Z.q_):{};Z.Cz?(Z.dA="POST",Q["Content-Type"]="application/x-www-form-urlencoded",Z.rV.send(Z.HF,Z.dA,Z.Cz,Q)):(Z.dA="GET",Z.UL&&!g.Fv&&(Q.Connection="close"),Z.rV.send(Z.HF,Z.dA,null,Q));Z.Y.ND(1)},AWm=function(Z,Q){var z=Z.BF,K=Q.indexOf("\n",z); if(K==-1)return q7J;z=Number(Q.substring(z,K));if(isNaN(z))return rWw;K+=1;if(K+z>Q.length)return q7J;Q=Q.slice(K,K+z);Z.BF=K+z;return Q},bSw=function(Z){Z.Rh=Date.now()+Z.j; j7z(Z,Z.j)},j7z=function(Z,Q){if(Z.nP!=null)throw Error("WatchDog timer not null"); Z.nP=Uv((0,g.EG)(Z.RD,Z),Q)},DWJ=function(Z){Z.nP&&(g.OG.clearTimeout(Z.nP),Z.nP=null)},vTn=function(Z){Z.Y.Bx()||Z.b3||Z.Y.bW(Z)},WH=function(Z){DWJ(Z); g.jR(Z.WF);Z.WF=null;Z.L.stop();Z.S.removeAll();if(Z.rV){var Q=Z.rV;Z.rV=null;Q.abort();Q.dispose()}Z.Qb&&(Z.Qb=null)},gTE=function(Z,Q){try{Z.Y.j4(Z,Q),Z.Y.ND(4)}catch(z){}},X60=function(Z,Q,z,K,b){if(K==0)z(!1); else{var q=b||0;K--;Y7Y(Z,Q,function(r){r?z(!0):g.OG.setTimeout(function(){X60(Z,Q,z,K,q)},q)})}},Y7Y=function(Z,Q,z){var K=new Image; K.onload=function(){try{VA(K),z(!0)}catch(b){}}; K.onerror=function(){try{VA(K),z(!1)}catch(b){}}; K.onabort=function(){try{VA(K),z(!1)}catch(b){}}; K.ontimeout=function(){try{VA(K),z(!1)}catch(b){}}; g.OG.setTimeout(function(){if(K.ontimeout)K.ontimeout()},Q); K.src=Z},VA=function(Z){Z.onload=null; Z.onerror=null;Z.onabort=null;Z.ontimeout=null},S7z=function(Z){this.Y=Z; this.j=new Lk},$WH=function(Z){var Q=ky(Z.Y,Z.kI,"/mail/images/cleardot.gif"); E9(Q);X60(Q.toString(),5E3,(0,g.EG)(Z.Td,Z),3,2E3);Z.ND(1)},Tto=function(Z){var Q=Z.Y.K; Q!=null?(oJ(5),Q?(oJ(11),u0(Z.Y,Z,!1)):(oJ(12),u0(Z.Y,Z,!0))):(Z.kS=new BH(Z),Z.kS.q_=Z.Ot,Q=Z.Y,Q=ky(Q,Q.La()?Z.RJ:null,Z.Km),oJ(5),lF(Q,"TYPE","xmlhttp"),KCH(Z.kS,Q,!1,Z.RJ,!1))},fTz=function(Z,Q,z){this.Y=1; this.j=[];this.S=[];this.L=new Lk;this.U=Z||null;this.K=Q!=null?Q:null;this.X=z||!1},hgw=function(Z,Q){this.Y=Z; this.map=Q;this.context=null},LCQ=function(Z,Q,z,K){g.P8.call(this,"timingevent",Z); this.size=Q;this.rtt=z;this.retries=K},nTQ=function(Z){g.P8.call(this,"serverreachability",Z)},mWz=function(Z){Z.OO(1,0); Z.J1=ky(Z,null,Z.Lm);cWz(Z)},ITz=function(Z){Z.GU&&(Z.GU.abort(),Z.GU=null); Z.KK&&(Z.KK.cancel(),Z.KK=null);Z.Gw&&(g.OG.clearTimeout(Z.Gw),Z.Gw=null);tS(Z);Z.Zc&&(Z.Zc.cancel(),Z.Zc=null);Z.oe&&(g.OG.clearTimeout(Z.oe),Z.oe=null)},JWY=function(Z,Q){if(Z.Y==0)throw Error("Invalid operation: sending map when state is closed"); Z.j.push(new hgw(Z.bj++,Q));Z.Y!=2&&Z.Y!=3||cWz(Z)},yW0=function(Z){var Q=0; Z.KK&&Q++;Z.Zc&&Q++;return Q},cWz=function(Z){Z.Zc||Z.oe||(Z.oe=Uv((0,g.EG)(Z.g9,Z),0),Z.cK=0)},GMz=function(Z,Q){if(Z.Y==1){if(!Q){Z.Fb=Math.floor(Math.random()*1E5); Q=Z.Fb++;var z=new BH(Z,"",Q);z.q_=Z.cP;var K=dW0(Z),b=Z.J1.clone();g.Tp(b,"RID",Q);g.Tp(b,"CVER","1");F$(Z,b);zg$(z,b,K);Z.Zc=z;Z.Y=2}}else Z.Y==3&&(Q?Nt0(Z,Q):Z.j.length==0||Z.Zc||Nt0(Z))},Nt0=function(Z,Q){if(Q)if(Z.UD>6){Z.j=Z.S.concat(Z.j); Z.S.length=0;var z=Z.Fb-1;Q=dW0(Z)}else z=Q.T,Q=Q.Cz;else z=Z.Fb++,Q=dW0(Z);var K=Z.J1.clone();g.Tp(K,"SID",Z.W);g.Tp(K,"RID",z);g.Tp(K,"AID",Z.rk);F$(Z,K);z=new BH(Z,Z.W,z,Z.cK+1);z.q_=Z.cP;z.setTimeout(1E4+Math.round(1E4*Math.random()));Z.Zc=z;zg$(z,K,Q)},F$=function(Z,Q){Z.Qe&&(Z=Z.Qe.d9())&&g.fx(Z,function(z,K){g.Tp(Q,K,z)})},dW0=function(Z){var Q=Math.min(Z.j.length,1E3),z=["count="+Q]; if(Z.UD>6&&Q>0){var K=Z.j[0].Y;z.push("ofs="+K)}else K=0;for(var b={},q=0;q=3)return!1; Z.T++;Z.Gw=Uv((0,g.EG)(Z.w9,Z),aT$(Z,Z.FS));Z.FS++;return!0},u0=function(Z,Q,z){Z.Nq=Z.K==null?z:!Z.K; Z.UK=Q.lN;Z.X||mWz(Z)},tS=function(Z){Z.QB!=null&&(g.OG.clearTimeout(Z.QB),Z.QB=null)},aT$=function(Z,Q){var z=5E3+Math.floor(Math.random()*1E4); Z.isActive()||(z*=2);return z*Q},eh=function(Z,Q){if(Q==2||Q==9){var z=null; Z.Qe&&(z=null);var K=(0,g.EG)(Z.zD7,Z);z||(z=new g.jg("//www.google.com/images/cleardot.gif"),E9(z));Y7Y(z.toString(),1E4,K)}else oJ(2);RgR(Z,Q)},RgR=function(Z,Q){Z.Y=0; Z.Qe&&Z.Qe.W9(Q);Cbz(Z);ITz(Z)},Cbz=function(Z){Z.Y=0; Z.UK=-1;if(Z.Qe)if(Z.S.length==0&&Z.j.length==0)Z.Qe.VT();else{var Q=g.QM(Z.S),z=g.QM(Z.j);Z.S.length=0;Z.j.length=0;Z.Qe.VT(Q,z)}},ky=function(Z,Q,z){var K=g.fB(z); if(K.Y!="")Q&&g.vJ(K,Q+"."+K.Y),g.gc(K,K.S);else{var b=window.location;K=uBo(b.protocol,Q?Q+"."+b.hostname:b.hostname,+b.port,z)}Z.Vx&&g.fx(Z.Vx,function(q,r){g.Tp(K,r,q)}); g.Tp(K,"VER",Z.UD);F$(Z,K);return K},p60=function(){},HSE=function(){this.Y=[]; this.j=[]},Mjn=function(Z){g.P8.call(this,"channelMessage"); this.message=Z},UWm=function(Z){g.P8.call(this,"channelError"); this.error=Z},OSQ=function(Z,Q){this.action=Z; this.params=Q||{}},wq=function(Z,Q){g.O.call(this); this.Y=new g.E6(this.YvN,0,this);g.W(this,this.Y);this.P8=5E3;this.j=0;if(typeof Z==="function")Q&&(Z=(0,g.EG)(Z,Q));else if(Z&&typeof Z.handleEvent==="function")Z=(0,g.EG)(Z.handleEvent,Z);else throw Error("Invalid listener argument");this.S=Z},oTz=function(Z,Q,z,K,b,q,r){z=z===void 0?!1:z; K=K===void 0?function(){return""}:K; b=b===void 0?!1:b;q=q===void 0?!1:q;r=r===void 0?function(){return g.$7({})}:r; this.c7=Z;this.jJ=Q;this.L=new g.dd;this.j=new wq(this.V$p,this);this.Y=null;this.T=!1;this.U=null;this.P7="";this.SJ=this.X=0;this.S=[];this.s$=z;this.JG=K;this.K=q;this.KN=r;this.W=g.$7();this.NB=b;this.Zu=new x7z;this.Vp=new tnX;this.Du=new FfE;this.tG=new ewz;this.qB=new wCo;this.CN=new ERw},WCH=function(Z,Q,z,K,b){BtY(Z); if(Z.Y){var q=g.Ft("ID_TOKEN"),r=Z.Y.cP||{};q?r["x-youtube-identity-token"]=q:delete r["x-youtube-identity-token"];Z.Y.cP=r}K?(K.getState()!=3&&yW0(K)==0||K.getState(),Z.Y.connect(Q,z,Z.jJ,K.W,K.rk)):b?Z.Y.connect(Q,z,Z.jJ,b.sessionId,b.arrayId):Z.Y.connect(Q,z,Z.jJ)},uYU=function(Z){var Q,z; g.C(function(K){if(K.Y==1)return g.cG(K,2),g.P(K,Vjz(Z),2);g.Jn(K);Q=Z.S;Z.S=[];z=Q.length;kM0(Z,Q,z);Ev(Z);return g.yx(K,0)})},kM0=function(Z,Q,z){for(var K=0;K0?z=Object.assign({},z,Q):delete z.Authorization;Z.Y.cP=z}).catch(function(){})},l0=function(Z){this.scheme="https"; this.port=this.domain="";this.Y="/api/lounge";this.j=!0;Z=Z||document.location.href;var Q=Number(g.CE(4,Z))||"";Q&&(this.port=":"+Q);this.domain=g.pE(Z)||"";Z=g.iU();Z.search("MSIE")>=0&&(Z=Z.match(/MSIE ([\d.]+)/)[1],g.GJ(Z,"10.0")<0&&(this.j=!1))},sy=function(Z,Q){var z=Z.Y; Z.j&&(z=Z.scheme+"://"+Z.domain+Z.port+Z.Y);return g.BK(z+Q,{})},xWY=function(Z,Q){g.wC.call(this); var z=this;this.Bo=Z();this.Bo.subscribe("handlerOpened",this.zj,this);this.Bo.subscribe("handlerClosed",this.onClosed,this);this.Bo.subscribe("handlerError",function(K,b){z.onError(b)}); this.Bo.subscribe("handlerMessage",this.onMessage,this);this.Y=Q},tjR=function(Z,Q,z){var K=this; z=z===void 0?function(){return""}:z; var b=b===void 0?new eK0:b;var q=q===void 0?new g.dd:q;this.pathPrefix=Z;this.Y=Q;this.P7=z;this.L=q;this.X=null;this.U=this.T=0;this.channel=null;this.K=0;this.S=new wq(function(){K.S.isActive();var r;((r=K.channel)==null?void 0:IXH((new lXX(r,r.Y)).Y.j))===0&&K.connect(K.X,K.T)}); this.W={};this.j={};this.jJ=!1;this.logger=null;this.SJ=[];this.Xl=void 0;this.Vp=new x7z;this.JG=new tnX;this.c7=new FfE;this.KN=new ewz},FCY=function(Z){g.o8(Z.channel,"m",function(){Z.K=3; Z.S.reset();Z.X=null;Z.T=0;for(var Q=g.n(Z.SJ),z=Q.next();!z.done;z=Q.next())z=z.value,Z.channel&&Z.channel.send(z);Z.SJ=[];Z.publish("webChannelOpened");Z.Vp.Y("WEB_CHANNEL")}); g.o8(Z.channel,"n",function(){Z.K=0;Z.S.isActive()||Z.publish("webChannelClosed");var Q,z=(Q=Z.channel)==null?void 0:s7X(new lXX(Q,Q.Y));z&&(Z.SJ=[].concat(g.I(z)));Z.JG.Y("WEB_CHANNEL")}); g.o8(Z.channel,"p",function(Q){var z=Q.data;z[0]==="gracefulReconnect"?(Z.S.start(),Z.channel&&Z.channel.close()):Z.publish("webChannelMessage",new OSQ(z[0],z[1]));Z.Xl=Q.statusCode;Z.c7.Y("WEB_CHANNEL")}); g.o8(Z.channel,"o",function(){Z.Xl===401||Z.S.start();Z.publish("webChannelError");Z.KN.Y("WEB_CHANNEL")})},egH=function(Z){var Q=Z.P7(); Q?Z.W["x-youtube-lounge-xsrf-token"]=Q:delete Z.W["x-youtube-lounge-xsrf-token"]},w6z=function(Z){g.wC.call(this); this.Y=Z();this.Y.subscribe("webChannelOpened",this.LD,this);this.Y.subscribe("webChannelClosed",this.onClosed,this);this.Y.subscribe("webChannelError",this.onError,this);this.Y.subscribe("webChannelMessage",this.onMessage,this)},ETz=function(Z,Q,z,K,b){function q(){return new oTz(sy(Z,"/bc"),Q,!1,z,K)} z=z===void 0?function(){return""}:z; return g.nA("enable_mdx_web_channel_desktop")?new w6z(function(){return new tjR(sy(Z,"/wc"),Q,z)}):new xWY(q,b)},QwY=function(){var Z=lTz; swY();Zv.push(Z);ZcX()},Qg=function(Z,Q){swY(); var z=z4Q(Z,String(Q));Zv.length==0?KeE(z):(ZcX(),g.SB(Zv,function(K){K(z)}))},zW=function(Z){Qg("CP",Z)},swY=function(){Zv||(Zv=g.WG("yt.mdx.remote.debug.handlers_")||[],g.BG("yt.mdx.remote.debug.handlers_",Zv))},KeE=function(Z){var Q=(K2+1)%50; K2=Q;bw[Q]=Z;qg||(qg=Q==49)},ZcX=function(){var Z=Zv; if(bw[0]){var Q=qg?K2:-1,z={};do z={rY:void 0},Q=(Q+1)%50,z.rY=bw[Q],g.SB(Z,function(K){return function(b){b(K.rY)}}(z)); while(Q!=K2);bw=Array(50);K2=-1;qg=!1}},z4Q=function(Z,Q){var z=(Date.now()-bcw)/1E3; z.toFixed&&(z=z.toFixed(3));var K=[];K.push("[",z+"s","] ");K.push("[","yt.mdx.remote","] ");K.push(Z+": "+Q,"\n");return K.join("")},ri=function(Z){g.rV.call(this); this.K=Z;this.screens=[]},qIQ=function(Z,Q){var z=Z.get(Q.uuid)||Z.get(Q.id); if(z)return Z=z.name,z.id=Q.id||z.id,z.name=Q.name,z.token=Q.token,z.uuid=Q.uuid||z.uuid,z.name!=Z;Z.screens.push(Q);return!0},rh0=function(Z,Q){var z=Z.screens.length!=Q.length; Z.screens=g.jr(Z.screens,function(q){return!!ipX(Q,q)}); for(var K=Q.length,b=0;b0&&Z.W0&&L2(Z,z)},function(Q){Z.L=function(){}; Z.qU(Q)})},Hcz=function(Z){var Q={}; Q.pairingCode=Z.JG;Q.theme=Z.tG;BIz()&&(Q.env_useStageMdx=1);return g.ol(Q)},Mzo=function(Z){return new Promise(function(Q){Z.JG=NIz(); if(Z.Vp){var z=new chrome.cast.DialLaunchResponse(!0,Hcz(Z));Q(z);psX(Z)}else Z.jJ=function(){g.fA(Z.U);Z.jJ=function(){}; Z.U=NaN;var K=new chrome.cast.DialLaunchResponse(!0,Hcz(Z));Q(K);psX(Z)},Z.U=g.$q(function(){Z.jJ()},100)})},OcJ=function(Z,Q,z){Z.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(Q)); var K=new rq(Q);return(new Promise(function(b){UmU(Z,K,function(q){q?(Z.SJ=!0,Ym(Z.W,K),SA(Z,K),L2(Z,z)):g.Ef(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(Q)+" is not online."));b(q)},5)})).then(function(b){return b?new chrome.cast.DialLaunchResponse(!1):Mzo(Z)})},ok$=function(Z,Q){var z=Z.X.receiver.label,K=Z.j.friendlyName; return(new Promise(function(b){h4z(Z.W,z,Q,K,function(q){q&&q.token&&SA(Z,q);b(q)},function(q){$m(Z,"Failed to get DIAL screen: "+q); b(null)})})).then(function(b){return b&&b.token?new chrome.cast.DialLaunchResponse(!1):Mzo(Z)})},UmU=function(Z,Q,z,K){g.fA(Z.K); Z.K=0;nkX(Z.W,Q,function(b){b||K<0?z(b):Z.K=g.$q(function(){UmU(Z,Q,z,K-1)},300)})},L2=function(Z,Q){Z.info("getDialAppInfoWithTimeout_ "+Q); hL(Z)&&(g.fA(Z.T),Z.T=0,Q==0?Brm(Z):Z.T=g.$q(function(){Brm(Z)},Q))},Brm=function(Z){hL(Z)&&Z.S.getDialAppInfo(function(Q){Z.info("getDialAppInfo dialLaunchData: "+JSON.stringify(Q)); Q=Q.extraData||{};var z=null;if(Q.loungeToken){var K;((K=Z.Y)==null?void 0:K.token)==Q.loungeToken&&(z="staleLoungeToken")}else z="missingLoungeToken";z?(Z.P7=z,L2(Z,3E4)):(Z.SJ=!1,Z.P7="unknown",JhX(Z,Q.loungeToken),L2(Z,Q.loungeTokenRefreshIntervalMs))},function(Q){Z.info("getDialAppInfo error: "+Q); Z.P7="noLoungeTokenResponse";L2(Z,3E4)})},WeH=function(Z){g.fA(Z.K); Z.K=0;g.fA(Z.T);Z.T=0;Z.L();Z.L=function(){}; g.fA(Z.U)},n2=function(Z,Q){XI.call(this,Z,Q,"ManualSession"); this.S=g.$q((0,g.EG)(this.WE,this,null),150)},cr=function(Z,Q){g.rV.call(this); this.config_=Q;this.j=Z;this.X=Q.appId||"233637DE";this.W=Q.theme||"cl";this.U=Q.disableCastApi||!1;this.K=Q.forceMirroring||!1;this.Y=null;this.T=!1;this.S=[];this.L=(0,g.EG)(this.dRp,this)},Vzw=function(Z,Q){return Q?g.Fm(Z.S,function(z){return AS(Q,z.label)},Z):null},mA=function(Z){Qg("Controller",Z)},lTz=function(Z){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(Z)},I9=function(Z){return Z.T||!!Z.S.length||!!Z.Y},JL=function(Z,Q,z){Q!=Z.Y&&(g.jR(Z.Y),(Z.Y=Q)?(z?Z.publish("yt-remote-cast2-receiver-resumed", Q.j):Z.publish("yt-remote-cast2-receiver-selected",Q.j),Q.subscribe("sessionScreen",(0,g.EG)(Z.ao,Z,Q)),Q.subscribe("sessionFailed",function(){return kSz(Z,Q)}),Q.Y?Z.publish("yt-remote-cast2-session-change",Q.Y):z&&Z.Y.WE(null)):Z.publish("yt-remote-cast2-session-change",null))},kSz=function(Z,Q){Z.Y==Q&&Z.publish("yt-remote-cast2-session-failed")},ucE=function(Z){var Q=Z.j.B9(),z=Z.Y&&Z.Y.j; Z=g.my(Q,function(K){z&&AS(K,z.label)&&(z=null);var b=K.uuid?K.uuid:K.id,q=Vzw(this,K);q?(q.label=b,q.friendlyName=K.name):(q=new chrome.cast.Receiver(b,K.name),q.receiverType=chrome.cast.ReceiverType.CUSTOM);return q},Z); z&&(z.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(z=new chrome.cast.Receiver(z.label,z.friendlyName),z.receiverType=chrome.cast.ReceiverType.CUSTOM),Z.push(z));return Z},lWz=function(Z,Q,z,K){K.disableCastApi?yg("Cannot initialize because disabled by Mdx config."):xm$()?tzz(Q,K)&&(FeU(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?e4Q(Z,z):(window.__onGCastApiAvailable=function(b,q){b?e4Q(Z,z):(di("Failed to load cast API: "+q),wso(!1),FeU(!1),g.H6("yt-remote-cast-available"),g.H6("yt-remote-cast-receiver"), Ekz(),z(!1))},K.loadCastApiSetupScript?g.AX("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?VtY()>=60&&lPE():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?ttQ():VtY()>=89?ZAm():(E2R(),T8(snE.map(F$U))))):yg("Cannot initialize because not running Chrome")},Ekz=function(){yg("dispose"); var Z=Ng();Z&&Z.dispose();g.BG("yt.mdx.remote.cloudview.instance_",null);sf$(!1);g.qF(Zjm);Zjm.length=0},GW=function(){return!!g.pS("yt-remote-cast-installed")},QfH=function(){var Z=g.pS("yt-remote-cast-receiver"); return Z?Z.friendlyName:null},zkR=function(){yg("clearCurrentReceiver"); g.H6("yt-remote-cast-receiver")},Kpo=function(){return GW()?Ng()?Ng().getCastSession():(di("getCastSelector: Cast is not initialized."),null):(di("getCastSelector: Cast API is not installed!"),null)},bjX=function(){GW()?Ng()?iw()?(yg("Requesting cast selector."),Ng().requestSession()):(yg("Wait for cast API to be ready to request the session."),Zjm.push(g.bm("yt-remote-cast2-api-ready",bjX))):di("requestCastSelector: Cast is not initialized."):di("requestCastSelector: Cast API is not installed!")}, a9=function(Z,Q){iw()?Ng().setConnectedScreenStatus(Z,Q):di("setConnectedScreenStatus called before ready.")},xm$=function(){var Z=g.iU().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.R3||Z},qno=function(Z,Q){Ng().init(Z,Q)},tzz=function(Z,Q){var z=!1; Ng()||(Z=new cr(Z,Q),Z.subscribe("yt-remote-cast2-availability-change",function(K){g.CS("yt-remote-cast-available",K);Sh("yt-remote-cast2-availability-change",K)}),Z.subscribe("yt-remote-cast2-receiver-selected",function(K){yg("onReceiverSelected: "+K.friendlyName); g.CS("yt-remote-cast-receiver",K);Sh("yt-remote-cast2-receiver-selected",K)}),Z.subscribe("yt-remote-cast2-receiver-resumed",function(K){yg("onReceiverResumed: "+K.friendlyName); g.CS("yt-remote-cast-receiver",K);Sh("yt-remote-cast2-receiver-resumed",K)}),Z.subscribe("yt-remote-cast2-session-change",function(K){yg("onSessionChange: "+jh(K)); K||g.H6("yt-remote-cast-receiver");Sh("yt-remote-cast2-session-change",K)}),g.BG("yt.mdx.remote.cloudview.instance_",Z),z=!0); yg("cloudview.createSingleton_: "+z);return z},Ng=function(){return g.WG("yt.mdx.remote.cloudview.instance_")},e4Q=function(Z,Q){wso(!0); FeU(!1);qno(Z,function(z){z?(sf$(!0),g.r1("yt-remote-cast2-api-ready")):(di("Failed to initialize cast API."),wso(!1),g.H6("yt-remote-cast-available"),g.H6("yt-remote-cast-receiver"),Ekz());Q(z)})},yg=function(Z){Qg("cloudview",Z)},di=function(Z){Qg("cloudview",Z)},wso=function(Z){yg("setCastInstalled_ "+Z); g.CS("yt-remote-cast-installed",Z)},iw=function(){return!!g.WG("yt.mdx.remote.cloudview.apiReady_")},sf$=function(Z){yg("setApiReady_ "+Z); g.BG("yt.mdx.remote.cloudview.apiReady_",Z)},FeU=function(Z){g.BG("yt.mdx.remote.cloudview.initializing_",Z)},Pr=function(Z){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.T=0;this.trackData=null;this.C4=this.x3=!1;this.X=this.L=this.Y=this.W=0;this.S=NaN;this.j=!1;this.reset(Z)},rfU=function(Z){Z.audioTrackId=null; Z.trackData=null;Z.playerState=-1;Z.x3=!1;Z.C4=!1;Z.T=0;Z.K=g.sQ();Z.W=0;Z.Y=0;Z.L=0;Z.X=0;Z.S=NaN;Z.j=!1},R9=function(Z){return Z.isPlaying()?(g.sQ()-Z.K)/1E3:0},C2=function(Z,Q){Z.T=Q; Z.K=g.sQ()},p2=function(Z){switch(Z.playerState){case 1:case 1081:return(g.sQ()-Z.K)/1E3+Z.T; case -1E3:return 0}return Z.T},Hr=function(Z,Q,z){var K=Z.videoId; Z.videoId=Q;Z.index=z;Q!=K&&rfU(Z)},Afw=function(Z){var Q={}; Q.index=Z.index;Q.listId=Z.listId;Q.videoId=Z.videoId;Q.playerState=Z.playerState;Q.volume=Z.volume;Q.muted=Z.muted;Q.audioTrackId=Z.audioTrackId;Q.trackData=g.Pa(Z.trackData);Q.hasPrevious=Z.x3;Q.hasNext=Z.C4;Q.playerTime=Z.T;Q.playerTimeAt=Z.K;Q.seekableStart=Z.W;Q.seekableEnd=Z.Y;Q.duration=Z.L;Q.loadedTime=Z.X;Q.liveIngestionTime=Z.S;return Q},Uy=function(Z,Q){g.rV.call(this); var z=this;this.S=0;this.W=Z;this.K=[];this.L=new HSE;this.j=this.Y=null;this.U=(0,g.EG)(this.CaJ,this);this.T=(0,g.EG)(this.qQ,this);this.X=(0,g.EG)(this.AoN,this);this.jJ=(0,g.EG)(this.QTI,this);var K=0;Z?(K=Z.getProxyState(),K!=3&&(Z.subscribe("proxyStateChange",this.JZ,this),jfQ(this))):K=3;K!=0&&(Q?this.JZ(K):g.$q(function(){z.JZ(K)},0)); (Z=Kpo())&&Mg(this,Z);this.subscribe("yt-remote-cast2-session-change",this.jJ)},Oy=function(Z){return new Pr(Z.W.getPlayerContextData())},jfQ=function(Z){g.SB("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(Q){this.K.push(this.W.subscribe(Q,g.lu(this.Wvr,Q),this))},Z)},DQ0=function(Z){g.SB(Z.K,function(Q){this.W.unsubscribeByKey(Q)},Z); Z.K.length=0},o9=function(Z){return Z.getState()==1},Br=function(Z,Q){var z=Z.L; z.Y.length+z.j.length<50&&Z.L.enqueue(Q)},vSz=function(Z,Q,z){var K=Oy(Z); C2(K,z);K.playerState!=-1E3&&(K.playerState=Q);Wr(Z,K)},Vg=function(Z,Q,z){Z.W.sendMessage(Q,z)},Wr=function(Z,Q){DQ0(Z); Z.W.setPlayerContextData(Afw(Q));jfQ(Z)},Mg=function(Z,Q){Z.j&&(Z.j.removeUpdateListener(Z.U),Z.j.removeMediaListener(Z.T),Z.qQ(null)); Z.j=Q;Z.j&&(zW("Setting cast session: "+Z.j.sessionId),Z.j.addUpdateListener(Z.U),Z.j.addMediaListener(Z.T),Z.j.media.length&&Z.qQ(Z.j.media[0]))},gSQ=function(Z){var Q=Z.Y.media,z=Z.Y.customData; if(Q&&z){var K=Oy(Z);Q.contentId!=K.videoId&&zW("Cast changing video to: "+Q.contentId);K.videoId=Q.contentId;K.playerState=z.playerState;C2(K,Z.Y.getEstimatedTime());Wr(Z,K)}else zW("No cast media video. Ignoring state update.")},km=function(Z,Q,z){return(0,g.EG)(function(K){this.xJ("Failed to "+Q+" with cast v2 channel. Error code: "+K.code); K.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.xJ("Retrying "+Q+" using MDx browser channel."),Vg(this,Q,z))},Z)},tL=function(Z,Q,z,K){K=K===void 0?!1:K; g.rV.call(this);var b=this;this.K=NaN;this.JG=!1;this.U=this.X=this.SJ=this.P7=NaN;this.jJ=[];this.L=this.T=this.W=this.Y=this.j=null;this.Vp=Z;this.c7=K;this.jJ.push(g.mC(window,"beforeunload",function(){b.gi(2)})); this.S=[];this.Y=new Pr;this.tG=Q.id;this.KN=Q.idType;this.j=ETz(this.Vp,z,this.Kv,this.KN=="shortLived",this.tG);this.j.listen("channelOpened",function(){Yn0(b)}); this.j.listen("channelClosed",function(){uw("Channel closed");isNaN(b.K)?Yy(!0):Yy();b.dispose()}); this.j.listen("channelError",function(q){Yy();isNaN(b.Nj())?(q==1&&b.KN=="shortLived"&&b.publish("browserChannelAuthError",q),uw("Channel error: "+q+" without reconnection"),b.dispose()):(b.JG=!0,uw("Channel error: "+q+" with reconnection in "+b.Nj()+" ms"),xm(b,2))}); this.j.listen("channelMessage",function(q){XSm(b,q)}); this.j.BJ(Q.token);this.subscribe("remoteQueueChange",function(){var q=b.Y.videoId;g.MW()&&g.CS("yt-remote-session-video-id",q)})},Snz=function(Z){return g.Fm(Z.S,function(Q){return Q.type=="LOUNGE_SCREEN"})},uw=function(Z){Qg("conn",Z)},xm=function(Z,Q){Z.publish("proxyStateChange",Q)},$QU=function(Z){Z.K=g.$q(function(){uw("Connecting timeout"); Z.gi(1)},2E4)},TME=function(Z){g.fA(Z.K); Z.K=NaN},f4$=function(Z){g.fA(Z.P7); Z.P7=NaN},Lpz=function(Z){hk$(Z); Z.SJ=g.$q(function(){FI(Z,"getNowPlaying")},2E4)},hk$=function(Z){g.fA(Z.SJ); Z.SJ=NaN},Yn0=function(Z){uw("Channel opened"); Z.JG&&(Z.JG=!1,f4$(Z),Z.P7=g.$q(function(){uw("Timing out waiting for a screen.");Z.gi(1)},15E3))},cfE=function(Z,Q){var z=null; if(Q){var K=Snz(Z);K&&(z={clientName:K.clientName,deviceMake:K.brand,deviceModel:K.model,osVersion:K.osVersion})}g.BG("yt.mdx.remote.remoteClient_",z);Q&&(TME(Z),f4$(Z));z=Z.j.LQ()&&isNaN(Z.K);Q==z?Q&&(xm(Z,1),FI(Z,"getSubtitlesTrack")):Q?(Z.lL()&&Z.Y.reset(),xm(Z,1),FI(Z,"getNowPlaying"),nSX(Z)):Z.gi(1)},mQw=function(Z,Q){var z=Q.params.videoId; delete Q.params.videoId;z==Z.Y.videoId&&(g.Ne(Q.params)?Z.Y.trackData=null:Z.Y.trackData=Q.params,Z.publish("remotePlayerChange"))},I4w=function(Z,Q,z){var K=Q.params.videoId||Q.params.video_id,b=parseInt(Q.params.currentIndex,10); Z.Y.listId=Q.params.listId||Z.Y.listId;Hr(Z.Y,K,b);Z.publish("remoteQueueChange",z)},yfz=function(Z,Q){Q.params=Q.params||{}; I4w(Z,Q,"NOW_PLAYING_MAY_CHANGE");JfJ(Z,Q);Z.publish("autoplayDismissed")},JfJ=function(Z,Q){var z=parseInt(Q.params.currentTime||Q.params.current_time,10); C2(Z.Y,isNaN(z)?0:z);z=parseInt(Q.params.state,10);z=isNaN(z)?-1:z;z==-1&&Z.Y.playerState==-1E3&&(z=-1E3);Z.Y.playerState=z;z=Number(Q.params.loadedTime);Z.Y.X=isNaN(z)?0:z;Z.Y.bN(Number(Q.params.duration));z=Z.Y;var K=Number(Q.params.liveIngestionTime);z.S=K;z.j=isNaN(K)?!1:!0;z=Z.Y;K=Number(Q.params.seekableStartTime);Q=Number(Q.params.seekableEndTime);z.W=isNaN(K)?0:K;z.Y=isNaN(Q)?0:Q;Z.Y.playerState==1?Lpz(Z):hk$(Z);Z.publish("remotePlayerChange")},dQn=function(Z,Q){if(Z.Y.playerState!=-1E3){var z= 1085; switch(parseInt(Q.params.adState,10)){case 1:z=1081;break;case 2:z=1084;break;case 0:z=1083}Z.Y.playerState=z;Q=parseInt(Q.params.currentTime,10);C2(Z.Y,isNaN(Q)?0:Q);Z.publish("remotePlayerChange")}},NMR=function(Z,Q){var z=Q.params.muted=="true"; Z.Y.volume=parseInt(Q.params.volume,10);Z.Y.muted=z;Z.publish("remotePlayerChange")},Glz=function(Z,Q){Z.T=Q.params.videoId; Z.publish("nowAutoplaying",parseInt(Q.params.timeout,10))},ijE=function(Z,Q){Z.T=Q.params.videoId||null; Z.publish("autoplayUpNext",Z.T)},a4z=function(Z,Q){Z.L=Q.params.autoplayMode; Z.publish("autoplayModeChange",Z.L);Z.L=="DISABLED"&&Z.publish("autoplayDismissed")},PC$=function(Z,Q){var z=Q.params.hasNext=="true"; Z.Y.x3=Q.params.hasPrevious=="true";Z.Y.C4=z;Z.publish("previousNextChange")},XSm=function(Z,Q){Q=Q.message; Q.params?uw("Received: action="+Q.action+", params="+g.yU(Q.params)):uw("Received: action="+Q.action+" {}");switch(Q.action){case "loungeStatus":Q=ZG(Q.params.devices);Z.S=g.my(Q,function(K){return new qJ(K)}); Q=!!g.Fm(Z.S,function(K){return K.type=="LOUNGE_SCREEN"}); cfE(Z,Q);Q=Z.p5("mlm");Z.publish("multiStateLoopEnabled",Q);break;case "loungeScreenDisconnected":g.sm(Z.S,function(K){return K.type=="LOUNGE_SCREEN"}); cfE(Z,!1);break;case "remoteConnected":var z=new qJ(ZG(Q.params.device));g.Fm(Z.S,function(K){return K.Tg(z)})||U7w(Z.S,z); break;case "remoteDisconnected":z=new qJ(ZG(Q.params.device));g.sm(Z.S,function(K){return K.Tg(z)}); break;case "gracefulDisconnect":break;case "playlistModified":I4w(Z,Q,"QUEUE_MODIFIED");break;case "nowPlaying":yfz(Z,Q);break;case "onStateChange":JfJ(Z,Q);break;case "onAdStateChange":dQn(Z,Q);break;case "onVolumeChanged":NMR(Z,Q);break;case "onSubtitlesTrackChanged":mQw(Z,Q);break;case "nowAutoplaying":Glz(Z,Q);break;case "autoplayDismissed":Z.publish("autoplayDismissed");break;case "autoplayUpNext":ijE(Z,Q);break;case "onAutoplayModeChanged":a4z(Z,Q);break;case "onHasPreviousNextChanged":PC$(Z, Q);break;case "requestAssistedSignIn":Z.publish("assistedSignInRequested",Q.params.authCode);break;case "onLoopModeChanged":Z.publish("loopModeChange",Q.params.loopMode);break;default:uw("Unrecognized action: "+Q.action)}},nSX=function(Z){g.fA(Z.U); Z.U=g.$q(function(){Z.gi(1)},864E5)},FI=function(Z,Q,z){z?uw("Sending: action="+Q+", params="+g.yU(z)):uw("Sending: action="+Q); Z.j.sendMessage(Q,z)},Rkn=function(Z){ri.call(this,"ScreenServiceProxy"); this.kE=Z;this.Y=[];this.Y.push(this.kE.$_s("screenChange",(0,g.EG)(this.Tj,this)));this.Y.push(this.kE.$_s("onlineScreenChange",(0,g.EG)(this.XhF,this)))},UQY=function(Z,Q){o2z(); if(!X$||!X$.get("yt-remote-disable-remote-module-for-dev")){Q=g.Ft("MDX_CONFIG")||Q;aPo();pFo();eA||(eA=new l0(Q?Q.loungeApiHost:void 0),BIz()&&(eA.Y="/api/loungedev"));wi||(wi=g.WG("yt.mdx.remote.deferredProxies_")||[],g.BG("yt.mdx.remote.deferredProxies_",wi));CC0();var z=Ey();if(!z){var K=new gi(eA,Q?Q.disableAutomaticScreenCache||!1:!1);g.BG("yt.mdx.remote.screenService_",K);z=Ey();var b={};Q&&(b={appId:Q.appId,disableDial:Q.disableDial,theme:Q.theme,loadCastApiSetupScript:Q.loadCastApiSetupScript, disableCastApi:Q.disableCastApi,enableDialLoungeToken:Q.enableDialLoungeToken,enableCastLoungeToken:Q.enableCastLoungeToken,forceMirroring:Q.forceMirroring});g.BG("yt.mdx.remote.enableConnectWithInitialState_",Q?Q.enableConnectWithInitialState||!1:!1);lWz(Z,K,function(q){q?lw()&&a9(lw(),"YouTube TV"):K.subscribe("onlineScreenChange",function(){Sh("yt-remote-receiver-availability-change")})},b)}Q&&!g.WG("yt.mdx.remote.initialized_")&&(g.BG("yt.mdx.remote.initialized_",!0),sY("Initializing: "+g.yU(Q)), Z$.push(g.bm("yt-remote-cast2-api-ready",function(){Sh("yt-remote-api-ready")})),Z$.push(g.bm("yt-remote-cast2-availability-change",function(){Sh("yt-remote-receiver-availability-change")})),Z$.push(g.bm("yt-remote-cast2-receiver-selected",function(){Qk(null); Sh("yt-remote-auto-connect","cast-selector-receiver")})),Z$.push(g.bm("yt-remote-cast2-receiver-resumed",function(){Sh("yt-remote-receiver-resumed","cast-selector-receiver")})),Z$.push(g.bm("yt-remote-cast2-session-change",pSw)),Z$.push(g.bm("yt-remote-connection-change",function(q){q?a9(lw(),"YouTube TV"):zc()||(a9(null,null),zkR())})),Z$.push(g.bm("yt-remote-cast2-session-failed",function(){Sh("yt-remote-connection-failed")})),Z=Hjo(),Q.isAuto&&(Z.id+="#dial"),b=Q.capabilities||[],g.nA("desktop_enable_autoplay")&& b.push("atp"),b.length>0&&(Z.capabilities=b),Z.name=Q.device,Z.app=Q.app,(Q=Q.theme)&&(Z.theme=Q),sY(" -- with channel params: "+g.yU(Z)),Z?(g.CS("yt-remote-session-app",Z.app),g.CS("yt-remote-session-name",Z.name)):(g.H6("yt-remote-session-app"),g.H6("yt-remote-session-name")),g.BG("yt.mdx.remote.channelParams_",Z),z.start(),lw()||M7z())}},Ojo=function(){var Z=Ey().kE.$_gos(); var Q=KT();Q&&bE()&&(ipX(Z,Q)||Z.push(Q));return GOJ(Z)},BMn=function(){var Z=oSm(); !Z&&GW()&&QfH()&&(Z={key:"cast-selector-receiver",name:QfH()});return Z},oSm=function(){var Z=Ojo(),Q=KT(); Q||(Q=zc());return g.Fm(Z,function(z){return Q&&AS(Q,z.key)?!0:!1})},KT=function(){var Z=lw(); if(!Z)return null;var Q=Ey().hL();return DG(Q,Z)},pSw=function(Z){sY("remote.onCastSessionChange_: "+jh(Z)); if(Z){var Q=KT();if(Q&&Q.id==Z.id){if(a9(Q.id,"YouTube TV"),Z.idType=="shortLived"&&(Z=Z.token))qR&&(qR.token=Z),(Q=bE())&&Q.BJ(Z)}else Q&&re(),AD(Z,1)}else bE()&&re()},re=function(){iw()?Ng().stopSession():di("stopSession called before API ready."); var Z=bE();Z&&(Z.disconnect(1),WpU(null))},V7w=function(){var Z=bE(); return!!Z&&Z.getProxyState()!=3},sY=function(Z){Qg("remote",Z)},Ey=function(){if(!klJ){var Z=g.WG("yt.mdx.remote.screenService_"); klJ=Z?new Rkn(Z):null}return klJ},lw=function(){return g.WG("yt.mdx.remote.currentScreenId_")},u3U=function(Z){g.BG("yt.mdx.remote.currentScreenId_",Z)},xQQ=function(){return g.WG("yt.mdx.remote.connectData_")},Qk=function(Z){g.BG("yt.mdx.remote.connectData_",Z)},bE=function(){return g.WG("yt.mdx.remote.connection_")},WpU=function(Z){var Q=bE(); Qk(null);Z||u3U("");g.BG("yt.mdx.remote.connection_",Z);wi&&(g.SB(wi,function(z){z(Z)}),wi.length=0); Q&&!Z?Sh("yt-remote-connection-change",!1):!Q&&Z&&Sh("yt-remote-connection-change",!0)},zc=function(){var Z=g.MW(); if(!Z)return null;var Q=Ey();if(!Q)return null;Q=Q.hL();return DG(Q,Z)},AD=function(Z,Q){lw(); KT()&&KT();if(jS)qR=Z;else{u3U(Z.id);var z=g.WG("yt.mdx.remote.enableConnectWithInitialState_")||!1;Z=new tL(eA,Z,Hjo(),z);Z.connect(Q,xQQ());Z.subscribe("beforeDisconnect",function(K){Sh("yt-remote-before-disconnect",K)}); Z.subscribe("beforeDispose",function(){bE()&&(bE(),WpU(null))}); Z.subscribe("browserChannelAuthError",function(){var K=KT();K&&K.idType=="shortLived"&&(iw()?Ng().handleBrowserChannelAuthError():di("refreshLoungeToken called before API ready."))}); WpU(Z)}},M7z=function(){var Z=zc(); Z?(sY("Resume connection to: "+jh(Z)),AD(Z,0)):(Yy(),zkR(),sY("Skipping connecting because no session screen found."))},CC0=function(){var Z=Hjo(); if(g.Ne(Z)){Z=gq();var Q=g.pS("yt-remote-session-name")||"",z=g.pS("yt-remote-session-app")||"";Z={device:"REMOTE_CONTROL",id:Z,name:Q,app:z,mdxVersion:3};Z.authuser=String(g.Ft("SESSION_INDEX","0"));(Q=g.Ft("DELEGATED_SESSION_ID"))&&(Z.pageId=String(Q));g.BG("yt.mdx.remote.channelParams_",Z)}},Hjo=function(){return g.WG("yt.mdx.remote.channelParams_")||{}},ekz=function(Z,Q,z){g.O.call(this); var K=this;this.module=Z;this.J=Q;this.uh=z;this.events=new g.M5(this);this.W=!1;this.L=new g.Kg(64);this.Y=new g.E6(this.nx,500,this);this.j=new g.E6(this.FO,1E3,this);this.T=new fk(this.NmN,0,this);this.S={};this.X=new g.E6(this.t7,1E3,this);this.K=new hS(this.seekTo,1E3,this);this.U=this.events.Z(this.J,"onVolumeChange",function(b){t7w(K,b)}); g.W(this,this.events);this.events.Z(Q,"onCaptionsTrackListChanged",this.tpf);this.events.Z(Q,"captionschanged",this.hL7);this.events.Z(Q,"captionssettingschanged",this.DO);this.events.Z(Q,"videoplayerreset",this.wh);this.events.Z(Q,"mdxautoplaycancel",function(){K.uh.lZ()}); Q.V("enable_mdx_video_play_directly")&&this.events.Z(Q,"videodatachange",function(){Fpm(K.module)||D$(K)||vY(K,0)}); Z=this.uh;Z.FI();Z.subscribe("proxyStateChange",this.Z_,this);Z.subscribe("remotePlayerChange",this.i4,this);Z.subscribe("remoteQueueChange",this.wh,this);Z.subscribe("previousNextChange",this.TI,this);Z.subscribe("nowAutoplaying",this.vA,this);Z.subscribe("autoplayDismissed",this.WA,this);g.W(this,this.Y);g.W(this,this.j);g.W(this,this.T);g.W(this,this.X);g.W(this,this.K);this.DO();this.wh();this.i4()},t7w=function(Z,Q){if(D$(Z)){Z.uh.unsubscribe("remotePlayerChange",Z.i4,Z); var z=Math.round(Q.volume);Q=!!Q.muted;var K=Oy(Z.uh);if(z!==K.volume||Q!==K.muted)Z.uh.setVolume(z,Q),Z.X.start();Z.uh.subscribe("remotePlayerChange",Z.i4,Z)}},wSR=function(Z){Z.E8(0); Z.Y.stop();Z.V3(new g.Kg(64))},ESz=function(Z,Q){if(D$(Z)&&!Z.W){var z=null; Q&&(z={style:Z.J.getSubtitlesUserSettings()},Object.assign(z,Q));Z.uh.by(Z.J.getVideoData(1).videoId,z);Z.S=Oy(Z.uh).trackData}},vY=function(Z,Q){var z=Z.J.getPlaylist(); if(z==null?0:z.listId){var K=z.index;var b=z.listId.toString()}z=Z.J.getVideoData(1);Z.uh.playVideo(z.videoId,Q,K,b,z.playerParams,z.KN,Mnm(z));Z.V3(new g.Kg(1))},l4z=function(Z,Q){if(Q){var z=Z.J.getOption("captions","tracklist",{aV:1}); z&&z.length?(Z.J.setOption("captions","track",Q),Z.W=!1):(Z.J.loadModule("captions"),Z.W=!0)}else Z.J.setOption("captions","track",{})},D$=function(Z){return Oy(Z.uh).videoId===Z.J.getVideoData(1).videoId},ge=function(){g.x.call(this,{B:"div", D:"ytp-mdx-popup-dialog",C:{role:"dialog"},G:[{B:"div",D:"ytp-mdx-popup-dialog-inner-content",G:[{B:"div",D:"ytp-mdx-popup-title",W7:"Saliste de tu cuenta"},{B:"div",D:"ytp-mdx-popup-description",W7:"Es posible que los videos que mires se agreguen al historial de reproducciones de la TV, lo que puede influir en las recomendaciones. Para que esto no suceda, presiona \u201cCancelar\u201d y accede a YouTube desde tu computadora."},{B:"div",D:"ytp-mdx-privacy-popup-buttons",G:[{B:"button",nN:["ytp-button", "ytp-mdx-privacy-popup-cancel"],W7:"Cancelar"},{B:"button",nN:["ytp-button","ytp-mdx-privacy-popup-confirm"],W7:"Confirmar"}]}]}]});this.Y=new g.s8(this,250);this.cancelButton=this.Ru("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Ru("ytp-mdx-privacy-popup-confirm");g.W(this,this.Y);this.Z(this.cancelButton,"click",this.j);this.Z(this.confirmButton,"click",this.S)},Yu=function(Z){g.x.call(this,{B:"div", D:"ytp-remote",G:[{B:"div",D:"ytp-remote-display-status",G:[{B:"div",D:"ytp-remote-display-status-icon",G:[g.Xsr()]},{B:"div",D:"ytp-remote-display-status-text",W7:"{{statustext}}"}]}]});this.api=Z;this.Y=new g.s8(this,250);g.W(this,this.Y);this.Z(Z,"presentingplayerstatechange",this.onStateChange);this.Q3(Z.getPlayerStateObject())},XL=function(Z,Q){g.Fk.call(this,"Reproducir en",1,Z,Q); this.J=Z;this.gw={};this.Z(Z,"onMdxReceiversChange",this.W);this.Z(Z,"presentingplayerstatechange",this.W);this.W()},sYR=function(Z){g.Jv.call(this,Z); this.C9={key:NIz(),name:"Esta computadora"};this.f6=null;this.subscriptions=[];this.LT=this.uh=null;this.gw=[this.C9];this.qz=this.C9;this.gf=new g.Kg(64);this.Ja=0;this.Ve=-1;this.Vl=!1;this.Lt=this.wN=null;if(!g.ia(this.player.N())&&!g.HM(this.player.N())){Z=this.player;var Q=g.Dy(Z);Q&&(Q=Q.l7())&&(Q=new XL(Z,Q),g.W(this,Q));Q=new Yu(Z);g.W(this,Q);g.NZ(Z,Q.element,4);this.wN=new ge;g.W(this,this.wN);g.NZ(Z,this.wN.element,4);this.Vl=!!zc()}},SS=function(Z){Z.Lt&&(Z.player.removeEventListener("presentingplayerstatechange", Z.Lt),Z.Lt=null)},Zlo=function(Z,Q,z){Z.gf=z; Z.player.publish("presentingplayerstatechange",new g.gB(z,Q))},$u=function(Z,Q){if(Q.key!==Z.qz.key)if(Q.key===Z.C9.key)re(); else if(Fpm(Z)&&QY0(Z),Z.qz=Q,!Z.player.N().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.HM(Z.player.N())){var z=Z.player.getPlaylistId();var K=Z.player.getVideoData(1);var b=K.videoId;if(!z&&!b||(Z.player.getAppState()===2||Z.player.getAppState()===1)&&Z.player.N().V("should_clear_video_data_on_player_cued_unstarted"))K=null;else{var q=Z.player.getPlaylist();if(q){var r=[];for(var D=0;D2*this.size&&b0(this),!0):!1}; g.A.get=function(Z,Q){return z8(this.j,Z)?this.j[Z]:Q}; g.A.set=function(Z,Q){z8(this.j,Z)||(this.size+=1,this.Y.push(Z),this.DP++);this.j[Z]=Q}; g.A.forEach=function(Z,Q){for(var z=this.jS(),K=0;K=K.Y.length)return g.rN;var q=K.Y[Q++];return g.bA(Z?q:K.j[q])}; return b}; var csX={IHG:"atp",uNf:"ska",q9u:"que",gzY:"mus",rRG:"sus",Zsr:"dsp",PPu:"seq",UNI:"mic",AtY:"dpa",W$p:"cds",S9f:"mlm",hG$:"dsdtr",Jg$:"ntb",B6I:"vsp",W97:"scn",C7Y:"rpe",X8h:"dcn",lHI:"dcp",ozY:"pas",Gu7:"drq",L3g:"opf",giN:"els",wlY:"isg",O$B:"svq",wPu:"mvp",WLr:"ads",Q4r:"iat"},maR={P1g:"u",zG7:"cl",oSI:"k",Ymu:"i",DUG:"cr",W37:"m",F9J:"g",wT:"up"};qJ.prototype.Tg=function(Z){return Z?this.id==Z.id:!1}; var CWo="",X$=null;W$z.prototype.flush=function(Z,Q){Z=Z===void 0?[]:Z;Q=Q===void 0?!1:Q;if(g.nA("enable_client_streamz_web")){Z=g.n(Z);for(var z=Z.next();!z.done;z=Z.next())z=g.D_G(z.value),z={serializedIncrementBatch:g.hj(z.Y())},g.DW("streamzIncremented",z,{sendIsolatedPayload:Q})}}; var $y,wFn=kOY("loadCastFramework")||kOY("loadCastApplicationFramework"),snE=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.ZH(fk,g.O);g.A=fk.prototype;g.A.ws=function(Z){this.W=arguments;this.Y=!1;this.qb?this.S=g.sQ()+this.P8:this.qb=g.cK(this.L,this.P8)}; g.A.stop=function(){this.qb&&(g.OG.clearTimeout(this.qb),this.qb=null);this.S=null;this.Y=!1;this.W=[]}; g.A.pause=function(){++this.j}; g.A.resume=function(){this.j&&(--this.j,!this.j&&this.Y&&(this.Y=!1,this.K.apply(null,this.W)))}; g.A.gr=function(){this.stop();fk.L0.gr.call(this)}; g.A.gs=function(){this.qb&&(g.OG.clearTimeout(this.qb),this.qb=null);this.S?(this.qb=g.cK(this.L,this.S-g.sQ()),this.S=null):this.j?this.Y=!0:(this.Y=!1,this.K.apply(null,this.W))};g.L(hS,g.O);g.A=hS.prototype;g.A.dR=function(Z){this.S=arguments;this.qb||this.j?this.Y=!0:Qnm(this)}; g.A.stop=function(){this.qb&&(g.OG.clearTimeout(this.qb),this.qb=null,this.Y=!1,this.S=null)}; g.A.pause=function(){this.j++}; g.A.resume=function(){this.j--;this.j||!this.Y||this.qb||(this.Y=!1,Qnm(this))}; g.A.gr=function(){g.O.prototype.gr.call(this);this.stop()};Lk.prototype.stringify=function(Z){return g.OG.JSON.stringify(Z,void 0)}; Lk.prototype.parse=function(Z){return g.OG.JSON.parse(Z,void 0)};g.ZH(zKJ,g.P8);g.ZH(KYU,g.P8);var bAE=null;g.ZH(rNU,g.P8);g.ZH(ANE,g.P8);g.ZH(jnX,g.P8);IJ.prototype.debug=function(){}; IJ.prototype.info=function(){}; IJ.prototype.warning=function(){};var TpJ={},$iU={};g.A=JS.prototype;g.A.setTimeout=function(Z){this.qB=Z}; g.A.H3=function(Z){Z=Z.target;var Q=this.Zu;Q&&g.FA(Z)==3?Q.dR():this.Gm(Z)}; g.A.Gm=function(Z){try{if(Z==this.Y)a:{var Q=g.FA(this.Y),z=this.Y.j,K=this.Y.getStatus();if(!(Q<3)&&(Q!=3||this.Y&&(this.j.j||g.ww(this.Y)||g.Ej(this.Y)))){this.c7||Q!=4||z==7||(z==8||K<=0?nk(3):nk(2));LY$(this);var b=this.Y.getStatus();this.gq=b;var q=SSm(this);if(this.K=b==200){if(this.DI&&!this.Du){b:{if(this.Y){var r=g.lq(this.Y,"X-HTTP-Initial-Response");if(r&&!g.IE(r)){var D=r;break b}}D=null}if(Z=D)this.Du=!0,GrH(this,Z);else{this.K=!1;this.L=3;cH(12);dq(this);NJ(this);break a}}if(this.KN){Z= !0;for(var v;!this.c7&&this.T0&&!this.F7&&(this.F7=!0,this.S.zY(this)):(dq(this),NJ(this))}else GrH(this,q);Q==4&&dq(this);this.K&&!this.c7&&(Q==4?nq0(this.S,this):(this.K=!1,yA(this)))}else g.PY4(this.Y),b==400&&q.indexOf("Unknown SID")> 0?(this.L=3,cH(12)):(this.L=0,cH(13)),dq(this),NJ(this)}}}catch(Y){}finally{}}; g.A.cancel=function(){this.c7=!0;dq(this)}; g.A.W3=function(){this.jJ=null;var Z=Date.now();Z-this.CN>=0?(this.tG!=2&&(nk(3),cH(17)),dq(this),this.L=2,NJ(this)):hKX(this,this.CN-Z)}; g.A.getLastError=function(){return this.L}; g.A.bA=function(){return this.Y};aXE.prototype.cancel=function(){this.S=RKQ(this);if(this.j)this.j.cancel(),this.j=null;else if(this.Y&&this.Y.size!==0){for(var Z=g.n(this.Y.values()),Q=Z.next();!Q.done;Q=Z.next())Q.value.cancel();this.Y.clear()}};g.A=UiQ.prototype;g.A.hA=8;g.A.wv=1;g.A.connect=function(Z,Q,z,K){cH(0);this.sA=Z;this.c7=Q||{};z&&K!==void 0&&(this.c7.OSID=z,this.c7.OAID=K);this.Du=this.ih;this.Vp=yNR(this,null,this.sA);PH(this)}; g.A.disconnect=function(){oqH(this);if(this.wv==3){var Z=this.s$++,Q=this.Vp.clone();g.Tp(Q,"SID",this.W);g.Tp(Q,"RID",Z);g.Tp(Q,"TYPE","terminate");pk(this,Q);Z=new JS(this,this.W,Z);Z.tG=2;Z.X=E9(Q.clone());Q=!1;if(g.OG.navigator&&g.OG.navigator.sendBeacon)try{Q=g.OG.navigator.sendBeacon(Z.X.toString(),"")}catch(z){}!Q&&g.OG.Image&&((new Image).src=Z.X,Q=!0);Q||(Z.Y=YSJ(Z.S,null),Z.Y.send(Z.X));Z.P7=Date.now();yA(Z)}xi0(this)}; g.A.Bx=function(){return this.wv==0}; g.A.getState=function(){return this.wv}; g.A.AA=function(Z){if(this.K)if(this.K=null,this.wv==1){if(!Z){this.s$=Math.floor(Math.random()*1E5);Z=this.s$++;var Q=new JS(this,"",Z),z=this.U;this.gq&&(z?(z=g.ae(z),g.Re(z,this.gq)):z=this.gq);this.T!==null||this.CN||(Q.Vp=z,z=null);var K;if(this.Qp)a:{for(var b=K=0;b4096){K=b;break a}if(K===4096||b===this.S.length-1){K=b+1;break a}}K= 1E3}else K=1E3;K=VL0(this,Q,K);b=this.Vp.clone();g.Tp(b,"RID",Z);g.Tp(b,"CVER",22);this.KN&&g.Tp(b,"X-HTTP-Session-Id",this.KN);pk(this,b);z&&(this.CN?K="headers="+g.F5(g.UTG(z))+"&"+K:this.T&&g.nB(b,this.T,z));JNU(this.j,Q);this.Q7&&g.Tp(b,"TYPE","init");this.Qp?(g.Tp(b,"$req",K),g.Tp(b,"SID","null"),Q.DI=!0,gqn(Q,b,null)):gqn(Q,b,K);this.wv=2}}else this.wv==3&&(Z?krn(this,Z):this.S.length==0||PVQ(this.j)||krn(this))}; g.A.qs=function(){this.X=null;uJX(this);if(this.Sp&&!(this.qB||this.Y==null||this.fL<=0)){var Z=2*this.fL;this.JG=mJ((0,g.EG)(this.GWf,this),Z)}}; g.A.GWf=function(){this.JG&&(this.JG=null,this.Du=!1,this.qB=!0,cH(10),i0(this),uJX(this))}; g.A.zY=function(Z){this.Y==Z&&this.Sp&&!this.qB&&(OAz(this),this.qB=!0,cH(11))}; g.A.P3=function(){this.jJ!=null&&(this.jJ=null,i0(this),miH(this),cH(19))}; g.A.LGu=function(Z){Z?cH(2):cH(1)}; g.A.isActive=function(){return!!this.L&&this.L.isActive(this)}; g.A=FYE.prototype;g.A.YG=function(){}; g.A.QK=function(){}; g.A.Ua=function(){}; g.A.Ck=function(){}; g.A.isActive=function(){return!0}; g.A.B3=function(){};g.ZH(MJ,g.wC);MJ.prototype.open=function(){this.Y.L=this.S;this.K&&(this.Y.tG=!0);this.Y.connect(this.L,this.j||void 0)}; MJ.prototype.close=function(){this.Y.disconnect()}; MJ.prototype.send=function(Z){var Q=this.Y;if(typeof Z==="string"){var z={};z.__data__=Z;Z=z}else this.W&&(z={},z.__data__=g.yU(Z),Z=z);Q.S.push(new iAQ(Q.N8++,Z));Q.wv==3&&PH(Q)}; MJ.prototype.gr=function(){this.Y.L=null;delete this.S;this.Y.disconnect();delete this.Y;MJ.L0.gr.call(this)}; g.ZH(wX0,zKJ);g.ZH(Eqm,KYU);g.ZH(HH,FYE);HH.prototype.YG=function(){this.Y.dispatchEvent("m")}; HH.prototype.QK=function(Z){this.Y.dispatchEvent(new wX0(Z))}; HH.prototype.Ua=function(Z){this.Y.dispatchEvent(new Eqm(Z))}; HH.prototype.Ck=function(){this.Y.dispatchEvent("n")};var Ov=new g.wC;g.L(ZSJ,g.P8);g.A=BH.prototype;g.A.q_=null;g.A.k$=!1;g.A.nP=null;g.A.Rh=null;g.A.zv=null;g.A.PF=null;g.A.O2=null;g.A.HF=null;g.A.Cz=null;g.A.rV=null;g.A.BF=0;g.A.Qb=null;g.A.dA=null;g.A.AP=null;g.A.Ka=-1;g.A.UL=!0;g.A.b3=!1;g.A.Bq=0;g.A.WF=null;var rWw={},q7J={};g.A=BH.prototype;g.A.setTimeout=function(Z){this.j=Z}; g.A.J$=function(Z){Z=Z.target;var Q=this.WF;Q&&g.FA(Z)==3?Q.dR():this.It(Z)}; g.A.It=function(Z){try{if(Z==this.rV)a:{var Q=g.FA(this.rV),z=this.rV.j,K=this.rV.getStatus();if(g.Fv&&!g.fG("420+")){if(Q<4)break a}else if(Q<3||Q==3&&!g.ww(this.rV))break a;this.b3||Q!=4||z==7||(z==8||K<=0?this.Y.ND(3):this.Y.ND(2));DWJ(this);var b=this.rV.getStatus();this.Ka=b;var q=g.ww(this.rV);if(this.k$=b==200){Q==4&&WH(this);if(this.KN){for(Z=!0;!this.b3&&this.BF0?(this.AP=3,oJ(13)):(this.AP=0,oJ(14)),WH(this),vTn(this)}}catch(D){}finally{}}; g.A.cancel=function(){this.b3=!0;WH(this)}; g.A.RD=function(){this.nP=null;var Z=Date.now();Z-this.Rh>=0?(this.PF!=2&&this.Y.ND(3),WH(this),this.AP=2,oJ(18),vTn(this)):j7z(this,this.Rh-Z)}; g.A.getLastError=function(){return this.AP};g.A=S7z.prototype;g.A.Ot=null;g.A.kS=null;g.A.DN=!1;g.A.Km=null;g.A.Fo=null;g.A.lN=-1;g.A.RJ=null;g.A.kI=null;g.A.connect=function(Z){this.Km=Z;Z=ky(this.Y,null,this.Km);oJ(3);Date.now();var Q=this.Y.U;Q!=null?(this.RJ=Q[0],(this.kI=Q[1])?(this.Fo=1,$WH(this)):(this.Fo=2,Tto(this))):(lF(Z,"MODE","init"),this.kS=new BH(this),this.kS.q_=this.Ot,KCH(this.kS,Z,!1,null,!0),this.Fo=0)}; g.A.Td=function(Z){if(Z)this.Fo=2,Tto(this);else{oJ(4);var Q=this.Y;Q.UK=Q.GU.lN;eh(Q,9)}Z&&this.ND(2)}; g.A.Jv=function(Z){return this.Y.Jv(Z)}; g.A.abort=function(){this.kS&&(this.kS.cancel(),this.kS=null);this.lN=-1}; g.A.Bx=function(){return!1}; g.A.j4=function(Z,Q){this.lN=Z.Ka;if(this.Fo==0)if(Q){try{var z=this.j.parse(Q)}catch(K){Z=this.Y;Z.UK=this.lN;eh(Z,2);return}this.RJ=z[0];this.kI=z[1]}else Z=this.Y,Z.UK=this.lN,eh(Z,2);else this.Fo==2&&(this.DN?(oJ(7),Date.now()):Q=="11111"?(oJ(6),this.DN=!0,Date.now(),this.lN=200,this.kS.cancel(),oJ(12),u0(this.Y,this,!0)):(oJ(8),Date.now(),this.DN=!1))}; g.A.bW=function(){this.lN=this.kS.Ka;if(this.kS.k$)this.Fo==0?this.kI?(this.Fo=1,$WH(this)):(this.Fo=2,Tto(this)):this.Fo==2&&(this.DN?(oJ(12),u0(this.Y,this,!0)):(oJ(11),u0(this.Y,this,!1)));else{this.Fo==0?oJ(9):this.Fo==2&&oJ(10);var Z=this.Y;this.kS.getLastError();Z.UK=this.lN;eh(Z,2)}}; g.A.La=function(){return this.Y.La()}; g.A.isActive=function(){return this.Y.isActive()}; g.A.ND=function(Z){this.Y.ND(Z)};g.A=fTz.prototype;g.A.cP=null;g.A.Vx=null;g.A.Zc=null;g.A.KK=null;g.A.Lm=null;g.A.J1=null;g.A.iy=null;g.A.zL=null;g.A.Fb=0;g.A.bj=0;g.A.Qe=null;g.A.oe=null;g.A.Gw=null;g.A.QB=null;g.A.GU=null;g.A.Nq=null;g.A.rk=-1;g.A.S4=-1;g.A.UK=-1;g.A.cK=0;g.A.FS=0;g.A.UD=8;g.ZH(LCQ,g.P8);g.ZH(nTQ,g.P8);g.A=fTz.prototype;g.A.connect=function(Z,Q,z,K,b){oJ(0);this.Lm=Q;this.Vx=z||{};K&&b!==void 0&&(this.Vx.OSID=K,this.Vx.OAID=b);this.X?(Uv((0,g.EG)(this.tI,this,Z),100),mWz(this)):this.tI(Z)}; g.A.disconnect=function(){ITz(this);if(this.Y==3){var Z=this.Fb++,Q=this.J1.clone();g.Tp(Q,"SID",this.W);g.Tp(Q,"RID",Z);g.Tp(Q,"TYPE","terminate");F$(this,Q);Z=new BH(this,this.W,Z);Z.PF=2;Z.O2=E9(Q.clone());(new Image).src=Z.O2.toString();Z.zv=Date.now();bSw(Z)}Cbz(this)}; g.A.tI=function(Z){this.GU=new S7z(this);this.GU.Ot=this.cP;this.GU.j=this.L;this.GU.connect(Z)}; g.A.Bx=function(){return this.Y==0}; g.A.getState=function(){return this.Y}; g.A.g9=function(Z){this.oe=null;GMz(this,Z)}; g.A.w9=function(){this.Gw=null;this.KK=new BH(this,this.W,"rpc",this.T);this.KK.q_=this.cP;this.KK.Bq=0;var Z=this.iy.clone();g.Tp(Z,"RID","rpc");g.Tp(Z,"SID",this.W);g.Tp(Z,"CI",this.Nq?"0":"1");g.Tp(Z,"AID",this.rk);F$(this,Z);g.Tp(Z,"TYPE","xmlhttp");KCH(this.KK,Z,!0,this.zL,!1)}; g.A.j4=function(Z,Q){if(this.Y!=0&&(this.KK==Z||this.Zc==Z))if(this.UK=Z.Ka,this.Zc==Z&&this.Y==3)if(this.UD>7){try{var z=this.L.parse(Q)}catch(K){z=null}if(Array.isArray(z)&&z.length==3)if(Z=z,Z[0]==0)a:{if(!this.Gw){if(this.KK)if(this.KK.zv+3E30)){if(K=Q==1)this.Zc||this.oe||this.Y==1||this.cK>=2?K=!1:(this.oe=Uv((0,g.EG)(this.g9,this,Z),aT$(this,this.cK)),this.cK++,K=!0);K=!(K||Q==2&&PbR(this))}if(K)switch(z){case 1:eh(this, 5);break;case 4:eh(this,10);break;case 3:eh(this,6);break;case 7:eh(this,12);break;default:eh(this,2)}}}; g.A.OO=function(Z){if(!g.wX(arguments,this.Y))throw Error("Unexpected channel state: "+this.Y);}; g.A.zD7=function(Z){Z?oJ(2):(oJ(1),RgR(this,8))}; g.A.Jv=function(Z){if(Z)throw Error("Can't create secondary domain capable XhrIo object.");Z=new g.uq;Z.T=!1;return Z}; g.A.isActive=function(){return!!this.Qe&&this.Qe.isActive(this)}; g.A.ND=function(Z){var Q=Ov;Q.dispatchEvent(new nTQ(Q,Z))}; g.A.La=function(){return!1}; g.A=p60.prototype;g.A.P9=function(){}; g.A.H9=function(){}; g.A.W9=function(){}; g.A.VT=function(){}; g.A.d9=function(){return{}}; g.A.isActive=function(){return!0};g.A=HSE.prototype;g.A.enqueue=function(Z){this.j.push(Z)}; g.A.isEmpty=function(){return this.Y.length===0&&this.j.length===0}; g.A.clear=function(){this.Y=[];this.j=[]}; g.A.contains=function(Z){return g.wX(this.Y,Z)||g.wX(this.j,Z)}; g.A.remove=function(Z){var Q=this.Y;var z=(0,g.pYG)(Q,Z);z>=0?(g.EQ(Q,z),Q=!0):Q=!1;return Q||g.lU(this.j,Z)}; g.A.hg=function(){for(var Z=[],Q=this.Y.length-1;Q>=0;--Q)Z.push(this.Y[Q]);Q=this.j.length;for(var z=0;z=zNJ.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(Z=zNJ[this.j],this.qb=g.$q((0,g.EG)(this.R_,this),Z),this.j++):this.publish("pairingFailed",Error("Server error "+Z.status))}; g.A.Fa=function(){this.Y=null;this.publish("pairingFailed",Error("Server not responding"))}; var zNJ=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.ZH(jA,ri);g.A=jA.prototype;g.A.start=function(){AL(this)&&this.publish("screenChange");!g.pS("yt-remote-lounge-token-expiration")&&DmE(this);g.fA(this.Y);this.Y=g.$q((0,g.EG)(this.start,this),1E4)}; g.A.add=function(Z,Q){AL(this);qIQ(this,Z);Dv(this,!1);this.publish("screenChange");Q(Z);Z.token||DmE(this)}; g.A.remove=function(Z,Q){var z=AL(this);Ahz(this,Z)&&(Dv(this,!1),z=!0);Q(Z);z&&this.publish("screenChange")}; g.A.aO=function(Z,Q,z,K){var b=AL(this),q=this.get(Z.id);q?(q.name!=Q&&(q.name=Q,Dv(this,!1),b=!0),z(Z)):K(Error("no such local screen."));b&&this.publish("screenChange")}; g.A.gr=function(){g.fA(this.Y);jA.L0.gr.call(this)}; g.A.Qn=function(Z){AL(this);var Q=this.screens.length;Z=Z&&Z.screens||[];for(var z=Z.length,K=0;K20)break a;D=Q(q,r)}q=D}b.name=q}z(Ym(this,b))},this), onError:(0,g.EG)(function(b){K(Error("pairing request failed: "+b.status))},this), onTimeout:(0,g.EG)(function(){K(Error("pairing request timed out."))},this)})}; g.A.gr=function(){g.jR(this.j);g.jR(this.Y);gi.L0.gr.call(this)}; g.A.HN7=function(){cho(this);this.publish("screenChange");this.Y.update()}; gi.prototype.dispose=gi.prototype.dispose;g.ZH(XI,g.rV);g.A=XI.prototype;g.A.qU=function(Z){this.FI()||(Z&&($m(this,""+Z),this.publish("sessionFailed")),this.Y=null,this.publish("sessionScreen",null))}; g.A.info=function(Z){Qg(this.KN,Z)}; g.A.JK=function(){return null}; g.A.H1=function(Z){var Q=this.j;Z?(Q.displayStatus=new chrome.cast.ReceiverDisplayStatus(Z,[]),Q.displayStatus.showStop=!0):Q.displayStatus=null;chrome.cast.setReceiverDisplayStatus(Q,(0,g.EG)(function(){this.info("Updated receiver status for "+Q.friendlyName+": "+Z)},this),(0,g.EG)(function(){$m(this,"Failed to update receiver status for: "+Q.friendlyName)},this))}; g.A.gr=function(){this.H1("");XI.L0.gr.call(this)};g.L(TW,XI);g.A=TW.prototype;g.A.gQ=function(Z){if(this.S){if(this.S==Z)return;$m(this,"Overriding cast session with new session object");CQE(this);this.P7=!1;this.U="unknown";this.S.removeUpdateListener(this.SJ);this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.JG)}this.S=Z;this.S.addUpdateListener(this.SJ);this.S.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.JG);GSQ(this,"getMdxSessionStatus")}; g.A.WE=function(Z){this.info("launchWithParams no-op for Cast: "+g.yU(Z))}; g.A.stop=function(){this.S?this.S.stop((0,g.EG)(function(){this.qU()},this),(0,g.EG)(function(){this.qU(Error("Failed to stop receiver app."))},this)):this.qU(Error("Stopping cast device without session."))}; g.A.H1=function(){}; g.A.gr=function(){this.info("disposeInternal");CQE(this);this.S&&(this.S.removeUpdateListener(this.SJ),this.S.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.JG));this.S=null;XI.prototype.gr.call(this)}; g.A.Jjh=function(Z,Q){if(!this.FI())if(Q)if(Q=ZG(Q),g.tn(Q))switch(Z=""+Q.type,Q=Q.data||{},this.info("onYoutubeMessage_: "+Z+" "+g.yU(Q)),Z){case "mdxSessionStatus":yho(this,Q);break;case "loungeToken":icX(this,Q);break;default:$m(this,"Unknown youtube message: "+Z)}else $m(this,"Unable to parse message.");else $m(this,"No data in message.")}; g.A.U3=function(Z,Q,z,K){g.fA(this.X);this.X=0;h4z(this.W,this.j.label,Z,this.j.friendlyName,(0,g.EG)(function(b){b?Q(b):K>=0?($m(this,"Screen "+Z+" appears to be offline. "+K+" retries left."),this.X=g.$q((0,g.EG)(this.U3,this,Z,Q,z,K-1),300)):z(Error("Unable to fetch screen."))},this),z)}; g.A.JK=function(){return this.S}; g.A.uj=function(Z){this.FI()||Z||($m(this,"Cast session died."),this.qU())};g.L(f2,XI);g.A=f2.prototype;g.A.gQ=function(Z){this.S=Z;this.S.addUpdateListener(this.c7)}; g.A.WE=function(Z){this.Vp=Z;this.jJ()}; g.A.stop=function(){WeH(this);this.S?this.S.stop((0,g.EG)(this.qU,this,null),(0,g.EG)(this.qU,this,"Failed to stop DIAL device.")):this.qU()}; g.A.gr=function(){WeH(this);this.S&&this.S.removeUpdateListener(this.c7);this.S=null;XI.prototype.gr.call(this)}; g.A.t$=function(Z){this.FI()||Z||($m(this,"DIAL session died."),this.L(),this.L=function(){},this.qU())};g.L(n2,XI);n2.prototype.stop=function(){this.qU()}; n2.prototype.gQ=function(){}; n2.prototype.WE=function(){g.fA(this.S);this.S=NaN;var Z=DG(this.W.hL(),this.j.label);Z?SA(this,Z):this.qU(Error("No such screen"))}; n2.prototype.gr=function(){g.fA(this.S);this.S=NaN;XI.prototype.gr.call(this)};g.L(cr,g.rV);g.A=cr.prototype; g.A.init=function(Z,Q){chrome.cast.timeout.requestSession=3E4;var z=new chrome.cast.SessionRequest(this.X,[chrome.cast.Capability.AUDIO_OUT]);g.nA("desktop_enable_cast_connect")&&(z.androidReceiverCompatible=!0);this.U||(z.dialRequest=new chrome.cast.DialRequest("YouTube"));var K=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;Z=Z||this.K?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var b=(0,g.EG)(this.JHr,this);z=new chrome.cast.ApiConfig(z,(0,g.EG)(this.eI, this),b,K,Z);z.customDialLaunchCallback=(0,g.EG)(this.gdN,this);chrome.cast.initialize(z,(0,g.EG)(function(){this.FI()||(chrome.cast.addReceiverActionListener(this.L),QwY(),this.j.subscribe("onlineScreenChange",(0,g.EG)(this.Oo,this)),this.S=ucE(this),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.EG)(function(q){this.xJ("Failed to set initial custom receivers: "+g.yU(q))},this)),this.publish("yt-remote-cast2-availability-change",I9(this)),Q(!0))},this),(0,g.EG)(function(q){this.xJ("Failed to initialize API: "+ g.yU(q)); Q(!1)},this))}; g.A.Tpf=function(Z,Q){mA("Setting connected screen ID: "+Z+" -> "+Q);if(this.Y){var z=this.Y.Y;if(!Z||z&&z.id!=Z)mA("Unsetting old screen status: "+this.Y.j.friendlyName),JL(this,null)}if(Z&&Q){if(!this.Y){Z=DG(this.j.hL(),Z);if(!Z){mA("setConnectedScreenStatus: Unknown screen.");return}if(Z.idType=="shortLived"){mA("setConnectedScreenStatus: Screen with id type to be short lived.");return}z=Vzw(this,Z);z||(mA("setConnectedScreenStatus: Connected receiver not custom..."),z=new chrome.cast.Receiver(Z.uuid? Z.uuid:Z.id,Z.name),z.receiverType=chrome.cast.ReceiverType.CUSTOM,this.S.push(z),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.EG)(function(K){this.xJ("Failed to set initial custom receivers: "+g.yU(K))},this))); mA("setConnectedScreenStatus: new active receiver: "+z.friendlyName);JL(this,new n2(this.j,z),!0)}this.Y.H1(Q)}else mA("setConnectedScreenStatus: no screen.")}; g.A.M$7=function(Z){this.FI()?this.xJ("Setting connection data on disposed cast v2"):this.Y?this.Y.WE(Z):this.xJ("Setting connection data without a session")}; g.A.fD=function(){this.FI()?this.xJ("Stopping session on disposed cast v2"):this.Y?(this.Y.stop(),JL(this,null)):mA("Stopping non-existing session")}; g.A.requestSession=function(){chrome.cast.requestSession((0,g.EG)(this.eI,this),(0,g.EG)(this.eou,this))}; g.A.gr=function(){this.j.unsubscribe("onlineScreenChange",(0,g.EG)(this.Oo,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.L);var Z=lTz,Q=g.WG("yt.mdx.remote.debug.handlers_");g.lU(Q||[],Z);g.jR(this.Y);g.rV.prototype.gr.call(this)}; g.A.xJ=function(Z){Qg("Controller",Z)}; g.A.ao=function(Z,Q){this.Y==Z&&(Q||JL(this,null),this.publish("yt-remote-cast2-session-change",Q))}; g.A.dRp=function(Z,Q){if(!this.FI())if(Z)switch(Z.friendlyName=chrome.cast.unescape(Z.friendlyName),mA("onReceiverAction_ "+Z.label+" / "+Z.friendlyName+"-- "+Q),Q){case chrome.cast.ReceiverAction.CAST:if(this.Y)if(this.Y.j.label!=Z.label)mA("onReceiverAction_: Stopping active receiver: "+this.Y.j.friendlyName),this.Y.stop();else{mA("onReceiverAction_: Casting to active receiver.");this.Y.Y&&this.publish("yt-remote-cast2-session-change",this.Y.Y);break}switch(Z.receiverType){case chrome.cast.ReceiverType.CUSTOM:JL(this, new n2(this.j,Z));break;case chrome.cast.ReceiverType.DIAL:JL(this,new f2(this.j,Z,this.W,this.config_));break;case chrome.cast.ReceiverType.CAST:JL(this,new TW(this.j,Z,this.config_));break;default:this.xJ("Unknown receiver type: "+Z.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Y&&this.Y.j.label==Z.label?this.Y.stop():this.xJ("Stopping receiver w/o session: "+Z.friendlyName)}else this.xJ("onReceiverAction_ called without receiver.")}; g.A.gdN=function(Z){if(this.FI())return Promise.reject(Error("disposed"));var Q=Z.receiver;Q.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.xJ("Not DIAL receiver: "+Q.friendlyName),Q.receiverType=chrome.cast.ReceiverType.DIAL);var z=this.Y?this.Y.j:null;if(!z||z.label!=Q.label)return this.xJ("Receiving DIAL launch request for non-clicked DIAL receiver: "+Q.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(z&&z.label==Q.label&&z.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Y.Y)return mA("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Y.Y),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.xJ('Changing CAST intent from "'+z.receiverType+'" to "dial" for '+Q.friendlyName);JL(this,new f2(this.j,Q,this.W,this.config_))}Q=this.Y;Q.X=Z;Q.X.appState==chrome.cast.DialAppState.RUNNING?(Z=Q.X.extraData||{},z=Z.screenId||null,hL(Q)&&Z.loungeToken?Z.loungeTokenRefreshIntervalMs?Z=OcJ(Q,{name:Q.j.friendlyName,screenId:Z.screenId,loungeToken:Z.loungeToken,dialId:Q.X.receiver.label, screenIdType:"shortLived"},Z.loungeTokenRefreshIntervalMs):(g.Ef(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(Z)+".")),Z=ok$(Q,z)):Z=ok$(Q,z)):Z=Mzo(Q);return Z}; g.A.eI=function(Z){var Q=this;if(!this.FI()&&!this.K){mA("New cast session ID: "+Z.sessionId);var z=Z.receiver;if(z.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Y)if(z.receiverType==chrome.cast.ReceiverType.CAST)mA("Got resumed cast session before resumed mdx connection."),z.friendlyName=chrome.cast.unescape(z.friendlyName),JL(this,new TW(this.j,z,this.config_),!0);else{this.xJ("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var K=this.Y.j,b=DG(this.j.hL(), K.label);b&&AS(b,z.label)&&K.receiverType!=chrome.cast.ReceiverType.CAST&&z.receiverType==chrome.cast.ReceiverType.CAST&&(mA("onSessionEstablished_: manual to cast session change "+z.friendlyName),g.jR(this.Y),this.Y=new TW(this.j,z,this.config_),this.Y.subscribe("sessionScreen",(0,g.EG)(this.ao,this,this.Y)),this.Y.subscribe("sessionFailed",function(){return kSz(Q,Q.Y)}),this.Y.WE(null)); this.Y.gQ(Z)}}}; g.A.oD=function(){return this.Y?this.Y.JK():null}; g.A.eou=function(Z){this.FI()||(this.xJ("Failed to estabilish a session: "+g.yU(Z)),Z.code!=chrome.cast.ErrorCode.CANCEL&&JL(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.A.JHr=function(Z){mA("Receiver availability updated: "+Z);if(!this.FI()){var Q=I9(this);this.T=Z==chrome.cast.ReceiverAvailability.AVAILABLE;I9(this)!=Q&&this.publish("yt-remote-cast2-availability-change",I9(this))}}; g.A.Oo=function(){this.FI()||(this.S=ucE(this),mA("Updating custom receivers: "+g.yU(this.S)),chrome.cast.setCustomReceivers(this.S,function(){},(0,g.EG)(function(){this.xJ("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",I9(this)))}; cr.prototype.setLaunchParams=cr.prototype.M$7;cr.prototype.setConnectedScreenStatus=cr.prototype.Tpf;cr.prototype.stopSession=cr.prototype.fD;cr.prototype.getCastSession=cr.prototype.oD;cr.prototype.requestSession=cr.prototype.requestSession;cr.prototype.init=cr.prototype.init;cr.prototype.dispose=cr.prototype.dispose;var Zjm=[];g.A=Pr.prototype; g.A.reset=function(Z){this.listId="";this.index=-1;this.videoId="";rfU(this);this.volume=-1;this.muted=!1;Z&&(this.index=Z.index,this.listId=Z.listId,this.videoId=Z.videoId,this.playerState=Z.playerState,this.volume=Z.volume,this.muted=Z.muted,this.audioTrackId=Z.audioTrackId,this.trackData=Z.trackData,this.x3=Z.hasPrevious,this.C4=Z.hasNext,this.T=Z.playerTime,this.K=Z.playerTimeAt,this.W=Z.seekableStart,this.Y=Z.seekableEnd,this.L=Z.duration,this.X=Z.loadedTime,this.S=Z.liveIngestionTime,this.j= !isNaN(this.S))}; g.A.isPlaying=function(){return this.playerState==1}; g.A.isBuffering=function(){return this.playerState==3}; g.A.sR=function(){return this.playerState==1081}; g.A.bN=function(Z){this.L=isNaN(Z)?0:Z}; g.A.getDuration=function(){return this.j?this.L+R9(this):this.L}; g.A.clone=function(){return new Pr(Afw(this))};g.L(Uy,g.rV);g.A=Uy.prototype;g.A.getState=function(){return this.S}; g.A.Rr=function(){return this.W.getReconnectTimeout()}; g.A.c_=function(){this.W.reconnect()}; g.A.play=function(){o9(this)?(this.Y?this.Y.play(null,g.DS,km(this,"play")):Vg(this,"play"),vSz(this,1,p2(Oy(this))),this.publish("remotePlayerChange")):Br(this,this.play)}; g.A.pause=function(){o9(this)?(this.Y?this.Y.pause(null,g.DS,km(this,"pause")):Vg(this,"pause"),vSz(this,2,p2(Oy(this))),this.publish("remotePlayerChange")):Br(this,this.pause)}; g.A.seekTo=function(Z){if(o9(this)){if(this.Y){var Q=Oy(this),z=new chrome.cast.media.SeekRequest;z.currentTime=Z;Q.isPlaying()||Q.isBuffering()?z.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:z.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Y.seek(z,g.DS,km(this,"seekTo",{newTime:Z}))}else Vg(this,"seekTo",{newTime:Z});vSz(this,3,Z);this.publish("remotePlayerChange")}else Br(this,g.lu(this.seekTo,Z))}; g.A.stop=function(){if(o9(this)){this.Y?this.Y.stop(null,g.DS,km(this,"stopVideo")):Vg(this,"stopVideo");var Z=Oy(this);Z.index=-1;Z.videoId="";rfU(Z);Wr(this,Z);this.publish("remotePlayerChange")}else Br(this,this.stop)}; g.A.setVolume=function(Z,Q){if(o9(this)){var z=Oy(this);if(this.j){if(z.volume!=Z){var K=Math.round(Z)/100;this.j.setReceiverVolumeLevel(K,(0,g.EG)(function(){zW("set receiver volume: "+K)},this),(0,g.EG)(function(){this.xJ("failed to set receiver volume.")},this))}z.muted!=Q&&this.j.setReceiverMuted(Q,(0,g.EG)(function(){zW("set receiver muted: "+Q)},this),(0,g.EG)(function(){this.xJ("failed to set receiver muted.")},this))}else{var b={volume:Z, muted:Q};z.volume!=-1&&(b.delta=Z-z.volume);Vg(this,"setVolume",b)}z.muted=Q;z.volume=Z;Wr(this,z)}else Br(this,g.lu(this.setVolume,Z,Q))}; g.A.by=function(Z,Q){if(o9(this)){var z=Oy(this);Z={videoId:Z};Q&&(z.trackData={trackName:Q.name,languageCode:Q.languageCode,sourceLanguageCode:Q.translationLanguage?Q.translationLanguage.languageCode:"",languageName:Q.languageName,kind:Q.kind},Z.style=g.yU(Q.style),g.Re(Z,z.trackData));Vg(this,"setSubtitlesTrack",Z);Wr(this,z)}else Br(this,g.lu(this.by,Z,Q))}; g.A.setAudioTrack=function(Z,Q){o9(this)?(Q=Q.getLanguageInfo().getId(),Vg(this,"setAudioTrack",{videoId:Z,audioTrackId:Q}),Z=Oy(this),Z.audioTrackId=Q,Wr(this,Z)):Br(this,g.lu(this.setAudioTrack,Z,Q))}; g.A.playVideo=function(Z,Q,z,K,b,q,r){K=K===void 0?null:K;b=b===void 0?null:b;q=q===void 0?null:q;r=r===void 0?null:r;var D=Oy(this),v={videoId:Z};z!==void 0&&(v.currentIndex=z);Hr(D,Z,z||0);Q!==void 0&&(C2(D,Q),v.currentTime=Q);K&&(v.listId=K);b&&(v.playerParams=b);q&&(v.clickTrackingParams=q);r&&(v.locationInfo=g.yU(r));Vg(this,"setPlaylist",v);K||Wr(this,D)}; g.A.uS=function(Z,Q){if(o9(this)){if(Z&&Q){var z=Oy(this);Hr(z,Z,Q);Wr(this,z)}Vg(this,"previous")}else Br(this,g.lu(this.uS,Z,Q))}; g.A.nextVideo=function(Z,Q){if(o9(this)){if(Z&&Q){var z=Oy(this);Hr(z,Z,Q);Wr(this,z)}Vg(this,"next")}else Br(this,g.lu(this.nextVideo,Z,Q))}; g.A.fY=function(){if(o9(this)){Vg(this,"clearPlaylist");var Z=Oy(this);Z.reset();Wr(this,Z);this.publish("remotePlayerChange")}else Br(this,this.fY)}; g.A.lZ=function(){o9(this)?Vg(this,"dismissAutoplay"):Br(this,this.lZ)}; g.A.dispose=function(){if(this.S!=3){var Z=this.S;this.S=3;this.publish("proxyStateChange",Z,this.S)}g.rV.prototype.dispose.call(this)}; g.A.gr=function(){DQ0(this);this.W=null;this.L.clear();Mg(this,null);g.rV.prototype.gr.call(this)}; g.A.JZ=function(Z){if((Z!=this.S||Z==2)&&this.S!=3&&Z!=0){var Q=this.S;this.S=Z;this.publish("proxyStateChange",Q,Z);if(Z==1)for(;!this.L.isEmpty();)Q=Z=this.L,Q.Y.length===0&&(Q.Y=Q.j,Q.Y.reverse(),Q.j=[]),Z.Y.pop().apply(this);else Z==3&&this.dispose()}}; g.A.Wvr=function(Z,Q){this.publish(Z,Q)}; g.A.CaJ=function(Z){if(!Z)this.qQ(null),Mg(this,null);else if(this.j.receiver.volume){Z=this.j.receiver.volume;var Q=Oy(this),z=Math.round(100*Z.level||0);if(Q.volume!=z||Q.muted!=Z.muted)zW("Cast volume update: "+Z.level+(Z.muted?" muted":"")),Q.volume=z,Q.muted=!!Z.muted,Wr(this,Q)}}; g.A.qQ=function(Z){zW("Cast media: "+!!Z);this.Y&&this.Y.removeUpdateListener(this.X);if(this.Y=Z)this.Y.addUpdateListener(this.X),gSQ(this),this.publish("remotePlayerChange")}; g.A.AoN=function(Z){Z?(gSQ(this),this.publish("remotePlayerChange")):this.qQ(null)}; g.A.C1=function(){Vg(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.A.QTI=function(){var Z=Kpo();Z&&Mg(this,Z)}; g.A.xJ=function(Z){Qg("CP",Z)};g.L(tL,g.rV);g.A=tL.prototype; g.A.connect=function(Z,Q){if(Q){var z=Q.listId,K=Q.videoId,b=Q.videoIds,q=Q.playerParams,r=Q.clickTrackingParams,D=Q.index,v={videoId:K},Y=Q.currentTime,X=Q.locationInfo;Q=Q.loopMode;Y!==void 0&&(v.currentTime=Y<=5?0:Y);q&&(v.playerParams=q);X&&(v.locationInfo=X);r&&(v.clickTrackingParams=r);z&&(v.listId=z);b&&b.length>0&&(v.videoIds=b.join(","));D!==void 0&&(v.currentIndex=D);this.c7&&(v.loopMode=Q||"LOOP_MODE_OFF");z&&(this.Y.listId=z);this.Y.videoId=K;this.Y.index=D||0;this.Y.state=3;C2(this.Y, Y);this.L="UNSUPPORTED";z=this.c7?"setInitialState":"setPlaylist";uw("Connecting with "+z+" and params: "+g.yU(v));this.j.connect({method:z,params:g.yU(v)},Z,Hpo())}else uw("Connecting without params"),this.j.connect({},Z,Hpo());$QU(this)}; g.A.BJ=function(Z){this.j.BJ(Z)}; g.A.dispose=function(){this.FI()||(g.BG("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),xm(this,3));g.rV.prototype.dispose.call(this)}; g.A.gr=function(){TME(this);hk$(this);f4$(this);g.fA(this.X);this.X=NaN;g.fA(this.U);this.U=NaN;this.W=null;g.I7(this.jJ);this.jJ.length=0;this.j.dispose();g.rV.prototype.gr.call(this);this.L=this.T=this.S=this.Y=this.j=null}; g.A.p5=function(Z){if(!this.S||this.S.length===0)return!1;for(var Q=g.n(this.S),z=Q.next();!z.done;z=Q.next())if(!z.value.capabilities.has(Z))return!1;return!0}; g.A.xW=function(){var Z=3;this.FI()||(Z=0,isNaN(this.Nj())?this.j.LQ()&&isNaN(this.K)&&(Z=1):Z=2);return Z}; g.A.gi=function(Z){uw("Disconnecting with "+Z);g.BG("yt.mdx.remote.remoteClient_",null);TME(this);this.publish("beforeDisconnect",Z);Z==1&&Yy();this.j.disconnect(Z);this.dispose()}; g.A.rF=function(){var Z=this.Y;this.W&&(Z=this.Y.clone(),Hr(Z,this.W,Z.index));return Afw(Z)}; g.A.aiY=function(Z){var Q=this,z=new Pr(Z);z.videoId&&z.videoId!=this.Y.videoId&&(this.W=z.videoId,g.fA(this.X),this.X=g.$q(function(){if(Q.W){var b=Q.W;Q.W=null;Q.Y.videoId!=b&&FI(Q,"getNowPlaying")}},5E3)); var K=[];this.Y.listId==z.listId&&this.Y.videoId==z.videoId&&this.Y.index==z.index||K.push("remoteQueueChange");this.Y.playerState==z.playerState&&this.Y.volume==z.volume&&this.Y.muted==z.muted&&p2(this.Y)==p2(z)&&g.yU(this.Y.trackData)==g.yU(z.trackData)||K.push("remotePlayerChange");this.Y.reset(Z);g.SB(K,function(b){this.publish(b)},this)}; g.A.lL=function(){var Z=this.j.getDeviceId(),Q=g.Fm(this.S,function(z){return z.type=="REMOTE_CONTROL"&&z.id!=Z}); return Q?Q.id:""}; g.A.Nj=function(){return this.j.Rr()}; g.A.Wt=function(){return this.L||"UNSUPPORTED"}; g.A.Ht=function(){return this.T||""}; g.A.xv=function(){!isNaN(this.Nj())&&this.j.c_()}; g.A.oJJ=function(Z,Q){FI(this,Z,Q);nSX(this)}; g.A.Kv=function(){var Z=g.Mi("SAPISID","")||g.Mi("__Secure-1PAPISID")||"",Q=g.Mi("__Secure-3PAPISID","")||"";if(!Z&&!Q)return"";Z=g.hj(g.cn(Z),2);Q=g.hj(g.cn(Q),2);return g.hj(g.cn(","+Z+","+Q),2)}; tL.prototype.subscribe=tL.prototype.subscribe;tL.prototype.unsubscribeByKey=tL.prototype.SK;tL.prototype.getProxyState=tL.prototype.xW;tL.prototype.disconnect=tL.prototype.gi;tL.prototype.getPlayerContextData=tL.prototype.rF;tL.prototype.setPlayerContextData=tL.prototype.aiY;tL.prototype.getOtherConnectedRemoteId=tL.prototype.lL;tL.prototype.getReconnectTimeout=tL.prototype.Nj;tL.prototype.getAutoplayMode=tL.prototype.Wt;tL.prototype.getAutoplayVideoId=tL.prototype.Ht;tL.prototype.reconnect=tL.prototype.xv; tL.prototype.sendMessage=tL.prototype.oJJ;tL.prototype.getXsrfToken=tL.prototype.Kv;tL.prototype.isCapabilitySupportedOnConnectedDevices=tL.prototype.p5;g.L(Rkn,ri);g.A=Rkn.prototype;g.A.hL=function(Z){return this.kE.$_gs(Z)}; g.A.contains=function(Z){return!!this.kE.$_c(Z)}; g.A.get=function(Z){return this.kE.$_g(Z)}; g.A.start=function(){this.kE.$_st()}; g.A.add=function(Z,Q,z){this.kE.$_a(Z,Q,z)}; g.A.remove=function(Z,Q,z){this.kE.$_r(Z,Q,z)}; g.A.aO=function(Z,Q,z,K){this.kE.$_un(Z,Q,z,K)}; g.A.gr=function(){for(var Z=this.Y.length,Q=0;Q1&&!this.J.getOption("remote","quickCast")?(this.gw=g.$n(Z,this.Y,this),this.xS(g.my(Z,this.Y)),Z=this.J.getOption("remote","currentReceiver"),Z=this.Y(Z),this.options[Z]&&this.D3(Z),this.enable(!0)):this.enable(!1)}; XL.prototype.Y=function(Z){return Z.key}; XL.prototype.f4=function(Z){return Z==="cast-selector-receiver"?"Transmitir\u2026":this.gw[Z].name}; XL.prototype.zp=function(Z){g.Fk.prototype.zp.call(this,Z);this.J.setOption("remote","currentReceiver",this.gw[Z]);this.Kd.oT()};g.L(sYR,g.Jv);g.A=sYR.prototype; g.A.create=function(){var Z=this.player.N(),Q=g.GK(Z);Z={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:Z.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:Z.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:Z.V("enable_cast_short_lived_lounge_token")};UQY(Q,Z);this.subscriptions.push(g.bm("yt-remote-before-disconnect",this.lIf,this));this.subscriptions.push(g.bm("yt-remote-connection-change",this.bfg,this));this.subscriptions.push(g.bm("yt-remote-receiver-availability-change",this.D_, this));this.subscriptions.push(g.bm("yt-remote-auto-connect",this.RoF,this));this.subscriptions.push(g.bm("yt-remote-receiver-resumed",this.BXN,this));this.subscriptions.push(g.bm("mdx-privacy-popup-confirm",this.sCI,this));this.subscriptions.push(g.bm("mdx-privacy-popup-cancel",this.NfG,this));this.D_()}; g.A.load=function(){this.player.cancelPlayback();g.Jv.prototype.load.call(this);this.f6=new ekz(this,this.player,this.uh);var Z=(Z=xQQ())?Z.currentTime:0;var Q=V7w()?new Uy(bE(),void 0):null;Z==0&&Q&&(Z=p2(Oy(Q)));Z!==0&&this.E8(Z);Zlo(this,this.gf,this.gf);this.player.Oj(6)}; g.A.unload=function(){this.player.publish("mdxautoplaycanceled");this.qz=this.C9;g.DH(this.f6,this.uh);this.uh=this.f6=null;g.Jv.prototype.unload.call(this);this.player.Oj(5);SS(this)}; g.A.gr=function(){g.qF(this.subscriptions);g.Jv.prototype.gr.call(this)}; g.A.Uf=function(Z){var Q=g.iu.apply(1,arguments);this.loaded&&this.f6.a4.apply(this.f6,[Z].concat(g.I(Q)))}; g.A.getAdState=function(){return this.Ve}; g.A.x3=function(){return this.uh?Oy(this.uh).x3:!1}; g.A.C4=function(){return this.uh?Oy(this.uh).C4:!1}; g.A.E8=function(Z,Q){this.Ja=Z||0;this.player.publish("progresssync",Z,Q);this.player.wX("onVideoProgress",Z||0)}; g.A.getCurrentTime=function(){return this.Ja}; g.A.getProgressState=function(){var Z=Oy(this.uh),Q=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!Z.sR()&&this.player.xE(),clipEnd:Q.clipEnd,clipStart:Q.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:Z.getDuration(),ingestionTime:Z.j?Z.S+R9(Z):Z.S,isAtLiveHead:(Z.j?Z.Y+R9(Z):Z.Y)-this.getCurrentTime()<=1,loaded:Z.X,seekableEnd:Z.j?Z.Y+R9(Z):Z.Y,seekableStart:Z.W>0?Z.W+R9(Z):Z.W,offset:0,viewerLivestreamJoinMediaTime:0}}; g.A.nextVideo=function(){this.uh&&this.uh.nextVideo()}; g.A.uS=function(){this.uh&&this.uh.uS()}; g.A.lIf=function(Z){Z===1&&(this.LT=this.uh?Oy(this.uh):null)}; g.A.bfg=function(){var Z=V7w()?new Uy(bE(),void 0):null;if(Z){var Q=this.qz;this.loaded&&this.unload();this.uh=Z;this.LT=null;Q.key!==this.C9.key&&(this.qz=Q,this.load())}else g.jR(this.uh),this.uh=null,this.loaded&&(this.unload(),(Z=this.LT)&&Z.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(Z.videoId,p2(Z)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.A.D_=function(){var Z=[this.C9],Q=Z.concat,z=Ojo();GW()&&g.pS("yt-remote-cast-available")&&z.push({key:"cast-selector-receiver",name:"Cast..."});this.gw=Q.call(Z,z);Z=BMn()||this.C9;$u(this,Z);this.player.wX("onMdxReceiversChange")}; g.A.RoF=function(){var Z=BMn();$u(this,Z)}; g.A.BXN=function(){this.qz=BMn()}; g.A.sCI=function(){this.Vl=!0;SS(this);jS=!1;qR&&AD(qR,1);qR=null}; g.A.NfG=function(){this.Vl=!1;SS(this);$u(this,this.C9);this.qz=this.C9;jS=!1;qR=null;this.player.playVideo()}; g.A.Pv=function(Z,Q){switch(Z){case "casting":return this.loaded;case "receivers":return this.gw;case "currentReceiver":return Q&&(Q.key==="cast-selector-receiver"?bjX():$u(this,Q)),this.loaded?this.qz:this.C9;case "quickCast":return this.gw.length===2&&this.gw[1].key==="cast-selector-receiver"?(Q&&bjX(),!0):!1}}; g.A.C1=function(){this.uh.C1()}; g.A.bP=function(){return!1}; g.A.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.A.isLoggedIn=function(){var Z,Q;return((Z=g.Ft("PLAYER_CONFIG"))==null?void 0:(Q=Z.args)==null?void 0:Q.authuser)!==void 0?!0:!(!g.Ft("SESSION_INDEX")&&!g.Ft("LOGGED_IN"))};g.Iq("remote",sYR);})(_yt_player);