(function(g){var window=this;'use strict';var $yh=function(O){if(O instanceof g.m4)return O;if(typeof O.lK=="function")return O.lK(!1);if(g.eG(O)){var b=0,a=new g.m4;a.next=function(){for(;;){if(b>=O.length)return g.F4;if(b in O)return g.Jc(O[b++]);b++}}; return a}throw Error("Not implemented");},Cy$=function(O,b,a){if(g.eG(O))g.pg(O,b,a); else for(O=$yh(O);;){var N=O.next();if(N.done)break;b.call(a,N.value,void 0,O)}},Oz=function(O){g.wA(O,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.s$()).toString(36)); return O},bf=function(O,b,a){Array.isArray(a)||(a=[String(a)]); g.PAz(O.X,b,a)},dyC=function(O,b){var a=[]; Cy$(b,function(N){try{var k=g.Pb.prototype.G.call(this,N,!0)}catch(D){if(D=="Storage: Invalid value was encountered")return;throw D;}k===void 0?a.push(N):g.X0w(k)&&a.push(N)},O); return a},ZlR=function(O,b){dyC(O,b).forEach(function(a){g.Pb.prototype.remove.call(this,a)},O)},Fd$=function(O){if(O.A0){if(O.A0.locationOverrideToken)return{locationOverrideToken:O.A0.locationOverrideToken}; if(O.A0.latitudeE7!=null&&O.A0.longitudeE7!=null)return{latitudeE7:O.A0.latitudeE7,longitudeE7:O.A0.longitudeE7}}return null},gj$=function(O,b){g.tR(O,b)||O.push(b)},BL$=function(O){var b=0,a; for(a in O)b++;return b},Kdr=function(O,b){return g.Lg(O,b)},t1i=function(O){try{return g.le.JSON.parse(O)}catch(b){}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(b){}throw Error("Invalid JSON string: "+O);},aZ=function(O){if(g.le.JSON)try{return g.le.JSON.parse(O)}catch(b){}return t1i(O)},hI$=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/channel/opened",g.KD("channel_type"))},y5g=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/channel/closed",g.KD("channel_type"))},wir=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/channel/message_received",g.KD("channel_type"))},TL$=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/channel/success")},r5$=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/channel/error",g.KD("channel_type"),g.KD("error_type"))},UyM=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},uZM=function(){var O=Nl(); this.T=O;O.cQ("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},A5$=function(O){if(O.Zo&&typeof O.Zo=="function")return O.Zo(); if(typeof Map!=="undefined"&&O instanceof Map||typeof Set!=="undefined"&&O instanceof Set)return Array.from(O.values());if(typeof O==="string")return O.split("");if(g.eG(O)){for(var b=[],a=O.length,N=0;N1){if(a%2)throw Error("Uneven number of arguments");for(var N=0;N5&&(O=O.slice(O.length-5)); var b=g.Xq(gp$(),function(N){return N.loungeToken}),a=g.Xq(O,function(N){return N.loungeToken}); g.iF(a,function(N){return!g.tR(b,N)})&&B6c(); g.Sb("yt-remote-local-screens",O,31536E3)},Bx=function(O){O||(g.fz("yt-remote-session-screen-id"),g.fz("yt-remote-session-video-id")); ZzC();O=FH();g.yD(O,gB());Cl$(O)},tb$=function(){if(!KT){var O=g.lw(); O&&(KT=new g.GW(O))}},hAC=function(){tb$(); return KT?!!KT.get("yt-remote-use-staging-server"):!1},ta=function(O,b){g.F1[O]=!0; var a=g.dx();a&&a.publish.apply(a,arguments);g.F1[O]=!1},yXL=function(){},Nl=function(){if(!ha){ha=new g.V3(new yXL); var O=g.zw("client_streamz_web_flush_count",-1);O!==-1&&(ha.V=O)}return ha},w4v=function(){var O=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return O?parseInt(O[1],10):0},T6$=function(O){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+O)!=-1||document.currentScript.src.indexOf("&"+O)!=-1)},rXG=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},yh=function(O){O.length?Uj$(O.shift(),function(){yh(O)}):uAg()},AX$=function(O){return"chrome-extension://"+O+"/cast_sender.js"},Uj$=function(O,b,a){var N=document.createElement("script"); N.onerror=b;a&&(N.onload=a);g.Ri(N,g.MZ(O));(document.head||document.documentElement).appendChild(N)},WTc=function(){var O=w4v(),b=[]; if(O>1){var a=O-1;b.push("//www.gstatic.com/eureka/clank/"+O+"/cast_sender.js");b.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js")}return b},uAg=function(){var O=rXG(); O&&O(!1,"No cast extension found")},HzR=function(){if(qbG){var O=2,b=rXG(),a=function(){O--; O==0&&b&&b(!0)}; window.__onGCastApiAvailable=a;Uj$("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",uAg,a)}},Ybr=function(){HzR(); var O=WTc();O.push("//www.gstatic.com/eureka/clank/cast_sender.js");yh(O)},mjg=function(){HzR(); var O=WTc();O.push.apply(O,g.H(cXG.map(AX$)));O.push("//www.gstatic.com/eureka/clank/cast_sender.js");yh(O)},wB=function(O,b,a){g.p.call(this); this.Y=a!=null?(0,g.kr)(O,a):O;this.b4=b;this.N=(0,g.kr)(this.Nm,this);this.T=!1;this.G=0;this.V=this.FF=null;this.X=[]},T4=function(){},zAr=function(){g.kL.call(this,"p")},JXh=function(){g.kL.call(this,"o")},Mbi=function(){return EpL=EpL||new g.Th},npr=function(O){g.kL.call(this,"serverreachability",O)},rB=function(O){var b=Mbi(); b.dispatchEvent(new npr(b,O))},p4R=function(O){g.kL.call(this,"statevent",O)},Uz=function(O){var b=Mbi(); b.dispatchEvent(new p4R(b,O))},GoL=function(O,b,a,N){g.kL.call(this,"timingevent",O); this.size=b;this.rtt=a;this.retries=N},uf=function(O,b){if(typeof O!=="function")throw Error("Fn must not be null and must be a function"); return g.le.setTimeout(function(){O()},b)},Aa=function(){},Wx=function(O,b,a,N){this.V=O; this.X=b;this.zo=a;this.BB=N||1;this.m_=new g.Ak(this);this.bV=45E3;this.Py=null;this.Y=!1;this.J=this.p8=this.L=this.UU=this.Tr=this.Ql=this.yl=null;this.Mi=[];this.T=null;this.U=0;this.N=this.Xy=null;this.yp=-1;this.Ni=!1;this.L8=0;this.OU=null;this.Zh=this.C8=this.fF=this.aX=!1;this.G=new opi},opi=function(){this.V=null; this.T="";this.G=!1},PlM=function(O,b,a){O.UU=1; O.L=Oz(b.clone());O.J=a;O.aX=!0;xjD(O,null)},xjD=function(O,b){O.Tr=Date.now(); ql(O);O.p8=O.L.clone();bf(O.p8,"t",O.BB);O.U=0;var a=O.V.UU;O.G=new opi;O.T=vpD(O.V,a?b:null,!O.J);O.L8>0&&(O.OU=new g.dg((0,g.kr)(O.Uu,O,O.T),O.L8));O.m_.listen(O.T,"readystatechange",O.DQ);b=O.Py?g.On(O.Py):{};O.J?(O.Xy||(O.Xy="POST"),b["Content-Type"]="application/x-www-form-urlencoded",O.T.send(O.p8,O.Xy,O.J,b)):(O.Xy="GET",O.T.send(O.p8,O.Xy,null,b));rB(1)},Sb$=function(O){if(!jpR(O))return g.k$(O.T); var b=g.D1(O.T);if(b==="")return"";var a="",N=b.length,k=g.ao(O.T)==4;if(!O.G.V){if(typeof TextDecoder==="undefined")return Hx(O),Yl(O),"";O.G.V=new g.le.TextDecoder}for(var D=0;Db.length)return I0i;b=b.slice(N,N+a);O.U=N+a;return b},ql=function(O){O.Ql=Date.now()+O.bV; Vbc(O,O.bV)},Vbc=function(O,b){if(O.yl!=null)throw Error("WatchDog timer not null"); O.yl=uf((0,g.kr)(O.kF,O),b)},LTM=function(O){O.yl&&(g.le.clearTimeout(O.yl),O.yl=null)},Yl=function(O){O.V.lE()||O.Ni||X4$(O.V,O)},Hx=function(O){LTM(O); g.Bv(O.OU);O.OU=null;O.m_.removeAll();if(O.T){var b=O.T;O.T=null;b.abort();b.dispose()}},kxc=function(O,b){try{var a=O.V; if(a.jM!=0&&(a.T==O||izh(a.G,O)))if(!O.C8&&izh(a.G,O)&&a.jM==3){try{var N=a.Yl.T.parse(b)}catch(U){N=null}if(Array.isArray(N)&&N.length==3){var k=N;if(k[0]==0)a:{if(!a.L){if(a.T)if(a.T.Tr+3E30&&(a.L8=1.5*d);N=a;var Z=O.XO();if(Z){var F=g.sG(Z,"X-Client-Wire-Protocol");if(F){var B=N.G;!B.T&&(g.h_(F,"spdy")||g.h_(F,"quic")||g.h_(F,"h2"))&&(B.X=B.N,B.T=new Set,B.G&&(OH$(B,B.G),B.G=null))}if(N.aX){var K=g.sG(Z,"X-HTTP-Session-Id");K&&(N.A0=K,g.wA(N.Py,N.aX,K))}}a.jM=3;a.N&&a.N.q0();a.pF&&(a.zG=Date.now()-O.Tr);N=a;var t=O;N.o8=bHR(N,N.UU?N.BB:null,N.zo);if(t.C8){aoi(N.G, t);var h=t,y=N.L8;y&&h.setTimeout(y);h.yl&&(LTM(h),ql(h));N.T=t}else Nih(N);a.V.length>0&&Ja(a)}else D[0]!="stop"&&D[0]!="close"||z4(a,7);else a.jM==3&&(D[0]=="stop"||D[0]=="close"?D[0]=="stop"?z4(a,7):a.disconnect():D[0]!="noop"&&a.N&&a.N.iQ(D),a.Mi=0)}rB(4)}catch(U){}},Dfh=function(O,b){this.T=O; this.map=b;this.context=null},sLM=function(O){this.N=O||10; g.le.PerformanceNavigationTiming?(O=g.le.performance.getEntriesByType("navigation"),O=O.length>0&&(O[0].nextHopProtocol=="hq"||O[0].nextHopProtocol=="h2")):O=!!(g.le.chrome&&g.le.chrome.loadTimes&&g.le.chrome.loadTimes()&&g.le.chrome.loadTimes().wasFetchedViaSpdy);this.X=O?this.N:1;this.T=null;this.X>1&&(this.T=new Set);this.G=null;this.V=[]},RZc=function(O){return O.G?!0:O.T?O.T.size>=O.X:!1},eA$=function(O){return O.G?1:O.T?O.T.size:0},izh=function(O,b){return O.G?O.G==b:O.T?O.T.has(b):!1},OH$= function(O,b){O.T?O.T.add(b):O.G=b},aoi=function(O,b){O.G&&O.G==b?O.G=null:O.T&&O.T.has(b)&&O.T.delete(b)},$fR=function(O){if(O.G!=null)return O.V.concat(O.G.Mi); if(O.T!=null&&O.T.size!==0){var b=O.V;O=g.r(O.T.values());for(var a=O.next();!a.done;a=O.next())b=b.concat(a.value.Mi);return b}return g.rv(O.V)},Cjr=function(O,b){var a=new Aa; if(g.le.Image){var N=new Image;N.onload=g.D$(Ez,a,"TestLoadImage: loaded",!0,b,N);N.onerror=g.D$(Ez,a,"TestLoadImage: error",!1,b,N);N.onabort=g.D$(Ez,a,"TestLoadImage: abort",!1,b,N);N.ontimeout=g.D$(Ez,a,"TestLoadImage: timeout",!1,b,N);g.le.setTimeout(function(){if(N.ontimeout)N.ontimeout()},1E4); N.src=O}else b(!1)},dfr=function(O,b){var a=new Aa,N=new AbortController,k=setTimeout(function(){N.abort(); Ez(a,"TestPingServer: timeout",!1,b)},1E4); fetch(O,{signal:N.signal}).then(function(D){clearTimeout(k);D.ok?Ez(a,"TestPingServer: ok",!0,b):Ez(a,"TestPingServer: server error",!1,b)}).catch(function(){clearTimeout(k); Ez(a,"TestPingServer: error",!1,b)})},Ez=function(O,b,a,N,k){try{k&&(k.onload=null,k.onerror=null,k.onabort=null,k.ontimeout=null),N(a)}catch(D){}},ZHM=function(){this.T=new T4},FOg=function(O,b,a){var N=a||""; try{qOC(O,function(k,D){var R=k;g.O$(k)&&(R=g.Xr(k));b.push(N+D+"="+encodeURIComponent(R))})}catch(k){throw b.push(N+"type="+encodeURIComponent("_badmap")),k; }},Ml=function(O,b,a){return a&&a.WF?a.WF[O]||b:b},gar=function(O){this.V=[]; this.BB=this.o8=this.Py=this.zo=this.T=this.A0=this.aX=this.Ni=this.U=this.yp=this.J=null;this.Is=this.p8=0;this.ip=Ml("failFast",!1,O);this.C8=this.yl=this.L=this.Y=this.N=null;this.FX=!0;this.yW=this.OU=-1;this.Zh=this.Mi=this.Tr=0;this.CJ=Ml("baseRetryDelayMs",5E3,O);this.xt=Ml("retryDelaySeedMs",1E4,O);this.qk=Ml("forwardChannelMaxRetries",2,O);this.I8=Ml("forwardChannelRequestTimeoutMs",2E4,O);this.zl=O&&O.PCk||void 0;this.FM=O&&O.tdl||void 0;this.yJ=O&&O.VJi||!1;this.L8=void 0;this.UU=O&&O.akd|| !1;this.X="";this.G=new sLM(O&&O.oR8);this.Yl=new ZHM;this.m_=O&&O.Tx8||!1;this.Ql=O&&O.J9r||!1;this.m_&&this.Ql&&(this.Ql=!1);this.B1=O&&O.DG_||!1;O&&O.njG&&(this.FX=!1);this.pF=!this.m_&&this.FX&&O&&O.LDy||!1;this.Dq=void 0;O&&O.lj&&O.lj>0&&(this.Dq=O.lj);this.R7=void 0;this.zG=0;this.bV=!1;this.fF=this.Xy=null},mw=function(O){O.T&&(Biv(O),O.T.cancel(),O.T=null)},KO$=function(O){mw(O); O.L&&(g.le.clearTimeout(O.L),O.L=null);cx(O);O.G.cancel();O.Y&&(typeof O.Y==="number"&&g.le.clearTimeout(O.Y),O.Y=null)},Ja=function(O){RZc(O.G)||O.Y||(O.Y=!0,g.zh(O.Eu,O),O.Tr=0)},hZv=function(O,b){if(eA$(O.G)>=O.G.X-(O.Y?1:0))return!1; if(O.Y)return O.V=b.Mi.concat(O.V),!0;if(O.jM==1||O.jM==2||O.Tr>=(O.ip?0:O.qk))return!1;O.Y=uf((0,g.kr)(O.Eu,O,b),to$(O,O.Tr));O.Tr++;return!0},wmv=function(O,b){var a; b?a=b.zo:a=O.p8++;var N=O.Py.clone();g.wA(N,"SID",O.X);g.wA(N,"RID",a);g.wA(N,"AID",O.OU);nT(O,N);O.U&&O.J&&g.u4(N,O.U,O.J);a=new Wx(O,O.X,a,O.Tr+1);O.U===null&&(a.Py=O.J);b&&(O.V=b.Mi.concat(O.V));b=yIv(O,a,1E3);a.setTimeout(Math.round(O.I8*.5)+Math.round(O.I8*.5*Math.random()));OH$(O.G,a);PlM(a,N,b)},nT=function(O,b){O.Ni&&g.xr(O.Ni,function(a,N){g.wA(b,N,a)}); O.N&&qOC({},function(a,N){g.wA(b,N,a)})},yIv=function(O,b,a){a=Math.min(O.V.length,a); var N=O.N?(0,g.kr)(O.N.dE,O.N,O):null;a:{for(var k=O.V,D=-1;;){var R=["count="+a];D==-1?a>0?(D=k[0].T,R.push("ofs="+D)):D=0:R.push("ofs="+D);for(var d=!0,Z=0;Z=3)return!1; O.Zh++;O.L=uf((0,g.kr)(O.zI,O),to$(O,O.Mi));O.Mi++;return!0},Biv=function(O){O.Xy!=null&&(g.le.clearTimeout(O.Xy),O.Xy=null)},Tir=function(O){O.T=new Wx(O,O.X,"rpc",O.Zh); O.U===null&&(O.T.Py=O.J);O.T.L8=0;var b=O.o8.clone();g.wA(b,"RID","rpc");g.wA(b,"SID",O.X);g.wA(b,"AID",O.OU);g.wA(b,"CI",O.C8?"0":"1");!O.C8&&O.Dq&&g.wA(b,"TO",O.Dq);g.wA(b,"TYPE","xmlhttp");nT(O,b);O.U&&O.J&&g.u4(b,O.U,O.J);O.L8&&O.T.setTimeout(O.L8);var a=O.T;O=O.BB;a.UU=1;a.L=Oz(b.clone());a.J=null;a.aX=!0;xjD(a,O)},cx=function(O){O.yl!=null&&(g.le.clearTimeout(O.yl),O.yl=null)},X4$=function(O,b){var a=null; if(O.T==b){cx(O);Biv(O);O.T=null;var N=2}else if(izh(O.G,b))a=b.Mi,aoi(O.G,b),N=1;else return;if(O.jM!=0)if(b.Y)if(N==1){a=b.J?b.J.length:0;b=Date.now()-b.Tr;var k=O.Tr;N=Mbi();N.dispatchEvent(new GoL(N,a,b,k));Ja(O)}else Nih(O);else{var D=b.yp;k=b.getLastError();if(k==3||k==0&&D>0||!(N==1&&hZv(O,b)||N==2&&Qpi(O)))switch(a&&a.length>0&&(b=O.G,b.V=b.V.concat(a)),k){case 1:z4(O,5);break;case 4:z4(O,10);break;case 3:z4(O,6);break;default:z4(O,2)}}},to$=function(O,b){var a=O.CJ+Math.floor(Math.random()* O.xt); O.isActive()||(a*=2);return a*b},z4=function(O,b){if(b==2){var a=(0,g.kr)(O.YFL,O),N=O.FM,k=!N; N=new g.Zv(N||"//www.google.com/images/cleardot.gif");g.le.location&&g.le.location.protocol=="http"||g.FQ(N,"https");Oz(N);k?Cjr(N.toString(),a):dfr(N.toString(),a)}else Uz(2);O.jM=0;O.N&&O.N.Cg(b);rI$(O);KO$(O)},rI$=function(O){O.jM=0; O.fF=[];if(O.N){var b=$fR(O.G);if(b.length!=0||O.V.length!=0)g.u$(O.fF,b),g.u$(O.fF,O.V),O.G.V.length=0,g.rv(O.V),O.V.length=0;O.N.hA()}},Uf$=function(O){if(O.jM==0)return O.fF; var b=[];g.u$(b,$fR(O.G));g.u$(b,O.V);return b},bHR=function(O,b,a){var N=g.T$(a); N.T!=""?(b&&g.gA(N,b+"."+N.T),g.Bq(N,N.V)):(N=g.le.location,N=HlG(N.protocol,b?b+"."+N.hostname:N.hostname,+N.port,a));b=O.aX;a=O.A0;b&&a&&g.wA(N,b,a);g.wA(N,"VER",O.dQ);nT(O,N);return N},vpD=function(O,b,a){if(b&&!O.UU)throw Error("Can't create secondary domain capable XhrIo object."); b=O.yJ&&!O.zl?new g.eD(new g.Rn({yO:a})):new g.eD(O.zl);b.U=O.UU;return b},uz$=function(){},AIL=function(){},G4=function(O,b){g.Th.call(this); this.T=new gar(b);this.N=O;this.G=b&&b.wyy||null;O=b&&b.fG_||null;b&&b.inU&&(O?O["X-Client-Protocol"]="webchannel":O={"X-Client-Protocol":"webchannel"});this.T.J=O;O=b&&b.EU_||null;b&&b.Xh&&(O?O["X-WebChannel-Content-Type"]=b.Xh:O={"X-WebChannel-Content-Type":b.Xh});b&&b.XD&&(O?O["X-WebChannel-Client-Profile"]=b.XD:O={"X-WebChannel-Client-Profile":b.XD});this.T.yp=O;(O=b&&b.zGy)&&!g.Kx(O)&&(this.T.U=O);this.Y=b&&b.akd||!1;this.X=b&&b.oOV||!1;(b=b&&b.wO)&&!g.Kx(b)&&(this.T.aX=b,g.VD(this.G,b)&&(O= this.G,b in O&&delete O[b]));this.V=new pT(this)},WOL=function(O){zAr.call(this); O.__headers__&&(this.headers=O.__headers__,this.statusCode=O.__status__,delete O.__headers__,delete O.__status__);var b=O.__sm__;b?this.data=(this.T=g.Si(b))?g.QD(b,this.T):b:this.data=O},q4v=function(O){JXh.call(this); this.status=1;this.errorCode=O},pT=function(O){this.T=O},HHM=function(O,b){this.G=O; this.T=b},Y4G=function(O){return Uf$(O.T).map(function(b){var a=O.G; b=b.map;"__data__"in b?(b=b.__data__,a=a.X?t1i(b):b):a=b;return a})},oZ=function(O,b){if(typeof O!=="function")throw Error("Fn must not be null and must be a function"); return g.le.setTimeout(function(){O()},b)},Px=function(O){xl.dispatchEvent(new cID(xl,O))},cID=function(O){g.kL.call(this,"statevent",O)},vx=function(O,b,a,N){this.T=O; this.X=b;this.U=a;this.Y=N||1;this.G=45E3;this.V=new g.Ak(this);this.N=new g.If;this.N.setInterval(250)},zZD=function(O,b,a){O.H5=1; O.YI=Oz(b.clone());O.gH=a;O.aX=!0;mfh(O,null)},JIM=function(O,b,a,N,k){O.H5=1; O.YI=Oz(b.clone());O.gH=null;O.aX=a;k&&(O.uI=!1);mfh(O,N)},mfh=function(O,b){O.DI=Date.now(); Eag(O);O.AF=O.YI.clone();bf(O.AF,"t",O.Y);O.Qr=0;O.T6=O.T.s6(O.T.UO()?b:null);O.fE>0&&(O.jk=new g.dg((0,g.kr)(O.Ig,O,O.T6),O.fE));O.V.listen(O.T6,"readystatechange",O.EV);b=O.rH?g.On(O.rH):{};O.gH?(O.JF="POST",b["Content-Type"]="application/x-www-form-urlencoded",O.T6.send(O.AF,O.JF,O.gH,b)):(O.JF="GET",O.uI&&!g.lt&&(b.Connection="close"),O.T6.send(O.AF,O.JF,null,b));O.T.Xj(1)},pmc=function(O,b){var a=O.Qr,N=b.indexOf("\n",a); if(N==-1)return MoL;a=Number(b.substring(a,N));if(isNaN(a))return naD;N+=1;if(N+a>b.length)return MoL;b=b.slice(N,N+a);O.Qr=N+a;return b},Eag=function(O){O.wp=Date.now()+O.G; Gxg(O,O.G)},Gxg=function(O,b){if(O.DM!=null)throw Error("WatchDog timer not null"); O.DM=oZ((0,g.kr)(O.zk,O),b)},oag=function(O){O.DM&&(g.le.clearTimeout(O.DM),O.DM=null)},xfh=function(O){O.T.lE()||O.Nr||O.T.GO(O)},j5=function(O){oag(O); g.Bv(O.jk);O.jk=null;O.N.stop();O.V.removeAll();if(O.T6){var b=O.T6;O.T6=null;b.abort();b.dispose()}O.dj&&(O.dj=null)},Pji=function(O,b){try{O.T.BW(O,b),O.T.Xj(4)}catch(a){}},S4G=function(O,b,a,N,k){if(N==0)a(!1); else{var D=k||0;N--;jLD(O,b,function(R){R?a(!0):g.le.setTimeout(function(){S4G(O,b,a,N,D)},D)})}},jLD=function(O,b,a){var N=new Image; N.onload=function(){try{S5(N),a(!0)}catch(k){}}; N.onerror=function(){try{S5(N),a(!1)}catch(k){}}; N.onabort=function(){try{S5(N),a(!1)}catch(k){}}; N.ontimeout=function(){try{S5(N),a(!1)}catch(k){}}; g.le.setTimeout(function(){if(N.ontimeout)N.ontimeout()},b); N.src=O},S5=function(O){O.onload=null; O.onerror=null;O.onabort=null;O.ontimeout=null},IoM=function(O){this.T=O; this.G=new T4},foR=function(O){var b=IZ(O.T,O.g4,"/mail/images/cleardot.gif"); Oz(b);S4G(b.toString(),5E3,(0,g.kr)(O.nh,O),3,2E3);O.Xj(1)},loD=function(O){var b=O.T.Y; b!=null?(Px(5),b?(Px(11),fT(O.T,O,!1)):(Px(12),fT(O.T,O,!0))):(O.mw=new vx(O),O.mw.rH=O.TO,b=O.T,b=IZ(b,b.UO()?O.mS:null,O.nE),Px(5),bf(b,"TYPE","xmlhttp"),JIM(O.mw,b,!1,O.mS,!1))},Voh=function(O,b,a){this.T=1; this.G=[];this.V=[];this.N=new T4;this.J=O||null;this.Y=b!=null?b:null;this.L=a||!1},LOi=function(O,b){this.T=O; this.map=b;this.context=null},Xmg=function(O,b,a,N){g.kL.call(this,"timingevent",O); this.size=b;this.rtt=a;this.retries=N},iHR=function(O){g.kL.call(this,"serverreachability",O)},eZg=function(O){O.hQ(1,0); O.lY=IZ(O,null,O.XR);QLR(O)},OJr=function(O){O.P2&&(O.P2.abort(),O.P2=null); O.TK&&(O.TK.cancel(),O.TK=null);O.gy&&(g.le.clearTimeout(O.gy),O.gy=null);lf(O);O.GP&&(O.GP.cancel(),O.GP=null);O.v2&&(g.le.clearTimeout(O.v2),O.v2=null)},bJD=function(O,b){if(O.T==0)throw Error("Invalid operation: sending map when state is closed"); O.G.push(new LOi(O.CV++,b));O.T!=2&&O.T!=3||QLR(O)},aRh=function(O){var b=0; O.TK&&b++;O.GP&&b++;return b},QLR=function(O){O.GP||O.v2||(O.v2=oZ((0,g.kr)(O.Lg,O),0),O.dW=0)},DnL=function(O,b){if(O.T==1){if(!b){O.zE=Math.floor(Math.random()*1E5); b=O.zE++;var a=new vx(O,"",b);a.rH=O.bD;var N=NqG(O),k=O.lY.clone();g.wA(k,"RID",b);g.wA(k,"CVER","1");Vh(O,k);zZD(a,k,N);O.GP=a;O.T=2}}else O.T==3&&(b?kaR(O,b):O.G.length==0||O.GP||kaR(O))},kaR=function(O,b){if(b)if(O.u1>6){O.G=O.V.concat(O.G); O.V.length=0;var a=O.zE-1;b=NqG(O)}else a=b.U,b=b.gH;else a=O.zE++,b=NqG(O);var N=O.lY.clone();g.wA(N,"SID",O.X);g.wA(N,"RID",a);g.wA(N,"AID",O.zL);Vh(O,N);a=new vx(O,O.X,a,O.dW+1);a.rH=O.bD;a.setTimeout(1E4+Math.round(1E4*Math.random()));O.GP=a;zZD(a,N,b)},Vh=function(O,b){O.Aq&&(O=O.Aq.S2())&&g.xr(O,function(a,N){g.wA(b,N,a)})},NqG=function(O){var b=Math.min(O.G.length,1E3),a=["count="+b]; if(O.u1>6&&b>0){var N=O.G[0].T;a.push("ofs="+N)}else N=0;for(var k={},D=0;D=3)return!1; O.U++;O.gy=oZ((0,g.kr)(O.Ou,O),RfG(O,O.Ux));O.Ux++;return!0},fT=function(O,b,a){O.OM=O.Y==null?a:!O.Y; O.dA=b.PP;O.L||eZg(O)},lf=function(O){O.YD!=null&&(g.le.clearTimeout(O.YD),O.YD=null)},RfG=function(O,b){var a=5E3+Math.floor(Math.random()*1E4); O.isActive()||(a*=2);return a*b},LT=function(O,b){if(b==2||b==9){var a=null; O.Aq&&(a=null);var N=(0,g.kr)(O.uxX,O);a||(a=new g.Zv("//www.google.com/images/cleardot.gif"),Oz(a));jLD(a.toString(),1E4,N)}else Px(2);Cqc(O,b)},Cqc=function(O,b){O.T=0; O.Aq&&O.Aq.Kg(b);dnh(O);OJr(O)},dnh=function(O){O.T=0; O.dA=-1;if(O.Aq)if(O.V.length==0&&O.G.length==0)O.Aq.aA();else{var b=g.rv(O.V),a=g.rv(O.G);O.V.length=0;O.G.length=0;O.Aq.aA(b,a)}},IZ=function(O,b,a){var N=g.T$(a); if(N.T!="")b&&g.gA(N,b+"."+N.T),g.Bq(N,N.V);else{var k=window.location;N=HlG(k.protocol,b?b+"."+k.hostname:k.hostname,+k.port,a)}O.d8&&g.xr(O.d8,function(D,R){g.wA(N,R,D)}); g.wA(N,"VER",O.u1);Vh(O,N);return N},ZJC=function(){},FUD=function(){this.T=[]; this.G=[]},gtD=function(O){g.kL.call(this,"channelMessage"); this.message=O},Bqv=function(O){g.kL.call(this,"channelError"); this.error=O},KUG=function(O,b){this.action=O; this.params=b||{}},XH=function(O,b){g.p.call(this); this.T=new g.sW(this.s38,0,this);g.G(this,this.T);this.b4=5E3;this.G=0;if(typeof O==="function")b&&(O=(0,g.kr)(O,b));else if(O&&typeof O.handleEvent==="function")O=(0,g.kr)(O.handleEvent,O);else throw Error("Invalid listener argument");this.V=O},tji=function(O,b,a,N,k,D,R,d,Z,F,B,K,t,h){a=a===void 0?!1:a; N=N===void 0?function(){return""}:N; k=k===void 0?!1:k;D=D===void 0?!1:D;R=R===void 0?!1:R;d=d===void 0?function(){return g.xL({})}:d; Z=Z===void 0?!1:Z;B=B===void 0?!1:B;K=K===void 0?!1:K;t=t===void 0?!1:t;h=h===void 0?!1:h;this.UU=O;this.yl=b;this.Y=new g.p6;this.G=new XH(this.Ukd,this);this.T=null;this.U=!1;this.J=null;this.Tr="";this.Mi=this.L=0;this.V=[];this.Zh=a;this.aX=N;this.N=D;this.Py=d;this.Ni=F;this.BB=R;this.Xy=null;this.X=g.xL();this.zo=k;this.fF=Z;this.m_=B;this.Ql=K;this.FX=t;this.yp=h;this.L8=new hI$;this.C8=new y5g;this.bV=new TL$;this.p8=new wir;this.OU=new r5$;this.pF=new UyM;this.R7=new uZM},wP$=function(O, b,a,N,k){hfG(O); if(O.T){var D=g.Ny("ID_TOKEN"),R=O.T.bD||{};D?R["x-youtube-identity-token"]=D:delete R["x-youtube-identity-token"];O.T.bD=R}yNi(O);N?(N.getState()!=3&&aRh(N)==0||N.getState(),O.T.connect(b,a,O.yl,N.X,N.zL)):k?O.T.connect(b,a,O.yl,k.sessionId,k.arrayId):O.T.connect(b,a,O.yl)},uxG=function(O,b){return O.FX?!0:O.Ql?Object.values(Tq$).includes(b):O.m_?!Object.values(rN$).includes(b):O.yp?Object.values(Unc).includes(b):!1},qor=function(O){var b,a; g.M(function(N){if(N.G==1)return g.U7(N,2),g.J(N,ANG(O),2);g.c8(N);b=O.V;O.V=[];a=b.length;WU$(O,b,a);Qh(O);return g.zz(N,0)})},WU$=function(O,b,a){for(var N=0;N0?a=Object.assign({},a,b):delete a.Authorization;O.T.bD=a}},yNi=function(O){O.Ni&&!O.N&&YoG(O,O.Ni())},e5=function(O){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.G=!0;O=O||document.location.href;var b=Number(g.Uk(O)[4]||null)||"";b&&(this.port=":"+b);this.domain=g.uQ(O)||"";O=g.A_();O.search("MSIE")>=0&&(O=O.match(/MSIE ([\d.]+)/)[1],g.ud(O,"10.0")<0&&(this.G=!1))},Oh=function(O,b){var a=O.T; O.G&&(a=O.scheme+"://"+O.domain+O.port+O.T);return g.mm(a+b,{})},cNM=function(O,b){g.Th.call(this); var a=this;this.Qt=O();this.Qt.subscribe("handlerOpened",this.qm,this);this.Qt.subscribe("handlerClosed",this.onClosed,this);this.Qt.subscribe("handlerError",function(N,k){a.onError(k)}); this.Qt.subscribe("handlerMessage",this.onMessage,this);this.T=b},mnc=function(O,b,a){var N=this; a=a===void 0?function(){return""}:a; var k=k===void 0?new AIL:k;var D=D===void 0?new g.p6:D;this.pathPrefix=O;this.T=b;this.Tr=a;this.N=D;this.L=null;this.J=this.U=0;this.channel=null;this.Y=0;this.V=new XH(function(){N.V.isActive();var R;((R=N.channel)==null?void 0:eA$((new HHM(R,R.T)).T.G))===0&&N.connect(N.L,N.U)}); this.X={};this.G={};this.yl=!1;this.logger=null;this.Mi=[];this.q3=void 0;this.Py=new hI$;this.Xy=new y5g;this.Ni=new wir;this.aX=new r5$},zfR=function(O){g.Fr(O.channel,"m",function(){O.Y=3; O.V.reset();O.L=null;O.U=0;for(var b=g.r(O.Mi),a=b.next();!a.done;a=b.next())a=a.value,O.channel&&O.channel.send(a);O.Mi=[];O.publish("webChannelOpened");O.Py.LJ("WEB_CHANNEL")}); g.Fr(O.channel,"n",function(){O.Y=0;O.V.isActive()||O.publish("webChannelClosed");var b,a=(b=O.channel)==null?void 0:Y4G(new HHM(b,b.T));a&&(O.Mi=[].concat(g.H(a)));O.Xy.LJ("WEB_CHANNEL")}); g.Fr(O.channel,"p",function(b){var a=b.data;a[0]==="gracefulReconnect"?(O.V.start(),O.channel&&O.channel.close()):O.publish("webChannelMessage",new KUG(a[0],a[1]));O.q3=b.statusCode;O.Ni.LJ("WEB_CHANNEL")}); g.Fr(O.channel,"o",function(){O.q3===401||O.V.start();O.publish("webChannelError");O.aX.LJ("WEB_CHANNEL","")})},JN$=function(O){var b=O.Tr(); b?O.X["x-youtube-lounge-xsrf-token"]=b:delete O.X["x-youtube-lounge-xsrf-token"]},EtD=function(O){g.Th.call(this); this.T=O();this.T.subscribe("webChannelOpened",this.oO,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},Mj$=function(O,b,a,N,k){function D(){return new tji(Oh(O,"/bc"),b,!1,a,N)} a=a===void 0?function(){return""}:a; return g.md("enable_mdx_web_channel_desktop")?new EtD(function(){return new mnc(Oh(O,"/wc"),b,a)}):new cNM(D,k)},otg=function(){var O=ntr; pPD();bJ.push(O);Gai()},aV=function(O,b){pPD(); var a=xnD(O,String(b));bJ.length==0?Pqc(a):(Gai(),g.pg(bJ,function(N){N(a)}))},NF=function(O){aV("CP",O)},pPD=function(){bJ||(bJ=g.Lw("yt.mdx.remote.debug.handlers_")||[],g.VQ("yt.mdx.remote.debug.handlers_",bJ))},Pqc=function(O){var b=(kD+1)%50; kD=b;DM[b]=O;sh||(sh=b==49)},Gai=function(){var O=bJ; if(DM[0]){var b=sh?kD:-1,a={};do a={SO:void 0},b=(b+1)%50,a.SO=DM[b],g.pg(O,function(N){return function(k){k(N.SO)}}(a)); while(b!=kD);DM=Array(50);kD=-1;sh=!1}},xnD=function(O,b){var a=(Date.now()-vtG)/1E3; a.toFixed&&(a=a.toFixed(3));var N=[];N.push("[",a+"s","] ");N.push("[","yt.mdx.remote","] ");N.push(O+": "+b,"\n");return N.join("")},RV=function(O){g.w1.call(this); this.Y=O;this.screens=[]},jtC=function(O,b){var a=O.get(b.uuid)||O.get(b.id); if(a)return O=a.name,a.id=b.id||a.id,a.name=b.name,a.token=b.token,a.uuid=b.uuid||a.uuid,a.name!=O;O.screens.push(b);return!0},Soh=function(O,b){var a=O.screens.length!=b.length; O.screens=g.pm(O.screens,function(D){return!!spi(b,D)}); for(var N=b.length,k=0;k0&&O.X0&&Tm(O,a)},function(b){O.N=function(){}; O.i$(b)})},wrh=function(O){var b={}; b.pairingCode=O.Xy;b.theme=O.UU;hAC()&&(b.env_useStageMdx=1);return g.co(b)},Txg=function(O){return new Promise(function(b){O.Xy=kov(); if(O.Py){var a=new chrome.cast.DialLaunchResponse(!0,wrh(O));b(a);ytc(O)}else O.yl=function(){g.Hi(O.J);O.yl=function(){}; O.J=NaN;var N=new chrome.cast.DialLaunchResponse(!0,wrh(O));b(N);ytc(O)},O.J=g.Wi(function(){O.yl()},100)})},UoC=function(O,b,a){O.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(b)); var N=new $l(b);return(new Promise(function(k){rti(O,N,function(D){D?(O.Mi=!0,g7(O.X,N),K0(O,N),Tm(O,a)):g.sO(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online."));k(D)},5)})).then(function(k){return k?new chrome.cast.DialLaunchResponse(!1):Txg(O)})},u1v=function(O,b){var a=O.L.receiver.label,N=O.G.friendlyName; return(new Promise(function(k){amv(O.X,a,b,N,function(D){D&&D.token&&K0(O,D);k(D)},function(D){tG(O,"Failed to get DIAL screen: "+D); k(null)})})).then(function(k){return k&&k.token?new chrome.cast.DialLaunchResponse(!1):Txg(O)})},rti=function(O,b,a,N){g.Hi(O.Y); O.Y=0;kHv(O.X,b,function(k){k||N<0?a(k):O.Y=g.Wi(function(){rti(O,b,a,N-1)},300)})},Tm=function(O,b){O.info("getDialAppInfoWithTimeout_ "+b); w7(O)&&(g.Hi(O.U),O.U=0,b==0?AtL(O):O.U=g.Wi(function(){AtL(O)},b))},AtL=function(O){w7(O)&&O.V.getDialAppInfo(function(b){O.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b)); b=b.extraData||{};var a=null;if(b.loungeToken){var N;((N=O.T)==null?void 0:N.token)==b.loungeToken&&(a="staleLoungeToken")}else a="missingLoungeToken";a?(O.Tr=a,Tm(O,3E4)):(O.Mi=!1,O.Tr="unknown",$og(O,b.loungeToken),Tm(O,b.loungeTokenRefreshIntervalMs))},function(b){O.info("getDialAppInfo error: "+b); O.Tr="noLoungeTokenResponse";Tm(O,3E4)})},Wvv=function(O){g.Hi(O.Y); O.Y=0;g.Hi(O.U);O.U=0;O.N();O.N=function(){}; g.Hi(O.J)},r7=function(O,b){B5.call(this,O,b,"ManualSession"); this.V=g.Wi((0,g.kr)(this.aQ,this,null),150)},Uh=function(O,b){g.w1.call(this); this.config_=b;this.G=O;this.L=b.appId||"233637DE";this.X=b.theme||"cl";this.J=b.disableCastApi||!1;this.Y=b.forceMirroring||!1;this.T=null;this.U=!1;this.V=[];this.N=(0,g.kr)(this.DJU,this)},qML=function(O,b){return b?g.B$(O.V,function(a){return CT(b,a.label)},O):null},uJ=function(O){aV("Controller",O)},ntr=function(O){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(O)},AG=function(O){return O.U||!!O.V.length||!!O.T},W5=function(O,b,a){b!=O.T&&(g.Bv(O.T),(O.T=b)?(a?O.publish("yt-remote-cast2-receiver-resumed", b.G):O.publish("yt-remote-cast2-receiver-selected",b.G),b.subscribe("sessionScreen",(0,g.kr)(O.Xu,O,b)),b.subscribe("sessionFailed",function(){return H7D(O,b)}),b.T?O.publish("yt-remote-cast2-session-change",b.T):a&&O.T.aQ(null)):O.publish("yt-remote-cast2-session-change",null))},H7D=function(O,b){O.T==b&&O.publish("yt-remote-cast2-session-failed")},YM$=function(O){var b=O.G.j2(),a=O.T&&O.T.G; O=g.Xq(b,function(N){a&&CT(N,a.label)&&(a=null);var k=N.uuid?N.uuid:N.id,D=qML(this,N);D?(D.label=k,D.friendlyName=N.name):(D=new chrome.cast.Receiver(k,N.name),D.receiverType=chrome.cast.ReceiverType.CUSTOM);return D},O); a&&(a.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(a=new chrome.cast.Receiver(a.label,a.friendlyName),a.receiverType=chrome.cast.ReceiverType.CUSTOM),O.push(a));return O},nGh=function(O,b,a,N){N.disableCastApi?qF("Cannot initialize because disabled by Mdx config."):ct$()?moG(b,N)&&(ze$(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?JtD(O,a):(window.__onGCastApiAvailable=function(k,D){k?JtD(O,a):(H5("Failed to load cast API: "+D),EGG(!1),ze$(!1),g.fz("yt-remote-cast-available"),g.fz("yt-remote-cast-receiver"), MmG(),a(!1))},N.loadCastApiSetupScript?g.ht("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?w4v()>=60&&Ybr():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?uAg():w4v()>=89?mjg():(HzR(),yh(cXG.map(AX$))))):qF("Cannot initialize because not running Chrome")},MmG=function(){qF("dispose"); var O=YD();O&&O.dispose();g.VQ("yt.mdx.remote.cloudview.instance_",null);pri(!1);g.K7(GHg);GHg.length=0},c5=function(){return!!g.Ip("yt-remote-cast-installed")},oG$=function(){var O=g.Ip("yt-remote-cast-receiver"); return O?O.friendlyName:null},xoh=function(){qF("clearCurrentReceiver"); g.fz("yt-remote-cast-receiver")},Pp$=function(){return c5()?YD()?YD().getCastSession():(H5("getCastSelector: Cast is not initialized."),null):(H5("getCastSelector: Cast API is not installed!"),null)},vGi=function(){c5()?YD()?mD()?(qF("Requesting cast selector."),YD().requestSession()):(qF("Wait for cast API to be ready to request the session."),GHg.push(g.Br("yt-remote-cast2-api-ready",vGi))):H5("requestCastSelector: Cast is not initialized."):H5("requestCastSelector: Cast API is not installed!")}, zm=function(O,b){mD()?YD().setConnectedScreenStatus(O,b):H5("setConnectedScreenStatus called before ready.")},ct$=function(){var O=g.A_().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.SL||O},js$=function(O,b){YD().init(O,b)},moG=function(O,b){var a=!1; YD()||(O=new Uh(O,b),O.subscribe("yt-remote-cast2-availability-change",function(N){g.Sb("yt-remote-cast-available",N);ta("yt-remote-cast2-availability-change",N)}),O.subscribe("yt-remote-cast2-receiver-selected",function(N){qF("onReceiverSelected: "+N.friendlyName); g.Sb("yt-remote-cast-receiver",N);ta("yt-remote-cast2-receiver-selected",N)}),O.subscribe("yt-remote-cast2-receiver-resumed",function(N){qF("onReceiverResumed: "+N.friendlyName); g.Sb("yt-remote-cast-receiver",N);ta("yt-remote-cast2-receiver-resumed",N)}),O.subscribe("yt-remote-cast2-session-change",function(N){qF("onSessionChange: "+dB(N)); N||g.fz("yt-remote-cast-receiver");ta("yt-remote-cast2-session-change",N)}),g.VQ("yt.mdx.remote.cloudview.instance_",O),a=!0); qF("cloudview.createSingleton_: "+a);return a},YD=function(){return g.Lw("yt.mdx.remote.cloudview.instance_")},JtD=function(O,b){EGG(!0); ze$(!1);js$(O,function(a){a?(pri(!0),g.tt("yt-remote-cast2-api-ready")):(H5("Failed to initialize cast API."),EGG(!1),g.fz("yt-remote-cast-available"),g.fz("yt-remote-cast-receiver"),MmG());b(a)})},qF=function(O){aV("cloudview",O)},H5=function(O){aV("cloudview",O)},EGG=function(O){qF("setCastInstalled_ "+O); g.Sb("yt-remote-cast-installed",O)},mD=function(){return!!g.Lw("yt.mdx.remote.cloudview.apiReady_")},pri=function(O){qF("setApiReady_ "+O); g.VQ("yt.mdx.remote.cloudview.apiReady_",O)},ze$=function(O){g.VQ("yt.mdx.remote.cloudview.initializing_",O)},JG=function(O){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.N=this.Y=0;this.trackData=null;this.uD=this.lr=!1;this.L=this.V=this.U=this.G=0;this.T=NaN;this.X=!1;this.reset(O)},SMh=function(O){O.audioTrackId=null; O.trackData=null;O.playerState=-1;O.lr=!1;O.uD=!1;O.Y=0;O.N=g.s$();O.G=0;O.U=0;O.V=0;O.L=0;O.T=NaN;O.X=!1},Eh=function(O){return O.isPlaying()?(g.s$()-O.N)/1E3:0},MF=function(O,b){O.Y=b; O.N=g.s$()},n0=function(O){switch(O.playerState){case 1:case 1081:return(g.s$()-O.N)/1E3+O.Y; case -1E3:return 0}return O.Y},ImC=function(O){return O.X?O.U+Eh(O):O.U},p0=function(O,b,a){var N=O.videoId; O.videoId=b;O.index=a;b!=N&&SMh(O)},fm$=function(O){var b={}; b.index=O.index;b.listId=O.listId;b.videoId=O.videoId;b.playerState=O.playerState;b.volume=O.volume;b.muted=O.muted;b.audioTrackId=O.audioTrackId;b.trackData=g.bd(O.trackData);b.hasPrevious=O.lr;b.hasNext=O.uD;b.playerTime=O.Y;b.playerTimeAt=O.N;b.seekableStart=O.G;b.seekableEnd=O.U;b.duration=O.V;b.loadedTime=O.L;b.liveIngestionTime=O.T;return b},oV=function(O,b){g.w1.call(this); var a=this;this.V=0;this.X=O;this.Y=[];this.N=new FUD;this.G=this.T=null;this.J=(0,g.kr)(this.O84,this);this.U=(0,g.kr)(this.Rh,this);this.L=(0,g.kr)(this.e4U,this);this.yl=(0,g.kr)(this.K_k,this);var N=0;O?(N=O.getProxyState(),N!=3&&(O.subscribe("proxyStateChange",this.RI,this),lmi(this))):N=3;N!=0&&(b?this.RI(N):g.Wi(function(){a.RI(N)},0)); (O=Pp$())&&Gm(this,O);this.subscribe("yt-remote-cast2-session-change",this.yl)},xD=function(O){return new JG(O.X.getPlayerContextData())},lmi=function(O){g.pg("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.Y.push(this.X.subscribe(b,g.D$(this.Y8k,b),this))},O)},Vmg=function(O){g.pg(O.Y,function(b){this.X.unsubscribeByKey(b)},O); O.Y.length=0},P5=function(O){return O.getState()==1},v5=function(O,b){var a=O.N; a.T.length+a.G.length<50&&O.N.enqueue(b)},LvL=function(O,b,a){var N=xD(O); MF(N,a);N.playerState!=-1E3&&(N.playerState=b);jh(O,N)},Sh=function(O,b,a){O.X.sendMessage(b,a)},jh=function(O,b){Vmg(O); O.X.setPlayerContextData(fm$(b));lmi(O)},Gm=function(O,b){O.G&&(O.G.removeUpdateListener(O.J),O.G.removeMediaListener(O.U),O.Rh(null)); O.G=b;O.G&&(NF("Setting cast session: "+O.G.sessionId),O.G.addUpdateListener(O.J),O.G.addMediaListener(O.U),O.G.media.length&&O.Rh(O.G.media[0]))},XrG=function(O){var b=O.T.media,a=O.T.customData; if(b&&a){var N=xD(O);b.contentId!=N.videoId&&NF("Cast changing video to: "+b.contentId);N.videoId=b.contentId;N.playerState=a.playerState;MF(N,O.T.getEstimatedTime());jh(O,N)}else NF("No cast media video. Ignoring state update.")},IV=function(O,b,a){return(0,g.kr)(function(N){this.Pc("Failed to "+b+" with cast v2 channel. Error code: "+N.code); N.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Pc("Retrying "+b+" using MDx browser channel."),Sh(this,b,a))},O)},Vk=function(O,b,a,N){N=N===void 0?!1:N; g.w1.call(this);var k=this;this.Y=NaN;this.Xy=!1;this.J=this.L=this.Mi=this.Tr=NaN;this.yl=[];this.N=this.U=this.X=this.T=this.G=null;this.Py=O;this.Ni=N;this.yl.push(g.JX(window,"beforeunload",function(){k.TT(2)})); this.V=[];this.T=new JG;this.UU=b.id;this.aX=b.idType;this.G=Mj$(this.Py,a,this.mE,this.aX=="shortLived",this.UU);this.G.listen("channelOpened",function(){i7G(k)}); this.G.listen("channelClosed",function(){f0("Channel closed");isNaN(k.Y)?Bx(!0):Bx();k.dispose()}); this.G.listen("channelError",function(D){Bx();isNaN(k.UA())?(D==1&&k.aX=="shortLived"&&k.publish("browserChannelAuthError",D),f0("Channel error: "+D+" without reconnection"),k.dispose()):(k.Xy=!0,f0("Channel error: "+D+" with reconnection in "+k.UA()+" ms"),lJ(k,2))}); this.G.listen("channelMessage",function(D){Qsh(k,D)}); this.G.Fj(b.token);this.subscribe("remoteQueueChange",function(){var D=k.T.videoId;g.ll()&&g.Sb("yt-remote-session-video-id",D)})},eeG=function(O){return g.B$(O.V,function(b){return b.type=="LOUNGE_SCREEN"})},f0=function(O){aV("conn",O)},lJ=function(O,b){O.publish("proxyStateChange",b)},O3L=function(O){O.Y=g.Wi(function(){f0("Connecting timeout"); O.TT(1)},2E4)},b3L=function(O){g.Hi(O.Y); O.Y=NaN},aSL=function(O){g.Hi(O.Tr); O.Tr=NaN},kK$=function(O){NG$(O); O.Mi=g.Wi(function(){L0(O,"getNowPlaying")},2E4)},NG$=function(O){g.Hi(O.Mi); O.Mi=NaN},i7G=function(O){f0("Channel opened"); O.Xy&&(O.Xy=!1,aSL(O),O.Tr=g.Wi(function(){f0("Timing out waiting for a screen.");O.TT(1)},15E3))},s6r=function(O,b){var a=null; if(b){var N=eeG(O);N&&(a={clientName:N.clientName,deviceMake:N.brand,deviceModel:N.model,osVersion:N.osVersion})}g.VQ("yt.mdx.remote.remoteClient_",a);b&&(b3L(O),aSL(O));a=O.G.IJ()&&isNaN(O.Y);b==a?b&&(lJ(O,1),L0(O,"getSubtitlesTrack")):b?(O.d1()&&O.T.reset(),lJ(O,1),L0(O,"getNowPlaying"),DbD(O)):O.TT(1)},Rji=function(O,b){var a=b.params.videoId; delete b.params.videoId;a==O.T.videoId&&(g.i$(b.params)?O.T.trackData=null:O.T.trackData=b.params,O.publish("remotePlayerChange"))},$b$=function(O,b,a){var N=b.params.videoId||b.params.video_id,k=parseInt(b.params.currentIndex,10); O.T.listId=b.params.listId||O.T.listId;p0(O.T,N,k);O.publish("remoteQueueChange",a)},dbh=function(O,b){b.params=b.params||{}; $b$(O,b,"NOW_PLAYING_MAY_CHANGE");CEL(O,b);O.publish("autoplayDismissed")},CEL=function(O,b){var a=parseInt(b.params.currentTime||b.params.current_time,10); MF(O.T,isNaN(a)?0:a);a=parseInt(b.params.state,10);a=isNaN(a)?-1:a;a==-1&&O.T.playerState==-1E3&&(a=-1E3);O.T.playerState=a;a=Number(b.params.loadedTime);O.T.L=isNaN(a)?0:a;O.T.Iv(Number(b.params.duration));a=O.T;var N=Number(b.params.liveIngestionTime);a.T=N;a.X=isNaN(N)?!1:!0;a=O.T;N=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);a.G=isNaN(N)?0:N;a.U=isNaN(b)?0:b;O.T.playerState==1?kK$(O):NG$(O);O.publish("remotePlayerChange")},Z3R=function(O,b){if(O.T.playerState!=-1E3){var a= 1085; switch(parseInt(b.params.adState,10)){case 1:a=1081;break;case 2:a=1084;break;case 0:a=1083}O.T.playerState=a;b=parseInt(b.params.currentTime,10);MF(O.T,isNaN(b)?0:b);O.publish("remotePlayerChange")}},FVi=function(O,b){var a=b.params.muted=="true"; O.T.volume=parseInt(b.params.volume,10);O.T.muted=a;O.publish("remotePlayerChange")},gJ$=function(O,b){O.U=b.params.videoId; O.publish("nowAutoplaying",parseInt(b.params.timeout,10))},BGL=function(O,b){O.U=b.params.videoId||null; O.publish("autoplayUpNext",O.U)},KVD=function(O,b){O.N=b.params.autoplayMode; O.publish("autoplayModeChange",O.N);O.N=="DISABLED"&&O.publish("autoplayDismissed")},t$M=function(O,b){var a=b.params.hasNext=="true"; O.T.lr=b.params.hasPrevious=="true";O.T.uD=a;O.publish("previousNextChange")},Qsh=function(O,b){b=b.message; b.params?f0("Received: action="+b.action+", params="+g.Xr(b.params)):f0("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=aZ(b.params.devices);O.V=g.Xq(b,function(N){return new RZ(N)}); b=!!g.B$(O.V,function(N){return N.type=="LOUNGE_SCREEN"}); s6r(O,b);b=O.kX("mlm");O.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.wv(O.V,function(N){return N.type=="LOUNGE_SCREEN"}); s6r(O,!1);break;case "remoteConnected":var a=new RZ(aZ(b.params.device));g.B$(O.V,function(N){return N.equals(a)})||gj$(O.V,a); break;case "remoteDisconnected":a=new RZ(aZ(b.params.device));g.wv(O.V,function(N){return N.equals(a)}); break;case "gracefulDisconnect":break;case "playlistModified":$b$(O,b,"QUEUE_MODIFIED");break;case "nowPlaying":dbh(O,b);break;case "onStateChange":CEL(O,b);break;case "onAdStateChange":Z3R(O,b);break;case "onVolumeChanged":FVi(O,b);break;case "onSubtitlesTrackChanged":Rji(O,b);break;case "nowAutoplaying":gJ$(O,b);break;case "autoplayDismissed":O.publish("autoplayDismissed");break;case "autoplayUpNext":BGL(O,b);break;case "onAutoplayModeChanged":KVD(O,b);break;case "onHasPreviousNextChanged":t$M(O, b);break;case "requestAssistedSignIn":O.publish("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":O.publish("loopModeChange",b.params.loopMode);break;default:f0("Unrecognized action: "+b.action)}},DbD=function(O){g.Hi(O.J); O.J=g.Wi(function(){O.TT(1)},864E5)},L0=function(O,b,a){a?f0("Sending: action="+b+", params="+g.Xr(a)):f0("Sending: action="+b); O.G.sendMessage(b,a)},hjg=function(O){RV.call(this,"ScreenServiceProxy"); this.PZ=O;this.T=[];this.T.push(this.PZ.$_s("screenChange",(0,g.kr)(this.by,this)));this.T.push(this.PZ.$_s("onlineScreenChange",(0,g.kr)(this.hJ8,this)))},Ubh=function(O,b){tb$(); if(!KT||!KT.get("yt-remote-disable-remote-module-for-dev")){b=g.Ny("MDX_CONFIG")||b;RAh();ZzC();Xh||(Xh=new e5(b?b.loungeApiHost:void 0),hAC()&&(Xh.T="/api/loungedev"));iJ||(iJ=g.Lw("yt.mdx.remote.deferredProxies_")||[],g.VQ("yt.mdx.remote.deferredProxies_",iJ));yg$();var a=Qk();if(!a){var N=new Fh(Xh,b?b.disableAutomaticScreenCache||!1:!1);g.VQ("yt.mdx.remote.screenService_",N);a=Qk();var k={};b&&(k={appId:b.appId,disableDial:b.disableDial,theme:b.theme,loadCastApiSetupScript:b.loadCastApiSetupScript, disableCastApi:b.disableCastApi,enableDialLoungeToken:b.enableDialLoungeToken,enableCastLoungeToken:b.enableCastLoungeToken,forceMirroring:b.forceMirroring});g.VQ("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);nGh(O,N,function(D){D?eh()&&zm(eh(),"YouTube TV"):N.subscribe("onlineScreenChange",function(){ta("yt-remote-receiver-availability-change")})},k)}b&&!g.Lw("yt.mdx.remote.initialized_")&&(g.VQ("yt.mdx.remote.initialized_",!0),Og("Initializing: "+g.Xr(b)), b2.push(g.Br("yt-remote-cast2-api-ready",function(){ta("yt-remote-api-ready")})),b2.push(g.Br("yt-remote-cast2-availability-change",function(){ta("yt-remote-receiver-availability-change")})),b2.push(g.Br("yt-remote-cast2-receiver-selected",function(){aA(null); ta("yt-remote-auto-connect","cast-selector-receiver")})),b2.push(g.Br("yt-remote-cast2-receiver-resumed",function(){ta("yt-remote-receiver-resumed","cast-selector-receiver")})),b2.push(g.Br("yt-remote-cast2-session-change",wu$)),b2.push(g.Br("yt-remote-connection-change",function(D){D?zm(eh(),"YouTube TV"):N5()||(zm(null,null),xoh())})),b2.push(g.Br("yt-remote-cast2-session-failed",function(){ta("yt-remote-connection-failed")})),O=TGc(),b.isAuto&&(O.id+="#dial"),k=b.capabilities||[],k.length>0&&(O.capabilities= k),O.name=b.device,O.app=b.app,(b=b.theme)&&(O.theme=b),Og(" -- with channel params: "+g.Xr(O)),O?(g.Sb("yt-remote-session-app",O.app),g.Sb("yt-remote-session-name",O.name)):(g.fz("yt-remote-session-app"),g.fz("yt-remote-session-name")),g.VQ("yt.mdx.remote.channelParams_",O),a.start(),eh()||rgi())}},ufL=function(){var O=Qk().PZ.$_gos(); var b=k_();b&&Ds()&&(spi(O,b)||O.push(b));return Djr(O)},WVv=function(){var O=AgG(); !O&&c5()&&oG$()&&(O={key:"cast-selector-receiver",name:oG$()});return O},AgG=function(){var O=ufL(),b=k_(); b||(b=N5());return g.B$(O,function(a){return b&&CT(b,a.key)?!0:!1})},k_=function(){var O=eh(); if(!O)return null;var b=Qk().Z8();return ZI(b,O)},wu$=function(O){Og("remote.onCastSessionChange_: "+dB(O)); if(O){var b=k_();if(b&&b.id==O.id){if(zm(b.id,"YouTube TV"),O.idType=="shortLived"&&(O=O.token))sg&&(sg.token=O),(b=Ds())&&b.Fj(O)}else b&&RA(),$_(O,1)}else Ds()&&RA()},RA=function(){mD()?YD().stopSession():H5("stopSession called before API ready."); var O=Ds();O&&(O.disconnect(1),qU$(null))},H3G=function(){var O=Ds(); return!!O&&O.getProxyState()!=3},Og=function(O){aV("remote",O)},Qk=function(){if(!YUD){var O=g.Lw("yt.mdx.remote.screenService_"); YUD=O?new hjg(O):null}return YUD},eh=function(){return g.Lw("yt.mdx.remote.currentScreenId_")},cgc=function(O){g.VQ("yt.mdx.remote.currentScreenId_",O)},mbL=function(){return g.Lw("yt.mdx.remote.connectData_")},aA=function(O){g.VQ("yt.mdx.remote.connectData_",O)},Ds=function(){return g.Lw("yt.mdx.remote.connection_")},qU$=function(O){var b=Ds(); aA(null);O||cgc("");g.VQ("yt.mdx.remote.connection_",O);iJ&&(g.pg(iJ,function(a){a(O)}),iJ.length=0); b&&!O?ta("yt-remote-connection-change",!1):!b&&O&&ta("yt-remote-connection-change",!0)},N5=function(){var O=g.ll(); if(!O)return null;var b=Qk();if(!b)return null;b=b.Z8();return ZI(b,O)},$_=function(O,b){eh(); k_()&&k_();if(Ci)sg=O;else{cgc(O.id);var a=g.Lw("yt.mdx.remote.enableConnectWithInitialState_")||!1;O=new Vk(Xh,O,TGc(),a);O.connect(b,mbL());O.subscribe("beforeDisconnect",function(N){ta("yt-remote-before-disconnect",N)}); O.subscribe("beforeDispose",function(){Ds()&&(Ds(),qU$(null))}); O.subscribe("browserChannelAuthError",function(){var N=k_();N&&N.idType=="shortLived"&&(mD()?YD().handleBrowserChannelAuthError():H5("refreshLoungeToken called before API ready."))}); qU$(O)}},rgi=function(){var O=N5(); O?(Og("Resume connection to: "+dB(O)),$_(O,0)):(Bx(),xoh(),Og("Skipping connecting because no session screen found."))},yg$=function(){var O=TGc(); if(g.i$(O)){O=gB();var b=g.Ip("yt-remote-session-name")||"",a=g.Ip("yt-remote-session-app")||"";O={device:"REMOTE_CONTROL",id:O,name:b,app:a,mdxVersion:3};O.authuser=String(g.Ny("SESSION_INDEX","0"));(b=g.Ny("DELEGATED_SESSION_ID"))&&(O.pageId=String(b));g.VQ("yt.mdx.remote.channelParams_",O)}},TGc=function(){return g.Lw("yt.mdx.remote.channelParams_")||{}},EJL=function(O,b,a){g.p.call(this); var N=this;this.T=O;this.Z=b;this.HB=a;this.events=new g.V4(this);this.N=!1;this.Y=new g.tS(64);this.G=new g.sW(this.Sw,500,this);this.V=new g.sW(this.jw,1E3,this);this.L=new wB(this.RMr,0,this);this.X={};this.J=new g.sW(this.QO,1E3,this);this.U=new g.dg(this.seekTo,1E3,this);this.yl=this.events.B(this.Z,"onVolumeChange",function(k){zj$(N,k)}); g.G(this,this.events);this.events.B(b,"onCaptionsTrackListChanged",this.ZF8);this.events.B(b,"captionschanged",this.Bd8);this.events.B(b,"captionssettingschanged",this.TJ);this.events.B(b,"videoplayerreset",this.Sy);this.events.B(b,"mdxautoplaycancel",function(){N.HB.FD()}); b.D("enable_mdx_video_play_directly")&&this.events.B(b,"videodatachange",function(){Jg$(N.T)||dO(N)||Zs(N,0)}); O=this.HB;O.Yk();O.subscribe("proxyStateChange",this.Td,this);O.subscribe("remotePlayerChange",this.Qc,this);O.subscribe("remoteQueueChange",this.Sy,this);O.subscribe("previousNextChange",this.yA,this);O.subscribe("nowAutoplaying",this.jA,this);O.subscribe("autoplayDismissed",this.C3,this);g.G(this,this.G);g.G(this,this.V);g.G(this,this.L);g.G(this,this.J);g.G(this,this.U);this.TJ();this.Sy();this.Qc()},zj$=function(O,b){if(dO(O)){O.HB.unsubscribe("remotePlayerChange",O.Qc,O); var a=Math.round(b.volume);b=!!b.muted;var N=xD(O.HB);if(a!==N.volume||b!==N.muted)O.HB.setVolume(a,b),O.J.start();O.HB.subscribe("remotePlayerChange",O.Qc,O)}},M$$=function(O){O.ud(0); O.G.stop();O.w5(new g.tS(64))},nJR=function(O,b){if(dO(O)&&!O.N){var a=null; b&&(a={style:O.Z.getSubtitlesUserSettings()},Object.assign(a,b));O.HB.QP(O.Z.getVideoData(1).videoId,a);O.X=xD(O.HB).trackData}},Zs=function(O,b){var a=O.Z.getPlaylist(); if(a==null?0:a.listId){var N=a.index;var k=a.listId.toString()}a=O.Z.getVideoData(1);O.HB.playVideo(a.videoId,b,N,k,a.playerParams,a.Py,Fd$(a));O.w5(new g.tS(1))},puD=function(O,b){if(b){var a=O.Z.getOption("captions","tracklist",{nL:1}); a&&a.length?(O.Z.setOption("captions","track",b),O.N=!1):(O.Z.loadModule("captions"),O.N=!0)}else O.Z.setOption("captions","track",{})},dO=function(O){return xD(O.HB).videoId===O.Z.getVideoData(1).videoId},GKg=function(O,b){g.Sf.call(this,O); this.T=b},F_=function(){g.f.call(this,{W:"div", C:"ytp-mdx-popup-dialog",S:{role:"dialog"},j:[{W:"div",C:"ytp-mdx-popup-dialog-inner-content",j:[{W:"div",C:"ytp-mdx-popup-title",f8:"Vous \u00eates d\u00e9connect\u00e9"},{W:"div",C:"ytp-mdx-popup-description",f8:"Les vid\u00e9os que vous visionnez peuvent \u00eatre ajout\u00e9es \u00e0 l'historique des vid\u00e9os regard\u00e9es sur votre t\u00e9l\u00e9viseur et avoir une influence sur les recommandations qui vous sont faites. Pour \u00e9viter ce probl\u00e8me, annulez et connectez-vous \u00e0 YouTube sur un ordinateur."}, {W:"div",C:"ytp-mdx-privacy-popup-buttons",j:[{W:"button",rd:["ytp-button","ytp-mdx-privacy-popup-cancel"],f8:"Annuler"},{W:"button",rd:["ytp-button","ytp-mdx-privacy-popup-confirm"],f8:"Confirmer"}]}]}]});this.fade=new g.gN(this,250);this.cancelButton=this.Gr("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Gr("ytp-mdx-privacy-popup-confirm");g.G(this,this.fade);this.B(this.cancelButton,"click",this.T);this.B(this.confirmButton,"click",this.G)},gO=function(O){g.f.call(this,{W:"div", C:"ytp-remote",j:[{W:"div",C:"ytp-remote-display-status",j:[{W:"div",C:"ytp-remote-display-status-icon",j:[g.to8()]},{W:"div",C:"ytp-remote-display-status-text",f8:"{{statustext}}"}]}]});this.api=O;this.fade=new g.gN(this,250);g.G(this,this.fade);this.B(O,"presentingplayerstatechange",this.onStateChange);this.qJ(O.getPlayerStateObject())},B9=function(O,b){g.ou.call(this,"Lire sur",1,O,b); this.Z=O;this.IY={};this.B(O,"onMdxReceiversChange",this.X);this.B(O,"presentingplayerstatechange",this.X);this.X()},oJi=function(O){g.U9.call(this,O); this.XI={key:kov(),name:"Cet ordinateur"};this.vQ=null;this.subscriptions=[];this.pT=this.HB=null;this.IY=[this.XI];this.uC=this.XI;this.xA=new g.tS(64);this.q8=0;this.V9=-1;this.ra=!1;this.al=this.ZF=this.QN=null;if(!g.lV(this.player.K())&&!g.LF(this.player.K())){O=this.player;var b=g.AK(O);b&&(b=b.XL())&&(b=new B9(O,b),g.G(this,b));b=new gO(O);g.G(this,b);g.jO(O,b.element,4);this.QN=new F_;g.G(this,this.QN);g.jO(O,this.QN.element,4);this.ra=!!N5()}},Ki=function(O){O.ZF&&(O.player.removeEventListener("presentingplayerstatechange", O.ZF),O.ZF=null)},xbD=function(O,b,a){O.xA=a; O.player.publish("presentingplayerstatechange",new g.AY(a,b))},tM=function(O,b){if(b.key!==O.uC.key)if(b.key===O.XI.key)RA(); else if(Jg$(O)&&PEg(O),O.uC=b,!O.player.K().D("disable_mdx_connection_in_mdx_module_for_music_web")||!g.LF(O.player.K())){var a=O.player.getPlaylistId();var N=O.player.getVideoData(1);var k=N.videoId;if(!a&&!k||(O.player.getAppState()===2||O.player.getAppState()===1)&&O.player.K().D("should_clear_video_data_on_player_cued_unstarted"))N=null;else{var D=O.player.getPlaylist();if(D){var R=[];for(var d=0;d2*this.size&&sz(this),!0):!1}; g.w.get=function(O,b){return kl(this.G,O)?this.G[O]:b}; g.w.set=function(O,b){kl(this.G,O)||(this.size+=1,this.T.push(O),this.nQ++);this.G[O]=b}; g.w.forEach=function(O,b){for(var a=this.j6(),N=0;N=N.T.length)return g.F4;var D=N.T[b++];return g.Jc(O?D:N.G[D])}; return k}; var Ej$={MWU:"atp",BkU:"ska",vvN:"que",nWk:"mus",ov8:"sus",p64:"dsp",rXX:"seq",cer:"mic",v$y:"dpa",TIy:"mlm",mUU:"dsdtr",gW8:"ntb",NT8:"vsp",aZV:"scn",yX4:"rpe",Am8:"dcn",H0N:"dcp",I8l:"pas",QlU:"drq",DVi:"opf",X64:"els",Vgi:"isg",Nk_:"svq",GNy:"mvp",GK8:"ads",x_X:"stcp",U_V:"sads",JmV:"dloc",ynd:"dcw"},M1M={uoy:"u",kDi:"cl",qzy:"k",tYN:"i",LQk:"cr",Vz_:"m",E$4:"g",dV:"up"},Tq$={uu:"adPlaying",WX:"onAdStateChange"},rN$={YRU:"nowPlaying",dV_:"onStateChange",uu:"adPlaying",WX:"onAdStateChange",XP:"nowPlayingShorts", ZH:"onShortsStateChange"},Unc={XP:"nowPlayingShorts",ZH:"onShortsStateChange"};RZ.prototype.equals=function(O){return O?this.id==O.id:!1}; var djv="",KT=null;g.T(yXL,g.i8);var ha,qbG=T6$("loadCastFramework")||T6$("loadCastApplicationFramework"),cXG=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Cg(wB,g.p);g.w=wB.prototype;g.w.YF=function(O){this.X=arguments;this.T=!1;this.FF?this.V=g.s$()+this.b4:this.FF=g.fb(this.N,this.b4)}; g.w.stop=function(){this.FF&&(g.le.clearTimeout(this.FF),this.FF=null);this.V=null;this.T=!1;this.X=[]}; g.w.pause=function(){++this.G}; g.w.resume=function(){this.G&&(--this.G,!this.G&&this.T&&(this.T=!1,this.Y.apply(null,this.X)))}; g.w.wd=function(){this.stop();wB.G4.wd.call(this)}; g.w.Nm=function(){this.FF&&(g.le.clearTimeout(this.FF),this.FF=null);this.V?(this.FF=g.fb(this.N,this.V-g.s$()),this.V=null):this.G?this.T=!0:(this.T=!1,this.Y.apply(null,this.X))};T4.prototype.stringify=function(O){return g.le.JSON.stringify(O,void 0)}; T4.prototype.parse=function(O){return g.le.JSON.parse(O,void 0)};g.Cg(zAr,g.kL);g.Cg(JXh,g.kL);var EpL=null;g.Cg(npr,g.kL);g.Cg(p4R,g.kL);g.Cg(GoL,g.kL);Aa.prototype.debug=function(){}; Aa.prototype.info=function(){}; Aa.prototype.warning=function(){};var f0L={},I0i={};g.w=Wx.prototype;g.w.setTimeout=function(O){this.bV=O}; g.w.DQ=function(O){O=O.target;var b=this.OU;b&&g.ao(O)==3?b.yL():this.Uu(O)}; g.w.Uu=function(O){try{if(O==this.T)a:{var b=g.ao(this.T),a=this.T.G,N=this.T.getStatus();if(!(b<3)&&(b!=3||this.T&&(this.G.G||g.k$(this.T)||g.D1(this.T)))){this.Ni||b!=4||a==7||(a==8||N<=0?rB(3):rB(2));LTM(this);var k=this.T.getStatus();this.yp=k;var D=Sb$(this);if(this.Y=k==200){if(this.fF&&!this.C8){b:{if(this.T){var R=g.sG(this.T,"X-HTTP-Initial-Response");if(R&&!g.Kx(R)){var d=R;break b}}d=null}if(O=d)this.C8=!0,kxc(this,O);else{this.Y=!1;this.N=3;Uz(12);Hx(this);Yl(this);break a}}if(this.aX){O= !0;for(var Z;!this.Ni&&this.U0&&!this.Zh&&(this.Zh=!0,this.V.jb(this)):(Hx(this),Yl(this))}else kxc(this,D);b==4&&Hx(this);this.Y&&!this.Ni&&(b==4?X4$(this.V,this):(this.Y=!1,ql(this)))}else g.uWf(this.T),k==400&&D.indexOf("Unknown SID")> 0?(this.N=3,Uz(12)):(this.N=0,Uz(13)),Hx(this),Yl(this)}}}catch(F){}finally{}}; g.w.cancel=function(){this.Ni=!0;Hx(this)}; g.w.kF=function(){this.yl=null;var O=Date.now();O-this.Ql>=0?(this.UU!=2&&(rB(3),Uz(17)),Hx(this),this.N=2,Yl(this)):Vbc(this,this.Ql-O)}; g.w.getLastError=function(){return this.N}; g.w.XO=function(){return this.T};sLM.prototype.cancel=function(){this.V=$fR(this);if(this.G)this.G.cancel(),this.G=null;else if(this.T&&this.T.size!==0){for(var O=g.r(this.T.values()),b=O.next();!b.done;b=O.next())b.value.cancel();this.T.clear()}};g.w=gar.prototype;g.w.dQ=8;g.w.jM=1;g.w.connect=function(O,b,a,N){Uz(0);this.zo=O;this.Ni=b||{};a&&N!==void 0&&(this.Ni.OSID=a,this.Ni.OAID=N);this.C8=this.FX;this.Py=bHR(this,null,this.zo);Ja(this)}; g.w.disconnect=function(){KO$(this);if(this.jM==3){var O=this.p8++,b=this.Py.clone();g.wA(b,"SID",this.X);g.wA(b,"RID",O);g.wA(b,"TYPE","terminate");nT(this,b);O=new Wx(this,this.X,O);O.UU=2;O.L=Oz(b.clone());b=!1;if(g.le.navigator&&g.le.navigator.sendBeacon)try{b=g.le.navigator.sendBeacon(O.L.toString(),"")}catch(a){}!b&&g.le.Image&&((new Image).src=O.L,b=!0);b||(O.T=vpD(O.V,null),O.T.send(O.L));O.Tr=Date.now();ql(O)}rI$(this)}; g.w.lE=function(){return this.jM==0}; g.w.getState=function(){return this.jM}; g.w.Eu=function(O){if(this.Y)if(this.Y=null,this.jM==1){if(!O){this.p8=Math.floor(Math.random()*1E5);O=this.p8++;var b=new Wx(this,"",O),a=this.J;this.yp&&(a?(a=g.On(a),g.aR(a,this.yp)):a=this.yp);this.U!==null||this.Ql||(b.Py=a,a=null);var N;if(this.m_)a:{for(var k=N=0;k4096){N=k;break a}if(N===4096||k===this.V.length-1){N=k+1;break a}}N= 1E3}else N=1E3;N=yIv(this,b,N);k=this.Py.clone();g.wA(k,"RID",O);g.wA(k,"CVER",22);this.aX&&g.wA(k,"X-HTTP-Session-Id",this.aX);nT(this,k);a&&(this.Ql?N="headers="+g.gt(g.vT8(a))+"&"+N:this.U&&g.u4(k,this.U,a));OH$(this.G,b);this.B1&&g.wA(k,"TYPE","init");this.m_?(g.wA(k,"$req",N),g.wA(k,"SID","null"),b.fF=!0,PlM(b,k,null)):PlM(b,k,N);this.jM=2}}else this.jM==3&&(O?wmv(this,O):this.V.length==0||RZc(this.G)||wmv(this))}; g.w.zI=function(){this.L=null;Tir(this);if(this.pF&&!(this.bV||this.T==null||this.zG<=0)){var O=2*this.zG;this.Xy=uf((0,g.kr)(this.IGU,this),O)}}; g.w.IGU=function(){this.Xy&&(this.Xy=null,this.C8=!1,this.bV=!0,Uz(10),mw(this),Tir(this))}; g.w.jb=function(O){this.T==O&&this.pF&&!this.bV&&(Biv(this),this.bV=!0,Uz(11))}; g.w.UV=function(){this.yl!=null&&(this.yl=null,mw(this),Qpi(this),Uz(19))}; g.w.YFL=function(O){O?Uz(2):Uz(1)}; g.w.isActive=function(){return!!this.N&&this.N.isActive(this)}; g.w=uz$.prototype;g.w.q0=function(){}; g.w.iQ=function(){}; g.w.Cg=function(){}; g.w.hA=function(){}; g.w.isActive=function(){return!0}; g.w.dE=function(){};g.Cg(G4,g.Th);G4.prototype.open=function(){this.T.N=this.V;this.Y&&(this.T.UU=!0);this.T.connect(this.N,this.G||void 0)}; G4.prototype.close=function(){this.T.disconnect()}; G4.prototype.send=function(O){var b=this.T;if(typeof O==="string"){var a={};a.__data__=O;O=a}else this.X&&(a={},a.__data__=g.Xr(O),O=a);b.V.push(new Dfh(b.Is++,O));b.jM==3&&Ja(b)}; G4.prototype.wd=function(){this.T.N=null;delete this.V;this.T.disconnect();delete this.T;G4.G4.wd.call(this)}; g.Cg(WOL,zAr);g.Cg(q4v,JXh);g.Cg(pT,uz$);pT.prototype.q0=function(){this.T.dispatchEvent("m")}; pT.prototype.iQ=function(O){this.T.dispatchEvent(new WOL(O))}; pT.prototype.Cg=function(O){this.T.dispatchEvent(new q4v(O))}; pT.prototype.hA=function(){this.T.dispatchEvent("n")};var xl=new g.Th;g.T(cID,g.kL);g.w=vx.prototype;g.w.rH=null;g.w.lC=!1;g.w.DM=null;g.w.wp=null;g.w.DI=null;g.w.H5=null;g.w.YI=null;g.w.AF=null;g.w.gH=null;g.w.T6=null;g.w.Qr=0;g.w.dj=null;g.w.JF=null;g.w.Pg=null;g.w.kI=-1;g.w.uI=!0;g.w.Nr=!1;g.w.fE=0;g.w.jk=null;var naD={},MoL={};g.w=vx.prototype;g.w.setTimeout=function(O){this.G=O}; g.w.EV=function(O){O=O.target;var b=this.jk;b&&g.ao(O)==3?b.yL():this.Ig(O)}; g.w.Ig=function(O){try{if(O==this.T6)a:{var b=g.ao(this.T6),a=this.T6.G,N=this.T6.getStatus();if(g.lt&&!g.WO("420+")){if(b<4)break a}else if(b<3||b==3&&!g.k$(this.T6))break a;this.Nr||b!=4||a==7||(a==8||N<=0?this.T.Xj(3):this.T.Xj(2));oag(this);var k=this.T6.getStatus();this.kI=k;var D=g.k$(this.T6);if(this.lC=k==200){b==4&&j5(this);if(this.aX){for(O=!0;!this.Nr&&this.Qr0?(this.Pg=3,Px(13)):(this.Pg=0,Px(14)),j5(this),xfh(this)}}catch(d){}finally{}}; g.w.cancel=function(){this.Nr=!0;j5(this)}; g.w.zk=function(){this.DM=null;var O=Date.now();O-this.wp>=0?(this.H5!=2&&this.T.Xj(3),j5(this),this.Pg=2,Px(18),xfh(this)):Gxg(this,this.wp-O)}; g.w.getLastError=function(){return this.Pg};g.w=IoM.prototype;g.w.TO=null;g.w.mw=null;g.w.Uo=!1;g.w.nE=null;g.w.xW=null;g.w.PP=-1;g.w.mS=null;g.w.g4=null;g.w.connect=function(O){this.nE=O;O=IZ(this.T,null,this.nE);Px(3);Date.now();var b=this.T.J;b!=null?(this.mS=b[0],(this.g4=b[1])?(this.xW=1,foR(this)):(this.xW=2,loD(this))):(bf(O,"MODE","init"),this.mw=new vx(this),this.mw.rH=this.TO,JIM(this.mw,O,!1,null,!0),this.xW=0)}; g.w.nh=function(O){if(O)this.xW=2,loD(this);else{Px(4);var b=this.T;b.dA=b.P2.PP;LT(b,9)}O&&this.Xj(2)}; g.w.s6=function(O){return this.T.s6(O)}; g.w.abort=function(){this.mw&&(this.mw.cancel(),this.mw=null);this.PP=-1}; g.w.lE=function(){return!1}; g.w.BW=function(O,b){this.PP=O.kI;if(this.xW==0)if(b){try{var a=this.G.parse(b)}catch(N){O=this.T;O.dA=this.PP;LT(O,2);return}this.mS=a[0];this.g4=a[1]}else O=this.T,O.dA=this.PP,LT(O,2);else this.xW==2&&(this.Uo?(Px(7),Date.now()):b=="11111"?(Px(6),this.Uo=!0,Date.now(),this.PP=200,this.mw.cancel(),Px(12),fT(this.T,this,!0)):(Px(8),Date.now(),this.Uo=!1))}; g.w.GO=function(){this.PP=this.mw.kI;if(this.mw.lC)this.xW==0?this.g4?(this.xW=1,foR(this)):(this.xW=2,loD(this)):this.xW==2&&(this.Uo?(Px(12),fT(this.T,this,!0)):(Px(11),fT(this.T,this,!1)));else{this.xW==0?Px(9):this.xW==2&&Px(10);var O=this.T;this.mw.getLastError();O.dA=this.PP;LT(O,2)}}; g.w.UO=function(){return this.T.UO()}; g.w.isActive=function(){return this.T.isActive()}; g.w.Xj=function(O){this.T.Xj(O)};g.w=Voh.prototype;g.w.bD=null;g.w.d8=null;g.w.GP=null;g.w.TK=null;g.w.XR=null;g.w.lY=null;g.w.Fm=null;g.w.VC=null;g.w.zE=0;g.w.CV=0;g.w.Aq=null;g.w.v2=null;g.w.gy=null;g.w.YD=null;g.w.P2=null;g.w.OM=null;g.w.zL=-1;g.w.e2=-1;g.w.dA=-1;g.w.dW=0;g.w.Ux=0;g.w.u1=8;var vJG={OK:0,svk:2,AWy:4,NIl:5,ggG:6,STOP:7,V3:8,slk:9,tWU:10,wDi:11,n0V:12};g.Cg(Xmg,g.kL);g.Cg(iHR,g.kL);g.w=Voh.prototype; g.w.connect=function(O,b,a,N,k){Px(0);this.XR=b;this.d8=a||{};N&&k!==void 0&&(this.d8.OSID=N,this.d8.OAID=k);this.L?(oZ((0,g.kr)(this.Wd,this,O),100),eZg(this)):this.Wd(O)}; g.w.disconnect=function(){OJr(this);if(this.T==3){var O=this.zE++,b=this.lY.clone();g.wA(b,"SID",this.X);g.wA(b,"RID",O);g.wA(b,"TYPE","terminate");Vh(this,b);O=new vx(this,this.X,O);O.H5=2;O.YI=Oz(b.clone());(new Image).src=O.YI.toString();O.DI=Date.now();Eag(O)}dnh(this)}; g.w.Wd=function(O){this.P2=new IoM(this);this.P2.TO=this.bD;this.P2.G=this.N;this.P2.connect(O)}; g.w.lE=function(){return this.T==0}; g.w.getState=function(){return this.T}; g.w.Lg=function(O){this.v2=null;DnL(this,O)}; g.w.Ou=function(){this.gy=null;this.TK=new vx(this,this.X,"rpc",this.U);this.TK.rH=this.bD;this.TK.fE=0;var O=this.Fm.clone();g.wA(O,"RID","rpc");g.wA(O,"SID",this.X);g.wA(O,"CI",this.OM?"0":"1");g.wA(O,"AID",this.zL);Vh(this,O);g.wA(O,"TYPE","xmlhttp");JIM(this.TK,O,!0,this.VC,!1)}; g.w.BW=function(O,b){if(this.T!=0&&(this.TK==O||this.GP==O))if(this.dA=O.kI,this.GP==O&&this.T==3)if(this.u1>7){try{var a=this.N.parse(b)}catch(N){a=null}if(Array.isArray(a)&&a.length==3)if(O=a,O[0]==0)a:{if(!this.gy){if(this.TK)if(this.TK.DI+3E30)){if(N=b==1)this.GP||this.v2||this.T==1||this.dW>=2?N=!1:(this.v2=oZ((0,g.kr)(this.Lg,this,O),RfG(this,this.dW)),this.dW++, N=!0);N=!(N||b==2&&$nM(this))}if(N)switch(a){case 1:LT(this,5);break;case 4:LT(this,10);break;case 3:LT(this,6);break;case 7:LT(this,12);break;default:LT(this,2)}}}; g.w.hQ=function(O){if(!g.tR(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.w.uxX=function(O){O?Px(2):(Px(1),Cqc(this,8))}; g.w.s6=function(O){if(O)throw Error("Can't create secondary domain capable XhrIo object.");O=new g.eD;O.U=!1;return O}; g.w.isActive=function(){return!!this.Aq&&this.Aq.isActive(this)}; g.w.Xj=function(O){var b=xl;b.dispatchEvent(new iHR(b,O))}; g.w.UO=function(){return!1}; g.w=ZJC.prototype;g.w.Rg=function(){}; g.w.pg=function(){}; g.w.bQ=function(){}; g.w.Kg=function(){}; g.w.aA=function(){}; g.w.S2=function(){return{}}; g.w.isActive=function(){return!0};g.w=FUD.prototype;g.w.enqueue=function(O){this.G.push(O)}; g.w.isEmpty=function(){return this.T.length===0&&this.G.length===0}; g.w.clear=function(){this.T=[];this.G=[]}; g.w.contains=function(O){return g.tR(this.T,O)||g.tR(this.G,O)}; g.w.remove=function(O){var b=this.T;var a=(0,g.IpG)(b,O);a>=0?(g.hR(b,a),b=!0):b=!1;return b||g.yD(this.G,O)}; g.w.Zo=function(){for(var O=[],b=this.T.length-1;b>=0;--b)O.push(this.T[b]);b=this.G.length;for(var a=0;a=j6$.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(O=j6$[this.G],this.FF=g.Wi((0,g.kr)(this.Fu,this),O),this.G++):this.publish("pairingFailed",Error("Server error "+O.status))}; g.w.eH=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var j6$=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Cg(C0,RV);g.w=C0.prototype;g.w.start=function(){$D(this)&&this.publish("screenChange");!g.Ip("yt-remote-lounge-token-expiration")&&lRG(this);g.Hi(this.T);this.T=g.Wi((0,g.kr)(this.start,this),1E4)}; g.w.add=function(O,b){$D(this);jtC(this,O);d7(this,!1);this.publish("screenChange");b(O);O.token||lRG(this)}; g.w.remove=function(O,b){var a=$D(this);IR$(this,O)&&(d7(this,!1),a=!0);b(O);a&&this.publish("screenChange")}; g.w.Fc=function(O,b,a,N){var k=$D(this),D=this.get(O.id);D?(D.name!=b&&(D.name=b,d7(this,!1),k=!0),a(O)):N(Error("no such local screen."));k&&this.publish("screenChange")}; g.w.wd=function(){g.Hi(this.T);C0.G4.wd.call(this)}; g.w.CK=function(O){$D(this);var b=this.screens.length;O=O&&O.screens||[];for(var a=O.length,N=0;N20)break a;d=b(D,R)}D=d}k.name=D}a(g7(this,k))},this), onError:(0,g.kr)(function(k){N(Error("pairing request failed: "+k.status))},this), onTimeout:(0,g.kr)(function(){N(Error("pairing request timed out."))},this)})}; g.w.wd=function(){g.Bv(this.G);g.Bv(this.T);Fh.G4.wd.call(this)}; g.w.RZ=function(){Dor(this);this.publish("screenChange");this.T.update()}; Fh.prototype.dispose=Fh.prototype.dispose;g.Cg(B5,g.w1);g.w=B5.prototype;g.w.i$=function(O){this.Yk()||(O&&(tG(this,""+O),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.w.info=function(O){aV(this.aX,O)}; g.w.HW=function(){return null}; g.w.OZ=function(O){var b=this.G;O?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(O,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.kr)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+O)},this),(0,g.kr)(function(){tG(this,"Failed to update receiver status for: "+b.friendlyName)},this))}; g.w.wd=function(){this.OZ("");B5.G4.wd.call(this)};g.T(hG,B5);g.w=hG.prototype;g.w.Fq=function(O){if(this.V){if(this.V==O)return;tG(this,"Overriding cast session with new session object");heG(this);this.Tr=!1;this.J="unknown";this.V.removeUpdateListener(this.Mi);this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xy)}this.V=O;this.V.addUpdateListener(this.Mi);this.V.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xy);Fv$(this,"getMdxSessionStatus")}; g.w.aQ=function(O){this.info("launchWithParams no-op for Cast: "+g.Xr(O))}; g.w.stop=function(){this.V?this.V.stop((0,g.kr)(function(){this.i$()},this),(0,g.kr)(function(){this.i$(Error("Failed to stop receiver app."))},this)):this.i$(Error("Stopping cast device without session."))}; g.w.OZ=function(){}; g.w.wd=function(){this.info("disposeInternal");heG(this);this.V&&(this.V.removeUpdateListener(this.Mi),this.V.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Xy));this.V=null;B5.prototype.wd.call(this)}; g.w.Yyi=function(O,b){if(!this.Yk())if(b)if(b=aZ(b),g.O$(b))switch(O=""+b.type,b=b.data||{},this.info("onYoutubeMessage_: "+O+" "+g.Xr(b)),O){case "mdxSessionStatus":CpL(this,b);break;case "loungeToken":gGv(this,b);break;default:tG(this,"Unknown youtube message: "+O)}else tG(this,"Unable to parse message.");else tG(this,"No data in message.")}; g.w.qB=function(O,b,a,N){g.Hi(this.L);this.L=0;amv(this.X,this.G.label,O,this.G.friendlyName,(0,g.kr)(function(k){k?b(k):N>=0?(tG(this,"Screen "+O+" appears to be offline. "+N+" retries left."),this.L=g.Wi((0,g.kr)(this.qB,this,O,b,a,N-1),300)):a(Error("Unable to fetch screen."))},this),a)}; g.w.HW=function(){return this.V}; g.w.LV=function(O){this.Yk()||O||(tG(this,"Cast session died."),this.i$())};g.T(yk,B5);g.w=yk.prototype;g.w.Fq=function(O){this.V=O;this.V.addUpdateListener(this.Ni)}; g.w.aQ=function(O){this.Py=O;this.yl()}; g.w.stop=function(){Wvv(this);this.V?this.V.stop((0,g.kr)(this.i$,this,null),(0,g.kr)(this.i$,this,"Failed to stop DIAL device.")):this.i$()}; g.w.wd=function(){Wvv(this);this.V&&this.V.removeUpdateListener(this.Ni);this.V=null;B5.prototype.wd.call(this)}; g.w.KV=function(O){this.Yk()||O||(tG(this,"DIAL session died."),this.N(),this.N=function(){},this.i$())};g.T(r7,B5);r7.prototype.stop=function(){this.i$()}; r7.prototype.Fq=function(){}; r7.prototype.aQ=function(){g.Hi(this.V);this.V=NaN;var O=ZI(this.X.Z8(),this.G.label);O?K0(this,O):this.i$(Error("No such screen"))}; r7.prototype.wd=function(){g.Hi(this.V);this.V=NaN;B5.prototype.wd.call(this)};g.T(Uh,g.w1);g.w=Uh.prototype; g.w.init=function(O,b){chrome.cast.timeout.requestSession=3E4;var a=new chrome.cast.SessionRequest(this.L,[chrome.cast.Capability.AUDIO_OUT]);g.md("desktop_enable_cast_connect")&&(a.androidReceiverCompatible=!0);this.J||(a.dialRequest=new chrome.cast.DialRequest("YouTube"));var N=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;O=O||this.Y?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var k=(0,g.kr)(this.zhN,this);a=new chrome.cast.ApiConfig(a,(0,g.kr)(this.nX, this),k,N,O);a.customDialLaunchCallback=(0,g.kr)(this.H8d,this);chrome.cast.initialize(a,(0,g.kr)(function(){this.Yk()||(chrome.cast.addReceiverActionListener(this.N),otg(),this.G.subscribe("onlineScreenChange",(0,g.kr)(this.JA,this)),this.V=YM$(this),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.kr)(function(D){this.Pc("Failed to set initial custom receivers: "+g.Xr(D))},this)),this.publish("yt-remote-cast2-availability-change",AG(this)),b(!0))},this),(0,g.kr)(function(D){this.Pc("Failed to initialize API: "+ g.Xr(D)); b(!1)},this))}; g.w.Fsy=function(O,b){uJ("Setting connected screen ID: "+O+" -> "+b);if(this.T){var a=this.T.T;if(!O||a&&a.id!=O)uJ("Unsetting old screen status: "+this.T.G.friendlyName),W5(this,null)}if(O&&b){if(!this.T){O=ZI(this.G.Z8(),O);if(!O){uJ("setConnectedScreenStatus: Unknown screen.");return}if(O.idType=="shortLived"){uJ("setConnectedScreenStatus: Screen with id type to be short lived.");return}a=qML(this,O);a||(uJ("setConnectedScreenStatus: Connected receiver not custom..."),a=new chrome.cast.Receiver(O.uuid? O.uuid:O.id,O.name),a.receiverType=chrome.cast.ReceiverType.CUSTOM,this.V.push(a),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.kr)(function(N){this.Pc("Failed to set initial custom receivers: "+g.Xr(N))},this))); uJ("setConnectedScreenStatus: new active receiver: "+a.friendlyName);W5(this,new r7(this.G,a),!0)}this.T.OZ(b)}else uJ("setConnectedScreenStatus: no screen.")}; g.w.Ksr=function(O){this.Yk()?this.Pc("Setting connection data on disposed cast v2"):this.T?this.T.aQ(O):this.Pc("Setting connection data without a session")}; g.w.RO=function(){this.Yk()?this.Pc("Stopping session on disposed cast v2"):this.T?(this.T.stop(),W5(this,null)):uJ("Stopping non-existing session")}; g.w.requestSession=function(){chrome.cast.requestSession((0,g.kr)(this.nX,this),(0,g.kr)(this.HDy,this))}; g.w.wd=function(){this.G.unsubscribe("onlineScreenChange",(0,g.kr)(this.JA,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.N);var O=ntr,b=g.Lw("yt.mdx.remote.debug.handlers_");g.yD(b||[],O);g.Bv(this.T);g.w1.prototype.wd.call(this)}; g.w.Pc=function(O){aV("Controller",O)}; g.w.Xu=function(O,b){this.T==O&&(b||W5(this,null),this.publish("yt-remote-cast2-session-change",b))}; g.w.DJU=function(O,b){if(!this.Yk())if(O)switch(O.friendlyName=chrome.cast.unescape(O.friendlyName),uJ("onReceiverAction_ "+O.label+" / "+O.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.G.label!=O.label)uJ("onReceiverAction_: Stopping active receiver: "+this.T.G.friendlyName),this.T.stop();else{uJ("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(O.receiverType){case chrome.cast.ReceiverType.CUSTOM:W5(this, new r7(this.G,O));break;case chrome.cast.ReceiverType.DIAL:W5(this,new yk(this.G,O,this.X,this.config_));break;case chrome.cast.ReceiverType.CAST:W5(this,new hG(this.G,O,this.config_));break;default:this.Pc("Unknown receiver type: "+O.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.G.label==O.label?this.T.stop():this.Pc("Stopping receiver w/o session: "+O.friendlyName)}else this.Pc("onReceiverAction_ called without receiver.")}; g.w.H8d=function(O){if(this.Yk())return Promise.reject(Error("disposed"));var b=O.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Pc("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var a=this.T?this.T.G:null;if(!a||a.label!=b.label)return this.Pc("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(a&&a.label==b.label&&a.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return uJ("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Pc('Changing CAST intent from "'+a.receiverType+'" to "dial" for '+b.friendlyName);W5(this,new yk(this.G,b,this.X,this.config_))}b=this.T;b.L=O;b.L.appState==chrome.cast.DialAppState.RUNNING?(O=b.L.extraData||{},a=O.screenId||null,w7(b)&&O.loungeToken?O.loungeTokenRefreshIntervalMs?O=UoC(b,{name:b.G.friendlyName,screenId:O.screenId,loungeToken:O.loungeToken,dialId:b.L.receiver.label, screenIdType:"shortLived"},O.loungeTokenRefreshIntervalMs):(g.sO(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(O)+".")),O=u1v(b,a)):O=u1v(b,a)):O=Txg(b);return O}; g.w.nX=function(O){var b=this;if(!this.Yk()&&!this.Y){uJ("New cast session ID: "+O.sessionId);var a=O.receiver;if(a.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(a.receiverType==chrome.cast.ReceiverType.CAST)uJ("Got resumed cast session before resumed mdx connection."),a.friendlyName=chrome.cast.unescape(a.friendlyName),W5(this,new hG(this.G,a,this.config_),!0);else{this.Pc("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var N=this.T.G,k=ZI(this.G.Z8(), N.label);k&&CT(k,a.label)&&N.receiverType!=chrome.cast.ReceiverType.CAST&&a.receiverType==chrome.cast.ReceiverType.CAST&&(uJ("onSessionEstablished_: manual to cast session change "+a.friendlyName),g.Bv(this.T),this.T=new hG(this.G,a,this.config_),this.T.subscribe("sessionScreen",(0,g.kr)(this.Xu,this,this.T)),this.T.subscribe("sessionFailed",function(){return H7D(b,b.T)}),this.T.aQ(null)); this.T.Fq(O)}}}; g.w.pV=function(){return this.T?this.T.HW():null}; g.w.HDy=function(O){this.Yk()||(this.Pc("Failed to estabilish a session: "+g.Xr(O)),O.code!=chrome.cast.ErrorCode.CANCEL&&W5(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.w.zhN=function(O){uJ("Receiver availability updated: "+O);if(!this.Yk()){var b=AG(this);this.U=O==chrome.cast.ReceiverAvailability.AVAILABLE;AG(this)!=b&&this.publish("yt-remote-cast2-availability-change",AG(this))}}; g.w.JA=function(){this.Yk()||(this.V=YM$(this),uJ("Updating custom receivers: "+g.Xr(this.V)),chrome.cast.setCustomReceivers(this.V,function(){},(0,g.kr)(function(){this.Pc("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",AG(this)))}; Uh.prototype.setLaunchParams=Uh.prototype.Ksr;Uh.prototype.setConnectedScreenStatus=Uh.prototype.Fsy;Uh.prototype.stopSession=Uh.prototype.RO;Uh.prototype.getCastSession=Uh.prototype.pV;Uh.prototype.requestSession=Uh.prototype.requestSession;Uh.prototype.init=Uh.prototype.init;Uh.prototype.dispose=Uh.prototype.dispose;var GHg=[];g.w=JG.prototype; g.w.reset=function(O){this.listId="";this.index=-1;this.videoId="";SMh(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.lr=O.hasPrevious,this.uD=O.hasNext,this.Y=O.playerTime,this.N=O.playerTimeAt,this.G=O.seekableStart,this.U=O.seekableEnd,this.V=O.duration,this.L=O.loadedTime,this.T=O.liveIngestionTime,this.X= !isNaN(this.T))}; g.w.isPlaying=function(){return this.playerState==1}; g.w.isBuffering=function(){return this.playerState==3}; g.w.QX=function(){return this.playerState==1081}; g.w.Iv=function(O){this.V=isNaN(O)?0:O}; g.w.getDuration=function(){return this.X?this.V+Eh(this):this.V}; g.w.clone=function(){return new JG(fm$(this))};g.T(oV,g.w1);g.w=oV.prototype;g.w.getState=function(){return this.V}; g.w.LB=function(){return this.X.getReconnectTimeout()}; g.w.KA=function(){this.X.reconnect()}; g.w.play=function(){P5(this)?(this.T?this.T.play(null,g.Fq,IV(this,"play")):Sh(this,"play"),LvL(this,1,n0(xD(this))),this.publish("remotePlayerChange")):v5(this,this.play)}; g.w.pause=function(){P5(this)?(this.T?this.T.pause(null,g.Fq,IV(this,"pause")):Sh(this,"pause"),LvL(this,2,n0(xD(this))),this.publish("remotePlayerChange")):v5(this,this.pause)}; g.w.seekTo=function(O){if(P5(this)){if(this.T){var b=xD(this),a=new chrome.cast.media.SeekRequest;a.currentTime=O;b.isPlaying()||b.isBuffering()?a.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:a.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(a,g.Fq,IV(this,"seekTo",{newTime:O}))}else Sh(this,"seekTo",{newTime:O});LvL(this,3,O);this.publish("remotePlayerChange")}else v5(this,g.D$(this.seekTo,O))}; g.w.stop=function(){if(P5(this)){this.T?this.T.stop(null,g.Fq,IV(this,"stopVideo")):Sh(this,"stopVideo");var O=xD(this);O.index=-1;O.videoId="";SMh(O);jh(this,O);this.publish("remotePlayerChange")}else v5(this,this.stop)}; g.w.setVolume=function(O,b){if(P5(this)){var a=xD(this);if(this.G){if(a.volume!=O){var N=Math.round(O)/100;this.G.setReceiverVolumeLevel(N,(0,g.kr)(function(){NF("set receiver volume: "+N)},this),(0,g.kr)(function(){this.Pc("failed to set receiver volume.")},this))}a.muted!=b&&this.G.setReceiverMuted(b,(0,g.kr)(function(){NF("set receiver muted: "+b)},this),(0,g.kr)(function(){this.Pc("failed to set receiver muted.")},this))}else{var k={volume:O, muted:b};a.volume!=-1&&(k.delta=O-a.volume);Sh(this,"setVolume",k)}a.muted=b;a.volume=O;jh(this,a)}else v5(this,g.D$(this.setVolume,O,b))}; g.w.QP=function(O,b){if(P5(this)){var a=xD(this);O={videoId:O};b&&(a.trackData={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},O.style=g.Xr(b.style),g.aR(O,a.trackData));Sh(this,"setSubtitlesTrack",O);jh(this,a)}else v5(this,g.D$(this.QP,O,b))}; g.w.setAudioTrack=function(O,b){P5(this)?(b=b.getLanguageInfo().getId(),Sh(this,"setAudioTrack",{videoId:O,audioTrackId:b}),O=xD(this),O.audioTrackId=b,jh(this,O)):v5(this,g.D$(this.setAudioTrack,O,b))}; g.w.playVideo=function(O,b,a,N,k,D,R){N=N===void 0?null:N;k=k===void 0?null:k;D=D===void 0?null:D;R=R===void 0?null:R;var d=xD(this),Z={videoId:O};a!==void 0&&(Z.currentIndex=a);p0(d,O,a||0);b!==void 0&&(MF(d,b),Z.currentTime=b);N&&(Z.listId=N);k&&(Z.playerParams=k);D&&(Z.clickTrackingParams=D);R&&(Z.locationInfo=g.Xr(R));Sh(this,"setPlaylist",Z);N||jh(this,d)}; g.w.ZK=function(O,b){if(P5(this)){if(O&&b){var a=xD(this);p0(a,O,b);jh(this,a)}Sh(this,"previous")}else v5(this,g.D$(this.ZK,O,b))}; g.w.nextVideo=function(O,b){if(P5(this)){if(O&&b){var a=xD(this);p0(a,O,b);jh(this,a)}Sh(this,"next")}else v5(this,g.D$(this.nextVideo,O,b))}; g.w.dC=function(){if(P5(this)){Sh(this,"clearPlaylist");var O=xD(this);O.reset();jh(this,O);this.publish("remotePlayerChange")}else v5(this,this.dC)}; g.w.FD=function(){P5(this)?Sh(this,"dismissAutoplay"):v5(this,this.FD)}; g.w.dispose=function(){if(this.V!=3){var O=this.V;this.V=3;this.publish("proxyStateChange",O,this.V)}g.w1.prototype.dispose.call(this)}; g.w.wd=function(){Vmg(this);this.X=null;this.N.clear();Gm(this,null);g.w1.prototype.wd.call(this)}; g.w.RI=function(O){if((O!=this.V||O==2)&&this.V!=3&&O!=0){var b=this.V;this.V=O;this.publish("proxyStateChange",b,O);if(O==1)for(;!this.N.isEmpty();)b=O=this.N,b.T.length===0&&(b.T=b.G,b.T.reverse(),b.G=[]),O.T.pop().apply(this);else O==3&&this.dispose()}}; g.w.Y8k=function(O,b){this.publish(O,b)}; g.w.O84=function(O){if(!O)this.Rh(null),Gm(this,null);else if(this.G.receiver.volume){O=this.G.receiver.volume;var b=xD(this),a=Math.round(100*O.level||0);if(b.volume!=a||b.muted!=O.muted)NF("Cast volume update: "+O.level+(O.muted?" muted":"")),b.volume=a,b.muted=!!O.muted,jh(this,b)}}; g.w.Rh=function(O){NF("Cast media: "+!!O);this.T&&this.T.removeUpdateListener(this.L);if(this.T=O)this.T.addUpdateListener(this.L),XrG(this),this.publish("remotePlayerChange")}; g.w.e4U=function(O){O?(XrG(this),this.publish("remotePlayerChange")):this.Rh(null)}; g.w.uO=function(){Sh(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.w.K_k=function(){var O=Pp$();O&&Gm(this,O)}; g.w.Pc=function(O){aV("CP",O)};g.T(Vk,g.w1);g.w=Vk.prototype; g.w.connect=function(O,b){if(b){var a=b.listId,N=b.videoId,k=b.videoIds,D=b.playerParams,R=b.clickTrackingParams,d=b.index,Z={videoId:N},F=b.currentTime,B=b.locationInfo;b=b.loopMode;F!==void 0&&(Z.currentTime=F<=5?0:F);D&&(Z.playerParams=D);B&&(Z.locationInfo=B);R&&(Z.clickTrackingParams=R);a&&(Z.listId=a);k&&k.length>0&&(Z.videoIds=k.join(","));d!==void 0&&(Z.currentIndex=d);this.Ni&&(Z.loopMode=b||"LOOP_MODE_OFF");a&&(this.T.listId=a);this.T.videoId=N;this.T.index=d||0;this.T.state=3;MF(this.T, F);this.N="UNSUPPORTED";a=this.Ni?"setInitialState":"setPlaylist";f0("Connecting with "+a+" and params: "+g.Xr(Z));this.G.connect({method:a,params:g.Xr(Z)},O,FTg())}else f0("Connecting without params"),this.G.connect({},O,FTg());O3L(this)}; g.w.Fj=function(O){this.G.Fj(O)}; g.w.dispose=function(){this.Yk()||(g.VQ("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),lJ(this,3));g.w1.prototype.dispose.call(this)}; g.w.wd=function(){b3L(this);NG$(this);aSL(this);g.Hi(this.L);this.L=NaN;g.Hi(this.J);this.J=NaN;this.X=null;g.Eb(this.yl);this.yl.length=0;this.G.dispose();g.w1.prototype.wd.call(this);this.N=this.U=this.V=this.T=this.G=null}; g.w.kX=function(O){if(!this.V||this.V.length===0)return!1;for(var b=g.r(this.V),a=b.next();!a.done;a=b.next())if(!a.value.capabilities.has(O))return!1;return!0}; g.w.Tp=function(){var O=3;this.Yk()||(O=0,isNaN(this.UA())?this.G.IJ()&&isNaN(this.Y)&&(O=1):O=2);return O}; g.w.TT=function(O){f0("Disconnecting with "+O);g.VQ("yt.mdx.remote.remoteClient_",null);b3L(this);this.publish("beforeDisconnect",O);O==1&&Bx();this.G.disconnect(O);this.dispose()}; g.w.vv=function(){var O=this.T;this.X&&(O=this.T.clone(),p0(O,this.X,O.index));return fm$(O)}; g.w.xk8=function(O){var b=this,a=new JG(O);a.videoId&&a.videoId!=this.T.videoId&&(this.X=a.videoId,g.Hi(this.L),this.L=g.Wi(function(){if(b.X){var k=b.X;b.X=null;b.T.videoId!=k&&L0(b,"getNowPlaying")}},5E3)); var N=[];this.T.listId==a.listId&&this.T.videoId==a.videoId&&this.T.index==a.index||N.push("remoteQueueChange");this.T.playerState==a.playerState&&this.T.volume==a.volume&&this.T.muted==a.muted&&n0(this.T)==n0(a)&&g.Xr(this.T.trackData)==g.Xr(a.trackData)||N.push("remotePlayerChange");this.T.reset(O);g.pg(N,function(k){this.publish(k)},this)}; g.w.d1=function(){var O=this.G.getDeviceId(),b=g.B$(this.V,function(a){return a.type=="REMOTE_CONTROL"&&a.id!=O}); return b?b.id:""}; g.w.UA=function(){return this.G.LB()}; g.w.FK=function(){return this.N||"UNSUPPORTED"}; g.w.e3=function(){return this.U||""}; g.w.xF=function(){!isNaN(this.UA())&&this.G.KA()}; g.w.olU=function(O,b){L0(this,O,b);DbD(this)}; g.w.mE=function(){var O=g.ly("SAPISID","")||g.ly("__Secure-1PAPISID")||"",b=g.ly("__Secure-3PAPISID","")||"";if(!O&&!b)return"";O=g.DP(g.kW(O),2);b=g.DP(g.kW(b),2);return g.DP(g.kW(","+O+","+b),2)}; Vk.prototype.subscribe=Vk.prototype.subscribe;Vk.prototype.unsubscribeByKey=Vk.prototype.SM;Vk.prototype.getProxyState=Vk.prototype.Tp;Vk.prototype.disconnect=Vk.prototype.TT;Vk.prototype.getPlayerContextData=Vk.prototype.vv;Vk.prototype.setPlayerContextData=Vk.prototype.xk8;Vk.prototype.getOtherConnectedRemoteId=Vk.prototype.d1;Vk.prototype.getReconnectTimeout=Vk.prototype.UA;Vk.prototype.getAutoplayMode=Vk.prototype.FK;Vk.prototype.getAutoplayVideoId=Vk.prototype.e3;Vk.prototype.reconnect=Vk.prototype.xF; Vk.prototype.sendMessage=Vk.prototype.olU;Vk.prototype.getXsrfToken=Vk.prototype.mE;Vk.prototype.isCapabilitySupportedOnConnectedDevices=Vk.prototype.kX;g.T(hjg,RV);g.w=hjg.prototype;g.w.Z8=function(O){return this.PZ.$_gs(O)}; g.w.contains=function(O){return!!this.PZ.$_c(O)}; g.w.get=function(O){return this.PZ.$_g(O)}; g.w.start=function(){this.PZ.$_st()}; g.w.add=function(O,b,a){this.PZ.$_a(O,b,a)}; g.w.remove=function(O,b,a){this.PZ.$_r(O,b,a)}; g.w.Fc=function(O,b,a,N){this.PZ.$_un(O,b,a,N)}; g.w.wd=function(){for(var O=this.T.length,b=0;b1&&!this.Z.getOption("remote","quickCast")?(this.IY=g.GM(O,this.T,this),this.c7(g.Xq(O,this.T)),O=this.Z.getOption("remote","currentReceiver"),O=this.T(O),this.options[O]&&this.Jq(O),this.enable(!0)):this.enable(!1)}; B9.prototype.T=function(O){return O.key}; B9.prototype.v7=function(O){return O==="cast-selector-receiver"?"Caster sur\u2026":this.IY[O].name}; B9.prototype.GK=function(O){g.ou.prototype.GK.call(this,O);this.Z.setOption("remote","currentReceiver",this.IY[O]);this.s0.gP()};g.T(oJi,g.U9);g.w=oJi.prototype; g.w.create=function(){var O=this.player.K(),b=g.fa(O);O={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:O.D("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:O.D("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:O.D("enable_cast_short_lived_lounge_token")};Ubh(b,O);this.subscriptions.push(g.Br("yt-remote-before-disconnect",this.okk,this));this.subscriptions.push(g.Br("yt-remote-connection-change",this.E1l,this));this.subscriptions.push(g.Br("yt-remote-receiver-availability-change",this.wg, this));this.subscriptions.push(g.Br("yt-remote-auto-connect",this.dJL,this));this.subscriptions.push(g.Br("yt-remote-receiver-resumed",this.UJi,this));this.subscriptions.push(g.Br("mdx-privacy-popup-confirm",this.Hc8,this));this.subscriptions.push(g.Br("mdx-privacy-popup-cancel",this.A0l,this));this.wg()}; g.w.load=function(){this.player.cancelPlayback();g.U9.prototype.load.call(this);this.al=new GKg(this.player.K(),this);this.player.mW(this.al);this.vQ=new EJL(this,this.player,this.HB);var O=(O=mbL())?O.currentTime:0;var b=H3G()?new oV(Ds(),void 0):null;O==0&&b&&(O=n0(xD(b)));O!==0&&this.ud(O);xbD(this,this.xA,this.xA);this.player.FI(6)}; g.w.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.ob();this.uC=this.XI;g.Km(this.vQ,this.HB);this.HB=this.al=this.vQ=null;g.U9.prototype.unload.call(this);this.player.FI(5);Ki(this)}; g.w.wd=function(){g.K7(this.subscriptions);g.U9.prototype.wd.call(this)}; g.w.Es=function(O){var b=g.nw.apply(1,arguments);this.loaded&&this.vQ.Z9.apply(this.vQ,[O].concat(g.H(b)))}; g.w.getAdState=function(){return this.V9}; g.w.lr=function(){return this.HB?xD(this.HB).lr:!1}; g.w.uD=function(){return this.HB?xD(this.HB).uD:!1}; g.w.ud=function(O,b){this.q8=O||0;this.player.publish("progresssync",O,b);this.player.Ai("onVideoProgress",O||0)}; g.w.getCurrentTime=function(){return this.q8}; g.w.getDuration=function(){return xD(this.HB).getDuration()||0}; g.w.wD=function(){var O=xD(this.HB);return O.X?O.T+Eh(O):O.T}; g.w.Vm=function(){return xD(this.HB).L}; g.w.u$=function(){return ImC(xD(this.HB))}; g.w.Fk=function(){var O=xD(this.HB);return O.G>0?O.G+Eh(O):O.G}; g.w.getProgressState=function(){var O=xD(this.HB),b=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!O.QX()&&this.player.vZ(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.wD(),isAtLiveHead:this.isAtLiveHead(),loaded:this.Vm(),seekableEnd:this.u$(),seekableStart:this.Fk(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.w.isAtLiveHead=function(){return ImC(xD(this.HB))-this.getCurrentTime()<=1}; g.w.nextVideo=function(){this.HB&&this.HB.nextVideo()}; g.w.ZK=function(){this.HB&&this.HB.ZK()}; g.w.okk=function(O){O===1&&(this.pT=this.HB?xD(this.HB):null)}; g.w.E1l=function(){var O=H3G()?new oV(Ds(),void 0):null;if(O){var b=this.uC;this.loaded&&this.unload();this.HB=O;this.pT=null;b.key!==this.XI.key&&(this.uC=b,this.load())}else g.Bv(this.HB),this.HB=null,this.loaded&&(this.unload(),(O=this.pT)&&O.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(O.videoId,n0(O)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.w.wg=function(){var O=[this.XI],b=O.concat,a=ufL();c5()&&g.Ip("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});this.IY=b.call(O,a);O=WVv()||this.XI;tM(this,O);this.player.Ai("onMdxReceiversChange")}; g.w.dJL=function(){var O=WVv();tM(this,O)}; g.w.UJi=function(){this.uC=WVv()}; g.w.Hc8=function(){this.ra=!0;Ki(this);Ci=!1;sg&&$_(sg,1);sg=null}; g.w.A0l=function(){this.ra=!1;Ki(this);tM(this,this.XI);this.uC=this.XI;Ci=!1;sg=null;this.player.playVideo()}; g.w.QZ=function(O,b){switch(O){case "casting":return this.loaded;case "receivers":return this.IY;case "currentReceiver":return b&&(b.key==="cast-selector-receiver"?vGi():tM(this,b)),this.loaded?this.uC:this.XI;case "quickCast":return this.IY.length===2&&this.IY[1].key==="cast-selector-receiver"?(b&&vGi(),!0):!1}}; g.w.uO=function(){this.HB.uO()}; g.w.BQ=function(){return!1}; g.w.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.w.isLoggedIn=function(){var O,b;return((O=g.Ny("PLAYER_CONFIG"))==null?void 0:(b=O.args)==null?void 0:b.authuser)!==void 0?!0:!(!g.Ny("SESSION_INDEX")&&!g.Ny("LOGGED_IN"))};g.rw("remote",oJi);})(_yt_player);