(function(g){var window=this;'use strict';var Ytu=function(J){if(J instanceof g.mR)return J;if(typeof J.py=="function")return J.py(!1);if(g.Jj(J)){var K=0,n=new g.mR;n.next=function(){for(;;){if(K>=J.length)return g.xa;if(K in J)return g.ps(J[K++]);K++}}; return n}throw Error("Not implemented");},Gqm=function(J,K,n){if(g.Jj(J))g.Yr(J,K,n); else for(J=Ytu(J);;){var X=J.next();if(X.done)break;K.call(n,X.value,void 0,J)}},NZ=function(J){g.Q1(J,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.jV()).toString(36)); return J},JW=function(J,K,n){Array.isArray(n)||(n=[String(n)]); g.Frf(J.U,K,n)},UM0=function(J,K){var n=[]; Gqm(K,function(X){try{var l=g.Ta.prototype.Z.call(this,X,!0)}catch(x){if(x=="Storage: Invalid value was encountered")return;throw x;}l===void 0?n.push(X):g.K_H(l)&&n.push(X)},J); return n},tjV=function(J,K){UM0(J,K).forEach(function(n){g.Ta.prototype.remove.call(this,n)},J)},ycr=function(J){if(J.F2){if(J.F2.locationOverrideToken)return{locationOverrideToken:J.F2.locationOverrideToken}; if(J.F2.latitudeE7!=null&&J.F2.longitudeE7!=null)return{latitudeE7:J.F2.latitudeE7,longitudeE7:J.F2.longitudeE7}}return null},Z5H=function(J,K){g.O0(J,K)||J.push(K)},f1g=function(J){var K=0,n; for(n in J)K++;return K},WHg=function(J,K){return g.bG(J,K)},a1V=function(J){try{return g.qp.JSON.parse(J)}catch(K){}J=String(J); if(/^\s*$/.test(J)?0:/^[\],:{}\s\u2028\u2029]*$/.test(J.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("("+J+")")}catch(K){}throw Error("Invalid JSON string: "+J);},Kq=function(J){if(g.qp.JSON)try{return g.qp.JSON.parse(J)}catch(K){}return a1V(J)},FH0=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/channel/opened",g.QZ("channel_type"))},qtO=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/channel/closed",g.QZ("channel_type"))},Exj=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/channel/message_received",g.QZ("channel_type"))},b5n=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/channel/success")},Ac8=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/channel/error",g.QZ("channel_type"),g.QZ("error_type"))},Mj8=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},NWS=function(){var J=nq(); this.G=J;J.h0("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},J20=function(J){if(J.U6&&typeof J.U6=="function")return J.U6(); if(typeof Map!=="undefined"&&J instanceof Map||typeof Set!=="undefined"&&J instanceof Set)return Array.from(J.values());if(typeof J==="string")return J.split("");if(g.Jj(J)){for(var K=[],n=J.length,X=0;X1){if(n%2)throw Error("Uneven number of arguments");for(var X=0;X5&&(J=J.slice(J.length-5)); var K=g.ff(Zau(),function(X){return X.loungeToken}),n=g.ff(J,function(X){return X.loungeToken}); g.WH(n,function(X){return!g.O0(K,X)})&&fC0(); g.kF("yt-remote-local-screens",J,31536E3)},r8=function(J){J||(g.cB("yt-remote-session-screen-id"),g.cB("yt-remote-session-video-id")); tfz();J=$y();g.RH(J,SJ());Grz(J)},aCF=function(){if(!sJ){var J=g.Yt(); J&&(sJ=new g.mO(J))}},F10=function(){aCF(); return sJ?!!sJ.get("yt-remote-use-staging-server"):!1},Cq=function(J,K){g.on[J]=!0; var n=g.KE();n&&n.publish.apply(n,arguments);g.on[J]=!1},qjS=function(){},nq=function(){if(!OJ){OJ=new g.UG(new qjS); var J=g.zr("client_streamz_web_flush_count",-1);J!==-1&&(OJ.X=J)}return OJ},EAH=function(){var J=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return J?parseInt(J[1],10):0},bag=function(J){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+J)!=-1||document.currentScript.src.indexOf("&"+J)!=-1)},A2u=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},HT=function(J){J.length?Mfz(J.shift(),function(){HT(J)}):NN0()},J_r=function(J){return"chrome-extension://"+J+"/cast_sender.js"},Mfz=function(J,K,n){var X=document.createElement("script"); X.onerror=K;n&&(X.onload=n);g.Vh(X,g.ik(J));(document.head||document.documentElement).appendChild(X)},KGn=function(){var J=EAH(),K=[]; if(J>1){var n=J-1;K.push("//www.gstatic.com/eureka/clank/"+J+"/cast_sender.js");K.push("//www.gstatic.com/eureka/clank/"+n+"/cast_sender.js")}return K},NN0=function(){var J=A2u(); J&&J(!1,"No cast extension found")},oF8=function(){if(nFg){var J=2,K=A2u(),n=function(){J--; J==0&&K&&K(!0)}; window.__onGCastApiAvailable=n;Mfz("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",NN0,n)}},XB0=function(){oF8(); var J=KGn();J.push("//www.gstatic.com/eureka/clank/cast_sender.js");HT(J)},xtm=function(){oF8(); var J=KGn();J.push.apply(J,g.m(l0S.map(J_r)));J.push("//www.gstatic.com/eureka/clank/cast_sender.js");HT(J)},Rw=function(J,K,n){g.t.call(this); this.N=n!=null?(0,g.XS)(J,n):J;this.LA=K;this.C=(0,g.XS)(this.Hz,this);this.G=!1;this.Z=0;this.X=this.JH=null;this.U=[]},uv=function(){},jVz=function(){g.bh.call(this,"p")},VIF=function(){g.bh.call(this,"o")},vFm=function(){return hFF=hFF||new g.S9},QVS=function(J){g.bh.call(this,"serverreachability",J)},eJ=function(J){var K=vFm(); K.dispatchEvent(new QVS(K,J))},$tm=function(J){g.bh.call(this,"statevent",J)},zg=function(J){var K=vFm(); K.dispatchEvent(new $tm(K,J))},S1m=function(J,K,n,X){g.bh.call(this,"timingevent",J); this.size=K;this.rtt=n;this.retries=X},w8=function(J,K){if(typeof J!=="function")throw Error("Fn must not be null and must be a function"); return g.qp.setTimeout(function(){J()},K)},PT=function(){},Iw=function(J,K,n,X){this.X=J; this.U=K;this.o5=n;this.a5=X||1;this.Dm=new g.Cm(this);this.Fq=45E3;this.j_=null;this.N=!1;this.K=this.gQ=this.L=this.Cv=this.Aj=this.md=this.GA=null;this.QG=[];this.G=null;this.W=0;this.C=this.cW=null;this.vW=-1;this.PW=!1;this.wQ=0;this.fv=null;this.iR=this.kF=this.Gi=this.MQ=!1;this.Z=new r_F},r_F=function(){this.X=null; this.G="";this.Z=!1},Cu0=function(J,K,n){J.Cv=1; J.L=NZ(K.clone());J.K=n;J.MQ=!0;sV8(J,null)},sV8=function(J,K){J.Aj=Date.now(); iv(J);J.gQ=J.L.clone();JW(J.gQ,"t",J.a5);J.W=0;var n=J.X.Cv;J.Z=new r_F;J.G=O0j(J.X,n?K:null,!J.K);J.wQ>0&&(J.fv=new g.Kj((0,g.XS)(J.yq,J,J.G),J.wQ));J.Dm.listen(J.G,"readystatechange",J.k0);K=J.j_?g.Ku(J.j_):{};J.K?(J.cW||(J.cW="POST"),K["Content-Type"]="application/x-www-form-urlencoded",J.G.send(J.gQ,J.cW,J.K,K)):(J.cW="GET",J.G.send(J.gQ,J.cW,null,K));eJ(1)},RFm=function(J){if(!H0j(J))return g.bg(J.G); var K=g.AU(J.G);if(K==="")return"";var n="",X=K.length,l=g.q7(J.G)==4;if(!J.Z.X){if(typeof TextDecoder==="undefined")return BT(J),mP(J),"";J.Z.X=new g.qp.TextDecoder}for(var x=0;xK.length)return uKj;K=K.slice(X,X+n);J.W=X+n;return K},iv=function(J){J.md=Date.now()+J.Fq; wBG(J,J.Fq)},wBG=function(J,K){if(J.GA!=null)throw Error("WatchDog timer not null"); J.GA=w8((0,g.XS)(J.JC,J),K)},PuH=function(J){J.GA&&(g.qp.clearTimeout(J.GA),J.GA=null)},mP=function(J){J.X.Kl()||J.PW||I0V(J.X,J)},BT=function(J){PuH(J); g.QD(J.fv);J.fv=null;J.Dm.removeAll();if(J.G){var K=J.G;J.G=null;K.abort();K.dispose()}},dtz=function(J,K){try{var n=J.X; if(n.Y7!=0&&(n.G==J||i0O(n.Z,J)))if(!J.kF&&i0O(n.Z,J)&&n.Y7==3){try{var X=n.nH.G.parse(K)}catch(w){X=null}if(Array.isArray(X)&&X.length==3){var l=X;if(l[0]==0)a:{if(!n.L){if(n.G)if(n.G.Aj+3E30&&(n.wQ=1.5*v);X=n;var Q=J.Wr();if(Q){var S=g.M7(Q,"X-Client-Wire-Protocol");if(S){var r=X.Z;!r.G&&(g.Hj(S,"spdy")||g.Hj(S,"quic")||g.Hj(S,"h2"))&&(r.U=r.C,r.G=new Set,r.Z&&(pBG(r,r.Z),r.Z=null))}if(X.MQ){var C=g.M7(Q,"X-HTTP-Session-Id");C&&(X.ih=C,g.Q1(X.j_,X.MQ,C))}}n.Y7=3;n.C&&n.C.zV();n.fU&&(n.x4=Date.now()-J.Aj);X=n;var O=J;X.C9=LGz(X,X.Cv?X.a5:null,X.o5);if(O.kF){T18(X.Z, O);var H=O,R=X.wQ;R&&H.setTimeout(R);H.GA&&(PuH(H),iv(H));X.G=O}else DtH(X);n.X.length>0&&D9(n)}else x[0]!="stop"&&x[0]!="close"||Tg(n,7);else n.Y7==3&&(x[0]=="stop"||x[0]=="close"?x[0]=="stop"?Tg(n,7):n.disconnect():x[0]!="noop"&&n.C&&n.C.YJ(x),n.QG=0)}eJ(4)}catch(w){}},kBS=function(J,K){this.G=J; this.map=K;this.context=null},gFz=function(J){this.C=J||10; g.qp.PerformanceNavigationTiming?(J=g.qp.performance.getEntriesByType("navigation"),J=J.length>0&&(J[0].nextHopProtocol=="hq"||J[0].nextHopProtocol=="h2")):J=!!(g.qp.chrome&&g.qp.chrome.loadTimes&&g.qp.chrome.loadTimes()&&g.qp.chrome.loadTimes().wasFetchedViaSpdy);this.U=J?this.C:1;this.G=null;this.U>1&&(this.G=new Set);this.Z=null;this.X=[]},c_8=function(J){return J.Z?!0:J.G?J.G.size>=J.U:!1},mtG=function(J){return J.Z?1:J.G?J.G.size:0},i0O=function(J,K){return J.Z?J.Z==K:J.G?J.G.has(K):!1},pBG= function(J,K){J.G?J.G.add(K):J.Z=K},T18=function(J,K){J.Z&&J.Z==K?J.Z=null:J.G&&J.G.has(K)&&J.G.delete(K)},Y1V=function(J){if(J.Z!=null)return J.X.concat(J.Z.QG); if(J.G!=null&&J.G.size!==0){var K=J.X;J=g.z(J.G.values());for(var n=J.next();!n.done;n=J.next())K=K.concat(n.value.QG);return K}return g.zO(J.X)},GBO=function(J,K){var n=new PT; if(g.qp.Image){var X=new Image;X.onload=g.xr(d8,n,"TestLoadImage: loaded",!0,K,X);X.onerror=g.xr(d8,n,"TestLoadImage: error",!1,K,X);X.onabort=g.xr(d8,n,"TestLoadImage: abort",!1,K,X);X.ontimeout=g.xr(d8,n,"TestLoadImage: timeout",!1,K,X);g.qp.setTimeout(function(){if(X.ontimeout)X.ontimeout()},1E4); X.src=J}else K(!1)},Utm=function(J,K){var n=new PT,X=new AbortController,l=setTimeout(function(){X.abort(); d8(n,"TestPingServer: timeout",!1,K)},1E4); fetch(J,{signal:X.signal}).then(function(x){clearTimeout(l);x.ok?d8(n,"TestPingServer: ok",!0,K):d8(n,"TestPingServer: server error",!1,K)}).catch(function(){clearTimeout(l); d8(n,"TestPingServer: error",!1,K)})},d8=function(J,K,n,X,l){try{l&&(l.onload=null,l.onerror=null,l.onabort=null,l.ontimeout=null),X(n)}catch(x){}},tIn=function(){this.G=new uv},y_u=function(J,K,n){var X=n||""; try{nAG(J,function(l,x){var V=l;g.Kn(l)&&(V=g.yH(l));K.push(X+x+"="+encodeURIComponent(V))})}catch(l){throw K.push(X+"type="+encodeURIComponent("_badmap")),l; }},ky=function(J,K,n){return n&&n.Bv?n.Bv[J]||K:K},Z00=function(J){this.X=[]; this.a5=this.C9=this.j_=this.o5=this.G=this.ih=this.MQ=this.PW=this.W=this.vW=this.K=null;this.CH=this.gQ=0;this.o2=ky("failFast",!1,J);this.kF=this.GA=this.L=this.N=this.C=null;this.wN=!0;this.f9=this.fv=-1;this.iR=this.QG=this.Aj=0;this.P3=ky("baseRetryDelayMs",5E3,J);this.H3=ky("retryDelaySeedMs",1E4,J);this.Nk=ky("forwardChannelMaxRetries",2,J);this.nE=ky("forwardChannelRequestTimeoutMs",2E4,J);this.F2=J&&J.P3m||void 0;this.kO=J&&J.ZnQ||void 0;this.zL=J&&J.cyW||!1;this.wQ=void 0;this.Cv=J&&J.jOj|| !1;this.U="";this.Z=new gFz(J&&J.aGm);this.nH=new tIn;this.Dm=J&&J.uQq||!1;this.md=J&&J.KZM||!1;this.Dm&&this.md&&(this.md=!1);this.J7=J&&J.HgW||!1;J&&J.i$d&&(this.wN=!1);this.fU=!this.Dm&&this.wN&&J&&J.IGM||!1;this.PM=void 0;J&&J.Qr&&J.Qr>0&&(this.PM=J.Qr);this.KU=void 0;this.x4=0;this.Fq=!1;this.Gi=this.cW=null},Lq=function(J){J.G&&(f0m(J),J.G.cancel(),J.G=null)},WGj=function(J){Lq(J); J.L&&(g.qp.clearTimeout(J.L),J.L=null);pq(J);J.Z.cancel();J.N&&(typeof J.N==="number"&&g.qp.clearTimeout(J.N),J.N=null)},D9=function(J){c_8(J.Z)||J.N||(J.N=!0,g.wT(J.Fe,J),J.Aj=0)},FGG=function(J,K){if(mtG(J.Z)>=J.Z.U-(J.N?1:0))return!1; if(J.N)return J.X=K.QG.concat(J.X),!0;if(J.Y7==1||J.Y7==2||J.Aj>=(J.o2?0:J.Nk))return!1;J.N=w8((0,g.XS)(J.Fe,J,K),a00(J,J.Aj));J.Aj++;return!0},EFO=function(J,K){var n; K?n=K.o5:n=J.gQ++;var X=J.j_.clone();g.Q1(X,"SID",J.U);g.Q1(X,"RID",n);g.Q1(X,"AID",J.fv);g8(J,X);J.W&&J.K&&g.sX(X,J.W,J.K);n=new Iw(J,J.U,n,J.Aj+1);J.W===null&&(n.j_=J.K);K&&(J.X=K.QG.concat(J.X));K=q1V(J,n,1E3);n.setTimeout(Math.round(J.nE*.5)+Math.round(J.nE*.5*Math.random()));pBG(J.Z,n);Cu0(n,X,K)},g8=function(J,K){J.PW&&g.tj(J.PW,function(n,X){g.Q1(K,X,n)}); J.C&&nAG({},function(n,X){g.Q1(K,X,n)})},q1V=function(J,K,n){n=Math.min(J.X.length,n); var X=J.C?(0,g.XS)(J.C.Wz,J.C,J):null;a:{for(var l=J.X,x=-1;;){var V=["count="+n];x==-1?n>0?(x=l[0].G,V.push("ofs="+x)):x=0:V.push("ofs="+x);for(var v=!0,Q=0;Q=3)return!1; J.iR++;J.L=w8((0,g.XS)(J.II,J),a00(J,J.QG));J.QG++;return!0},f0m=function(J){J.cW!=null&&(g.qp.clearTimeout(J.cW),J.cW=null)},b0G=function(J){J.G=new Iw(J,J.U,"rpc",J.iR); J.W===null&&(J.G.j_=J.K);J.G.wQ=0;var K=J.C9.clone();g.Q1(K,"RID","rpc");g.Q1(K,"SID",J.U);g.Q1(K,"AID",J.fv);g.Q1(K,"CI",J.kF?"0":"1");!J.kF&&J.PM&&g.Q1(K,"TO",J.PM);g.Q1(K,"TYPE","xmlhttp");g8(J,K);J.W&&J.K&&g.sX(K,J.W,J.K);J.wQ&&J.G.setTimeout(J.wQ);var n=J.G;J=J.a5;n.Cv=1;n.L=NZ(K.clone());n.K=null;n.MQ=!0;sV8(n,J)},pq=function(J){J.GA!=null&&(g.qp.clearTimeout(J.GA),J.GA=null)},I0V=function(J,K){var n=null; if(J.G==K){pq(J);f0m(J);J.G=null;var X=2}else if(i0O(J.Z,K))n=K.QG,T18(J.Z,K),X=1;else return;if(J.Y7!=0)if(K.N)if(X==1){n=K.K?K.K.length:0;K=Date.now()-K.Aj;var l=J.Aj;X=vFm();X.dispatchEvent(new S1m(X,n,K,l));D9(J)}else DtH(J);else{var x=K.vW;l=K.getLastError();if(l==3||l==0&&x>0||!(X==1&&FGG(J,K)||X==2&&B1r(J)))switch(n&&n.length>0&&(K=J.Z,K.X=K.X.concat(n)),l){case 1:Tg(J,5);break;case 4:Tg(J,10);break;case 3:Tg(J,6);break;default:Tg(J,2)}}},a00=function(J,K){var n=J.P3+Math.floor(Math.random()* J.H3); J.isActive()||(n*=2);return n*K},Tg=function(J,K){if(K==2){var n=(0,g.XS)(J.Jom,J),X=J.kO,l=!X; X=new g.o0(X||"//www.google.com/images/cleardot.gif");g.qp.location&&g.qp.location.protocol=="http"||g.Xd(X,"https");NZ(X);l?GBO(X.toString(),n):Utm(X.toString(),n)}else zg(2);J.Y7=0;J.C&&J.C.S6(K);A_u(J);WGj(J)},A_u=function(J){J.Y7=0; J.Gi=[];if(J.C){var K=Y1V(J.Z);if(K.length!=0||J.X.length!=0)g.P8(J.Gi,K),g.P8(J.Gi,J.X),J.Z.X.length=0,g.zO(J.X),J.X.length=0;J.C.La()}},MIG=function(J){if(J.Y7==0)return J.Gi; var K=[];g.P8(K,Y1V(J.Z));g.P8(K,J.X);return K},LGz=function(J,K,n){var X=g.$P(n); X.G!=""?(K&&g.l1(X,K+"."+X.G),g.xP(X,X.X)):(X=g.qp.location,X=oAn(X.protocol,K?K+"."+X.hostname:X.hostname,+X.port,n));K=J.MQ;n=J.ih;K&&n&&g.Q1(X,K,n);g.Q1(X,"VER",J.gw);g8(J,X);return X},O0j=function(J,K,n){if(K&&!J.Cv)throw Error("Can't create secondary domain capable XhrIo object."); K=J.zL&&!J.F2?new g.WV(new g.NC({pZ:n})):new g.WV(J.F2);K.W=J.Cv;return K},N1O=function(){},JL0=function(){},Yy=function(J,K){g.S9.call(this); this.G=new Z00(K);this.C=J;this.Z=K&&K.M_M||null;J=K&&K.cjx||null;K&&K.V$G&&(J?J["X-Client-Protocol"]="webchannel":J={"X-Client-Protocol":"webchannel"});this.G.K=J;J=K&&K.kOQ||null;K&&K.Ed&&(J?J["X-WebChannel-Content-Type"]=K.Ed:J={"X-WebChannel-Content-Type":K.Ed});K&&K.xz&&(J?J["X-WebChannel-Client-Profile"]=K.xz:J={"X-WebChannel-Client-Profile":K.xz});this.G.vW=J;(J=K&&K.JFW)&&!g.O7(J)&&(this.G.W=J);this.N=K&&K.jOj||!1;this.U=K&&K.VkM||!1;(K=K&&K.EE)&&!g.O7(K)&&(this.G.MQ=K,g.E0(this.Z,K)&&(J= this.Z,K in J&&delete J[K]));this.X=new cT(this)},KAz=function(J){jVz.call(this); J.__headers__&&(this.headers=J.__headers__,this.statusCode=J.__status__,delete J.__headers__,delete J.__status__);var K=J.__sm__;K?this.data=(this.G=g.W8(K))?g.Nz(K,this.G):K:this.data=J},ndm=function(J){VIF.call(this); this.status=1;this.errorCode=J},cT=function(J){this.G=J},od8=function(J,K){this.Z=J; this.G=K},XJj=function(J){return MIG(J.G).map(function(K){var n=J.Z; K=K.map;"__data__"in K?(K=K.__data__,n=n.U?a1V(K):K):n=K;return n})},Gg=function(J,K){if(typeof J!=="function")throw Error("Fn must not be null and must be a function"); return g.qp.setTimeout(function(){J()},K)},tW=function(J){UJ.dispatchEvent(new lAn(UJ,J))},lAn=function(J){g.bh.call(this,"statevent",J)},yi=function(J,K,n,X){this.G=J; this.U=K;this.W=n;this.N=X||1;this.Z=45E3;this.X=new g.Cm(this);this.C=new g.cV;this.C.setInterval(250)},jBj=function(J,K,n){J.UH=1; J.Ke=NZ(K.clone());J.P5=n;J.MQ=!0;xHm(J,null)},Vk0=function(J,K,n,X,l){J.UH=1; J.Ke=NZ(K.clone());J.P5=null;J.MQ=n;l&&(J.oS=!1);xHm(J,X)},xHm=function(J,K){J.GM=Date.now(); htj(J);J.qZ=J.Ke.clone();JW(J.qZ,"t",J.N);J.Bk=0;J.Au=J.G.Rv(J.G.QM()?K:null);J.JQ>0&&(J.MZ=new g.Kj((0,g.XS)(J.Oc,J,J.Au),J.JQ));J.X.listen(J.Au,"readystatechange",J.eJ);K=J.je?g.Ku(J.je):{};J.P5?(J.j8="POST",K["Content-Type"]="application/x-www-form-urlencoded",J.Au.send(J.qZ,J.j8,J.P5,K)):(J.j8="GET",J.oS&&!g.qE&&(K.Connection="close"),J.Au.send(J.qZ,J.j8,null,K));J.G.xf(1)},$Hn=function(J,K){var n=J.Bk,X=K.indexOf("\n",n); if(X==-1)return vdO;n=Number(K.substring(n,X));if(isNaN(n))return QBu;X+=1;if(X+n>K.length)return vdO;K=K.slice(X,X+n);J.Bk=X+n;return K},htj=function(J){J.kD=Date.now()+J.Z; S6V(J,J.Z)},S6V=function(J,K){if(J.yd!=null)throw Error("WatchDog timer not null"); J.yd=Gg((0,g.XS)(J.tC,J),K)},rL0=function(J){J.yd&&(g.qp.clearTimeout(J.yd),J.yd=null)},sBG=function(J){J.G.Kl()||J.vu||J.G.tQ(J)},Z9=function(J){rL0(J); g.QD(J.MZ);J.MZ=null;J.C.stop();J.X.removeAll();if(J.Au){var K=J.Au;J.Au=null;K.abort();K.dispose()}J.CZ&&(J.CZ=null)},CtF=function(J,K){try{J.G.D7(J,K),J.G.xf(4)}catch(n){}},H6n=function(J,K,n,X,l){if(X==0)n(!1); else{var x=l||0;X--;O6G(J,K,function(V){V?n(!0):g.qp.setTimeout(function(){H6n(J,K,n,X,x)},x)})}},O6G=function(J,K,n){var X=new Image; X.onload=function(){try{fq(X),n(!0)}catch(l){}}; X.onerror=function(){try{fq(X),n(!1)}catch(l){}}; X.onabort=function(){try{fq(X),n(!1)}catch(l){}}; X.ontimeout=function(){try{fq(X),n(!1)}catch(l){}}; g.qp.setTimeout(function(){if(X.ontimeout)X.ontimeout()},K); X.src=J},fq=function(J){J.onload=null; J.onerror=null;J.onabort=null;J.ontimeout=null},RtS=function(J){this.G=J; this.Z=new uv},uzG=function(J){var K=WT(J.G,J.S7,"/mail/images/cleardot.gif"); NZ(K);H6n(K.toString(),5E3,(0,g.XS)(J.Ex,J),3,2E3);J.xf(1)},etr=function(J){var K=J.G.N; K!=null?(tW(5),K?(tW(11),aw(J.G,J,!1)):(tW(12),aw(J.G,J,!0))):(J.hL=new yi(J),J.hL.je=J.WS,K=J.G,K=WT(K,K.QM()?J.Pk:null,J.eD),tW(5),JW(K,"TYPE","xmlhttp"),Vk0(J.hL,K,!1,J.Pk,!1))},ztG=function(J,K,n){this.G=1; this.Z=[];this.X=[];this.C=new uv;this.K=J||null;this.N=K!=null?K:null;this.L=n||!1},wJG=function(J,K){this.G=J; this.map=K;this.context=null},Ptg=function(J,K,n,X){g.bh.call(this,"timingevent",J); this.size=K;this.rtt=n;this.retries=X},IAS=function(J){g.bh.call(this,"serverreachability",J)},B2F=function(J){J.V6(1,0); J.oL=WT(J,null,J.TC);i6S(J)},mHz=function(J){J.b3&&(J.b3.abort(),J.b3=null); J.XH&&(J.XH.cancel(),J.XH=null);J.bu&&(g.qp.clearTimeout(J.bu),J.bu=null);F9(J);J.nL&&(J.nL.cancel(),J.nL=null);J.dJ&&(g.qp.clearTimeout(J.dJ),J.dJ=null)},pJO=function(J,K){if(J.G==0)throw Error("Invalid operation: sending map when state is closed"); J.Z.push(new wJG(J.TX++,K));J.G!=2&&J.G!=3||i6S(J)},LA8=function(J){var K=0; J.XH&&K++;J.nL&&K++;return K},i6S=function(J){J.nL||J.dJ||(J.dJ=Gg((0,g.XS)(J.d1,J),0),J.Ie=0)},dHF=function(J,K){if(J.G==1){if(!K){J.ZR=Math.floor(Math.random()*1E5); K=J.ZR++;var n=new yi(J,"",K);n.je=J.KI;var X=T2u(J),l=J.oL.clone();g.Q1(l,"RID",K);g.Q1(l,"CVER","1");qN(J,l);jBj(n,l,X);J.nL=n;J.G=2}}else J.G==3&&(K?DHn(J,K):J.Z.length==0||J.nL||DHn(J))},DHn=function(J,K){if(K)if(J.oJ>6){J.Z=J.X.concat(J.Z); J.X.length=0;var n=J.ZR-1;K=T2u(J)}else n=K.W,K=K.P5;else n=J.ZR++,K=T2u(J);var X=J.oL.clone();g.Q1(X,"SID",J.U);g.Q1(X,"RID",n);g.Q1(X,"AID",J.FD);qN(J,X);n=new yi(J,J.U,n,J.Ie+1);n.je=J.KI;n.setTimeout(1E4+Math.round(1E4*Math.random()));J.nL=n;jBj(n,X,K)},qN=function(J,K){J.mC&&(J=J.mC.hR())&&g.tj(J,function(n,X){g.Q1(K,X,n)})},T2u=function(J){var K=Math.min(J.Z.length,1E3),n=["count="+K]; if(J.oJ>6&&K>0){var X=J.Z[0].G;n.push("ofs="+X)}else X=0;for(var l={},x=0;x=3)return!1; J.W++;J.bu=Gg((0,g.XS)(J.lL,J),gdn(J,J.sG));J.sG++;return!0},aw=function(J,K,n){J.AQ=J.N==null?n:!J.N; J.Hs=K.qc;J.L||B2F(J)},F9=function(J){J.CG!=null&&(g.qp.clearTimeout(J.CG),J.CG=null)},gdn=function(J,K){var n=5E3+Math.floor(Math.random()*1E4); J.isActive()||(n*=2);return n*K},EJ=function(J,K){if(K==2||K==9){var n=null; J.mC&&(n=null);var X=(0,g.XS)(J.Hl4,J);n||(n=new g.o0("//www.google.com/images/cleardot.gif"),NZ(n));O6G(n.toString(),1E4,X)}else tW(2);Y6r(J,K)},Y6r=function(J,K){J.G=0; J.mC&&J.mC.Ga(K);GpO(J);mHz(J)},GpO=function(J){J.G=0; J.Hs=-1;if(J.mC)if(J.X.length==0&&J.Z.length==0)J.mC.wF();else{var K=g.zO(J.X),n=g.zO(J.Z);J.X.length=0;J.Z.length=0;J.mC.wF(K,n)}},WT=function(J,K,n){var X=g.$P(n); if(X.G!="")K&&g.l1(X,K+"."+X.G),g.xP(X,X.X);else{var l=window.location;X=oAn(l.protocol,K?K+"."+l.hostname:l.hostname,+l.port,n)}J.pu&&g.tj(J.pu,function(x,V){g.Q1(X,V,x)}); g.Q1(X,"VER",J.oJ);qN(J,X);return X},UHm=function(){},tkz=function(){this.G=[]; this.Z=[]},yLz=function(J){g.bh.call(this,"channelMessage"); this.message=J},Z6F=function(J){g.bh.call(this,"channelError"); this.error=J},fAn=function(J,K){this.action=J; this.params=K||{}},bv=function(J,K){g.t.call(this); this.G=new g.AT(this.Mc4,0,this);g.Z(this,this.G);this.LA=5E3;this.Z=0;if(typeof J==="function")K&&(J=(0,g.XS)(J,K));else if(J&&typeof J.handleEvent==="function")J=(0,g.XS)(J.handleEvent,J);else throw Error("Invalid listener argument");this.X=J},WAO=function(J,K,n,X,l,x,V,v,Q,S,r,C,O,H){n=n===void 0?!1:n; X=X===void 0?function(){return""}:X; l=l===void 0?!1:l;x=x===void 0?!1:x;V=V===void 0?!1:V;v=v===void 0?function(){return g.TD({})}:v; Q=Q===void 0?!1:Q;r=r===void 0?!1:r;C=C===void 0?!1:C;O=O===void 0?!1:O;H=H===void 0?!1:H;this.Cv=J;this.GA=K;this.N=new g.BM;this.Z=new bv(this.tpA,this);this.G=null;this.W=!1;this.K=null;this.Aj="";this.QG=this.L=0;this.X=[];this.iR=n;this.MQ=X;this.C=x;this.j_=v;this.PW=S;this.a5=V;this.cW=null;this.U=g.TD();this.o5=l;this.Gi=Q;this.Dm=r;this.md=C;this.wN=O;this.vW=H;this.wQ=new FH0;this.kF=new qtO;this.Fq=new b5n;this.gQ=new Exj;this.fv=new Ac8;this.fU=new Mj8;this.KU=new NWS},q6G=function(J, K,n,X,l){aA0(J); if(J.G){var x=g.Et("ID_TOKEN"),V=J.G.KI||{};x?V["x-youtube-identity-token"]=x:delete V["x-youtube-identity-token"];J.G.KI=V}FA0(J);X?(X.getState()!=3&&LA8(X)==0||X.getState(),J.G.connect(K,n,J.GA,X.U,X.FD)):l?J.G.connect(K,n,J.GA,l.sessionId,l.arrayId):J.G.connect(K,n,J.GA)},Mkm=function(J,K){return J.wN?!0:J.md?Object.values(Edj).includes(K):J.Dm?!Object.values(b68).includes(K):J.vW?Object.values(ALH).includes(K):!1},K2V=function(J){var K,n; g.G(function(X){if(X.Z==1)return g.w3(X,2),g.d(X,N2g(J),2);g.LU(X);K=J.X;J.X=[];n=K.length;JEO(J,K,n);AW(J);return g.De(X,0)})},JEO=function(J,K,n){for(var X=0;X0?n=Object.assign({},n,K):delete n.Authorization;J.G.KI=n}},FA0=function(J){J.PW&&!J.C&&obG(J,J.PW())},MN=function(J){this.scheme="https"; this.port=this.domain="";this.G="/api/lounge";this.Z=!0;J=J||document.location.href;var K=Number(g.wP(J)[4]||null)||"";K&&(this.port=":"+K);this.domain=g.PH(J)||"";J=g.Ii();J.search("MSIE")>=0&&(J=J.match(/MSIE ([\d.]+)/)[1],g.Pj(J,"10.0")<0&&(this.Z=!1))},NN=function(J,K){var n=J.G; J.Z&&(n=J.scheme+"://"+J.domain+J.port+J.G);return g.Td(n+K,{})},XNj=function(J,K){g.S9.call(this); var n=this;this.L9=J();this.L9.subscribe("handlerOpened",this.wx,this);this.L9.subscribe("handlerClosed",this.onClosed,this);this.L9.subscribe("handlerError",function(X,l){n.onError(l)}); this.L9.subscribe("handlerMessage",this.onMessage,this);this.G=K},lYS=function(J,K,n){var X=this; n=n===void 0?function(){return""}:n; var l=l===void 0?new JL0:l;var x=x===void 0?new g.BM:x;this.pathPrefix=J;this.G=K;this.Aj=n;this.C=x;this.L=null;this.K=this.W=0;this.channel=null;this.N=0;this.X=new bv(function(){X.X.isActive();var V;((V=X.channel)==null?void 0:mtG((new od8(V,V.G)).G.Z))===0&&X.connect(X.L,X.W)}); this.U={};this.Z={};this.GA=!1;this.logger=null;this.QG=[];this.RO=void 0;this.j_=new FH0;this.cW=new qtO;this.PW=new Exj;this.MQ=new Ac8},xog=function(J){g.Xx(J.channel,"m",function(){J.N=3; J.X.reset();J.L=null;J.W=0;for(var K=g.z(J.QG),n=K.next();!n.done;n=K.next())n=n.value,J.channel&&J.channel.send(n);J.QG=[];J.publish("webChannelOpened");J.j_.W3("WEB_CHANNEL")}); g.Xx(J.channel,"n",function(){J.N=0;J.X.isActive()||J.publish("webChannelClosed");var K,n=(K=J.channel)==null?void 0:XJj(new od8(K,K.G));n&&(J.QG=[].concat(g.m(n)));J.cW.W3("WEB_CHANNEL")}); g.Xx(J.channel,"p",function(K){var n=K.data;n[0]==="gracefulReconnect"?(J.X.start(),J.channel&&J.channel.close()):J.publish("webChannelMessage",new fAn(n[0],n[1]));J.RO=K.statusCode;J.PW.W3("WEB_CHANNEL")}); g.Xx(J.channel,"o",function(){J.RO===401||J.X.start();J.publish("webChannelError");J.MQ.W3("WEB_CHANNEL","")})},jWg=function(J){var K=J.Aj(); K?J.U["x-youtube-lounge-xsrf-token"]=K:delete J.U["x-youtube-lounge-xsrf-token"]},VDm=function(J){g.S9.call(this); this.G=J();this.G.subscribe("webChannelOpened",this.fq,this);this.G.subscribe("webChannelClosed",this.onClosed,this);this.G.subscribe("webChannelError",this.onError,this);this.G.subscribe("webChannelMessage",this.onMessage,this)},h2g=function(J,K,n,X,l){function x(){return new WAO(NN(J,"/bc"),K,!1,n,X)} n=n===void 0?function(){return""}:n; return g.ef("enable_mdx_web_channel_desktop")?new VDm(function(){return new lYS(NN(J,"/wc"),K,n)}):new XNj(x,l)},SSS=function(){var J=vbj; QWm();JH.push(J);$on()},Kr=function(J,K){QWm(); var n=rEg(J,String(K));JH.length==0?sWO(n):($on(),g.Yr(JH,function(X){X(n)}))},nr=function(J){Kr("CP",J)},QWm=function(){JH||(JH=g.bF("yt.mdx.remote.debug.handlers_")||[],g.Ed("yt.mdx.remote.debug.handlers_",JH))},sWO=function(J){var K=(oE+1)%50; oE=K;Xu[K]=J;l4||(l4=K==49)},$on=function(){var J=JH; if(Xu[0]){var K=l4?oE:-1,n={};do n={Kc:void 0},K=(K+1)%50,n.Kc=Xu[K],g.Yr(J,function(X){return function(l){l(X.Kc)}}(n)); while(K!=oE);Xu=Array(50);oE=-1;l4=!1}},rEg=function(J,K){var n=(Date.now()-CP0)/1E3; n.toFixed&&(n=n.toFixed(3));var X=[];X.push("[",n+"s","] ");X.push("[","yt.mdx.remote","] ");X.push(J+": "+K,"\n");return X.join("")},xs=function(J){g.hi.call(this); this.N=J;this.screens=[]},OMF=function(J,K){var n=J.get(K.uuid)||J.get(K.id); if(n)return J=n.name,n.id=K.id||n.id,n.name=K.name,n.token=K.token,n.uuid=K.uuid||n.uuid,n.name!=J;J.screens.push(K);return!0},HMn=function(J,K){var n=J.screens.length!=K.length; J.screens=g.d7(J.screens,function(x){return!!gAz(K,x)}); for(var X=K.length,l=0;l0&&J.U0&&RE(J,n)},function(K){J.C=function(){}; J.kT(K)})},qS0=function(J){var K={}; K.pairingCode=J.cW;K.theme=J.Cv;F10()&&(K.env_useStageMdx=1);return g.Lf(K)},Ebr=function(J){return new Promise(function(K){J.cW=deG(); if(J.j_){var n=new chrome.cast.DialLaunchResponse(!0,qS0(J));K(n);F28(J)}else J.GA=function(){g.Ha(J.K);J.GA=function(){}; J.K=NaN;var X=new chrome.cast.DialLaunchResponse(!0,qS0(J));K(X);F28(J)},J.K=g.Ca(function(){J.GA()},100)})},AEz=function(J,K,n){J.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(K)); var X=new Vi(K);return(new Promise(function(l){bMu(J,X,function(x){x?(J.QG=!0,$s(J.U,X),rC(J,X),RE(J,n)):g.MM(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(K)+" is not online."));l(x)},5)})).then(function(l){return l?new chrome.cast.DialLaunchResponse(!1):Ebr(J)})},MDF=function(J,K){var n=J.L.receiver.label,X=J.Z.friendlyName; return(new Promise(function(l){L2m(J.U,n,K,X,function(x){x&&x.token&&rC(J,x);l(x)},function(x){sq(J,"Failed to get DIAL screen: "+x); l(null)})})).then(function(l){return l&&l.token?new chrome.cast.DialLaunchResponse(!1):Ebr(J)})},bMu=function(J,K,n,X){g.Ha(J.N); J.N=0;Dor(J.U,K,function(l){l||X<0?n(l):J.N=g.Ca(function(){bMu(J,K,n,X-1)},300)})},RE=function(J,K){J.info("getDialAppInfoWithTimeout_ "+K); Hw(J)&&(g.Ha(J.W),J.W=0,K==0?Ng0(J):J.W=g.Ca(function(){Ng0(J)},K))},Ng0=function(J){Hw(J)&&J.X.getDialAppInfo(function(K){J.info("getDialAppInfo dialLaunchData: "+JSON.stringify(K)); K=K.extraData||{};var n=null;if(K.loungeToken){var X;((X=J.G)==null?void 0:X.token)==K.loungeToken&&(n="staleLoungeToken")}else n="missingLoungeToken";n?(J.Aj=n,RE(J,3E4)):(J.QG=!1,J.Aj="unknown",cEu(J,K.loungeToken),RE(J,K.loungeTokenRefreshIntervalMs))},function(K){J.info("getDialAppInfo error: "+K); J.Aj="noLoungeTokenResponse";RE(J,3E4)})},Jaj=function(J){g.Ha(J.N); J.N=0;g.Ha(J.W);J.W=0;J.C();J.C=function(){}; g.Ha(J.K)},u4=function(J,K){SN.call(this,J,K,"ManualSession"); this.X=g.Ca((0,g.XS)(this.wv,this,null),150)},eN=function(J,K){g.hi.call(this); this.config_=K;this.Z=J;this.L=K.appId||"233637DE";this.U=K.theme||"cl";this.K=K.disableCastApi||!1;this.N=K.forceMirroring||!1;this.G=null;this.W=!1;this.X=[];this.C=(0,g.XS)(this.th5,this)},KIz=function(J,K){return K?g.ru(J.X,function(n){return hW(K,n.label)},J):null},zw=function(J){Kr("Controller",J)},vbj=function(J){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(J)},wC=function(J){return J.W||!!J.X.length||!!J.G},Pw=function(J,K,n){K!=J.G&&(g.QD(J.G),(J.G=K)?(n?J.publish("yt-remote-cast2-receiver-resumed", K.Z):J.publish("yt-remote-cast2-receiver-selected",K.Z),K.subscribe("sessionScreen",(0,g.XS)(J.ET,J,K)),K.subscribe("sessionFailed",function(){return n4n(J,K)}),K.G?J.publish("yt-remote-cast2-session-change",K.G):n&&J.G.wv(null)):J.publish("yt-remote-cast2-session-change",null))},n4n=function(J,K){J.G==K&&J.publish("yt-remote-cast2-session-failed")},o4g=function(J){var K=J.Z.Xs(),n=J.G&&J.G.Z; J=g.ff(K,function(X){n&&hW(X,n.label)&&(n=null);var l=X.uuid?X.uuid:X.id,x=KIz(this,X);x?(x.label=l,x.friendlyName=X.name):(x=new chrome.cast.Receiver(l,X.name),x.receiverType=chrome.cast.ReceiverType.CUSTOM);return x},J); n&&(n.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(n=new chrome.cast.Receiver(n.label,n.friendlyName),n.receiverType=chrome.cast.ReceiverType.CUSTOM),J.push(n));return J},v4G=function(J,K,n,X){X.disableCastApi?IE("Cannot initialize because disabled by Mdx config."):XCg()?l$V(K,X)&&(xD8(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?jnu(J,n):(window.__onGCastApiAvailable=function(l,x){l?jnu(J,n):(i4("Failed to load cast API: "+x),VpH(!1),xD8(!1),g.cB("yt-remote-cast-available"),g.cB("yt-remote-cast-receiver"), hs0(),n(!1))},X.loadCastApiSetupScript?g.VR("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?EAH()>=60&&XB0():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?NN0():EAH()>=89?xtm():(oF8(),HT(l0S.map(J_r))))):IE("Cannot initialize because not running Chrome")},hs0=function(){IE("dispose"); var J=Bw();J&&J.dispose();g.Ed("yt.mdx.remote.cloudview.instance_",null);QnS(!1);g.x4($Dz);$Dz.length=0},m3=function(){return!!g.g1("yt-remote-cast-installed")},SHz=function(){var J=g.g1("yt-remote-cast-receiver"); return J?J.friendlyName:null},raV=function(){IE("clearCurrentReceiver"); g.cB("yt-remote-cast-receiver")},snH=function(){return m3()?Bw()?Bw().getCastSession():(i4("getCastSelector: Cast is not initialized."),null):(i4("getCastSelector: Cast API is not installed!"),null)},CNG=function(){m3()?Bw()?pr()?(IE("Requesting cast selector."),Bw().requestSession()):(IE("Wait for cast API to be ready to request the session."),$Dz.push(g.lN("yt-remote-cast2-api-ready",CNG))):i4("requestCastSelector: Cast is not initialized."):i4("requestCastSelector: Cast API is not installed!")}, Lr=function(J,K){pr()?Bw().setConnectedScreenStatus(J,K):i4("setConnectedScreenStatus called before ready.")},XCg=function(){var J=g.Ii().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.T2||J},OEu=function(J,K){Bw().init(J,K)},l$V=function(J,K){var n=!1; Bw()||(J=new eN(J,K),J.subscribe("yt-remote-cast2-availability-change",function(X){g.kF("yt-remote-cast-available",X);Cq("yt-remote-cast2-availability-change",X)}),J.subscribe("yt-remote-cast2-receiver-selected",function(X){IE("onReceiverSelected: "+X.friendlyName); g.kF("yt-remote-cast-receiver",X);Cq("yt-remote-cast2-receiver-selected",X)}),J.subscribe("yt-remote-cast2-receiver-resumed",function(X){IE("onReceiverResumed: "+X.friendlyName); g.kF("yt-remote-cast-receiver",X);Cq("yt-remote-cast2-receiver-resumed",X)}),J.subscribe("yt-remote-cast2-session-change",function(X){IE("onSessionChange: "+vT(X)); X||g.cB("yt-remote-cast-receiver");Cq("yt-remote-cast2-session-change",X)}),g.Ed("yt.mdx.remote.cloudview.instance_",J),n=!0); IE("cloudview.createSingleton_: "+n);return n},Bw=function(){return g.bF("yt.mdx.remote.cloudview.instance_")},jnu=function(J,K){VpH(!0); xD8(!1);OEu(J,function(n){n?(QnS(!0),g.jp("yt-remote-cast2-api-ready")):(i4("Failed to initialize cast API."),VpH(!1),g.cB("yt-remote-cast-available"),g.cB("yt-remote-cast-receiver"),hs0());K(n)})},IE=function(J){Kr("cloudview",J)},i4=function(J){Kr("cloudview",J)},VpH=function(J){IE("setCastInstalled_ "+J); g.kF("yt-remote-cast-installed",J)},pr=function(){return!!g.bF("yt.mdx.remote.cloudview.apiReady_")},QnS=function(J){IE("setApiReady_ "+J); g.Ed("yt.mdx.remote.cloudview.apiReady_",J)},xD8=function(J){g.Ed("yt.mdx.remote.cloudview.initializing_",J)},Tw=function(J){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.N=0;this.trackData=null;this.kL=this.p$=!1;this.L=this.X=this.W=this.Z=0;this.G=NaN;this.U=!1;this.reset(J)},HEF=function(J){J.audioTrackId=null; J.trackData=null;J.playerState=-1;J.p$=!1;J.kL=!1;J.N=0;J.C=g.jV();J.Z=0;J.W=0;J.X=0;J.L=0;J.G=NaN;J.U=!1},DJ=function(J){return J.isPlaying()?(g.jV()-J.C)/1E3:0},dC=function(J,K){J.N=K; J.C=g.jV()},ks=function(J){switch(J.playerState){case 1:case 1081:return(g.jV()-J.C)/1E3+J.N; case -1E3:return 0}return J.N},RsG=function(J){return J.U?J.W+DJ(J):J.W},gC=function(J,K,n){var X=J.videoId; J.videoId=K;J.index=n;K!=X&&HEF(J)},uPu=function(J){var K={}; K.index=J.index;K.listId=J.listId;K.videoId=J.videoId;K.playerState=J.playerState;K.volume=J.volume;K.muted=J.muted;K.audioTrackId=J.audioTrackId;K.trackData=g.nu(J.trackData);K.hasPrevious=J.p$;K.hasNext=J.kL;K.playerTime=J.N;K.playerTimeAt=J.C;K.seekableStart=J.Z;K.seekableEnd=J.W;K.duration=J.X;K.loadedTime=J.L;K.liveIngestionTime=J.G;return K},Ys=function(J,K){g.hi.call(this); var n=this;this.X=0;this.U=J;this.N=[];this.C=new tkz;this.Z=this.G=null;this.K=(0,g.XS)(this.z5F,this);this.W=(0,g.XS)(this.qL,this);this.L=(0,g.XS)(this.mQd,this);this.GA=(0,g.XS)(this.DQ5,this);var X=0;J?(X=J.getProxyState(),X!=3&&(J.subscribe("proxyStateChange",this.hG,this),esF(this))):X=3;X!=0&&(K?this.hG(X):g.Ca(function(){n.hG(X)},0)); (J=snH())&&cw(this,J);this.subscribe("yt-remote-cast2-session-change",this.GA)},Gw=function(J){return new Tw(J.U.getPlayerContextData())},esF=function(J){g.Yr("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(K){this.N.push(this.U.subscribe(K,g.xr(this.k4F,K),this))},J)},zsz=function(J){g.Yr(J.N,function(K){this.U.unsubscribeByKey(K)},J); J.N.length=0},Uq=function(J){return J.getState()==1},tH=function(J,K){var n=J.C; n.G.length+n.Z.length<50&&J.C.enqueue(K)},wCj=function(J,K,n){var X=Gw(J); dC(X,n);X.playerState!=-1E3&&(X.playerState=K);y6(J,X)},ZJ=function(J,K,n){J.U.sendMessage(K,n)},y6=function(J,K){zsz(J); J.U.setPlayerContextData(uPu(K));esF(J)},cw=function(J,K){J.Z&&(J.Z.removeUpdateListener(J.K),J.Z.removeMediaListener(J.W),J.qL(null)); J.Z=K;J.Z&&(nr("Setting cast session: "+J.Z.sessionId),J.Z.addUpdateListener(J.K),J.Z.addMediaListener(J.W),J.Z.media.length&&J.qL(J.Z.media[0]))},PNV=function(J){var K=J.G.media,n=J.G.customData; if(K&&n){var X=Gw(J);K.contentId!=X.videoId&&nr("Cast changing video to: "+K.contentId);X.videoId=K.contentId;X.playerState=n.playerState;dC(X,J.G.getEstimatedTime());y6(J,X)}else nr("No cast media video. Ignoring state update.")},fr=function(J,K,n){return(0,g.XS)(function(X){this.Ek("Failed to "+K+" with cast v2 channel. Error code: "+X.code); X.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Ek("Retrying "+K+" using MDx browser channel."),ZJ(this,K,n))},J)},Fu=function(J,K,n,X){X=X===void 0?!1:X; g.hi.call(this);var l=this;this.N=NaN;this.cW=!1;this.K=this.L=this.QG=this.Aj=NaN;this.GA=[];this.C=this.W=this.U=this.G=this.Z=null;this.j_=J;this.PW=X;this.GA.push(g.w1(window,"beforeunload",function(){l.CC(2)})); this.X=[];this.G=new Tw;this.Cv=K.id;this.MQ=K.idType;this.Z=h2g(this.j_,n,this.iL,this.MQ=="shortLived",this.Cv);this.Z.listen("channelOpened",function(){I$0(l)}); this.Z.listen("channelClosed",function(){Ww("Channel closed");isNaN(l.N)?r8(!0):r8();l.dispose()}); this.Z.listen("channelError",function(x){r8();isNaN(l.hN())?(x==1&&l.MQ=="shortLived"&&l.publish("browserChannelAuthError",x),Ww("Channel error: "+x+" without reconnection"),l.dispose()):(l.cW=!0,Ww("Channel error: "+x+" with reconnection in "+l.hN()+" ms"),aE(l,2))}); this.Z.listen("channelMessage",function(x){iEH(l,x)}); this.Z.WL(K.token);this.subscribe("remoteQueueChange",function(){var x=l.G.videoId;g.YF()&&g.kF("yt-remote-session-video-id",x)})},BVV=function(J){return g.ru(J.X,function(K){return K.type=="LOUNGE_SCREEN"})},Ww=function(J){Kr("conn",J)},aE=function(J,K){J.publish("proxyStateChange",K)},mDS=function(J){J.N=g.Ca(function(){Ww("Connecting timeout"); J.CC(1)},2E4)},pCO=function(J){g.Ha(J.N); J.N=NaN},LIH=function(J){g.Ha(J.Aj); J.Aj=NaN},DD8=function(J){TVS(J); J.QG=g.Ca(function(){q_(J,"getNowPlaying")},2E4)},TVS=function(J){g.Ha(J.QG); J.QG=NaN},I$0=function(J){Ww("Channel opened"); J.cW&&(J.cW=!1,LIH(J),J.Aj=g.Ca(function(){Ww("Timing out waiting for a screen.");J.CC(1)},15E3))},k0F=function(J,K){var n=null; if(K){var X=BVV(J);X&&(n={clientName:X.clientName,deviceMake:X.brand,deviceModel:X.model,osVersion:X.osVersion})}g.Ed("yt.mdx.remote.remoteClient_",n);K&&(pCO(J),LIH(J));n=J.Z.Kr()&&isNaN(J.N);K==n?K&&(aE(J,1),q_(J,"getSubtitlesTrack")):K?(J.BN()&&J.G.reset(),aE(J,1),q_(J,"getNowPlaying"),dDO(J)):J.CC(1)},g4F=function(J,K){var n=K.params.videoId; delete K.params.videoId;n==J.G.videoId&&(g.Mz(K.params)?J.G.trackData=null:J.G.trackData=K.params,J.publish("remotePlayerChange"))},can=function(J,K,n){var X=K.params.videoId||K.params.video_id,l=parseInt(K.params.currentIndex,10); J.G.listId=K.params.listId||J.G.listId;gC(J.G,X,l);J.publish("remoteQueueChange",n)},G0F=function(J,K){K.params=K.params||{}; can(J,K,"NOW_PLAYING_MAY_CHANGE");YHz(J,K);J.publish("autoplayDismissed")},YHz=function(J,K){var n=parseInt(K.params.currentTime||K.params.current_time,10); dC(J.G,isNaN(n)?0:n);n=parseInt(K.params.state,10);n=isNaN(n)?-1:n;n==-1&&J.G.playerState==-1E3&&(n=-1E3);J.G.playerState=n;n=Number(K.params.loadedTime);J.G.L=isNaN(n)?0:n;J.G.yL(Number(K.params.duration));n=J.G;var X=Number(K.params.liveIngestionTime);n.G=X;n.U=isNaN(X)?!1:!0;n=J.G;X=Number(K.params.seekableStartTime);K=Number(K.params.seekableEndTime);n.Z=isNaN(X)?0:X;n.W=isNaN(K)?0:K;J.G.playerState==1?DD8(J):TVS(J);J.publish("remotePlayerChange")},UDr=function(J,K){if(J.G.playerState!=-1E3){var n= 1085; switch(parseInt(K.params.adState,10)){case 1:n=1081;break;case 2:n=1084;break;case 0:n=1083}J.G.playerState=n;K=parseInt(K.params.currentTime,10);dC(J.G,isNaN(K)?0:K);J.publish("remotePlayerChange")}},tpO=function(J,K){var n=K.params.muted=="true"; J.G.volume=parseInt(K.params.volume,10);J.G.muted=n;J.publish("remotePlayerChange")},yaF=function(J,K){J.W=K.params.videoId; J.publish("nowAutoplaying",parseInt(K.params.timeout,10))},ZEz=function(J,K){J.W=K.params.videoId||null; J.publish("autoplayUpNext",J.W)},f$u=function(J,K){J.C=K.params.autoplayMode; J.publish("autoplayModeChange",J.C);J.C=="DISABLED"&&J.publish("autoplayDismissed")},WIm=function(J,K){var n=K.params.hasNext=="true"; J.G.p$=K.params.hasPrevious=="true";J.G.kL=n;J.publish("previousNextChange")},iEH=function(J,K){K=K.message; K.params?Ww("Received: action="+K.action+", params="+g.yH(K.params)):Ww("Received: action="+K.action+" {}");switch(K.action){case "loungeStatus":K=Kq(K.params.devices);J.X=g.ff(K,function(X){return new jJ(X)}); K=!!g.ru(J.X,function(X){return X.type=="LOUNGE_SCREEN"}); k0F(J,K);K=J.Pj("mlm");J.publish("multiStateLoopEnabled",K);break;case "loungeScreenDisconnected":g.uG(J.X,function(X){return X.type=="LOUNGE_SCREEN"}); k0F(J,!1);break;case "remoteConnected":var n=new jJ(Kq(K.params.device));g.ru(J.X,function(X){return X.equals(n)})||Z5H(J.X,n); break;case "remoteDisconnected":n=new jJ(Kq(K.params.device));g.uG(J.X,function(X){return X.equals(n)}); break;case "gracefulDisconnect":break;case "playlistModified":can(J,K,"QUEUE_MODIFIED");break;case "nowPlaying":G0F(J,K);break;case "onStateChange":YHz(J,K);break;case "onAdStateChange":UDr(J,K);break;case "onVolumeChanged":tpO(J,K);break;case "onSubtitlesTrackChanged":g4F(J,K);break;case "nowAutoplaying":yaF(J,K);break;case "autoplayDismissed":J.publish("autoplayDismissed");break;case "autoplayUpNext":ZEz(J,K);break;case "onAutoplayModeChanged":f$u(J,K);break;case "onHasPreviousNextChanged":WIm(J, K);break;case "requestAssistedSignIn":J.publish("assistedSignInRequested",K.params.authCode);break;case "onLoopModeChanged":J.publish("loopModeChange",K.params.loopMode);break;default:Ww("Unrecognized action: "+K.action)}},dDO=function(J){g.Ha(J.K); J.K=g.Ca(function(){J.CC(1)},864E5)},q_=function(J,K,n){n?Ww("Sending: action="+K+", params="+g.yH(n)):Ww("Sending: action="+K); J.Z.sendMessage(K,n)},a$z=function(J){xs.call(this,"ScreenServiceProxy"); this.cO=J;this.G=[];this.G.push(this.cO.$_s("screenChange",(0,g.XS)(this.zX,this)));this.G.push(this.cO.$_s("onlineScreenChange",(0,g.XS)(this.fvj,this)))},Aar=function(J,K){aCF(); if(!sJ||!sJ.get("yt-remote-disable-remote-module-for-dev")){K=g.Et("MDX_CONFIG")||K;c2V();tfz();Eq||(Eq=new MN(K?K.loungeApiHost:void 0),F10()&&(Eq.G="/api/loungedev"));b4||(b4=g.bF("yt.mdx.remote.deferredProxies_")||[],g.Ed("yt.mdx.remote.deferredProxies_",b4));FIz();var n=AH();if(!n){var X=new Q6(Eq,K?K.disableAutomaticScreenCache||!1:!1);g.Ed("yt.mdx.remote.screenService_",X);n=AH();var l={};K&&(l={appId:K.appId,disableDial:K.disableDial,theme:K.theme,loadCastApiSetupScript:K.loadCastApiSetupScript, disableCastApi:K.disableCastApi,enableDialLoungeToken:K.enableDialLoungeToken,enableCastLoungeToken:K.enableCastLoungeToken,forceMirroring:K.forceMirroring});g.Ed("yt.mdx.remote.enableConnectWithInitialState_",K?K.enableConnectWithInitialState||!1:!1);v4G(J,X,function(x){x?M_()&&Lr(M_(),"YouTube TV"):X.subscribe("onlineScreenChange",function(){Cq("yt-remote-receiver-availability-change")})},l)}K&&!g.bF("yt.mdx.remote.initialized_")&&(g.Ed("yt.mdx.remote.initialized_",!0),N_("Initializing: "+g.yH(K)), Jb.push(g.lN("yt-remote-cast2-api-ready",function(){Cq("yt-remote-api-ready")})),Jb.push(g.lN("yt-remote-cast2-availability-change",function(){Cq("yt-remote-receiver-availability-change")})),Jb.push(g.lN("yt-remote-cast2-receiver-selected",function(){Kw(null); Cq("yt-remote-auto-connect","cast-selector-receiver")})),Jb.push(g.lN("yt-remote-cast2-receiver-resumed",function(){Cq("yt-remote-receiver-resumed","cast-selector-receiver")})),Jb.push(g.lN("yt-remote-cast2-session-change",qHz)),Jb.push(g.lN("yt-remote-connection-change",function(x){x?Lr(M_(),"YouTube TV"):nw()||(Lr(null,null),raV())})),Jb.push(g.lN("yt-remote-cast2-session-failed",function(){Cq("yt-remote-connection-failed")})),J=E4O(),K.isAuto&&(J.id+="#dial"),l=K.capabilities||[],g.ef("desktop_enable_autoplay")&& l.push("atp"),l.length>0&&(J.capabilities=l),J.name=K.device,J.app=K.app,(K=K.theme)&&(J.theme=K),N_(" -- with channel params: "+g.yH(J)),J?(g.kF("yt-remote-session-app",J.app),g.kF("yt-remote-session-name",J.name)):(g.cB("yt-remote-session-app"),g.cB("yt-remote-session-name")),g.Ed("yt.mdx.remote.channelParams_",J),n.start(),M_()||bEz())}},MpH=function(){var J=AH().cO.$_gos(); var K=oq();K&&XU()&&(gAz(J,K)||J.push(K));return kr8(J)},J4u=function(){var J=NVz(); !J&&m3()&&SHz()&&(J={key:"cast-selector-receiver",name:SHz()});return J},NVz=function(){var J=MpH(),K=oq(); K||(K=nw());return g.ru(J,function(n){return K&&hW(K,n.key)?!0:!1})},oq=function(){var J=M_(); if(!J)return null;var K=AH().oE();return Qi(K,J)},qHz=function(J){N_("remote.onCastSessionChange_: "+vT(J)); if(J){var K=oq();if(K&&K.id==J.id){if(Lr(K.id,"YouTube TV"),J.idType=="shortLived"&&(J=J.token))lY&&(lY.token=J),(K=XU())&&K.WL(J)}else K&&x8(),jF(J,1)}else XU()&&x8()},x8=function(){pr()?Bw().stopSession():i4("stopSession called before API ready."); var J=XU();J&&(J.disconnect(1),KL8(null))},nou=function(){var J=XU(); return!!J&&J.getProxyState()!=3},N_=function(J){Kr("remote",J)},AH=function(){if(!ooG){var J=g.bF("yt.mdx.remote.screenService_"); ooG=J?new a$z(J):null}return ooG},M_=function(){return g.bF("yt.mdx.remote.currentScreenId_")},Xxn=function(J){g.Ed("yt.mdx.remote.currentScreenId_",J)},lxF=function(){return g.bF("yt.mdx.remote.connectData_")},Kw=function(J){g.Ed("yt.mdx.remote.connectData_",J)},XU=function(){return g.bF("yt.mdx.remote.connection_")},KL8=function(J){var K=XU(); Kw(null);J||Xxn("");g.Ed("yt.mdx.remote.connection_",J);b4&&(g.Yr(b4,function(n){n(J)}),b4.length=0); K&&!J?Cq("yt-remote-connection-change",!1):!K&&J&&Cq("yt-remote-connection-change",!0)},nw=function(){var J=g.YF(); if(!J)return null;var K=AH();if(!K)return null;K=K.oE();return Qi(K,J)},jF=function(J,K){M_(); oq()&&oq();if(VK)lY=J;else{Xxn(J.id);var n=g.bF("yt.mdx.remote.enableConnectWithInitialState_")||!1;J=new Fu(Eq,J,E4O(),n);J.connect(K,lxF());J.subscribe("beforeDisconnect",function(X){Cq("yt-remote-before-disconnect",X)}); J.subscribe("beforeDispose",function(){XU()&&(XU(),KL8(null))}); J.subscribe("browserChannelAuthError",function(){var X=oq();X&&X.idType=="shortLived"&&(pr()?Bw().handleBrowserChannelAuthError():i4("refreshLoungeToken called before API ready."))}); KL8(J)}},bEz=function(){var J=nw(); J?(N_("Resume connection to: "+vT(J)),jF(J,0)):(r8(),raV(),N_("Skipping connecting because no session screen found."))},FIz=function(){var J=E4O(); if(g.Mz(J)){J=SJ();var K=g.g1("yt-remote-session-name")||"",n=g.g1("yt-remote-session-app")||"";J={device:"REMOTE_CONTROL",id:J,name:K,app:n,mdxVersion:3};J.authuser=String(g.Et("SESSION_INDEX","0"));(K=g.Et("DELEGATED_SESSION_ID"))&&(J.pageId=String(K));g.Ed("yt.mdx.remote.channelParams_",J)}},E4O=function(){return g.bF("yt.mdx.remote.channelParams_")||{}},VEr=function(J,K,n){g.t.call(this); var X=this;this.G=J;this.B=K;this.LU=n;this.events=new g.gY(this);this.C=!1;this.N=new g.lH(64);this.Z=new g.AT(this.Kx,500,this);this.X=new g.AT(this.vg,1E3,this);this.L=new Rw(this.Ol5,0,this);this.U={};this.K=new g.AT(this.YV,1E3,this);this.W=new g.Kj(this.seekTo,1E3,this);this.GA=this.events.T(this.B,"onVolumeChange",function(l){xqj(X,l)}); g.Z(this,this.events);this.events.T(K,"onCaptionsTrackListChanged",this.NNM);this.events.T(K,"captionschanged",this.SMd);this.events.T(K,"captionssettingschanged",this.Ab);this.events.T(K,"videoplayerreset",this.q7);this.events.T(K,"mdxautoplaycancel",function(){X.LU.kz()}); K.J("enable_mdx_video_play_directly")&&this.events.T(K,"videodatachange",function(){jZF(X.G)||vE(X)||QK(X,0)}); J=this.LU;J.o4();J.subscribe("proxyStateChange",this.xM,this);J.subscribe("remotePlayerChange",this.HV,this);J.subscribe("remoteQueueChange",this.q7,this);J.subscribe("previousNextChange",this.pc,this);J.subscribe("nowAutoplaying",this.KB,this);J.subscribe("autoplayDismissed",this.TH,this);g.Z(this,this.Z);g.Z(this,this.X);g.Z(this,this.L);g.Z(this,this.K);g.Z(this,this.W);this.Ab();this.q7();this.HV()},xqj=function(J,K){if(vE(J)){J.LU.unsubscribe("remotePlayerChange",J.HV,J); var n=Math.round(K.volume);K=!!K.muted;var X=Gw(J.LU);if(n!==X.volume||K!==X.muted)J.LU.setVolume(n,K),J.K.start();J.LU.subscribe("remotePlayerChange",J.HV,J)}},h7r=function(J){J.MH(0); J.Z.stop();J.G4(new g.lH(64))},voF=function(J,K){if(vE(J)&&!J.C){var n=null; K&&(n={style:J.B.getSubtitlesUserSettings()},Object.assign(n,K));J.LU.nk(J.B.getVideoData(1).videoId,n);J.U=g.U(Gw(J.LU).trackData)}},QK=function(J,K){var n=J.B.getPlaylist(); if(n==null?0:n.listId){var X=n.index;var l=n.listId.toString()}n=J.B.getVideoData(1);J.LU.playVideo(n.videoId,K,X,l,n.playerParams,n.j_,ycr(n));J.G4(new g.lH(1))},QZS=function(J,K){if(K){var n=J.B.getOption("captions","tracklist",{xv:1}); n&&n.length?(J.B.setOption("captions","track",K),J.C=!1):(J.B.loadModule("captions"),J.C=!0)}else J.B.setOption("captions","track",{})},vE=function(J){return Gw(J.LU).videoId===J.B.getVideoData(1).videoId},$qV=function(J,K){g.YZ.call(this,J); this.G=K},$8=function(){g.F.call(this,{j:"div", V:"ytp-mdx-popup-dialog",D:{role:"dialog"},Y:[{j:"div",V:"ytp-mdx-popup-dialog-inner-content",Y:[{j:"div",V:"ytp-mdx-popup-title",hj:"You're signed out"},{j:"div",V:"ytp-mdx-popup-description",hj:"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."},{j:"div",V:"ytp-mdx-privacy-popup-buttons",Y:[{j:"button",UM:["ytp-button","ytp-mdx-privacy-popup-cancel"],hj:"Cancel"},{j:"button",UM:["ytp-button", "ytp-mdx-privacy-popup-confirm"],hj:"Confirm"}]}]}]});this.fade=new g.ov(this,250);this.cancelButton=this.rQ("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.rQ("ytp-mdx-privacy-popup-confirm");g.Z(this,this.fade);this.T(this.cancelButton,"click",this.G);this.T(this.confirmButton,"click",this.Z)},SF=function(J){g.F.call(this,{j:"div", V:"ytp-remote",Y:[{j:"div",V:"ytp-remote-display-status",Y:[{j:"div",V:"ytp-remote-display-status-icon",Y:[g.H6U()]},{j:"div",V:"ytp-remote-display-status-text",hj:"{{statustext}}"}]}]});this.api=J;this.fade=new g.ov(this,250);g.Z(this,this.fade);this.T(J,"presentingplayerstatechange",this.onStateChange);this.RZ(J.getPlayerStateObject())},rA=function(J,K){g.gd.call(this,"Play on",1,J,K); this.B=J;this.TZ={};this.T(J,"onMdxReceiversChange",this.U);this.T(J,"presentingplayerstatechange",this.U);this.U()},Smm=function(J){g.CH.call(this,J); this.jY={key:deG(),name:"This computer"};this.Z5=null;this.subscriptions=[];this.AS=this.LU=null;this.TZ=[this.jY];this.jC=this.jY;this.N_=new g.lH(64);this.Vo=0;this.x6=-1;this.Iq=!1;this.uH=this.sW=this.PP=null;if(!g.cp(this.player.S())&&!g.G_(this.player.S())){J=this.player;var K=g.s2(J);K&&(K=K.NB())&&(K=new rA(J,K),g.Z(this,K));K=new SF(J);g.Z(this,K);g.dv(J,K.element,4);this.PP=new $8;g.Z(this,this.PP);g.dv(J,this.PP.element,4);this.Iq=!!nw()}},sh=function(J){J.sW&&(J.player.removeEventListener("presentingplayerstatechange", J.sW),J.sW=null)},r4r=function(J,K,n){J.N_=n; J.player.publish("presentingplayerstatechange",new g.rf(n,K))},Cw=function(J,K){if(K.key!==J.jC.key)if(K.key===J.jY.key)x8(); else if(jZF(J)&&sZG(J),J.jC=K,!J.player.S().J("disable_mdx_connection_in_mdx_module_for_music_web")||!g.G_(J.player.S())){var n=J.player.getPlaylistId();var X=J.player.getVideoData(1);var l=X.videoId;if(!n&&!l||(J.player.getAppState()===2||J.player.getAppState()===1)&&J.player.S().J("should_clear_video_data_on_player_cued_unstarted"))X=null;else{var x=J.player.getPlaylist();if(x){var V=[];for(var v=0;v2*this.size&&lv(this),!0):!1}; g.u.get=function(J,K){return ow(this.Z,J)?this.Z[J]:K}; g.u.set=function(J,K){ow(this.Z,J)||(this.size+=1,this.G.push(J),this.iD++);this.Z[J]=K}; g.u.forEach=function(J,K){for(var n=this.t9(),X=0;X=X.G.length)return g.xa;var x=X.G[K++];return g.ps(J?x:X.Z[x])}; return l}; var hqS={x3A:"atp",y0q:"ska",Zyd:"que",Myx:"mus",wqx:"sus",YYQ:"dsp",B5d:"seq",X65:"mic",ZJQ:"dpa",ELq:"mlm",QPd:"dsdtr",N34:"ntb",C$M:"vsp",qYd:"scn",XqF:"rpe",v6d:"dcn",lO5:"dcp",gLW:"pas",GdW:"drq",RNA:"opf",Mu4:"els",cux:"isg",Hy_:"svq",cLQ:"mvp",E74:"ads",mVd:"stcp",RxG:"sads",dPx:"dloc"},vAF={odW:"u",JdA:"cl",faj:"k",uNA:"i",Lj_:"cr",qRQ:"m",elG:"g",J_:"up"},Edj={M4:"adPlaying",En:"onAdStateChange"},b68={HId:"nowPlaying",tyF:"onStateChange",M4:"adPlaying",En:"onAdStateChange",il:"nowPlayingShorts", M9:"onShortsStateChange"},ALH={il:"nowPlayingShorts",M9:"onShortsStateChange"};jJ.prototype.equals=function(J){return J?this.id==J.id:!1}; var UeF="",sJ=null;qjS.prototype.flush=function(J,K){J=J===void 0?[]:J;K=K===void 0?!1:K;if(g.ef("enable_client_streamz_web")){J=g.z(J);for(var n=J.next();!n.done;n=J.next())n=g.lrH(n.value),n={serializedIncrementBatch:g.Je(n.Z())},g.vJ("streamzIncremented",n,{sendIsolatedPayload:K})}}; var OJ,nFg=bag("loadCastFramework")||bag("loadCastApplicationFramework"),l0S=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.v8(Rw,g.t);g.u=Rw.prototype;g.u.Cq=function(J){this.U=arguments;this.G=!1;this.JH?this.X=g.jV()+this.LA:this.JH=g.Y0(this.C,this.LA)}; g.u.stop=function(){this.JH&&(g.qp.clearTimeout(this.JH),this.JH=null);this.X=null;this.G=!1;this.U=[]}; g.u.pause=function(){++this.Z}; g.u.resume=function(){this.Z&&(--this.Z,!this.Z&&this.G&&(this.G=!1,this.N.apply(null,this.U)))}; g.u.Xq=function(){this.stop();Rw.lY.Xq.call(this)}; g.u.Hz=function(){this.JH&&(g.qp.clearTimeout(this.JH),this.JH=null);this.X?(this.JH=g.Y0(this.C,this.X-g.jV()),this.X=null):this.Z?this.G=!0:(this.G=!1,this.N.apply(null,this.U))};uv.prototype.stringify=function(J){return g.qp.JSON.stringify(J,void 0)}; uv.prototype.parse=function(J){return g.qp.JSON.parse(J,void 0)};g.v8(jVz,g.bh);g.v8(VIF,g.bh);var hFF=null;g.v8(QVS,g.bh);g.v8($tm,g.bh);g.v8(S1m,g.bh);PT.prototype.debug=function(){}; PT.prototype.info=function(){}; PT.prototype.warning=function(){};var eFV={},uKj={};g.u=Iw.prototype;g.u.setTimeout=function(J){this.Fq=J}; g.u.k0=function(J){J=J.target;var K=this.fv;K&&g.q7(J)==3?K.Hk():this.yq(J)}; g.u.yq=function(J){try{if(J==this.G)a:{var K=g.q7(this.G),n=this.G.Z,X=this.G.getStatus();if(!(K<3)&&(K!=3||this.G&&(this.Z.Z||g.bg(this.G)||g.AU(this.G)))){this.PW||K!=4||n==7||(n==8||X<=0?eJ(3):eJ(2));PuH(this);var l=this.G.getStatus();this.vW=l;var x=RFm(this);if(this.N=l==200){if(this.Gi&&!this.kF){b:{if(this.G){var V=g.M7(this.G,"X-HTTP-Initial-Response");if(V&&!g.O7(V)){var v=V;break b}}v=null}if(J=v)this.kF=!0,dtz(this,J);else{this.N=!1;this.C=3;zg(12);BT(this);mP(this);break a}}if(this.MQ){J= !0;for(var Q;!this.PW&&this.W0&&!this.iR&&(this.iR=!0,this.X.cK(this)):(BT(this),mP(this))}else dtz(this,x);K==4&&BT(this);this.N&&!this.PW&&(K==4?I0V(this.X,this):(this.N=!1,iv(this)))}else g.mdd(this.G),l==400&&x.indexOf("Unknown SID")> 0?(this.C=3,zg(12)):(this.C=0,zg(13)),BT(this),mP(this)}}}catch(S){}finally{}}; g.u.cancel=function(){this.PW=!0;BT(this)}; g.u.JC=function(){this.GA=null;var J=Date.now();J-this.md>=0?(this.Cv!=2&&(eJ(3),zg(17)),BT(this),this.C=2,mP(this)):wBG(this,this.md-J)}; g.u.getLastError=function(){return this.C}; g.u.Wr=function(){return this.G};gFz.prototype.cancel=function(){this.X=Y1V(this);if(this.Z)this.Z.cancel(),this.Z=null;else if(this.G&&this.G.size!==0){for(var J=g.z(this.G.values()),K=J.next();!K.done;K=J.next())K.value.cancel();this.G.clear()}};g.u=Z00.prototype;g.u.gw=8;g.u.Y7=1;g.u.connect=function(J,K,n,X){zg(0);this.o5=J;this.PW=K||{};n&&X!==void 0&&(this.PW.OSID=n,this.PW.OAID=X);this.kF=this.wN;this.j_=LGz(this,null,this.o5);D9(this)}; g.u.disconnect=function(){WGj(this);if(this.Y7==3){var J=this.gQ++,K=this.j_.clone();g.Q1(K,"SID",this.U);g.Q1(K,"RID",J);g.Q1(K,"TYPE","terminate");g8(this,K);J=new Iw(this,this.U,J);J.Cv=2;J.L=NZ(K.clone());K=!1;if(g.qp.navigator&&g.qp.navigator.sendBeacon)try{K=g.qp.navigator.sendBeacon(J.L.toString(),"")}catch(n){}!K&&g.qp.Image&&((new Image).src=J.L,K=!0);K||(J.G=O0j(J.X,null),J.G.send(J.L));J.Aj=Date.now();iv(J)}A_u(this)}; g.u.Kl=function(){return this.Y7==0}; g.u.getState=function(){return this.Y7}; g.u.Fe=function(J){if(this.N)if(this.N=null,this.Y7==1){if(!J){this.gQ=Math.floor(Math.random()*1E5);J=this.gQ++;var K=new Iw(this,"",J),n=this.K;this.vW&&(n?(n=g.Ku(n),g.oi(n,this.vW)):n=this.vW);this.W!==null||this.md||(K.j_=n,n=null);var X;if(this.Dm)a:{for(var l=X=0;l4096){X=l;break a}if(X===4096||l===this.X.length-1){X=l+1;break a}}X= 1E3}else X=1E3;X=q1V(this,K,X);l=this.j_.clone();g.Q1(l,"RID",J);g.Q1(l,"CVER",22);this.MQ&&g.Q1(l,"X-HTTP-Session-Id",this.MQ);g8(this,l);n&&(this.md?X="headers="+g.rs(g.qW8(n))+"&"+X:this.W&&g.sX(l,this.W,n));pBG(this.Z,K);this.J7&&g.Q1(l,"TYPE","init");this.Dm?(g.Q1(l,"$req",X),g.Q1(l,"SID","null"),K.Gi=!0,Cu0(K,l,null)):Cu0(K,l,X);this.Y7=2}}else this.Y7==3&&(J?EFO(this,J):this.X.length==0||c_8(this.Z)||EFO(this))}; g.u.II=function(){this.L=null;b0G(this);if(this.fU&&!(this.Fq||this.G==null||this.x4<=0)){var J=2*this.x4;this.cW=w8((0,g.XS)(this.Ldx,this),J)}}; g.u.Ldx=function(){this.cW&&(this.cW=null,this.kF=!1,this.Fq=!0,zg(10),Lq(this),b0G(this))}; g.u.cK=function(J){this.G==J&&this.fU&&!this.Fq&&(f0m(this),this.Fq=!0,zg(11))}; g.u.R_=function(){this.GA!=null&&(this.GA=null,Lq(this),B1r(this),zg(19))}; g.u.Jom=function(J){J?zg(2):zg(1)}; g.u.isActive=function(){return!!this.C&&this.C.isActive(this)}; g.u=N1O.prototype;g.u.zV=function(){}; g.u.YJ=function(){}; g.u.S6=function(){}; g.u.La=function(){}; g.u.isActive=function(){return!0}; g.u.Wz=function(){};g.v8(Yy,g.S9);Yy.prototype.open=function(){this.G.C=this.X;this.N&&(this.G.Cv=!0);this.G.connect(this.C,this.Z||void 0)}; Yy.prototype.close=function(){this.G.disconnect()}; Yy.prototype.send=function(J){var K=this.G;if(typeof J==="string"){var n={};n.__data__=J;J=n}else this.U&&(n={},n.__data__=g.yH(J),J=n);K.X.push(new kBS(K.CH++,J));K.Y7==3&&D9(K)}; Yy.prototype.Xq=function(){this.G.C=null;delete this.X;this.G.disconnect();delete this.G;Yy.lY.Xq.call(this)}; g.v8(KAz,jVz);g.v8(ndm,VIF);g.v8(cT,N1O);cT.prototype.zV=function(){this.G.dispatchEvent("m")}; cT.prototype.YJ=function(J){this.G.dispatchEvent(new KAz(J))}; cT.prototype.S6=function(J){this.G.dispatchEvent(new ndm(J))}; cT.prototype.La=function(){this.G.dispatchEvent("n")};var UJ=new g.S9;g.e(lAn,g.bh);g.u=yi.prototype;g.u.je=null;g.u.l3=!1;g.u.yd=null;g.u.kD=null;g.u.GM=null;g.u.UH=null;g.u.Ke=null;g.u.qZ=null;g.u.P5=null;g.u.Au=null;g.u.Bk=0;g.u.CZ=null;g.u.j8=null;g.u.B5=null;g.u.lQ=-1;g.u.oS=!0;g.u.vu=!1;g.u.JQ=0;g.u.MZ=null;var QBu={},vdO={};g.u=yi.prototype;g.u.setTimeout=function(J){this.Z=J}; g.u.eJ=function(J){J=J.target;var K=this.MZ;K&&g.q7(J)==3?K.Hk():this.Oc(J)}; g.u.Oc=function(J){try{if(J==this.Au)a:{var K=g.q7(this.Au),n=this.Au.Z,X=this.Au.getStatus();if(g.qE&&!g.iB("420+")){if(K<4)break a}else if(K<3||K==3&&!g.bg(this.Au))break a;this.vu||K!=4||n==7||(n==8||X<=0?this.G.xf(3):this.G.xf(2));rL0(this);var l=this.Au.getStatus();this.lQ=l;var x=g.bg(this.Au);if(this.l3=l==200){K==4&&Z9(this);if(this.MQ){for(J=!0;!this.vu&&this.Bk0?(this.B5=3,tW(13)):(this.B5=0,tW(14)),Z9(this),sBG(this)}}catch(v){}finally{}}; g.u.cancel=function(){this.vu=!0;Z9(this)}; g.u.tC=function(){this.yd=null;var J=Date.now();J-this.kD>=0?(this.UH!=2&&this.G.xf(3),Z9(this),this.B5=2,tW(18),sBG(this)):S6V(this,this.kD-J)}; g.u.getLastError=function(){return this.B5};g.u=RtS.prototype;g.u.WS=null;g.u.hL=null;g.u.zf=!1;g.u.eD=null;g.u.Dz=null;g.u.qc=-1;g.u.Pk=null;g.u.S7=null;g.u.connect=function(J){this.eD=J;J=WT(this.G,null,this.eD);tW(3);Date.now();var K=this.G.K;K!=null?(this.Pk=K[0],(this.S7=K[1])?(this.Dz=1,uzG(this)):(this.Dz=2,etr(this))):(JW(J,"MODE","init"),this.hL=new yi(this),this.hL.je=this.WS,Vk0(this.hL,J,!1,null,!0),this.Dz=0)}; g.u.Ex=function(J){if(J)this.Dz=2,etr(this);else{tW(4);var K=this.G;K.Hs=K.b3.qc;EJ(K,9)}J&&this.xf(2)}; g.u.Rv=function(J){return this.G.Rv(J)}; g.u.abort=function(){this.hL&&(this.hL.cancel(),this.hL=null);this.qc=-1}; g.u.Kl=function(){return!1}; g.u.D7=function(J,K){this.qc=J.lQ;if(this.Dz==0)if(K){try{var n=this.Z.parse(K)}catch(X){J=this.G;J.Hs=this.qc;EJ(J,2);return}this.Pk=n[0];this.S7=n[1]}else J=this.G,J.Hs=this.qc,EJ(J,2);else this.Dz==2&&(this.zf?(tW(7),Date.now()):K=="11111"?(tW(6),this.zf=!0,Date.now(),this.qc=200,this.hL.cancel(),tW(12),aw(this.G,this,!0)):(tW(8),Date.now(),this.zf=!1))}; g.u.tQ=function(){this.qc=this.hL.lQ;if(this.hL.l3)this.Dz==0?this.S7?(this.Dz=1,uzG(this)):(this.Dz=2,etr(this)):this.Dz==2&&(this.zf?(tW(12),aw(this.G,this,!0)):(tW(11),aw(this.G,this,!1)));else{this.Dz==0?tW(9):this.Dz==2&&tW(10);var J=this.G;this.hL.getLastError();J.Hs=this.qc;EJ(J,2)}}; g.u.QM=function(){return this.G.QM()}; g.u.isActive=function(){return this.G.isActive()}; g.u.xf=function(J){this.G.xf(J)};g.u=ztG.prototype;g.u.KI=null;g.u.pu=null;g.u.nL=null;g.u.XH=null;g.u.TC=null;g.u.oL=null;g.u.Ka=null;g.u.VF=null;g.u.ZR=0;g.u.TX=0;g.u.mC=null;g.u.dJ=null;g.u.bu=null;g.u.CG=null;g.u.b3=null;g.u.AQ=null;g.u.FD=-1;g.u.vl=-1;g.u.Hs=-1;g.u.Ie=0;g.u.sG=0;g.u.oJ=8;var C2z={OK:0,iyQ:2,lzA:4,JLM:5,P$4:6,STOP:7,n7:8,iAM:9,Ad_:10,n6q:11,c8d:12};g.v8(Ptg,g.bh);g.v8(IAS,g.bh);g.u=ztG.prototype; g.u.connect=function(J,K,n,X,l){tW(0);this.TC=K;this.pu=n||{};X&&l!==void 0&&(this.pu.OSID=X,this.pu.OAID=l);this.L?(Gg((0,g.XS)(this.u6,this,J),100),B2F(this)):this.u6(J)}; g.u.disconnect=function(){mHz(this);if(this.G==3){var J=this.ZR++,K=this.oL.clone();g.Q1(K,"SID",this.U);g.Q1(K,"RID",J);g.Q1(K,"TYPE","terminate");qN(this,K);J=new yi(this,this.U,J);J.UH=2;J.Ke=NZ(K.clone());(new Image).src=J.Ke.toString();J.GM=Date.now();htj(J)}GpO(this)}; g.u.u6=function(J){this.b3=new RtS(this);this.b3.WS=this.KI;this.b3.Z=this.C;this.b3.connect(J)}; g.u.Kl=function(){return this.G==0}; g.u.getState=function(){return this.G}; g.u.d1=function(J){this.dJ=null;dHF(this,J)}; g.u.lL=function(){this.bu=null;this.XH=new yi(this,this.U,"rpc",this.W);this.XH.je=this.KI;this.XH.JQ=0;var J=this.Ka.clone();g.Q1(J,"RID","rpc");g.Q1(J,"SID",this.U);g.Q1(J,"CI",this.AQ?"0":"1");g.Q1(J,"AID",this.FD);qN(this,J);g.Q1(J,"TYPE","xmlhttp");Vk0(this.XH,J,!0,this.VF,!1)}; g.u.D7=function(J,K){if(this.G!=0&&(this.XH==J||this.nL==J))if(this.Hs=J.lQ,this.nL==J&&this.G==3)if(this.oJ>7){try{var n=this.C.parse(K)}catch(X){n=null}if(Array.isArray(n)&&n.length==3)if(J=n,J[0]==0)a:{if(!this.bu){if(this.XH)if(this.XH.GM+3E30)){if(X=K==1)this.nL||this.dJ||this.G==1||this.Ie>=2?X=!1:(this.dJ=Gg((0,g.XS)(this.d1,this,J),gdn(this,this.Ie)),this.Ie++, X=!0);X=!(X||K==2&&cLz(this))}if(X)switch(n){case 1:EJ(this,5);break;case 4:EJ(this,10);break;case 3:EJ(this,6);break;case 7:EJ(this,12);break;default:EJ(this,2)}}}; g.u.V6=function(J){if(!g.O0(arguments,this.G))throw Error("Unexpected channel state: "+this.G);}; g.u.Hl4=function(J){J?tW(2):(tW(1),Y6r(this,8))}; g.u.Rv=function(J){if(J)throw Error("Can't create secondary domain capable XhrIo object.");J=new g.WV;J.W=!1;return J}; g.u.isActive=function(){return!!this.mC&&this.mC.isActive(this)}; g.u.xf=function(J){var K=UJ;K.dispatchEvent(new IAS(K,J))}; g.u.QM=function(){return!1}; g.u=UHm.prototype;g.u.pk=function(){}; g.u.Qp=function(){}; g.u.Ze=function(){}; g.u.Ga=function(){}; g.u.wF=function(){}; g.u.hR=function(){return{}}; g.u.isActive=function(){return!0};g.u=tkz.prototype;g.u.enqueue=function(J){this.Z.push(J)}; g.u.isEmpty=function(){return this.G.length===0&&this.Z.length===0}; g.u.clear=function(){this.G=[];this.Z=[]}; g.u.contains=function(J){return g.O0(this.G,J)||g.O0(this.Z,J)}; g.u.remove=function(J){var K=this.G;var n=(0,g.iUn)(K,J);n>=0?(g.H8(K,n),K=!0):K=!1;return K||g.RH(this.Z,J)}; g.u.U6=function(){for(var J=[],K=this.G.length-1;K>=0;--K)J.push(this.G[K]);K=this.Z.length;for(var n=0;n=OZF.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(J=OZF[this.Z],this.JH=g.Ca((0,g.XS)(this.IA,this),J),this.Z++):this.publish("pairingFailed",Error("Server error "+J.status))}; g.u.s9=function(){this.G=null;this.publish("pairingFailed",Error("Server not responding"))}; var OZF=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.v8(V6,xs);g.u=V6.prototype;g.u.start=function(){jN(this)&&this.publish("screenChange");!g.g1("yt-remote-lounge-token-expiration")&&e2G(this);g.Ha(this.G);this.G=g.Ca((0,g.XS)(this.start,this),1E4)}; g.u.add=function(J,K){jN(this);OMF(this,J);hH(this,!1);this.publish("screenChange");K(J);J.token||e2G(this)}; g.u.remove=function(J,K){var n=jN(this);R20(this,J)&&(hH(this,!1),n=!0);K(J);n&&this.publish("screenChange")}; g.u.Xn=function(J,K,n,X){var l=jN(this),x=this.get(J.id);x?(x.name!=K&&(x.name=K,hH(this,!1),l=!0),n(J)):X(Error("no such local screen."));l&&this.publish("screenChange")}; g.u.Xq=function(){g.Ha(this.G);V6.lY.Xq.call(this)}; g.u.T6=function(J){jN(this);var K=this.screens.length;J=J&&J.screens||[];for(var n=J.length,X=0;X20)break a;v=K(x,V)}x=v}l.name=x}n($s(this,l))},this), onError:(0,g.XS)(function(l){X(Error("pairing request failed: "+l.status))},this), onTimeout:(0,g.XS)(function(){X(Error("pairing request timed out."))},this)})}; g.u.Xq=function(){g.QD(this.Z);g.QD(this.G);Q6.lY.Xq.call(this)}; g.u.Sd=function(){doO(this);this.publish("screenChange");this.G.update()}; Q6.prototype.dispose=Q6.prototype.dispose;g.v8(SN,g.hi);g.u=SN.prototype;g.u.kT=function(J){this.o4()||(J&&(sq(this,""+J),this.publish("sessionFailed")),this.G=null,this.publish("sessionScreen",null))}; g.u.info=function(J){Kr(this.MQ,J)}; g.u.AR=function(){return null}; g.u.GI=function(J){var K=this.Z;J?(K.displayStatus=new chrome.cast.ReceiverDisplayStatus(J,[]),K.displayStatus.showStop=!0):K.displayStatus=null;chrome.cast.setReceiverDisplayStatus(K,(0,g.XS)(function(){this.info("Updated receiver status for "+K.friendlyName+": "+J)},this),(0,g.XS)(function(){sq(this,"Failed to update receiver status for: "+K.friendlyName)},this))}; g.u.Xq=function(){this.GI("");SN.lY.Xq.call(this)};g.e(Cr,SN);g.u=Cr.prototype;g.u.l7=function(J){if(this.X){if(this.X==J)return;sq(this,"Overriding cast session with new session object");aYG(this);this.Aj=!1;this.K="unknown";this.X.removeUpdateListener(this.QG);this.X.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.cW)}this.X=J;this.X.addUpdateListener(this.QG);this.X.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.cW);tDm(this,"getMdxSessionStatus")}; g.u.wv=function(J){this.info("launchWithParams no-op for Cast: "+g.yH(J))}; g.u.stop=function(){this.X?this.X.stop((0,g.XS)(function(){this.kT()},this),(0,g.XS)(function(){this.kT(Error("Failed to stop receiver app."))},this)):this.kT(Error("Stopping cast device without session."))}; g.u.GI=function(){}; g.u.Xq=function(){this.info("disposeInternal");aYG(this);this.X&&(this.X.removeUpdateListener(this.QG),this.X.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.cW));this.X=null;SN.prototype.Xq.call(this)}; g.u.RHj=function(J,K){if(!this.o4())if(K)if(K=Kq(K),g.Kn(K))switch(J=""+K.type,K=K.data||{},this.info("onYoutubeMessage_: "+J+" "+g.yH(K)),J){case "mdxSessionStatus":YSO(this,K);break;case "loungeToken":yEr(this,K);break;default:sq(this,"Unknown youtube message: "+J)}else sq(this,"Unable to parse message.");else sq(this,"No data in message.")}; g.u.Jr=function(J,K,n,X){g.Ha(this.L);this.L=0;L2m(this.U,this.Z.label,J,this.Z.friendlyName,(0,g.XS)(function(l){l?K(l):X>=0?(sq(this,"Screen "+J+" appears to be offline. "+X+" retries left."),this.L=g.Ca((0,g.XS)(this.Jr,this,J,K,n,X-1),300)):n(Error("Unable to fetch screen."))},this),n)}; g.u.AR=function(){return this.X}; g.u.FJ=function(J){this.o4()||J||(sq(this,"Cast session died."),this.kT())};g.e(Oq,SN);g.u=Oq.prototype;g.u.l7=function(J){this.X=J;this.X.addUpdateListener(this.PW)}; g.u.wv=function(J){this.j_=J;this.GA()}; g.u.stop=function(){Jaj(this);this.X?this.X.stop((0,g.XS)(this.kT,this,null),(0,g.XS)(this.kT,this,"Failed to stop DIAL device.")):this.kT()}; g.u.Xq=function(){Jaj(this);this.X&&this.X.removeUpdateListener(this.PW);this.X=null;SN.prototype.Xq.call(this)}; g.u.Lq=function(J){this.o4()||J||(sq(this,"DIAL session died."),this.C(),this.C=function(){},this.kT())};g.e(u4,SN);u4.prototype.stop=function(){this.kT()}; u4.prototype.l7=function(){}; u4.prototype.wv=function(){g.Ha(this.X);this.X=NaN;var J=Qi(this.U.oE(),this.Z.label);J?rC(this,J):this.kT(Error("No such screen"))}; u4.prototype.Xq=function(){g.Ha(this.X);this.X=NaN;SN.prototype.Xq.call(this)};g.e(eN,g.hi);g.u=eN.prototype; g.u.init=function(J,K){chrome.cast.timeout.requestSession=3E4;var n=new chrome.cast.SessionRequest(this.L,[chrome.cast.Capability.AUDIO_OUT]);g.ef("desktop_enable_cast_connect")&&(n.androidReceiverCompatible=!0);this.K||(n.dialRequest=new chrome.cast.DialRequest("YouTube"));var X=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;J=J||this.N?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var l=(0,g.XS)(this.TRv,this);n=new chrome.cast.ApiConfig(n,(0,g.XS)(this.ue, this),l,X,J);n.customDialLaunchCallback=(0,g.XS)(this.ZUQ,this);chrome.cast.initialize(n,(0,g.XS)(function(){this.o4()||(chrome.cast.addReceiverActionListener(this.C),SSS(),this.Z.subscribe("onlineScreenChange",(0,g.XS)(this.uL,this)),this.X=o4g(this),chrome.cast.setCustomReceivers(this.X,function(){},(0,g.XS)(function(x){this.Ek("Failed to set initial custom receivers: "+g.yH(x))},this)),this.publish("yt-remote-cast2-availability-change",wC(this)),K(!0))},this),(0,g.XS)(function(x){this.Ek("Failed to initialize API: "+ g.yH(x)); K(!1)},this))}; g.u.FV_=function(J,K){zw("Setting connected screen ID: "+J+" -> "+K);if(this.G){var n=this.G.G;if(!J||n&&n.id!=J)zw("Unsetting old screen status: "+this.G.Z.friendlyName),Pw(this,null)}if(J&&K){if(!this.G){J=Qi(this.Z.oE(),J);if(!J){zw("setConnectedScreenStatus: Unknown screen.");return}if(J.idType=="shortLived"){zw("setConnectedScreenStatus: Screen with id type to be short lived.");return}n=KIz(this,J);n||(zw("setConnectedScreenStatus: Connected receiver not custom..."),n=new chrome.cast.Receiver(J.uuid? J.uuid:J.id,J.name),n.receiverType=chrome.cast.ReceiverType.CUSTOM,this.X.push(n),chrome.cast.setCustomReceivers(this.X,function(){},(0,g.XS)(function(X){this.Ek("Failed to set initial custom receivers: "+g.yH(X))},this))); zw("setConnectedScreenStatus: new active receiver: "+n.friendlyName);Pw(this,new u4(this.Z,n),!0)}this.G.GI(K)}else zw("setConnectedScreenStatus: no screen.")}; g.u.mkq=function(J){this.o4()?this.Ek("Setting connection data on disposed cast v2"):this.G?this.G.wv(J):this.Ek("Setting connection data without a session")}; g.u.Y0=function(){this.o4()?this.Ek("Stopping session on disposed cast v2"):this.G?(this.G.stop(),Pw(this,null)):zw("Stopping non-existing session")}; g.u.requestSession=function(){chrome.cast.requestSession((0,g.XS)(this.ue,this),(0,g.XS)(this.Q9A,this))}; g.u.Xq=function(){this.Z.unsubscribe("onlineScreenChange",(0,g.XS)(this.uL,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var J=vbj,K=g.bF("yt.mdx.remote.debug.handlers_");g.RH(K||[],J);g.QD(this.G);g.hi.prototype.Xq.call(this)}; g.u.Ek=function(J){Kr("Controller",J)}; g.u.ET=function(J,K){this.G==J&&(K||Pw(this,null),this.publish("yt-remote-cast2-session-change",K))}; g.u.th5=function(J,K){if(!this.o4())if(J)switch(J.friendlyName=chrome.cast.unescape(J.friendlyName),zw("onReceiverAction_ "+J.label+" / "+J.friendlyName+"-- "+K),K){case chrome.cast.ReceiverAction.CAST:if(this.G)if(this.G.Z.label!=J.label)zw("onReceiverAction_: Stopping active receiver: "+this.G.Z.friendlyName),this.G.stop();else{zw("onReceiverAction_: Casting to active receiver.");this.G.G&&this.publish("yt-remote-cast2-session-change",this.G.G);break}switch(J.receiverType){case chrome.cast.ReceiverType.CUSTOM:Pw(this, new u4(this.Z,J));break;case chrome.cast.ReceiverType.DIAL:Pw(this,new Oq(this.Z,J,this.U,this.config_));break;case chrome.cast.ReceiverType.CAST:Pw(this,new Cr(this.Z,J,this.config_));break;default:this.Ek("Unknown receiver type: "+J.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.G&&this.G.Z.label==J.label?this.G.stop():this.Ek("Stopping receiver w/o session: "+J.friendlyName)}else this.Ek("onReceiverAction_ called without receiver.")}; g.u.ZUQ=function(J){if(this.o4())return Promise.reject(Error("disposed"));var K=J.receiver;K.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Ek("Not DIAL receiver: "+K.friendlyName),K.receiverType=chrome.cast.ReceiverType.DIAL);var n=this.G?this.G.Z:null;if(!n||n.label!=K.label)return this.Ek("Receiving DIAL launch request for non-clicked DIAL receiver: "+K.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(n&&n.label==K.label&&n.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.G.G)return zw("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.G.G),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Ek('Changing CAST intent from "'+n.receiverType+'" to "dial" for '+K.friendlyName);Pw(this,new Oq(this.Z,K,this.U,this.config_))}K=this.G;K.L=J;K.L.appState==chrome.cast.DialAppState.RUNNING?(J=K.L.extraData||{},n=J.screenId||null,Hw(K)&&J.loungeToken?J.loungeTokenRefreshIntervalMs?J=AEz(K,{name:K.Z.friendlyName,screenId:J.screenId,loungeToken:J.loungeToken,dialId:K.L.receiver.label, screenIdType:"shortLived"},J.loungeTokenRefreshIntervalMs):(g.MM(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(J)+".")),J=MDF(K,n)):J=MDF(K,n)):J=Ebr(K);return J}; g.u.ue=function(J){var K=this;if(!this.o4()&&!this.N){zw("New cast session ID: "+J.sessionId);var n=J.receiver;if(n.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.G)if(n.receiverType==chrome.cast.ReceiverType.CAST)zw("Got resumed cast session before resumed mdx connection."),n.friendlyName=chrome.cast.unescape(n.friendlyName),Pw(this,new Cr(this.Z,n,this.config_),!0);else{this.Ek("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var X=this.G.Z,l=Qi(this.Z.oE(), X.label);l&&hW(l,n.label)&&X.receiverType!=chrome.cast.ReceiverType.CAST&&n.receiverType==chrome.cast.ReceiverType.CAST&&(zw("onSessionEstablished_: manual to cast session change "+n.friendlyName),g.QD(this.G),this.G=new Cr(this.Z,n,this.config_),this.G.subscribe("sessionScreen",(0,g.XS)(this.ET,this,this.G)),this.G.subscribe("sessionFailed",function(){return n4n(K,K.G)}),this.G.wv(null)); this.G.l7(J)}}}; g.u.SJ=function(){return this.G?this.G.AR():null}; g.u.Q9A=function(J){this.o4()||(this.Ek("Failed to estabilish a session: "+g.yH(J)),J.code!=chrome.cast.ErrorCode.CANCEL&&Pw(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.u.TRv=function(J){zw("Receiver availability updated: "+J);if(!this.o4()){var K=wC(this);this.W=J==chrome.cast.ReceiverAvailability.AVAILABLE;wC(this)!=K&&this.publish("yt-remote-cast2-availability-change",wC(this))}}; g.u.uL=function(){this.o4()||(this.X=o4g(this),zw("Updating custom receivers: "+g.yH(this.X)),chrome.cast.setCustomReceivers(this.X,function(){},(0,g.XS)(function(){this.Ek("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",wC(this)))}; eN.prototype.setLaunchParams=eN.prototype.mkq;eN.prototype.setConnectedScreenStatus=eN.prototype.FV_;eN.prototype.stopSession=eN.prototype.Y0;eN.prototype.getCastSession=eN.prototype.SJ;eN.prototype.requestSession=eN.prototype.requestSession;eN.prototype.init=eN.prototype.init;eN.prototype.dispose=eN.prototype.dispose;var $Dz=[];g.u=Tw.prototype; g.u.reset=function(J){this.listId="";this.index=-1;this.videoId="";HEF(this);this.volume=-1;this.muted=!1;J&&(this.index=J.index,this.listId=J.listId,this.videoId=J.videoId,this.playerState=J.playerState,this.volume=J.volume,this.muted=J.muted,this.audioTrackId=J.audioTrackId,this.trackData=J.trackData,this.p$=J.hasPrevious,this.kL=J.hasNext,this.N=J.playerTime,this.C=J.playerTimeAt,this.Z=J.seekableStart,this.W=J.seekableEnd,this.X=J.duration,this.L=J.loadedTime,this.G=J.liveIngestionTime,this.U= !isNaN(this.G))}; g.u.isPlaying=function(){return this.playerState==1}; g.u.isBuffering=function(){return this.playerState==3}; g.u.BR=function(){return this.playerState==1081}; g.u.yL=function(J){this.X=isNaN(J)?0:J}; g.u.getDuration=function(){return this.U?this.X+DJ(this):this.X}; g.u.clone=function(){return new Tw(uPu(this))};g.e(Ys,g.hi);g.u=Ys.prototype;g.u.getState=function(){return this.X}; g.u.gJ=function(){return this.U.getReconnectTimeout()}; g.u.hU=function(){this.U.reconnect()}; g.u.play=function(){Uq(this)?(this.G?this.G.play(null,g.S5,fr(this,"play")):ZJ(this,"play"),wCj(this,1,ks(Gw(this))),this.publish("remotePlayerChange")):tH(this,this.play)}; g.u.pause=function(){Uq(this)?(this.G?this.G.pause(null,g.S5,fr(this,"pause")):ZJ(this,"pause"),wCj(this,2,ks(Gw(this))),this.publish("remotePlayerChange")):tH(this,this.pause)}; g.u.seekTo=function(J){if(Uq(this)){if(this.G){var K=Gw(this),n=new chrome.cast.media.SeekRequest;n.currentTime=J;K.isPlaying()||K.isBuffering()?n.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:n.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.G.seek(n,g.S5,fr(this,"seekTo",{newTime:J}))}else ZJ(this,"seekTo",{newTime:J});wCj(this,3,J);this.publish("remotePlayerChange")}else tH(this,g.xr(this.seekTo,J))}; g.u.stop=function(){if(Uq(this)){this.G?this.G.stop(null,g.S5,fr(this,"stopVideo")):ZJ(this,"stopVideo");var J=Gw(this);J.index=-1;J.videoId="";HEF(J);y6(this,J);this.publish("remotePlayerChange")}else tH(this,this.stop)}; g.u.setVolume=function(J,K){if(Uq(this)){var n=Gw(this);if(this.Z){if(n.volume!=J){var X=Math.round(J)/100;this.Z.setReceiverVolumeLevel(X,(0,g.XS)(function(){nr("set receiver volume: "+X)},this),(0,g.XS)(function(){this.Ek("failed to set receiver volume.")},this))}n.muted!=K&&this.Z.setReceiverMuted(K,(0,g.XS)(function(){nr("set receiver muted: "+K)},this),(0,g.XS)(function(){this.Ek("failed to set receiver muted.")},this))}else{var l={volume:J, muted:K};n.volume!=-1&&(l.delta=J-n.volume);ZJ(this,"setVolume",l)}n.muted=K;n.volume=J;y6(this,n)}else tH(this,g.xr(this.setVolume,J,K))}; g.u.nk=function(J,K){if(Uq(this)){var n=Gw(this);J={videoId:J};K&&(n.trackData={trackName:K.name,languageCode:K.languageCode,sourceLanguageCode:K.translationLanguage?K.translationLanguage.languageCode:"",languageName:K.languageName,kind:K.kind},J.style=g.yH(K.style),g.oi(J,n.trackData));ZJ(this,"setSubtitlesTrack",J);y6(this,n)}else tH(this,g.xr(this.nk,J,K))}; g.u.setAudioTrack=function(J,K){Uq(this)?(K=K.getLanguageInfo().getId(),ZJ(this,"setAudioTrack",{videoId:J,audioTrackId:K}),J=Gw(this),J.audioTrackId=K,y6(this,J)):tH(this,g.xr(this.setAudioTrack,J,K))}; g.u.playVideo=function(J,K,n,X,l,x,V){X=X===void 0?null:X;l=l===void 0?null:l;x=x===void 0?null:x;V=V===void 0?null:V;var v=Gw(this),Q={videoId:J};n!==void 0&&(Q.currentIndex=n);gC(v,J,n||0);K!==void 0&&(dC(v,K),Q.currentTime=K);X&&(Q.listId=X);l&&(Q.playerParams=l);x&&(Q.clickTrackingParams=x);V&&(Q.locationInfo=g.yH(V));ZJ(this,"setPlaylist",Q);X||y6(this,v)}; g.u.sz=function(J,K){if(Uq(this)){if(J&&K){var n=Gw(this);gC(n,J,K);y6(this,n)}ZJ(this,"previous")}else tH(this,g.xr(this.sz,J,K))}; g.u.nextVideo=function(J,K){if(Uq(this)){if(J&&K){var n=Gw(this);gC(n,J,K);y6(this,n)}ZJ(this,"next")}else tH(this,g.xr(this.nextVideo,J,K))}; g.u.Yq=function(){if(Uq(this)){ZJ(this,"clearPlaylist");var J=Gw(this);J.reset();y6(this,J);this.publish("remotePlayerChange")}else tH(this,this.Yq)}; g.u.kz=function(){Uq(this)?ZJ(this,"dismissAutoplay"):tH(this,this.kz)}; g.u.dispose=function(){if(this.X!=3){var J=this.X;this.X=3;this.publish("proxyStateChange",J,this.X)}g.hi.prototype.dispose.call(this)}; g.u.Xq=function(){zsz(this);this.U=null;this.C.clear();cw(this,null);g.hi.prototype.Xq.call(this)}; g.u.hG=function(J){if((J!=this.X||J==2)&&this.X!=3&&J!=0){var K=this.X;this.X=J;this.publish("proxyStateChange",K,J);if(J==1)for(;!this.C.isEmpty();)K=J=this.C,K.G.length===0&&(K.G=K.Z,K.G.reverse(),K.Z=[]),J.G.pop().apply(this);else J==3&&this.dispose()}}; g.u.k4F=function(J,K){this.publish(J,K)}; g.u.z5F=function(J){if(!J)this.qL(null),cw(this,null);else if(this.Z.receiver.volume){J=this.Z.receiver.volume;var K=Gw(this),n=Math.round(100*J.level||0);if(K.volume!=n||K.muted!=J.muted)nr("Cast volume update: "+J.level+(J.muted?" muted":"")),K.volume=n,K.muted=!!J.muted,y6(this,K)}}; g.u.qL=function(J){nr("Cast media: "+!!J);this.G&&this.G.removeUpdateListener(this.L);if(this.G=J)this.G.addUpdateListener(this.L),PNV(this),this.publish("remotePlayerChange")}; g.u.mQd=function(J){J?(PNV(this),this.publish("remotePlayerChange")):this.qL(null)}; g.u.Vl=function(){ZJ(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.u.DQ5=function(){var J=snH();J&&cw(this,J)}; g.u.Ek=function(J){Kr("CP",J)};g.e(Fu,g.hi);g.u=Fu.prototype; g.u.connect=function(J,K){if(K){var n=K.listId,X=K.videoId,l=K.videoIds,x=K.playerParams,V=K.clickTrackingParams,v=K.index,Q={videoId:X},S=K.currentTime,r=K.locationInfo;K=K.loopMode;S!==void 0&&(Q.currentTime=S<=5?0:S);x&&(Q.playerParams=x);r&&(Q.locationInfo=r);V&&(Q.clickTrackingParams=V);n&&(Q.listId=n);l&&l.length>0&&(Q.videoIds=l.join(","));v!==void 0&&(Q.currentIndex=v);this.PW&&(Q.loopMode=K||"LOOP_MODE_OFF");n&&(this.G.listId=n);this.G.videoId=X;this.G.index=v||0;this.G.state=3;dC(this.G, S);this.C="UNSUPPORTED";n=this.PW?"setInitialState":"setPlaylist";Ww("Connecting with "+n+" and params: "+g.yH(Q));this.Z.connect({method:n,params:g.yH(Q)},J,y2O())}else Ww("Connecting without params"),this.Z.connect({},J,y2O());mDS(this)}; g.u.WL=function(J){this.Z.WL(J)}; g.u.dispose=function(){this.o4()||(g.Ed("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),aE(this,3));g.hi.prototype.dispose.call(this)}; g.u.Xq=function(){pCO(this);TVS(this);LIH(this);g.Ha(this.L);this.L=NaN;g.Ha(this.K);this.K=NaN;this.U=null;g.PB(this.GA);this.GA.length=0;this.Z.dispose();g.hi.prototype.Xq.call(this);this.C=this.W=this.X=this.G=this.Z=null}; g.u.Pj=function(J){if(!this.X||this.X.length===0)return!1;for(var K=g.z(this.X),n=K.next();!n.done;n=K.next())if(!n.value.capabilities.has(J))return!1;return!0}; g.u.rS=function(){var J=3;this.o4()||(J=0,isNaN(this.hN())?this.Z.Kr()&&isNaN(this.N)&&(J=1):J=2);return J}; g.u.CC=function(J){Ww("Disconnecting with "+J);g.Ed("yt.mdx.remote.remoteClient_",null);pCO(this);this.publish("beforeDisconnect",J);J==1&&r8();this.Z.disconnect(J);this.dispose()}; g.u.hZ=function(){var J=this.G;this.U&&(J=this.G.clone(),gC(J,this.U,J.index));return uPu(J)}; g.u.DkW=function(J){var K=this,n=new Tw(J);n.videoId&&n.videoId!=this.G.videoId&&(this.U=n.videoId,g.Ha(this.L),this.L=g.Ca(function(){if(K.U){var l=K.U;K.U=null;K.G.videoId!=l&&q_(K,"getNowPlaying")}},5E3)); var X=[];this.G.listId==n.listId&&this.G.videoId==n.videoId&&this.G.index==n.index||X.push("remoteQueueChange");this.G.playerState==n.playerState&&this.G.volume==n.volume&&this.G.muted==n.muted&&ks(this.G)==ks(n)&&g.yH(this.G.trackData)==g.yH(n.trackData)||X.push("remotePlayerChange");this.G.reset(J);g.Yr(X,function(l){this.publish(l)},this)}; g.u.BN=function(){var J=this.Z.getDeviceId(),K=g.ru(this.X,function(n){return n.type=="REMOTE_CONTROL"&&n.id!=J}); return K?K.id:""}; g.u.hN=function(){return this.Z.gJ()}; g.u.sU=function(){return this.C||"UNSUPPORTED"}; g.u.Iu=function(){return this.W||""}; g.u.mO=function(){!isNaN(this.hN())&&this.Z.hU()}; g.u.gO4=function(J,K){q_(this,J,K);dDO(this)}; g.u.iL=function(){var J=g.YA("SAPISID","")||g.YA("__Secure-1PAPISID")||"",K=g.YA("__Secure-3PAPISID","")||"";if(!J&&!K)return"";J=g.Je(g.Nu(J),2);K=g.Je(g.Nu(K),2);return g.Je(g.Nu(","+J+","+K),2)}; Fu.prototype.subscribe=Fu.prototype.subscribe;Fu.prototype.unsubscribeByKey=Fu.prototype.SK;Fu.prototype.getProxyState=Fu.prototype.rS;Fu.prototype.disconnect=Fu.prototype.CC;Fu.prototype.getPlayerContextData=Fu.prototype.hZ;Fu.prototype.setPlayerContextData=Fu.prototype.DkW;Fu.prototype.getOtherConnectedRemoteId=Fu.prototype.BN;Fu.prototype.getReconnectTimeout=Fu.prototype.hN;Fu.prototype.getAutoplayMode=Fu.prototype.sU;Fu.prototype.getAutoplayVideoId=Fu.prototype.Iu;Fu.prototype.reconnect=Fu.prototype.mO; Fu.prototype.sendMessage=Fu.prototype.gO4;Fu.prototype.getXsrfToken=Fu.prototype.iL;Fu.prototype.isCapabilitySupportedOnConnectedDevices=Fu.prototype.Pj;g.e(a$z,xs);g.u=a$z.prototype;g.u.oE=function(J){return this.cO.$_gs(J)}; g.u.contains=function(J){return!!this.cO.$_c(J)}; g.u.get=function(J){return this.cO.$_g(J)}; g.u.start=function(){this.cO.$_st()}; g.u.add=function(J,K,n){this.cO.$_a(J,K,n)}; g.u.remove=function(J,K,n){this.cO.$_r(J,K,n)}; g.u.Xn=function(J,K,n,X){this.cO.$_un(J,K,n,X)}; g.u.Xq=function(){for(var J=this.G.length,K=0;K1&&!this.B.getOption("remote","quickCast")?(this.TZ=g.GO(J,this.G,this),this.AL(g.ff(J,this.G)),J=g.U(this.B.getOption("remote","currentReceiver")),J=this.G(J),this.options[J]&&this.Oy(J),this.enable(!0)):this.enable(!1)}; rA.prototype.G=function(J){return J.key}; rA.prototype.xL=function(J){return J==="cast-selector-receiver"?"Cast...":this.TZ[J].name}; rA.prototype.x7=function(J){g.gd.prototype.x7.call(this,J);this.B.setOption("remote","currentReceiver",this.TZ[J]);this.Zv.MS()};g.e(Smm,g.CH);g.u=Smm.prototype; g.u.create=function(){var J=this.player.S(),K=g.gz(J);J={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:J.J("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:J.J("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:J.J("enable_cast_short_lived_lounge_token")};Aar(K,J);this.subscriptions.push(g.lN("yt-remote-before-disconnect",this.FdW,this));this.subscriptions.push(g.lN("yt-remote-connection-change",this.arx,this));this.subscriptions.push(g.lN("yt-remote-receiver-availability-change",this.XG, this));this.subscriptions.push(g.lN("yt-remote-auto-connect",this.Vh_,this));this.subscriptions.push(g.lN("yt-remote-receiver-resumed",this.eqm,this));this.subscriptions.push(g.lN("mdx-privacy-popup-confirm",this.Q2j,this));this.subscriptions.push(g.lN("mdx-privacy-popup-cancel",this.GnM,this));this.XG()}; g.u.load=function(){this.player.cancelPlayback();g.CH.prototype.load.call(this);this.uH=new $qV(this.player.S(),this);this.player.B_(this.uH);this.Z5=new VEr(this,this.player,this.LU);var J=(J=lxF())?J.currentTime:0;var K=nou()?new Ys(g.U(XU()),void 0):null;J==0&&K&&(J=ks(Gw(K)));J!==0&&this.MH(J);r4r(this,this.N_,this.N_);this.player.SY(6)}; g.u.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Q9();this.jC=this.jY;g.$T(this.Z5,this.LU);this.LU=this.uH=this.Z5=null;g.CH.prototype.unload.call(this);this.player.SY(5);sh(this)}; g.u.Xq=function(){g.x4(this.subscriptions);g.CH.prototype.Xq.call(this)}; g.u.DF=function(J){var K=g.c3.apply(1,arguments);this.loaded&&this.Z5.bk.apply(this.Z5,[J].concat(g.m(K)))}; g.u.getAdState=function(){return this.x6}; g.u.p$=function(){return this.LU?Gw(this.LU).p$:!1}; g.u.kL=function(){return this.LU?Gw(this.LU).kL:!1}; g.u.MH=function(J,K){this.Vo=J||0;this.player.publish("progresssync",J,K);this.player.gR("onVideoProgress",J||0)}; g.u.getCurrentTime=function(){return this.Vo}; g.u.getDuration=function(){return Gw(this.LU).getDuration()||0}; g.u.vM=function(){var J=Gw(this.LU);return J.U?J.G+DJ(J):J.G}; g.u.M$=function(){return Gw(this.LU).L}; g.u.bj=function(){return RsG(Gw(this.LU))}; g.u.TO=function(){var J=Gw(this.LU);return J.Z>0?J.Z+DJ(J):J.Z}; g.u.getProgressState=function(){var J=Gw(this.LU),K=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!J.BR()&&this.player.vp(),clipEnd:K.clipEnd,clipStart:K.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.vM(),isAtLiveHead:this.isAtLiveHead(),loaded:this.M$(),seekableEnd:this.bj(),seekableStart:this.TO(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.u.isAtLiveHead=function(){return RsG(Gw(this.LU))-this.getCurrentTime()<=1}; g.u.nextVideo=function(){this.LU&&this.LU.nextVideo()}; g.u.sz=function(){this.LU&&this.LU.sz()}; g.u.FdW=function(J){J===1&&(this.AS=this.LU?Gw(this.LU):null)}; g.u.arx=function(){var J=nou()?new Ys(g.U(XU()),void 0):null;if(J){var K=this.jC;this.loaded&&this.unload();this.LU=J;this.AS=null;K.key!==this.jY.key&&(this.jC=K,this.load())}else g.QD(this.LU),this.LU=null,this.loaded&&(this.unload(),(J=this.AS)&&J.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(J.videoId,ks(J)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.u.XG=function(){var J=[this.jY],K=J.concat,n=MpH();m3()&&g.g1("yt-remote-cast-available")&&n.push({key:"cast-selector-receiver",name:"Cast..."});this.TZ=K.call(J,n);J=J4u()||this.jY;Cw(this,J);this.player.gR("onMdxReceiversChange")}; g.u.Vh_=function(){var J=g.U(J4u());Cw(this,J)}; g.u.eqm=function(){this.jC=g.U(J4u())}; g.u.Q2j=function(){this.Iq=!0;sh(this);VK=!1;lY&&jF(lY,1);lY=null}; g.u.GnM=function(){this.Iq=!1;sh(this);Cw(this,this.jY);this.jC=this.jY;VK=!1;lY=null;this.player.playVideo()}; g.u.Dd=function(J,K){switch(J){case "casting":return this.loaded;case "receivers":return this.TZ;case "currentReceiver":return K&&(K.key==="cast-selector-receiver"?CNG():Cw(this,K)),this.loaded?this.jC:this.jY;case "quickCast":return this.TZ.length===2&&this.TZ[1].key==="cast-selector-receiver"?(K&&CNG(),!0):!1}}; g.u.Vl=function(){this.LU.Vl()}; g.u.g5=function(){return!1}; g.u.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.u.isLoggedIn=function(){var J,K;return((J=g.Et("PLAYER_CONFIG"))==null?void 0:(K=J.args)==null?void 0:K.authuser)!==void 0?!0:!(!g.Et("SESSION_INDEX")&&!g.Et("LOGGED_IN"))};g.sU("remote",Smm);})(_yt_player);