(function(g){var window=this;'use strict';var dnC=function(O){if(O instanceof g.h6)return O;if(typeof O.LB=="function")return O.LB(!1);if(g.Iz(O)){var V=0,J=new g.h6;J.next=function(){for(;;){if(V>=O.length)return g.jc;if(V in O)return g.oh(O[V++]);V++}}; return J}throw Error("Not implemented");},g6F=function(O,V,J){if(g.Iz(O))g.Cu(O,V,J); else for(O=dnC(O);;){var y=O.next();if(y.done)break;V.call(J,y.value,void 0,O)}},kw=function(O){g.$6(O,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.vn()).toString(36)); return O},Sb=function(O,V,J){Array.isArray(J)||(J=[String(J)]); g.Wzr(O.D,V,J)},q7D=function(O,V){var J=[]; g6F(V,function(y){try{var l=g.af.prototype.zm.call(this,y,!0)}catch(m){if(m=="Storage: Invalid value was encountered")return;throw m;}l===void 0?J.push(y):g.MIX(l)&&J.push(y)},O); return J},QZz=function(O,V){q7D(O,V).forEach(function(J){g.af.prototype.remove.call(this,J)},O)},Gzz=function(O){if(O.Xs){if(O.Xs.locationOverrideToken)return{locationOverrideToken:O.Xs.locationOverrideToken}; if(O.Xs.latitudeE7!=null&&O.Xs.longitudeE7!=null)return{latitudeE7:O.Xs.latitudeE7,longitudeE7:O.Xs.longitudeE7}}return null},KEz=function(O,V){g.Kd(O,V)||O.push(V)},tLm=function(O){var V=0,J; for(J in O)V++;return V},uyW=function(O,V){return g.Tv(O,V)},A_V=function(O){try{return g.Z1.JSON.parse(O)}catch(V){}O=String(O); if(/^\s*$/.test(O)?0:/^[\],:{}\s\u2028\u2029]*$/.test(O.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("("+O+")")}catch(V){}throw Error("Invalid JSON string: "+O);},DC=function(O){if(g.Z1.JSON)try{return g.Z1.JSON.parse(O)}catch(V){}return A_V(O)},r_s=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/channel/opened",g.jI("channel_type"))},iZm=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/channel/closed",g.jI("channel_type"))},RGF=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/channel/message_received",g.jI("channel_type"))},B7D=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/channel/success")},PLV=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/channel/error",g.jI("channel_type"),g.jI("error_type"))},kzI=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},S7s=function(){var O=g.E9(); this.K=O;O.nK("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Dny=function(O,V,J,y){var l=new g.Cn(null); O&&g.O7(l,O);V&&g.F1(l,V);J&&g.VX(l,J);y&&(l.j=y);return l},Ovs=function(O,V){return new g.By(O,V)},Ob=function(O,V){return Object.prototype.hasOwnProperty.call(O,V)},VrC=function(O,V){return O===V},V3=function(O,V){this.j={}; this.K=[];this.IL=this.size=0;var J=arguments.length;if(J>1){if(J%2)throw Error("Uneven number of arguments");for(var y=0;y5&&(O=O.slice(O.length-5)); var V=g.Ia(eUF(),function(y){return y.loungeToken}),J=g.Ia(O,function(y){return y.loungeToken}); g.bA(J,function(y){return!g.Kd(V,y)})&&IDz(); g.oH("yt-remote-local-screens",O,31536E3)},F9=function(O){O||(g.wE("yt-remote-session-screen-id"),g.wE("yt-remote-session-video-id")); sfE();O=jM();g.um(O,CX());zUz(O)},aDF=function(){if(!Nf){var O=g.vM(); O&&(Nf=new g.er(O))}},bvs=function(){aDF(); return Nf?!!Nf.get("yt-remote-use-staging-server"):!1},xk=function(O,V){g.tS[O]=!0; var J=g.GS();J&&J.publish.apply(J,arguments);g.tS[O]=!1},pMm=function(){var O=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return O?parseInt(O[1],10):0},fDz=function(O){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+O)!=-1||document.currentScript.src.indexOf("&"+O)!=-1)},hUW=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},WD=function(O){O.length?oFn(O.shift(),function(){WD(O)}):vFy()},wMC=function(O){return"chrome-extension://"+O+"/cast_sender.js"},oFn=function(O,V,J){var y=document.createElement("script"); y.onerror=V;J&&(y.onload=J);g.wO(y,g.I4(O));(document.head||document.documentElement).appendChild(y)},MrW=function(){var O=pMm(),V=[]; if(O>1){var J=O-1;V.push("//www.gstatic.com/eureka/clank/"+O+"/cast_sender.js");V.push("//www.gstatic.com/eureka/clank/"+J+"/cast_sender.js")}return V},vFy=function(){var O=hUW(); O&&O(!1,"No cast extension found")},nFC=function(){if(Lr1){var O=2,V=hUW(),J=function(){O--; O==0&&V&&V(!0)}; window.__onGCastApiAvailable=J;oFn("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",vFy,J)}},XMI=function(){nFC(); var O=MrW();O.push("//www.gstatic.com/eureka/clank/cast_sender.js");WD(O)},d2z=function(){nFC(); var O=MrW();O.push.apply(O,g.q(EFD.map(wMC)));O.push("//www.gstatic.com/eureka/clank/cast_sender.js");WD(O)},Ub=function(O,V,J){g.K.call(this); this.V=J!=null?(0,g.hI)(O,J):O;this.zM=V;this.W=(0,g.hI)(this.g4,this);this.K=!1;this.j=0;this.U=this.PB=null;this.D=[]},ZX=function(){this.K=g.vn()},gF1=function(){zy||(zy=new ZX)},qgz=function(){zy||(zy=new ZX)},cD=function(){},Qf1=function(){g.PG.call(this,"p")},GhW=function(){g.PG.call(this,"o")},trz=function(){return KrD=KrD||new g.xS},uKI=function(O){g.PG.call(this,"serverreachability",O)},sb=function(O){var V=trz(); V.dispatchEvent(new uKI(V,O))},Ans=function(O){g.PG.call(this,"statevent",O)},Ty=function(O){var V=trz(); V.dispatchEvent(new Ans(V,O))},rnz=function(O,V,J,y){g.PG.call(this,"timingevent",O); this.size=V;this.rtt=J;this.retries=y},eM=function(O,V){if(typeof O!=="function")throw Error("Fn must not be null and must be a function"); return g.Z1.setTimeout(function(){O()},V)},IX=function(){},Yk=function(O,V,J,y){this.U=O; this.D=V;this.NH=J;this.yc=y||1;this.Ks=new g.Fy(this);this.TL=45E3;this.ol=null;this.V=!1;this.qX=this.nD=this.T=this.LD=this.fD=this.eB=this.KD=null;this.lw=[];this.K=null;this.S=0;this.W=this.O5=null;this.UR=-1;this.Vz=!1;this.zL=0;this.E5=null;this.oB=this.yz=this.Xs=this.dW=!1;this.j=new iv1},iv1=function(){this.U=null; this.K="";this.j=!1},BC1=function(O,V,J){O.LD=1; O.T=kw(V.clone());O.qX=J;O.dW=!0;RUI(O,null)},RUI=function(O,V){O.fD=Date.now(); aX(O);O.nD=O.T.clone();Sb(O.nD,"t",O.yc);O.S=0;var J=O.U.yz;O.j=new iv1;O.K=Pkz(O.U,J?V:null,!O.qX);O.zL>0&&(O.E5=new g.iL((0,g.hI)(O.jN,O,O.K),O.zL));O.Ks.listen(O.K,"readystatechange",O.LA);V=O.ol?g.b2(O.ol):{};O.qX?(O.O5||(O.O5="POST"),V["Content-Type"]="application/x-www-form-urlencoded",O.K.send(O.nD,O.O5,O.qX,V)):(O.O5="GET",O.K.send(O.nD,O.O5,null,V));sb(1)},SgE=function(O){if(!khC(O))return g.AF(O.K); var V=g.r4(O.K);if(V==="")return"";var J="",y=V.length,l=g.tF(O.K)==4;if(!O.j.U){if(typeof TextDecoder==="undefined")return bt(O),pX(O),"";O.j.U=new g.Z1.TextDecoder}for(var m=0;mV.length)return D2n;V=V.slice(y,y+J);O.S=y+J;return V},aX=function(O){O.eB=Date.now()+O.TL; Jss(O,O.TL)},Jss=function(O,V){if(O.KD!=null)throw Error("WatchDog timer not null"); O.KD=eM((0,g.hI)(O.w4,O),V)},ysm=function(O){O.KD&&(g.Z1.clearTimeout(O.KD),O.KD=null)},pX=function(O){O.U.Qu()||O.Vz||lSI(O.U,O)},bt=function(O){ysm(O); g.C1(O.E5);O.E5=null;O.Ks.removeAll();if(O.K){var V=O.K;O.K=null;V.abort();V.dispose()}},x4s=function(O,V){try{var J=O.U; if(J.PK!=0&&(J.K==O||m4n(J.j,O)))if(!O.yz&&m4n(J.j,O)&&J.PK==3){try{var y=J.JL.K.parse(V)}catch(b){y=null}if(Array.isArray(y)&&y.length==3){var l=y;if(l[0]==0)a:{if(!J.T){if(J.K)if(J.K.fD+3E30&&(J.zL=1.5*N);y=J;var x=O.dT();if(x){var W=g.iF(x,"X-Client-Wire-Protocol");if(W){var U=y.j;!U.K&&(g.t0(W,"spdy")||g.t0(W,"quic")||g.t0(W,"h2"))&&(U.D=U.W,U.K=new Set,U.j&&(j4n(U,U.j),U.j=null))}if(y.dW){var Z=g.iF(x,"X-HTTP-Session-Id");Z&&(y.Wf=Z,g.$6(y.ol,y.dW,Z))}}J.PK=3;J.W&&J.W.Xf();J.eq&&(J.dX=Date.now()-O.fD);y=J;var z=O;y.MI=CiD(y,y.yz?y.NH:null,y.WB); if(z.yz){FmC(y.j,z);var c=z,Y=y.zL;Y&&c.setTimeout(Y);c.KD&&(ysm(c),aX(c));y.K=z}else NGz(y);J.U.length>0&&vD(J)}else m[0]!="stop"&&m[0]!="close"||oX(J,7);else J.PK==3&&(m[0]=="stop"||m[0]=="close"?m[0]=="stop"?oX(J,7):J.disconnect():m[0]!="noop"&&J.W&&J.W.WP(m),J.lw=0)}sb(4)}catch(b){}},WmC=function(O,V){this.K=O; this.map=V;this.context=null},U4m=function(O){this.W=O||10; g.Z1.PerformanceNavigationTiming?(O=g.Z1.performance.getEntriesByType("navigation"),O=O.length>0&&(O[0].nextHopProtocol=="hq"||O[0].nextHopProtocol=="h2")):O=!!(g.Z1.chrome&&g.Z1.chrome.loadTimes&&g.Z1.chrome.loadTimes()&&g.Z1.chrome.loadTimes().wasFetchedViaSpdy);this.D=O?this.W:1;this.K=null;this.D>1&&(this.K=new Set);this.j=null;this.U=[]},ZVI=function(O){return O.j?!0:O.K?O.K.size>=O.D:!1},HVm=function(O){return O.j?1:O.K?O.K.size:0},m4n=function(O,V){return O.j?O.j==V:O.K?O.K.has(V):!1},j4n= function(O,V){O.K?O.K.add(V):O.j=V},FmC=function(O,V){O.j&&O.j==V?O.j=null:O.K&&O.K.has(V)&&O.K.delete(V)},zum=function(O){if(O.j!=null)return O.U.concat(O.j.lw); if(O.K!=null&&O.K.size!==0){var V=O.U;O=g.n(O.K.values());for(var J=O.next();!J.done;J=O.next())V=V.concat(J.value.lw);return V}return g.kE(O.U)},csV=function(O,V){var J=new IX; if(g.Z1.Image){var y=new Image;y.onload=g.oz(wY,J,"TestLoadImage: loaded",!0,V,y);y.onerror=g.oz(wY,J,"TestLoadImage: error",!1,V,y);y.onabort=g.oz(wY,J,"TestLoadImage: abort",!1,V,y);y.ontimeout=g.oz(wY,J,"TestLoadImage: timeout",!1,V,y);g.Z1.setTimeout(function(){if(y.ontimeout)y.ontimeout()},1E4); y.src=O}else V(!1)},s4d=function(O,V){var J=new IX,y=new AbortController,l=setTimeout(function(){y.abort(); wY(J,"TestPingServer: timeout",!1,V)},1E4); fetch(O,{signal:y.signal}).then(function(m){clearTimeout(l);m.ok?wY(J,"TestPingServer: ok",!0,V):wY(J,"TestPingServer: server error",!1,V)}).catch(function(){clearTimeout(l); wY(J,"TestPingServer: error",!1,V)})},wY=function(O,V,J,y,l){try{l&&(l.onload=null,l.onerror=null,l.onabort=null,l.ontimeout=null),y(J)}catch(m){}},TGz=function(){this.K=new cD},Mf=function(O,V,J){return J&&J.TWi?J.TWi[O]||V:V},euE=function(O){this.U=[]; this.NH=this.MI=this.ol=this.WB=this.K=this.Wf=this.dW=this.Vz=this.S=this.Xs=this.qX=null;this.Pn=this.nD=0;this.dD=Mf("failFast",!1,O);this.E5=this.KD=this.T=this.V=this.W=null;this.aB=!0;this.zK=this.LD=-1;this.yc=this.lw=this.fD=0;this.ul=Mf("baseRetryDelayMs",5E3,O);this.Z_=Mf("retryDelaySeedMs",1E4,O);this.OE=Mf("forwardChannelMaxRetries",2,O);this.Jg=Mf("forwardChannelRequestTimeoutMs",2E4,O);this.DD=O&&O.pQz||void 0;this.qq=O&&O.zLE||void 0;this.HK=O&&O.ewD||!1;this.zL=void 0;this.yz=O&&O.phD|| !1;this.D="";this.j=new U4m(O&&O.vJl);this.xr=Math.min(O&&O.bhN||1E3,1E3);this.JL=new TGz;this.Ks=O&&O.NtK||!1;this.eB=O&&O.IG5||!1;this.Ks&&this.eB&&(this.eB=!1);this.bl=O&&O.p1X||!1;O&&O.zrj&&(this.aB=!1);this.eq=!this.Ks&&this.aB&&O&&O.F$w||!1;this.wX=void 0;O&&O.W6&&O.W6>0&&(this.wX=O.W6);this.UR=void 0;this.dX=0;this.TL=!1;this.oB=this.O5=null},hk=function(O){O.K&&(ISE(O),O.K.cancel(),O.K=null)},Yny=function(O){hk(O); O.T&&(g.Z1.clearTimeout(O.T),O.T=null);fX(O);O.j.cancel();O.V&&(typeof O.V==="number"&&g.Z1.clearTimeout(O.V),O.V=null)},vD=function(O){ZVI(O.j)||O.V||(O.V=!0,g.YS(O.Uy,O),O.fD=0)},bVW=function(O,V){if(HVm(O.j)>=O.j.D-(O.V?1:0))return!1; if(O.V)return O.U=V.lw.concat(O.U),!0;if(O.PK==1||O.PK==2||O.fD>=(O.dD?0:O.OE))return!1;O.V=eM((0,g.hI)(O.Uy,O,V),aSy(O,O.fD));O.fD++;return!0},fS1=function(O,V){var J; V?J=V.NH:J=O.nD++;var y=O.ol.clone();g.$6(y,"SID",O.D);g.$6(y,"RID",J);g.$6(y,"AID",O.LD);LX(O,y);O.S&&O.qX&&g.CZ(y,O.S,O.qX);J=new Yk(O,O.D,J,O.fD+1);O.S===null&&(J.ol=O.qX);V&&(O.U=V.lw.concat(O.U));V=pwz(O,J,O.xr);J.setTimeout(Math.round(O.Jg*.5)+Math.round(O.Jg*.5*Math.random()));j4n(O.j,J);BC1(J,y,V)},LX=function(O,V){O.Vz&&g.YY(O.Vz,function(J,y){g.$6(V,y,J)}); O.W&&g.YY({},function(J,y){g.$6(V,y,J)})},pwz=function(O,V,J){J=Math.min(O.U.length,J); var y=O.W?(0,g.hI)(O.W.ya,O.W,O):null;a:{for(var l=O.U,m=-1;;){var H=["count="+J];m==-1?J>0?(m=l[0].K,H.push("ofs="+m)):m=0:H.push("ofs="+m);for(var F=!0,N=0;N=3)return!1; O.yc++;O.T=eM((0,g.hI)(O.Rw,O),aSy(O,O.lw));O.lw++;return!0},ISE=function(O){O.O5!=null&&(g.Z1.clearTimeout(O.O5),O.O5=null)},huz=function(O){O.K=new Yk(O,O.D,"rpc",O.yc); O.S===null&&(O.K.ol=O.qX);O.K.zL=0;var V=O.MI.clone();g.$6(V,"RID","rpc");g.$6(V,"SID",O.D);g.$6(V,"AID",O.LD);g.$6(V,"CI",O.E5?"0":"1");!O.E5&&O.wX&&g.$6(V,"TO",O.wX);g.$6(V,"TYPE","xmlhttp");LX(O,V);O.S&&O.qX&&g.CZ(V,O.S,O.qX);O.zL&&O.K.setTimeout(O.zL);var J=O.K;O=O.NH;J.LD=1;J.T=kw(V.clone());J.qX=null;J.dW=!0;RUI(J,O)},fX=function(O){O.KD!=null&&(g.Z1.clearTimeout(O.KD),O.KD=null)},lSI=function(O,V){var J=null; if(O.K==V){fX(O);ISE(O);O.K=null;var y=2}else if(m4n(O.j,V))J=V.lw,FmC(O.j,V),y=1;else return;if(O.PK!=0)if(V.V)if(y==1){J=V.qX?V.qX.length:0;V=Date.now()-V.fD;var l=O.fD;y=trz();y.dispatchEvent(new rnz(y,J,V,l));vD(O)}else NGz(O);else{var m=V.UR;l=V.getLastError();if(l==3||l==0&&m>0||!(y==1&&bVW(O,V)||y==2&&$4W(O)))switch(J&&J.length>0&&(V=O.j,V.U=V.U.concat(J)),l){case 1:oX(O,5);break;case 4:oX(O,10);break;case 3:oX(O,6);break;default:oX(O,2)}}},aSy=function(O,V){var J=O.ul+Math.floor(Math.random()* O.Z_); O.isActive()||(J*=2);return J*V},oX=function(O,V){if(V==2){var J=(0,g.hI)(O.RkE,O),y=O.qq,l=!y; y=new g.Cn(y||"//www.google.com/images/cleardot.gif");g.Z1.location&&g.Z1.location.protocol=="http"||g.O7(y,"https");kw(y);l?csV(y.toString(),J):s4d(y.toString(),J)}else Ty(2);O.PK=0;O.W&&O.W.vP(V);oCE(O);Yny(O)},oCE=function(O){O.PK=0; O.oB=[];if(O.W){var V=zum(O.j);if(V.length!=0||O.U.length!=0)g.SF(O.oB,V),g.SF(O.oB,O.U),O.j.U.length=0,g.kE(O.U),O.U.length=0;O.W.D6()}},vCC=function(O){if(O.PK==0)return O.oB; var V=[];g.SF(V,zum(O.j));g.SF(V,O.U);return V},CiD=function(O,V,J){var y=g.fn(J); y.K!=""?(V&&g.F1(y,V+"."+y.K),g.VX(y,y.U)):(y=g.Z1.location,y=Dny(y.protocol,V?V+"."+y.hostname:y.hostname,+y.port,J));V=O.dW;J=O.Wf;V&&J&&g.$6(y,V,J);g.$6(y,"VER",O.mq);LX(O,y);return y},Pkz=function(O,V,J){if(V&&!O.yz)throw Error("Can't create secondary domain capable XhrIo object."); V=O.HK&&!O.DD?new g.QL(new g.BP({gE:J})):new g.QL(O.DD);V.S=O.yz;return V},wwC=function(){},MBz=function(){},X9=function(O,V){g.xS.call(this); this.K=new euE(V);this.W=O;this.j=V&&V.n8i||null;O=V&&V.E8L||null;V&&V.Dxn&&(O?O["X-Client-Protocol"]="webchannel":O={"X-Client-Protocol":"webchannel"});this.K.qX=O;O=V&&V.AqN||null;V&&V.g2&&(O?O["X-WebChannel-Content-Type"]=V.g2:O={"X-WebChannel-Content-Type":V.g2});V&&V.Rf&&(O?O["X-WebChannel-Client-Profile"]=V.Rf:O={"X-WebChannel-Client-Profile":V.Rf});this.K.Xs=O;(O=V&&V.dBj)&&!g.Ku(O)&&(this.K.S=O);this.V=V&&V.phD||!1;this.D=V&&V.iID||!1;(V=V&&V.ZDK)&&!g.Ku(V)&&(this.K.dW=V,g.s2(this.j,V)&&(O= this.j,V in O&&delete O[V]));this.U=new nX(this)},Lmy=function(O){Qf1.call(this); O.__headers__&&(this.headers=O.__headers__,this.statusCode=O.__status__,delete O.__headers__,delete O.__status__);var V=O.__sm__;V?this.data=(this.K=g.U2(V))?g.Ym(V,this.K):V:this.data=O},nCz=function(O){GhW.call(this); this.status=1;this.errorCode=O},nX=function(O){this.K=O},XwF=function(O,V){this.j=O; this.K=V},ECm=function(O){return vCC(O.K).map(function(V){var J=O.j; V=V.map;"__data__"in V?(V=V.__data__,J=J.D?A_V(V):V):J=V;return J})},Eb=function(O,V){if(typeof O!=="function")throw Error("Fn must not be null and must be a function"); return g.Z1.setTimeout(function(){O()},V)},gY=function(O){dY.dispatchEvent(new d4z(dY,O))},d4z=function(O){g.PG.call(this,"statevent",O)},qf=function(O,V,J,y){this.K=O; this.D=V;this.S=J;this.V=y||1;this.j=45E3;this.U=new g.Fy(this);this.W=new g.MU;this.W.setInterval(250)},qnI=function(O,V,J){O.fk=1; O.dl=kw(V.clone());O.J3=J;O.dW=!0;gCI(O,null)},Q4V=function(O,V,J,y,l){O.fk=1; O.dl=kw(V.clone());O.J3=null;O.dW=J;l&&(O.ZV=!1);gCI(O,y)},gCI=function(O,V){O.rl=Date.now(); G21(O);O.Ux=O.dl.clone();Sb(O.Ux,"t",O.V);O.vg=0;O.OC=O.K.Of(O.K.Fc()?V:null);O.uU>0&&(O.R9=new g.iL((0,g.hI)(O.uv,O,O.OC),O.uU));O.U.listen(O.OC,"readystatechange",O.I$);V=O.Nd?g.b2(O.Nd):{};O.J3?(O.Dx="POST",V["Content-Type"]="application/x-www-form-urlencoded",O.OC.send(O.Ux,O.Dx,O.J3,V)):(O.Dx="GET",O.ZV&&!g.z5&&(V.Connection="close"),O.OC.send(O.Ux,O.Dx,null,V));O.K.He(1)},uvy=function(O,V){var J=O.vg,y=V.indexOf("\n",J); if(y==-1)return Km1;J=Number(V.substring(J,y));if(isNaN(J))return tBV;y+=1;if(y+J>V.length)return Km1;V=V.slice(y,y+J);O.vg=y+J;return V},G21=function(O){O.dF=Date.now()+O.j; AsF(O,O.j)},AsF=function(O,V){if(O.C1!=null)throw Error("WatchDog timer not null"); O.C1=Eb((0,g.hI)(O.cN,O),V)},rsz=function(O){O.C1&&(g.Z1.clearTimeout(O.C1),O.C1=null)},iVE=function(O){O.K.Qu()||O.OD||O.K.rF(O)},Q3=function(O){rsz(O); g.C1(O.R9);O.R9=null;O.W.stop();O.U.removeAll();if(O.OC){var V=O.OC;O.OC=null;V.abort();V.dispose()}O.a8&&(O.a8=null)},Rud=function(O,V){try{O.K.d_(O,V),O.K.He(4)}catch(J){}},Pi1=function(O,V,J,y,l){if(y==0)J(!1); else{var m=l||0;y--;BGy(O,V,function(H){H?J(!0):g.Z1.setTimeout(function(){Pi1(O,V,J,y,m)},m)})}},BGy=function(O,V,J){var y=new Image; y.onload=function(){try{Gy(y),J(!0)}catch(l){}}; y.onerror=function(){try{Gy(y),J(!1)}catch(l){}}; y.onabort=function(){try{Gy(y),J(!1)}catch(l){}}; y.ontimeout=function(){try{Gy(y),J(!1)}catch(l){}}; g.Z1.setTimeout(function(){if(y.ontimeout)y.ontimeout()},V); y.src=O},Gy=function(O){O.onload=null; O.onerror=null;O.onabort=null;O.ontimeout=null},k2z=function(O){this.K=O; this.j=new cD},Sns=function(O){var V=KX(O.K,O.U6,"/mail/images/cleardot.gif"); kw(V);Pi1(V.toString(),5E3,(0,g.hI)(O.YB,O),3,2E3);O.He(1)},D4I=function(O){var V=O.K.V; V!=null?(gY(5),V?(gY(11),tk(O.K,O,!1)):(gY(12),tk(O.K,O,!0))):(O.CK=new qf(O),O.CK.Nd=O.AN,V=O.K,V=KX(V,V.Fc()?O.Wg:null,O.F0),gY(5),Sb(V,"TYPE","xmlhttp"),Q4V(O.CK,V,!1,O.Wg,!1))},OWd=function(O,V,J){this.K=1; this.j=[];this.U=[];this.W=new cD;this.qX=O||null;this.V=V!=null?V:null;this.T=J||!1},V8C=function(O,V){this.K=O; this.map=V;this.context=null},JyW=function(O,V,J,y){g.PG.call(this,"timingevent",O); this.size=V;this.rtt=J;this.retries=y},yym=function(O){g.PG.call(this,"serverreachability",O)},mzD=function(O){O.Qa(1,0); O.X1=KX(O,null,O.oi);l3E(O)},$zE=function(O){O.jQ&&(O.jQ.abort(),O.jQ=null); O.Nq&&(O.Nq.cancel(),O.Nq=null);O.n4&&(g.Z1.clearTimeout(O.n4),O.n4=null);ut(O);O.RW&&(O.RW.cancel(),O.RW=null);O.SV&&(g.Z1.clearTimeout(O.SV),O.SV=null)},HWd=function(O,V){if(O.K==0)throw Error("Invalid operation: sending map when state is closed"); O.j.push(new V8C(O.S9++,V));O.K!=2&&O.K!=3||l3E(O)},jNs=function(O){var V=0; O.Nq&&V++;O.RW&&V++;return V},l3E=function(O){O.RW||O.SV||(O.SV=Eb((0,g.hI)(O.Ff,O),0),O.n1=0)},Nrz=function(O,V){if(O.K==1){if(!V){O.on=Math.floor(Math.random()*1E5); V=O.on++;var J=new qf(O,"",V);J.Nd=O.GR;var y=CMm(O),l=O.X1.clone();g.$6(l,"RID",V);g.$6(l,"CVER","1");Ak(O,l);qnI(J,l,y);O.RW=J;O.K=2}}else O.K==3&&(V?Ftz(O,V):O.j.length==0||O.RW||Ftz(O))},Ftz=function(O,V){if(V)if(O.zT>6){O.j=O.U.concat(O.j); O.U.length=0;var J=O.on-1;V=CMm(O)}else J=V.S,V=V.J3;else J=O.on++,V=CMm(O);var y=O.X1.clone();g.$6(y,"SID",O.D);g.$6(y,"RID",J);g.$6(y,"AID",O.ZO);Ak(O,y);J=new qf(O,O.D,J,O.n1+1);J.Nd=O.GR;J.setTimeout(1E4+Math.round(1E4*Math.random()));O.RW=J;qnI(J,y,V)},Ak=function(O,V){O.Zs&&(O=O.Zs.g_())&&g.YY(O,function(J,y){g.$6(V,y,J)})},CMm=function(O){var V=Math.min(O.j.length,1E3),J=["count="+V]; if(O.zT>6&&V>0){var y=O.j[0].K;J.push("ofs="+y)}else y=0;for(var l={},m=0;m=3)return!1; O.S++;O.n4=Eb((0,g.hI)(O.r_,O),WtV(O,O.Eq));O.Eq++;return!0},tk=function(O,V,J){O.It=O.V==null?J:!O.V; O.py=V.Eu;O.T||mzD(O)},ut=function(O){O.aL!=null&&(g.Z1.clearTimeout(O.aL),O.aL=null)},WtV=function(O,V){var J=5E3+Math.floor(Math.random()*1E4); O.isActive()||(J*=2);return J*V},BD=function(O,V){if(V==2||V==9){var J=null; O.Zs&&(J=null);var y=(0,g.hI)(O.mE5,O);J||(J=new g.Cn("//www.google.com/images/cleardot.gif"),kw(J));BGy(J.toString(),1E4,y)}else gY(2);ZWC(O,V)},ZWC=function(O,V){O.K=0; O.Zs&&O.Zs.ow(V);z7F(O);$zE(O)},z7F=function(O){O.K=0; O.py=-1;if(O.Zs)if(O.U.length==0&&O.j.length==0)O.Zs.kD();else{var V=g.kE(O.U),J=g.kE(O.j);O.U.length=0;O.j.length=0;O.Zs.kD(V,J)}},KX=function(O,V,J){var y=g.fn(J); if(y.K!="")V&&g.F1(y,V+"."+y.K),g.VX(y,y.U);else{var l=window.location;y=Dny(l.protocol,V?V+"."+l.hostname:l.hostname,+l.port,J)}O.iH&&g.YY(O.iH,function(m,H){g.$6(y,H,m)}); g.$6(y,"VER",O.zT);Ak(O,y);return y},cyn=function(){},sNn=function(){this.K=[]; this.j=[]},Trz=function(O){g.PG.call(this,"channelMessage"); this.message=O},e7D=function(O){g.PG.call(this,"channelError"); this.error=O},I3V=function(O,V){this.action=O; this.params=V||{}},PD=function(O,V){g.K.call(this); this.K=new g.t_(this.sul,0,this);g.t(this,this.K);this.zM=5E3;this.retryCount=this.oZ=0;if(typeof O==="function")V&&(O=(0,g.hI)(O,V));else if(O&&typeof O.handleEvent==="function")O=(0,g.hI)(O.handleEvent,O);else throw Error("Invalid listener argument");this.j=O},YtV=function(O,V,J,y,l,m,H,F,N,x,W,U,Z,z){var c=this; J=J===void 0?!1:J;y=y===void 0?function(){return""}:y; l=l===void 0?!1:l;m=m===void 0?!1:m;H=H===void 0?!1:H;F=F===void 0?function(){return g.f3({})}:F; x=x===void 0?!1:x;W=W===void 0?!1:W;U=U===void 0?!1:U;this.E5=O;this.fD=V;this.T=new g.Th;this.V=z;this.j=(this.U=!!Z)?Z(function(){c.b6()}):new PD(this.b6,this); this.K=null;this.qX=!1;this.lw=null;this.dW="";this.O5=this.KD=0;this.D=[];this.oB=J;this.ol=y;this.S=m;this.yz=F;this.LD=N;this.yc=H;this.Vz=null;this.W=g.f3();this.NH=l;this.UR=x;this.WB=W;this.Xs=U;this.eB=new r_s;this.nD=new iZm;this.Ks=new B7D;this.TL=new RGF;this.zL=new PLV;this.aB=new kzI;this.eq=new S7s},pvW=function(O,V,J,y,l){a3z(O); if(O.K){var m=g.ts("ID_TOKEN"),H=O.K.GR||{};m?H["x-youtube-identity-token"]=m:delete H["x-youtube-identity-token"];O.K.GR=H}bWn(O);y?(y.getState()!=3&&jNs(y)==0||y.getState(),O.K.connect(V,J,O.fD,y.D,y.ZO)):l?O.K.connect(V,J,O.fD,l.sessionId,l.arrayId):O.K.connect(V,J,O.fD);O.U&&!O.j.isActive()&&O.j.start();O.V&&O.V.MtN()},ogE=function(O,V){return O.WB?!0:O.UR?!Object.values(f3z).includes(V):O.Xs?Object.values(h7E).includes(V):!1},M8z=function(O){var V,J; g.Q(function(y){if(y.j==1)return y.fD(2),y.K(vgz(O),2);y.T();V=O.D;O.D=[];J=V.length;wvz(O,V,J);kk(O);return y.qX(0)})},wvz=function(O,V,J){for(var y=0;y0?J=Object.assign({},J,V):delete J.Authorization;O.K.GR=J}},bWn=function(O){O.LD&&!O.S&&ngz(O,O.LD())},SM=function(O){this.scheme="https"; this.port=this.domain="";this.K="/api/lounge";this.j=!0;O=O||document.location.href;var V=Number(g.c$(O)[4]||null)||"";V&&(this.port=":"+V);this.domain=g.sd(O)||"";O=g.Pt();O.search("MSIE")>=0&&(O=O.match(/MSIE ([\d.]+)/)[1],g.Bt(O,"10.0")<0&&(this.j=!1))},DX=function(O,V){var J=O.K; O.j&&(J=O.scheme+"://"+O.domain+O.port+O.K);return g.pp(J+V,{})},Xvy=function(O,V){g.xS.call(this); var J=this;this.handler=O();this.handler.subscribe("handlerOpened",this.Et,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(y,l){J.onError(l)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.K=V},EgD=function(O,V,J){var y=this; J=J===void 0?function(){return""}:J; var l=l===void 0?new MBz:l;var m=m===void 0?new g.Th:m;this.pathPrefix=O;this.K=V;this.fD=J;this.W=m;this.T=null;this.qX=this.S=0;this.channel=null;this.V=0;this.U=new PD(function(){y.U.isActive();var H;((H=y.channel)==null?void 0:HVm((new XwF(H,H.K)).K.j))===0&&y.connect(y.T,y.S)}); this.D={};this.j={};this.KD=!1;this.logger=null;this.lw=[];this.FD=void 0;this.ol=new r_s;this.O5=new iZm;this.Vz=new RGF;this.dW=new PLV},dzI=function(O){g.mS(O.channel,"m",function(){O.V=3; O.U.reset();O.T=null;O.S=0;for(var V=g.n(O.lw),J=V.next();!J.done;J=V.next())J=J.value,O.channel&&O.channel.send(J);O.lw=[];O.publish("webChannelOpened");O.ol.gN("WEB_CHANNEL")}); g.mS(O.channel,"n",function(){O.V=0;O.U.isActive()||O.publish("webChannelClosed");var V,J=(V=O.channel)==null?void 0:ECm(new XwF(V,V.K));J&&(O.lw=[].concat(g.q(J)));O.O5.gN("WEB_CHANNEL")}); g.mS(O.channel,"p",function(V){var J=V.data;J[0]==="gracefulReconnect"?(O.U.start(),O.channel&&O.channel.close()):O.publish("webChannelMessage",new I3V(J[0],J[1]));O.FD=V.statusCode;O.Vz.gN("WEB_CHANNEL")}); g.mS(O.channel,"o",function(){O.FD===401||O.U.start();O.publish("webChannelError");O.dW.gN("WEB_CHANNEL","")})},gg1=function(O){var V=O.fD(); V?O.D["x-youtube-lounge-xsrf-token"]=V:delete O.D["x-youtube-lounge-xsrf-token"]},qtD=function(O){g.xS.call(this); this.K=O();this.K.subscribe("webChannelOpened",this.nA,this);this.K.subscribe("webChannelClosed",this.onClosed,this);this.K.subscribe("webChannelError",this.onError,this);this.K.subscribe("webChannelMessage",this.onMessage,this)},QNz=function(O,V,J,y,l){function m(){return new YtV(DX(O,"/bc"),V,!1,J,y)} J=J===void 0?function(){return""}:J; return g.Ut("enable_mdx_web_channel_desktop")?new qtD(function(){return new EgD(DX(O,"/wc"),V,J)}):new Xvy(m,l)},uRV=function(){var O=G8z; Ktm();Or.push(O);t8z()},Vi=function(O,V){Ktm(); var J=Ayn(O,String(V));Or.length==0?ryz(J):(t8z(),g.Cu(Or,function(y){y(J)}))},Jf=function(O){Vi("CP",O)},Ktm=function(){Or||(Or=g.cn("yt.mdx.remote.debug.handlers_")||[],g.zD("yt.mdx.remote.debug.handlers_",Or))},ryz=function(O){var V=(yi+1)%50; yi=V;l5[V]=O;mu||(mu=V==49)},t8z=function(){var O=Or; if(l5[0]){var V=mu?yi:-1,J={};do J={d$:void 0},V=(V+1)%50,J.d$=l5[V],g.Cu(O,function(y){return function(l){l(y.d$)}}(J)); while(V!=yi);l5=Array(50);yi=-1;mu=!1}},Ayn=function(O,V){var J=(Date.now()-iWC)/1E3; J.toFixed&&(J=J.toFixed(3));var y=[];y.push("[",J+"s","] ");y.push("[","yt.mdx.remote","] ");y.push(O+": "+V,"\n");return y.join("")},$0=function(O){g.BF.call(this); this.V=O;this.screens=[]},R7F=function(O,V){var J=O.get(V.uuid)||O.get(V.id); if(J)return O=J.name,J.id=V.id||J.id,J.name=V.name,J.token=V.token,J.uuid=V.uuid||J.uuid,J.name!=O;O.screens.push(V);return!0},Brz=function(O,V){var J=O.screens.length!=V.length; O.screens=g.L1(O.screens,function(m){return!!Wrz(V,m)}); for(var y=V.length,l=0;l0&&O.D0&&TZ(O,J)},function(V){O.W=function(){}; O.Cw(V)})},bzd=function(O){var V={}; V.pairingCode=O.O5;V.theme=O.LD;bvs()&&(V.env_useStageMdx=1);return g.bp(V)},pCD=function(O){return new Promise(function(V){O.O5=NCd(); if(O.ol){var J=new chrome.cast.DialLaunchResponse(!0,bzd(O));V(J);aiy(O)}else O.KD=function(){g.Nz(O.qX);O.KD=function(){}; O.qX=NaN;var y=new chrome.cast.DialLaunchResponse(!0,bzd(O));V(y);aiy(O)},O.qX=g.CW(function(){O.KD()},100)})},hKV=function(O,V,J){O.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(V)); var y=new lt(V);return(new Promise(function(l){fim(O,y,function(m){m?(O.lw=!0,x0(O.D,y),Ur(O,y),TZ(O,J)):g.rG(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(V)+" is not online."));l(m)},5)})).then(function(l){return l?new chrome.cast.DialLaunchResponse(!1):pCD(O)})},oOm=function(O,V){var J=O.T.receiver.label,y=O.j.friendlyName; return(new Promise(function(l){HzI(O.D,J,V,y,function(m){m&&m.token&&Ur(O,m);l(m)},function(m){Zc(O,"Failed to get DIAL screen: "+m); l(null)})})).then(function(l){return l&&l.token?new chrome.cast.DialLaunchResponse(!1):pCD(O)})},fim=function(O,V,J,y){g.Nz(O.V); O.V=0;CjE(O.D,V,function(l){l||y<0?J(l):O.V=g.CW(function(){fim(O,V,J,y-1)},300)})},TZ=function(O,V){O.info("getDialAppInfoWithTimeout_ "+V); sr(O)&&(g.Nz(O.S),O.S=0,V==0?vOE(O):O.S=g.CW(function(){vOE(O)},V))},vOE=function(O){sr(O)&&O.U.getDialAppInfo(function(V){O.info("getDialAppInfo dialLaunchData: "+JSON.stringify(V)); V=V.extraData||{};var J=null;if(V.loungeToken){var y;((y=O.K)==null?void 0:y.token)==V.loungeToken&&(J="staleLoungeToken")}else J="missingLoungeToken";J?(O.fD=J,TZ(O,3E4)):(O.lw=!1,O.fD="unknown",W2z(O,V.loungeToken),TZ(O,V.loungeTokenRefreshIntervalMs))},function(V){O.info("getDialAppInfo error: "+V); O.fD="noLoungeTokenResponse";TZ(O,3E4)})},wCI=function(O){g.Nz(O.V); O.V=0;g.Nz(O.S);O.S=0;O.W();O.W=function(){}; g.Nz(O.qX)},eO=function(O,V){W4.call(this,O,V,"ManualSession"); this.U=g.CW((0,g.hI)(this.gj,this,null),150)},IK=function(O,V){g.BF.call(this); this.config_=V;this.j=O;this.T=V.appId||"233637DE";this.D=V.theme||"cl";this.qX=V.disableCastApi||!1;this.V=V.forceMirroring||!1;this.K=null;this.S=!1;this.U=[];this.W=(0,g.hI)(this.f_w,this)},Mds=function(O,V){return V?g.Qs(O.U,function(J){return mn(V,J.label)},O):null},Y0=function(O){Vi("Controller",O)},G8z=function(O){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(O)},aK=function(O){return O.S||!!O.U.length||!!O.K},b5=function(O,V,J){V!=O.K&&(g.C1(O.K),(O.K=V)?(J?O.publish("yt-remote-cast2-receiver-resumed", V.j):O.publish("yt-remote-cast2-receiver-selected",V.j),V.subscribe("sessionScreen",(0,g.hI)(O.w3,O,V)),V.subscribe("sessionFailed",function(){return L2y(O,V)}),V.K?O.publish("yt-remote-cast2-session-change",V.K):J&&O.K.gj(null)):O.publish("yt-remote-cast2-session-change",null))},L2y=function(O,V){O.K==V&&O.publish("yt-remote-cast2-session-failed")},nOy=function(O){var V=O.j.w_(),J=O.K&&O.K.j; O=g.Ia(V,function(y){J&&mn(y,J.label)&&(J=null);var l=y.uuid?y.uuid:y.id,m=Mds(this,y);m?(m.label=l,m.friendlyName=y.name):(m=new chrome.cast.Receiver(l,y.name),m.receiverType=chrome.cast.ReceiverType.CUSTOM);return m},O); J&&(J.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(J=new chrome.cast.Receiver(J.label,J.friendlyName),J.receiverType=chrome.cast.ReceiverType.CUSTOM),O.push(J));return O},K2F=function(O,V,J,y){y.disableCastApi?pl("Cannot initialize because disabled by Mdx config."):XCC()?EOz(V,y)&&(dvW(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?gOz(O,J):(window.__onGCastApiAvailable=function(l,m){l?gOz(O,J):(fl("Failed to load cast API: "+m),q$E(!1),dvW(!1),g.wE("yt-remote-cast-available"),g.wE("yt-remote-cast-receiver"), QHz(),J(!1))},y.loadCastApiSetupScript?g.RF(GbI):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?pMm()>=60&&XMI():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?vFy():pMm()>=89?d2z():(nFC(),WD(EFD.map(wMC))))):pl("Cannot initialize because not running Chrome")},QHz=function(){pl("dispose"); var O=hf();O&&O.dispose();g.zD("yt.mdx.remote.cloudview.instance_",null);tds(!1);g.rS(uQz);uQz.length=0},oK=function(){return!!g.vC("yt-remote-cast-installed")},AGz=function(){var O=g.vC("yt-remote-cast-receiver"); return O?O.friendlyName:null},rGE=function(){pl("clearCurrentReceiver"); g.wE("yt-remote-cast-receiver")},izC=function(){return oK()?hf()?hf().getCastSession():(fl("getCastSelector: Cast is not initialized."),null):(fl("getCastSelector: Cast API is not installed!"),null)},RKz=function(){oK()?hf()?v4()?(pl("Requesting cast selector."),hf().requestSession()):(pl("Wait for cast API to be ready to request the session."),uQz.push(g.AS("yt-remote-cast2-api-ready",RKz))):fl("requestCastSelector: Cast is not initialized."):fl("requestCastSelector: Cast API is not installed!")}, wD=function(O,V){v4()?hf().setConnectedScreenStatus(O,V):fl("setConnectedScreenStatus called before ready.")},XCC=function(){var O=g.Pt().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.l$||O},BED=function(O,V){hf().init(O,V)},EOz=function(O,V){var J=!1; hf()||(O=new IK(O,V),O.subscribe("yt-remote-cast2-availability-change",function(y){g.oH("yt-remote-cast-available",y);xk("yt-remote-cast2-availability-change",y)}),O.subscribe("yt-remote-cast2-receiver-selected",function(y){pl("onReceiverSelected: "+y.friendlyName); g.oH("yt-remote-cast-receiver",y);xk("yt-remote-cast2-receiver-selected",y)}),O.subscribe("yt-remote-cast2-receiver-resumed",function(y){pl("onReceiverResumed: "+y.friendlyName); g.oH("yt-remote-cast-receiver",y);xk("yt-remote-cast2-receiver-resumed",y)}),O.subscribe("yt-remote-cast2-session-change",function(y){pl("onSessionChange: "+$k(y)); y||g.wE("yt-remote-cast-receiver");xk("yt-remote-cast2-session-change",y)}),g.zD("yt.mdx.remote.cloudview.instance_",O),J=!0); pl("cloudview.createSingleton_: "+J);return J},hf=function(){return g.cn("yt.mdx.remote.cloudview.instance_")},gOz=function(O,V){q$E(!0); dvW(!1);BED(O,function(J){J?(tds(!0),g.i0("yt-remote-cast2-api-ready")):(fl("Failed to initialize cast API."),q$E(!1),g.wE("yt-remote-cast-available"),g.wE("yt-remote-cast-receiver"),QHz());V(J)})},pl=function(O){Vi("cloudview",O)},fl=function(O){Vi("cloudview",O)},q$E=function(O){pl("setCastInstalled_ "+O); g.oH("yt-remote-cast-installed",O)},v4=function(){return!!g.cn("yt.mdx.remote.cloudview.apiReady_")},tds=function(O){pl("setApiReady_ "+O); g.zD("yt.mdx.remote.cloudview.apiReady_",O)},dvW=function(O){g.zD("yt.mdx.remote.cloudview.initializing_",O)},MC=function(O){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.W=this.V=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.U=this.S=this.j=0;this.K=NaN;this.D=!1;this.reset(O)},PjF=function(O){O.audioTrackId=null; O.trackData=null;O.playerState=-1;O.hasPrevious=!1;O.hasNext=!1;O.V=0;O.W=g.vn();O.j=0;O.S=0;O.U=0;O.loadedTime=0;O.K=NaN;O.D=!1},Ll=function(O){return O.isPlaying()?(g.vn()-O.W)/1E3:0},nl=function(O,V){O.V=V; O.W=g.vn()},XJ=function(O){switch(O.playerState){case 1:case 1081:return(g.vn()-O.W)/1E3+O.V; case -1E3:return 0}return O.V},kbd=function(O){return O.D?O.S+Ll(O):O.S},Er=function(O,V,J){var y=O.videoId; O.videoId=V;O.index=J;V!=y&&PjF(O)},S$z=function(O){var V={}; V.index=O.index;V.listId=O.listId;V.videoId=O.videoId;V.playerState=O.playerState;V.volume=O.volume;V.muted=O.muted;V.audioTrackId=O.audioTrackId;V.trackData=g.pu(O.trackData);V.hasPrevious=O.hasPrevious;V.hasNext=O.hasNext;V.playerTime=O.V;V.playerTimeAt=O.W;V.seekableStart=O.j;V.seekableEnd=O.S;V.duration=O.U;V.loadedTime=O.loadedTime;V.liveIngestionTime=O.K;return V},gD=function(O,V){g.BF.call(this); var J=this;this.U=0;this.D=O;this.V=[];this.W=new sNn;this.j=this.K=null;this.qX=(0,g.hI)(this.rCn,this);this.S=(0,g.hI)(this.yx,this);this.T=(0,g.hI)(this.ACB,this);this.KD=(0,g.hI)(this.orW,this);var y=0;O?(y=O.getProxyState(),y!=3&&(O.subscribe("proxyStateChange",this.w1,this),DvI(this))):y=3;y!=0&&(V?this.w1(y):g.CW(function(){J.w1(y)},0)); (O=izC())&&dD(this,O);this.subscribe("yt-remote-cast2-session-change",this.KD)},qC=function(O){return new MC(O.D.getPlayerContextData())},DvI=function(O){g.Cu("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(V){this.V.push(this.D.subscribe(V,g.oz(this.mfn,V),this))},O)},OHz=function(O){g.Cu(O.V,function(V){this.D.unsubscribeByKey(V)},O); O.V.length=0},Qi=function(O){return O.getState()==1},GZ=function(O,V){var J=O.W; J.K.length+J.j.length<50&&O.W.enqueue(V)},VAC=function(O,V,J){var y=qC(O); nl(y,J);y.playerState!=-1E3&&(y.playerState=V);Kl(O,y)},tf=function(O,V,J){O.D.sendMessage(V,J)},Kl=function(O,V){OHz(O); O.D.setPlayerContextData(S$z(V));DvI(O)},dD=function(O,V){O.j&&(O.j.removeUpdateListener(O.qX),O.j.removeMediaListener(O.S),O.yx(null)); O.j=V;O.j&&(Jf("Setting cast session: "+O.j.sessionId),O.j.addUpdateListener(O.qX),O.j.addMediaListener(O.S),O.j.media.length&&O.yx(O.j.media[0]))},JDF=function(O){var V=O.K.media,J=O.K.customData; if(V&&J){var y=qC(O);V.contentId!=y.videoId&&Jf("Cast changing video to: "+V.contentId);y.videoId=V.contentId;y.playerState=J.playerState;nl(y,O.K.getEstimatedTime());Kl(O,y)}else Jf("No cast media video. Ignoring state update.")},u5=function(O,V,J){return(0,g.hI)(function(y){this.pu("Failed to "+V+" with cast v2 channel. Error code: "+y.code); y.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.pu("Retrying "+V+" using MDx browser channel."),tf(this,V,J))},O)},i5=function(O,V,J,y){y=y===void 0?!1:y; g.BF.call(this);var l=this;this.V=NaN;this.O5=!1;this.qX=this.T=this.lw=this.fD=NaN;this.KD=[];this.W=this.S=this.D=this.K=this.j=null;this.ol=O;this.Vz=y;this.KD.push(g.Tb(window,"beforeunload",function(){l.oO(2)})); this.U=[];this.K=new MC;this.LD=V.id;this.dW=V.idType;this.j=QNz(this.ol,J,this.Iw,this.dW=="shortLived",this.LD);this.j.listen("channelOpened",function(){yDd(l)}); this.j.listen("channelClosed",function(){Af("Channel closed");isNaN(l.V)?F9(!0):F9();l.dispose()}); this.j.listen("channelError",function(m){F9();isNaN(l.Wk())?(m==1&&l.dW=="shortLived"&&l.publish("browserChannelAuthError",m),Af("Channel error: "+m+" without reconnection"),l.dispose()):(l.O5=!0,Af("Channel error: "+m+" with reconnection in "+l.Wk()+" ms"),rD(l,2))}); this.j.listen("channelMessage",function(m){lVz(l,m)}); this.j.fG(V.token);this.subscribe("remoteQueueChange",function(){var m=l.K.videoId;g.Mv()&&g.oH("yt-remote-session-video-id",m)})},mVC=function(O){return g.Qs(O.U,function(V){return V.type=="LOUNGE_SCREEN"})},Af=function(O){Vi("conn",O)},rD=function(O,V){O.publish("proxyStateChange",V)},$Vy=function(O){O.V=g.CW(function(){Af("Connecting timeout"); O.oO(1)},2E4)},HHD=function(O){g.Nz(O.V); O.V=NaN},jjm=function(O){g.Nz(O.fD); O.fD=NaN},FNm=function(O){CHz(O); O.lw=g.CW(function(){RK(O,"getNowPlaying")},2E4)},CHz=function(O){g.Nz(O.lw); O.lw=NaN},yDd=function(O){Af("Channel opened"); O.O5&&(O.O5=!1,jjm(O),O.fD=g.CW(function(){Af("Timing out waiting for a screen.");O.oO(1)},15E3))},xVI=function(O,V){var J=null; if(V){var y=mVC(O);y&&(J={clientName:y.clientName,deviceMake:y.brand,deviceModel:y.model,osVersion:y.osVersion})}g.zD("yt.mdx.remote.remoteClient_",J);V&&(HHD(O),jjm(O));J=O.j.T9()&&isNaN(O.V);V==J?V&&(rD(O,1),RK(O,"getSubtitlesTrack")):V?(O.LH()&&O.K.reset(),rD(O,1),RK(O,"getNowPlaying"),N9z(O)):O.oO(1)},WNF=function(O,V){var J=V.params.videoId; delete V.params.videoId;J==O.K.videoId&&(g.Id(V.params)?O.K.trackData=null:O.K.trackData=V.params,O.publish("remotePlayerChange"))},UVz=function(O,V,J){var y=V.params.videoId||V.params.video_id,l=parseInt(V.params.currentIndex,10); O.K.listId=V.params.listId||O.K.listId;Er(O.K,y,l);O.publish("remoteQueueChange",J)},z5E=function(O,V){V.params=V.params||{}; UVz(O,V,"NOW_PLAYING_MAY_CHANGE");ZHD(O,V);O.publish("autoplayDismissed")},ZHD=function(O,V){var J=parseInt(V.params.currentTime||V.params.current_time,10); nl(O.K,isNaN(J)?0:J);J=parseInt(V.params.state,10);J=isNaN(J)?-1:J;J==-1&&O.K.playerState==-1E3&&(J=-1E3);O.K.playerState=J;J=Number(V.params.loadedTime);O.K.loadedTime=isNaN(J)?0:J;O.K.vH(Number(V.params.duration));J=O.K;var y=Number(V.params.liveIngestionTime);J.K=y;J.D=isNaN(y)?!1:!0;J=O.K;y=Number(V.params.seekableStartTime);V=Number(V.params.seekableEndTime);J.j=isNaN(y)?0:y;J.S=isNaN(V)?0:V;O.K.playerState==1?FNm(O):CHz(O);O.publish("remotePlayerChange")},cDz=function(O,V){if(O.K.playerState!= -1E3){var J=1085; switch(parseInt(V.params.adState,10)){case 1:J=1081;break;case 2:J=1084;break;case 0:J=1083}O.K.playerState=J;V=parseInt(V.params.currentTime,10);nl(O.K,isNaN(V)?0:V);O.publish("remotePlayerChange")}},sjC=function(O,V){var J=V.params.muted=="true"; O.K.volume=parseInt(V.params.volume,10);O.K.muted=J;O.publish("remotePlayerChange")},T9z=function(O,V){O.S=V.params.videoId; O.publish("nowAutoplaying",parseInt(V.params.timeout,10))},e5z=function(O,V){O.S=V.params.videoId||null; O.publish("autoplayUpNext",O.S)},IVz=function(O,V){O.W=V.params.autoplayMode; O.publish("autoplayModeChange",O.W);O.W=="DISABLED"&&O.publish("autoplayDismissed")},YNn=function(O,V){var J=V.params.hasNext=="true"; O.K.hasPrevious=V.params.hasPrevious=="true";O.K.hasNext=J;O.publish("previousNextChange")},lVz=function(O,V){V=V.message; V.params?Af("Received: action="+V.action+", params="+g.d4(V.params)):Af("Received: action="+V.action+" {}");switch(V.action){case "loungeStatus":V=DC(V.params.devices);O.U=g.Ia(V,function(y){return new y3(y)}); V=!!g.Qs(O.U,function(y){return y.type=="LOUNGE_SCREEN"}); xVI(O,V);V=O.Ss("mlm");O.publish("multiStateLoopEnabled",V);break;case "loungeScreenDisconnected":g.rV(O.U,function(y){return y.type=="LOUNGE_SCREEN"}); xVI(O,!1);break;case "remoteConnected":var J=new y3(DC(V.params.device));g.Qs(O.U,function(y){return y.equals(J)})||KEz(O.U,J); break;case "remoteDisconnected":J=new y3(DC(V.params.device));g.rV(O.U,function(y){return y.equals(J)}); break;case "gracefulDisconnect":break;case "playlistModified":UVz(O,V,"QUEUE_MODIFIED");break;case "nowPlaying":z5E(O,V);break;case "onStateChange":ZHD(O,V);break;case "onAdStateChange":cDz(O,V);break;case "onVolumeChanged":sjC(O,V);break;case "onSubtitlesTrackChanged":WNF(O,V);break;case "nowAutoplaying":T9z(O,V);break;case "autoplayDismissed":O.publish("autoplayDismissed");break;case "autoplayUpNext":e5z(O,V);break;case "onAutoplayModeChanged":IVz(O,V);break;case "onHasPreviousNextChanged":YNn(O, V);break;case "requestAssistedSignIn":O.publish("assistedSignInRequested",V.params.authCode);break;case "onLoopModeChanged":O.publish("loopModeChange",V.params.loopMode);break;default:Af("Unrecognized action: "+V.action)}},N9z=function(O){g.Nz(O.qX); O.qX=g.CW(function(){O.oO(1)},864E5)},RK=function(O,V,J){J?Af("Sending: action="+V+", params="+g.d4(J)):Af("Sending: action="+V); O.j.sendMessage(V,J)},aVy=function(O){$0.call(this,"ScreenServiceProxy"); this.lB=O;this.K=[];this.K.push(this.lB.$_s("screenChange",(0,g.hI)(this.zZ,this)));this.K.push(this.lB.$_s("onlineScreenChange",(0,g.hI)(this.WiE,this)))},oPs=function(O,V){aDF(); if(!Nf||!Nf.get("yt-remote-disable-remote-module-for-dev")){V=g.ts("MDX_CONFIG")||V;U2W();sfE();B4||(B4=new SM(V?V.loungeApiHost:void 0),bvs()&&(B4.K="/api/loungedev"));P4||(P4=g.cn("yt.mdx.remote.deferredProxies_")||[],g.zD("yt.mdx.remote.deferredProxies_",P4));bHI();var J=k0();if(!J){var y=new NC(B4,V?V.disableAutomaticScreenCache||!1:!1);g.zD("yt.mdx.remote.screenService_",y);J=k0();var l={};V&&(l={appId:V.appId,disableDial:V.disableDial,theme:V.theme,loadCastApiSetupScript:V.loadCastApiSetupScript, disableCastApi:V.disableCastApi,enableDialLoungeToken:V.enableDialLoungeToken,enableCastLoungeToken:V.enableCastLoungeToken,forceMirroring:V.forceMirroring});g.zD("yt.mdx.remote.enableConnectWithInitialState_",V?V.enableConnectWithInitialState||!1:!1);K2F(O,y,function(m){m?SO()&&wD(SO(),"YouTube TV"):y.subscribe("onlineScreenChange",function(){xk("yt-remote-receiver-availability-change")})},l)}V&&!g.cn("yt.mdx.remote.initialized_")&&(g.zD("yt.mdx.remote.initialized_",!0),Dc("Initializing: "+g.d4(V)), Ov.push(g.AS("yt-remote-cast2-api-ready",function(){xk("yt-remote-api-ready")})),Ov.push(g.AS("yt-remote-cast2-availability-change",function(){xk("yt-remote-receiver-availability-change")})),Ov.push(g.AS("yt-remote-cast2-receiver-selected",function(){VZ(null); xk("yt-remote-auto-connect","cast-selector-receiver")})),Ov.push(g.AS("yt-remote-cast2-receiver-resumed",function(){xk("yt-remote-receiver-resumed","cast-selector-receiver")})),Ov.push(g.AS("yt-remote-cast2-session-change",pHV)),Ov.push(g.AS("yt-remote-connection-change",function(m){m?wD(SO(),"YouTube TV"):Jl()||(wD(null,null),rGE())})),Ov.push(g.AS("yt-remote-cast2-session-failed",function(){xk("yt-remote-connection-failed")})),O=fVy(),V.isAuto&&(O.id+="#dial"),l=V.capabilities||[],l.length>0&&(O.capabilities= l),O.name=V.device,O.app=V.app,(V=V.theme)&&(O.theme=V),Dc(" -- with channel params: "+g.d4(O)),O?(g.oH("yt-remote-session-app",O.app),g.oH("yt-remote-session-name",O.name)):(g.wE("yt-remote-session-app"),g.wE("yt-remote-session-name")),g.zD("yt.mdx.remote.channelParams_",O),J.start(),SO()||h5s())}},vPs=function(){var O=k0().lB.$_gos(); var V=yZ();V&&lP()&&(Wrz(O,V)||O.push(V));return x2z(O)},MAy=function(){var O=wHz(); !O&&oK()&&AGz()&&(O={key:"cast-selector-receiver",name:AGz()});return O},wHz=function(){var O=vPs(),V=yZ(); V||(V=Jl());return g.Qs(O,function(J){return V&&mn(V,J.key)?!0:!1})},yZ=function(){var O=SO(); if(!O)return null;var V=k0().Nj();return HD(V,O)},pHV=function(O){Dc("remote.onCastSessionChange_: "+$k(O)); if(O){var V=yZ();if(V&&V.id==O.id){if(wD(V.id,"YouTube TV"),O.idType=="shortLived"&&(O=O.token))mI&&(mI.token=O),(V=lP())&&V.fG(O)}else V&&$d(),Ho(O,1)}else lP()&&$d()},$d=function(){v4()?hf().stopSession():fl("stopSession called before API ready."); var O=lP();O&&(O.disconnect(1),LNz(null))},nPF=function(){var O=lP(); return!!O&&O.getProxyState()!=3},Dc=function(O){Vi("remote",O)},k0=function(){if(!XHz){var O=g.cn("yt.mdx.remote.screenService_"); XHz=O?new aVy(O):null}return XHz},SO=function(){return g.cn("yt.mdx.remote.currentScreenId_")},EPz=function(O){g.zD("yt.mdx.remote.currentScreenId_",O)},dVC=function(){return g.cn("yt.mdx.remote.connectData_")},VZ=function(O){g.zD("yt.mdx.remote.connectData_",O)},lP=function(){return g.cn("yt.mdx.remote.connection_")},LNz=function(O){var V=lP(); VZ(null);O||EPz("");g.zD("yt.mdx.remote.connection_",O);P4&&(g.Cu(P4,function(J){J(O)}),P4.length=0); V&&!O?xk("yt-remote-connection-change",!1):!V&&O&&xk("yt-remote-connection-change",!0)},Jl=function(){var O=g.Mv(); if(!O)return null;var V=k0();if(!V)return null;V=V.Nj();return HD(V,O)},Ho=function(O,V){SO(); yZ()&&yZ();if(j6)mI=O;else{EPz(O.id);var J=g.cn("yt.mdx.remote.enableConnectWithInitialState_")||!1;O=new i5(B4,O,fVy(),J);O.connect(V,dVC());O.subscribe("beforeDisconnect",function(y){xk("yt-remote-before-disconnect",y)}); O.subscribe("beforeDispose",function(){lP()&&(lP(),LNz(null))}); O.subscribe("browserChannelAuthError",function(){var y=yZ();y&&y.idType=="shortLived"&&(v4()?hf().handleBrowserChannelAuthError():fl("refreshLoungeToken called before API ready."))}); LNz(O)}},h5s=function(){var O=Jl(); O?(Dc("Resume connection to: "+$k(O)),Ho(O,0)):(F9(),rGE(),Dc("Skipping connecting because no session screen found."))},bHI=function(){var O=fVy(); if(g.Id(O)){O=CX();var V=g.vC("yt-remote-session-name")||"",J=g.vC("yt-remote-session-app")||"";O={device:"REMOTE_CONTROL",id:O,name:V,app:J,mdxVersion:3};O.authuser=String(g.ts("SESSION_INDEX","0"));(V=g.ts("DELEGATED_SESSION_ID"))&&(O.pageId=String(V));g.zD("yt.mdx.remote.channelParams_",O)}},fVy=function(){return g.cn("yt.mdx.remote.channelParams_")||{}},Qjn=function(O,V,J){g.K.call(this); var y=this;this.K=O;this.G=V;this.hx=J;this.events=new g.jX(this);this.W=!1;this.V=new g.nr(64);this.j=new g.t_(this.AG,500,this);this.U=new g.t_(this.rE,1E3,this);this.T=new Ub(this.Q2v,0,this);this.D={};this.qX=new g.t_(this.kf,1E3,this);this.S=new g.iL(this.seekTo,1E3,this);this.KD=this.events.Z(this.G,"onVolumeChange",function(l){gPm(y,l)}); g.t(this,this.events);this.events.Z(V,"onCaptionsTrackListChanged",this.BXD);this.events.Z(V,"captionschanged",this.dIw);this.events.Z(V,"captionssettingschanged",this.c9);this.events.Z(V,"videoplayerreset",this.H2);this.events.Z(V,"mdxautoplaycancel",function(){y.hx.Q9()}); V.L("enable_mdx_video_play_directly")&&this.events.Z(V,"videodatachange",function(){qNn(y.K)||CS(y)||Fc(y,0)}); O=this.hx;O.GL();O.subscribe("proxyStateChange",this.i8,this);O.subscribe("remotePlayerChange",this.CV,this);O.subscribe("remoteQueueChange",this.H2,this);O.subscribe("previousNextChange",this.O2,this);O.subscribe("nowAutoplaying",this.DE,this);O.subscribe("autoplayDismissed",this.Tj,this);g.t(this,this.j);g.t(this,this.U);g.t(this,this.T);g.t(this,this.qX);g.t(this,this.S);this.c9();this.H2();this.CV()},gPm=function(O,V){if(CS(O)){O.hx.unsubscribe("remotePlayerChange",O.CV,O); var J=Math.round(V.volume);V=!!V.muted;var y=qC(O.hx);if(J!==y.volume||V!==y.muted)O.hx.setVolume(J,V),O.qX.start();O.hx.subscribe("remotePlayerChange",O.CV,O)}},GfF=function(O){O.VK(0); O.j.stop();O.mA(new g.nr(64))},KNd=function(O,V){if(CS(O)&&!O.W){var J=null; V&&(J={style:O.G.getSubtitlesUserSettings()},Object.assign(J,V));O.hx.cP(NK(O).videoId,J);O.D=qC(O.hx).trackData}},Fc=function(O,V){var J=O.G.getPlaylist(); if(J==null?0:J.listId){var y=J.index;var l=J.listId.toString()}J=NK(O);O.hx.playVideo(J.videoId,V,y,l,J.playerParams,J.KD,Gzz(J));O.mA(new g.nr(1))},tAz=function(O,V){if(V){var J=O.G.getOption("captions","tracklist",{kS:1}); J&&J.length?(O.G.setOption("captions","track",V),O.W=!1):(O.G.loadModule("captions"),O.W=!0)}else O.G.setOption("captions","track",{})},CS=function(O){return qC(O.hx).videoId===NK(O).videoId},NK=function(O){return O.G.getVideoData({playerType:1})},uhz=function(O,V){g.QF.call(this,O); this.K=V},xd=function(){g.r.call(this,{X:"div", C:"ytp-mdx-popup-dialog",N:{role:"dialog"},J:[{X:"div",C:"ytp-mdx-popup-dialog-inner-content",J:[{X:"div",C:"ytp-mdx-popup-title",Rl:"You're signed out"},{X:"div",C:"ytp-mdx-popup-description",Rl:"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."},{X:"div",C:"ytp-mdx-privacy-popup-buttons",J:[{X:"button",Fj:["ytp-button","ytp-mdx-privacy-popup-cancel"],Rl:"Cancel"},{X:"button",Fj:["ytp-button", "ytp-mdx-privacy-popup-confirm"],Rl:"Confirm"}]}]}]});this.fade=new g.AV(this,250);this.cancelButton=this.DN("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.DN("ytp-mdx-privacy-popup-confirm");g.t(this,this.fade);this.Z(this.cancelButton,"click",this.K);this.Z(this.confirmButton,"click",this.j)},Wo=function(O){g.r.call(this,{X:"div", C:"ytp-remote",J:[{X:"div",C:"ytp-remote-display-status",J:[{X:"div",C:"ytp-remote-display-status-icon",J:[g.ryp()]},{X:"div",C:"ytp-remote-display-status-text",Rl:"{{statustext}}"}]}]});this.api=O;this.fade=new g.AV(this,250);g.t(this,this.fade);this.Z(O,"presentingplayerstatechange",this.onStateChange);this.gX(O.getPlayerStateObject())},Uv=function(O,V){g.og.call(this,"Play on",1,O,V); this.G=O;this.NB={};this.Z(O,"onMdxReceiversChange",this.j);this.Z(O,"presentingplayerstatechange",this.j);this.j()},ADz=function(O){g.zm.call(this,O); this.TX={key:NCd(),name:"This computer"};this.IK=null;this.subscriptions=[];this.ri=this.hx=null;this.NB=[this.TX];this.Ud=this.TX;this.Pf=new g.nr(64);this.N_=0;this.Kf=-1;this.qt=!1;this.lV=this.p8=this.Un=null;if(!g.Vw(this.player.Y())&&!g.pJ(this.player.Y())){O=this.player;var V=g.Lj(O);V&&(V=V.gq())&&(V=new Uv(O,V),g.t(this,V));V=new Wo(O);g.t(this,V);g.kD(O,V.element,4);this.Un=new xd;g.t(this,this.Un);g.kD(O,this.Un.element,4);this.qt=!!Jl()}},Zo=function(O){O.p8&&(O.player.removeEventListener("presentingplayerstatechange", O.p8),O.p8=null)},rDn=function(O,V,J){O.Pf=J; O.player.publish("presentingplayerstatechange",new g.OK(J,V))},zq=function(O,V){if(V.key!==O.Ud.key)if(V.key===O.TX.key)$d(); else if(qNn(O)&&iHI(O),O.Ud=V,!g.pJ(O.player.Y())){var J=O.player.getPlaylistId();var y=O.player.getVideoData({playerType:1});var l=y.videoId;if(!J&&!l||(O.player.getAppState()===2||O.player.getAppState()===1)&&O.player.Y().L("should_clear_video_data_on_player_cued_unstarted"))y=null;else{var m=O.player.getPlaylist();if(m){var H=[];for(var F=0;F2*this.size&&Jk(this),!0):!1}; g.T.get=function(O,V){return Ob(this.j,O)?this.j[O]:V}; g.T.set=function(O,V){Ob(this.j,O)||(this.size+=1,this.K.push(O),this.IL++);this.j[O]=V}; g.T.forEach=function(O,V){for(var J=this.Hs(),y=0;y=y.K.length)return g.jc;var m=y.K[V++];return g.oh(O?m:y.j[m])}; return l}; var m2W={q9N:"atp",WzL:"ska",IRN:"que",oPz:"mus",D5B:"sus",JRN:"dsp",aRn:"seq",WCN:"mic",KyW:"dpa",FCX:"mlm",psW:"dsdtr",yIW:"ntb",peB:"vsp",ARK:"scn",SsE:"rpe",sWL:"dcn",BBD:"dcp",zjN:"pas",elz:"drq",EPl:"opf",OBK:"els",dKL:"isg",eyz:"svq",irB:"mvp",KP5:"ads",i4B:"stcp",Kzl:"sads",hlv:"dloc",lqD:"dcw",lcW:"asw",jzE:"apw",m8D:"wrc",Duj:"pcw",Eyi:"ipv",Son:"ndt",C_N:"ctops",ZBz:"gsrm"},$2I={hqj:"u",Vk5:"cl",Ybi:"k",WBz:"i",Y9n:"cr",kgL:"m",Iqz:"g",qD:"up"},f3z={IQN:"nowPlaying",Zrn:"onStateChange", uFi:"adPlaying",PQW:"onAdStateChange",Ew:"nowPlayingShorts",Pz:"onShortsStateChange"},h7E={Ew:"nowPlayingShorts",Pz:"onShortsStateChange"};y3.prototype.equals=function(O){return O?this.id==O.id:!1}; var cnE="",Nf=null,Lr1=fDz("loadCastFramework")||fDz("loadCastApplicationFramework"),EFD=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.nd(Ub,g.K);g.T=Ub.prototype;g.T.Va=function(O){this.D=arguments;this.K=!1;this.PB?this.U=g.vn()+this.zM:this.PB=g.L3(this.W,this.zM)}; g.T.stop=function(){this.PB&&(g.Z1.clearTimeout(this.PB),this.PB=null);this.U=null;this.K=!1;this.D=[]}; g.T.pause=function(){++this.j}; g.T.resume=function(){this.j&&(--this.j,!this.j&&this.K&&(this.K=!1,this.V.apply(null,this.D)))}; g.T.U5=function(){this.stop();Ub.EE.U5.call(this)}; g.T.g4=function(){this.PB&&(g.Z1.clearTimeout(this.PB),this.PB=null);this.U?(this.PB=g.L3(this.W,this.U-g.vn()),this.U=null):this.j?this.K=!0:(this.K=!1,this.V.apply(null,this.D))};var zy=null;ZX.prototype.set=function(O){this.K=O}; ZX.prototype.reset=function(){this.set(g.vn())}; ZX.prototype.get=function(){return this.K};g.nd(qgz,gF1);cD.prototype.stringify=function(O){return g.Z1.JSON.stringify(O,void 0)}; cD.prototype.parse=function(O){return g.Z1.JSON.parse(O,void 0)};g.nd(Qf1,g.PG);g.nd(GhW,g.PG);var KrD=null;g.nd(uKI,g.PG);g.nd(Ans,g.PG);g.nd(rnz,g.PG);IX.prototype.debug=function(){}; IX.prototype.info=function(){}; IX.prototype.warning=function(){};var OVm={},D2n={};g.T=Yk.prototype;g.T.setTimeout=function(O){this.TL=O}; g.T.LA=function(O){O=O.target;var V=this.E5;V&&g.tF(O)==3?V.F1():this.jN(O)}; g.T.jN=function(O){try{if(O==this.K)a:{var V=g.tF(this.K),J=this.K.j,y=this.K.getStatus();if(!(V<3)&&(V!=3||this.K&&(this.j.j||g.AF(this.K)||g.r4(this.K)))){this.Vz||V!=4||J==7||(J==8||y<=0?sb(3):sb(2));ysm(this);var l=this.K.getStatus();this.UR=l;var m=SgE(this);if(this.V=l==200){if(this.Xs&&!this.yz){b:{if(this.K){var H=g.iF(this.K,"X-HTTP-Initial-Response");if(H&&!g.Ku(H)){var F=H;break b}}F=null}if(O=F)this.yz=!0,x4s(this,O);else{this.V=!1;this.W=3;Ty(12);bt(this);pX(this);break a}}if(this.dW){O= !0;for(var N;!this.Vz&&this.S0&&!this.oB&&(this.oB=!0,this.U.FE(this)):(bt(this),pX(this))}else x4s(this,m);V==4&&bt(this);this.V&&!this.Vz&&(V==4?lSI(this.U,this):(this.V=!1,aX(this)))}else g.AZh(this.K),l==400&&m.indexOf("Unknown SID")> 0?(this.W=3,Ty(12)):(this.W=0,Ty(13)),bt(this),pX(this)}}}catch(x){}finally{}}; g.T.cancel=function(){this.Vz=!0;bt(this)}; g.T.w4=function(){this.KD=null;var O=Date.now();O-this.eB>=0?(this.LD!=2&&(sb(3),Ty(17)),bt(this),this.W=2,pX(this)):Jss(this,this.eB-O)}; g.T.getLastError=function(){return this.W}; g.T.dT=function(){return this.K};U4m.prototype.cancel=function(){this.U=zum(this);if(this.j)this.j.cancel(),this.j=null;else if(this.K&&this.K.size!==0){for(var O=g.n(this.K.values()),V=O.next();!V.done;V=O.next())V.value.cancel();this.K.clear()}};g.T=euE.prototype;g.T.mq=8;g.T.PK=1;g.T.connect=function(O,V,J,y){Ty(0);this.WB=O;this.Vz=V||{};J&&y!==void 0&&(this.Vz.OSID=J,this.Vz.OAID=y);this.E5=this.aB;this.ol=CiD(this,null,this.WB);vD(this)}; g.T.disconnect=function(){Yny(this);if(this.PK==3){var O=this.nD++,V=this.ol.clone();g.$6(V,"SID",this.D);g.$6(V,"RID",O);g.$6(V,"TYPE","terminate");LX(this,V);O=new Yk(this,this.D,O);O.LD=2;O.T=kw(V.clone());V=!1;if(g.Z1.navigator&&g.Z1.navigator.sendBeacon)try{V=g.Z1.navigator.sendBeacon(O.T.toString(),"")}catch(J){}!V&&g.Z1.Image&&((new Image).src=O.T,V=!0);V||(O.K=Pkz(O.U,null),O.K.send(O.T));O.fD=Date.now();aX(O)}oCE(this)}; g.T.Qu=function(){return this.PK==0}; g.T.getState=function(){return this.PK}; g.T.Uy=function(O){if(this.V)if(this.V=null,this.PK==1){if(!O){this.nD=Math.floor(Math.random()*1E5);O=this.nD++;var V=new Yk(this,"",O),J=this.qX;this.Xs&&(J?(J=g.b2(J),g.h0(J,this.Xs)):J=this.Xs);this.S!==null||this.eB||(V.ol=J,J=null);var y;if(this.Ks)a:{for(var l=y=0;l4096){y=l;break a}if(y===4096||l===this.U.length-1){y=l+1;break a}}y= this.xr}else y=this.xr;y=pwz(this,V,y);l=this.ol.clone();g.$6(l,"RID",O);g.$6(l,"CVER",22);this.dW&&g.$6(l,"X-HTTP-Session-Id",this.dW);LX(this,l);J&&(this.eB?y="headers="+g.dO(g.U$V(J))+"&"+y:this.S&&g.CZ(l,this.S,J));j4n(this.j,V);this.bl&&g.$6(l,"TYPE","init");this.Ks?(g.$6(l,"$req",y),g.$6(l,"SID","null"),V.Xs=!0,BC1(V,l,null)):BC1(V,l,y);this.PK=2}}else this.PK==3&&(O?fS1(this,O):this.U.length==0||ZVI(this.j)||fS1(this))}; g.T.Rw=function(){this.T=null;huz(this);if(this.eq&&!(this.TL||this.K==null||this.dX<=0)){var O=4*this.dX;this.O5=eM((0,g.hI)(this.u5D,this),O)}}; g.T.u5D=function(){this.O5&&(this.O5=null,this.E5=!1,this.TL=!0,Ty(10),hk(this),huz(this))}; g.T.FE=function(O){this.K==O&&this.eq&&!this.TL&&(ISE(this),this.TL=!0,Ty(11))}; g.T.x5=function(){this.KD!=null&&(this.KD=null,hk(this),$4W(this),Ty(19))}; g.T.RkE=function(O){O?Ty(2):Ty(1)}; g.T.isActive=function(){return!!this.W&&this.W.isActive(this)}; g.T=wwC.prototype;g.T.Xf=function(){}; g.T.WP=function(){}; g.T.vP=function(){}; g.T.D6=function(){}; g.T.isActive=function(){return!0}; g.T.ya=function(){};g.nd(X9,g.xS);X9.prototype.open=function(){this.K.W=this.U;this.V&&(this.K.yz=!0);this.K.connect(this.W,this.j||void 0)}; X9.prototype.close=function(){this.K.disconnect()}; X9.prototype.send=function(O){var V=this.K;if(typeof O==="string"){var J={};J.__data__=O;O=J}else this.D&&(J={},J.__data__=g.d4(O),O=J);V.U.push(new WmC(V.Pn++,O));V.PK==3&&vD(V)}; X9.prototype.U5=function(){this.K.W=null;delete this.U;this.K.disconnect();delete this.K;X9.EE.U5.call(this)}; g.nd(Lmy,Qf1);g.nd(nCz,GhW);g.nd(nX,wwC);nX.prototype.Xf=function(){this.K.dispatchEvent("m")}; nX.prototype.WP=function(O){this.K.dispatchEvent(new Lmy(O))}; nX.prototype.vP=function(O){this.K.dispatchEvent(new nCz(O))}; nX.prototype.D6=function(){this.K.dispatchEvent("n")}; XwF.prototype.commit=function(O){this.K.UR=O};var dY=new g.xS;g.I(d4z,g.PG);g.T=qf.prototype;g.T.Nd=null;g.T.Qo=!1;g.T.C1=null;g.T.dF=null;g.T.rl=null;g.T.fk=null;g.T.dl=null;g.T.Ux=null;g.T.J3=null;g.T.OC=null;g.T.vg=0;g.T.a8=null;g.T.Dx=null;g.T.TT=null;g.T.Aw=-1;g.T.ZV=!0;g.T.OD=!1;g.T.uU=0;g.T.R9=null;var tBV={},Km1={};g.T=qf.prototype;g.T.setTimeout=function(O){this.j=O}; g.T.I$=function(O){O=O.target;var V=this.R9;V&&g.tF(O)==3?V.F1():this.uv(O)}; g.T.uv=function(O){try{if(O==this.OC)a:{var V=g.tF(this.OC),J=this.OC.j,y=this.OC.getStatus();if(g.z5&&!g.RG("420+")){if(V<4)break a}else if(V<3||V==3&&!g.AF(this.OC))break a;this.OD||V!=4||J==7||(J==8||y<=0?this.K.He(3):this.K.He(2));rsz(this);var l=this.OC.getStatus();this.Aw=l;var m=g.AF(this.OC);if(this.Qo=l==200){V==4&&Q3(this);if(this.dW){for(O=!0;!this.OD&&this.vg0?(this.TT=3,gY(13)):(this.TT=0,gY(14)),Q3(this),iVE(this)}}catch(F){}finally{}}; g.T.cancel=function(){this.OD=!0;Q3(this)}; g.T.cN=function(){this.C1=null;var O=Date.now();O-this.dF>=0?(this.fk!=2&&this.K.He(3),Q3(this),this.TT=2,gY(18),iVE(this)):AsF(this,this.dF-O)}; g.T.getLastError=function(){return this.TT};g.T=k2z.prototype;g.T.AN=null;g.T.CK=null;g.T.Go=!1;g.T.F0=null;g.T.oK=null;g.T.Eu=-1;g.T.Wg=null;g.T.U6=null;g.T.connect=function(O){this.F0=O;O=KX(this.K,null,this.F0);gY(3);Date.now();var V=this.K.qX;V!=null?(this.Wg=V[0],(this.U6=V[1])?(this.oK=1,Sns(this)):(this.oK=2,D4I(this))):(Sb(O,"MODE","init"),this.CK=new qf(this),this.CK.Nd=this.AN,Q4V(this.CK,O,!1,null,!0),this.oK=0)}; g.T.YB=function(O){if(O)this.oK=2,D4I(this);else{gY(4);var V=this.K;V.py=V.jQ.Eu;BD(V,9)}O&&this.He(2)}; g.T.Of=function(O){return this.K.Of(O)}; g.T.abort=function(){this.CK&&(this.CK.cancel(),this.CK=null);this.Eu=-1}; g.T.Qu=function(){return!1}; g.T.d_=function(O,V){this.Eu=O.Aw;if(this.oK==0)if(V){try{var J=this.j.parse(V)}catch(y){O=this.K;O.py=this.Eu;BD(O,2);return}this.Wg=J[0];this.U6=J[1]}else O=this.K,O.py=this.Eu,BD(O,2);else this.oK==2&&(this.Go?(gY(7),Date.now()):V=="11111"?(gY(6),this.Go=!0,Date.now(),this.Eu=200,this.CK.cancel(),gY(12),tk(this.K,this,!0)):(gY(8),Date.now(),this.Go=!1))}; g.T.rF=function(){this.Eu=this.CK.Aw;if(this.CK.Qo)this.oK==0?this.U6?(this.oK=1,Sns(this)):(this.oK=2,D4I(this)):this.oK==2&&(this.Go?(gY(12),tk(this.K,this,!0)):(gY(11),tk(this.K,this,!1)));else{this.oK==0?gY(9):this.oK==2&&gY(10);var O=this.K;this.CK.getLastError();O.py=this.Eu;BD(O,2)}}; g.T.Fc=function(){return this.K.Fc()}; g.T.isActive=function(){return this.K.isActive()}; g.T.He=function(O){this.K.He(O)};g.T=OWd.prototype;g.T.GR=null;g.T.iH=null;g.T.RW=null;g.T.Nq=null;g.T.oi=null;g.T.X1=null;g.T.Oy=null;g.T.iU=null;g.T.on=0;g.T.S9=0;g.T.Zs=null;g.T.SV=null;g.T.n4=null;g.T.aL=null;g.T.jQ=null;g.T.It=null;g.T.ZO=-1;g.T.Ae=-1;g.T.py=-1;g.T.n1=0;g.T.Eq=0;g.T.zT=8;var R5s={OK:0,Zyn:2,lQj:4,QTj:5,BME:6,STOP:7,CL:8,Uj5:9,jWn:10,Rlv:11,RNL:12};g.nd(JyW,g.PG);g.nd(yym,g.PG);g.T=OWd.prototype; g.T.connect=function(O,V,J,y,l){gY(0);this.oi=V;this.iH=J||{};y&&l!==void 0&&(this.iH.OSID=y,this.iH.OAID=l);this.T?(Eb((0,g.hI)(this.v$,this,O),100),mzD(this)):this.v$(O)}; g.T.disconnect=function(){$zE(this);if(this.K==3){var O=this.on++,V=this.X1.clone();g.$6(V,"SID",this.D);g.$6(V,"RID",O);g.$6(V,"TYPE","terminate");Ak(this,V);O=new qf(this,this.D,O);O.fk=2;O.dl=kw(V.clone());(new Image).src=O.dl.toString();O.rl=Date.now();G21(O)}z7F(this)}; g.T.v$=function(O){this.jQ=new k2z(this);this.jQ.AN=this.GR;this.jQ.j=this.W;this.jQ.connect(O)}; g.T.Qu=function(){return this.K==0}; g.T.getState=function(){return this.K}; g.T.Ff=function(O){this.SV=null;Nrz(this,O)}; g.T.r_=function(){this.n4=null;this.Nq=new qf(this,this.D,"rpc",this.S);this.Nq.Nd=this.GR;this.Nq.uU=0;var O=this.Oy.clone();g.$6(O,"RID","rpc");g.$6(O,"SID",this.D);g.$6(O,"CI",this.It?"0":"1");g.$6(O,"AID",this.ZO);Ak(this,O);g.$6(O,"TYPE","xmlhttp");Q4V(this.Nq,O,!0,this.iU,!1)}; g.T.d_=function(O,V){if(this.K!=0&&(this.Nq==O||this.RW==O))if(this.py=O.Aw,this.RW==O&&this.K==3)if(this.zT>7){try{var J=this.W.parse(V)}catch(y){J=null}if(Array.isArray(J)&&J.length==3)if(O=J,O[0]==0)a:{if(!this.n4){if(this.Nq)if(this.Nq.rl+3E30)){if(y=V==1)this.RW||this.SV||this.K==1||this.n1>=2?y=!1:(this.SV=Eb((0,g.hI)(this.Ff,this,O),WtV(this,this.n1)),this.n1++, y=!0);y=!(y||V==2&&Uzm(this))}if(y)switch(J){case 1:BD(this,5);break;case 4:BD(this,10);break;case 3:BD(this,6);break;case 7:BD(this,12);break;default:BD(this,2)}}}; g.T.Qa=function(O){if(!g.Kd(arguments,this.K))throw Error("Unexpected channel state: "+this.K);}; g.T.mE5=function(O){O?gY(2):(gY(1),ZWC(this,8))}; g.T.Of=function(O){if(O)throw Error("Can't create secondary domain capable XhrIo object.");O=new g.QL;O.S=!1;return O}; g.T.isActive=function(){return!!this.Zs&&this.Zs.isActive(this)}; g.T.He=function(O){var V=dY;V.dispatchEvent(new yym(V,O))}; g.T.Fc=function(){return!1}; new qgz;g.T=cyn.prototype;g.T.GB=function(){}; g.T.kU=function(){}; g.T.Vj=function(){}; g.T.ow=function(){}; g.T.kD=function(){}; g.T.g_=function(){return{}}; g.T.isActive=function(){return!0};g.T=sNn.prototype;g.T.enqueue=function(O){this.j.push(O)}; g.T.isEmpty=function(){return this.K.length===0&&this.j.length===0}; g.T.clear=function(){this.K=[];this.j=[]}; g.T.contains=function(O){return g.Kd(this.K,O)||g.Kd(this.j,O)}; g.T.remove=function(O){var V=this.K;var J=(0,g.DC1)(V,O);J>=0?(g.tI(V,J),V=!0):V=!1;return V||g.um(this.j,O)}; g.T.JR=function(){for(var O=[],V=this.K.length-1;V>=0;--V)O.push(this.K[V]);V=this.j.length;for(var J=0;J0&&(this.V.nkW(this.j.MJ(),this.U,!0),this.V.PAK());this.V&&this.V.j_B();this.U?(this.j.stop(),g.C1(this.j),this.j=new PD(this.b6,this),this.U=!1):this.j.reset();this.lw=null;this.KD=0;if(this.D.length)if(this.S)M8z(this);else{var O=this.D;this.D=[];var V=O.length;bWn(this);wvz(this,O,V);kk(this)}else kk(this)}; g.T.ow=function(O){var V=O==2&&this.K.py==401;O==4||V||(this.U&&!this.j.isActive()&&(g.C1(this.j),this.j=new PD(this.b6,this),this.U=!1),this.j.start());this.publish("handlerError",O,V);V=Object.keys(R5s).find(function(J){return R5s[J]===O}); this.zL.gN("BROWSER_CHANNEL",V!=null?V:"UNKNOWN")}; g.T.kD=function(O,V){if(!this.j.isActive())this.publish("handlerClosed");else if(V)for(var J=V.length,y=0;y=B9D.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(O=B9D[this.j],this.PB=g.CW((0,g.hI)(this.eO,this),O),this.j++):this.publish("pairingFailed",Error("Server error "+O.status))}; g.T.bE=function(){this.K=null;this.publish("pairingFailed",Error("Server not responding"))}; var B9D=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.nd(jO,$0);g.T=jO.prototype;g.T.start=function(){H4(this)&&this.publish("screenChange");!g.vC("yt-remote-lounge-token-expiration")&&Sty(this);g.Nz(this.K);this.K=g.CW((0,g.hI)(this.start,this),1E4)}; g.T.add=function(O,V){H4(this);R7F(this,O);Cl(this,!1);this.publish("screenChange");V(O);O.token||Sty(this)}; g.T.remove=function(O,V){var J=H4(this);PMs(this,O)&&(Cl(this,!1),J=!0);V(O);J&&this.publish("screenChange")}; g.T.y$=function(O,V,J,y){var l=H4(this),m=this.get(O.id);m?(m.name!=V&&(m.name=V,Cl(this,!1),l=!0),J(O)):y(Error("no such local screen."));l&&this.publish("screenChange")}; g.T.U5=function(){g.Nz(this.K);jO.EE.U5.call(this)}; g.T.ujw=function(O){H4(this);var V=this.screens.length;O=O&&O.screens||[];for(var J=O.length,y=0;y20)break a;F=V(m,H)}m=F}l.name=m}J(x0(this,l))},this), onError:(0,g.hI)(function(l){y(Error("pairing request failed: "+l.status))},this), onTimeout:(0,g.hI)(function(){y(Error("pairing request timed out."))},this)})}; g.T.U5=function(){g.C1(this.j);g.C1(this.K);NC.EE.U5.call(this)}; g.T.kLl=function(){F2n(this);this.publish("screenChange");this.K.update()}; NC.prototype.dispose=NC.prototype.dispose;g.nd(W4,g.BF);g.T=W4.prototype;g.T.Cw=function(O){this.GL()||(O&&(Zc(this,""+O),this.publish("sessionFailed")),this.K=null,this.publish("sessionScreen",null))}; g.T.info=function(O){Vi(this.dW,O)}; g.T.xU=function(){return null}; g.T.oD=function(O){var V=this.j;O?(V.displayStatus=new chrome.cast.ReceiverDisplayStatus(O,[]),V.displayStatus.showStop=!0):V.displayStatus=null;chrome.cast.setReceiverDisplayStatus(V,(0,g.hI)(function(){this.info("Updated receiver status for "+V.friendlyName+": "+O)},this),(0,g.hI)(function(){Zc(this,"Failed to update receiver status for: "+V.friendlyName)},this))}; g.T.U5=function(){this.oD("");W4.EE.U5.call(this)};g.I(zZ,W4);g.T=zZ.prototype;g.T.Fm=function(O){if(this.U){if(this.U==O)return;Zc(this,"Overriding cast session with new session object");Y$z(this);this.fD=!1;this.qX="unknown";this.U.removeUpdateListener(this.lw);this.U.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.O5)}this.U=O;this.U.addUpdateListener(this.lw);this.U.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.O5);cGy(this,"getMdxSessionStatus")}; g.T.gj=function(O){this.info("launchWithParams no-op for Cast: "+g.d4(O))}; g.T.stop=function(){this.U?this.U.stop((0,g.hI)(function(){this.Cw()},this),(0,g.hI)(function(){this.Cw(Error("Failed to stop receiver app."))},this)):this.Cw(Error("Stopping cast device without session."))}; g.T.oD=function(){}; g.T.U5=function(){this.info("disposeInternal");Y$z(this);this.U&&(this.U.removeUpdateListener(this.lw),this.U.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.O5));this.U=null;W4.prototype.U5.call(this)}; g.T.v3v=function(O,V){if(!this.GL())if(V)if(V=DC(V),g.YE(V))switch(O=""+V.type,V=V.data||{},this.info("onYoutubeMessage_: "+O+" "+g.d4(V)),O){case "mdxSessionStatus":UvE(this,V);break;case "loungeToken":sHz(this,V);break;default:Zc(this,"Unknown youtube message: "+O)}else Zc(this,"Unable to parse message.");else Zc(this,"No data in message.")}; g.T.S3=function(O,V,J,y){g.Nz(this.T);this.T=0;HzI(this.D,this.j.label,O,this.j.friendlyName,(0,g.hI)(function(l){l?V(l):y>=0?(Zc(this,"Screen "+O+" appears to be offline. "+y+" retries left."),this.T=g.CW((0,g.hI)(this.S3,this,O,V,J,y-1),300)):J(Error("Unable to fetch screen."))},this),J)}; g.T.xU=function(){return this.U}; g.T.Y5=function(O){this.GL()||O||(Zc(this,"Cast session died."),this.Cw())};g.I(c4,W4);g.T=c4.prototype;g.T.Fm=function(O){this.U=O;this.U.addUpdateListener(this.Vz)}; g.T.gj=function(O){this.ol=O;this.KD()}; g.T.stop=function(){wCI(this);this.U?this.U.stop((0,g.hI)(this.Cw,this,null),(0,g.hI)(this.Cw,this,"Failed to stop DIAL device.")):this.Cw()}; g.T.U5=function(){wCI(this);this.U&&this.U.removeUpdateListener(this.Vz);this.U=null;W4.prototype.U5.call(this)}; g.T.MC=function(O){this.GL()||O||(Zc(this,"DIAL session died."),this.W(),this.W=function(){},this.Cw())};g.I(eO,W4);eO.prototype.stop=function(){this.Cw()}; eO.prototype.Fm=function(){}; eO.prototype.gj=function(){g.Nz(this.U);this.U=NaN;var O=HD(this.D.Nj(),this.j.label);O?Ur(this,O):this.Cw(Error("No such screen"))}; eO.prototype.U5=function(){g.Nz(this.U);this.U=NaN;W4.prototype.U5.call(this)};g.I(IK,g.BF);g.T=IK.prototype; g.T.init=function(O,V){chrome.cast.timeout.requestSession=3E4;var J=new chrome.cast.SessionRequest(this.T,[chrome.cast.Capability.AUDIO_OUT]);g.Ut("desktop_enable_cast_connect")&&(J.androidReceiverCompatible=!0);this.qX||(J.dialRequest=new chrome.cast.DialRequest("YouTube"));var y=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;O=O||this.V?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var l=(0,g.hI)(this.W8W,this);J=new chrome.cast.ApiConfig(J,(0,g.hI)(this.VE, this),l,y,O);J.customDialLaunchCallback=(0,g.hI)(this.yCj,this);chrome.cast.initialize(J,(0,g.hI)(function(){this.GL()||(chrome.cast.addReceiverActionListener(this.W),uRV(),this.j.subscribe("onlineScreenChange",(0,g.hI)(this.yj,this)),this.U=nOy(this),chrome.cast.setCustomReceivers(this.U,function(){},(0,g.hI)(function(m){this.pu("Failed to set initial custom receivers: "+g.d4(m))},this)),this.publish("yt-remote-cast2-availability-change",aK(this)),V(!0))},this),(0,g.hI)(function(m){this.pu("Failed to initialize API: "+ g.d4(m)); V(!1)},this))}; g.T.gIi=function(O,V){Y0("Setting connected screen ID: "+O+" -> "+V);if(this.K){var J=this.K.K;if(!O||J&&J.id!=O)Y0("Unsetting old screen status: "+this.K.j.friendlyName),b5(this,null)}if(O&&V){if(!this.K){O=HD(this.j.Nj(),O);if(!O){Y0("setConnectedScreenStatus: Unknown screen.");return}if(O.idType=="shortLived"){Y0("setConnectedScreenStatus: Screen with id type to be short lived.");return}J=Mds(this,O);J||(Y0("setConnectedScreenStatus: Connected receiver not custom..."),J=new chrome.cast.Receiver(O.uuid? O.uuid:O.id,O.name),J.receiverType=chrome.cast.ReceiverType.CUSTOM,this.U.push(J),chrome.cast.setCustomReceivers(this.U,function(){},(0,g.hI)(function(y){this.pu("Failed to set initial custom receivers: "+g.d4(y))},this))); Y0("setConnectedScreenStatus: new active receiver: "+J.friendlyName);b5(this,new eO(this.j,J),!0)}this.K.oD(V)}else Y0("setConnectedScreenStatus: no screen.")}; g.T.yOE=function(O){this.GL()?this.pu("Setting connection data on disposed cast v2"):this.K?this.K.gj(O):this.pu("Setting connection data without a session")}; g.T.TZ=function(){this.GL()?this.pu("Stopping session on disposed cast v2"):this.K?(this.K.stop(),b5(this,null)):Y0("Stopping non-existing session")}; g.T.requestSession=function(){chrome.cast.requestSession((0,g.hI)(this.VE,this),(0,g.hI)(this.SE5,this))}; g.T.U5=function(){this.j.unsubscribe("onlineScreenChange",(0,g.hI)(this.yj,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.W);var O=G8z,V=g.cn("yt.mdx.remote.debug.handlers_");g.um(V||[],O);g.C1(this.K);g.BF.prototype.U5.call(this)}; g.T.pu=function(O){Vi("Controller",O)}; g.T.w3=function(O,V){this.K==O&&(V||b5(this,null),this.publish("yt-remote-cast2-session-change",V))}; g.T.f_w=function(O,V){if(!this.GL())if(O)switch(O.friendlyName=chrome.cast.unescape(O.friendlyName),Y0("onReceiverAction_ "+O.label+" / "+O.friendlyName+"-- "+V),V){case chrome.cast.ReceiverAction.CAST:if(this.K)if(this.K.j.label!=O.label)Y0("onReceiverAction_: Stopping active receiver: "+this.K.j.friendlyName),this.K.stop();else{Y0("onReceiverAction_: Casting to active receiver.");this.K.K&&this.publish("yt-remote-cast2-session-change",this.K.K);break}switch(O.receiverType){case chrome.cast.ReceiverType.CUSTOM:b5(this, new eO(this.j,O));break;case chrome.cast.ReceiverType.DIAL:b5(this,new c4(this.j,O,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:b5(this,new zZ(this.j,O,this.config_));break;default:this.pu("Unknown receiver type: "+O.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.K&&this.K.j.label==O.label?this.K.stop():this.pu("Stopping receiver w/o session: "+O.friendlyName)}else this.pu("onReceiverAction_ called without receiver.")}; g.T.yCj=function(O){if(this.GL())return Promise.reject(Error("disposed"));var V=O.receiver;V.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.pu("Not DIAL receiver: "+V.friendlyName),V.receiverType=chrome.cast.ReceiverType.DIAL);var J=this.K?this.K.j:null;if(!J||J.label!=V.label)return this.pu("Receiving DIAL launch request for non-clicked DIAL receiver: "+V.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(J&&J.label==V.label&&J.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.K.K)return Y0("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.K.K),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.pu('Changing CAST intent from "'+J.receiverType+'" to "dial" for '+V.friendlyName);b5(this,new c4(this.j,V,this.D,this.config_))}V=this.K;V.T=O;V.T.appState==chrome.cast.DialAppState.RUNNING?(O=V.T.extraData||{},J=O.screenId||null,sr(V)&&O.loungeToken?O.loungeTokenRefreshIntervalMs?O=hKV(V,{name:V.j.friendlyName,screenId:O.screenId,loungeToken:O.loungeToken,dialId:V.T.receiver.label, screenIdType:"shortLived"},O.loungeTokenRefreshIntervalMs):(g.rG(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(O)+".")),O=oOm(V,J)):O=oOm(V,J)):O=pCD(V);return O}; g.T.VE=function(O){var V=this;if(!this.GL()&&!this.V){Y0("New cast session ID: "+O.sessionId);var J=O.receiver;if(J.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.K)if(J.receiverType==chrome.cast.ReceiverType.CAST)Y0("Got resumed cast session before resumed mdx connection."),J.friendlyName=chrome.cast.unescape(J.friendlyName),b5(this,new zZ(this.j,J,this.config_),!0);else{this.pu("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var y=this.K.j,l=HD(this.j.Nj(), y.label);l&&mn(l,J.label)&&y.receiverType!=chrome.cast.ReceiverType.CAST&&J.receiverType==chrome.cast.ReceiverType.CAST&&(Y0("onSessionEstablished_: manual to cast session change "+J.friendlyName),g.C1(this.K),this.K=new zZ(this.j,J,this.config_),this.K.subscribe("sessionScreen",(0,g.hI)(this.w3,this,this.K)),this.K.subscribe("sessionFailed",function(){return L2y(V,V.K)}),this.K.gj(null)); this.K.Fm(O)}}}; g.T.NC=function(){return this.K?this.K.xU():null}; g.T.SE5=function(O){this.GL()||(this.pu("Failed to estabilish a session: "+g.d4(O)),O.code!=chrome.cast.ErrorCode.CANCEL&&b5(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.T.W8W=function(O){Y0("Receiver availability updated: "+O);if(!this.GL()){var V=aK(this);this.S=O==chrome.cast.ReceiverAvailability.AVAILABLE;aK(this)!=V&&this.publish("yt-remote-cast2-availability-change",aK(this))}}; g.T.yj=function(){this.GL()||(this.U=nOy(this),Y0("Updating custom receivers: "+g.d4(this.U)),chrome.cast.setCustomReceivers(this.U,function(){},(0,g.hI)(function(){this.pu("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",aK(this)))}; IK.prototype.setLaunchParams=IK.prototype.yOE;IK.prototype.setConnectedScreenStatus=IK.prototype.gIi;IK.prototype.stopSession=IK.prototype.TZ;IK.prototype.getCastSession=IK.prototype.NC;IK.prototype.requestSession=IK.prototype.requestSession;IK.prototype.init=IK.prototype.init;IK.prototype.dispose=IK.prototype.dispose;var PHs=g.iX(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),uQz=[],GbI=g.$a(PHs);g.T=MC.prototype; g.T.reset=function(O){this.listId="";this.index=-1;this.videoId="";PjF(this);this.volume=-1;this.muted=!1;O&&(this.index=O.index,this.listId=O.listId,this.videoId=O.videoId,this.playerState=O.playerState,this.volume=O.volume,this.muted=O.muted,this.audioTrackId=O.audioTrackId,this.trackData=O.trackData,this.hasPrevious=O.hasPrevious,this.hasNext=O.hasNext,this.V=O.playerTime,this.W=O.playerTimeAt,this.j=O.seekableStart,this.S=O.seekableEnd,this.U=O.duration,this.loadedTime=O.loadedTime,this.K=O.liveIngestionTime, this.D=!isNaN(this.K))}; g.T.isPlaying=function(){return this.playerState==1}; g.T.isBuffering=function(){return this.playerState==3}; g.T.vH=function(O){this.U=isNaN(O)?0:O}; g.T.getDuration=function(){return this.D?this.U+Ll(this):this.U}; g.T.clone=function(){return new MC(S$z(this))};g.I(gD,g.BF);g.T=gD.prototype;g.T.getState=function(){return this.U}; g.T.CJ=function(){return this.D.getReconnectTimeout()}; g.T.N1=function(){this.D.reconnect()}; g.T.play=function(){Qi(this)?(this.K?this.K.play(null,g.qY,u5(this,"play")):tf(this,"play"),VAC(this,1,XJ(qC(this))),this.publish("remotePlayerChange")):GZ(this,this.play)}; g.T.pause=function(){Qi(this)?(this.K?this.K.pause(null,g.qY,u5(this,"pause")):tf(this,"pause"),VAC(this,2,XJ(qC(this))),this.publish("remotePlayerChange")):GZ(this,this.pause)}; g.T.seekTo=function(O){if(Qi(this)){if(this.K){var V=qC(this),J=new chrome.cast.media.SeekRequest;J.currentTime=O;V.isPlaying()||V.isBuffering()?J.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:J.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.K.seek(J,g.qY,u5(this,"seekTo",{newTime:O}))}else tf(this,"seekTo",{newTime:O});VAC(this,3,O);this.publish("remotePlayerChange")}else GZ(this,g.oz(this.seekTo,O))}; g.T.stop=function(){if(Qi(this)){this.K?this.K.stop(null,g.qY,u5(this,"stopVideo")):tf(this,"stopVideo");var O=qC(this);O.index=-1;O.videoId="";PjF(O);Kl(this,O);this.publish("remotePlayerChange")}else GZ(this,this.stop)}; g.T.setVolume=function(O,V){if(Qi(this)){var J=qC(this);if(this.j){if(J.volume!=O){var y=Math.round(O)/100;this.j.setReceiverVolumeLevel(y,(0,g.hI)(function(){Jf("set receiver volume: "+y)},this),(0,g.hI)(function(){this.pu("failed to set receiver volume.")},this))}J.muted!=V&&this.j.setReceiverMuted(V,(0,g.hI)(function(){Jf("set receiver muted: "+V)},this),(0,g.hI)(function(){this.pu("failed to set receiver muted.")},this))}else{var l={volume:O, muted:V};J.volume!=-1&&(l.delta=O-J.volume);tf(this,"setVolume",l)}J.muted=V;J.volume=O;Kl(this,J)}else GZ(this,g.oz(this.setVolume,O,V))}; g.T.cP=function(O,V){if(Qi(this)){var J=qC(this);O={videoId:O};V&&(J.trackData={trackName:V.name,languageCode:V.languageCode,sourceLanguageCode:V.translationLanguage?V.translationLanguage.languageCode:"",languageName:V.languageName,kind:V.kind},O.style=g.d4(V.style),g.h0(O,J.trackData));tf(this,"setSubtitlesTrack",O);Kl(this,J)}else GZ(this,g.oz(this.cP,O,V))}; g.T.setAudioTrack=function(O,V){Qi(this)?(V=V.getLanguageInfo().getId(),tf(this,"setAudioTrack",{videoId:O,audioTrackId:V}),O=qC(this),O.audioTrackId=V,Kl(this,O)):GZ(this,g.oz(this.setAudioTrack,O,V))}; g.T.playVideo=function(O,V,J,y,l,m,H){y=y===void 0?null:y;l=l===void 0?null:l;m=m===void 0?null:m;H=H===void 0?null:H;var F=qC(this),N={videoId:O};J!==void 0&&(N.currentIndex=J);Er(F,O,J||0);V!==void 0&&(nl(F,V),N.currentTime=V);y&&(N.listId=y);l&&(N.playerParams=l);m&&(N.clickTrackingParams=m);H&&(N.locationInfo=g.d4(H));tf(this,"setPlaylist",N);y||Kl(this,F)}; g.T.Dy=function(O,V){if(Qi(this)){if(O&&V){var J=qC(this);Er(J,O,V);Kl(this,J)}tf(this,"previous")}else GZ(this,g.oz(this.Dy,O,V))}; g.T.nextVideo=function(O,V){if(Qi(this)){if(O&&V){var J=qC(this);Er(J,O,V);Kl(this,J)}tf(this,"next")}else GZ(this,g.oz(this.nextVideo,O,V))}; g.T.yP=function(){if(Qi(this)){tf(this,"clearPlaylist");var O=qC(this);O.reset();Kl(this,O);this.publish("remotePlayerChange")}else GZ(this,this.yP)}; g.T.Q9=function(){Qi(this)?tf(this,"dismissAutoplay"):GZ(this,this.Q9)}; g.T.dispose=function(){if(this.U!=3){var O=this.U;this.U=3;this.publish("proxyStateChange",O,this.U)}g.BF.prototype.dispose.call(this)}; g.T.U5=function(){OHz(this);this.D=null;this.W.clear();dD(this,null);g.BF.prototype.U5.call(this)}; g.T.w1=function(O){if((O!=this.U||O==2)&&this.U!=3&&O!=0){var V=this.U;this.U=O;this.publish("proxyStateChange",V,O);if(O==1)for(;!this.W.isEmpty();)V=O=this.W,V.K.length===0&&(V.K=V.j,V.K.reverse(),V.j=[]),O.K.pop().apply(this);else O==3&&this.dispose()}}; g.T.mfn=function(O,V){this.publish(O,V)}; g.T.rCn=function(O){if(!O)this.yx(null),dD(this,null);else if(this.j.receiver.volume){O=this.j.receiver.volume;var V=qC(this),J=Math.round(100*O.level||0);if(V.volume!=J||V.muted!=O.muted)Jf("Cast volume update: "+O.level+(O.muted?" muted":"")),V.volume=J,V.muted=!!O.muted,Kl(this,V)}}; g.T.yx=function(O){Jf("Cast media: "+!!O);this.K&&this.K.removeUpdateListener(this.T);if(this.K=O)this.K.addUpdateListener(this.T),JDF(this),this.publish("remotePlayerChange")}; g.T.ACB=function(O){O?(JDF(this),this.publish("remotePlayerChange")):this.yx(null)}; g.T.md=function(){tf(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.T.orW=function(){var O=izC();O&&dD(this,O)}; g.T.pu=function(O){Vi("CP",O)};g.I(i5,g.BF);g.T=i5.prototype; g.T.connect=function(O,V){if(V){var J=V.listId,y=V.videoId,l=V.videoIds,m=V.playerParams,H=V.clickTrackingParams,F=V.index,N={videoId:y},x=V.currentTime,W=V.locationInfo;V=V.loopMode;x!==void 0&&(N.currentTime=x<=5?0:x);m&&(N.playerParams=m);W&&(N.locationInfo=W);H&&(N.clickTrackingParams=H);J&&(N.listId=J);l&&l.length>0&&(N.videoIds=l.join(","));F!==void 0&&(N.currentIndex=F);this.Vz&&(N.loopMode=V||"LOOP_MODE_OFF");J&&(this.K.listId=J);this.K.videoId=y;this.K.index=F||0;this.K.state=3;nl(this.K, x);this.W="UNSUPPORTED";J=this.Vz?"setInitialState":"setPlaylist";Af("Connecting with "+J+" and params: "+g.d4(N));this.j.connect({method:J,params:g.d4(N)},O,TCV())}else Af("Connecting without params"),this.j.connect({},O,TCV());$Vy(this)}; g.T.fG=function(O){this.j.fG(O)}; g.T.dispose=function(){this.GL()||(g.zD("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),rD(this,3));g.BF.prototype.dispose.call(this)}; g.T.U5=function(){HHD(this);CHz(this);jjm(this);g.Nz(this.T);this.T=NaN;g.Nz(this.qX);this.qX=NaN;this.D=null;g.ed(this.KD);this.KD.length=0;this.j.dispose();g.BF.prototype.U5.call(this);this.W=this.S=this.U=this.K=this.j=null}; g.T.Ss=function(O){if(!this.U||this.U.length===0)return!1;for(var V=g.n(this.U),J=V.next();!J.done;J=V.next())if(!J.value.capabilities.has(O))return!1;return!0}; g.T.NQ=function(){var O=3;this.GL()||(O=0,isNaN(this.Wk())?this.j.T9()&&isNaN(this.V)&&(O=1):O=2);return O}; g.T.oO=function(O){Af("Disconnecting with "+O);g.zD("yt.mdx.remote.remoteClient_",null);HHD(this);this.publish("beforeDisconnect",O);O==1&&F9();this.j.disconnect(O);this.dispose()}; g.T.Po=function(){var O=this.K;this.D&&(O=this.K.clone(),Er(O,this.D,O.index));return S$z(O)}; g.T.Q5W=function(O){var V=this,J=new MC(O);J.videoId&&J.videoId!=this.K.videoId&&(this.D=J.videoId,g.Nz(this.T),this.T=g.CW(function(){if(V.D){var l=V.D;V.D=null;V.K.videoId!=l&&RK(V,"getNowPlaying")}},5E3)); var y=[];this.K.listId==J.listId&&this.K.videoId==J.videoId&&this.K.index==J.index||y.push("remoteQueueChange");this.K.playerState==J.playerState&&this.K.volume==J.volume&&this.K.muted==J.muted&&XJ(this.K)==XJ(J)&&g.d4(this.K.trackData)==g.d4(J.trackData)||y.push("remotePlayerChange");this.K.reset(O);g.Cu(y,function(l){this.publish(l)},this)}; g.T.LH=function(){var O=this.j.getDeviceId(),V=g.Qs(this.U,function(J){return J.type=="REMOTE_CONTROL"&&J.id!=O}); return V?V.id:""}; g.T.Wk=function(){return this.j.CJ()}; g.T.oe=function(){return this.W||"UNSUPPORTED"}; g.T.k$=function(){return this.S||""}; g.T.JH=function(){!isNaN(this.Wk())&&this.j.N1()}; g.T.oIw=function(O,V){RK(this,O,V);N9z(this)}; g.T.Iw=function(){var O=g.Mz("SAPISID","")||g.Mz("__Secure-1PAPISID")||"",V=g.Mz("__Secure-3PAPISID","")||"";if(!O&&!V)return"";O=g.nD(g.LD(O),2);V=g.nD(g.LD(V),2);return g.nD(g.LD(","+O+","+V),2)}; i5.prototype.subscribe=i5.prototype.subscribe;i5.prototype.unsubscribeByKey=i5.prototype.nE;i5.prototype.getProxyState=i5.prototype.NQ;i5.prototype.disconnect=i5.prototype.oO;i5.prototype.getPlayerContextData=i5.prototype.Po;i5.prototype.setPlayerContextData=i5.prototype.Q5W;i5.prototype.getOtherConnectedRemoteId=i5.prototype.LH;i5.prototype.getReconnectTimeout=i5.prototype.Wk;i5.prototype.getAutoplayMode=i5.prototype.oe;i5.prototype.getAutoplayVideoId=i5.prototype.k$;i5.prototype.reconnect=i5.prototype.JH; i5.prototype.sendMessage=i5.prototype.oIw;i5.prototype.getXsrfToken=i5.prototype.Iw;i5.prototype.isCapabilitySupportedOnConnectedDevices=i5.prototype.Ss;g.I(aVy,$0);g.T=aVy.prototype;g.T.Nj=function(O){return this.lB.$_gs(O)}; g.T.contains=function(O){return!!this.lB.$_c(O)}; g.T.get=function(O){return this.lB.$_g(O)}; g.T.start=function(){this.lB.$_st()}; g.T.add=function(O,V,J){this.lB.$_a(O,V,J)}; g.T.remove=function(O,V,J){this.lB.$_r(O,V,J)}; g.T.y$=function(O,V,J,y){this.lB.$_un(O,V,J,y)}; g.T.U5=function(){for(var O=this.K.length,V=0;V1&&!this.G.getOption("remote","quickCast")?(this.NB=g.FC(O,this.K,this),this.w8(g.Ia(O,this.K)),O=this.G.getOption("remote","currentReceiver"),O=this.K(O),this.options[O]&&this.bB(O),this.enable(!0)):this.enable(!1)}; Uv.prototype.K=function(O){return O.key}; Uv.prototype.r0=function(O){return O==="cast-selector-receiver"?"Cast...":this.NB[O].name}; Uv.prototype.Tb=function(O){g.og.prototype.Tb.call(this,O);this.G.setOption("remote","currentReceiver",this.NB[O]);this.mp.x8()};g.I(ADz,g.zm);g.T=ADz.prototype; g.T.create=function(){var O=this.player.Y(),V=g.Oj(O);O={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:O.L("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:O.L("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:O.L("enable_cast_short_lived_lounge_token")};oPs(V,O);this.subscriptions.push(g.AS("yt-remote-before-disconnect",this.XB5,this));this.subscriptions.push(g.AS("yt-remote-connection-change",this.Xnl,this));this.subscriptions.push(g.AS("yt-remote-receiver-availability-change",this.Fa, this));this.subscriptions.push(g.AS("yt-remote-auto-connect",this.vpz,this));this.subscriptions.push(g.AS("yt-remote-receiver-resumed",this.Dfn,this));this.subscriptions.push(g.AS("mdx-privacy-popup-confirm",this.buz,this));this.subscriptions.push(g.AS("mdx-privacy-popup-cancel",this.ZuD,this));this.Fa()}; g.T.load=function(){this.player.cancelPlayback();g.zm.prototype.load.call(this);this.lV=new uhz(this.player.Y(),this);this.player.Nt(this.lV);this.IK=new Qjn(this,this.player,this.hx);var O=(O=dVC())?O.currentTime:0;var V=nPF()?new gD(lP(),void 0):null;O==0&&V&&(O=XJ(qC(V)));O!==0&&this.VK(O);rDn(this,this.Pf,this.Pf);this.player.Ap(6)}; g.T.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Vb();this.Ud=this.TX;g.FM(this.IK,this.hx);this.hx=this.lV=this.IK=null;g.zm.prototype.unload.call(this);this.player.Ap(5);Zo(this)}; g.T.U5=function(){g.rS(this.subscriptions);g.zm.prototype.U5.call(this)}; g.T.Vv=function(O){var V=g.jF.apply(1,arguments);this.loaded&&this.IK.aK.apply(this.IK,[O].concat(g.q(V)))}; g.T.getAdState=function(){return this.Kf}; g.T.hasPrevious=function(){return this.hx?qC(this.hx).hasPrevious:!1}; g.T.hasNext=function(){return this.hx?qC(this.hx).hasNext:!1}; g.T.VK=function(O,V){this.N_=O||0;this.player.publish("progresssync",O,V);this.player.qG("onVideoProgress",O||0)}; g.T.getCurrentTime=function(){return this.N_}; g.T.getDuration=function(){return qC(this.hx).getDuration()||0}; g.T.dN=function(){var O=qC(this.hx);return O.D?O.K+Ll(O):O.K}; g.T.Hc=function(){return qC(this.hx).loadedTime}; g.T.U9=function(){return kbd(qC(this.hx))}; g.T.xo=function(){var O=qC(this.hx);return O.j>0?O.j+Ll(O):O.j}; g.T.getProgressState=function(){var O=qC(this.hx),V=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:O.playerState!=1081&&this.player.SE(),clipEnd:V.clipEnd,clipStart:V.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.dN(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Hc(),seekableEnd:this.U9(),seekableStart:this.xo(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.T.isAtLiveHead=function(){return kbd(qC(this.hx))-this.getCurrentTime()<=1}; g.T.nextVideo=function(){this.hx&&this.hx.nextVideo()}; g.T.Dy=function(){this.hx&&this.hx.Dy()}; g.T.XB5=function(O){O===1&&(this.ri=this.hx?qC(this.hx):null)}; g.T.Xnl=function(){var O=nPF()?new gD(lP(),void 0):null;if(O){var V=this.Ud;this.loaded&&this.unload();this.hx=O;this.ri=null;V.key!==this.TX.key&&(this.Ud=V,this.load())}else g.C1(this.hx),this.hx=null,this.loaded&&(this.unload(),(O=this.ri)&&O.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(O.videoId,XJ(O)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.T.Fa=function(){var O=[this.TX],V=O.concat,J=vPs();oK()&&g.vC("yt-remote-cast-available")&&J.push({key:"cast-selector-receiver",name:"Cast..."});this.NB=V.call(O,J);O=MAy()||this.TX;zq(this,O);this.player.qG("onMdxReceiversChange")}; g.T.vpz=function(){var O=MAy();zq(this,O)}; g.T.Dfn=function(){this.Ud=MAy()}; g.T.buz=function(){this.qt=!0;Zo(this);j6=!1;mI&&Ho(mI,1);mI=null}; g.T.ZuD=function(){this.qt=!1;Zo(this);zq(this,this.TX);this.Ud=this.TX;j6=!1;mI=null;this.player.playVideo()}; g.T.NU=function(O,V){switch(O){case "casting":return this.loaded;case "receivers":return this.NB;case "currentReceiver":return V&&(V.key==="cast-selector-receiver"?RKz():zq(this,V)),this.loaded?this.Ud:this.TX;case "quickCast":return this.NB.length===2&&this.NB[1].key==="cast-selector-receiver"?(V&&RKz(),!0):!1}}; g.T.md=function(){this.hx.md()}; g.T.W1=function(){return!1}; g.T.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.T.isLoggedIn=function(){var O,V;return((O=g.ts("PLAYER_CONFIG"))==null?void 0:(V=O.args)==null?void 0:V.authuser)!==void 0?!0:!(!g.ts("SESSION_INDEX")&&!g.ts("LOGGED_IN"))};g.Z8("remote",ADz);})(_yt_player);