(function(g){var window=this;'use strict';var QwF=function(a){if(a instanceof g.$U)return a;if(typeof a.nH=="function")return a.nH(!1);if(g.lV(a)){var l=0,m=new g.$U;m.next=function(){for(;;){if(l>=a.length)return g.Ht;if(l in a)return g.si(a[l++]);l++}}; return m}throw Error("Not implemented");},tQI=function(a,l,m){if(g.lV(a))g.Bn(a,l,m); else for(a=QwF(a);;){var T=a.next();if(T.done)break;l.call(m,T.value,void 0,a)}},rc=function(a){g.GJ(a,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.bV()).toString(36)); return a},a6=function(a,l,m){Array.isArray(m)||(m=[String(m)]); g.kt7(a.j,l,m)},ey5=function(a,l){var m=[]; tQI(l,function(T){try{var y=g.s3.prototype.L.call(this,T,!0)}catch(R){if(R=="Storage: Invalid value was encountered")return;throw R;}y===void 0?m.push(T):g.CBb(y)&&m.push(T)},a); return m},FoV=function(a,l){ey5(a,l).forEach(function(m){g.s3.prototype.remove.call(this,m)},a)},hyI=function(a){if(a.nR){if(a.nR.locationOverrideToken)return{locationOverrideToken:a.nR.locationOverrideToken}; if(a.nR.latitudeE7!=null&&a.nR.longitudeE7!=null)return{latitudeE7:a.nR.latitudeE7,longitudeE7:a.nR.longitudeE7}}return null},O5D=function(a,l){g.pD(a,l)||a.push(l)},Koc=function(a){var l=0,m; for(m in a)l++;return l},zy9=function(a,l){return g.YB(a,l)},vvI=function(a){try{return g.u7.JSON.parse(a)}catch(l){}a=String(a); if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(l){}throw Error("Invalid JSON string: "+a);},lt=function(a){if(g.u7.JSON)try{return g.u7.JSON.parse(a)}catch(l){}return vvI(a)},$Md=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/channel/opened",g.PE("channel_type"))},swF=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/channel/closed",g.PE("channel_type"))},SuV=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/channel/message_received",g.PE("channel_type"))},ffc=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/channel/success")},JWF=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/channel/error",g.PE("channel_type"),g.PE("error_type"))},Bh_=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},kc_=function(){var a=m_(); this.T=a;a.v7("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},nvB=function(a){if(a.hs&&typeof a.hs=="function")return a.hs(); if(typeof Map!=="undefined"&&a instanceof Map||typeof Set!=="undefined"&&a instanceof Set)return Array.from(a.values());if(typeof a==="string")return a.split("");if(g.lV(a)){for(var l=[],m=a.length,T=0;T1){if(m%2)throw Error("Uneven number of arguments");for(var T=0;T5&&(a=a.slice(a.length-5)); var l=g.xX(Oyn(),function(T){return T.loungeToken}),m=g.xX(a,function(T){return T.loungeToken}); g.DN(m,function(T){return!g.pD(l,T)})&&Kes(); g.JN("yt-remote-local-screens",a,31536E3)},jA=function(a){a||(g.kH("yt-remote-session-screen-id"),g.kH("yt-remote-session-video-id")); FeV();a=it();g.Wn(a,dJ());tng(a)},vaB=function(){if(!Af){var a=g.ne(); a&&(Af=new g.zw(a))}},$ys=function(){vaB(); return Af?!!Af.get("yt-remote-use-staging-server"):!1},PD=function(a,l){g.qQ[a]=!0; var m=g.Ro();m&&m.publish.apply(m,arguments);g.qQ[a]=!1},stV=function(){},m_=function(){if(!Gg){Gg=new g.C1(new stV); var a=g.tR("client_streamz_web_flush_count",-1);a!==-1&&(Gg.Z=a)}return Gg},SZX=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return a?parseInt(a[1],10):0},fCX=function(a){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+a)!=-1||document.currentScript.src.indexOf("&"+a)!=-1)},JR9=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},V_=function(a){a.length?B05(a.shift(),function(){V_(a)}):kvr()},na5=function(a){return"chrome-extension://"+a+"/cast_sender.js"},B05=function(a,l,m){var T=document.createElement("script"); T.onerror=l;m&&(T.onload=m);g.ME(T,g.hW(a));(document.head||document.documentElement).appendChild(T)},w$d=function(){var a=SZX(),l=[]; if(a>1){var m=a-1;l.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");l.push("//www.gstatic.com/eureka/clank/"+m+"/cast_sender.js")}return l},kvr=function(){var a=JR9(); a&&a(!1,"No cast extension found")},Crd=function(){if(IC_){var a=2,l=JR9(),m=function(){a--; a==0&&l&&l(!0)}; window.__onGCastApiAvailable=m;B05("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",kvr,m)}},EaD=function(){Crd(); var a=w$d();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");V_(a)},xys=function(){Crd(); var a=w$d();a.push.apply(a,g.F(oaD.map(na5)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");V_(a)},pB=function(a,l,m){g.k.call(this); this.C=m!=null?(0,g.Rs)(a,m):a;this.rk=l;this.K=(0,g.Rs)(this.C0,this);this.T=!1;this.L=0;this.Z=this.pR=null;this.j=[]},Zv=function(){},DyI=function(){g.ak.call(this,"p")},uLB=function(){g.ak.call(this,"o")},YZ9=function(){return X$B=X$B||new g.Vz},Uyd=function(a){g.ak.call(this,"serverreachability",a)},WD=function(a){var l=YZ9(); l.dispatchEvent(new Uyd(l,a))},rRI=function(a){g.ak.call(this,"statevent",a)},cD=function(a){var l=YZ9(); l.dispatchEvent(new rRI(l,a))},aXs=function(a,l,m,T){g.ak.call(this,"timingevent",a); this.size=l;this.rtt=m;this.retries=T},LB=function(a,l){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.u7.setTimeout(function(){a()},l)},N9=function(){},Q_=function(a,l,m,T){this.Z=a; this.j=l;this.SW=m;this.QO=T||1;this.vF=new g.cf(this);this.rb=45E3;this.Cx=null;this.C=!1;this.N=this.Mj=this.J=this.AM=this.jt=this.yg=this.Ij=null;this.lT=[];this.T=null;this.B=0;this.K=this.qj=null;this.lZ=-1;this.Kx=!1;this.wb=0;this.tM=null;this.uZ=this.St=this.ZR=this.hM=!1;this.L=new lXg},lXg=function(){this.Z=null; this.T="";this.L=!1},TQr=function(a,l,m){a.AM=1; a.J=rc(l.clone());a.N=m;a.hM=!0;mp5(a,null)},mp5=function(a,l){a.jt=Date.now(); tf(a);a.Mj=a.J.clone();a6(a.Mj,"t",a.QO);a.B=0;var m=a.Z.AM;a.L=new lXg;a.T=yNc(a.Z,m?l:null,!a.N);a.wb>0&&(a.tM=new g.ye((0,g.Rs)(a.Xo,a,a.T),a.wb));a.vF.listen(a.T,"readystatechange",a.mX);l=a.Cx?g.mn(a.Cx):{};a.N?(a.qj||(a.qj="POST"),l["Content-Type"]="application/x-www-form-urlencoded",a.T.send(a.Mj,a.qj,a.N,l)):(a.qj="GET",a.T.send(a.Mj,a.qj,null,l));WD(1)},HZ_=function(a){if(!RPI(a))return g.aI(a.T); var l=g.ln(a.T);if(l==="")return"";var m="",T=l.length,y=g.UB(a.T)==4;if(!a.L.Z){if(typeof TextDecoder==="undefined")return eA(a),F4(a),"";a.L.Z=new g.u7.TextDecoder}for(var R=0;Rl.length)return qCg;l=l.slice(T,T+m);a.B=T+m;return l},tf=function(a){a.yg=Date.now()+a.rb; Mbc(a,a.rb)},Mbc=function(a,l){if(a.Ij!=null)throw Error("WatchDog timer not null"); a.Ij=LB((0,g.Rs)(a.eR,a),l)},iZV=function(a){a.Ij&&(g.u7.clearTimeout(a.Ij),a.Ij=null)},F4=function(a){a.Z.gL()||a.Kx||dp5(a.Z,a)},eA=function(a){iZV(a); g.Go(a.tM);a.tM=null;a.vF.removeAll();if(a.T){var l=a.T;a.T=null;l.abort();l.dispose()}},W7c=function(a,l){try{var m=a.Z; if(m.gR!=0&&(m.T==a||jic(m.L,a)))if(!a.St&&jic(m.L,a)&&m.gR==3){try{var T=m.im.T.parse(l)}catch(L){T=null}if(Array.isArray(T)&&T.length==3){var y=T;if(y[0]==0)a:{if(!m.J){if(m.T)if(m.T.jt+3E30&&(m.wb=1.5*b);T=m;var M=a.wh();if(M){var d=g.mX(M,"X-Client-Wire-Protocol");if(d){var A=T.L;!A.T&&(g.Z2(d,"spdy")||g.Z2(d,"quic")||g.Z2(d,"h2"))&&(A.j=A.K,A.T=new Set,A.L&&(GOd(A,A.L),A.L=null))}if(T.hM){var P=g.mX(M,"X-HTTP-Session-Id");P&&(T.p5=P,g.GJ(T.Cx,T.hM,P))}}m.gR=3;m.K&&m.K.y$();m.tN&&(m.Eg=Date.now()-a.jt);T=m;var G=a;T.JW=Vb_(T,T.AM?T.QO:null,T.SW);if(G.St){pWr(T.L, G);var V=G,p=T.wb;p&&V.setTimeout(p);V.Ij&&(iZV(V),tf(V));T.T=G}else ZZg(T);m.Z.length>0&&zg(m)}else R[0]!="stop"&&R[0]!="close"||KB(m,7);else m.gR==3&&(R[0]=="stop"||R[0]=="close"?R[0]=="stop"?KB(m,7):m.disconnect():R[0]!="noop"&&m.K&&m.K.cH(R),m.lT=0)}WD(4)}catch(L){}},cNd=function(a,l){this.T=a; this.map=l;this.context=null},L7I=function(a){this.K=a||10; g.u7.PerformanceNavigationTiming?(a=g.u7.performance.getEntriesByType("navigation"),a=a.length>0&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(g.u7.chrome&&g.u7.chrome.loadTimes&&g.u7.chrome.loadTimes()&&g.u7.chrome.loadTimes().wasFetchedViaSpdy);this.j=a?this.K:1;this.T=null;this.j>1&&(this.T=new Set);this.L=null;this.Z=[]},NQI=function(a){return a.L?!0:a.T?a.T.size>=a.j:!1},PRd=function(a){return a.L?1:a.T?a.T.size:0},jic=function(a,l){return a.L?a.L==l:a.T?a.T.has(l):!1},GOd= function(a,l){a.T?a.T.add(l):a.L=l},pWr=function(a,l){a.L&&a.L==l?a.L=null:a.T&&a.T.has(l)&&a.T.delete(l)},QiB=function(a){if(a.L!=null)return a.Z.concat(a.L.lT); if(a.T!=null&&a.T.size!==0){var l=a.Z;a=g.c(a.T.values());for(var m=a.next();!m.done;m=a.next())l=l.concat(m.value.lT);return l}return g.NF(a.Z)},tbn=function(a,l){var m=new N9; if(g.u7.Image){var T=new Image;T.onload=g.qF(vD,m,"TestLoadImage: loaded",!0,l,T);T.onerror=g.qF(vD,m,"TestLoadImage: error",!1,l,T);T.onabort=g.qF(vD,m,"TestLoadImage: abort",!1,l,T);T.ontimeout=g.qF(vD,m,"TestLoadImage: timeout",!1,l,T);g.u7.setTimeout(function(){if(T.ontimeout)T.ontimeout()},1E4); T.src=a}else l(!1)},ePF=function(a,l){var m=new N9,T=new AbortController,y=setTimeout(function(){T.abort(); vD(m,"TestPingServer: timeout",!1,l)},1E4); fetch(a,{signal:T.signal}).then(function(R){clearTimeout(y);R.ok?vD(m,"TestPingServer: ok",!0,l):vD(m,"TestPingServer: server error",!1,l)}).catch(function(){clearTimeout(y); vD(m,"TestPingServer: error",!1,l)})},vD=function(a,l,m,T,y){try{y&&(y.onload=null,y.onerror=null,y.onabort=null,y.ontimeout=null),T(m)}catch(R){}},F7F=function(){this.T=new Zv},hP5=function(a,l,m){var T=m||""; try{Ifc(a,function(y,R){var H=y;g.ms(y)&&(H=g.ok(y));l.push(T+R+"="+encodeURIComponent(H))})}catch(y){throw l.push(T+"type="+encodeURIComponent("_badmap")),y; }},s4=function(a,l,m){return m&&m.uv?m.uv[a]||l:l},OZ5=function(a){this.Z=[]; this.QO=this.JW=this.Cx=this.SW=this.T=this.p5=this.hM=this.Kx=this.B=this.lZ=this.N=null;this.Be=this.Mj=0;this.Aa=s4("failFast",!1,a);this.St=this.Ij=this.J=this.C=this.K=null;this.wW=!0;this.wO=this.tM=-1;this.uZ=this.lT=this.jt=0;this.xN=s4("baseRetryDelayMs",5E3,a);this.Sd=s4("retryDelaySeedMs",1E4,a);this.VX=s4("forwardChannelMaxRetries",2,a);this.EG=s4("forwardChannelRequestTimeoutMs",2E4,a);this.nR=a&&a.bdg||void 0;this.Xe=a&&a.Uxg||void 0;this.OQ=a&&a.mL8||!1;this.wb=void 0;this.AM=a&&a.C4L|| !1;this.j="";this.L=new L7I(a&&a.H2b);this.im=new F7F;this.vF=a&&a.DiT||!1;this.yg=a&&a.Izu||!1;this.vF&&this.yg&&(this.yg=!1);this.kN=a&&a.Wcb||!1;a&&a.uuu&&(this.wW=!1);this.tN=!this.vF&&this.wW&&a&&a.gVO||!1;this.FU=void 0;a&&a.Tk&&a.Tk>0&&(this.FU=a.Tk);this.Ug=void 0;this.Eg=0;this.rb=!1;this.ZR=this.qj=null},O4=function(a){a.T&&(K7F(a),a.T.cancel(),a.T=null)},zPc=function(a){O4(a); a.J&&(g.u7.clearTimeout(a.J),a.J=null);hf(a);a.L.cancel();a.C&&(typeof a.C==="number"&&g.u7.clearTimeout(a.C),a.C=null)},zg=function(a){NQI(a.L)||a.C||(a.C=!0,g.FS(a.gy,a),a.jt=0)},$pV=function(a,l){if(PRd(a.L)>=a.L.j-(a.C?1:0))return!1; if(a.C)return a.Z=l.lT.concat(a.Z),!0;if(a.gR==1||a.gR==2||a.jt>=(a.Aa?0:a.VX))return!1;a.C=LB((0,g.Rs)(a.gy,a,l),vHd(a,a.jt));a.jt++;return!0},SCc=function(a,l){var m; l?m=l.SW:m=a.Mj++;var T=a.Cx.clone();g.GJ(T,"SID",a.j);g.GJ(T,"RID",m);g.GJ(T,"AID",a.tM);SA(a,T);a.B&&a.N&&g.Wf(T,a.B,a.N);m=new Q_(a,a.j,m,a.jt+1);a.B===null&&(m.Cx=a.N);l&&(a.Z=l.lT.concat(a.Z));l=sig(a,m,1E3);m.setTimeout(Math.round(a.EG*.5)+Math.round(a.EG*.5*Math.random()));GOd(a.L,m);TQr(m,T,l)},SA=function(a,l){a.Kx&&g.wg(a.Kx,function(m,T){g.GJ(l,T,m)}); a.K&&Ifc({},function(m,T){g.GJ(l,T,m)})},sig=function(a,l,m){m=Math.min(a.Z.length,m); var T=a.K?(0,g.Rs)(a.K.F3,a.K,a):null;a:{for(var y=a.Z,R=-1;;){var H=["count="+m];R==-1?m>0?(R=y[0].T,H.push("ofs="+R)):R=0:H.push("ofs="+R);for(var b=!0,M=0;M=3)return!1; a.uZ++;a.J=LB((0,g.Rs)(a.PH,a),vHd(a,a.lT));a.lT++;return!0},K7F=function(a){a.qj!=null&&(g.u7.clearTimeout(a.qj),a.qj=null)},fXB=function(a){a.T=new Q_(a,a.j,"rpc",a.uZ); a.B===null&&(a.T.Cx=a.N);a.T.wb=0;var l=a.JW.clone();g.GJ(l,"RID","rpc");g.GJ(l,"SID",a.j);g.GJ(l,"AID",a.tM);g.GJ(l,"CI",a.St?"0":"1");!a.St&&a.FU&&g.GJ(l,"TO",a.FU);g.GJ(l,"TYPE","xmlhttp");SA(a,l);a.B&&a.N&&g.Wf(l,a.B,a.N);a.wb&&a.T.setTimeout(a.wb);var m=a.T;a=a.QO;m.AM=1;m.J=rc(l.clone());m.N=null;m.hM=!0;mp5(m,a)},hf=function(a){a.Ij!=null&&(g.u7.clearTimeout(a.Ij),a.Ij=null)},dp5=function(a,l){var m=null; if(a.T==l){hf(a);K7F(a);a.T=null;var T=2}else if(jic(a.L,l))m=l.lT,pWr(a.L,l),T=1;else return;if(a.gR!=0)if(l.C)if(T==1){m=l.N?l.N.length:0;l=Date.now()-l.jt;var y=a.jt;T=YZ9();T.dispatchEvent(new aXs(T,m,l,y));zg(a)}else ZZg(a);else{var R=l.lZ;y=l.getLastError();if(y==3||y==0&&R>0||!(T==1&&$pV(a,l)||T==2&&ANs(a)))switch(m&&m.length>0&&(l=a.L,l.Z=l.Z.concat(m)),y){case 1:KB(a,5);break;case 4:KB(a,10);break;case 3:KB(a,6);break;default:KB(a,2)}}},vHd=function(a,l){var m=a.xN+Math.floor(Math.random()* a.Sd); a.isActive()||(m*=2);return m*l},KB=function(a,l){if(l==2){var m=(0,g.Rs)(a.Vqj,a),T=a.Xe,y=!T; T=new g.b_(T||"//www.google.com/images/cleardot.gif");g.u7.location&&g.u7.location.protocol=="http"||g.gR(T,"https");rc(T);y?tbn(T.toString(),m):ePF(T.toString(),m)}else cD(2);a.gR=0;a.K&&a.K.GQ(l);JNV(a);zPc(a)},JNV=function(a){a.gR=0; a.ZR=[];if(a.K){var l=QiB(a.L);if(l.length!=0||a.Z.length!=0)g.tI(a.ZR,l),g.tI(a.ZR,a.Z),a.L.Z.length=0,g.NF(a.Z),a.Z.length=0;a.K.zQ()}},BQX=function(a){if(a.gR==0)return a.ZR; var l=[];g.tI(l,QiB(a.L));g.tI(l,a.Z);return l},Vb_=function(a,l,m){var T=g.Vr(m); T.T!=""?(l&&g.MV(T,l+"."+T.T),g.i_(T,T.Z)):(T=g.u7.location,T=Cpr(T.protocol,l?l+"."+T.hostname:T.hostname,+T.port,m));l=a.hM;m=a.p5;l&&m&&g.GJ(T,l,m);g.GJ(T,"VER",a.MZ);SA(a,T);return T},yNc=function(a,l,m){if(l&&!a.AM)throw Error("Can't create secondary domain capable XhrIo object."); l=a.OQ&&!a.nR?new g.uB(new g.yr({O3:m})):new g.uB(a.nR);l.B=a.AM;return l},kOF=function(){},nHV=function(){},Jf=function(a,l){g.Vz.call(this); this.T=new OZ5(l);this.K=a;this.L=l&&l.hjx||null;a=l&&l.qLL||null;l&&l.wdK&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.T.N=a;a=l&&l.fkL||null;l&&l.Eh&&(a?a["X-WebChannel-Content-Type"]=l.Eh:a={"X-WebChannel-Content-Type":l.Eh});l&&l.eg&&(a?a["X-WebChannel-Client-Profile"]=l.eg:a={"X-WebChannel-Client-Profile":l.eg});this.T.lZ=a;(a=l&&l.J5u)&&!g.Vk(a)&&(this.T.B=a);this.C=l&&l.C4L||!1;this.j=l&&l.w5N||!1;(l=l&&l.OT)&&!g.Vk(l)&&(this.T.hM=l,g.X_(this.L,l)&&(a= this.L,l in a&&delete a[l]));this.Z=new fB(this)},wW5=function(a){DyI.call(this); a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var l=a.__sm__;l?this.data=(this.T=g.os(l))?g.aV(l,this.T):l:this.data=a},IX9=function(a){uLB.call(this); this.status=1;this.errorCode=a},fB=function(a){this.T=a},CRI=function(a,l){this.L=a; this.T=l},EH_=function(a){return BQX(a.T).map(function(l){var m=a.L; l=l.map;"__data__"in l?(l=l.__data__,m=m.j?vvI(l):l):m=l;return m})},BD=function(a,l){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.u7.setTimeout(function(){a()},l)},nB=function(a){kj.dispatchEvent(new oHn(kj,a))},oHn=function(a){g.ak.call(this,"statevent",a)},wJ=function(a,l,m,T){this.T=a; this.j=l;this.B=m;this.C=T||1;this.L=45E3;this.Z=new g.cf(this);this.K=new g.n1;this.K.setInterval(250)},Dpd=function(a,l,m){a.Bm=1; a.ZY=rc(l.clone());a.IW=m;a.hM=!0;xpX(a,null)},uYV=function(a,l,m,T,y){a.Bm=1; a.ZY=rc(l.clone());a.IW=null;a.hM=m;y&&(a.SJ=!1);xpX(a,T)},xpX=function(a,l){a.OY=Date.now(); XW5(a);a.VV=a.ZY.clone();a6(a.VV,"t",a.C);a.kL=0;a.U9=a.T.Y_(a.T.i7()?l:null);a.pW>0&&(a.Am=new g.ye((0,g.Rs)(a.NZ,a,a.U9),a.pW));a.Z.listen(a.U9,"readystatechange",a.Aj);l=a.Na?g.mn(a.Na):{};a.IW?(a.SK="POST",l["Content-Type"]="application/x-www-form-urlencoded",a.U9.send(a.VV,a.SK,a.IW,l)):(a.SK="GET",a.SJ&&!g.Y5&&(l.Connection="close"),a.U9.send(a.VV,a.SK,null,l));a.T.hX(1)},rNV=function(a,l){var m=a.kL,T=l.indexOf("\n",m); if(T==-1)return YCX;m=Number(l.substring(m,T));if(isNaN(m))return Upn;T+=1;if(T+m>l.length)return YCX;l=l.slice(T,T+m);a.kL=T+m;return l},XW5=function(a){a.RZ=Date.now()+a.L; aZV(a,a.L)},aZV=function(a,l){if(a.lI!=null)throw Error("WatchDog timer not null"); a.lI=BD((0,g.Rs)(a.xK,a),l)},lZI=function(a){a.lI&&(g.u7.clearTimeout(a.lI),a.lI=null)},mr5=function(a){a.T.gL()||a.j0||a.T.t0(a)},I6=function(a){lZI(a); g.Go(a.Am);a.Am=null;a.K.stop();a.Z.removeAll();if(a.U9){var l=a.U9;a.U9=null;l.abort();l.dispose()}a.k6&&(a.k6=null)},TCg=function(a,l){try{a.T.nX(a,l),a.T.hX(4)}catch(m){}},RbV=function(a,l,m,T,y){if(T==0)m(!1); else{var R=y||0;T--;y7I(a,l,function(H){H?m(!0):g.u7.setTimeout(function(){RbV(a,l,m,T,R)},R)})}},y7I=function(a,l,m){var T=new Image; T.onload=function(){try{CB(T),m(!0)}catch(y){}}; T.onerror=function(){try{CB(T),m(!1)}catch(y){}}; T.onabort=function(){try{CB(T),m(!1)}catch(y){}}; T.ontimeout=function(){try{CB(T),m(!1)}catch(y){}}; g.u7.setTimeout(function(){if(T.ontimeout)T.ontimeout()},l); T.src=a},CB=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},H2g=function(a){this.T=a; this.L=new Zv},q99=function(a){var l=E4(a.T,a.IT,"/mail/images/cleardot.gif"); rc(l);RbV(l.toString(),5E3,(0,g.Rs)(a.v2,a),3,2E3);a.hX(1)},b2I=function(a){var l=a.T.C; l!=null?(nB(5),l?(nB(11),o6(a.T,a,!1)):(nB(12),o6(a.T,a,!0))):(a.I8=new wJ(a),a.I8.Na=a.QI,l=a.T,l=E4(l,l.i7()?a.Wm:null,a.Hf),nB(5),a6(l,"TYPE","xmlhttp"),uYV(a.I8,l,!1,a.Wm,!1))},gTs=function(a,l,m){this.T=1; this.L=[];this.Z=[];this.K=new Zv;this.N=a||null;this.C=l!=null?l:null;this.J=m||!1},Mss=function(a,l){this.T=a; this.map=l;this.context=null},i2_=function(a,l,m,T){g.ak.call(this,"timingevent",a); this.size=l;this.rtt=m;this.retries=T},drr=function(a){g.ak.call(this,"serverreachability",a)},A7V=function(a){a.Vb(1,0); a.Jm=E4(a,null,a.Mn);j$V(a)},P4r=function(a){a.Fh&&(a.Fh.abort(),a.Fh=null); a.Ig&&(a.Ig.cancel(),a.Ig=null);a.xu&&(g.u7.clearTimeout(a.xu),a.xu=null);xj(a);a.Zi&&(a.Zi.cancel(),a.Zi=null);a.Ld&&(g.u7.clearTimeout(a.Ld),a.Ld=null)},GSX=function(a,l){if(a.T==0)throw Error("Invalid operation: sending map when state is closed"); a.L.push(new Mss(a.Bn++,l));a.T!=2&&a.T!=3||j$V(a)},Vss=function(a){var l=0; a.Ig&&l++;a.Zi&&l++;return l},j$V=function(a){a.Zi||a.Ld||(a.Ld=BD((0,g.Rs)(a.Lr,a),0),a.LU=0)},W$5=function(a,l){if(a.T==1){if(!l){a.DY=Math.floor(Math.random()*1E5); l=a.DY++;var m=new wJ(a,"",l);m.Na=a.zb;var T=pws(a),y=a.Jm.clone();g.GJ(y,"RID",l);g.GJ(y,"CVER","1");Dv(a,y);Dpd(m,y,T);a.Zi=m;a.T=2}}else a.T==3&&(l?Z2X(a,l):a.L.length==0||a.Zi||Z2X(a))},Z2X=function(a,l){if(l)if(a.lD>6){a.L=a.Z.concat(a.L); a.Z.length=0;var m=a.DY-1;l=pws(a)}else m=l.B,l=l.IW;else m=a.DY++,l=pws(a);var T=a.Jm.clone();g.GJ(T,"SID",a.j);g.GJ(T,"RID",m);g.GJ(T,"AID",a.sA);Dv(a,T);m=new wJ(a,a.j,m,a.LU+1);m.Na=a.zb;m.setTimeout(1E4+Math.round(1E4*Math.random()));a.Zi=m;Dpd(m,T,l)},Dv=function(a,l){a.zW&&(a=a.zW.O2())&&g.wg(a,function(m,T){g.GJ(l,T,m)})},pws=function(a){var l=Math.min(a.L.length,1E3),m=["count="+l]; if(a.lD>6&&l>0){var T=a.L[0].T;m.push("ofs="+T)}else T=0;for(var y={},R=0;R=3)return!1; a.B++;a.xu=BD((0,g.Rs)(a.Tg,a),L$B(a,a.Ta));a.Ta++;return!0},o6=function(a,l,m){a.DO=a.C==null?m:!a.C; a.kV=l.Fs;a.J||A7V(a)},xj=function(a){a.T4!=null&&(g.u7.clearTimeout(a.T4),a.T4=null)},L$B=function(a,l){var m=5E3+Math.floor(Math.random()*1E4); a.isActive()||(m*=2);return m*l},ut=function(a,l){if(l==2||l==9){var m=null; a.zW&&(m=null);var T=(0,g.Rs)(a.Atj,a);m||(m=new g.b_("//www.google.com/images/cleardot.gif"),rc(m));y7I(m.toString(),1E4,T)}else nB(2);Q$B(a,l)},Q$B=function(a,l){a.T=0; a.zW&&a.zW.s2(l);tsr(a);P4r(a)},tsr=function(a){a.T=0; a.kV=-1;if(a.zW)if(a.Z.length==0&&a.L.length==0)a.zW.Pf();else{var l=g.NF(a.Z),m=g.NF(a.L);a.Z.length=0;a.L.length=0;a.zW.Pf(l,m)}},E4=function(a,l,m){var T=g.Vr(m); if(T.T!="")l&&g.MV(T,l+"."+T.T),g.i_(T,T.Z);else{var y=window.location;T=Cpr(y.protocol,l?l+"."+y.hostname:y.hostname,+y.port,m)}a.q7&&g.wg(a.q7,function(R,H){g.GJ(T,H,R)}); g.GJ(T,"VER",a.lD);Dv(a,T);return T},ebg=function(){},F$V=function(){this.T=[]; this.L=[]},hb5=function(a){g.ak.call(this,"channelMessage"); this.message=a},O2D=function(a){g.ak.call(this,"channelError"); this.error=a},K$5=function(a,l){this.action=a; this.params=l||{}},X4=function(a,l){g.k.call(this); this.T=new g.aH(this.i5O,0,this);g.w(this,this.T);this.rk=5E3;this.L=0;if(typeof a==="function")l&&(a=(0,g.Rs)(a,l));else if(a&&typeof a.handleEvent==="function")a=(0,g.Rs)(a.handleEvent,a);else throw Error("Invalid listener argument");this.Z=a},zbg=function(a,l,m,T,y,R,H,b,M,d,A,P,G,V){m=m===void 0?!1:m; T=T===void 0?function(){return""}:T; y=y===void 0?!1:y;R=R===void 0?!1:R;H=H===void 0?!1:H;b=b===void 0?function(){return g.SF({})}:b; M=M===void 0?!1:M;A=A===void 0?!1:A;P=P===void 0?!1:P;G=G===void 0?!1:G;V=V===void 0?!1:V;this.AM=a;this.Ij=l;this.C=new g.Ke;this.L=new X4(this.BNu,this);this.T=null;this.B=!1;this.N=null;this.jt="";this.lT=this.J=0;this.Z=[];this.uZ=m;this.hM=T;this.K=R;this.Cx=b;this.Kx=d;this.QO=H;this.qj=null;this.j=g.SF();this.SW=y;this.ZR=M;this.vF=A;this.yg=P;this.wW=G;this.lZ=V;this.wb=new $Md;this.St=new swF;this.rb=new ffc;this.Mj=new SuV;this.tM=new JWF;this.tN=new Bh_;this.Ug=new kc_},s$B=function(a, l,m,T,y){vTn(a); if(a.T){var R=g.Uu("ID_TOKEN"),H=a.T.zb||{};R?H["x-youtube-identity-token"]=R:delete H["x-youtube-identity-token"];a.T.zb=H}$rr(a);T?(T.getState()!=3&&Vss(T)==0||T.getState(),a.T.connect(l,m,a.Ij,T.j,T.sA)):y?a.T.connect(l,m,a.Ij,y.sessionId,y.arrayId):a.T.connect(l,m,a.Ij)},BC9=function(a,l){return a.wW?!0:a.yg?Object.values(S9d).includes(l):a.vF?!Object.values(fZd).includes(l):a.lZ?Object.values(J7F).includes(l):!1},wws=function(a){var l,m; g.J(function(T){if(T.L==1)return g.Qp(T,2),g.z(T,kS5(a),2);g.zH(T);l=a.Z;a.Z=[];m=l.length;nTX(a,l,m);Yj(a);return g.$l(T,0)})},nTX=function(a,l,m){for(var T=0;T0?m=Object.assign({},m,l):delete m.Authorization;a.T.zb=m}},$rr=function(a){a.Kx&&!a.K&&C4X(a,a.Kx())},U4=function(a){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.L=!0;a=a||document.location.href;var l=Number(g.e$(a)[4]||null)||"";l&&(this.port=":"+l);this.domain=g.Fl(a)||"";a=g.ej();a.search("MSIE")>=0&&(a=a.match(/MSIE ([\d.]+)/)[1],g.t0(a,"10.0")<0&&(this.L=!1))},rJ=function(a,l){var m=a.T; a.L&&(m=a.scheme+"://"+a.domain+a.port+a.T);return g.S$(m+l,{})},ET5=function(a,l){g.Vz.call(this); var m=this;this.Gq=a();this.Gq.subscribe("handlerOpened",this.SR,this);this.Gq.subscribe("handlerClosed",this.onClosed,this);this.Gq.subscribe("handlerError",function(T,y){m.onError(y)}); this.Gq.subscribe("handlerMessage",this.onMessage,this);this.T=l},oT5=function(a,l,m){var T=this; m=m===void 0?function(){return""}:m; var y=y===void 0?new nHV:y;var R=R===void 0?new g.Ke:R;this.pathPrefix=a;this.T=l;this.jt=m;this.K=R;this.J=null;this.N=this.B=0;this.channel=null;this.C=0;this.Z=new X4(function(){T.Z.isActive();var H;((H=T.channel)==null?void 0:PRd((new CRI(H,H.T)).T.L))===0&&T.connect(T.J,T.B)}); this.j={};this.L={};this.Ij=!1;this.logger=null;this.lT=[];this.At=void 0;this.Cx=new $Md;this.qj=new swF;this.Kx=new SuV;this.hM=new JWF},xrD=function(a){g.bB(a.channel,"m",function(){a.C=3; a.Z.reset();a.J=null;a.B=0;for(var l=g.c(a.lT),m=l.next();!m.done;m=l.next())m=m.value,a.channel&&a.channel.send(m);a.lT=[];a.publish("webChannelOpened");a.Cx.p$("WEB_CHANNEL")}); g.bB(a.channel,"n",function(){a.C=0;a.Z.isActive()||a.publish("webChannelClosed");var l,m=(l=a.channel)==null?void 0:EH_(new CRI(l,l.T));m&&(a.lT=[].concat(g.F(m)));a.qj.p$("WEB_CHANNEL")}); g.bB(a.channel,"p",function(l){var m=l.data;m[0]==="gracefulReconnect"?(a.Z.start(),a.channel&&a.channel.close()):a.publish("webChannelMessage",new K$5(m[0],m[1]));a.At=l.statusCode;a.Kx.p$("WEB_CHANNEL")}); g.bB(a.channel,"o",function(){a.At===401||a.Z.start();a.publish("webChannelError");a.hM.p$("WEB_CHANNEL","")})},Drn=function(a){var l=a.jt(); l?a.j["x-youtube-lounge-xsrf-token"]=l:delete a.j["x-youtube-lounge-xsrf-token"]},uzV=function(a){g.Vz.call(this); this.T=a();this.T.subscribe("webChannelOpened",this.kK,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},Xwc=function(a,l,m,T,y){function R(){return new zbg(rJ(a,"/bc"),l,!1,m,T)} m=m===void 0?function(){return""}:m; return g.Q7("enable_mdx_web_channel_desktop")?new uzV(function(){return new oT5(rJ(a,"/wc"),l,m)}):new ET5(R,y)},a1c=function(){var a=Y9s; UrX();aD.push(a);r7_()},lU=function(a,l){UrX(); var m=l1B(a,String(l));aD.length==0?mtV(m):(r7_(),g.Bn(aD,function(T){T(m)}))},mM=function(a){lU("CP",a)},UrX=function(){aD||(aD=g.Yl("yt.mdx.remote.debug.handlers_")||[],g.Xt("yt.mdx.remote.debug.handlers_",aD))},mtV=function(a){var l=(TF+1)%50; TF=l;yG[l]=a;RD||(RD=l==49)},r7_=function(){var a=aD; if(yG[0]){var l=RD?TF:-1,m={};do m={sR:void 0},l=(l+1)%50,m.sR=yG[l],g.Bn(a,function(T){return function(y){y(T.sR)}}(m)); while(l!=TF);yG=Array(50);TF=-1;RD=!1}},l1B=function(a,l){var m=(Date.now()-Ted)/1E3; m.toFixed&&(m=m.toFixed(3));var T=[];T.push("[",m+"s","] ");T.push("[","yt.mdx.remote","] ");T.push(a+": "+l,"\n");return T.join("")},HG=function(a){g.Aj.call(this); this.C=a;this.screens=[]},yJs=function(a,l){var m=a.get(l.uuid)||a.get(l.id); if(m)return a=m.name,m.id=l.id||m.id,m.name=l.name,m.token=l.token,m.uuid=l.uuid||m.uuid,m.name!=a;a.screens.push(l);return!0},RT_=function(a,l){var m=a.screens.length!=l.length; a.screens=g.BN(a.screens,function(R){return!!Lec(l,R)}); for(var T=l.length,y=0;y0&&a.j0&&ZG(a,m)},function(l){a.K=function(){}; a.bS(l)})},sWd=function(a){var l={}; l.pairingCode=a.qj;l.theme=a.AM;$ys()&&(l.env_useStageMdx=1);return g.s0(l)},ScD=function(a){return new Promise(function(l){a.qj=We9(); if(a.Cx){var m=new chrome.cast.DialLaunchResponse(!0,sWd(a));l(m);$tr(a)}else a.Ij=function(){g.c$(a.N);a.Ij=function(){}; a.N=NaN;var T=new chrome.cast.DialLaunchResponse(!0,sWd(a));l(T);$tr(a)},a.N=g.ZC(function(){a.Ij()},100)})},JJ9=function(a,l,m){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(l)); var T=new q9(l);return(new Promise(function(y){f1s(a,T,function(R){R?(a.lT=!0,dl(a.j,T),Ah(a,T),ZG(a,m)):g.lr(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(l)+" is not online."));y(R)},5)})).then(function(y){return y?new chrome.cast.DialLaunchResponse(!1):ScD(a)})},Bes=function(a,l){var m=a.J.receiver.label,T=a.L.friendlyName; return(new Promise(function(y){Vxd(a.j,m,l,T,function(R){R&&R.token&&Ah(a,R);y(R)},function(R){PG(a,"Failed to get DIAL screen: "+R); y(null)})})).then(function(y){return y&&y.token?new chrome.cast.DialLaunchResponse(!1):ScD(a)})},f1s=function(a,l,m,T){g.c$(a.C); a.C=0;ZIn(a.j,l,function(y){y||T<0?m(y):a.C=g.ZC(function(){f1s(a,l,m,T-1)},300)})},ZG=function(a,l){a.info("getDialAppInfoWithTimeout_ "+l); p6(a)&&(g.c$(a.B),a.B=0,l==0?kx_(a):a.B=g.ZC(function(){kx_(a)},l))},kx_=function(a){p6(a)&&a.Z.getDialAppInfo(function(l){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(l)); l=l.extraData||{};var m=null;if(l.loungeToken){var T;((T=a.T)==null?void 0:T.token)==l.loungeToken&&(m="staleLoungeToken")}else m="missingLoungeToken";m?(a.jt=m,ZG(a,3E4)):(a.lT=!1,a.jt="unknown",NeB(a,l.loungeToken),ZG(a,l.loungeTokenRefreshIntervalMs))},function(l){a.info("getDialAppInfo error: "+l); a.jt="noLoungeTokenResponse";ZG(a,3E4)})},nqr=function(a){g.c$(a.C); a.C=0;g.c$(a.B);a.B=0;a.K();a.K=function(){}; g.c$(a.N)},WG=function(a,l){jH.call(this,a,l,"ManualSession"); this.Z=g.ZC((0,g.Rs)(this.yE,this,null),150)},cG=function(a,l){g.Aj.call(this); this.config_=l;this.L=a;this.J=l.appId||"233637DE";this.j=l.theme||"cl";this.N=l.disableCastApi||!1;this.C=l.forceMirroring||!1;this.T=null;this.B=!1;this.Z=[];this.K=(0,g.Rs)(this.bRL,this)},wjr=function(a,l){return l?g.Pn(a.Z,function(m){return bt(l,m.label)},a):null},L6=function(a){lU("Controller",a)},Y9s=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},Ns=function(a){return a.B||!!a.Z.length||!!a.T},QG=function(a,l,m){l!=a.T&&(g.Go(a.T),(a.T=l)?(m?a.publish("yt-remote-cast2-receiver-resumed", l.L):a.publish("yt-remote-cast2-receiver-selected",l.L),l.subscribe("sessionScreen",(0,g.Rs)(a.mZ,a,l)),l.subscribe("sessionFailed",function(){return I1I(a,l)}),l.T?a.publish("yt-remote-cast2-session-change",l.T):m&&a.T.yE(null)):a.publish("yt-remote-cast2-session-change",null))},I1I=function(a,l){a.T==l&&a.publish("yt-remote-cast2-session-failed")},CQs=function(a){var l=a.L.qW(),m=a.T&&a.T.L; a=g.xX(l,function(T){m&&bt(T,m.label)&&(m=null);var y=T.uuid?T.uuid:T.id,R=wjr(this,T);R?(R.label=y,R.friendlyName=T.name):(R=new chrome.cast.Receiver(y,T.name),R.receiverType=chrome.cast.ReceiverType.CUSTOM);return R},a); m&&(m.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(m=new chrome.cast.Receiver(m.label,m.friendlyName),m.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(m));return a},Yc9=function(a,l,m,T){T.disableCastApi?th("Cannot initialize because disabled by Mdx config."):Eq_()?oq9(l,T)&&(xtr(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Dts(a,m):(window.__onGCastApiAvailable=function(y,R){y?Dts(a,m):(eH("Failed to load cast API: "+R),uBI(!1),xtr(!1),g.kH("yt-remote-cast-available"),g.kH("yt-remote-cast-receiver"), XjV(),m(!1))},T.loadCastApiSetupScript?g.d6("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?SZX()>=60&&EaD():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?kvr():SZX()>=89?xys():(Crd(),V_(oaD.map(na5))))):th("Cannot initialize because not running Chrome")},XjV=function(){th("dispose"); var a=Fj();a&&a.dispose();g.Xt("yt.mdx.remote.cloudview.instance_",null);Utr(!1);g.MQ(rJd);rJd.length=0},hh=function(){return!!g.BW("yt-remote-cast-installed")},aEX=function(){var a=g.BW("yt-remote-cast-receiver"); return a?a.friendlyName:null},lEd=function(){th("clearCurrentReceiver"); g.kH("yt-remote-cast-receiver")},mQs=function(){return hh()?Fj()?Fj().getCastSession():(eH("getCastSelector: Cast is not initialized."),null):(eH("getCastSelector: Cast API is not installed!"),null)},T69=function(){hh()?Fj()?Ok()?(th("Requesting cast selector."),Fj().requestSession()):(th("Wait for cast API to be ready to request the session."),rJd.push(g.g6("yt-remote-cast2-api-ready",T69))):eH("requestCastSelector: Cast is not initialized."):eH("requestCastSelector: Cast API is not installed!")}, K6=function(a,l){Ok()?Fj().setConnectedScreenStatus(a,l):eH("setConnectedScreenStatus called before ready.")},Eq_=function(){var a=g.ej().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.s_||a},ymF=function(a,l){Fj().init(a,l)},oq9=function(a,l){var m=!1; Fj()||(a=new cG(a,l),a.subscribe("yt-remote-cast2-availability-change",function(T){g.JN("yt-remote-cast-available",T);PD("yt-remote-cast2-availability-change",T)}),a.subscribe("yt-remote-cast2-receiver-selected",function(T){th("onReceiverSelected: "+T.friendlyName); g.JN("yt-remote-cast-receiver",T);PD("yt-remote-cast2-receiver-selected",T)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(T){th("onReceiverResumed: "+T.friendlyName); g.JN("yt-remote-cast-receiver",T);PD("yt-remote-cast2-receiver-resumed",T)}),a.subscribe("yt-remote-cast2-session-change",function(T){th("onSessionChange: "+gJ(T)); T||g.kH("yt-remote-cast-receiver");PD("yt-remote-cast2-session-change",T)}),g.Xt("yt.mdx.remote.cloudview.instance_",a),m=!0); th("cloudview.createSingleton_: "+m);return m},Fj=function(){return g.Yl("yt.mdx.remote.cloudview.instance_")},Dts=function(a,l){uBI(!0); xtr(!1);ymF(a,function(m){m?(Utr(!0),g.i$("yt-remote-cast2-api-ready")):(eH("Failed to initialize cast API."),uBI(!1),g.kH("yt-remote-cast-available"),g.kH("yt-remote-cast-receiver"),XjV());l(m)})},th=function(a){lU("cloudview",a)},eH=function(a){lU("cloudview",a)},uBI=function(a){th("setCastInstalled_ "+a); g.JN("yt-remote-cast-installed",a)},Ok=function(){return!!g.Yl("yt.mdx.remote.cloudview.apiReady_")},Utr=function(a){th("setApiReady_ "+a); g.Xt("yt.mdx.remote.cloudview.apiReady_",a)},xtr=function(a){g.Xt("yt.mdx.remote.cloudview.initializing_",a)},zF=function(a){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.B=0;this.trackData=null;this.AE=this.Dz=!1;this.J=this.K=this.T=this.j=0;this.Z=NaN;this.L=!1;this.reset(a)},RD5=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.Dz=!1;a.AE=!1;a.B=0;a.C=g.bV();a.j=0;a.T=0;a.K=0;a.J=0;a.Z=NaN;a.L=!1},vG=function(a){return a.isPlaying()?(g.bV()-a.C)/1E3:0},$J=function(a,l){a.B=l; a.C=g.bV()},sk=function(a){switch(a.playerState){case 1:case 1081:return(g.bV()-a.C)/1E3+a.B; case -1E3:return 0}return a.B},SH=function(a,l,m){var T=a.videoId; a.videoId=l;a.index=m;l!=T&&RD5(a)},HpI=function(a){var l={}; l.index=a.index;l.listId=a.listId;l.videoId=a.videoId;l.playerState=a.playerState;l.volume=a.volume;l.muted=a.muted;l.audioTrackId=a.audioTrackId;l.trackData=g.Tm(a.trackData);l.hasPrevious=a.Dz;l.hasNext=a.AE;l.playerTime=a.B;l.playerTimeAt=a.C;l.seekableStart=a.j;l.seekableEnd=a.T;l.duration=a.K;l.loadedTime=a.J;l.liveIngestionTime=a.Z;return l},Jh=function(a,l){g.Aj.call(this); var m=this;this.Z=0;this.j=a;this.C=[];this.K=new F$V;this.L=this.T=null;this.N=(0,g.Rs)(this.rMK,this);this.B=(0,g.Rs)(this.FB,this);this.J=(0,g.Rs)(this.PTT,this);this.Ij=(0,g.Rs)(this.zjK,this);var T=0;a?(T=a.getProxyState(),T!=3&&(a.subscribe("proxyStateChange",this.iR,this),qUV(this))):T=3;T!=0&&(l?this.iR(T):g.ZC(function(){m.iR(T)},0)); (a=mQs())&&f6(this,a);this.subscribe("yt-remote-cast2-session-change",this.Ij)},BG=function(a){return new zF(a.j.getPlayerContextData())},qUV=function(a){g.Bn("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(l){this.C.push(this.j.subscribe(l,g.qF(this.AWO,l),this))},a)},bpr=function(a){g.Bn(a.C,function(l){this.j.unsubscribeByKey(l)},a); a.C.length=0},kJ=function(a){return a.getState()==1},n6=function(a,l){var m=a.K; m.T.length+m.L.length<50&&a.K.enqueue(l)},gOs=function(a,l,m){var T=BG(a); $J(T,m);T.playerState!=-1E3&&(T.playerState=l);wl(a,T)},ID=function(a,l,m){a.j.sendMessage(l,m)},wl=function(a,l){bpr(a); a.j.setPlayerContextData(HpI(l));qUV(a)},f6=function(a,l){a.L&&(a.L.removeUpdateListener(a.N),a.L.removeMediaListener(a.B),a.FB(null)); a.L=l;a.L&&(mM("Setting cast session: "+a.L.sessionId),a.L.addUpdateListener(a.N),a.L.addMediaListener(a.B),a.L.media.length&&a.FB(a.L.media[0]))},MLd=function(a){var l=a.T.media,m=a.T.customData; if(l&&m){var T=BG(a);l.contentId!=T.videoId&&mM("Cast changing video to: "+l.contentId);T.videoId=l.contentId;T.playerState=m.playerState;$J(T,a.T.getEstimatedTime());wl(a,T)}else mM("No cast media video. Ignoring state update.")},C6=function(a,l,m){return(0,g.Rs)(function(T){this.i4("Failed to "+l+" with cast v2 channel. Error code: "+T.code); T.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.i4("Retrying "+l+" using MDx browser channel."),ID(this,l,m))},a)},xJ=function(a,l,m,T){T=T===void 0?!1:T; g.Aj.call(this);var y=this;this.C=NaN;this.qj=!1;this.N=this.J=this.lT=this.jt=NaN;this.Ij=[];this.K=this.B=this.j=this.T=this.L=null;this.Cx=a;this.Kx=T;this.Ij.push(g.eb(window,"beforeunload",function(){y.Hb(2)})); this.Z=[];this.T=new zF;this.AM=l.id;this.hM=l.idType;this.L=Xwc(this.Cx,m,this.o3,this.hM=="shortLived",this.AM);this.L.listen("channelOpened",function(){ipg(y)}); this.L.listen("channelClosed",function(){Ek("Channel closed");isNaN(y.C)?jA(!0):jA();y.dispose()}); this.L.listen("channelError",function(R){jA();isNaN(y.Oo())?(R==1&&y.hM=="shortLived"&&y.publish("browserChannelAuthError",R),Ek("Channel error: "+R+" without reconnection"),y.dispose()):(y.qj=!0,Ek("Channel error: "+R+" with reconnection in "+y.Oo()+" ms"),oD(y,2))}); this.L.listen("channelMessage",function(R){dQn(y,R)}); this.L.wp(l.token);this.subscribe("remoteQueueChange",function(){var R=y.T.videoId;g.nZ()&&g.JN("yt-remote-session-video-id",R)})},joI=function(a){return g.Pn(a.Z,function(l){return l.type=="LOUNGE_SCREEN"})},Ek=function(a){lU("conn",a)},oD=function(a,l){a.publish("proxyStateChange",l)},AmD=function(a){a.C=g.ZC(function(){Ek("Connecting timeout"); a.Hb(1)},2E4)},P$s=function(a){g.c$(a.C); a.C=NaN},GGV=function(a){g.c$(a.jt); a.jt=NaN},pgs=function(a){VLr(a); a.lT=g.ZC(function(){DG(a,"getNowPlaying")},2E4)},VLr=function(a){g.c$(a.lT); a.lT=NaN},ipg=function(a){Ek("Channel opened"); a.qj&&(a.qj=!1,GGV(a),a.jt=g.ZC(function(){Ek("Timing out waiting for a screen.");a.Hb(1)},15E3))},WPs=function(a,l){var m=null; if(l){var T=joI(a);T&&(m={clientName:T.clientName,deviceMake:T.brand,deviceModel:T.model,osVersion:T.osVersion})}g.Xt("yt.mdx.remote.remoteClient_",m);l&&(P$s(a),GGV(a));m=a.L.eV()&&isNaN(a.C);l==m?l&&(oD(a,1),DG(a,"getSubtitlesTrack")):l?(a.VT()&&a.T.reset(),oD(a,1),DG(a,"getNowPlaying"),ZpD(a)):a.Hb(1)},cmd=function(a,l){var m=l.params.videoId; delete l.params.videoId;m==a.T.videoId&&(g.rg(l.params)?a.T.trackData=null:a.T.trackData=l.params,a.publish("remotePlayerChange"))},LPn=function(a,l,m){var T=l.params.videoId||l.params.video_id,y=parseInt(l.params.currentIndex,10); a.T.listId=l.params.listId||a.T.listId;SH(a.T,T,y);a.publish("remoteQueueChange",m)},Qor=function(a,l){l.params=l.params||{}; LPn(a,l,"NOW_PLAYING_MAY_CHANGE");N6X(a,l);a.publish("autoplayDismissed")},N6X=function(a,l){var m=parseInt(l.params.currentTime||l.params.current_time,10); $J(a.T,isNaN(m)?0:m);m=parseInt(l.params.state,10);m=isNaN(m)?-1:m;m==-1&&a.T.playerState==-1E3&&(m=-1E3);a.T.playerState=m;m=Number(l.params.loadedTime);a.T.J=isNaN(m)?0:m;a.T.yf(Number(l.params.duration));m=a.T;var T=Number(l.params.liveIngestionTime);m.Z=T;m.L=isNaN(T)?!1:!0;m=a.T;T=Number(l.params.seekableStartTime);l=Number(l.params.seekableEndTime);m.j=isNaN(T)?0:T;m.T=isNaN(l)?0:l;a.T.playerState==1?pgs(a):VLr(a);a.publish("remotePlayerChange")},tLV=function(a,l){if(a.T.playerState!=-1E3){var m= 1085; switch(parseInt(l.params.adState,10)){case 1:m=1081;break;case 2:m=1084;break;case 0:m=1083}a.T.playerState=m;l=parseInt(l.params.currentTime,10);$J(a.T,isNaN(l)?0:l);a.publish("remotePlayerChange")}},eDd=function(a,l){var m=l.params.muted=="true"; a.T.volume=parseInt(l.params.volume,10);a.T.muted=m;a.publish("remotePlayerChange")},FPn=function(a,l){a.B=l.params.videoId; a.publish("nowAutoplaying",parseInt(l.params.timeout,10))},hD9=function(a,l){a.B=l.params.videoId||null; a.publish("autoplayUpNext",a.B)},OpF=function(a,l){a.K=l.params.autoplayMode; a.publish("autoplayModeChange",a.K);a.K=="DISABLED"&&a.publish("autoplayDismissed")},KPX=function(a,l){var m=l.params.hasNext=="true"; a.T.Dz=l.params.hasPrevious=="true";a.T.AE=m;a.publish("previousNextChange")},dQn=function(a,l){l=l.message; l.params?Ek("Received: action="+l.action+", params="+g.ok(l.params)):Ek("Received: action="+l.action+" {}");switch(l.action){case "loungeStatus":l=lt(l.params.devices);a.Z=g.xX(l,function(T){return new HD(T)}); l=!!g.Pn(a.Z,function(T){return T.type=="LOUNGE_SCREEN"}); WPs(a,l);l=a.Ve("mlm");a.publish("multiStateLoopEnabled",l);break;case "loungeScreenDisconnected":g.cn(a.Z,function(T){return T.type=="LOUNGE_SCREEN"}); WPs(a,!1);break;case "remoteConnected":var m=new HD(lt(l.params.device));g.Pn(a.Z,function(T){return T.equals(m)})||O5D(a.Z,m); break;case "remoteDisconnected":m=new HD(lt(l.params.device));g.cn(a.Z,function(T){return T.equals(m)}); break;case "gracefulDisconnect":break;case "playlistModified":LPn(a,l,"QUEUE_MODIFIED");break;case "nowPlaying":Qor(a,l);break;case "onStateChange":N6X(a,l);break;case "onAdStateChange":tLV(a,l);break;case "onVolumeChanged":eDd(a,l);break;case "onSubtitlesTrackChanged":cmd(a,l);break;case "nowAutoplaying":FPn(a,l);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":hD9(a,l);break;case "onAutoplayModeChanged":OpF(a,l);break;case "onHasPreviousNextChanged":KPX(a, l);break;case "requestAssistedSignIn":a.publish("assistedSignInRequested",l.params.authCode);break;case "onLoopModeChanged":a.publish("loopModeChange",l.params.loopMode);break;default:Ek("Unrecognized action: "+l.action)}},ZpD=function(a){g.c$(a.N); a.N=g.ZC(function(){a.Hb(1)},864E5)},DG=function(a,l,m){m?Ek("Sending: action="+l+", params="+g.ok(m)):Ek("Sending: action="+l); a.L.sendMessage(l,m)},zDn=function(a){HG.call(this,"ScreenServiceProxy"); this.q6=a;this.T=[];this.T.push(this.q6.$_s("screenChange",(0,g.Rs)(this.dE,this)));this.T.push(this.q6.$_s("onlineScreenChange",(0,g.Rs)(this.R4j,this)))},fEs=function(a,l){vaB(); if(!Af||!Af.get("yt-remote-disable-remote-module-for-dev")){l=g.Uu("MDX_CONFIG")||l;N0s();FeV();uU||(uU=new U4(l?l.loungeApiHost:void 0),$ys()&&(uU.T="/api/loungedev"));Xj||(Xj=g.Yl("yt.mdx.remote.deferredProxies_")||[],g.Xt("yt.mdx.remote.deferredProxies_",Xj));vOB();var m=YJ();if(!m){var T=new iU(uU,l?l.disableAutomaticScreenCache||!1:!1);g.Xt("yt.mdx.remote.screenService_",T);m=YJ();var y={};l&&(y={appId:l.appId,disableDial:l.disableDial,theme:l.theme,loadCastApiSetupScript:l.loadCastApiSetupScript, disableCastApi:l.disableCastApi,enableDialLoungeToken:l.enableDialLoungeToken,enableCastLoungeToken:l.enableCastLoungeToken,forceMirroring:l.forceMirroring});g.Xt("yt.mdx.remote.enableConnectWithInitialState_",l?l.enableConnectWithInitialState||!1:!1);Yc9(a,T,function(R){R?Uk()&&K6(Uk(),"YouTube TV"):T.subscribe("onlineScreenChange",function(){PD("yt-remote-receiver-availability-change")})},y)}l&&!g.Yl("yt.mdx.remote.initialized_")&&(g.Xt("yt.mdx.remote.initialized_",!0),rl("Initializing: "+g.ok(l)), aK.push(g.g6("yt-remote-cast2-api-ready",function(){PD("yt-remote-api-ready")})),aK.push(g.g6("yt-remote-cast2-availability-change",function(){PD("yt-remote-receiver-availability-change")})),aK.push(g.g6("yt-remote-cast2-receiver-selected",function(){lx(null); PD("yt-remote-auto-connect","cast-selector-receiver")})),aK.push(g.g6("yt-remote-cast2-receiver-resumed",function(){PD("yt-remote-receiver-resumed","cast-selector-receiver")})),aK.push(g.g6("yt-remote-cast2-session-change",$QV)),aK.push(g.g6("yt-remote-connection-change",function(R){R?K6(Uk(),"YouTube TV"):mR()||(K6(null,null),lEd())})),aK.push(g.g6("yt-remote-cast2-session-failed",function(){PD("yt-remote-connection-failed")})),a=sod(),l.isAuto&&(a.id+="#dial"),y=l.capabilities||[],g.Q7("desktop_enable_autoplay")&& y.push("atp"),y.length>0&&(a.capabilities=y),a.name=l.device,a.app=l.app,(l=l.theme)&&(a.theme=l),rl(" -- with channel params: "+g.ok(a)),a?(g.JN("yt-remote-session-app",a.app),g.JN("yt-remote-session-name",a.name)):(g.kH("yt-remote-session-app"),g.kH("yt-remote-session-name")),g.Xt("yt.mdx.remote.channelParams_",a),m.start(),Uk()||SUs())}},JmV=function(){var a=YJ().q6.$_gos(); var l=TT();l&&RK()&&(Lec(a,l)||a.push(l));return cRd(a)},kG_=function(){var a=B6_(); !a&&hh()&&aEX()&&(a={key:"cast-selector-receiver",name:aEX()});return a},B6_=function(){var a=JmV(),l=TT(); l||(l=mR());return g.Pn(a,function(m){return l&&bt(l,m.key)?!0:!1})},TT=function(){var a=Uk(); if(!a)return null;var l=YJ().eC();return M9(l,a)},$QV=function(a){rl("remote.onCastSessionChange_: "+gJ(a)); if(a){var l=TT();if(l&&l.id==a.id){if(K6(l.id,"YouTube TV"),a.idType=="shortLived"&&(a=a.token))Hh&&(Hh.token=a),(l=RK())&&l.wp(a)}else l&&qk(),bx(a,1)}else RK()&&qk()},qk=function(){Ok()?Fj().stopSession():eH("stopSession called before API ready."); var a=RK();a&&(a.disconnect(1),nOr(null))},wgr=function(){var a=RK(); return!!a&&a.getProxyState()!=3},rl=function(a){lU("remote",a)},YJ=function(){if(!IEr){var a=g.Yl("yt.mdx.remote.screenService_"); IEr=a?new zDn(a):null}return IEr},Uk=function(){return g.Yl("yt.mdx.remote.currentScreenId_")},C$X=function(a){g.Xt("yt.mdx.remote.currentScreenId_",a)},EO_=function(){return g.Yl("yt.mdx.remote.connectData_")},lx=function(a){g.Xt("yt.mdx.remote.connectData_",a)},RK=function(){return g.Yl("yt.mdx.remote.connection_")},nOr=function(a){var l=RK(); lx(null);a||C$X("");g.Xt("yt.mdx.remote.connection_",a);Xj&&(g.Bn(Xj,function(m){m(a)}),Xj.length=0); l&&!a?PD("yt-remote-connection-change",!1):!l&&a&&PD("yt-remote-connection-change",!0)},mR=function(){var a=g.nZ(); if(!a)return null;var l=YJ();if(!l)return null;l=l.eC();return M9(l,a)},bx=function(a,l){Uk(); TT()&&TT();if(gI)Hh=a;else{C$X(a.id);var m=g.Yl("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new xJ(uU,a,sod(),m);a.connect(l,EO_());a.subscribe("beforeDisconnect",function(T){PD("yt-remote-before-disconnect",T)}); a.subscribe("beforeDispose",function(){RK()&&(RK(),nOr(null))}); a.subscribe("browserChannelAuthError",function(){var T=TT();T&&T.idType=="shortLived"&&(Ok()?Fj().handleBrowserChannelAuthError():eH("refreshLoungeToken called before API ready."))}); nOr(a)}},SUs=function(){var a=mR(); a?(rl("Resume connection to: "+gJ(a)),bx(a,0)):(jA(),lEd(),rl("Skipping connecting because no session screen found."))},vOB=function(){var a=sod(); if(g.rg(a)){a=dJ();var l=g.BW("yt-remote-session-name")||"",m=g.BW("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:l,app:m,mdxVersion:3};a.authuser=String(g.Uu("SESSION_INDEX","0"));(l=g.Uu("DELEGATED_SESSION_ID"))&&(a.pageId=String(l));g.Xt("yt.mdx.remote.channelParams_",a)}},sod=function(){return g.Yl("yt.mdx.remote.channelParams_")||{}},DQr=function(a,l,m){g.k.call(this); var T=this;this.T=a;this.D=l;this.jx=m;this.events=new g.BT(this);this.K=!1;this.C=new g.qz(64);this.L=new g.aH(this.LK,500,this);this.Z=new g.aH(this.s3,1E3,this);this.J=new pB(this.GAN,0,this);this.j={};this.N=new g.aH(this.NT,1E3,this);this.B=new g.ye(this.seekTo,1E3,this);this.Ij=this.events.W(this.D,"onVolumeChange",function(y){oOV(T,y)}); g.w(this,this.events);this.events.W(l,"onCaptionsTrackListChanged",this.KWt);this.events.W(l,"captionschanged",this.XzO);this.events.W(l,"captionssettingschanged",this.Dm);this.events.W(l,"videoplayerreset",this.k$);this.events.W(l,"mdxautoplaycancel",function(){T.jx.Qn()}); l.V("enable_mdx_video_play_directly")&&this.events.W(l,"videodatachange",function(){xQX(T.T)||Mk(T)||ix(T,0)}); a=this.jx;a.FO();a.subscribe("proxyStateChange",this.Ec,this);a.subscribe("remotePlayerChange",this.SG,this);a.subscribe("remoteQueueChange",this.k$,this);a.subscribe("previousNextChange",this.Uc,this);a.subscribe("nowAutoplaying",this.vl,this);a.subscribe("autoplayDismissed",this.Q9,this);g.w(this,this.L);g.w(this,this.Z);g.w(this,this.J);g.w(this,this.N);g.w(this,this.B);this.Dm();this.k$();this.SG()},oOV=function(a,l){if(Mk(a)){a.jx.unsubscribe("remotePlayerChange",a.SG,a); var m=Math.round(l.volume);l=!!l.muted;var T=BG(a.jx);if(m!==T.volume||l!==T.muted)a.jx.setVolume(m,l),a.N.start();a.jx.subscribe("remotePlayerChange",a.SG,a)}},uHr=function(a){a.ex(0); a.L.stop();a.If(new g.qz(64))},Xg_=function(a,l){if(Mk(a)&&!a.K){var m=null; l&&(m={style:a.D.getSubtitlesUserSettings()},Object.assign(m,l));a.jx.ut(a.D.getVideoData(1).videoId,m);a.j=g.B(BG(a.jx).trackData)}},ix=function(a,l){var m=a.D.getPlaylist(); if(m==null?0:m.listId){var T=m.index;var y=m.listId.toString()}m=a.D.getVideoData(1);a.jx.playVideo(m.videoId,l,T,y,m.playerParams,m.Cx,hyI(m));a.If(new g.qz(1))},YU5=function(a,l){if(l){var m=a.D.getOption("captions","tracklist",{iX:1}); m&&m.length?(a.D.setOption("captions","track",l),a.K=!1):(a.D.loadModule("captions"),a.K=!0)}else a.D.setOption("captions","track",{})},Mk=function(a){return BG(a.jx).videoId===a.D.getVideoData(1).videoId},UQF=function(a,l){g.JG.call(this,a); this.T=l},dI=function(){g.x.call(this,{U:"div", S:"ytp-mdx-popup-dialog",G:{role:"dialog"},X:[{U:"div",S:"ytp-mdx-popup-dialog-inner-content",X:[{U:"div",S:"ytp-mdx-popup-title",Lx:"No has iniciado sesi\u00f3n"},{U:"div",S:"ytp-mdx-popup-description",Lx:"Los v\u00eddeos que veas podr\u00edan aparecer en el historial de reproducciones de la TV e influir en las recomendaciones. Puedes evitarlo si cancelas e inicias sesi\u00f3n en YouTube desde tu ordenador."},{U:"div",S:"ytp-mdx-privacy-popup-buttons",X:[{U:"button",uT:["ytp-button","ytp-mdx-privacy-popup-cancel"], Lx:"Cancelar"},{U:"button",uT:["ytp-button","ytp-mdx-privacy-popup-confirm"],Lx:"Confirmar"}]}]}]});this.fade=new g.q4(this,250);this.cancelButton=this.OL("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.OL("ytp-mdx-privacy-popup-confirm");g.w(this,this.fade);this.W(this.cancelButton,"click",this.T);this.W(this.confirmButton,"click",this.L)},j0=function(a){g.x.call(this,{U:"div", S:"ytp-remote",X:[{U:"div",S:"ytp-remote-display-status",X:[{U:"div",S:"ytp-remote-display-status-icon",X:[g.q9R()]},{U:"div",S:"ytp-remote-display-status-text",Lx:"{{statustext}}"}]}]});this.api=a;this.fade=new g.q4(this,250);g.w(this,this.fade);this.W(a,"presentingplayerstatechange",this.onStateChange);this.Rf(a.getPlayerStateObject())},AY=function(a,l){g.sR.call(this,"Reproducir en",1,a,l); this.D=a;this.TL={};this.W(a,"onMdxReceiversChange",this.j);this.W(a,"presentingplayerstatechange",this.j);this.j()},rmr=function(a){g.P3.call(this,a); this.S7={key:We9(),name:"Este ordenador"};this.aV=null;this.subscriptions=[];this.oQ=this.jx=null;this.TL=[this.S7];this.Ay=this.S7;this.K5=new g.qz(64);this.Yj=0;this.qw=-1;this.rH=!1;this.W1=this.Pw=this.YS=null;if(!g.kN(this.player.Y())&&!g.IE(this.player.Y())){a=this.player;var l=g.pq(a);l&&(l=l.mM())&&(l=new AY(a,l),g.w(this,l));l=new j0(a);g.w(this,l);g.fq(a,l.element,4);this.YS=new dI;g.w(this,this.YS);g.fq(a,this.YS.element,4);this.rH=!!mR()}},Ph=function(a){a.Pw&&(a.player.removeEventListener("presentingplayerstatechange", a.Pw),a.Pw=null)},a_5=function(a,l,m){a.K5=m; a.player.publish("presentingplayerstatechange",new g.pu(m,l))},GT=function(a,l){if(l.key!==a.Ay.key)if(l.key===a.S7.key)qk(); else if(xQX(a)&&l_n(a),a.Ay=l,!a.player.Y().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.IE(a.player.Y())){var m=a.player.getPlaylistId();var T=a.player.getVideoData(1);var y=T.videoId;if(!m&&!y||(a.player.getAppState()===2||a.player.getAppState()===1)&&a.player.Y().V("should_clear_video_data_on_player_cued_unstarted"))T=null;else{var R=a.player.getPlaylist();if(R){var H=[];for(var b=0;b2*this.size&&R6(this),!0):!1}; g.Z.get=function(a,l){return Tg(this.L,a)?this.L[a]:l}; g.Z.set=function(a,l){Tg(this.L,a)||(this.size+=1,this.T.push(a),this.Hi++);this.L[a]=l}; g.Z.forEach=function(a,l){for(var m=this.JK(),T=0;T=T.T.length)return g.Ht;var R=T.T[l++];return g.si(a?R:T.L[R])}; return y}; var Xp_={Oub:"atp",X7N:"ska",jVK:"que",e7u:"mus",Hlj:"sus",yVx:"dsp",Ast:"seq",OHL:"mic",Ohb:"dpa",mwb:"cds",oW8:"mlm",jyu:"dsdtr",bHM:"ntb",kFL:"vsp",FmN:"scn",Olj:"rpe",Tdg:"dcn",Lmj:"dcp",MCu:"pas",Zhx:"drq",f$b:"opf",KmK:"els",m9T:"isg",kXz:"svq",CuL:"mvp",uKM:"ads",Noj:"stcp",f3L:"sads",syb:"dloc"},PrI={bn8:"u",J$t:"cl",dgL:"k",hcu:"i",GSL:"cr",msz:"m",Qyt:"g",CS:"up"},S9d={uB:"adPlaying",LS:"onAdStateChange"},fZd={kbx:"nowPlaying",R7t:"onStateChange",uB:"adPlaying",LS:"onAdStateChange",lf:"nowPlayingShorts", Zh:"onShortsStateChange"},J7F={lf:"nowPlayingShorts",Zh:"onShortsStateChange"};HD.prototype.equals=function(a){return a?this.id==a.id:!1}; var e0s="",Af=null;stV.prototype.flush=function(a,l){a=a===void 0?[]:a;l=l===void 0?!1:l;if(g.Q7("enable_client_streamz_web")){a=g.c(a);for(var m=a.next();!m.done;m=a.next())m=g.a8l(m.value),m={serializedIncrementBatch:g.Tf(m.L())},g.js("streamzIncremented",m,{sendIsolatedPayload:l})}}; var Gg,IC_=fCX("loadCastFramework")||fCX("loadCastApplicationFramework"),oaD=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.iV(pB,g.k);g.Z=pB.prototype;g.Z.oL=function(a){this.j=arguments;this.T=!1;this.pR?this.Z=g.bV()+this.rk:this.pR=g.wX(this.K,this.rk)}; g.Z.stop=function(){this.pR&&(g.u7.clearTimeout(this.pR),this.pR=null);this.Z=null;this.T=!1;this.j=[]}; g.Z.pause=function(){++this.L}; g.Z.resume=function(){this.L&&(--this.L,!this.L&&this.T&&(this.T=!1,this.C.apply(null,this.j)))}; g.Z.sL=function(){this.stop();pB.l4.sL.call(this)}; g.Z.C0=function(){this.pR&&(g.u7.clearTimeout(this.pR),this.pR=null);this.Z?(this.pR=g.wX(this.K,this.Z-g.bV()),this.Z=null):this.L?this.T=!0:(this.T=!1,this.C.apply(null,this.j))};Zv.prototype.stringify=function(a){return g.u7.JSON.stringify(a,void 0)}; Zv.prototype.parse=function(a){return g.u7.JSON.parse(a,void 0)};g.iV(DyI,g.ak);g.iV(uLB,g.ak);var X$B=null;g.iV(Uyd,g.ak);g.iV(rRI,g.ak);g.iV(aXs,g.ak);N9.prototype.debug=function(){}; N9.prototype.info=function(){}; N9.prototype.warning=function(){};var bZX={},qCg={};g.Z=Q_.prototype;g.Z.setTimeout=function(a){this.rb=a}; g.Z.mX=function(a){a=a.target;var l=this.tM;l&&g.UB(a)==3?l.QV():this.Xo(a)}; g.Z.Xo=function(a){try{if(a==this.T)a:{var l=g.UB(this.T),m=this.T.L,T=this.T.getStatus();if(!(l<3)&&(l!=3||this.T&&(this.L.L||g.aI(this.T)||g.ln(this.T)))){this.Kx||l!=4||m==7||(m==8||T<=0?WD(3):WD(2));iZV(this);var y=this.T.getStatus();this.lZ=y;var R=HZ_(this);if(this.C=y==200){if(this.ZR&&!this.St){b:{if(this.T){var H=g.mX(this.T,"X-HTTP-Initial-Response");if(H&&!g.Vk(H)){var b=H;break b}}b=null}if(a=b)this.St=!0,W7c(this,a);else{this.C=!1;this.K=3;cD(12);eA(this);F4(this);break a}}if(this.hM){a= !0;for(var M;!this.Kx&&this.B0&&!this.uZ&&(this.uZ=!0,this.Z.A4(this)):(eA(this),F4(this))}else W7c(this,R);l==4&&eA(this);this.C&&!this.Kx&&(l==4?dp5(this.Z,this):(this.C=!1,tf(this)))}else g.NZz(this.T),y==400&&R.indexOf("Unknown SID")> 0?(this.K=3,cD(12)):(this.K=0,cD(13)),eA(this),F4(this)}}}catch(d){}finally{}}; g.Z.cancel=function(){this.Kx=!0;eA(this)}; g.Z.eR=function(){this.Ij=null;var a=Date.now();a-this.yg>=0?(this.AM!=2&&(WD(3),cD(17)),eA(this),this.K=2,F4(this)):Mbc(this,this.yg-a)}; g.Z.getLastError=function(){return this.K}; g.Z.wh=function(){return this.T};L7I.prototype.cancel=function(){this.Z=QiB(this);if(this.L)this.L.cancel(),this.L=null;else if(this.T&&this.T.size!==0){for(var a=g.c(this.T.values()),l=a.next();!l.done;l=a.next())l.value.cancel();this.T.clear()}};g.Z=OZ5.prototype;g.Z.MZ=8;g.Z.gR=1;g.Z.connect=function(a,l,m,T){cD(0);this.SW=a;this.Kx=l||{};m&&T!==void 0&&(this.Kx.OSID=m,this.Kx.OAID=T);this.St=this.wW;this.Cx=Vb_(this,null,this.SW);zg(this)}; g.Z.disconnect=function(){zPc(this);if(this.gR==3){var a=this.Mj++,l=this.Cx.clone();g.GJ(l,"SID",this.j);g.GJ(l,"RID",a);g.GJ(l,"TYPE","terminate");SA(this,l);a=new Q_(this,this.j,a);a.AM=2;a.J=rc(l.clone());l=!1;if(g.u7.navigator&&g.u7.navigator.sendBeacon)try{l=g.u7.navigator.sendBeacon(a.J.toString(),"")}catch(m){}!l&&g.u7.Image&&((new Image).src=a.J,l=!0);l||(a.T=yNc(a.Z,null),a.T.send(a.J));a.jt=Date.now();tf(a)}JNV(this)}; g.Z.gL=function(){return this.gR==0}; g.Z.getState=function(){return this.gR}; g.Z.gy=function(a){if(this.C)if(this.C=null,this.gR==1){if(!a){this.Mj=Math.floor(Math.random()*1E5);a=this.Mj++;var l=new Q_(this,"",a),m=this.N;this.lZ&&(m?(m=g.mn(m),g.yk(m,this.lZ)):m=this.lZ);this.B!==null||this.yg||(l.Cx=m,m=null);var T;if(this.vF)a:{for(var y=T=0;y4096){T=y;break a}if(T===4096||y===this.Z.length-1){T=y+1;break a}}T= 1E3}else T=1E3;T=sig(this,l,T);y=this.Cx.clone();g.GJ(y,"RID",a);g.GJ(y,"CVER",22);this.hM&&g.GJ(y,"X-HTTP-Session-Id",this.hM);SA(this,y);m&&(this.yg?T="headers="+g.Gy(g.nxd(m))+"&"+T:this.B&&g.Wf(y,this.B,m));GOd(this.L,l);this.kN&&g.GJ(y,"TYPE","init");this.vF?(g.GJ(y,"$req",T),g.GJ(y,"SID","null"),l.ZR=!0,TQr(l,y,null)):TQr(l,y,T);this.gR=2}}else this.gR==3&&(a?SCc(this,a):this.Z.length==0||NQI(this.L)||SCc(this))}; g.Z.PH=function(){this.J=null;fXB(this);if(this.tN&&!(this.rb||this.T==null||this.Eg<=0)){var a=2*this.Eg;this.qj=LB((0,g.Rs)(this.djb,this),a)}}; g.Z.djb=function(){this.qj&&(this.qj=null,this.St=!1,this.rb=!0,cD(10),O4(this),fXB(this))}; g.Z.A4=function(a){this.T==a&&this.tN&&!this.rb&&(K7F(this),this.rb=!0,cD(11))}; g.Z.K0=function(){this.Ij!=null&&(this.Ij=null,O4(this),ANs(this),cD(19))}; g.Z.Vqj=function(a){a?cD(2):cD(1)}; g.Z.isActive=function(){return!!this.K&&this.K.isActive(this)}; g.Z=kOF.prototype;g.Z.y$=function(){}; g.Z.cH=function(){}; g.Z.GQ=function(){}; g.Z.zQ=function(){}; g.Z.isActive=function(){return!0}; g.Z.F3=function(){};g.iV(Jf,g.Vz);Jf.prototype.open=function(){this.T.K=this.Z;this.C&&(this.T.AM=!0);this.T.connect(this.K,this.L||void 0)}; Jf.prototype.close=function(){this.T.disconnect()}; Jf.prototype.send=function(a){var l=this.T;if(typeof a==="string"){var m={};m.__data__=a;a=m}else this.j&&(m={},m.__data__=g.ok(a),a=m);l.Z.push(new cNd(l.Be++,a));l.gR==3&&zg(l)}; Jf.prototype.sL=function(){this.T.K=null;delete this.Z;this.T.disconnect();delete this.T;Jf.l4.sL.call(this)}; g.iV(wW5,DyI);g.iV(IX9,uLB);g.iV(fB,kOF);fB.prototype.y$=function(){this.T.dispatchEvent("m")}; fB.prototype.cH=function(a){this.T.dispatchEvent(new wW5(a))}; fB.prototype.GQ=function(a){this.T.dispatchEvent(new IX9(a))}; fB.prototype.zQ=function(){this.T.dispatchEvent("n")};var kj=new g.Vz;g.W(oHn,g.ak);g.Z=wJ.prototype;g.Z.Na=null;g.Z.T7=!1;g.Z.lI=null;g.Z.RZ=null;g.Z.OY=null;g.Z.Bm=null;g.Z.ZY=null;g.Z.VV=null;g.Z.IW=null;g.Z.U9=null;g.Z.kL=0;g.Z.k6=null;g.Z.SK=null;g.Z.aW=null;g.Z.UY=-1;g.Z.SJ=!0;g.Z.j0=!1;g.Z.pW=0;g.Z.Am=null;var Upn={},YCX={};g.Z=wJ.prototype;g.Z.setTimeout=function(a){this.L=a}; g.Z.Aj=function(a){a=a.target;var l=this.Am;l&&g.UB(a)==3?l.QV():this.NZ(a)}; g.Z.NZ=function(a){try{if(a==this.U9)a:{var l=g.UB(this.U9),m=this.U9.L,T=this.U9.getStatus();if(g.Y5&&!g.OJ("420+")){if(l<4)break a}else if(l<3||l==3&&!g.aI(this.U9))break a;this.j0||l!=4||m==7||(m==8||T<=0?this.T.hX(3):this.T.hX(2));lZI(this);var y=this.U9.getStatus();this.UY=y;var R=g.aI(this.U9);if(this.T7=y==200){l==4&&I6(this);if(this.hM){for(a=!0;!this.j0&&this.kL0?(this.aW=3,nB(13)):(this.aW=0,nB(14)),I6(this),mr5(this)}}catch(b){}finally{}}; g.Z.cancel=function(){this.j0=!0;I6(this)}; g.Z.xK=function(){this.lI=null;var a=Date.now();a-this.RZ>=0?(this.Bm!=2&&this.T.hX(3),I6(this),this.aW=2,nB(18),mr5(this)):aZV(this,this.RZ-a)}; g.Z.getLastError=function(){return this.aW};g.Z=H2g.prototype;g.Z.QI=null;g.Z.I8=null;g.Z.LO=!1;g.Z.Hf=null;g.Z.g6=null;g.Z.Fs=-1;g.Z.Wm=null;g.Z.IT=null;g.Z.connect=function(a){this.Hf=a;a=E4(this.T,null,this.Hf);nB(3);Date.now();var l=this.T.N;l!=null?(this.Wm=l[0],(this.IT=l[1])?(this.g6=1,q99(this)):(this.g6=2,b2I(this))):(a6(a,"MODE","init"),this.I8=new wJ(this),this.I8.Na=this.QI,uYV(this.I8,a,!1,null,!0),this.g6=0)}; g.Z.v2=function(a){if(a)this.g6=2,b2I(this);else{nB(4);var l=this.T;l.kV=l.Fh.Fs;ut(l,9)}a&&this.hX(2)}; g.Z.Y_=function(a){return this.T.Y_(a)}; g.Z.abort=function(){this.I8&&(this.I8.cancel(),this.I8=null);this.Fs=-1}; g.Z.gL=function(){return!1}; g.Z.nX=function(a,l){this.Fs=a.UY;if(this.g6==0)if(l){try{var m=this.L.parse(l)}catch(T){a=this.T;a.kV=this.Fs;ut(a,2);return}this.Wm=m[0];this.IT=m[1]}else a=this.T,a.kV=this.Fs,ut(a,2);else this.g6==2&&(this.LO?(nB(7),Date.now()):l=="11111"?(nB(6),this.LO=!0,Date.now(),this.Fs=200,this.I8.cancel(),nB(12),o6(this.T,this,!0)):(nB(8),Date.now(),this.LO=!1))}; g.Z.t0=function(){this.Fs=this.I8.UY;if(this.I8.T7)this.g6==0?this.IT?(this.g6=1,q99(this)):(this.g6=2,b2I(this)):this.g6==2&&(this.LO?(nB(12),o6(this.T,this,!0)):(nB(11),o6(this.T,this,!1)));else{this.g6==0?nB(9):this.g6==2&&nB(10);var a=this.T;this.I8.getLastError();a.kV=this.Fs;ut(a,2)}}; g.Z.i7=function(){return this.T.i7()}; g.Z.isActive=function(){return this.T.isActive()}; g.Z.hX=function(a){this.T.hX(a)};g.Z=gTs.prototype;g.Z.zb=null;g.Z.q7=null;g.Z.Zi=null;g.Z.Ig=null;g.Z.Mn=null;g.Z.Jm=null;g.Z.vO=null;g.Z.Xd=null;g.Z.DY=0;g.Z.Bn=0;g.Z.zW=null;g.Z.Ld=null;g.Z.xu=null;g.Z.T4=null;g.Z.Fh=null;g.Z.DO=null;g.Z.sA=-1;g.Z.I3=-1;g.Z.kV=-1;g.Z.LU=0;g.Z.Ta=0;g.Z.lD=8;var mx5={OK:0,EFu:2,l$t:4,WMz:5,BUb:6,STOP:7,IK:8,Dwt:9,iuu:10,hhu:11,oAx:12};g.iV(i2_,g.ak);g.iV(drr,g.ak);g.Z=gTs.prototype; g.Z.connect=function(a,l,m,T,y){nB(0);this.Mn=l;this.q7=m||{};T&&y!==void 0&&(this.q7.OSID=T,this.q7.OAID=y);this.J?(BD((0,g.Rs)(this.FC,this,a),100),A7V(this)):this.FC(a)}; g.Z.disconnect=function(){P4r(this);if(this.T==3){var a=this.DY++,l=this.Jm.clone();g.GJ(l,"SID",this.j);g.GJ(l,"RID",a);g.GJ(l,"TYPE","terminate");Dv(this,l);a=new wJ(this,this.j,a);a.Bm=2;a.ZY=rc(l.clone());(new Image).src=a.ZY.toString();a.OY=Date.now();XW5(a)}tsr(this)}; g.Z.FC=function(a){this.Fh=new H2g(this);this.Fh.QI=this.zb;this.Fh.L=this.K;this.Fh.connect(a)}; g.Z.gL=function(){return this.T==0}; g.Z.getState=function(){return this.T}; g.Z.Lr=function(a){this.Ld=null;W$5(this,a)}; g.Z.Tg=function(){this.xu=null;this.Ig=new wJ(this,this.j,"rpc",this.B);this.Ig.Na=this.zb;this.Ig.pW=0;var a=this.vO.clone();g.GJ(a,"RID","rpc");g.GJ(a,"SID",this.j);g.GJ(a,"CI",this.DO?"0":"1");g.GJ(a,"AID",this.sA);Dv(this,a);g.GJ(a,"TYPE","xmlhttp");uYV(this.Ig,a,!0,this.Xd,!1)}; g.Z.nX=function(a,l){if(this.T!=0&&(this.Ig==a||this.Zi==a))if(this.kV=a.UY,this.Zi==a&&this.T==3)if(this.lD>7){try{var m=this.K.parse(l)}catch(T){m=null}if(Array.isArray(m)&&m.length==3)if(a=m,a[0]==0)a:{if(!this.xu){if(this.Ig)if(this.Ig.OY+3E30)){if(T=l==1)this.Zi||this.Ld||this.T==1||this.LU>=2?T=!1:(this.Ld=BD((0,g.Rs)(this.Lr,this,a),L$B(this,this.LU)),this.LU++, T=!0);T=!(T||l==2&&NCD(this))}if(T)switch(m){case 1:ut(this,5);break;case 4:ut(this,10);break;case 3:ut(this,6);break;case 7:ut(this,12);break;default:ut(this,2)}}}; g.Z.Vb=function(a){if(!g.pD(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.Z.Atj=function(a){a?nB(2):(nB(1),Q$B(this,8))}; g.Z.Y_=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.uB;a.B=!1;return a}; g.Z.isActive=function(){return!!this.zW&&this.zW.isActive(this)}; g.Z.hX=function(a){var l=kj;l.dispatchEvent(new drr(l,a))}; g.Z.i7=function(){return!1}; g.Z=ebg.prototype;g.Z.jy=function(){}; g.Z.ZQ=function(){}; g.Z.U2=function(){}; g.Z.s2=function(){}; g.Z.Pf=function(){}; g.Z.O2=function(){return{}}; g.Z.isActive=function(){return!0};g.Z=F$V.prototype;g.Z.enqueue=function(a){this.L.push(a)}; g.Z.isEmpty=function(){return this.T.length===0&&this.L.length===0}; g.Z.clear=function(){this.T=[];this.L=[]}; g.Z.contains=function(a){return g.pD(this.T,a)||g.pD(this.L,a)}; g.Z.remove=function(a){var l=this.T;var m=(0,g.GHD)(l,a);m>=0?(g.Z9(l,m),l=!0):l=!1;return l||g.Wn(this.L,a)}; g.Z.hs=function(){for(var a=[],l=this.T.length-1;l>=0;--l)a.push(this.T[l]);l=this.L.length;for(var m=0;m=TEB.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=TEB[this.L],this.pR=g.ZC((0,g.Rs)(this.zI,this),a),this.L++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.Z.f0=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var TEB=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.iV(bU,HG);g.Z=bU.prototype;g.Z.start=function(){qs(this)&&this.publish("screenChange");!g.BW("yt-remote-lounge-token-expiration")&&bIc(this);g.c$(this.T);this.T=g.ZC((0,g.Rs)(this.start,this),1E4)}; g.Z.add=function(a,l){qs(this);yJs(this,a);gl(this,!1);this.publish("screenChange");l(a);a.token||bIc(this)}; g.Z.remove=function(a,l){var m=qs(this);HIs(this,a)&&(gl(this,!1),m=!0);l(a);m&&this.publish("screenChange")}; g.Z.qn=function(a,l,m,T){var y=qs(this),R=this.get(a.id);R?(R.name!=l&&(R.name=l,gl(this,!1),y=!0),m(a)):T(Error("no such local screen."));y&&this.publish("screenChange")}; g.Z.sL=function(){g.c$(this.T);bU.l4.sL.call(this)}; g.Z.Ws=function(a){qs(this);var l=this.screens.length;a=a&&a.screens||[];for(var m=a.length,T=0;T20)break a;b=l(R,H)}R=b}y.name=R}m(dl(this,y))},this), onError:(0,g.Rs)(function(y){T(Error("pairing request failed: "+y.status))},this), onTimeout:(0,g.Rs)(function(){T(Error("pairing request timed out."))},this)})}; g.Z.sL=function(){g.Go(this.L);g.Go(this.T);iU.l4.sL.call(this)}; g.Z.MK=function(){W8g(this);this.publish("screenChange");this.T.update()}; iU.prototype.dispose=iU.prototype.dispose;g.iV(jH,g.Aj);g.Z=jH.prototype;g.Z.bS=function(a){this.FO()||(a&&(PG(this,""+a),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.Z.info=function(a){lU(this.hM,a)}; g.Z.DQ=function(){return null}; g.Z.Zw=function(a){var l=this.L;a?(l.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),l.displayStatus.showStop=!0):l.displayStatus=null;chrome.cast.setReceiverDisplayStatus(l,(0,g.Rs)(function(){this.info("Updated receiver status for "+l.friendlyName+": "+a)},this),(0,g.Rs)(function(){PG(this,"Failed to update receiver status for: "+l.friendlyName)},this))}; g.Z.sL=function(){this.Zw("");jH.l4.sL.call(this)};g.W(GF,jH);g.Z=GF.prototype;g.Z.Lo=function(a){if(this.Z){if(this.Z==a)return;PG(this,"Overriding cast session with new session object");vqD(this);this.jt=!1;this.N="unknown";this.Z.removeUpdateListener(this.lT);this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qj)}this.Z=a;this.Z.addUpdateListener(this.lT);this.Z.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.qj);F8c(this,"getMdxSessionStatus")}; g.Z.yE=function(a){this.info("launchWithParams no-op for Cast: "+g.ok(a))}; g.Z.stop=function(){this.Z?this.Z.stop((0,g.Rs)(function(){this.bS()},this),(0,g.Rs)(function(){this.bS(Error("Failed to stop receiver app."))},this)):this.bS(Error("Stopping cast device without session."))}; g.Z.Zw=function(){}; g.Z.sL=function(){this.info("disposeInternal");vqD(this);this.Z&&(this.Z.removeUpdateListener(this.lT),this.Z.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.qj));this.Z=null;jH.prototype.sL.call(this)}; g.Z.AbN=function(a,l){if(!this.FO())if(l)if(l=lt(l),g.ms(l))switch(a=""+l.type,l=l.data||{},this.info("onYoutubeMessage_: "+a+" "+g.ok(l)),a){case "mdxSessionStatus":QWr(this,l);break;case "loungeToken":hTs(this,l);break;default:PG(this,"Unknown youtube message: "+a)}else PG(this,"Unable to parse message.");else PG(this,"No data in message.")}; g.Z.pm=function(a,l,m,T){g.c$(this.J);this.J=0;Vxd(this.j,this.L.label,a,this.L.friendlyName,(0,g.Rs)(function(y){y?l(y):T>=0?(PG(this,"Screen "+a+" appears to be offline. "+T+" retries left."),this.J=g.ZC((0,g.Rs)(this.pm,this,a,l,m,T-1),300)):m(Error("Unable to fetch screen."))},this),m)}; g.Z.DQ=function(){return this.Z}; g.Z.YK=function(a){this.FO()||a||(PG(this,"Cast session died."),this.bS())};g.W(VG,jH);g.Z=VG.prototype;g.Z.Lo=function(a){this.Z=a;this.Z.addUpdateListener(this.Kx)}; g.Z.yE=function(a){this.Cx=a;this.Ij()}; g.Z.stop=function(){nqr(this);this.Z?this.Z.stop((0,g.Rs)(this.bS,this,null),(0,g.Rs)(this.bS,this,"Failed to stop DIAL device.")):this.bS()}; g.Z.sL=function(){nqr(this);this.Z&&this.Z.removeUpdateListener(this.Kx);this.Z=null;jH.prototype.sL.call(this)}; g.Z.Qb=function(a){this.FO()||a||(PG(this,"DIAL session died."),this.K(),this.K=function(){},this.bS())};g.W(WG,jH);WG.prototype.stop=function(){this.bS()}; WG.prototype.Lo=function(){}; WG.prototype.yE=function(){g.c$(this.Z);this.Z=NaN;var a=M9(this.j.eC(),this.L.label);a?Ah(this,a):this.bS(Error("No such screen"))}; WG.prototype.sL=function(){g.c$(this.Z);this.Z=NaN;jH.prototype.sL.call(this)};g.W(cG,g.Aj);g.Z=cG.prototype; g.Z.init=function(a,l){chrome.cast.timeout.requestSession=3E4;var m=new chrome.cast.SessionRequest(this.J,[chrome.cast.Capability.AUDIO_OUT]);g.Q7("desktop_enable_cast_connect")&&(m.androidReceiverCompatible=!0);this.N||(m.dialRequest=new chrome.cast.DialRequest("YouTube"));var T=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.C?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var y=(0,g.Rs)(this.WLb,this);m=new chrome.cast.ApiConfig(m,(0,g.Rs)(this.Cq, this),y,T,a);m.customDialLaunchCallback=(0,g.Rs)(this.IRK,this);chrome.cast.initialize(m,(0,g.Rs)(function(){this.FO()||(chrome.cast.addReceiverActionListener(this.K),a1c(),this.L.subscribe("onlineScreenChange",(0,g.Rs)(this.E2,this)),this.Z=CQs(this),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Rs)(function(R){this.i4("Failed to set initial custom receivers: "+g.ok(R))},this)),this.publish("yt-remote-cast2-availability-change",Ns(this)),l(!0))},this),(0,g.Rs)(function(R){this.i4("Failed to initialize API: "+ g.ok(R)); l(!1)},this))}; g.Z.wet=function(a,l){L6("Setting connected screen ID: "+a+" -> "+l);if(this.T){var m=this.T.T;if(!a||m&&m.id!=a)L6("Unsetting old screen status: "+this.T.L.friendlyName),QG(this,null)}if(a&&l){if(!this.T){a=M9(this.L.eC(),a);if(!a){L6("setConnectedScreenStatus: Unknown screen.");return}if(a.idType=="shortLived"){L6("setConnectedScreenStatus: Screen with id type to be short lived.");return}m=wjr(this,a);m||(L6("setConnectedScreenStatus: Connected receiver not custom..."),m=new chrome.cast.Receiver(a.uuid? a.uuid:a.id,a.name),m.receiverType=chrome.cast.ReceiverType.CUSTOM,this.Z.push(m),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Rs)(function(T){this.i4("Failed to set initial custom receivers: "+g.ok(T))},this))); L6("setConnectedScreenStatus: new active receiver: "+m.friendlyName);QG(this,new WG(this.L,m),!0)}this.T.Zw(l)}else L6("setConnectedScreenStatus: no screen.")}; g.Z.Xeg=function(a){this.FO()?this.i4("Setting connection data on disposed cast v2"):this.T?this.T.yE(a):this.i4("Setting connection data without a session")}; g.Z.tj=function(){this.FO()?this.i4("Stopping session on disposed cast v2"):this.T?(this.T.stop(),QG(this,null)):L6("Stopping non-existing session")}; g.Z.requestSession=function(){chrome.cast.requestSession((0,g.Rs)(this.Cq,this),(0,g.Rs)(this.NO8,this))}; g.Z.sL=function(){this.L.unsubscribe("onlineScreenChange",(0,g.Rs)(this.E2,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.K);var a=Y9s,l=g.Yl("yt.mdx.remote.debug.handlers_");g.Wn(l||[],a);g.Go(this.T);g.Aj.prototype.sL.call(this)}; g.Z.i4=function(a){lU("Controller",a)}; g.Z.mZ=function(a,l){this.T==a&&(l||QG(this,null),this.publish("yt-remote-cast2-session-change",l))}; g.Z.bRL=function(a,l){if(!this.FO())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),L6("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+l),l){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.L.label!=a.label)L6("onReceiverAction_: Stopping active receiver: "+this.T.L.friendlyName),this.T.stop();else{L6("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:QG(this, new WG(this.L,a));break;case chrome.cast.ReceiverType.DIAL:QG(this,new VG(this.L,a,this.j,this.config_));break;case chrome.cast.ReceiverType.CAST:QG(this,new GF(this.L,a,this.config_));break;default:this.i4("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.L.label==a.label?this.T.stop():this.i4("Stopping receiver w/o session: "+a.friendlyName)}else this.i4("onReceiverAction_ called without receiver.")}; g.Z.IRK=function(a){if(this.FO())return Promise.reject(Error("disposed"));var l=a.receiver;l.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.i4("Not DIAL receiver: "+l.friendlyName),l.receiverType=chrome.cast.ReceiverType.DIAL);var m=this.T?this.T.L:null;if(!m||m.label!=l.label)return this.i4("Receiving DIAL launch request for non-clicked DIAL receiver: "+l.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(m&&m.label==l.label&&m.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return L6("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.i4('Changing CAST intent from "'+m.receiverType+'" to "dial" for '+l.friendlyName);QG(this,new VG(this.L,l,this.j,this.config_))}l=this.T;l.J=a;l.J.appState==chrome.cast.DialAppState.RUNNING?(a=l.J.extraData||{},m=a.screenId||null,p6(l)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=JJ9(l,{name:l.L.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:l.J.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.lr(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=Bes(l,m)):a=Bes(l,m)):a=ScD(l);return a}; g.Z.Cq=function(a){var l=this;if(!this.FO()&&!this.C){L6("New cast session ID: "+a.sessionId);var m=a.receiver;if(m.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(m.receiverType==chrome.cast.ReceiverType.CAST)L6("Got resumed cast session before resumed mdx connection."),m.friendlyName=chrome.cast.unescape(m.friendlyName),QG(this,new GF(this.L,m,this.config_),!0);else{this.i4("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var T=this.T.L,y=M9(this.L.eC(), T.label);y&&bt(y,m.label)&&T.receiverType!=chrome.cast.ReceiverType.CAST&&m.receiverType==chrome.cast.ReceiverType.CAST&&(L6("onSessionEstablished_: manual to cast session change "+m.friendlyName),g.Go(this.T),this.T=new GF(this.L,m,this.config_),this.T.subscribe("sessionScreen",(0,g.Rs)(this.mZ,this,this.T)),this.T.subscribe("sessionFailed",function(){return I1I(l,l.T)}),this.T.yE(null)); this.T.Lo(a)}}}; g.Z.wE=function(){return this.T?this.T.DQ():null}; g.Z.NO8=function(a){this.FO()||(this.i4("Failed to estabilish a session: "+g.ok(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&QG(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.Z.WLb=function(a){L6("Receiver availability updated: "+a);if(!this.FO()){var l=Ns(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;Ns(this)!=l&&this.publish("yt-remote-cast2-availability-change",Ns(this))}}; g.Z.E2=function(){this.FO()||(this.Z=CQs(this),L6("Updating custom receivers: "+g.ok(this.Z)),chrome.cast.setCustomReceivers(this.Z,function(){},(0,g.Rs)(function(){this.i4("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Ns(this)))}; cG.prototype.setLaunchParams=cG.prototype.Xeg;cG.prototype.setConnectedScreenStatus=cG.prototype.wet;cG.prototype.stopSession=cG.prototype.tj;cG.prototype.getCastSession=cG.prototype.wE;cG.prototype.requestSession=cG.prototype.requestSession;cG.prototype.init=cG.prototype.init;cG.prototype.dispose=cG.prototype.dispose;var rJd=[];g.Z=zF.prototype; g.Z.reset=function(a){this.listId="";this.index=-1;this.videoId="";RD5(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.trackData=a.trackData,this.Dz=a.hasPrevious,this.AE=a.hasNext,this.B=a.playerTime,this.C=a.playerTimeAt,this.j=a.seekableStart,this.T=a.seekableEnd,this.K=a.duration,this.J=a.loadedTime,this.Z=a.liveIngestionTime,this.L= !isNaN(this.Z))}; g.Z.isPlaying=function(){return this.playerState==1}; g.Z.isBuffering=function(){return this.playerState==3}; g.Z.Yp=function(){return this.playerState==1081}; g.Z.yf=function(a){this.K=isNaN(a)?0:a}; g.Z.getDuration=function(){return this.L?this.K+vG(this):this.K}; g.Z.clone=function(){return new zF(HpI(this))};g.W(Jh,g.Aj);g.Z=Jh.prototype;g.Z.getState=function(){return this.Z}; g.Z.PS=function(){return this.j.getReconnectTimeout()}; g.Z.xY=function(){this.j.reconnect()}; g.Z.play=function(){kJ(this)?(this.T?this.T.play(null,g.Gb,C6(this,"play")):ID(this,"play"),gOs(this,1,sk(BG(this))),this.publish("remotePlayerChange")):n6(this,this.play)}; g.Z.pause=function(){kJ(this)?(this.T?this.T.pause(null,g.Gb,C6(this,"pause")):ID(this,"pause"),gOs(this,2,sk(BG(this))),this.publish("remotePlayerChange")):n6(this,this.pause)}; g.Z.seekTo=function(a){if(kJ(this)){if(this.T){var l=BG(this),m=new chrome.cast.media.SeekRequest;m.currentTime=a;l.isPlaying()||l.isBuffering()?m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:m.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(m,g.Gb,C6(this,"seekTo",{newTime:a}))}else ID(this,"seekTo",{newTime:a});gOs(this,3,a);this.publish("remotePlayerChange")}else n6(this,g.qF(this.seekTo,a))}; g.Z.stop=function(){if(kJ(this)){this.T?this.T.stop(null,g.Gb,C6(this,"stopVideo")):ID(this,"stopVideo");var a=BG(this);a.index=-1;a.videoId="";RD5(a);wl(this,a);this.publish("remotePlayerChange")}else n6(this,this.stop)}; g.Z.setVolume=function(a,l){if(kJ(this)){var m=BG(this);if(this.L){if(m.volume!=a){var T=Math.round(a)/100;this.L.setReceiverVolumeLevel(T,(0,g.Rs)(function(){mM("set receiver volume: "+T)},this),(0,g.Rs)(function(){this.i4("failed to set receiver volume.")},this))}m.muted!=l&&this.L.setReceiverMuted(l,(0,g.Rs)(function(){mM("set receiver muted: "+l)},this),(0,g.Rs)(function(){this.i4("failed to set receiver muted.")},this))}else{var y={volume:a, muted:l};m.volume!=-1&&(y.delta=a-m.volume);ID(this,"setVolume",y)}m.muted=l;m.volume=a;wl(this,m)}else n6(this,g.qF(this.setVolume,a,l))}; g.Z.ut=function(a,l){if(kJ(this)){var m=BG(this);a={videoId:a};l&&(m.trackData={trackName:l.name,languageCode:l.languageCode,sourceLanguageCode:l.translationLanguage?l.translationLanguage.languageCode:"",languageName:l.languageName,kind:l.kind},a.style=g.ok(l.style),g.yk(a,m.trackData));ID(this,"setSubtitlesTrack",a);wl(this,m)}else n6(this,g.qF(this.ut,a,l))}; g.Z.setAudioTrack=function(a,l){kJ(this)?(l=l.getLanguageInfo().getId(),ID(this,"setAudioTrack",{videoId:a,audioTrackId:l}),a=BG(this),a.audioTrackId=l,wl(this,a)):n6(this,g.qF(this.setAudioTrack,a,l))}; g.Z.playVideo=function(a,l,m,T,y,R,H){T=T===void 0?null:T;y=y===void 0?null:y;R=R===void 0?null:R;H=H===void 0?null:H;var b=BG(this),M={videoId:a};m!==void 0&&(M.currentIndex=m);SH(b,a,m||0);l!==void 0&&($J(b,l),M.currentTime=l);T&&(M.listId=T);y&&(M.playerParams=y);R&&(M.clickTrackingParams=R);H&&(M.locationInfo=g.ok(H));ID(this,"setPlaylist",M);T||wl(this,b)}; g.Z.yZ=function(a,l){if(kJ(this)){if(a&&l){var m=BG(this);SH(m,a,l);wl(this,m)}ID(this,"previous")}else n6(this,g.qF(this.yZ,a,l))}; g.Z.nextVideo=function(a,l){if(kJ(this)){if(a&&l){var m=BG(this);SH(m,a,l);wl(this,m)}ID(this,"next")}else n6(this,g.qF(this.nextVideo,a,l))}; g.Z.vP=function(){if(kJ(this)){ID(this,"clearPlaylist");var a=BG(this);a.reset();wl(this,a);this.publish("remotePlayerChange")}else n6(this,this.vP)}; g.Z.Qn=function(){kJ(this)?ID(this,"dismissAutoplay"):n6(this,this.Qn)}; g.Z.dispose=function(){if(this.Z!=3){var a=this.Z;this.Z=3;this.publish("proxyStateChange",a,this.Z)}g.Aj.prototype.dispose.call(this)}; g.Z.sL=function(){bpr(this);this.j=null;this.K.clear();f6(this,null);g.Aj.prototype.sL.call(this)}; g.Z.iR=function(a){if((a!=this.Z||a==2)&&this.Z!=3&&a!=0){var l=this.Z;this.Z=a;this.publish("proxyStateChange",l,a);if(a==1)for(;!this.K.isEmpty();)l=a=this.K,l.T.length===0&&(l.T=l.L,l.T.reverse(),l.L=[]),a.T.pop().apply(this);else a==3&&this.dispose()}}; g.Z.AWO=function(a,l){this.publish(a,l)}; g.Z.rMK=function(a){if(!a)this.FB(null),f6(this,null);else if(this.L.receiver.volume){a=this.L.receiver.volume;var l=BG(this),m=Math.round(100*a.level||0);if(l.volume!=m||l.muted!=a.muted)mM("Cast volume update: "+a.level+(a.muted?" muted":"")),l.volume=m,l.muted=!!a.muted,wl(this,l)}}; g.Z.FB=function(a){mM("Cast media: "+!!a);this.T&&this.T.removeUpdateListener(this.J);if(this.T=a)this.T.addUpdateListener(this.J),MLd(this),this.publish("remotePlayerChange")}; g.Z.PTT=function(a){a?(MLd(this),this.publish("remotePlayerChange")):this.FB(null)}; g.Z.d_=function(){ID(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.Z.zjK=function(){var a=mQs();a&&f6(this,a)}; g.Z.i4=function(a){lU("CP",a)};g.W(xJ,g.Aj);g.Z=xJ.prototype; g.Z.connect=function(a,l){if(l){var m=l.listId,T=l.videoId,y=l.videoIds,R=l.playerParams,H=l.clickTrackingParams,b=l.index,M={videoId:T},d=l.currentTime,A=l.locationInfo;l=l.loopMode;d!==void 0&&(M.currentTime=d<=5?0:d);R&&(M.playerParams=R);A&&(M.locationInfo=A);H&&(M.clickTrackingParams=H);m&&(M.listId=m);y&&y.length>0&&(M.videoIds=y.join(","));b!==void 0&&(M.currentIndex=b);this.Kx&&(M.loopMode=l||"LOOP_MODE_OFF");m&&(this.T.listId=m);this.T.videoId=T;this.T.index=b||0;this.T.state=3;$J(this.T, d);this.K="UNSUPPORTED";m=this.Kx?"setInitialState":"setPlaylist";Ek("Connecting with "+m+" and params: "+g.ok(M));this.L.connect({method:m,params:g.ok(M)},a,h0n())}else Ek("Connecting without params"),this.L.connect({},a,h0n());AmD(this)}; g.Z.wp=function(a){this.L.wp(a)}; g.Z.dispose=function(){this.FO()||(g.Xt("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),oD(this,3));g.Aj.prototype.dispose.call(this)}; g.Z.sL=function(){P$s(this);VLr(this);GGV(this);g.c$(this.J);this.J=NaN;g.c$(this.N);this.N=NaN;this.j=null;g.FY(this.Ij);this.Ij.length=0;this.L.dispose();g.Aj.prototype.sL.call(this);this.K=this.B=this.Z=this.T=this.L=null}; g.Z.Ve=function(a){if(!this.Z||this.Z.length===0)return!1;for(var l=g.c(this.Z),m=l.next();!m.done;m=l.next())if(!m.value.capabilities.has(a))return!1;return!0}; g.Z.Zf=function(){var a=3;this.FO()||(a=0,isNaN(this.Oo())?this.L.eV()&&isNaN(this.C)&&(a=1):a=2);return a}; g.Z.Hb=function(a){Ek("Disconnecting with "+a);g.Xt("yt.mdx.remote.remoteClient_",null);P$s(this);this.publish("beforeDisconnect",a);a==1&&jA();this.L.disconnect(a);this.dispose()}; g.Z.a_=function(){var a=this.T;this.j&&(a=this.T.clone(),SH(a,this.j,a.index));return HpI(a)}; g.Z.rat=function(a){var l=this,m=new zF(a);m.videoId&&m.videoId!=this.T.videoId&&(this.j=m.videoId,g.c$(this.J),this.J=g.ZC(function(){if(l.j){var y=l.j;l.j=null;l.T.videoId!=y&&DG(l,"getNowPlaying")}},5E3)); var T=[];this.T.listId==m.listId&&this.T.videoId==m.videoId&&this.T.index==m.index||T.push("remoteQueueChange");this.T.playerState==m.playerState&&this.T.volume==m.volume&&this.T.muted==m.muted&&sk(this.T)==sk(m)&&g.ok(this.T.trackData)==g.ok(m.trackData)||T.push("remotePlayerChange");this.T.reset(a);g.Bn(T,function(y){this.publish(y)},this)}; g.Z.VT=function(){var a=this.L.getDeviceId(),l=g.Pn(this.Z,function(m){return m.type=="REMOTE_CONTROL"&&m.id!=a}); return l?l.id:""}; g.Z.Oo=function(){return this.L.PS()}; g.Z.fF=function(){return this.K||"UNSUPPORTED"}; g.Z.pF=function(){return this.B||""}; g.Z.Hn=function(){!isNaN(this.Oo())&&this.L.xY()}; g.Z.R6T=function(a,l){DG(this,a,l);ZpD(this)}; g.Z.o3=function(){var a=g.ny("SAPISID","")||g.ny("__Secure-1PAPISID")||"",l=g.ny("__Secure-3PAPISID","")||"";if(!a&&!l)return"";a=g.Tf(g.mL(a),2);l=g.Tf(g.mL(l),2);return g.Tf(g.mL(","+a+","+l),2)}; xJ.prototype.subscribe=xJ.prototype.subscribe;xJ.prototype.unsubscribeByKey=xJ.prototype.rR;xJ.prototype.getProxyState=xJ.prototype.Zf;xJ.prototype.disconnect=xJ.prototype.Hb;xJ.prototype.getPlayerContextData=xJ.prototype.a_;xJ.prototype.setPlayerContextData=xJ.prototype.rat;xJ.prototype.getOtherConnectedRemoteId=xJ.prototype.VT;xJ.prototype.getReconnectTimeout=xJ.prototype.Oo;xJ.prototype.getAutoplayMode=xJ.prototype.fF;xJ.prototype.getAutoplayVideoId=xJ.prototype.pF;xJ.prototype.reconnect=xJ.prototype.Hn; xJ.prototype.sendMessage=xJ.prototype.R6T;xJ.prototype.getXsrfToken=xJ.prototype.o3;xJ.prototype.isCapabilitySupportedOnConnectedDevices=xJ.prototype.Ve;g.W(zDn,HG);g.Z=zDn.prototype;g.Z.eC=function(a){return this.q6.$_gs(a)}; g.Z.contains=function(a){return!!this.q6.$_c(a)}; g.Z.get=function(a){return this.q6.$_g(a)}; g.Z.start=function(){this.q6.$_st()}; g.Z.add=function(a,l,m){this.q6.$_a(a,l,m)}; g.Z.remove=function(a,l,m){this.q6.$_r(a,l,m)}; g.Z.qn=function(a,l,m,T){this.q6.$_un(a,l,m,T)}; g.Z.sL=function(){for(var a=this.T.length,l=0;l1&&!this.D.getOption("remote","quickCast")?(this.TL=g.kB(a,this.T,this),this.sP(g.xX(a,this.T)),a=g.B(this.D.getOption("remote","currentReceiver")),a=this.T(a),this.options[a]&&this.cE(a),this.enable(!0)):this.enable(!1)}; AY.prototype.T=function(a){return a.key}; AY.prototype.LH=function(a){return a==="cast-selector-receiver"?"Enviar...":this.TL[a].name}; AY.prototype.lk=function(a){g.sR.prototype.lk.call(this,a);this.D.setOption("remote","currentReceiver",this.TL[a]);this.Ob.KE()};g.W(rmr,g.P3);g.Z=rmr.prototype; g.Z.create=function(){var a=this.player.Y(),l=g.BS(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.V("enable_cast_short_lived_lounge_token")};fEs(l,a);this.subscriptions.push(g.g6("yt-remote-before-disconnect",this.Hxb,this));this.subscriptions.push(g.g6("yt-remote-connection-change",this.JWj,this));this.subscriptions.push(g.g6("yt-remote-receiver-availability-change",this.DZ, this));this.subscriptions.push(g.g6("yt-remote-auto-connect",this.kqj,this));this.subscriptions.push(g.g6("yt-remote-receiver-resumed",this.Sg8,this));this.subscriptions.push(g.g6("mdx-privacy-popup-confirm",this.N7N,this));this.subscriptions.push(g.g6("mdx-privacy-popup-cancel",this.ybL,this));this.DZ()}; g.Z.load=function(){this.player.cancelPlayback();g.P3.prototype.load.call(this);this.W1=new UQF(this.player.Y(),this);this.player.b8(this.W1);this.aV=new DQr(this,this.player,this.jx);var a=(a=EO_())?a.currentTime:0;var l=wgr()?new Jh(g.B(RK()),void 0):null;a==0&&l&&(a=sk(BG(l)));a!==0&&this.ex(a);a_5(this,this.K5,this.K5);this.player.cZ(6)}; g.Z.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.ZG();this.Ay=this.S7;g.VL(this.aV,this.jx);this.jx=this.W1=this.aV=null;g.P3.prototype.unload.call(this);this.player.cZ(5);Ph(this)}; g.Z.sL=function(){g.MQ(this.subscriptions);g.P3.prototype.sL.call(this)}; g.Z.j_=function(a){var l=g.Jz.apply(1,arguments);this.loaded&&this.aV.UH.apply(this.aV,[a].concat(g.F(l)))}; g.Z.getAdState=function(){return this.qw}; g.Z.Dz=function(){return this.jx?BG(this.jx).Dz:!1}; g.Z.AE=function(){return this.jx?BG(this.jx).AE:!1}; g.Z.ex=function(a,l){this.Yj=a||0;this.player.publish("progresssync",a,l);this.player.PN("onVideoProgress",a||0)}; g.Z.getCurrentTime=function(){return this.Yj}; g.Z.getProgressState=function(){var a=BG(this.jx),l=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!a.Yp()&&this.player.zA(),clipEnd:l.clipEnd,clipStart:l.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.L?a.Z+vG(a):a.Z,isAtLiveHead:(a.L?a.T+vG(a):a.T)-this.getCurrentTime()<=1,loaded:a.J,seekableEnd:a.L?a.T+vG(a):a.T,seekableStart:a.j>0?a.j+vG(a):a.j,offset:0,viewerLivestreamJoinMediaTime:0}}; g.Z.nextVideo=function(){this.jx&&this.jx.nextVideo()}; g.Z.yZ=function(){this.jx&&this.jx.yZ()}; g.Z.Hxb=function(a){a===1&&(this.oQ=this.jx?BG(this.jx):null)}; g.Z.JWj=function(){var a=wgr()?new Jh(g.B(RK()),void 0):null;if(a){var l=this.Ay;this.loaded&&this.unload();this.jx=a;this.oQ=null;l.key!==this.S7.key&&(this.Ay=l,this.load())}else g.Go(this.jx),this.jx=null,this.loaded&&(this.unload(),(a=this.oQ)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,sk(a)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.Z.DZ=function(){var a=[this.S7],l=a.concat,m=JmV();hh()&&g.BW("yt-remote-cast-available")&&m.push({key:"cast-selector-receiver",name:"Cast..."});this.TL=l.call(a,m);a=kG_()||this.S7;GT(this,a);this.player.PN("onMdxReceiversChange")}; g.Z.kqj=function(){var a=g.B(kG_());GT(this,a)}; g.Z.Sg8=function(){this.Ay=g.B(kG_())}; g.Z.N7N=function(){this.rH=!0;Ph(this);gI=!1;Hh&&bx(Hh,1);Hh=null}; g.Z.ybL=function(){this.rH=!1;Ph(this);GT(this,this.S7);this.Ay=this.S7;gI=!1;Hh=null;this.player.playVideo()}; g.Z.N6=function(a,l){switch(a){case "casting":return this.loaded;case "receivers":return this.TL;case "currentReceiver":return l&&(l.key==="cast-selector-receiver"?T69():GT(this,l)),this.loaded?this.Ay:this.S7;case "quickCast":return this.TL.length===2&&this.TL[1].key==="cast-selector-receiver"?(l&&T69(),!0):!1}}; g.Z.d_=function(){this.jx.d_()}; g.Z.fl=function(){return!1}; g.Z.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.Z.isLoggedIn=function(){var a,l;return((a=g.Uu("PLAYER_CONFIG"))==null?void 0:(l=a.args)==null?void 0:l.authuser)!==void 0?!0:!(!g.Uu("SESSION_INDEX")&&!g.Uu("LOGGED_IN"))};g.AO("remote",rmr);})(_yt_player);