(function(g){var window=this;'use strict';var YFK=function(q){if(q instanceof g.C$)return q;if(typeof q.Vh=="function")return q.Vh(!1);if(g.kc(q)){var a=0,w=new g.C$;w.next=function(){for(;;){if(a>=q.length)return g.lT;if(a in q)return g.my(q[a++]);a++}}; return w}throw Error("Not implemented");},POw=function(q,a,w){if(g.kc(q))g.WR(q,a,w); else for(q=YFK(q);;){var G=q.next();if(G.done)break;a.call(w,G.value,void 0,q)}},gA=function(q){g.ed(q,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.Kw()).toString(36)); return q},a7=function(q,a,w){Array.isArray(w)||(w=[String(w)]); g.pNK(q.Y,a,w)},Kkl=function(q,a){var w=[]; POw(a,function(G){try{var k=g.Qp.prototype.U.call(this,G,!0)}catch(b){if(b=="Storage: Invalid value was encountered")return;throw b;}k===void 0?w.push(G):g.tzK(k)&&w.push(G)},q); return w},dLl=function(q,a){Kkl(q,a).forEach(function(w){g.Qp.prototype.remove.call(this,w)},q)},TFy=function(q){if(q.aA){if(q.aA.locationOverrideToken)return{locationOverrideToken:q.aA.locationOverrideToken}; if(q.aA.latitudeE7!=null&&q.aA.longitudeE7!=null)return{latitudeE7:q.aA.latitudeE7,longitudeE7:q.aA.longitudeE7}}return null},$LB=function(q,a){g.Vx(q,a)||q.push(a)},scx=function(q){var a=0,w; for(w in q)a++;return a},Fkx=function(q,a){return g.YI(q,a)},COx=function(q){try{return g.yV.JSON.parse(q)}catch(a){}q=String(q); if(/^\s*$/.test(q)?0:/^[\],:{}\s\u2028\u2029]*$/.test(q.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("("+q+")")}catch(a){}throw Error("Invalid JSON string: "+q);},wA=function(q){if(g.yV.JSON)try{return g.yV.JSON.parse(q)}catch(a){}return COx(q)},ZyU=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/channel/opened",g.Gy("channel_type"))},Enc=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/channel/closed",g.Gy("channel_type"))},Ve6=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Gy("channel_type"))},JGV=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/channel/success")},mLc=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/channel/error",g.Gy("channel_type"),g.Gy("error_type"))},QcJ=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},AG8=function(){var q=Go(); this.V=q;q.Uo("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},xLw=function(q,a,w,G){var k=new g.g_(null); q&&g.a1(k,q);a&&g.w_(k,a);w&&g.GE(k,w);G&&(k.U=G);return k},LkB=function(q,a){return new g.DH(q,a)},kH=function(q,a){return Object.prototype.hasOwnProperty.call(q,a)},BFw=function(q,a){return q===a},bJ=function(q,a){this.U={}; this.V=[];this.V4=this.size=0;var w=arguments.length;if(w>1){if(w%2)throw Error("Uneven number of arguments");for(var G=0;G5&&(q=q.slice(q.length-5)); var a=g.sd(KBI(),function(G){return G.loungeToken}),w=g.sd(q,function(G){return G.loungeToken}); g.Fx(w,function(G){return!g.Vx(a,G)})&&dRx(); g.AE("yt-remote-local-screens",q,31536E3)},To=function(q){q||(g.L2("yt-remote-session-screen-id"),g.L2("yt-remote-session-video-id")); YHe();q=KY();g.mU(q,dA());eAR(q)},$Rl=function(){if(!$H){var q=g.na(); q&&($H=new g.Vp(q))}},stV=function(){$Rl(); return $H?!!$H.get("yt-remote-use-staging-server"):!1},sa=function(q,a){g.v0[q]=!0; var w=g.u$();w&&w.publish.apply(w,arguments);g.v0[q]=!1},FBK=function(){},Go=function(){if(!Fm){Fm=new g.pT(new FBK); var q=g.Tn("client_streamz_web_flush_count",-1);q!==-1&&(Fm.W=q)}return Fm},CMV=function(){var q=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return q?parseInt(q[1],10):0},Z26=function(q){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+q)!=-1||document.currentScript.src.indexOf("&"+q)!=-1)},Etx=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},CY=function(q){q.length?V2V(q.shift(),function(){CY(q)}):JEJ()},mRy=function(q){return"chrome-extension://"+q+"/cast_sender.js"},V2V=function(q,a,w){var G=document.createElement("script"); G.onerror=a;w&&(G.onload=w);g.Zv(G,g.C_(q));(document.head||document.documentElement).appendChild(G)},QtJ=function(){var q=CMV(),a=[]; if(q>1){var w=q-1;a.push("//www.gstatic.com/eureka/clank/"+q+"/cast_sender.js");a.push("//www.gstatic.com/eureka/clank/"+w+"/cast_sender.js")}return a},JEJ=function(){var q=Etx(); q&&q(!1,"No cast extension found")},xRU=function(){if(AEe){var q=2,a=Etx(),w=function(){q--; q==0&&a&&a(!0)}; window.__onGCastApiAvailable=w;V2V("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",JEJ,w)}},LBK=function(){xRU(); var q=QtJ();q.push("//www.gstatic.com/eureka/clank/cast_sender.js");CY(q)},rEU=function(){xRU(); var q=QtJ();q.push.apply(q,g.Tf(Bgy.map(mRy)));q.push("//www.gstatic.com/eureka/clank/cast_sender.js");CY(q)},Zf=function(q,a,w){g.c.call(this); this.L=w!=null?(0,g.Ne)(q,w):q;this.AL=a;this.D=(0,g.Ne)(this.rX,this);this.V=!1;this.U=0;this.W=this.bK=null;this.Y=[]},Ea=function(){},ntc=function(){g.t1.call(this,"p")},M2U=function(){g.t1.call(this,"o")},SHe=function(){return hAe=hAe||new g.PO},fnx=function(q){g.t1.call(this,"serverreachability",q)},VT=function(q){var a=SHe(); a.dispatchEvent(new fnx(a,q))},H2y=function(q){g.t1.call(this,"statevent",q)},JT=function(q){var a=SHe(); a.dispatchEvent(new H2y(a,q))},cEy=function(q,a,w,G){g.t1.call(this,"timingevent",q); this.size=a;this.rtt=w;this.retries=G},m7=function(q,a){if(typeof q!=="function")throw Error("Fn must not be null and must be a function"); return g.yV.setTimeout(function(){q()},a)},QT=function(){},AT=function(q,a,w,G){this.W=q; this.Y=a;this.N1=w;this.w$=G||1;this.VN=new g.d_(this);this.BT=45E3;this.L7=null;this.L=!1;this.J=this.A2=this.S=this.Tl=this.y7=this.IW=this.F9=null;this.UK=[];this.V=null;this.X=0;this.D=this.jt=null;this.OA=-1;this.EK=!1;this.h2=0;this.St=null;this.yN=this.le=this.uF=this.f7=!1;this.U=new p56},p56=function(){this.U=null; this.V="";this.W=!1},X58=function(q,a,w){q.Tl=1; q.S=gA(a.clone());q.J=w;q.f7=!0;URR(q,null)},URR=function(q,a){q.y7=Date.now(); xH(q);q.A2=q.S.clone();a7(q.A2,"t",q.w$);q.X=0;var w=q.W.Tl;q.U=new p56;q.V=jte(q.W,w?a:null,!q.J);q.h2>0&&(q.St=new g.iX((0,g.Ne)(q.Sl,q,q.V),q.h2));q.VN.listen(q.V,"readystatechange",q.aS);a=q.L7?g.$I(q.L7):{};q.J?(q.jt||(q.jt="POST"),a["Content-Type"]="application/x-www-form-urlencoded",q.V.send(q.A2,q.jt,q.J,a)):(q.jt="GET",q.V.send(q.A2,q.jt,null,a));VT(1)},InB=function(q){if(!otw(q))return g.iy(q.V); var a=g.WO(q.V);if(a==="")return"";var w="",G=a.length,k=g.vO(q.V)==4;if(!q.U.U){if(typeof TextDecoder==="undefined")return LY(q),Bi(q),"";q.U.U=new g.yV.TextDecoder}for(var b=0;ba.length)return utc;a=a.slice(G,G+w);q.X=G+w;return a},xH=function(q){q.IW=Date.now()+q.BT; zAc(q,q.BT)},zAc=function(q,a){if(q.F9!=null)throw Error("WatchDog timer not null"); q.F9=m7((0,g.Ne)(q.Vk,q),a)},i28=function(q){q.F9&&(g.yV.clearTimeout(q.F9),q.F9=null)},Bi=function(q){q.W.A$()||q.EK||WBx(q.W,q)},LY=function(q){i28(q); g.wB(q.St);q.St=null;q.VN.removeAll();if(q.V){var a=q.V;q.V=null;a.abort();a.dispose()}},GAU=function(q,a){try{var w=q.W; if(w.zA!=0&&(w.V==q||DRR(w.U,q)))if(!q.le&&DRR(w.U,q)&&w.zA==3){try{var G=w.rz.V.parse(a)}catch(J){G=null}if(Array.isArray(G)&&G.length==3){var k=G;if(k[0]==0)a:{if(!w.S){if(w.V)if(w.V.y7+3E30&&(w.h2=1.5*e);G=w;var N=q.Hu();if(N){var Y=g.DG(N,"X-Client-Wire-Protocol");if(Y){var P=G.U;!P.V&&(g.nH(Y,"spdy")||g.nH(Y,"quic")||g.nH(Y,"h2"))&&(P.Y=P.D,P.V=new Set,P.U&&(qPe(P,P.U),P.U=null))}if(G.f7){var K=g.DG(N,"X-HTTP-Session-Id");K&&(G.M9=K,g.ed(G.L7,G.f7,K))}}w.zA=3;w.D&&w.D.KA();w.OQ&&(w.L0=Date.now()-q.y7);G=w;var d=q;G.h8=g7V(G,G.Tl?G.N1:null,G.Ck);if(d.le){ajI(G.U, d);var T=d,F=G.h2;F&&T.setTimeout(F);T.F9&&(i28(T),xH(T));G.V=d}else whK(G);w.W.length>0&&hT(w)}else b[0]!="stop"&&b[0]!="close"||Ma(w,7);else w.zA==3&&(b[0]=="stop"||b[0]=="close"?b[0]=="stop"?Ma(w,7):w.disconnect():b[0]!="noop"&&w.D&&w.D.mJ(b),w.UK=0)}VT(4)}catch(J){}},kAy=function(q,a){this.V=q; this.map=a;this.context=null},bIK=function(q){this.D=q||10; g.yV.PerformanceNavigationTiming?(q=g.yV.performance.getEntriesByType("navigation"),q=q.length>0&&(q[0].nextHopProtocol=="hq"||q[0].nextHopProtocol=="h2")):q=!!(g.yV.chrome&&g.yV.chrome.loadTimes&&g.yV.chrome.loadTimes()&&g.yV.chrome.loadTimes().wasFetchedViaSpdy);this.Y=q?this.D:1;this.V=null;this.Y>1&&(this.V=new Set);this.U=null;this.W=[]},OIx=function(q){return q.U?!0:q.V?q.V.size>=q.Y:!1},yEc=function(q){return q.U?1:q.V?q.V.size:0},DRR=function(q,a){return q.U?q.U==a:q.V?q.V.has(a):!1},qPe= function(q,a){q.V?q.V.add(a):q.U=a},ajI=function(q,a){q.U&&q.U==a?q.U=null:q.V&&q.V.has(a)&&q.V.delete(a)},lj8=function(q){if(q.U!=null)return q.W.concat(q.U.UK); if(q.V!=null&&q.V.size!==0){var a=q.W;q=g.V(q.V.values());for(var w=q.next();!w.done;w=q.next())a=a.concat(w.value.UK);return a}return g.nw(q.W)},e9w=function(q,a){var w=new QT; if(g.yV.Image){var G=new Image;G.onload=g.Yc(SP,w,"TestLoadImage: loaded",!0,a,G);G.onerror=g.Yc(SP,w,"TestLoadImage: error",!1,a,G);G.onabort=g.Yc(SP,w,"TestLoadImage: abort",!1,a,G);G.ontimeout=g.Yc(SP,w,"TestLoadImage: timeout",!1,a,G);g.yV.setTimeout(function(){if(G.ontimeout)G.ontimeout()},1E4); G.src=q}else a(!1)},Nwx=function(q,a){var w=new QT,G=new AbortController,k=setTimeout(function(){G.abort(); SP(w,"TestPingServer: timeout",!1,a)},1E4); fetch(q,{signal:G.signal}).then(function(b){clearTimeout(k);b.ok?SP(w,"TestPingServer: ok",!0,a):SP(w,"TestPingServer: server error",!1,a)}).catch(function(){clearTimeout(k); SP(w,"TestPingServer: error",!1,a)})},SP=function(q,a,w,G,k){try{k&&(k.onload=null,k.onerror=null,k.onabort=null,k.ontimeout=null),G(w)}catch(b){}},YPI=function(){this.V=new Ea},fY=function(q,a,w){return w&&w.e6?w.e6[q]||a:a},PYK=function(q){this.W=[]; this.N1=this.h8=this.L7=this.Ck=this.V=this.M9=this.f7=this.EK=this.X=this.uF=this.J=null;this.ke=this.A2=0;this.tp=fY("failFast",!1,q);this.le=this.F9=this.S=this.L=this.D=null;this.Ai=!0;this.aA=this.St=-1;this.w$=this.UK=this.y7=0;this.QE=fY("baseRetryDelayMs",5E3,q);this.Th=fY("retryDelaySeedMs",1E4,q);this.E3=fY("forwardChannelMaxRetries",2,q);this.C0=fY("forwardChannelRequestTimeoutMs",2E4,q);this.RA=q&&q.zEl||void 0;this.nu=q&&q.MuW||void 0;this.JS=q&&q.hEQ||!1;this.h2=void 0;this.Tl=q&&q.T4T|| !1;this.Y="";this.U=new bIK(q&&q.Obh);this.rz=new YPI;this.VN=q&&q.NFt||!1;this.IW=q&&q.LzB||!1;this.VN&&this.IW&&(this.IW=!1);this.XN=q&&q.IJt||!1;q&&q.bbT&&(this.Ai=!1);this.OQ=!this.VN&&this.Ai&&q&&q.y57||!1;this.Nh=void 0;q&&q.f_&&q.f_>0&&(this.Nh=q.f_);this.OA=void 0;this.L0=0;this.BT=!1;this.yN=this.jt=null},nY=function(q){q.V&&(KJV(q),q.V.cancel(),q.V=null)},dFx=function(q){nY(q); q.S&&(g.yV.clearTimeout(q.S),q.S=null);rA(q);q.U.cancel();q.L&&(typeof q.L==="number"&&g.yV.clearTimeout(q.L),q.L=null)},hT=function(q){OIx(q.U)||q.L||(q.L=!0,g.VP(q.ZP,q),q.y7=0)},$Fc=function(q,a){if(yEc(q.U)>=q.U.Y-(q.L?1:0))return!1; if(q.L)return q.W=a.UK.concat(q.W),!0;if(q.zA==1||q.zA==2||q.y7>=(q.tp?0:q.E3))return!1;q.L=m7((0,g.Ne)(q.ZP,q,a),Twe(q,q.y7));q.y7++;return!0},FJ6=function(q,a){var w; a?w=a.N1:w=q.A2++;var G=q.L7.clone();g.ed(G,"SID",q.Y);g.ed(G,"RID",w);g.ed(G,"AID",q.St);Hi(q,G);q.X&&q.J&&g.KJ(G,q.X,q.J);w=new AT(q,q.Y,w,q.y7+1);q.X===null&&(w.L7=q.J);a&&(q.W=a.UK.concat(q.W));a=swe(q,w,1E3);w.setTimeout(Math.round(q.C0*.5)+Math.round(q.C0*.5*Math.random()));qPe(q.U,w);X58(w,G,a)},Hi=function(q,a){q.EK&&g.yx(q.EK,function(w,G){g.ed(a,G,w)}); q.D&&g.yx({},function(w,G){g.ed(a,G,w)})},swe=function(q,a,w){w=Math.min(q.W.length,w); var G=q.D?(0,g.Ne)(q.D.UV,q.D,q):null;a:{for(var k=q.W,b=-1;;){var O=["count="+w];b==-1?w>0?(b=k[0].V,O.push("ofs="+b)):b=0:O.push("ofs="+b);for(var e=!0,N=0;N=3)return!1; q.w$++;q.S=m7((0,g.Ne)(q.zo,q),Twe(q,q.UK));q.UK++;return!0},KJV=function(q){q.jt!=null&&(g.yV.clearTimeout(q.jt),q.jt=null)},CYl=function(q){q.V=new AT(q,q.Y,"rpc",q.w$); q.X===null&&(q.V.L7=q.J);q.V.h2=0;var a=q.h8.clone();g.ed(a,"RID","rpc");g.ed(a,"SID",q.Y);g.ed(a,"AID",q.St);g.ed(a,"CI",q.le?"0":"1");!q.le&&q.Nh&&g.ed(a,"TO",q.Nh);g.ed(a,"TYPE","xmlhttp");Hi(q,a);q.X&&q.J&&g.KJ(a,q.X,q.J);q.h2&&q.V.setTimeout(q.h2);var w=q.V;q=q.N1;w.Tl=1;w.S=gA(a.clone());w.J=null;w.f7=!0;URR(w,q)},rA=function(q){q.F9!=null&&(g.yV.clearTimeout(q.F9),q.F9=null)},WBx=function(q,a){var w=null; if(q.V==a){rA(q);KJV(q);q.V=null;var G=2}else if(DRR(q.U,a))w=a.UK,ajI(q.U,a),G=1;else return;if(q.zA!=0)if(a.L)if(G==1){w=a.J?a.J.length:0;a=Date.now()-a.y7;var k=q.y7;G=SHe();G.dispatchEvent(new cEy(G,w,a,k));hT(q)}else whK(q);else{var b=a.OA;k=a.getLastError();if(k==3||k==0&&b>0||!(G==1&&$Fc(q,a)||G==2&&RAU(q)))switch(w&&w.length>0&&(a=q.U,a.W=a.W.concat(w)),k){case 1:Ma(q,5);break;case 4:Ma(q,10);break;case 3:Ma(q,6);break;default:Ma(q,2)}}},Twe=function(q,a){var w=q.QE+Math.floor(Math.random()* q.Th); q.isActive()||(w*=2);return w*a},Ma=function(q,a){if(a==2){var w=(0,g.Ne)(q.ge9,q),G=q.nu,k=!G; G=new g.g_(G||"//www.google.com/images/cleardot.gif");g.yV.location&&g.yV.location.protocol=="http"||g.a1(G,"https");gA(G);k?e9w(G.toString(),w):Nwx(G.toString(),w)}else JT(2);q.zA=0;q.D&&q.D.sf(a);ZIR(q);dFx(q)},ZIR=function(q){q.zA=0; q.yN=[];if(q.D){var a=lj8(q.U);if(a.length!=0||q.W.length!=0)g.Me(q.yN,a),g.Me(q.yN,q.W),q.U.W.length=0,g.nw(q.W),q.W.length=0;q.D.BB()}},E7B=function(q){if(q.zA==0)return q.yN; var a=[];g.Me(a,lj8(q.U));g.Me(a,q.W);return a},g7V=function(q,a,w){var G=g.Nb(w); G.V!=""?(a&&g.w_(G,a+"."+G.V),g.GE(G,G.W)):(G=g.yV.location,G=xLw(G.protocol,a?a+"."+G.hostname:G.hostname,+G.port,w));a=q.f7;w=q.M9;a&&w&&g.ed(G,a,w);g.ed(G,"VER",q.Av);Hi(q,G);return G},jte=function(q,a,w){if(a&&!q.Tl)throw Error("Can't create secondary domain capable XhrIo object."); a=q.JS&&!q.RA?new g.Il(new g.DX({R$:w})):new g.Il(q.RA);a.X=q.Tl;return a},VIx=function(){},J26=function(){},pY=function(q,a){g.PO.call(this); this.V=new PYK(a);this.D=q;this.U=a&&a.vTT||null;q=a&&a.i7W||null;a&&a.dTe&&(q?q["X-Client-Protocol"]="webchannel":q={"X-Client-Protocol":"webchannel"});this.V.J=q;q=a&&a.avT||null;a&&a.TJ&&(q?q["X-WebChannel-Content-Type"]=a.TJ:q={"X-WebChannel-Content-Type":a.TJ});a&&a.Lf&&(q?q["X-WebChannel-Client-Profile"]=a.Lf:q={"X-WebChannel-Client-Profile":a.Lf});this.V.uF=q;(q=a&&a.Vul)&&!g.rn(q)&&(this.V.X=q);this.L=a&&a.T4T||!1;this.Y=a&&a.WIG||!1;(a=a&&a.R0)&&!g.rn(a)&&(this.V.f7=a,g.NW(this.U,a)&&(q= this.U,a in q&&delete q[a]));this.W=new ci(this)},mFy=function(q){ntc.call(this); q.__headers__&&(this.headers=q.__headers__,this.statusCode=q.__status__,delete q.__headers__,delete q.__status__);var a=q.__sm__;a?this.data=(this.V=g.wn(a))?g.dn(a,this.V):a:this.data=q},Qwe=function(q){M2U.call(this); this.status=1;this.errorCode=q},ci=function(q){this.V=q},A2y=function(q,a){this.U=q; this.V=a},xFV=function(q){return E7B(q.V).map(function(a){var w=q.U; a=a.map;"__data__"in a?(a=a.__data__,w=w.Y?COx(a):a):w=a;return w})},Ua=function(q,a){if(typeof q!=="function")throw Error("Fn must not be null and must be a function"); return g.yV.setTimeout(function(){q()},a)},jP=function(q){Xm.dispatchEvent(new LJI(Xm,q))},LJI=function(q){g.t1.call(this,"statevent",q)},o7=function(q,a,w,G){this.V=q; this.Y=a;this.X=w;this.L=G||1;this.U=45E3;this.W=new g.d_(this);this.D=new g.fT;this.D.setInterval(250)},r2V=function(q,a,w){q.al=1; q.Li=gA(a.clone());q.y4=w;q.f7=!0;BwB(q,null)},n7U=function(q,a,w,G,k){q.al=1; q.Li=gA(a.clone());q.y4=null;q.f7=w;k&&(q.Cj=!1);BwB(q,G)},BwB=function(q,a){q.EZ=Date.now(); MIV(q);q.Vl=q.Li.clone();a7(q.Vl,"t",q.L);q.U5=0;q.qz=q.V.qL(q.V.eT()?a:null);q.O4>0&&(q.rN=new g.iX((0,g.Ne)(q.Io,q,q.qz),q.O4));q.W.listen(q.qz,"readystatechange",q.OV);a=q.qA?g.$I(q.qA):{};q.y4?(q.FE="POST",a["Content-Type"]="application/x-www-form-urlencoded",q.qz.send(q.Vl,q.FE,q.y4,a)):(q.FE="GET",q.Cj&&!g.NP&&(a.Connection="close"),q.qz.send(q.Vl,q.FE,null,a));q.V.ZG(1)},fj8=function(q,a){var w=q.U5,G=a.indexOf("\n",w); if(G==-1)return h9c;w=Number(a.substring(w,G));if(isNaN(w))return SPI;G+=1;if(G+w>a.length)return h9c;a=a.slice(G,G+w);q.U5=G+w;return a},MIV=function(q){q.WX=Date.now()+q.U; HIU(q,q.U)},HIU=function(q,a){if(q.xN!=null)throw Error("WatchDog timer not null"); q.xN=Ua((0,g.Ne)(q.d7,q),a)},c2K=function(q){q.xN&&(g.yV.clearTimeout(q.xN),q.xN=null)},phw=function(q){q.V.A$()||q.DQ||q.V.y3(q)},I7=function(q){c2K(q); g.wB(q.rN);q.rN=null;q.D.stop();q.W.removeAll();if(q.qz){var a=q.qz;q.qz=null;a.abort();a.dispose()}q.Z4&&(q.Z4=null)},UF8=function(q,a){try{q.V.Jv(q,a),q.V.ZG(4)}catch(w){}},jwx=function(q,a,w,G,k){if(G==0)w(!1); else{var b=k||0;G--;XhU(q,a,function(O){O?w(!0):g.yV.setTimeout(function(){jwx(q,a,w,G,b)},b)})}},XhU=function(q,a,w){var G=new Image; G.onload=function(){try{uJ(G),w(!0)}catch(k){}}; G.onerror=function(){try{uJ(G),w(!1)}catch(k){}}; G.onabort=function(){try{uJ(G),w(!1)}catch(k){}}; G.ontimeout=function(){try{uJ(G),w(!1)}catch(k){}}; g.yV.setTimeout(function(){if(G.ontimeout)G.ontimeout()},a); G.src=q},uJ=function(q){q.onload=null; q.onerror=null;q.onabort=null;q.ontimeout=null},o78=function(q){this.V=q; this.U=new Ea},Ijl=function(q){var a=tT(q.V,q.LK,"/mail/images/cleardot.gif"); gA(a);jwx(a.toString(),5E3,(0,g.Ne)(q.T1,q),3,2E3);q.ZG(1)},u4J=function(q){var a=q.V.L; a!=null?(jP(5),a?(jP(11),vi(q.V,q,!1)):(jP(12),vi(q.V,q,!0))):(q.JJ=new o7(q),q.JJ.qA=q.Q3,a=q.V,a=tT(a,a.eT()?q.dj:null,q.oD),jP(5),a7(a,"TYPE","xmlhttp"),n7U(q.JJ,a,!1,q.dj,!1))},tIw=function(q,a,w){this.V=1; this.U=[];this.W=[];this.D=new Ea;this.J=q||null;this.L=a!=null?a:null;this.S=w||!1},v7K=function(q,a){this.V=q; this.map=a;this.context=null},z98=function(q,a,w,G){g.t1.call(this,"timingevent",q); this.size=a;this.rtt=w;this.retries=G},iIw=function(q){g.t1.call(this,"serverreachability",q)},DFV=function(q){q.u3(1,0); q.O5=tT(q,null,q.cX);WJU(q)},R9w=function(q){q.Um&&(q.Um.abort(),q.Um=null); q.J$&&(q.J$.cancel(),q.J$=null);q.Ob&&(g.yV.clearTimeout(q.Ob),q.Ob=null);zo(q);q.qX&&(q.qX.cancel(),q.qX=null);q.Ph&&(g.yV.clearTimeout(q.Ph),q.Ph=null)},y2J=function(q,a){if(q.V==0)throw Error("Invalid operation: sending map when state is closed"); q.U.push(new v7K(q.Wj++,a));q.V!=2&&q.V!=3||WJU(q)},qbB=function(q){var a=0; q.J$&&a++;q.qX&&a++;return a},WJU=function(q){q.qX||q.Ph||(q.Ph=Ua((0,g.Ne)(q.UX,q),0),q.SN=0)},w0J=function(q,a){if(q.V==1){if(!a){q.Xq=Math.floor(Math.random()*1E5); a=q.Xq++;var w=new o7(q,"",a);w.qA=q.BI;var G=g3K(q),k=q.O5.clone();g.ed(k,"RID",a);g.ed(k,"CVER","1");iJ(q,k);r2V(w,k,G);q.qX=w;q.V=2}}else q.V==3&&(a?a2c(q,a):q.U.length==0||q.qX||a2c(q))},a2c=function(q,a){if(a)if(q.o5>6){q.U=q.W.concat(q.U); q.W.length=0;var w=q.Xq-1;a=g3K(q)}else w=a.X,a=a.y4;else w=q.Xq++,a=g3K(q);var G=q.O5.clone();g.ed(G,"SID",q.Y);g.ed(G,"RID",w);g.ed(G,"AID",q.Aw);iJ(q,G);w=new o7(q,q.Y,w,q.SN+1);w.qA=q.BI;w.setTimeout(1E4+Math.round(1E4*Math.random()));q.qX=w;r2V(w,G,a)},iJ=function(q,a){q.Z8&&(q=q.Z8.q6())&&g.yx(q,function(w,G){g.ed(a,G,w)})},g3K=function(q){var a=Math.min(q.U.length,1E3),w=["count="+a]; if(q.o5>6&&a>0){var G=q.U[0].V;w.push("ofs="+G)}else G=0;for(var k={},b=0;b=3)return!1; q.X++;q.Ob=Ua((0,g.Ne)(q.FR,q),kZx(q,q.Cx));q.Cx++;return!0},vi=function(q,a,w){q.hN=q.L==null?w:!q.L; q.HC=a.Ub;q.S||DFV(q)},zo=function(q){q.Y6!=null&&(g.yV.clearTimeout(q.Y6),q.Y6=null)},kZx=function(q,a){var w=5E3+Math.floor(Math.random()*1E4); q.isActive()||(w*=2);return w*a},Wi=function(q,a){if(a==2||a==9){var w=null; q.Z8&&(w=null);var G=(0,g.Ne)(q.wHW,q);w||(w=new g.g_("//www.google.com/images/cleardot.gif"),gA(w));XhU(w.toString(),1E4,G)}else jP(2);OBI(q,a)},OBI=function(q,a){q.V=0; q.Z8&&q.Z8.dg(a);l2x(q);R9w(q)},l2x=function(q){q.V=0; q.HC=-1;if(q.Z8)if(q.W.length==0&&q.U.length==0)q.Z8.Ge();else{var a=g.nw(q.W),w=g.nw(q.U);q.W.length=0;q.U.length=0;q.Z8.Ge(a,w)}},tT=function(q,a,w){var G=g.Nb(w); if(G.V!="")a&&g.w_(G,a+"."+G.V),g.GE(G,G.W);else{var k=window.location;G=xLw(k.protocol,a?a+"."+k.hostname:k.hostname,+k.port,w)}q.TW&&g.yx(q.TW,function(b,O){g.ed(G,O,b)}); g.ed(G,"VER",q.o5);iJ(q,G);return G},eDJ=function(){},Nec=function(){this.V=[]; this.U=[]},Ybc=function(q){g.t1.call(this,"channelMessage"); this.message=q},P$B=function(q){g.t1.call(this,"channelError"); this.error=q},KNw=function(q,a){this.action=q; this.params=a||{}},Df=function(q,a){g.c.call(this); this.V=new g.o1(this.iTe,0,this);g.p(this,this.V);this.AL=5E3;this.U=0;if(typeof q==="function")a&&(q=(0,g.Ne)(q,a));else if(q&&typeof q.handleEvent==="function")q=(0,g.Ne)(q.handleEvent,q);else throw Error("Invalid listener argument");this.W=q},dYI=function(q,a,w,G,k,b,O,e,N,Y,P,K,d,T){w=w===void 0?!1:w; G=G===void 0?function(){return""}:G; k=k===void 0?!1:k;b=b===void 0?!1:b;O=O===void 0?!1:O;e=e===void 0?function(){return g.rH({})}:e; N=N===void 0?!1:N;P=P===void 0?!1:P;K=K===void 0?!1:K;d=d===void 0?!1:d;T=T===void 0?!1:T;this.Tl=q;this.F9=a;this.L=new g.E8;this.U=new Df(this.hLT,this);this.V=null;this.X=!1;this.J=null;this.y7="";this.UK=this.S=0;this.W=[];this.yN=w;this.f7=G;this.D=b;this.L7=e;this.EK=Y;this.w$=O;this.jt=null;this.Y=g.rH();this.N1=k;this.uF=N;this.VN=P;this.IW=K;this.Ck=d;this.OA=T;this.h2=new ZyU;this.le=new Enc;this.BT=new JGV;this.A2=new Ve6;this.St=new mLc;this.Ai=new QcJ;this.OQ=new AG8},s5K=function(q, a,w,G,k){TeJ(q); if(q.V){var b=g.UL("ID_TOKEN"),O=q.V.BI||{};b?O["x-youtube-identity-token"]=b:delete O["x-youtube-identity-token"];q.V.BI=O}$Yx(q);G?(G.getState()!=3&&qbB(G)==0||G.getState(),q.V.connect(a,w,q.F9,G.Y,G.Aw)):k?q.V.connect(a,w,q.F9,k.sessionId,k.arrayId):q.V.connect(a,w,q.F9)},E3w=function(q,a){return q.Ck?!0:q.IW?Object.values(FNV).includes(a):q.VN?!Object.values(C$6).includes(a):q.OA?Object.values(ZBx).includes(a):!1},mY6=function(q){var a,w; g.h(function(G){if(G.U==1)return g.QV(G,2),g.n(G,VCc(q),2);g.Sy(G);a=q.W;q.W=[];w=a.length;Jal(q,a,w);R7(q);return g.HJ(G,0)})},Jal=function(q,a,w){for(var G=0;G0?w=Object.assign({},w,a):delete w.Authorization;q.V.BI=w}},$Yx=function(q){q.EK&&!q.D&&Aac(q,q.EK())},yT=function(q){this.scheme="https"; this.port=this.domain="";this.V="/api/lounge";this.U=!0;q=q||document.location.href;var a=Number(g.es(q)[4]||null)||"";a&&(this.port=":"+a);this.domain=g.Nr(q)||"";q=g.cL();q.search("MSIE")>=0&&(q=q.match(/MSIE ([\d.]+)/)[1],g.HL(q,"10.0")<0&&(this.U=!1))},qU=function(q,a){var w=q.V; q.U&&(w=q.scheme+"://"+q.domain+q.port+q.V);return g.sk(w+a,{})},xYJ=function(q,a){g.PO.call(this); var w=this;this.Ia=q();this.Ia.subscribe("handlerOpened",this.Qk,this);this.Ia.subscribe("handlerClosed",this.onClosed,this);this.Ia.subscribe("handlerError",function(G,k){w.onError(k)}); this.Ia.subscribe("handlerMessage",this.onMessage,this);this.V=a},LNB=function(q,a,w){var G=this; w=w===void 0?function(){return""}:w; var k=k===void 0?new J26:k;var b=b===void 0?new g.E8:b;this.pathPrefix=q;this.V=a;this.y7=w;this.D=b;this.S=null;this.J=this.X=0;this.channel=null;this.L=0;this.W=new Df(function(){G.W.isActive();var O;((O=G.channel)==null?void 0:yEc((new A2y(O,O.V)).V.U))===0&&G.connect(G.S,G.X)}); this.Y={};this.U={};this.F9=!1;this.logger=null;this.UK=[];this.eZ=void 0;this.L7=new ZyU;this.jt=new Enc;this.EK=new Ve6;this.f7=new mLc},BeU=function(q){g.qI(q.channel,"m",function(){q.L=3; q.W.reset();q.S=null;q.X=0;for(var a=g.V(q.UK),w=a.next();!w.done;w=a.next())w=w.value,q.channel&&q.channel.send(w);q.UK=[];q.publish("webChannelOpened");q.L7.N_("WEB_CHANNEL")}); g.qI(q.channel,"n",function(){q.L=0;q.W.isActive()||q.publish("webChannelClosed");var a,w=(a=q.channel)==null?void 0:xFV(new A2y(a,a.V));w&&(q.UK=[].concat(g.Tf(w)));q.jt.N_("WEB_CHANNEL")}); g.qI(q.channel,"p",function(a){var w=a.data;w[0]==="gracefulReconnect"?(q.W.start(),q.channel&&q.channel.close()):q.publish("webChannelMessage",new KNw(w[0],w[1]));q.eZ=a.statusCode;q.EK.N_("WEB_CHANNEL")}); g.qI(q.channel,"o",function(){q.eZ===401||q.W.start();q.publish("webChannelError");q.f7.N_("WEB_CHANNEL","")})},raK=function(q){var a=q.y7(); a?q.Y["x-youtube-lounge-xsrf-token"]=a:delete q.Y["x-youtube-lounge-xsrf-token"]},n3c=function(q){g.PO.call(this); this.V=q();this.V.subscribe("webChannelOpened",this.yk,this);this.V.subscribe("webChannelClosed",this.onClosed,this);this.V.subscribe("webChannelError",this.onError,this);this.V.subscribe("webChannelMessage",this.onMessage,this)},MCJ=function(q,a,w,G,k){function b(){return new dYI(qU(q,"/bc"),a,!1,w,G)} w=w===void 0?function(){return""}:w; return g.dF("enable_mdx_web_channel_desktop")?new n3c(function(){return new LNB(qU(q,"/wc"),a,w)}):new xYJ(b,k)},HB6=function(){var q=hD7; Sb7();gf.push(q);f2x()},aF=function(q,a){Sb7(); var w=caw(q,String(a));gf.length==0?p0J(w):(f2x(),g.WR(gf,function(G){G(w)}))},wf=function(q){aF("CP",q)},Sb7=function(){gf||(gf=g.aB("yt.mdx.remote.debug.handlers_")||[],g.qe("yt.mdx.remote.debug.handlers_",gf))},p0J=function(q){var a=(Gl+1)%50; Gl=a;ko[a]=q;bD||(bD=a==49)},f2x=function(){var q=gf; if(ko[0]){var a=bD?Gl:-1,w={};do w={QI:void 0},a=(a+1)%50,w.QI=ko[a],g.WR(q,function(G){return function(k){k(G.QI)}}(w)); while(a!=Gl);ko=Array(50);Gl=-1;bD=!1}},caw=function(q,a){var w=(Date.now()-UY8)/1E3; w.toFixed&&(w=w.toFixed(3));var G=[];G.push("[",w+"s","] ");G.push("[","yt.mdx.remote","] ");G.push(q+": "+a,"\n");return G.join("")},On=function(q){g.ya.call(this); this.L=q;this.screens=[]},X0w=function(q,a){var w=q.get(a.uuid)||q.get(a.id); if(w)return q=w.name,w.id=a.id||w.id,w.name=a.name,w.token=a.token,w.uuid=a.uuid||w.uuid,w.name!=q;q.screens.push(a);return!0},j5e=function(q,a){var w=q.screens.length!=a.length; q.screens=g.L$(q.screens,function(b){return!!b2l(a,b)}); for(var G=a.length,k=0;k0&&q.Y0&&Z_(q,w)},function(a){q.D=function(){}; q.Mz(a)})},sGl=function(q){var a={}; a.pairingCode=q.jt;a.theme=q.Tl;stV()&&(a.env_useStageMdx=1);return g.$$(a)},F2R=function(q){return new Promise(function(a){q.jt=GVe(); if(q.L7){var w=new chrome.cast.DialLaunchResponse(!0,sGl(q));a(w);$9x(q)}else q.F9=function(){g.Yn(q.J);q.F9=function(){}; q.J=NaN;var G=new chrome.cast.DialLaunchResponse(!0,sGl(q));a(G);$9x(q)},q.J=g.ee(function(){q.F9()},100)})},Z5B=function(q,a,w){q.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(a)); var G=new eP(a);return(new Promise(function(k){CzR(q,G,function(b){b?(q.UK=!0,KR(q.Y,G),Tl(q,G),Z_(q,w)):g.ux(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(a)+" is not online."));k(b)},5)})).then(function(k){return k?new chrome.cast.DialLaunchResponse(!1):F2R(q)})},E5K=function(q,a){var w=q.S.receiver.label,G=q.U.friendlyName; return(new Promise(function(k){q97(q.Y,w,a,G,function(b){b&&b.token&&Tl(q,b);k(b)},function(b){$o(q,"Failed to get DIAL screen: "+b); k(null)})})).then(function(k){return k&&k.token?new chrome.cast.DialLaunchResponse(!1):F2R(q)})},CzR=function(q,a,w,G){g.Yn(q.L); q.L=0;aVI(q.Y,a,function(k){k||G<0?w(k):q.L=g.ee(function(){CzR(q,a,w,G-1)},300)})},Z_=function(q,a){q.info("getDialAppInfoWithTimeout_ "+a); CR(q)&&(g.Yn(q.X),q.X=0,a==0?Vb8(q):q.X=g.ee(function(){Vb8(q)},a))},Vb8=function(q){CR(q)&&q.W.getDialAppInfo(function(a){q.info("getDialAppInfo dialLaunchData: "+JSON.stringify(a)); a=a.extraData||{};var w=null;if(a.loungeToken){var G;((G=q.V)==null?void 0:G.token)==a.loungeToken&&(w="staleLoungeToken")}else w="missingLoungeToken";w?(q.y7=w,Z_(q,3E4)):(q.UK=!1,q.y7="unknown",b5w(q,a.loungeToken),Z_(q,a.loungeTokenRefreshIntervalMs))},function(a){q.info("getDialAppInfo error: "+a); q.y7="noLoungeTokenResponse";Z_(q,3E4)})},JNV=function(q){g.Yn(q.L); q.L=0;g.Yn(q.X);q.X=0;q.D();q.D=function(){}; g.Yn(q.J)},En=function(q,a){df.call(this,q,a,"ManualSession"); this.W=g.ee((0,g.Ne)(this.DB,this,null),150)},Vm=function(q,a){g.ya.call(this); this.config_=a;this.U=q;this.S=a.appId||"233637DE";this.Y=a.theme||"cl";this.J=a.disableCastApi||!1;this.L=a.forceMirroring||!1;this.V=null;this.X=!1;this.W=[];this.D=(0,g.Ne)(this.k07,this)},m9V=function(q,a){return a?g.Z7(q.W,function(w){return Na(a,w.label)},q):null},JR=function(q){aF("Controller",q)},hD7=function(q){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(q)},m8=function(q){return q.X||!!q.W.length||!!q.V},Qm=function(q,a,w){a!=q.V&&(g.wB(q.V),(q.V=a)?(w?q.publish("yt-remote-cast2-receiver-resumed", a.U):q.publish("yt-remote-cast2-receiver-selected",a.U),a.subscribe("sessionScreen",(0,g.Ne)(q.XK,q,a)),a.subscribe("sessionFailed",function(){return QGR(q,a)}),a.V?q.publish("yt-remote-cast2-session-change",a.V):w&&q.V.DB(null)):q.publish("yt-remote-cast2-session-change",null))},QGR=function(q,a){q.V==a&&q.publish("yt-remote-cast2-session-failed")},ANB=function(q){var a=q.U.QC(),w=q.V&&q.V.U; q=g.sd(a,function(G){w&&Na(G,w.label)&&(w=null);var k=G.uuid?G.uuid:G.id,b=m9V(this,G);b?(b.label=k,b.friendlyName=G.name):(b=new chrome.cast.Receiver(k,G.name),b.receiverType=chrome.cast.ReceiverType.CUSTOM);return b},q); w&&(w.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(w=new chrome.cast.Receiver(w.label,w.friendlyName),w.receiverType=chrome.cast.ReceiverType.CUSTOM),q.push(w));return q},S9J=function(q,a,w,G){G.disableCastApi?AR("Cannot initialize because disabled by Mdx config."):x9x()?L2I(a,G)&&(BWx(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?rNV(q,w):(window.__onGCastApiAvailable=function(k,b){k?rNV(q,w):(xo("Failed to load cast API: "+b),n5x(!1),BWx(!1),g.L2("yt-remote-cast-available"),g.L2("yt-remote-cast-receiver"), MbK(),w(!1))},G.loadCastApiSetupScript?g.R5(h_V):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?CMV()>=60&&LBK():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?JEJ():CMV()>=89?rEU():(xRU(),CY(Bgy.map(mRy))))):AR("Cannot initialize because not running Chrome")},MbK=function(){AR("dispose"); var q=LR();q&&q.dispose();g.qe("yt.mdx.remote.cloudview.instance_",null);fVI(!1);g.W0(H5V);H5V.length=0},B6=function(){return!!g.xt("yt-remote-cast-installed")},cNJ=function(){var q=g.xt("yt-remote-cast-receiver"); return q?q.friendlyName:null},ppU=function(){AR("clearCurrentReceiver"); g.L2("yt-remote-cast-receiver")},U9U=function(){return B6()?LR()?LR().getCastSession():(xo("getCastSelector: Cast is not initialized."),null):(xo("getCastSelector: Cast API is not installed!"),null)},Xp8=function(){B6()?LR()?rf()?(AR("Requesting cast selector."),LR().requestSession()):(AR("Wait for cast API to be ready to request the session."),H5V.push(g.i$("yt-remote-cast2-api-ready",Xp8))):xo("requestCastSelector: Cast is not initialized."):xo("requestCastSelector: Cast API is not installed!")}, nR=function(q,a){rf()?LR().setConnectedScreenStatus(q,a):xo("setConnectedScreenStatus called before ready.")},x9x=function(){var q=g.cL().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.se||q},jGR=function(q,a){LR().init(q,a)},L2I=function(q,a){var w=!1; LR()||(q=new Vm(q,a),q.subscribe("yt-remote-cast2-availability-change",function(G){g.AE("yt-remote-cast-available",G);sa("yt-remote-cast2-availability-change",G)}),q.subscribe("yt-remote-cast2-receiver-selected",function(G){AR("onReceiverSelected: "+G.friendlyName); g.AE("yt-remote-cast-receiver",G);sa("yt-remote-cast2-receiver-selected",G)}),q.subscribe("yt-remote-cast2-receiver-resumed",function(G){AR("onReceiverResumed: "+G.friendlyName); g.AE("yt-remote-cast-receiver",G);sa("yt-remote-cast2-receiver-resumed",G)}),q.subscribe("yt-remote-cast2-session-change",function(G){AR("onSessionChange: "+YH(G)); G||g.L2("yt-remote-cast-receiver");sa("yt-remote-cast2-session-change",G)}),g.qe("yt.mdx.remote.cloudview.instance_",q),w=!0); AR("cloudview.createSingleton_: "+w);return w},LR=function(){return g.aB("yt.mdx.remote.cloudview.instance_")},rNV=function(q,a){n5x(!0); BWx(!1);jGR(q,function(w){w?(fVI(!0),g.D2("yt-remote-cast2-api-ready")):(xo("Failed to initialize cast API."),n5x(!1),g.L2("yt-remote-cast-available"),g.L2("yt-remote-cast-receiver"),MbK());a(w)})},AR=function(q){aF("cloudview",q)},xo=function(q){aF("cloudview",q)},n5x=function(q){AR("setCastInstalled_ "+q); g.AE("yt-remote-cast-installed",q)},rf=function(){return!!g.aB("yt.mdx.remote.cloudview.apiReady_")},fVI=function(q){AR("setApiReady_ "+q); g.qe("yt.mdx.remote.cloudview.apiReady_",q)},BWx=function(q){g.qe("yt.mdx.remote.cloudview.initializing_",q)},MU=function(q){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.D=this.L=0;this.trackData=null;this.HI=this.IE=!1;this.S=this.W=this.X=this.U=0;this.V=NaN;this.Y=!1;this.reset(q)},o56=function(q){q.audioTrackId=null; q.trackData=null;q.playerState=-1;q.IE=!1;q.HI=!1;q.L=0;q.D=g.Kw();q.U=0;q.X=0;q.W=0;q.S=0;q.V=NaN;q.Y=!1},hR=function(q){return q.isPlaying()?(g.Kw()-q.D)/1E3:0},So=function(q,a){q.L=a; q.D=g.Kw()},fR=function(q){switch(q.playerState){case 1:case 1081:return(g.Kw()-q.D)/1E3+q.L; case -1E3:return 0}return q.L},IV6=function(q){return q.Y?q.X+hR(q):q.X},H6=function(q,a,w){var G=q.videoId; q.videoId=a;q.index=w;a!=G&&o56(q)},uFc=function(q){var a={}; a.index=q.index;a.listId=q.listId;a.videoId=q.videoId;a.playerState=q.playerState;a.volume=q.volume;a.muted=q.muted;a.audioTrackId=q.audioTrackId;a.trackData=g.s7(q.trackData);a.hasPrevious=q.IE;a.hasNext=q.HI;a.playerTime=q.L;a.playerTimeAt=q.D;a.seekableStart=q.U;a.seekableEnd=q.X;a.duration=q.W;a.loadedTime=q.S;a.liveIngestionTime=q.V;return a},pR=function(q,a){g.ya.call(this); var w=this;this.W=0;this.Y=q;this.L=[];this.D=new Nec;this.U=this.V=null;this.J=(0,g.Ne)(this.J2K,this);this.X=(0,g.Ne)(this.xM,this);this.S=(0,g.Ne)(this.IhQ,this);this.F9=(0,g.Ne)(this.Vil,this);var G=0;q?(G=q.getProxyState(),G!=3&&(q.subscribe("proxyStateChange",this.JF,this),tbR(this))):G=3;G!=0&&(a?this.JF(G):g.ee(function(){w.JF(G)},0)); (q=U9U())&&c6(this,q);this.subscribe("yt-remote-cast2-session-change",this.F9)},Un=function(q){return new MU(q.Y.getPlayerContextData())},tbR=function(q){g.WR("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(a){this.L.push(this.Y.subscribe(a,g.Yc(this.NGK,a),this))},q)},v5e=function(q){g.WR(q.L,function(a){this.Y.unsubscribeByKey(a)},q); q.L.length=0},Xz=function(q){return q.getState()==1},jo=function(q,a){var w=q.D; w.V.length+w.U.length<50&&q.D.enqueue(a)},z_w=function(q,a,w){var G=Un(q); So(G,w);G.playerState!=-1E3&&(G.playerState=a);oF(q,G)},IF=function(q,a,w){q.Y.sendMessage(a,w)},oF=function(q,a){v5e(q); q.Y.setPlayerContextData(uFc(a));tbR(q)},c6=function(q,a){q.U&&(q.U.removeUpdateListener(q.J),q.U.removeMediaListener(q.X),q.xM(null)); q.U=a;q.U&&(wf("Setting cast session: "+q.U.sessionId),q.U.addUpdateListener(q.J),q.U.addMediaListener(q.X),q.U.media.length&&q.xM(q.U.media[0]))},i58=function(q){var a=q.V.media,w=q.V.customData; if(a&&w){var G=Un(q);a.contentId!=G.videoId&&wf("Cast changing video to: "+a.contentId);G.videoId=a.contentId;G.playerState=w.playerState;So(G,q.V.getEstimatedTime());oF(q,G)}else wf("No cast media video. Ignoring state update.")},uD=function(q,a,w){return(0,g.Ne)(function(G){this.qH("Failed to "+a+" with cast v2 channel. Error code: "+G.code); G.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.qH("Retrying "+a+" using MDx browser channel."),IF(this,a,w))},q)},zl=function(q,a,w,G){G=G===void 0?!1:G; g.ya.call(this);var k=this;this.L=NaN;this.jt=!1;this.J=this.S=this.UK=this.y7=NaN;this.F9=[];this.D=this.X=this.Y=this.V=this.U=null;this.L7=q;this.EK=G;this.F9.push(g.$t(window,"beforeunload",function(){k.iC(2)})); this.W=[];this.V=new MU;this.Tl=a.id;this.f7=a.idType;this.U=MCJ(this.L7,w,this.jJ,this.f7=="shortLived",this.Tl);this.U.listen("channelOpened",function(){W26(k)}); this.U.listen("channelClosed",function(){tR("Channel closed");isNaN(k.L)?To(!0):To();k.dispose()}); this.U.listen("channelError",function(b){To();isNaN(k.e5())?(b==1&&k.f7=="shortLived"&&k.publish("browserChannelAuthError",b),tR("Channel error: "+b+" without reconnection"),k.dispose()):(k.jt=!0,tR("Channel error: "+b+" with reconnection in "+k.e5()+" ms"),v6(k,2))}); this.U.listen("channelMessage",function(b){D96(k,b)}); this.U.Hh(a.token);this.subscribe("remoteQueueChange",function(){var b=k.V.videoId;g.B5()&&g.AE("yt-remote-session-video-id",b)})},R_I=function(q){return g.Z7(q.W,function(a){return a.type=="LOUNGE_SCREEN"})},tR=function(q){aF("conn",q)},v6=function(q,a){q.publish("proxyStateChange",a)},yNK=function(q){q.L=g.ee(function(){tR("Connecting timeout"); q.iC(1)},2E4)},q_c=function(q){g.Yn(q.L); q.L=NaN},gfR=function(q){g.Yn(q.y7); q.y7=NaN},wCl=function(q){a1K(q); q.UK=g.ee(function(){iD(q,"getNowPlaying")},2E4)},a1K=function(q){g.Yn(q.UK); q.UK=NaN},W26=function(q){tR("Channel opened"); q.jt&&(q.jt=!1,gfR(q),q.y7=g.ee(function(){tR("Timing out waiting for a screen.");q.iC(1)},15E3))},kXR=function(q,a){var w=null; if(a){var G=R_I(q);G&&(w={clientName:G.clientName,deviceMake:G.brand,deviceModel:G.model,osVersion:G.osVersion})}g.qe("yt.mdx.remote.remoteClient_",w);a&&(q_c(q),gfR(q));w=q.U.hE()&&isNaN(q.L);a==w?a&&(v6(q,1),iD(q,"getSubtitlesTrack")):a?(q.g3()&&q.V.reset(),v6(q,1),iD(q,"getNowPlaying"),GXK(q)):q.iC(1)},bFx=function(q,a){var w=a.params.videoId; delete a.params.videoId;w==q.V.videoId&&(g.KH(a.params)?q.V.trackData=null:q.V.trackData=a.params,q.publish("remotePlayerChange"))},OFB=function(q,a,w){var G=a.params.videoId||a.params.video_id,k=parseInt(a.params.currentIndex,10); q.V.listId=a.params.listId||q.V.listId;H6(q.V,G,k);q.publish("remoteQueueChange",w)},eYe=function(q,a){a.params=a.params||{}; OFB(q,a,"NOW_PLAYING_MAY_CHANGE");l1c(q,a);q.publish("autoplayDismissed")},l1c=function(q,a){var w=parseInt(a.params.currentTime||a.params.current_time,10); So(q.V,isNaN(w)?0:w);w=parseInt(a.params.state,10);w=isNaN(w)?-1:w;w==-1&&q.V.playerState==-1E3&&(w=-1E3);q.V.playerState=w;w=Number(a.params.loadedTime);q.V.S=isNaN(w)?0:w;q.V.SD(Number(a.params.duration));w=q.V;var G=Number(a.params.liveIngestionTime);w.V=G;w.Y=isNaN(G)?!1:!0;w=q.V;G=Number(a.params.seekableStartTime);a=Number(a.params.seekableEndTime);w.U=isNaN(G)?0:G;w.X=isNaN(a)?0:a;q.V.playerState==1?wCl(q):a1K(q);q.publish("remotePlayerChange")},NIx=function(q,a){if(q.V.playerState!=-1E3){var w= 1085; switch(parseInt(a.params.adState,10)){case 1:w=1081;break;case 2:w=1084;break;case 0:w=1083}q.V.playerState=w;a=parseInt(a.params.currentTime,10);So(q.V,isNaN(a)?0:a);q.publish("remotePlayerChange")}},Y_y=function(q,a){var w=a.params.muted=="true"; q.V.volume=parseInt(a.params.volume,10);q.V.muted=w;q.publish("remotePlayerChange")},PdR=function(q,a){q.X=a.params.videoId; q.publish("nowAutoplaying",parseInt(a.params.timeout,10))},KQc=function(q,a){q.X=a.params.videoId||null; q.publish("autoplayUpNext",q.X)},dww=function(q,a){q.D=a.params.autoplayMode; q.publish("autoplayModeChange",q.D);q.D=="DISABLED"&&q.publish("autoplayDismissed")},TI8=function(q,a){var w=a.params.hasNext=="true"; q.V.IE=a.params.hasPrevious=="true";q.V.HI=w;q.publish("previousNextChange")},D96=function(q,a){a=a.message; a.params?tR("Received: action="+a.action+", params="+g.Xj(a.params)):tR("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=wA(a.params.devices);q.W=g.sd(a,function(G){return new lJ(G)}); a=!!g.Z7(q.W,function(G){return G.type=="LOUNGE_SCREEN"}); kXR(q,a);a=q.wr("mlm");q.publish("multiStateLoopEnabled",a);break;case "loungeScreenDisconnected":g.BR(q.W,function(G){return G.type=="LOUNGE_SCREEN"}); kXR(q,!1);break;case "remoteConnected":var w=new lJ(wA(a.params.device));g.Z7(q.W,function(G){return G.equals(w)})||$LB(q.W,w); break;case "remoteDisconnected":w=new lJ(wA(a.params.device));g.BR(q.W,function(G){return G.equals(w)}); break;case "gracefulDisconnect":break;case "playlistModified":OFB(q,a,"QUEUE_MODIFIED");break;case "nowPlaying":eYe(q,a);break;case "onStateChange":l1c(q,a);break;case "onAdStateChange":NIx(q,a);break;case "onVolumeChanged":Y_y(q,a);break;case "onSubtitlesTrackChanged":bFx(q,a);break;case "nowAutoplaying":PdR(q,a);break;case "autoplayDismissed":q.publish("autoplayDismissed");break;case "autoplayUpNext":KQc(q,a);break;case "onAutoplayModeChanged":dww(q,a);break;case "onHasPreviousNextChanged":TI8(q, a);break;case "requestAssistedSignIn":q.publish("assistedSignInRequested",a.params.authCode);break;case "onLoopModeChanged":q.publish("loopModeChange",a.params.loopMode);break;default:tR("Unrecognized action: "+a.action)}},GXK=function(q){g.Yn(q.J); q.J=g.ee(function(){q.iC(1)},864E5)},iD=function(q,a,w){w?tR("Sending: action="+a+", params="+g.Xj(w)):tR("Sending: action="+a); q.U.sendMessage(a,w)},$wx=function(q){On.call(this,"ScreenServiceProxy"); this.QT=q;this.V=[];this.V.push(this.QT.$_s("screenChange",(0,g.Ne)(this.DE,this)));this.V.push(this.QT.$_s("onlineScreenChange",(0,g.Ne)(this.CFT,this)))},Ef6=function(q,a){$Rl(); if(!$H||!$H.get("yt-remote-disable-remote-module-for-dev")){a=g.UL("MDX_CONFIG")||a;O2w();YHe();W6||(W6=new yT(a?a.loungeApiHost:void 0),stV()&&(W6.V="/api/loungedev"));D_||(D_=g.aB("yt.mdx.remote.deferredProxies_")||[],g.qe("yt.mdx.remote.deferredProxies_",D_));s9B();var w=RF();if(!w){var G=new P6(W6,a?a.disableAutomaticScreenCache||!1:!1);g.qe("yt.mdx.remote.screenService_",G);w=RF();var k={};a&&(k={appId:a.appId,disableDial:a.disableDial,theme:a.theme,loadCastApiSetupScript:a.loadCastApiSetupScript, disableCastApi:a.disableCastApi,enableDialLoungeToken:a.enableDialLoungeToken,enableCastLoungeToken:a.enableCastLoungeToken,forceMirroring:a.forceMirroring});g.qe("yt.mdx.remote.enableConnectWithInitialState_",a?a.enableConnectWithInitialState||!1:!1);S9J(q,G,function(b){b?ym()&&nR(ym(),"YouTube TV"):G.subscribe("onlineScreenChange",function(){sa("yt-remote-receiver-availability-change")})},k)}a&&!g.aB("yt.mdx.remote.initialized_")&&(g.qe("yt.mdx.remote.initialized_",!0),q$("Initializing: "+g.Xj(a)), gT.push(g.i$("yt-remote-cast2-api-ready",function(){sa("yt-remote-api-ready")})),gT.push(g.i$("yt-remote-cast2-availability-change",function(){sa("yt-remote-receiver-availability-change")})),gT.push(g.i$("yt-remote-cast2-receiver-selected",function(){aH(null); sa("yt-remote-auto-connect","cast-selector-receiver")})),gT.push(g.i$("yt-remote-cast2-receiver-resumed",function(){sa("yt-remote-receiver-resumed","cast-selector-receiver")})),gT.push(g.i$("yt-remote-cast2-session-change",FQJ)),gT.push(g.i$("yt-remote-connection-change",function(b){b?nR(ym(),"YouTube TV"):wT()||(nR(null,null),ppU())})),gT.push(g.i$("yt-remote-cast2-session-failed",function(){sa("yt-remote-connection-failed")})),q=Cdx(),a.isAuto&&(q.id+="#dial"),k=a.capabilities||[],k.length>0&&(q.capabilities= k),q.name=a.device,q.app=a.app,(a=a.theme)&&(q.theme=a),q$(" -- with channel params: "+g.Xj(q)),q?(g.AE("yt-remote-session-app",q.app),g.AE("yt-remote-session-name",q.name)):(g.L2("yt-remote-session-app"),g.L2("yt-remote-session-name")),g.qe("yt.mdx.remote.channelParams_",q),w.start(),ym()||ZFw())}},VRx=function(){var q=RF().QT.$_gos(); var a=GP();a&&kh()&&(b2l(q,a)||q.push(a));return kV8(q)},mwy=function(){var q=JWe(); !q&&B6()&&cNJ()&&(q={key:"cast-selector-receiver",name:cNJ()});return q},JWe=function(){var q=VRx(),a=GP(); a||(a=wT());return g.Z7(q,function(w){return a&&Na(a,w.key)?!0:!1})},GP=function(){var q=ym(); if(!q)return null;var a=RF().GY();return Pi(a,q)},FQJ=function(q){q$("remote.onCastSessionChange_: "+YH(q)); if(q){var a=GP();if(a&&a.id==q.id){if(nR(a.id,"YouTube TV"),q.idType=="shortLived"&&(q=q.token))bg&&(bg.token=q),(a=kh())&&a.Hh(q)}else a&&Oc(),lg(q,1)}else kh()&&Oc()},Oc=function(){rf()?LR().stopSession():xo("stopSession called before API ready."); var q=kh();q&&(q.disconnect(1),Q9J(null))},AW8=function(){var q=kh(); return!!q&&q.getProxyState()!=3},q$=function(q){aF("remote",q)},RF=function(){if(!xwc){var q=g.aB("yt.mdx.remote.screenService_"); xwc=q?new $wx(q):null}return xwc},ym=function(){return g.aB("yt.mdx.remote.currentScreenId_")},LQc=function(q){g.qe("yt.mdx.remote.currentScreenId_",q)},BIx=function(){return g.aB("yt.mdx.remote.connectData_")},aH=function(q){g.qe("yt.mdx.remote.connectData_",q)},kh=function(){return g.aB("yt.mdx.remote.connection_")},Q9J=function(q){var a=kh(); aH(null);q||LQc("");g.qe("yt.mdx.remote.connection_",q);D_&&(g.WR(D_,function(w){w(q)}),D_.length=0); a&&!q?sa("yt-remote-connection-change",!1):!a&&q&&sa("yt-remote-connection-change",!0)},wT=function(){var q=g.B5(); if(!q)return null;var a=RF();if(!a)return null;a=a.GY();return Pi(a,q)},lg=function(q,a){ym(); GP()&&GP();if(eB)bg=q;else{LQc(q.id);var w=g.aB("yt.mdx.remote.enableConnectWithInitialState_")||!1;q=new zl(W6,q,Cdx(),w);q.connect(a,BIx());q.subscribe("beforeDisconnect",function(G){sa("yt-remote-before-disconnect",G)}); q.subscribe("beforeDispose",function(){kh()&&(kh(),Q9J(null))}); q.subscribe("browserChannelAuthError",function(){var G=GP();G&&G.idType=="shortLived"&&(rf()?LR().handleBrowserChannelAuthError():xo("refreshLoungeToken called before API ready."))}); Q9J(q)}},ZFw=function(){var q=wT(); q?(q$("Resume connection to: "+YH(q)),lg(q,0)):(To(),ppU(),q$("Skipping connecting because no session screen found."))},s9B=function(){var q=Cdx(); if(g.KH(q)){q=dA();var a=g.xt("yt-remote-session-name")||"",w=g.xt("yt-remote-session-app")||"";q={device:"REMOTE_CONTROL",id:q,name:a,app:w,mdxVersion:3};q.authuser=String(g.UL("SESSION_INDEX","0"));(a=g.UL("DELEGATED_SESSION_ID"))&&(q.pageId=String(a));g.qe("yt.mdx.remote.channelParams_",q)}},Cdx=function(){return g.aB("yt.mdx.remote.channelParams_")||{}},MRw=function(q,a,w){g.c.call(this); var G=this;this.V=q;this.j=a;this.Ir=w;this.events=new g.Ee(this);this.D=!1;this.L=new g.rD(64);this.U=new g.o1(this.o$,500,this);this.W=new g.o1(this.Yr,1E3,this);this.S=new Zf(this.OW7,0,this);this.Y={};this.J=new g.o1(this.H2,1E3,this);this.X=new g.iX(this.seekTo,1E3,this);this.F9=this.events.C(this.j,"onVolumeChange",function(k){rWU(G,k)}); g.p(this,this.events);this.events.C(a,"onCaptionsTrackListChanged",this.T$l);this.events.C(a,"captionschanged",this.mBl);this.events.C(a,"captionssettingschanged",this.t6);this.events.C(a,"videoplayerreset",this.sR);this.events.C(a,"mdxautoplaycancel",function(){G.Ir.sJ()}); a.T("enable_mdx_video_play_directly")&&this.events.C(a,"videodatachange",function(){nfV(G.V)||N$(G)||Yh(G,0)}); q=this.Ir;q.t2();q.subscribe("proxyStateChange",this.pJ,this);q.subscribe("remotePlayerChange",this.Zp,this);q.subscribe("remoteQueueChange",this.sR,this);q.subscribe("previousNextChange",this.Hf,this);q.subscribe("nowAutoplaying",this.oZ,this);q.subscribe("autoplayDismissed",this.K_,this);g.p(this,this.U);g.p(this,this.W);g.p(this,this.S);g.p(this,this.J);g.p(this,this.X);this.t6();this.sR();this.Zp()},rWU=function(q,a){if(N$(q)){q.Ir.unsubscribe("remotePlayerChange",q.Zp,q); var w=Math.round(a.volume);a=!!a.muted;var G=Un(q.Ir);if(w!==G.volume||a!==G.muted)q.Ir.setVolume(w,a),q.J.start();q.Ir.subscribe("remotePlayerChange",q.Zp,q)}},hYR=function(q){q.EQ(0); q.U.stop();q.UQ(new g.rD(64))},S_R=function(q,a){if(N$(q)&&!q.D){var w=null; a&&(w={style:q.j.getSubtitlesUserSettings()},Object.assign(w,a));q.Ir.G_(q.j.getVideoData(1).videoId,w);q.Y=Un(q.Ir).trackData}},Yh=function(q,a){var w=q.j.getPlaylist(); if(w==null?0:w.listId){var G=w.index;var k=w.listId.toString()}w=q.j.getVideoData(1);q.Ir.playVideo(w.videoId,a,G,k,w.playerParams,w.L7,TFy(w));q.UQ(new g.rD(1))},f1U=function(q,a){if(a){var w=q.j.getOption("captions","tracklist",{Ln:1}); w&&w.length?(q.j.setOption("captions","track",a),q.D=!1):(q.j.loadModule("captions"),q.D=!0)}else q.j.setOption("captions","track",{})},N$=function(q){return Un(q.Ir).videoId===q.j.getVideoData(1).videoId},HFR=function(q,a){g.uR.call(this,q); this.V=a},PW=function(){g.u.call(this,{G:"div", N:"ytp-mdx-popup-dialog",Z:{role:"dialog"},K:[{G:"div",N:"ytp-mdx-popup-dialog-inner-content",K:[{G:"div",N:"ytp-mdx-popup-title",ue:"You're signed out"},{G:"div",N:"ytp-mdx-popup-description",ue:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{G:"div",N:"ytp-mdx-privacy-popup-buttons",K:[{G:"button",vT:["ytp-button","ytp-mdx-privacy-popup-cancel"],ue:"Cancel"},{G:"button",vT:["ytp-button", "ytp-mdx-privacy-popup-confirm"],ue:"Confirm"}]}]}]});this.fade=new g.zs(this,250);this.cancelButton=this.oW("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.oW("ytp-mdx-privacy-popup-confirm");g.p(this,this.fade);this.C(this.cancelButton,"click",this.V);this.C(this.confirmButton,"click",this.U)},KL=function(q){g.u.call(this,{G:"div", N:"ytp-remote",K:[{G:"div",N:"ytp-remote-display-status",K:[{G:"div",N:"ytp-remote-display-status-icon",K:[g.eAJ()]},{G:"div",N:"ytp-remote-display-status-text",ue:"{{statustext}}"}]}]});this.api=q;this.fade=new g.zs(this,250);g.p(this,this.fade);this.C(q,"presentingplayerstatechange",this.onStateChange);this.gG(q.getPlayerStateObject())},dT=function(q,a){g.HP.call(this,"Play on",1,q,a); this.j=q;this.pP={};this.C(q,"onMdxReceiversChange",this.Y);this.C(q,"presentingplayerstatechange",this.Y);this.Y()},cWx=function(q){g.md.call(this,q); this.yr={key:GVe(),name:"This computer"};this.FV=null;this.subscriptions=[];this.Is=this.Ir=null;this.pP=[this.yr];this.uW=this.yr;this.xw=new g.rD(64);this.Zs=0;this.ow=-1;this.YC=!1;this.Gn=this.yP=this.W_=null;if(!g.b0(this.player.B())&&!g.BA(this.player.B())){q=this.player;var a=g.MT(q);a&&(a=a.cW())&&(a=new dT(q,a),g.p(this,a));a=new KL(q);g.p(this,a);g.DZ(q,a.element,4);this.W_=new PW;g.p(this,this.W_);g.DZ(q,this.W_.element,4);this.YC=!!wT()}},TP=function(q){q.yP&&(q.player.removeEventListener("presentingplayerstatechange", q.yP),q.yP=null)},pCJ=function(q,a,w){q.xw=w; q.player.publish("presentingplayerstatechange",new g.km(w,a))},$h=function(q,a){if(a.key!==q.uW.key)if(a.key===q.yr.key)Oc(); else if(nfV(q)&&UwJ(q),q.uW=a,!q.player.B().T("disable_mdx_connection_in_mdx_module_for_music_web")||!g.BA(q.player.B())){var w=q.player.getPlaylistId();var G=q.player.getVideoData(1);var k=G.videoId;if(!w&&!k||(q.player.getAppState()===2||q.player.getAppState()===1)&&q.player.B().T("should_clear_video_data_on_player_cued_unstarted"))G=null;else{var b=q.player.getPlaylist();if(b){var O=[];for(var e=0;e2*this.size&&Oa(this),!0):!1}; g.C.get=function(q,a){return kH(this.U,q)?this.U[q]:a}; g.C.set=function(q,a){kH(this.U,q)||(this.size+=1,this.V.push(q),this.V4++);this.U[q]=a}; g.C.forEach=function(q,a){for(var w=this.SH(),G=0;G=G.V.length)return g.lT;var b=G.V[a++];return g.my(q?b:G.U[b])}; return k}; var hu6={l9B:"atp",yGW:"ska",ew7:"que",huK:"mus",qMG:"sus",fOT:"dsp",zwG:"seq",XIT:"mic",TT8:"dpa",kY7:"mlm",E37:"dsdtr",BkK:"ntb",Il7:"vsp",CD8:"scn",XcG:"rpe",LPT:"dcn",Dzh:"dcp",qoT:"pas",tc2:"drq",Jme:"opf",xz8:"els",PDB:"isg",ImB:"svq",b3G:"mvp",l87:"ads",R0B:"stcp",V_T:"sads",pQ7:"dloc",n3T:"dcw",NtG:"asw",MGQ:"apw"},SF7={mZl:"u",I9T:"cl",uB2:"k",M77:"i",cKG:"cr",Pr2:"m",F7B:"g",mL:"up"},FNV={hR:"adPlaying",g0:"onAdStateChange"},C$6={myG:"nowPlaying",VDG:"onStateChange",hR:"adPlaying",g0:"onAdStateChange", NI:"nowPlayingShorts",kG:"onShortsStateChange"},ZBx={NI:"nowPlayingShorts",kG:"onShortsStateChange"};lJ.prototype.equals=function(q){return q?this.id==q.id:!1}; var Ng6="",$H=null;g.Z(FBK,g.nj);var Fm,AEe=Z26("loadCastFramework")||Z26("loadCastApplicationFramework"),Bgy=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.TJ(Zf,g.c);g.C=Zf.prototype;g.C.JY=function(q){this.Y=arguments;this.V=!1;this.bK?this.W=g.Kw()+this.AL:this.bK=g.HO(this.D,this.AL)}; g.C.stop=function(){this.bK&&(g.yV.clearTimeout(this.bK),this.bK=null);this.W=null;this.V=!1;this.Y=[]}; g.C.pause=function(){++this.U}; g.C.resume=function(){this.U&&(--this.U,!this.U&&this.V&&(this.V=!1,this.L.apply(null,this.Y)))}; g.C.qB=function(){this.stop();Zf.mG.qB.call(this)}; g.C.rX=function(){this.bK&&(g.yV.clearTimeout(this.bK),this.bK=null);this.W?(this.bK=g.HO(this.D,this.W-g.Kw()),this.W=null):this.U?this.V=!0:(this.V=!1,this.L.apply(null,this.Y))};Ea.prototype.stringify=function(q){return g.yV.JSON.stringify(q,void 0)}; Ea.prototype.parse=function(q){return g.yV.JSON.parse(q,void 0)};g.TJ(ntc,g.t1);g.TJ(M2U,g.t1);var hAe=null;g.TJ(fnx,g.t1);g.TJ(H2y,g.t1);g.TJ(cEy,g.t1);QT.prototype.debug=function(){}; QT.prototype.info=function(){}; QT.prototype.warning=function(){};var t28={},utc={};g.C=AT.prototype;g.C.setTimeout=function(q){this.BT=q}; g.C.aS=function(q){q=q.target;var a=this.St;a&&g.vO(q)==3?a.qq():this.Sl(q)}; g.C.Sl=function(q){try{if(q==this.V)a:{var a=g.vO(this.V),w=this.V.U,G=this.V.getStatus();if(!(a<3)&&(a!=3||this.V&&(this.U.W||g.iy(this.V)||g.WO(this.V)))){this.EK||a!=4||w==7||(w==8||G<=0?VT(3):VT(2));i28(this);var k=this.V.getStatus();this.OA=k;var b=InB(this);if(this.L=k==200){if(this.uF&&!this.le){b:{if(this.V){var O=g.DG(this.V,"X-HTTP-Initial-Response");if(O&&!g.rn(O)){var e=O;break b}}e=null}if(q=e)this.le=!0,GAU(this,q);else{this.L=!1;this.D=3;JT(12);LY(this);Bi(this);break a}}if(this.f7){q= !0;for(var N;!this.EK&&this.X0&&!this.yN&&(this.yN=!0,this.W.U_(this)):(LY(this),Bi(this))}else GAU(this,b);a==4&&LY(this);this.L&&!this.EK&&(a==4?WBx(this.W,this):(this.L=!1,xH(this)))}else g.FyU(this.V),k==400&&b.indexOf("Unknown SID")> 0?(this.D=3,JT(12)):(this.D=0,JT(13)),LY(this),Bi(this)}}}catch(Y){}finally{}}; g.C.cancel=function(){this.EK=!0;LY(this)}; g.C.Vk=function(){this.F9=null;var q=Date.now();q-this.IW>=0?(this.Tl!=2&&(VT(3),JT(17)),LY(this),this.D=2,Bi(this)):zAc(this,this.IW-q)}; g.C.getLastError=function(){return this.D}; g.C.Hu=function(){return this.V};bIK.prototype.cancel=function(){this.W=lj8(this);if(this.U)this.U.cancel(),this.U=null;else if(this.V&&this.V.size!==0){for(var q=g.V(this.V.values()),a=q.next();!a.done;a=q.next())a.value.cancel();this.V.clear()}};g.C=PYK.prototype;g.C.Av=8;g.C.zA=1;g.C.connect=function(q,a,w,G){JT(0);this.Ck=q;this.EK=a||{};w&&G!==void 0&&(this.EK.OSID=w,this.EK.OAID=G);this.le=this.Ai;this.L7=g7V(this,null,this.Ck);hT(this)}; g.C.disconnect=function(){dFx(this);if(this.zA==3){var q=this.A2++,a=this.L7.clone();g.ed(a,"SID",this.Y);g.ed(a,"RID",q);g.ed(a,"TYPE","terminate");Hi(this,a);q=new AT(this,this.Y,q);q.Tl=2;q.S=gA(a.clone());a=!1;if(g.yV.navigator&&g.yV.navigator.sendBeacon)try{a=g.yV.navigator.sendBeacon(q.S.toString(),"")}catch(w){}!a&&g.yV.Image&&((new Image).src=q.S,a=!0);a||(q.V=jte(q.W,null),q.V.send(q.S));q.y7=Date.now();xH(q)}ZIR(this)}; g.C.A$=function(){return this.zA==0}; g.C.getState=function(){return this.zA}; g.C.ZP=function(q){if(this.L)if(this.L=null,this.zA==1){if(!q){this.A2=Math.floor(Math.random()*1E5);q=this.A2++;var a=new AT(this,"",q),w=this.J;this.uF&&(w?(w=g.$I(w),g.FE(w,this.uF)):w=this.uF);this.X!==null||this.IW||(a.L7=w,w=null);var G;if(this.VN)a:{for(var k=G=0;k4096){G=k;break a}if(G===4096||k===this.W.length-1){G=k+1;break a}}G= 1E3}else G=1E3;G=swe(this,a,G);k=this.L7.clone();g.ed(k,"RID",q);g.ed(k,"CVER",22);this.f7&&g.ed(k,"X-HTTP-Session-Id",this.f7);Hi(this,k);w&&(this.IW?G="headers="+g.x1(g.UEj(w))+"&"+G:this.X&&g.KJ(k,this.X,w));qPe(this.U,a);this.XN&&g.ed(k,"TYPE","init");this.VN?(g.ed(k,"$req",G),g.ed(k,"SID","null"),a.uF=!0,X58(a,k,null)):X58(a,k,G);this.zA=2}}else this.zA==3&&(q?FJ6(this,q):this.W.length==0||OIx(this.U)||FJ6(this))}; g.C.zo=function(){this.S=null;CYl(this);if(this.OQ&&!(this.BT||this.V==null||this.L0<=0)){var q=4*this.L0;this.jt=m7((0,g.Ne)(this.sWl,this),q)}}; g.C.sWl=function(){this.jt&&(this.jt=null,this.le=!1,this.BT=!0,JT(10),nY(this),CYl(this))}; g.C.U_=function(q){this.V==q&&this.OQ&&!this.BT&&(KJV(this),this.BT=!0,JT(11))}; g.C.Fo=function(){this.F9!=null&&(this.F9=null,nY(this),RAU(this),JT(19))}; g.C.ge9=function(q){q?JT(2):JT(1)}; g.C.isActive=function(){return!!this.D&&this.D.isActive(this)}; g.C=VIx.prototype;g.C.KA=function(){}; g.C.mJ=function(){}; g.C.sf=function(){}; g.C.BB=function(){}; g.C.isActive=function(){return!0}; g.C.UV=function(){};g.TJ(pY,g.PO);pY.prototype.open=function(){this.V.D=this.W;this.L&&(this.V.Tl=!0);this.V.connect(this.D,this.U||void 0)}; pY.prototype.close=function(){this.V.disconnect()}; pY.prototype.send=function(q){var a=this.V;if(typeof q==="string"){var w={};w.__data__=q;q=w}else this.Y&&(w={},w.__data__=g.Xj(q),q=w);a.W.push(new kAy(a.ke++,q));a.zA==3&&hT(a)}; pY.prototype.qB=function(){this.V.D=null;delete this.W;this.V.disconnect();delete this.V;pY.mG.qB.call(this)}; g.TJ(mFy,ntc);g.TJ(Qwe,M2U);g.TJ(ci,VIx);ci.prototype.KA=function(){this.V.dispatchEvent("m")}; ci.prototype.mJ=function(q){this.V.dispatchEvent(new mFy(q))}; ci.prototype.sf=function(q){this.V.dispatchEvent(new Qwe(q))}; ci.prototype.BB=function(){this.V.dispatchEvent("n")}; A2y.prototype.commit=function(q){this.V.OA=q};var Xm=new g.PO;g.Z(LJI,g.t1);g.C=o7.prototype;g.C.qA=null;g.C.hO=!1;g.C.xN=null;g.C.WX=null;g.C.EZ=null;g.C.al=null;g.C.Li=null;g.C.Vl=null;g.C.y4=null;g.C.qz=null;g.C.U5=0;g.C.Z4=null;g.C.FE=null;g.C.Q4=null;g.C.tP=-1;g.C.Cj=!0;g.C.DQ=!1;g.C.O4=0;g.C.rN=null;var SPI={},h9c={};g.C=o7.prototype;g.C.setTimeout=function(q){this.U=q}; g.C.OV=function(q){q=q.target;var a=this.rN;a&&g.vO(q)==3?a.qq():this.Io(q)}; g.C.Io=function(q){try{if(q==this.qz)a:{var a=g.vO(this.qz),w=this.qz.U,G=this.qz.getStatus();if(g.NP&&!g.UX("420+")){if(a<4)break a}else if(a<3||a==3&&!g.iy(this.qz))break a;this.DQ||a!=4||w==7||(w==8||G<=0?this.V.ZG(3):this.V.ZG(2));c2K(this);var k=this.qz.getStatus();this.tP=k;var b=g.iy(this.qz);if(this.hO=k==200){a==4&&I7(this);if(this.f7){for(q=!0;!this.DQ&&this.U50?(this.Q4=3,jP(13)):(this.Q4=0,jP(14)),I7(this),phw(this)}}catch(e){}finally{}}; g.C.cancel=function(){this.DQ=!0;I7(this)}; g.C.d7=function(){this.xN=null;var q=Date.now();q-this.WX>=0?(this.al!=2&&this.V.ZG(3),I7(this),this.Q4=2,jP(18),phw(this)):HIU(this,this.WX-q)}; g.C.getLastError=function(){return this.Q4};g.C=o78.prototype;g.C.Q3=null;g.C.JJ=null;g.C.tM=!1;g.C.oD=null;g.C.ZD=null;g.C.Ub=-1;g.C.dj=null;g.C.LK=null;g.C.connect=function(q){this.oD=q;q=tT(this.V,null,this.oD);jP(3);Date.now();var a=this.V.J;a!=null?(this.dj=a[0],(this.LK=a[1])?(this.ZD=1,Ijl(this)):(this.ZD=2,u4J(this))):(a7(q,"MODE","init"),this.JJ=new o7(this),this.JJ.qA=this.Q3,n7U(this.JJ,q,!1,null,!0),this.ZD=0)}; g.C.T1=function(q){if(q)this.ZD=2,u4J(this);else{jP(4);var a=this.V;a.HC=a.Um.Ub;Wi(a,9)}q&&this.ZG(2)}; g.C.qL=function(q){return this.V.qL(q)}; g.C.abort=function(){this.JJ&&(this.JJ.cancel(),this.JJ=null);this.Ub=-1}; g.C.A$=function(){return!1}; g.C.Jv=function(q,a){this.Ub=q.tP;if(this.ZD==0)if(a){try{var w=this.U.parse(a)}catch(G){q=this.V;q.HC=this.Ub;Wi(q,2);return}this.dj=w[0];this.LK=w[1]}else q=this.V,q.HC=this.Ub,Wi(q,2);else this.ZD==2&&(this.tM?(jP(7),Date.now()):a=="11111"?(jP(6),this.tM=!0,Date.now(),this.Ub=200,this.JJ.cancel(),jP(12),vi(this.V,this,!0)):(jP(8),Date.now(),this.tM=!1))}; g.C.y3=function(){this.Ub=this.JJ.tP;if(this.JJ.hO)this.ZD==0?this.LK?(this.ZD=1,Ijl(this)):(this.ZD=2,u4J(this)):this.ZD==2&&(this.tM?(jP(12),vi(this.V,this,!0)):(jP(11),vi(this.V,this,!1)));else{this.ZD==0?jP(9):this.ZD==2&&jP(10);var q=this.V;this.JJ.getLastError();q.HC=this.Ub;Wi(q,2)}}; g.C.eT=function(){return this.V.eT()}; g.C.isActive=function(){return this.V.isActive()}; g.C.ZG=function(q){this.V.ZG(q)};g.C=tIw.prototype;g.C.BI=null;g.C.TW=null;g.C.qX=null;g.C.J$=null;g.C.cX=null;g.C.O5=null;g.C.rL=null;g.C.Yq=null;g.C.Xq=0;g.C.Wj=0;g.C.Z8=null;g.C.Ph=null;g.C.Ob=null;g.C.Y6=null;g.C.Um=null;g.C.hN=null;g.C.Aw=-1;g.C.VC=-1;g.C.HC=-1;g.C.SN=0;g.C.Cx=0;g.C.o5=8;var XCU={OK:0,gU8:2,LnB:4,Kn7:5,sPT:6,STOP:7,MI:8,gLT:9,M2Q:10,waQ:11,wm8:12};g.TJ(z98,g.t1);g.TJ(iIw,g.t1);g.C=tIw.prototype; g.C.connect=function(q,a,w,G,k){jP(0);this.cX=a;this.TW=w||{};G&&k!==void 0&&(this.TW.OSID=G,this.TW.OAID=k);this.S?(Ua((0,g.Ne)(this.Tv,this,q),100),DFV(this)):this.Tv(q)}; g.C.disconnect=function(){R9w(this);if(this.V==3){var q=this.Xq++,a=this.O5.clone();g.ed(a,"SID",this.Y);g.ed(a,"RID",q);g.ed(a,"TYPE","terminate");iJ(this,a);q=new o7(this,this.Y,q);q.al=2;q.Li=gA(a.clone());(new Image).src=q.Li.toString();q.EZ=Date.now();MIV(q)}l2x(this)}; g.C.Tv=function(q){this.Um=new o78(this);this.Um.Q3=this.BI;this.Um.U=this.D;this.Um.connect(q)}; g.C.A$=function(){return this.V==0}; g.C.getState=function(){return this.V}; g.C.UX=function(q){this.Ph=null;w0J(this,q)}; g.C.FR=function(){this.Ob=null;this.J$=new o7(this,this.Y,"rpc",this.X);this.J$.qA=this.BI;this.J$.O4=0;var q=this.rL.clone();g.ed(q,"RID","rpc");g.ed(q,"SID",this.Y);g.ed(q,"CI",this.hN?"0":"1");g.ed(q,"AID",this.Aw);iJ(this,q);g.ed(q,"TYPE","xmlhttp");n7U(this.J$,q,!0,this.Yq,!1)}; g.C.Jv=function(q,a){if(this.V!=0&&(this.J$==q||this.qX==q))if(this.HC=q.tP,this.qX==q&&this.V==3)if(this.o5>7){try{var w=this.D.parse(a)}catch(G){w=null}if(Array.isArray(w)&&w.length==3)if(q=w,q[0]==0)a:{if(!this.Ob){if(this.J$)if(this.J$.EZ+3E30)){if(G=a==1)this.qX||this.Ph||this.V==1||this.SN>=2?G=!1:(this.Ph=Ua((0,g.Ne)(this.UX,this,q),kZx(this,this.SN)),this.SN++, G=!0);G=!(G||a==2&&bBV(this))}if(G)switch(w){case 1:Wi(this,5);break;case 4:Wi(this,10);break;case 3:Wi(this,6);break;case 7:Wi(this,12);break;default:Wi(this,2)}}}; g.C.u3=function(q){if(!g.Vx(arguments,this.V))throw Error("Unexpected channel state: "+this.V);}; g.C.wHW=function(q){q?jP(2):(jP(1),OBI(this,8))}; g.C.qL=function(q){if(q)throw Error("Can't create secondary domain capable XhrIo object.");q=new g.Il;q.X=!1;return q}; g.C.isActive=function(){return!!this.Z8&&this.Z8.isActive(this)}; g.C.ZG=function(q){var a=Xm;a.dispatchEvent(new iIw(a,q))}; g.C.eT=function(){return!1}; g.C=eDJ.prototype;g.C.u$=function(){}; g.C.OX=function(){}; g.C.Wn=function(){}; g.C.dg=function(){}; g.C.Ge=function(){}; g.C.q6=function(){return{}}; g.C.isActive=function(){return!0};g.C=Nec.prototype;g.C.enqueue=function(q){this.U.push(q)}; g.C.isEmpty=function(){return this.V.length===0&&this.U.length===0}; g.C.clear=function(){this.V=[];this.U=[]}; g.C.contains=function(q){return g.Vx(this.V,q)||g.Vx(this.U,q)}; g.C.remove=function(q){var a=this.V;var w=(0,g.Uex)(a,q);w>=0?(g.Jl(a,w),a=!0):a=!1;return a||g.mU(this.U,q)}; g.C.ip=function(){for(var q=[],a=this.V.length-1;a>=0;--a)q.push(this.V[a]);a=this.U.length;for(var w=0;w=j9B.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(q=j9B[this.U],this.bK=g.ee((0,g.Ne)(this.rV,this),q),this.U++):this.publish("pairingFailed",Error("Server error "+q.status))}; g.C.cj=function(){this.V=null;this.publish("pairingFailed",Error("Server not responding"))}; var j9B=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.TJ(eo,On);g.C=eo.prototype;g.C.start=function(){lD(this)&&this.publish("screenChange");!g.xt("yt-remote-lounge-token-expiration")&&u3V(this);g.Yn(this.V);this.V=g.ee((0,g.Ne)(this.start,this),1E4)}; g.C.add=function(q,a){lD(this);X0w(this,q);NU(this,!1);this.publish("screenChange");a(q);q.token||u3V(this)}; g.C.remove=function(q,a){var w=lD(this);o3J(this,q)&&(NU(this,!1),w=!0);a(q);w&&this.publish("screenChange")}; g.C.kH=function(q,a,w,G){var k=lD(this),b=this.get(q.id);b?(b.name!=a&&(b.name=a,NU(this,!1),k=!0),w(q)):G(Error("no such local screen."));k&&this.publish("screenChange")}; g.C.qB=function(){g.Yn(this.V);eo.mG.qB.call(this)}; g.C.Sq=function(q){lD(this);var a=this.screens.length;q=q&&q.screens||[];for(var w=q.length,G=0;G20)break a;e=a(b,O)}b=e}k.name=b}w(KR(this,k))},this), onError:(0,g.Ne)(function(k){G(Error("pairing request failed: "+k.status))},this), onTimeout:(0,g.Ne)(function(){G(Error("pairing request timed out."))},this)})}; g.C.qB=function(){g.wB(this.U);g.wB(this.V);P6.mG.qB.call(this)}; g.C.Vw=function(){wp7(this);this.publish("screenChange");this.V.update()}; P6.prototype.dispose=P6.prototype.dispose;g.TJ(df,g.ya);g.C=df.prototype;g.C.Mz=function(q){this.t2()||(q&&($o(this,""+q),this.publish("sessionFailed")),this.V=null,this.publish("sessionScreen",null))}; g.C.info=function(q){aF(this.f7,q)}; g.C.Yd=function(){return null}; g.C.BL=function(q){var a=this.U;q?(a.displayStatus=new chrome.cast.ReceiverDisplayStatus(q,[]),a.displayStatus.showStop=!0):a.displayStatus=null;chrome.cast.setReceiverDisplayStatus(a,(0,g.Ne)(function(){this.info("Updated receiver status for "+a.friendlyName+": "+q)},this),(0,g.Ne)(function(){$o(this,"Failed to update receiver status for: "+a.friendlyName)},this))}; g.C.qB=function(){this.BL("");df.mG.qB.call(this)};g.Z(sn,df);g.C=sn.prototype;g.C.zM=function(q){if(this.W){if(this.W==q)return;$o(this,"Overriding cast session with new session object");TWc(this);this.y7=!1;this.J="unknown";this.W.removeUpdateListener(this.UK);this.W.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jt)}this.W=q;this.W.addUpdateListener(this.UK);this.W.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.jt);NW8(this,"getMdxSessionStatus")}; g.C.DB=function(q){this.info("launchWithParams no-op for Cast: "+g.Xj(q))}; g.C.stop=function(){this.W?this.W.stop((0,g.Ne)(function(){this.Mz()},this),(0,g.Ne)(function(){this.Mz(Error("Failed to stop receiver app."))},this)):this.Mz(Error("Stopping cast device without session."))}; g.C.BL=function(){}; g.C.qB=function(){this.info("disposeInternal");TWc(this);this.W&&(this.W.removeUpdateListener(this.UK),this.W.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jt));this.W=null;df.prototype.qB.call(this)}; g.C.Nz8=function(q,a){if(!this.t2())if(a)if(a=wA(a),g.bV(a))switch(q=""+a.type,a=a.data||{},this.info("onYoutubeMessage_: "+q+" "+g.Xj(a)),q){case "mdxSessionStatus":O5w(this,a);break;case "loungeToken":Y9U(this,a);break;default:$o(this,"Unknown youtube message: "+q)}else $o(this,"Unable to parse message.");else $o(this,"No data in message.")}; g.C.S$=function(q,a,w,G){g.Yn(this.S);this.S=0;q97(this.Y,this.U.label,q,this.U.friendlyName,(0,g.Ne)(function(k){k?a(k):G>=0?($o(this,"Screen "+q+" appears to be offline. "+G+" retries left."),this.S=g.ee((0,g.Ne)(this.S$,this,q,a,w,G-1),300)):w(Error("Unable to fetch screen."))},this),w)}; g.C.Yd=function(){return this.W}; g.C.jE=function(q){this.t2()||q||($o(this,"Cast session died."),this.Mz())};g.Z(Fz,df);g.C=Fz.prototype;g.C.zM=function(q){this.W=q;this.W.addUpdateListener(this.EK)}; g.C.DB=function(q){this.L7=q;this.F9()}; g.C.stop=function(){JNV(this);this.W?this.W.stop((0,g.Ne)(this.Mz,this,null),(0,g.Ne)(this.Mz,this,"Failed to stop DIAL device.")):this.Mz()}; g.C.qB=function(){JNV(this);this.W&&this.W.removeUpdateListener(this.EK);this.W=null;df.prototype.qB.call(this)}; g.C.Hj=function(q){this.t2()||q||($o(this,"DIAL session died."),this.D(),this.D=function(){},this.Mz())};g.Z(En,df);En.prototype.stop=function(){this.Mz()}; En.prototype.zM=function(){}; En.prototype.DB=function(){g.Yn(this.W);this.W=NaN;var q=Pi(this.Y.GY(),this.U.label);q?Tl(this,q):this.Mz(Error("No such screen"))}; En.prototype.qB=function(){g.Yn(this.W);this.W=NaN;df.prototype.qB.call(this)};g.Z(Vm,g.ya);g.C=Vm.prototype; g.C.init=function(q,a){chrome.cast.timeout.requestSession=3E4;var w=new chrome.cast.SessionRequest(this.S,[chrome.cast.Capability.AUDIO_OUT]);g.dF("desktop_enable_cast_connect")&&(w.androidReceiverCompatible=!0);this.J||(w.dialRequest=new chrome.cast.DialRequest("YouTube"));var G=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;q=q||this.L?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var k=(0,g.Ne)(this.PKT,this);w=new chrome.cast.ApiConfig(w,(0,g.Ne)(this.eB, this),k,G,q);w.customDialLaunchCallback=(0,g.Ne)(this.qA7,this);chrome.cast.initialize(w,(0,g.Ne)(function(){this.t2()||(chrome.cast.addReceiverActionListener(this.D),HB6(),this.U.subscribe("onlineScreenChange",(0,g.Ne)(this.cn,this)),this.W=ANB(this),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.Ne)(function(b){this.qH("Failed to set initial custom receivers: "+g.Xj(b))},this)),this.publish("yt-remote-cast2-availability-change",m8(this)),a(!0))},this),(0,g.Ne)(function(b){this.qH("Failed to initialize API: "+ g.Xj(b)); a(!1)},this))}; g.C.IeK=function(q,a){JR("Setting connected screen ID: "+q+" -> "+a);if(this.V){var w=this.V.V;if(!q||w&&w.id!=q)JR("Unsetting old screen status: "+this.V.U.friendlyName),Qm(this,null)}if(q&&a){if(!this.V){q=Pi(this.U.GY(),q);if(!q){JR("setConnectedScreenStatus: Unknown screen.");return}if(q.idType=="shortLived"){JR("setConnectedScreenStatus: Screen with id type to be short lived.");return}w=m9V(this,q);w||(JR("setConnectedScreenStatus: Connected receiver not custom..."),w=new chrome.cast.Receiver(q.uuid? q.uuid:q.id,q.name),w.receiverType=chrome.cast.ReceiverType.CUSTOM,this.W.push(w),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.Ne)(function(G){this.qH("Failed to set initial custom receivers: "+g.Xj(G))},this))); JR("setConnectedScreenStatus: new active receiver: "+w.friendlyName);Qm(this,new En(this.U,w),!0)}this.V.BL(a)}else JR("setConnectedScreenStatus: no screen.")}; g.C.ayT=function(q){this.t2()?this.qH("Setting connection data on disposed cast v2"):this.V?this.V.DB(q):this.qH("Setting connection data without a session")}; g.C.vj=function(){this.t2()?this.qH("Stopping session on disposed cast v2"):this.V?(this.V.stop(),Qm(this,null)):JR("Stopping non-existing session")}; g.C.requestSession=function(){chrome.cast.requestSession((0,g.Ne)(this.eB,this),(0,g.Ne)(this.Wy7,this))}; g.C.qB=function(){this.U.unsubscribe("onlineScreenChange",(0,g.Ne)(this.cn,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.D);var q=hD7,a=g.aB("yt.mdx.remote.debug.handlers_");g.mU(a||[],q);g.wB(this.V);g.ya.prototype.qB.call(this)}; g.C.qH=function(q){aF("Controller",q)}; g.C.XK=function(q,a){this.V==q&&(a||Qm(this,null),this.publish("yt-remote-cast2-session-change",a))}; g.C.k07=function(q,a){if(!this.t2())if(q)switch(q.friendlyName=chrome.cast.unescape(q.friendlyName),JR("onReceiverAction_ "+q.label+" / "+q.friendlyName+"-- "+a),a){case chrome.cast.ReceiverAction.CAST:if(this.V)if(this.V.U.label!=q.label)JR("onReceiverAction_: Stopping active receiver: "+this.V.U.friendlyName),this.V.stop();else{JR("onReceiverAction_: Casting to active receiver.");this.V.V&&this.publish("yt-remote-cast2-session-change",this.V.V);break}switch(q.receiverType){case chrome.cast.ReceiverType.CUSTOM:Qm(this, new En(this.U,q));break;case chrome.cast.ReceiverType.DIAL:Qm(this,new Fz(this.U,q,this.Y,this.config_));break;case chrome.cast.ReceiverType.CAST:Qm(this,new sn(this.U,q,this.config_));break;default:this.qH("Unknown receiver type: "+q.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.V&&this.V.U.label==q.label?this.V.stop():this.qH("Stopping receiver w/o session: "+q.friendlyName)}else this.qH("onReceiverAction_ called without receiver.")}; g.C.qA7=function(q){if(this.t2())return Promise.reject(Error("disposed"));var a=q.receiver;a.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.qH("Not DIAL receiver: "+a.friendlyName),a.receiverType=chrome.cast.ReceiverType.DIAL);var w=this.V?this.V.U:null;if(!w||w.label!=a.label)return this.qH("Receiving DIAL launch request for non-clicked DIAL receiver: "+a.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(w&&w.label==a.label&&w.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.V.V)return JR("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.V.V),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.qH('Changing CAST intent from "'+w.receiverType+'" to "dial" for '+a.friendlyName);Qm(this,new Fz(this.U,a,this.Y,this.config_))}a=this.V;a.S=q;a.S.appState==chrome.cast.DialAppState.RUNNING?(q=a.S.extraData||{},w=q.screenId||null,CR(a)&&q.loungeToken?q.loungeTokenRefreshIntervalMs?q=Z5B(a,{name:a.U.friendlyName,screenId:q.screenId,loungeToken:q.loungeToken,dialId:a.S.receiver.label, screenIdType:"shortLived"},q.loungeTokenRefreshIntervalMs):(g.ux(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(q)+".")),q=E5K(a,w)):q=E5K(a,w)):q=F2R(a);return q}; g.C.eB=function(q){var a=this;if(!this.t2()&&!this.L){JR("New cast session ID: "+q.sessionId);var w=q.receiver;if(w.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.V)if(w.receiverType==chrome.cast.ReceiverType.CAST)JR("Got resumed cast session before resumed mdx connection."),w.friendlyName=chrome.cast.unescape(w.friendlyName),Qm(this,new sn(this.U,w,this.config_),!0);else{this.qH("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var G=this.V.U,k=Pi(this.U.GY(), G.label);k&&Na(k,w.label)&&G.receiverType!=chrome.cast.ReceiverType.CAST&&w.receiverType==chrome.cast.ReceiverType.CAST&&(JR("onSessionEstablished_: manual to cast session change "+w.friendlyName),g.wB(this.V),this.V=new sn(this.U,w,this.config_),this.V.subscribe("sessionScreen",(0,g.Ne)(this.XK,this,this.V)),this.V.subscribe("sessionFailed",function(){return QGR(a,a.V)}),this.V.DB(null)); this.V.zM(q)}}}; g.C.RS=function(){return this.V?this.V.Yd():null}; g.C.Wy7=function(q){this.t2()||(this.qH("Failed to estabilish a session: "+g.Xj(q)),q.code!=chrome.cast.ErrorCode.CANCEL&&Qm(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.C.PKT=function(q){JR("Receiver availability updated: "+q);if(!this.t2()){var a=m8(this);this.X=q==chrome.cast.ReceiverAvailability.AVAILABLE;m8(this)!=a&&this.publish("yt-remote-cast2-availability-change",m8(this))}}; g.C.cn=function(){this.t2()||(this.W=ANB(this),JR("Updating custom receivers: "+g.Xj(this.W)),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.Ne)(function(){this.qH("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",m8(this)))}; Vm.prototype.setLaunchParams=Vm.prototype.ayT;Vm.prototype.setConnectedScreenStatus=Vm.prototype.IeK;Vm.prototype.stopSession=Vm.prototype.vj;Vm.prototype.getCastSession=Vm.prototype.RS;Vm.prototype.requestSession=Vm.prototype.requestSession;Vm.prototype.init=Vm.prototype.init;Vm.prototype.dispose=Vm.prototype.dispose;var ofU=g.sj(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),H5V=[],h_V=g.Rs(ofU);g.C=MU.prototype; g.C.reset=function(q){this.listId="";this.index=-1;this.videoId="";o56(this);this.volume=-1;this.muted=!1;q&&(this.index=q.index,this.listId=q.listId,this.videoId=q.videoId,this.playerState=q.playerState,this.volume=q.volume,this.muted=q.muted,this.audioTrackId=q.audioTrackId,this.trackData=q.trackData,this.IE=q.hasPrevious,this.HI=q.hasNext,this.L=q.playerTime,this.D=q.playerTimeAt,this.U=q.seekableStart,this.X=q.seekableEnd,this.W=q.duration,this.S=q.loadedTime,this.V=q.liveIngestionTime,this.Y= !isNaN(this.V))}; g.C.isPlaying=function(){return this.playerState==1}; g.C.isBuffering=function(){return this.playerState==3}; g.C.SD=function(q){this.W=isNaN(q)?0:q}; g.C.getDuration=function(){return this.Y?this.W+hR(this):this.W}; g.C.clone=function(){return new MU(uFc(this))};g.Z(pR,g.ya);g.C=pR.prototype;g.C.getState=function(){return this.W}; g.C.pU=function(){return this.Y.getReconnectTimeout()}; g.C.Be=function(){this.Y.reconnect()}; g.C.play=function(){Xz(this)?(this.V?this.V.play(null,g.MP,uD(this,"play")):IF(this,"play"),z_w(this,1,fR(Un(this))),this.publish("remotePlayerChange")):jo(this,this.play)}; g.C.pause=function(){Xz(this)?(this.V?this.V.pause(null,g.MP,uD(this,"pause")):IF(this,"pause"),z_w(this,2,fR(Un(this))),this.publish("remotePlayerChange")):jo(this,this.pause)}; g.C.seekTo=function(q){if(Xz(this)){if(this.V){var a=Un(this),w=new chrome.cast.media.SeekRequest;w.currentTime=q;a.isPlaying()||a.isBuffering()?w.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:w.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.V.seek(w,g.MP,uD(this,"seekTo",{newTime:q}))}else IF(this,"seekTo",{newTime:q});z_w(this,3,q);this.publish("remotePlayerChange")}else jo(this,g.Yc(this.seekTo,q))}; g.C.stop=function(){if(Xz(this)){this.V?this.V.stop(null,g.MP,uD(this,"stopVideo")):IF(this,"stopVideo");var q=Un(this);q.index=-1;q.videoId="";o56(q);oF(this,q);this.publish("remotePlayerChange")}else jo(this,this.stop)}; g.C.setVolume=function(q,a){if(Xz(this)){var w=Un(this);if(this.U){if(w.volume!=q){var G=Math.round(q)/100;this.U.setReceiverVolumeLevel(G,(0,g.Ne)(function(){wf("set receiver volume: "+G)},this),(0,g.Ne)(function(){this.qH("failed to set receiver volume.")},this))}w.muted!=a&&this.U.setReceiverMuted(a,(0,g.Ne)(function(){wf("set receiver muted: "+a)},this),(0,g.Ne)(function(){this.qH("failed to set receiver muted.")},this))}else{var k={volume:q, muted:a};w.volume!=-1&&(k.delta=q-w.volume);IF(this,"setVolume",k)}w.muted=a;w.volume=q;oF(this,w)}else jo(this,g.Yc(this.setVolume,q,a))}; g.C.G_=function(q,a){if(Xz(this)){var w=Un(this);q={videoId:q};a&&(w.trackData={trackName:a.name,languageCode:a.languageCode,sourceLanguageCode:a.translationLanguage?a.translationLanguage.languageCode:"",languageName:a.languageName,kind:a.kind},q.style=g.Xj(a.style),g.FE(q,w.trackData));IF(this,"setSubtitlesTrack",q);oF(this,w)}else jo(this,g.Yc(this.G_,q,a))}; g.C.setAudioTrack=function(q,a){Xz(this)?(a=a.getLanguageInfo().getId(),IF(this,"setAudioTrack",{videoId:q,audioTrackId:a}),q=Un(this),q.audioTrackId=a,oF(this,q)):jo(this,g.Yc(this.setAudioTrack,q,a))}; g.C.playVideo=function(q,a,w,G,k,b,O){G=G===void 0?null:G;k=k===void 0?null:k;b=b===void 0?null:b;O=O===void 0?null:O;var e=Un(this),N={videoId:q};w!==void 0&&(N.currentIndex=w);H6(e,q,w||0);a!==void 0&&(So(e,a),N.currentTime=a);G&&(N.listId=G);k&&(N.playerParams=k);b&&(N.clickTrackingParams=b);O&&(N.locationInfo=g.Xj(O));IF(this,"setPlaylist",N);G||oF(this,e)}; g.C.jr=function(q,a){if(Xz(this)){if(q&&a){var w=Un(this);H6(w,q,a);oF(this,w)}IF(this,"previous")}else jo(this,g.Yc(this.jr,q,a))}; g.C.nextVideo=function(q,a){if(Xz(this)){if(q&&a){var w=Un(this);H6(w,q,a);oF(this,w)}IF(this,"next")}else jo(this,g.Yc(this.nextVideo,q,a))}; g.C.pY=function(){if(Xz(this)){IF(this,"clearPlaylist");var q=Un(this);q.reset();oF(this,q);this.publish("remotePlayerChange")}else jo(this,this.pY)}; g.C.sJ=function(){Xz(this)?IF(this,"dismissAutoplay"):jo(this,this.sJ)}; g.C.dispose=function(){if(this.W!=3){var q=this.W;this.W=3;this.publish("proxyStateChange",q,this.W)}g.ya.prototype.dispose.call(this)}; g.C.qB=function(){v5e(this);this.Y=null;this.D.clear();c6(this,null);g.ya.prototype.qB.call(this)}; g.C.JF=function(q){if((q!=this.W||q==2)&&this.W!=3&&q!=0){var a=this.W;this.W=q;this.publish("proxyStateChange",a,q);if(q==1)for(;!this.D.isEmpty();)a=q=this.D,a.V.length===0&&(a.V=a.U,a.V.reverse(),a.U=[]),q.V.pop().apply(this);else q==3&&this.dispose()}}; g.C.NGK=function(q,a){this.publish(q,a)}; g.C.J2K=function(q){if(!q)this.xM(null),c6(this,null);else if(this.U.receiver.volume){q=this.U.receiver.volume;var a=Un(this),w=Math.round(100*q.level||0);if(a.volume!=w||a.muted!=q.muted)wf("Cast volume update: "+q.level+(q.muted?" muted":"")),a.volume=w,a.muted=!!q.muted,oF(this,a)}}; g.C.xM=function(q){wf("Cast media: "+!!q);this.V&&this.V.removeUpdateListener(this.S);if(this.V=q)this.V.addUpdateListener(this.S),i58(this),this.publish("remotePlayerChange")}; g.C.IhQ=function(q){q?(i58(this),this.publish("remotePlayerChange")):this.xM(null)}; g.C.n1=function(){IF(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.C.Vil=function(){var q=U9U();q&&c6(this,q)}; g.C.qH=function(q){aF("CP",q)};g.Z(zl,g.ya);g.C=zl.prototype; g.C.connect=function(q,a){if(a){var w=a.listId,G=a.videoId,k=a.videoIds,b=a.playerParams,O=a.clickTrackingParams,e=a.index,N={videoId:G},Y=a.currentTime,P=a.locationInfo;a=a.loopMode;Y!==void 0&&(N.currentTime=Y<=5?0:Y);b&&(N.playerParams=b);P&&(N.locationInfo=P);O&&(N.clickTrackingParams=O);w&&(N.listId=w);k&&k.length>0&&(N.videoIds=k.join(","));e!==void 0&&(N.currentIndex=e);this.EK&&(N.loopMode=a||"LOOP_MODE_OFF");w&&(this.V.listId=w);this.V.videoId=G;this.V.index=e||0;this.V.state=3;So(this.V, Y);this.D="UNSUPPORTED";w=this.EK?"setInitialState":"setPlaylist";tR("Connecting with "+w+" and params: "+g.Xj(N));this.U.connect({method:w,params:g.Xj(N)},q,PMx())}else tR("Connecting without params"),this.U.connect({},q,PMx());yNK(this)}; g.C.Hh=function(q){this.U.Hh(q)}; g.C.dispose=function(){this.t2()||(g.qe("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),v6(this,3));g.ya.prototype.dispose.call(this)}; g.C.qB=function(){q_c(this);a1K(this);gfR(this);g.Yn(this.S);this.S=NaN;g.Yn(this.J);this.J=NaN;this.Y=null;g.sH(this.F9);this.F9.length=0;this.U.dispose();g.ya.prototype.qB.call(this);this.D=this.X=this.W=this.V=this.U=null}; g.C.wr=function(q){if(!this.W||this.W.length===0)return!1;for(var a=g.V(this.W),w=a.next();!w.done;w=a.next())if(!w.value.capabilities.has(q))return!1;return!0}; g.C.iQ=function(){var q=3;this.t2()||(q=0,isNaN(this.e5())?this.U.hE()&&isNaN(this.L)&&(q=1):q=2);return q}; g.C.iC=function(q){tR("Disconnecting with "+q);g.qe("yt.mdx.remote.remoteClient_",null);q_c(this);this.publish("beforeDisconnect",q);q==1&&To();this.U.disconnect(q);this.dispose()}; g.C.Yc=function(){var q=this.V;this.Y&&(q=this.V.clone(),H6(q,this.Y,q.index));return uFc(q)}; g.C.dH7=function(q){var a=this,w=new MU(q);w.videoId&&w.videoId!=this.V.videoId&&(this.Y=w.videoId,g.Yn(this.S),this.S=g.ee(function(){if(a.Y){var k=a.Y;a.Y=null;a.V.videoId!=k&&iD(a,"getNowPlaying")}},5E3)); var G=[];this.V.listId==w.listId&&this.V.videoId==w.videoId&&this.V.index==w.index||G.push("remoteQueueChange");this.V.playerState==w.playerState&&this.V.volume==w.volume&&this.V.muted==w.muted&&fR(this.V)==fR(w)&&g.Xj(this.V.trackData)==g.Xj(w.trackData)||G.push("remotePlayerChange");this.V.reset(q);g.WR(G,function(k){this.publish(k)},this)}; g.C.g3=function(){var q=this.U.getDeviceId(),a=g.Z7(this.W,function(w){return w.type=="REMOTE_CONTROL"&&w.id!=q}); return a?a.id:""}; g.C.e5=function(){return this.U.pU()}; g.C.mC=function(){return this.D||"UNSUPPORTED"}; g.C.KM=function(){return this.X||""}; g.C.Lr=function(){!isNaN(this.e5())&&this.U.Be()}; g.C.Bxt=function(q,a){iD(this,q,a);GXK(this)}; g.C.jJ=function(){var q=g.rF("SAPISID","")||g.rF("__Secure-1PAPISID")||"",a=g.rF("__Secure-3PAPISID","")||"";if(!q&&!a)return"";q=g.AH(g.QN(q),2);a=g.AH(g.QN(a),2);return g.AH(g.QN(","+q+","+a),2)}; zl.prototype.subscribe=zl.prototype.subscribe;zl.prototype.unsubscribeByKey=zl.prototype.A4;zl.prototype.getProxyState=zl.prototype.iQ;zl.prototype.disconnect=zl.prototype.iC;zl.prototype.getPlayerContextData=zl.prototype.Yc;zl.prototype.setPlayerContextData=zl.prototype.dH7;zl.prototype.getOtherConnectedRemoteId=zl.prototype.g3;zl.prototype.getReconnectTimeout=zl.prototype.e5;zl.prototype.getAutoplayMode=zl.prototype.mC;zl.prototype.getAutoplayVideoId=zl.prototype.KM;zl.prototype.reconnect=zl.prototype.Lr; zl.prototype.sendMessage=zl.prototype.Bxt;zl.prototype.getXsrfToken=zl.prototype.jJ;zl.prototype.isCapabilitySupportedOnConnectedDevices=zl.prototype.wr;g.Z($wx,On);g.C=$wx.prototype;g.C.GY=function(q){return this.QT.$_gs(q)}; g.C.contains=function(q){return!!this.QT.$_c(q)}; g.C.get=function(q){return this.QT.$_g(q)}; g.C.start=function(){this.QT.$_st()}; g.C.add=function(q,a,w){this.QT.$_a(q,a,w)}; g.C.remove=function(q,a,w){this.QT.$_r(q,a,w)}; g.C.kH=function(q,a,w,G){this.QT.$_un(q,a,w,G)}; g.C.qB=function(){for(var q=this.V.length,a=0;a1&&!this.j.getOption("remote","quickCast")?(this.pP=g.D7(q,this.V,this),this.VV(g.sd(q,this.V)),q=this.j.getOption("remote","currentReceiver"),q=this.V(q),this.options[q]&&this.sP(q),this.enable(!0)):this.enable(!1)}; dT.prototype.V=function(q){return q.key}; dT.prototype.I_=function(q){return q==="cast-selector-receiver"?"Cast...":this.pP[q].name}; dT.prototype.r4=function(q){g.HP.prototype.r4.call(this,q);this.j.setOption("remote","currentReceiver",this.pP[q]);this.Wq.DZ()};g.Z(cWx,g.md);g.C=cWx.prototype; g.C.create=function(){var q=this.player.B(),a=g.kM(q);q={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:q.T("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:q.T("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:q.T("enable_cast_short_lived_lounge_token")};Ef6(a,q);this.subscriptions.push(g.i$("yt-remote-before-disconnect",this.B8B,this));this.subscriptions.push(g.i$("yt-remote-connection-change",this.xhl,this));this.subscriptions.push(g.i$("yt-remote-receiver-availability-change",this.D5, this));this.subscriptions.push(g.i$("yt-remote-auto-connect",this.hgQ,this));this.subscriptions.push(g.i$("yt-remote-receiver-resumed",this.b0e,this));this.subscriptions.push(g.i$("mdx-privacy-popup-confirm",this.q3T,this));this.subscriptions.push(g.i$("mdx-privacy-popup-cancel",this.WG2,this));this.D5()}; g.C.load=function(){this.player.cancelPlayback();g.md.prototype.load.call(this);this.Gn=new HFR(this.player.B(),this);this.player.uq(this.Gn);this.FV=new MRw(this,this.player,this.Ir);var q=(q=BIx())?q.currentTime:0;var a=AW8()?new pR(kh(),void 0):null;q==0&&a&&(q=fR(Un(a)));q!==0&&this.EQ(q);pCJ(this,this.xw,this.xw);this.player.wF(6)}; g.C.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.kC();this.uW=this.yr;g.Gr(this.FV,this.Ir);this.Ir=this.Gn=this.FV=null;g.md.prototype.unload.call(this);this.player.wF(5);TP(this)}; g.C.qB=function(){g.W0(this.subscriptions);g.md.prototype.qB.call(this)}; g.C.lB=function(q){var a=g.XU.apply(1,arguments);this.loaded&&this.FV.fF.apply(this.FV,[q].concat(g.Tf(a)))}; g.C.getAdState=function(){return this.ow}; g.C.IE=function(){return this.Ir?Un(this.Ir).IE:!1}; g.C.HI=function(){return this.Ir?Un(this.Ir).HI:!1}; g.C.EQ=function(q,a){this.Zs=q||0;this.player.publish("progresssync",q,a);this.player.WN("onVideoProgress",q||0)}; g.C.getCurrentTime=function(){return this.Zs}; g.C.getDuration=function(){return Un(this.Ir).getDuration()||0}; g.C.OB=function(){var q=Un(this.Ir);return q.Y?q.V+hR(q):q.V}; g.C.oO=function(){return Un(this.Ir).S}; g.C.R_=function(){return IV6(Un(this.Ir))}; g.C.pm=function(){var q=Un(this.Ir);return q.U>0?q.U+hR(q):q.U}; g.C.getProgressState=function(){var q=Un(this.Ir),a=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:q.playerState!=1081&&this.player.zN(),clipEnd:a.clipEnd,clipStart:a.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.OB(),isAtLiveHead:this.isAtLiveHead(),loaded:this.oO(),seekableEnd:this.R_(),seekableStart:this.pm(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.C.isAtLiveHead=function(){return IV6(Un(this.Ir))-this.getCurrentTime()<=1}; g.C.nextVideo=function(){this.Ir&&this.Ir.nextVideo()}; g.C.jr=function(){this.Ir&&this.Ir.jr()}; g.C.B8B=function(q){q===1&&(this.Is=this.Ir?Un(this.Ir):null)}; g.C.xhl=function(){var q=AW8()?new pR(kh(),void 0):null;if(q){var a=this.uW;this.loaded&&this.unload();this.Ir=q;this.Is=null;a.key!==this.yr.key&&(this.uW=a,this.load())}else g.wB(this.Ir),this.Ir=null,this.loaded&&(this.unload(),(q=this.Is)&&q.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(q.videoId,fR(q)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.C.D5=function(){var q=[this.yr],a=q.concat,w=VRx();B6()&&g.xt("yt-remote-cast-available")&&w.push({key:"cast-selector-receiver",name:"Cast..."});this.pP=a.call(q,w);q=mwy()||this.yr;$h(this,q);this.player.WN("onMdxReceiversChange")}; g.C.hgQ=function(){var q=mwy();$h(this,q)}; g.C.b0e=function(){this.uW=mwy()}; g.C.q3T=function(){this.YC=!0;TP(this);eB=!1;bg&&lg(bg,1);bg=null}; g.C.WG2=function(){this.YC=!1;TP(this);$h(this,this.yr);this.uW=this.yr;eB=!1;bg=null;this.player.playVideo()}; g.C.KW=function(q,a){switch(q){case "casting":return this.loaded;case "receivers":return this.pP;case "currentReceiver":return a&&(a.key==="cast-selector-receiver"?Xp8():$h(this,a)),this.loaded?this.uW:this.yr;case "quickCast":return this.pP.length===2&&this.pP[1].key==="cast-selector-receiver"?(a&&Xp8(),!0):!1}}; g.C.n1=function(){this.Ir.n1()}; g.C.AZ=function(){return!1}; g.C.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.C.isLoggedIn=function(){var q,a;return((q=g.UL("PLAYER_CONFIG"))==null?void 0:(a=q.args)==null?void 0:a.authuser)!==void 0?!0:!(!g.UL("SESSION_INDEX")&&!g.UL("LOGGED_IN"))};g.Jq("remote",cWx);})(_yt_player);