(function(g){var window=this;'use strict';var q8v=function(p){if(p instanceof g.DB)return p;if(typeof p.rU=="function")return p.rU(!1);if(g.vQ(p)){var x=0,a=new g.DB;a.next=function(){for(;;){if(x>=p.length)return g.Kg;if(x in p)return g.UM(p[x++]);x++}}; return a}throw Error("Not implemented");},nLO=function(p,x,a){if(g.vQ(p))g.ej(p,x,a); else for(p=q8v(p);;){var v=p.next();if(v.done)break;x.call(a,v.value,void 0,p)}},ut=function(p){g.dg(p,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.BQ()).toString(36)); return p},Vu=function(p,x,a){Array.isArray(a)||(a=[String(a)]); g.gXI(p.B,x,a)},eEE=function(p,x){var a=[]; nLO(x,function(v){try{var c=g.T5.prototype.Z.call(this,v,!0)}catch(J){if(J=="Storage: Invalid value was encountered")return;throw J;}c===void 0?a.push(v):g.qfx(c)&&a.push(v)},p); return a},ujZ=function(p,x){eEE(p,x).forEach(function(a){g.T5.prototype.remove.call(this,a)},p)},Viy=function(p){if(p.y8){if(p.y8.locationOverrideToken)return{locationOverrideToken:p.y8.locationOverrideToken}; if(p.y8.latitudeE7!=null&&p.y8.longitudeE7!=null)return{latitudeE7:p.y8.latitudeE7,longitudeE7:p.y8.longitudeE7}}return null},FdQ=function(p,x){g.kt(p,x)||p.push(x)},pZV=function(p){var x=0,a; for(a in p)x++;return x},xkG=function(p,x){return g.ro(p,x)},$ky=function(p){try{return g.Fg.JSON.parse(p)}catch(x){}p=String(p); if(/^\s*$/.test(p)?0:/^[\],:{}\s\u2028\u2029]*$/.test(p.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("("+p+")")}catch(x){}throw Error("Invalid JSON string: "+p);},Fm=function(p){if(g.Fg.JSON)try{return g.Fg.JSON.parse(p)}catch(x){}return $ky(p)},agt=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/channel/opened",g.vL("channel_type"))},syR=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/channel/closed",g.vL("channel_type"))},vEO=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/channel/message_received",g.vL("channel_type"))},csR=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/channel/success")},JsX=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/channel/error",g.vL("channel_type"),g.vL("error_type"))},RmX=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},K4O=function(){var p=pc(); this.U=p;p.y0("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},dkG=function(p,x,a,v){var c=new g.$f(null); p&&g.aH(c,p);x&&g.sn(c,x);a&&g.vk(c,a);v&&(c.Z=v);return c},byQ=function(p,x){return new g.Vz(p,x)},x7=function(p,x){return Object.prototype.hasOwnProperty.call(p,x)},rsV=function(p,x){return p===x},$7=function(p,x){this.Z={}; this.U=[];this.g4=this.size=0;var a=arguments.length;if(a>1){if(a%2)throw Error("Uneven number of arguments");for(var v=0;v5&&(p=p.slice(p.length-5)); var x=g.IT(em$(),function(v){return v.loungeToken}),a=g.IT(p,function(v){return v.loungeToken}); g.Mv(a,function(v){return!g.kt(x,v)})&&urX(); g.Qe("yt-remote-local-screens",p,31536E3)},bv=function(p){p||(g.Sh("yt-remote-session-screen-id"),g.Sh("yt-remote-session-video-id")); qiZ();p=Kc();g.UV(p,dQ());Asj(p)},F4y=function(){if(!rQ){var p=g.XE(); p&&(rQ=new g.Dm(p))}},pbw=function(){F4y(); return rQ?!!rQ.get("yt-remote-use-staging-server"):!1},BI=function(p,x){g.PA[p]=!0; var a=g.NH();a&&a.publish.apply(a,arguments);g.PA[p]=!1},xlw=function(){},pc=function(){if(!lv){lv=new g.yD(new xlw); var p=g.YE("client_streamz_web_flush_count",-1);p!==-1&&(lv.j=p)}return lv},$lX=function(){var p=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return p?parseInt(p[1],10):0},avQ=function(p){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+p)!=-1||document.currentScript.src.indexOf("&"+p)!=-1)},sQw=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},Lc=function(p){p.length?vzZ(p.shift(),function(){Lc(p)}):cXv()},JX$=function(p){return"chrome-extension://"+p+"/cast_sender.js"},vzZ=function(p,x,a){var v=document.createElement("script"); v.onerror=x;a&&(v.onload=a);g.Ws(v,g.MY(p));(document.head||document.documentElement).appendChild(v)},RyO=function(){var p=$lX(),x=[]; if(p>1){var a=p-1;x.push("//www.gstatic.com/eureka/clank/"+p+"/cast_sender.js");x.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js")}return x},cXv=function(){var p=sQw(); p&&p(!1,"No cast extension found")},dlQ=function(){if(KDX){var p=2,x=sQw(),a=function(){p--; p==0&&x&&x(!0)}; window.__onGCastApiAvailable=a;vzZ("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",cXv,a)}},bP$=function(){dlQ(); var p=RyO();p.push("//www.gstatic.com/eureka/clank/cast_sender.js");Lc(p)},BrO=function(){dlQ(); var p=RyO();p.push.apply(p,g.lf(rXv.map(JX$)));p.push("//www.gstatic.com/eureka/clank/cast_sender.js");Lc(p)},Y7=function(p,x,a){g.y.call(this); this.S=a!=null?(0,g.dR)(p,a):p;this.eU=x;this.C=(0,g.dR)(this.n8,this);this.U=!1;this.Z=0;this.j=this.x$=null;this.B=[]},h9=function(){},lvV=function(){g.PL.call(this,"p")},LDQ=function(){g.PL.call(this,"o")},hyO=function(){return YUX=YUX||new g.Bm},jQy=function(p){g.PL.call(this,"serverreachability",p)},j8=function(p){var x=hyO(); x.dispatchEvent(new jQy(x,p))},IvO=function(p){g.PL.call(this,"statevent",p)},Ig=function(p){var x=hyO(); x.dispatchEvent(new IvO(x,p))},Mhv=function(p,x,a,v){g.PL.call(this,"timingevent",p); this.size=x;this.rtt=a;this.retries=v},MU=function(p,x){if(typeof p!=="function")throw Error("Fn must not be null and must be a function"); return g.Fg.setTimeout(function(){p()},x)},WI=function(){},k7=function(p,x,a,v){this.j=p; this.B=x;this.KW=a;this.XV=v||1;this.oa=new g.LO(this);this.HO=45E3;this.hG=null;this.S=!1;this.T=this.LI=this.Y=this.V6=this.O7=this.T4=this.Zt=null;this.pI=[];this.U=null;this.V=0;this.C=this.u$=null;this.US=-1;this.qT=!1;this.Ra=0;this.gr=null;this.OS=this.tG=this.Zp=this.F5=!1;this.Z=new WDv},WDv=function(){this.Z=null; this.U="";this.j=!1},Dlj=function(p,x,a){p.V6=1; p.Y=ut(x.clone());p.T=a;p.F5=!0;kWX(p,null)},kWX=function(p,x){p.O7=Date.now(); Dr(p);p.LI=p.Y.clone();Vu(p.LI,"t",p.XV);p.V=0;var a=p.j.V6;p.Z=new WDv;p.U=Ulv(p.j,a?x:null,!p.T);p.Ra>0&&(p.gr=new g.eR((0,g.dR)(p.ub,p,p.U),p.Ra));p.oa.listen(p.U,"readystatechange",p.K8);x=p.hG?g.hp(p.hG):{};p.T?(p.u$||(p.u$="POST"),x["Content-Type"]="application/x-www-form-urlencoded",p.U.send(p.LI,p.u$,p.T,x)):(p.u$="GET",p.U.send(p.LI,p.u$,null,x));j8(1)},TrV=function(p){if(!HPy(p))return g.el(p.U); var x=g.uJ(p.U);if(x==="")return"";var a="",v=x.length,c=g.q0(p.U)==4;if(!p.Z.Z){if(typeof TextDecoder==="undefined")return UI(p),HI(p),"";p.Z.Z=new g.Fg.TextDecoder}for(var J=0;Jx.length)return QQO;x=x.slice(v,v+a);p.V=v+a;return x},Dr=function(p){p.T4=Date.now()+p.HO; fvO(p,p.HO)},fvO=function(p,x){if(p.Zt!=null)throw Error("WatchDog timer not null"); p.Zt=MU((0,g.dR)(p.MM,p),x)},CoO=function(p){p.Zt&&(g.Fg.clearTimeout(p.Zt),p.Zt=null)},HI=function(p){p.j.TC()||p.qT||XbO(p.j,p)},UI=function(p){CoO(p); g.aZ(p.gr);p.gr=null;p.oa.removeAll();if(p.U){var x=p.U;p.U=null;x.abort();x.dispose()}},gzw=function(p,x){try{var a=p.j; if(a.rh!=0&&(a.U==p||iP$(a.Z,p)))if(!p.tG&&iP$(a.Z,p)&&a.rh==3){try{var v=a.ow.U.parse(x)}catch(D){v=null}if(Array.isArray(v)&&v.length==3){var c=v;if(c[0]==0)a:{if(!a.Y){if(a.U)if(a.U.O7+3E30&&(a.Ra=1.5*d);v=a;var b=p.lN();if(b){var r=g.VD(b,"X-Client-Wire-Protocol");if(r){var B=v.Z;!B.U&&(g.Xs(r,"spdy")||g.Xs(r,"quic")||g.Xs(r,"h2"))&&(B.B=B.C,B.U=new Set,B.Z&&(zyX(B,B.Z),B.Z=null))}if(v.F5){var l=g.VD(b,"X-HTTP-Session-Id");l&&(v.YN=l,g.dg(v.hG,v.F5,l))}}a.rh=3;a.C&&a.C.bb();a.vX&&(a.FX=Date.now()-p.O7);v=a;var L=p;v.RA=wb$(v,v.V6?v.XV:null,v.KW);if(L.tG){EzO(v.Z, L);var Y=L,h=v.Ra;h&&Y.setTimeout(h);Y.Zt&&(CoO(Y),Dr(Y));v.U=L}else yXw(v);a.j.length>0&&S8(a)}else J[0]!="stop"&&J[0]!="close"||ma(a,7);else a.rh==3&&(J[0]=="stop"||J[0]=="close"?J[0]=="stop"?ma(a,7):a.disconnect():J[0]!="noop"&&a.C&&a.C.DH(J),a.pI=0)}j8(4)}catch(D){}},ZPX=function(p,x){this.U=p; this.map=x;this.context=null},GWy=function(p){this.C=p||10; g.Fg.PerformanceNavigationTiming?(p=g.Fg.performance.getEntriesByType("navigation"),p=p.length>0&&(p[0].nextHopProtocol=="hq"||p[0].nextHopProtocol=="h2")):p=!!(g.Fg.chrome&&g.Fg.chrome.loadTimes&&g.Fg.chrome.loadTimes()&&g.Fg.chrome.loadTimes().wasFetchedViaSpdy);this.B=p?this.C:1;this.U=null;this.B>1&&(this.U=new Set);this.Z=null;this.j=[]},OPt=function(p){return p.Z?!0:p.U?p.U.size>=p.B:!1},thw=function(p){return p.Z?1:p.U?p.U.size:0},iP$=function(p,x){return p.Z?p.Z==x:p.U?p.U.has(x):!1},zyX= function(p,x){p.U?p.U.add(x):p.Z=x},EzO=function(p,x){p.Z&&p.Z==x?p.Z=null:p.U&&p.U.has(x)&&p.U.delete(x)},NrO=function(p){if(p.Z!=null)return p.j.concat(p.Z.pI); if(p.U!=null&&p.U.size!==0){var x=p.j;p=g.k(p.U.values());for(var a=p.next();!a.done;a=p.next())x=x.concat(a.value.pI);return x}return g.CG(p.j)},AXZ=function(p,x){var a=new WI; if(g.Fg.Image){var v=new Image;v.onload=g.bZ(fc,a,"TestLoadImage: loaded",!0,x,v);v.onerror=g.bZ(fc,a,"TestLoadImage: error",!1,x,v);v.onabort=g.bZ(fc,a,"TestLoadImage: abort",!1,x,v);v.ontimeout=g.bZ(fc,a,"TestLoadImage: timeout",!1,x,v);g.Fg.setTimeout(function(){if(v.ontimeout)v.ontimeout()},1E4); v.src=p}else x(!1)},PoO=function(p,x){var a=new WI,v=new AbortController,c=setTimeout(function(){v.abort(); fc(a,"TestPingServer: timeout",!1,x)},1E4); fetch(p,{signal:v.signal}).then(function(J){clearTimeout(c);J.ok?fc(a,"TestPingServer: ok",!0,x):fc(a,"TestPingServer: server error",!1,x)}).catch(function(){clearTimeout(c); fc(a,"TestPingServer: error",!1,x)})},fc=function(p,x,a,v,c){try{c&&(c.onload=null,c.onerror=null,c.onabort=null,c.ontimeout=null),v(a)}catch(J){}},qUZ=function(){this.U=new h9},Cc=function(p,x,a){return a&&a.SO?a.SO[p]||x:x},nzy=function(p){this.j=[]; this.XV=this.RA=this.hG=this.KW=this.U=this.YN=this.F5=this.qT=this.V=this.US=this.T=null;this.L3=this.LI=0;this.K1=Cc("failFast",!1,p);this.tG=this.Zt=this.Y=this.S=this.C=null;this.G$=!0;this.y8=this.gr=-1;this.OS=this.pI=this.O7=0;this.MN=Cc("baseRetryDelayMs",5E3,p);this.Xq=Cc("retryDelaySeedMs",1E4,p);this.tU=Cc("forwardChannelMaxRetries",2,p);this.aA=Cc("forwardChannelRequestTimeoutMs",2E4,p);this.Iw=p&&p.xtr||void 0;this.x_=p&&p.C7r||void 0;this.lc=p&&p.nkr||!1;this.Ra=void 0;this.V6=p&&p.hu7|| !1;this.B="";this.Z=new GWy(p&&p.fj5);this.ow=new qUZ;this.oa=p&&p.iqI||!1;this.T4=p&&p.sir||!1;this.oa&&this.T4&&(this.T4=!1);this.Y_=p&&p.Aud||!1;p&&p.V6r&&(this.G$=!1);this.vX=!this.oa&&this.G$&&p&&p.odO||!1;this.Kp=void 0;p&&p.eF&&p.eF>0&&(this.Kp=p.eF);this.ol=void 0;this.FX=0;this.HO=!1;this.Zp=this.u$=null},Qt=function(p){p.U&&(eyX(p),p.U.cancel(),p.U=null)},uKO=function(p){Qt(p); p.Y&&(g.Fg.clearTimeout(p.Y),p.Y=null);Tq(p);p.Z.cancel();p.S&&(typeof p.S==="number"&&g.Fg.clearTimeout(p.S),p.S=null)},S8=function(p){OPt(p.Z)||p.S||(p.S=!0,g.D9(p.Cx,p),p.O7=0)},FDy=function(p,x){if(thw(p.Z)>=p.Z.B-(p.S?1:0))return!1; if(p.S)return p.j=x.pI.concat(p.j),!0;if(p.rh==1||p.rh==2||p.O7>=(p.K1?0:p.tU))return!1;p.S=MU((0,g.dR)(p.Cx,p,x),Vhj(p,p.O7));p.O7++;return!0},xMj=function(p,x){var a; x?a=x.KW:a=p.LI++;var v=p.hG.clone();g.dg(v,"SID",p.B);g.dg(v,"RID",a);g.dg(v,"AID",p.gr);XQ(p,v);p.V&&p.T&&g.ld(v,p.V,p.T);a=new k7(p,p.B,a,p.O7+1);p.V===null&&(a.hG=p.T);x&&(p.j=x.pI.concat(p.j));x=pRG(p,a,1E3);a.setTimeout(Math.round(p.aA*.5)+Math.round(p.aA*.5*Math.random()));zyX(p.Z,a);Dlj(a,v,x)},XQ=function(p,x){p.qT&&g.FO(p.qT,function(a,v){g.dg(x,v,a)}); p.C&&g.FO({},function(a,v){g.dg(x,v,a)})},pRG=function(p,x,a){a=Math.min(p.j.length,a); var v=p.C?(0,g.dR)(p.C.Xe,p.C,p):null;a:{for(var c=p.j,J=-1;;){var R=["count="+a];J==-1?a>0?(J=c[0].U,R.push("ofs="+J)):J=0:R.push("ofs="+J);for(var d=!0,b=0;b=3)return!1; p.OS++;p.Y=MU((0,g.dR)(p.Su,p),Vhj(p,p.pI));p.pI++;return!0},eyX=function(p){p.u$!=null&&(g.Fg.clearTimeout(p.u$),p.u$=null)},$My=function(p){p.U=new k7(p,p.B,"rpc",p.OS); p.V===null&&(p.U.hG=p.T);p.U.Ra=0;var x=p.RA.clone();g.dg(x,"RID","rpc");g.dg(x,"SID",p.B);g.dg(x,"AID",p.gr);g.dg(x,"CI",p.tG?"0":"1");!p.tG&&p.Kp&&g.dg(x,"TO",p.Kp);g.dg(x,"TYPE","xmlhttp");XQ(p,x);p.V&&p.T&&g.ld(x,p.V,p.T);p.Ra&&p.U.setTimeout(p.Ra);var a=p.U;p=p.XV;a.V6=1;a.Y=ut(x.clone());a.T=null;a.F5=!0;kWX(a,p)},Tq=function(p){p.Zt!=null&&(g.Fg.clearTimeout(p.Zt),p.Zt=null)},XbO=function(p,x){var a=null; if(p.U==x){Tq(p);eyX(p);p.U=null;var v=2}else if(iP$(p.Z,x))a=x.pI,EzO(p.Z,x),v=1;else return;if(p.rh!=0)if(x.S)if(v==1){a=x.T?x.T.length:0;x=Date.now()-x.O7;var c=p.O7;v=hyO();v.dispatchEvent(new Mhv(v,a,x,c));S8(p)}else yXw(p);else{var J=x.US;c=x.getLastError();if(c==3||c==0&&J>0||!(v==1&&FDy(p,x)||v==2&&ozw(p)))switch(a&&a.length>0&&(x=p.Z,x.j=x.j.concat(a)),c){case 1:ma(p,5);break;case 4:ma(p,10);break;case 3:ma(p,6);break;default:ma(p,2)}}},Vhj=function(p,x){var a=p.MN+Math.floor(Math.random()* p.Xq); p.isActive()||(a*=2);return a*x},ma=function(p,x){if(x==2){var a=(0,g.dR)(p.Mha,p),v=p.x_,c=!v; v=new g.$f(v||"//www.google.com/images/cleardot.gif");g.Fg.location&&g.Fg.location.protocol=="http"||g.aH(v,"https");ut(v);c?AXZ(v.toString(),a):PoO(v.toString(),a)}else Ig(2);p.rh=0;p.C&&p.C.ib(x);aHj(p);uKO(p)},aHj=function(p){p.rh=0; p.Zp=[];if(p.C){var x=NrO(p.Z);if(x.length!=0||p.j.length!=0)g.XO(p.Zp,x),g.XO(p.Zp,p.j),p.Z.j.length=0,g.CG(p.j),p.j.length=0;p.C.hH()}},sbR=function(p){if(p.rh==0)return p.Zp; var x=[];g.XO(x,NrO(p.Z));g.XO(x,p.j);return x},wb$=function(p,x,a){var v=g.bd(a); v.U!=""?(x&&g.sn(v,x+"."+v.U),g.vk(v,v.j)):(v=g.Fg.location,v=dkG(v.protocol,x?x+"."+v.hostname:v.hostname,+v.port,a));x=p.F5;a=p.YN;x&&a&&g.dg(v,x,a);g.dg(v,"VER",p.WP);XQ(p,v);return v},Ulv=function(p,x,a){if(x&&!p.V6)throw Error("Can't create secondary domain capable XhrIo object."); x=p.lc&&!p.Iw?new g.N0(new g.VI({TU:a})):new g.N0(p.Iw);x.V=p.V6;return x},vlR=function(){},cxw=function(){},og=function(p,x){g.Bm.call(this); this.U=new nzy(x);this.C=p;this.Z=x&&x.Br5||null;p=x&&x.OI6||null;x&&x.eVA&&(p?p["X-Client-Protocol"]="webchannel":p={"X-Client-Protocol":"webchannel"});this.U.T=p;p=x&&x.gwA||null;x&&x.p5&&(p?p["X-WebChannel-Content-Type"]=x.p5:p={"X-WebChannel-Content-Type":x.p5});x&&x.L4&&(p?p["X-WebChannel-Client-Profile"]=x.L4:p={"X-WebChannel-Client-Profile":x.L4});this.U.US=p;(p=x&&x.aDA)&&!g.CZ(p)&&(this.U.V=p);this.S=x&&x.hu7||!1;this.B=x&&x.r75||!1;(x=x&&x.Bk)&&!g.CZ(x)&&(this.U.F5=x,g.bu(this.Z,x)&&(p= this.Z,x in p&&delete p[x]));this.j=new iv(this)},Jxy=function(p){lvV.call(this); p.__headers__&&(this.headers=p.__headers__,this.statusCode=p.__status__,delete p.__headers__,delete p.__status__);var x=p.__sm__;x?this.data=(this.U=g.aJ(x))?g.LZ(x,this.U):x:this.data=p},RsZ=function(p){LDQ.call(this); this.status=1;this.errorCode=p},iv=function(p){this.U=p},KAE=function(p,x){this.Z=p; this.U=x},dMG=function(p){return sbR(p.U).map(function(x){var a=p.Z; x=x.map;"__data__"in x?(x=x.__data__,a=a.B?$ky(x):x):a=x;return a})},t9=function(p,x){if(typeof p!=="function")throw Error("Fn must not be null and must be a function"); return g.Fg.setTimeout(function(){p()},x)},wQ=function(p){zq.dispatchEvent(new bFX(zq,p))},bFX=function(p){g.PL.call(this,"statevent",p)},EI=function(p,x,a,v){this.U=p; this.B=x;this.V=a;this.S=v||1;this.Z=45E3;this.j=new g.LO(this);this.C=new g.zD;this.C.setInterval(250)},BdG=function(p,x,a){p.iZ=1; p.dN=ut(x.clone());p.o2=a;p.F5=!0;rxt(p,null)},lHO=function(p,x,a,v,c){p.iZ=1; p.dN=ut(x.clone());p.o2=null;p.F5=a;c&&(p.WR=!1);rxt(p,v)},rxt=function(p,x){p.ZO=Date.now(); LAQ(p);p.hB=p.dN.clone();Vu(p.hB,"t",p.S);p.bZ=0;p.B$=p.U.Le(p.U.pm()?x:null);p.Ar>0&&(p.Cl=new g.eR((0,g.dR)(p.q$,p,p.B$),p.Ar));p.j.listen(p.B$,"readystatechange",p.xz);x=p.yD?g.hp(p.yD):{};p.o2?(p.Dv="POST",x["Content-Type"]="application/x-www-form-urlencoded",p.B$.send(p.hB,p.Dv,p.o2,x)):(p.Dv="GET",p.WR&&!g.bP&&(x.Connection="close"),p.B$.send(p.hB,p.Dv,null,x));p.U.QE(1)},jbt=function(p,x){var a=p.bZ,v=x.indexOf("\n",a); if(v==-1)return YjQ;a=Number(x.substring(a,v));if(isNaN(a))return hsV;v+=1;if(v+a>x.length)return YjQ;x=x.slice(v,v+a);p.bZ=v+a;return x},LAQ=function(p){p.gg=Date.now()+p.Z; IHO(p,p.Z)},IHO=function(p,x){if(p.hK!=null)throw Error("WatchDog timer not null"); p.hK=t9((0,g.dR)(p.Yz,p),x)},Mkw=function(p){p.hK&&(g.Fg.clearTimeout(p.hK),p.hK=null)},WAy=function(p){p.U.TC()||p.zP||p.U.cS(p)},gQ=function(p){Mkw(p); g.aZ(p.Cl);p.Cl=null;p.C.stop();p.j.removeAll();if(p.B$){var x=p.B$;p.B$=null;x.abort();x.dispose()}p.hs&&(p.hs=null)},kbG=function(p,x){try{p.U.Vk(p,x),p.U.QE(4)}catch(a){}},UMV=function(p,x,a,v,c){if(v==0)a(!1); else{var J=c||0;v--;DMR(p,x,function(R){R?a(!0):g.Fg.setTimeout(function(){UMV(p,x,a,v,J)},J)})}},DMR=function(p,x,a){var v=new Image; v.onload=function(){try{Zr(v),a(!0)}catch(c){}}; v.onerror=function(){try{Zr(v),a(!1)}catch(c){}}; v.onabort=function(){try{Zr(v),a(!1)}catch(c){}}; v.ontimeout=function(){try{Zr(v),a(!1)}catch(c){}}; g.Fg.setTimeout(function(){if(v.ontimeout)v.ontimeout()},x); v.src=p},Zr=function(p){p.onload=null; p.onerror=null;p.onabort=null;p.ontimeout=null},HFQ=function(p){this.U=p; this.Z=new h9},TdX=function(p){var x=Gq(p.U,p.l5,"/mail/images/cleardot.gif"); ut(x);UMV(x.toString(),5E3,(0,g.dR)(p.FE,p),3,2E3);p.QE(1)},QbV=function(p){var x=p.U.S; x!=null?(wQ(5),x?(wQ(11),OI(p.U,p,!1)):(wQ(12),OI(p.U,p,!0))):(p.dw=new EI(p),p.dw.yD=p.Nf,x=p.U,x=Gq(x,x.pm()?p.qe:null,p.HS),wQ(5),Vu(x,"TYPE","xmlhttp"),lHO(p.dw,x,!1,p.qe,!1))},mMO=function(p,x,a){this.U=1; this.Z=[];this.j=[];this.C=new h9;this.T=p||null;this.S=x!=null?x:null;this.Y=a||!1},Sjj=function(p,x){this.U=p; this.map=x;this.context=null},fHy=function(p,x,a,v){g.PL.call(this,"timingevent",p); this.size=x;this.rtt=a;this.retries=v},CMZ=function(p){g.PL.call(this,"serverreachability",p)},iFj=function(p){p.Qi(1,0); p.VX=Gq(p,null,p.rg);XR$(p)},olV=function(p){p.LA&&(p.LA.abort(),p.LA=null); p.zQ&&(p.zQ.cancel(),p.zQ=null);p.e6&&(g.Fg.clearTimeout(p.e6),p.e6=null);NU(p);p.s5&&(p.s5.cancel(),p.s5=null);p.qP&&(g.Fg.clearTimeout(p.qP),p.qP=null)},tkX=function(p,x){if(p.U==0)throw Error("Invalid operation: sending map when state is closed"); p.Z.push(new Sjj(p.Gu++,x));p.U!=2&&p.U!=3||XR$(p)},zsX=function(p){var x=0; p.zQ&&x++;p.s5&&x++;return x},XR$=function(p){p.s5||p.qP||(p.qP=t9((0,g.dR)(p.tH,p),0),p.qj=0)},yxO=function(p,x){if(p.U==1){if(!x){p.wX=Math.floor(Math.random()*1E5); x=p.wX++;var a=new EI(p,"",x);a.yD=p.NF;var v=wRw(p),c=p.VX.clone();g.dg(c,"RID",x);g.dg(c,"CVER","1");A9(p,c);BdG(a,c,v);p.s5=a;p.U=2}}else p.U==3&&(x?ElO(p,x):p.Z.length==0||p.s5||ElO(p))},ElO=function(p,x){if(x)if(p.Es>6){p.Z=p.j.concat(p.Z); p.j.length=0;var a=p.wX-1;x=wRw(p)}else a=x.V,x=x.o2;else a=p.wX++,x=wRw(p);var v=p.VX.clone();g.dg(v,"SID",p.B);g.dg(v,"RID",a);g.dg(v,"AID",p.Vl);A9(p,v);a=new EI(p,p.B,a,p.qj+1);a.yD=p.NF;a.setTimeout(1E4+Math.round(1E4*Math.random()));p.s5=a;BdG(a,v,x)},A9=function(p,x){p.TQ&&(p=p.TQ.GK())&&g.FO(p,function(a,v){g.dg(x,v,a)})},wRw=function(p){var x=Math.min(p.Z.length,1E3),a=["count="+x]; if(p.Es>6&&x>0){var v=p.Z[0].U;a.push("ofs="+v)}else v=0;for(var c={},J=0;J=3)return!1; p.V++;p.e6=t9((0,g.dR)(p.Kx,p),ZFG(p,p.D7));p.D7++;return!0},OI=function(p,x,a){p.WS=p.S==null?a:!p.S; p.pD=x.Hj;p.Y||iFj(p)},NU=function(p){p.kW!=null&&(g.Fg.clearTimeout(p.kW),p.kW=null)},ZFG=function(p,x){var a=5E3+Math.floor(Math.random()*1E4); p.isActive()||(a*=2);return a*x},PI=function(p,x){if(x==2||x==9){var a=null; p.TQ&&(a=null);var v=(0,g.dR)(p.nLG,p);a||(a=new g.$f("//www.google.com/images/cleardot.gif"),ut(a));DMR(a.toString(),1E4,v)}else wQ(2);OFv(p,x)},OFv=function(p,x){p.U=0; p.TQ&&p.TQ.XH(x);Nd$(p);olV(p)},Nd$=function(p){p.U=0; p.pD=-1;if(p.TQ)if(p.j.length==0&&p.Z.length==0)p.TQ.yg();else{var x=g.CG(p.j),a=g.CG(p.Z);p.j.length=0;p.Z.length=0;p.TQ.yg(x,a)}},Gq=function(p,x,a){var v=g.bd(a); if(v.U!="")x&&g.sn(v,x+"."+v.U),g.vk(v,v.j);else{var c=window.location;v=dkG(c.protocol,x?x+"."+c.hostname:c.hostname,+c.port,a)}p.jm&&g.FO(p.jm,function(J,R){g.dg(v,R,J)}); g.dg(v,"VER",p.Es);A9(p,v);return v},Axj=function(){},PMX=function(){this.U=[]; this.Z=[]},qjO=function(p){g.PL.call(this,"channelMessage"); this.message=p},nlX=function(p){g.PL.call(this,"channelError"); this.error=p},esX=function(p,x){this.action=p; this.params=x||{}},qU=function(p,x){g.y.call(this); this.U=new g.AW(this.BH5,0,this);g.Z(this,this.U);this.eU=5E3;this.Z=0;if(typeof p==="function")x&&(p=(0,g.dR)(p,x));else if(p&&typeof p.handleEvent==="function")p=(0,g.dR)(p.handleEvent,p);else throw Error("Invalid listener argument");this.j=p},udQ=function(p,x,a,v,c,J,R,d,b,r,B,l,L,Y){a=a===void 0?!1:a; v=v===void 0?function(){return""}:v; c=c===void 0?!1:c;J=J===void 0?!1:J;R=R===void 0?!1:R;d=d===void 0?function(){return g.Cp({})}:d; b=b===void 0?!1:b;B=B===void 0?!1:B;l=l===void 0?!1:l;L=L===void 0?!1:L;Y=Y===void 0?!1:Y;this.V6=p;this.Zt=x;this.S=new g.kW;this.Z=new qU(this.XmI,this);this.U=null;this.V=!1;this.T=null;this.O7="";this.pI=this.Y=0;this.j=[];this.OS=a;this.F5=v;this.C=J;this.hG=d;this.qT=r;this.XV=R;this.u$=null;this.B=g.Cp();this.KW=c;this.Zp=b;this.oa=B;this.T4=l;this.G$=L;this.US=Y;this.Ra=new agt;this.tG=new syR;this.HO=new csR;this.LI=new vEO;this.gr=new JsX;this.vX=new RmX;this.ol=new K4O},pAG=function(p, x,a,v,c){VkV(p); if(p.U){var J=g.gx("ID_TOKEN"),R=p.U.NF||{};J?R["x-youtube-identity-token"]=J:delete R["x-youtube-identity-token"];p.U.NF=R}FAV(p);v?(v.getState()!=3&&zsX(v)==0||v.getState(),p.U.connect(x,a,p.Zt,v.B,v.Vl)):c?p.U.connect(x,a,p.Zt,c.sessionId,c.arrayId):p.U.connect(x,a,p.Zt)},sFw=function(p,x){return p.G$?!0:p.T4?Object.values(xHw).includes(x):p.oa?!Object.values($HG).includes(x):p.US?Object.values(a2t).includes(x):!1},JQX=function(p){var x,a; g.t(function(v){if(v.Z==1)return g.UQ(v,2),g.C(v,vww(p),2);g.o8(v);x=p.j;p.j=[];a=x.length;cQO(p,x,a);nc(p);return g.z1(v,0)})},cQO=function(p,x,a){for(var v=0;v0?a=Object.assign({},a,x):delete a.Authorization;p.U.NF=a}},FAV=function(p){p.qT&&!p.C&&K8V(p,p.qT())},e8=function(p){this.scheme="https"; this.port=this.domain="";this.U="/api/lounge";this.Z=!0;p=p||document.location.href;var x=Number(g.d3(p)[4]||null)||"";x&&(this.port=":"+x);this.domain=g.b$(p)||"";p=g.Ez();p.search("MSIE")>=0&&(p=p.match(/MSIE ([\d.]+)/)[1],g.wo(p,"10.0")<0&&(this.Z=!1))},uv=function(p,x){var a=p.U; p.Z&&(a=p.scheme+"://"+p.domain+p.port+p.U);return g.jL(a+x,{})},dHX=function(p,x){g.Bm.call(this); var a=this;this.eV=p();this.eV.subscribe("handlerOpened",this.vl,this);this.eV.subscribe("handlerClosed",this.onClosed,this);this.eV.subscribe("handlerError",function(v,c){a.onError(c)}); this.eV.subscribe("handlerMessage",this.onMessage,this);this.U=x},bhX=function(p,x,a){var v=this; a=a===void 0?function(){return""}:a; var c=c===void 0?new cxw:c;var J=J===void 0?new g.kW:J;this.pathPrefix=p;this.U=x;this.O7=a;this.C=J;this.Y=null;this.T=this.V=0;this.channel=null;this.S=0;this.j=new qU(function(){v.j.isActive();var R;((R=v.channel)==null?void 0:thw((new KAE(R,R.U)).U.Z))===0&&v.connect(v.Y,v.V)}); this.B={};this.Z={};this.Zt=!1;this.logger=null;this.pI=[];this.YL=void 0;this.hG=new agt;this.u$=new syR;this.qT=new vEO;this.F5=new JsX},rQj=function(p){g.xJ(p.channel,"m",function(){p.S=3; p.j.reset();p.Y=null;p.V=0;for(var x=g.k(p.pI),a=x.next();!a.done;a=x.next())a=a.value,p.channel&&p.channel.send(a);p.pI=[];p.publish("webChannelOpened");p.hG.Rv("WEB_CHANNEL")}); g.xJ(p.channel,"n",function(){p.S=0;p.j.isActive()||p.publish("webChannelClosed");var x,a=(x=p.channel)==null?void 0:dMG(new KAE(x,x.U));a&&(p.pI=[].concat(g.lf(a)));p.u$.Rv("WEB_CHANNEL")}); g.xJ(p.channel,"p",function(x){var a=x.data;a[0]==="gracefulReconnect"?(p.j.start(),p.channel&&p.channel.close()):p.publish("webChannelMessage",new esX(a[0],a[1]));p.YL=x.statusCode;p.qT.Rv("WEB_CHANNEL")}); g.xJ(p.channel,"o",function(){p.YL===401||p.j.start();p.publish("webChannelError");p.F5.Rv("WEB_CHANNEL","")})},BUR=function(p){var x=p.O7(); x?p.B["x-youtube-lounge-xsrf-token"]=x:delete p.B["x-youtube-lounge-xsrf-token"]},l2X=function(p){g.Bm.call(this); this.U=p();this.U.subscribe("webChannelOpened",this.mZ,this);this.U.subscribe("webChannelClosed",this.onClosed,this);this.U.subscribe("webChannelError",this.onError,this);this.U.subscribe("webChannelMessage",this.onMessage,this)},L8t=function(p,x,a,v,c){function J(){return new udQ(uv(p,"/bc"),x,!1,a,v)} a=a===void 0?function(){return""}:a; return g.Ly("enable_mdx_web_channel_desktop")?new l2X(function(){return new bhX(uv(p,"/wc"),x,a)}):new dHX(J,c)},I2Q=function(){var p=YLX; hB$();Vt.push(p);jFw()},FQ=function(p,x){hB$(); var a=M6j(p,String(x));Vt.length==0?W8R(a):(jFw(),g.ej(Vt,function(v){v(a)}))},pd=function(p){FQ("CP",p)},hB$=function(){Vt||(Vt=g.$t("yt.mdx.remote.debug.handlers_")||[],g.pG("yt.mdx.remote.debug.handlers_",Vt))},W8R=function(p){var x=(xR+1)%50; xR=x;$R[x]=p;aY||(aY=x==49)},jFw=function(){var p=Vt; if($R[0]){var x=aY?xR:-1,a={};do a={cC:void 0},x=(x+1)%50,a.cC=$R[x],g.ej(p,function(v){return function(c){c(v.cC)}}(a)); while(x!=xR);$R=Array(50);xR=-1;aY=!1}},M6j=function(p,x){var a=(Date.now()-kIG)/1E3; a.toFixed&&(a=a.toFixed(3));var v=[];v.push("[",a+"s","] ");v.push("[","yt.mdx.remote","] ");v.push(p+": "+x,"\n");return v.join("")},sK=function(p){g.Fx.call(this); this.S=p;this.screens=[]},DHG=function(p,x){var a=p.get(x.uuid)||p.get(x.id); if(a)return p=a.name,a.id=x.id||a.id,a.name=x.name,a.token=x.token,a.uuid=x.uuid||a.uuid,a.name!=p;p.screens.push(x);return!0},UHw=function(p,x){var a=p.screens.length!=x.length; p.screens=g.mC(p.screens,function(J){return!!GSV(x,J)}); for(var v=x.length,c=0;c0&&p.B0&&hi(p,a)},function(x){p.C=function(){}; p.YD(x)})},p1E=function(p){var x={}; x.pairingCode=p.u$;x.theme=p.V6;pbw()&&(x.env_useStageMdx=1);return g.h1(x)},xQV=function(p){return new Promise(function(x){p.u$=gEV(); if(p.hG){var a=new chrome.cast.DialLaunchResponse(!0,p1E(p));x(a);F8j(p)}else p.Zt=function(){g.rT(p.T);p.Zt=function(){}; p.T=NaN;var v=new chrome.cast.DialLaunchResponse(!0,p1E(p));x(v);F8j(p)},p.T=g.dT(function(){p.Zt()},100)})},aZZ=function(p,x,a){p.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(x)); var v=new vI(x);return(new Promise(function(c){$QZ(p,v,function(J){J?(p.pI=!0,dJ(p.B,v),rJ(p,v),hi(p,a)):g.Aa(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(x)+" is not online."));c(J)},5)})).then(function(c){return c?new chrome.cast.DialLaunchResponse(!1):xQV(p)})},sj$=function(p,x){var a=p.Y.receiver.label,v=p.Z.friendlyName; return(new Promise(function(c){zBG(p.B,a,x,v,function(J){J&&J.token&&rJ(p,J);c(J)},function(J){Bj(p,"Failed to get DIAL screen: "+J); c(null)})})).then(function(c){return c&&c.token?new chrome.cast.DialLaunchResponse(!1):xQV(p)})},$QZ=function(p,x,a,v){g.rT(p.S); p.S=0;Ewy(p.B,x,function(c){c||v<0?a(c):p.S=g.dT(function(){$QZ(p,x,a,v-1)},300)})},hi=function(p,x){p.info("getDialAppInfoWithTimeout_ "+x); YR(p)&&(g.rT(p.V),p.V=0,x==0?vZw(p):p.V=g.dT(function(){vZw(p)},x))},vZw=function(p){YR(p)&&p.j.getDialAppInfo(function(x){p.info("getDialAppInfo dialLaunchData: "+JSON.stringify(x)); x=x.extraData||{};var a=null;if(x.loungeToken){var v;((v=p.U)==null?void 0:v.token)==x.loungeToken&&(a="staleLoungeToken")}else a="missingLoungeToken";a?(p.O7=a,hi(p,3E4)):(p.pI=!1,p.O7="unknown",GIv(p,x.loungeToken),hi(p,x.loungeTokenRefreshIntervalMs))},function(x){p.info("getDialAppInfo error: "+x); p.O7="noLoungeTokenResponse";hi(p,3E4)})},cJQ=function(p){g.rT(p.S); p.S=0;g.rT(p.V);p.V=0;p.C();p.C=function(){}; g.rT(p.T)},jN=function(p,x){bB.call(this,p,x,"ManualSession"); this.j=g.dT((0,g.dR)(this.pu,this,null),150)},IY=function(p,x){g.Fx.call(this); this.config_=x;this.Z=p;this.Y=x.appId||"233637DE";this.B=x.theme||"cl";this.T=x.disableCastApi||!1;this.S=x.forceMirroring||!1;this.U=null;this.V=!1;this.j=[];this.C=(0,g.dR)(this.KFr,this)},JJX=function(p,x){return x?g.ME(p.j,function(a){return cI(x,a.label)},p):null},M1=function(p){FQ("Controller",p)},YLX=function(p){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(p)},Wj=function(p){return p.V||!!p.j.length||!!p.U},kR=function(p,x,a){x!=p.U&&(g.aZ(p.U),(p.U=x)?(a?p.publish("yt-remote-cast2-receiver-resumed", x.Z):p.publish("yt-remote-cast2-receiver-selected",x.Z),x.subscribe("sessionScreen",(0,g.dR)(p.wO,p,x)),x.subscribe("sessionFailed",function(){return R1Q(p,x)}),x.U?p.publish("yt-remote-cast2-session-change",x.U):a&&p.U.pu(null)):p.publish("yt-remote-cast2-session-change",null))},R1Q=function(p,x){p.U==x&&p.publish("yt-remote-cast2-session-failed")},KQt=function(p){var x=p.Z.RH(),a=p.U&&p.U.Z; p=g.IT(x,function(v){a&&cI(v,a.label)&&(a=null);var c=v.uuid?v.uuid:v.id,J=JJX(this,v);J?(J.label=c,J.friendlyName=v.name):(J=new chrome.cast.Receiver(c,v.name),J.receiverType=chrome.cast.ReceiverType.CUSTOM);return J},p); a&&(a.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(a=new chrome.cast.Receiver(a.label,a.friendlyName),a.receiverType=chrome.cast.ReceiverType.CUSTOM),p.push(a));return p},h1Z=function(p,x,a,v){v.disableCastApi?DK("Cannot initialize because disabled by Mdx config."):dQQ()?bXG(x,v)&&(rJy(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?BSX(p,a):(window.__onGCastApiAvailable=function(c,J){c?BSX(p,a):(UK("Failed to load cast API: "+J),lZO(!1),rJy(!1),g.Sh("yt-remote-cast-available"),g.Sh("yt-remote-cast-receiver"), LQt(),a(!1))},v.loadCastApiSetupScript?g.Vo(Y0j):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?$lX()>=60&&bP$():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?cXv():$lX()>=89?BrO():(dlQ(),Lc(rXv.map(JX$))))):DK("Cannot initialize because not running Chrome")},LQt=function(){DK("dispose"); var p=Hj();p&&p.dispose();g.pG("yt.mdx.remote.cloudview.instance_",null);jjZ(!1);g.e6(IZy);IZy.length=0},TO=function(){return!!g.mD("yt-remote-cast-installed")},M4$=function(){var p=g.mD("yt-remote-cast-receiver"); return p?p.friendlyName:null},WQX=function(){DK("clearCurrentReceiver"); g.Sh("yt-remote-cast-receiver")},kKZ=function(){return TO()?Hj()?Hj().getCastSession():(UK("getCastSelector: Cast is not initialized."),null):(UK("getCastSelector: Cast API is not installed!"),null)},DQw=function(){TO()?Hj()?QG()?(DK("Requesting cast selector."),Hj().requestSession()):(DK("Wait for cast API to be ready to request the session."),IZy.push(g.nh("yt-remote-cast2-api-ready",DQw))):UK("requestCastSelector: Cast is not initialized."):UK("requestCastSelector: Cast API is not installed!")}, mp=function(p,x){QG()?Hj().setConnectedScreenStatus(p,x):UK("setConnectedScreenStatus called before ready.")},dQQ=function(){var p=g.Ez().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.Li||p},UQE=function(p,x){Hj().init(p,x)},bXG=function(p,x){var a=!1; Hj()||(p=new IY(p,x),p.subscribe("yt-remote-cast2-availability-change",function(v){g.Qe("yt-remote-cast-available",v);BI("yt-remote-cast2-availability-change",v)}),p.subscribe("yt-remote-cast2-receiver-selected",function(v){DK("onReceiverSelected: "+v.friendlyName); g.Qe("yt-remote-cast-receiver",v);BI("yt-remote-cast2-receiver-selected",v)}),p.subscribe("yt-remote-cast2-receiver-resumed",function(v){DK("onReceiverResumed: "+v.friendlyName); g.Qe("yt-remote-cast-receiver",v);BI("yt-remote-cast2-receiver-resumed",v)}),p.subscribe("yt-remote-cast2-session-change",function(v){DK("onSessionChange: "+J9(v)); v||g.Sh("yt-remote-cast-receiver");BI("yt-remote-cast2-session-change",v)}),g.pG("yt.mdx.remote.cloudview.instance_",p),a=!0); DK("cloudview.createSingleton_: "+a);return a},Hj=function(){return g.$t("yt.mdx.remote.cloudview.instance_")},BSX=function(p,x){lZO(!0); rJy(!1);UQE(p,function(a){a?(jjZ(!0),g.uV("yt-remote-cast2-api-ready")):(UK("Failed to initialize cast API."),lZO(!1),g.Sh("yt-remote-cast-available"),g.Sh("yt-remote-cast-receiver"),LQt());x(a)})},DK=function(p){FQ("cloudview",p)},UK=function(p){FQ("cloudview",p)},lZO=function(p){DK("setCastInstalled_ "+p); g.Qe("yt-remote-cast-installed",p)},QG=function(){return!!g.$t("yt.mdx.remote.cloudview.apiReady_")},jjZ=function(p){DK("setApiReady_ "+p); g.pG("yt.mdx.remote.cloudview.apiReady_",p)},rJy=function(p){g.pG("yt.mdx.remote.cloudview.initializing_",p)},SN=function(p){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.S=0;this.trackData=null;this.SB=this.vG=!1;this.Y=this.j=this.V=this.Z=0;this.U=NaN;this.B=!1;this.reset(p)},HXt=function(p){p.audioTrackId=null; p.trackData=null;p.playerState=-1;p.vG=!1;p.SB=!1;p.S=0;p.C=g.BQ();p.Z=0;p.V=0;p.j=0;p.Y=0;p.U=NaN;p.B=!1},fd=function(p){return p.isPlaying()?(g.BQ()-p.C)/1E3:0},Cd=function(p,x){p.S=x; p.C=g.BQ()},X8=function(p){switch(p.playerState){case 1:case 1081:return(g.BQ()-p.C)/1E3+p.S; case -1E3:return 0}return p.S},TSV=function(p){return p.B?p.V+fd(p):p.V},iB=function(p,x,a){var v=p.videoId; p.videoId=x;p.index=a;x!=v&&HXt(p)},QjQ=function(p){var x={}; x.index=p.index;x.listId=p.listId;x.videoId=p.videoId;x.playerState=p.playerState;x.volume=p.volume;x.muted=p.muted;x.audioTrackId=p.audioTrackId;x.trackData=g.jg(p.trackData);x.hasPrevious=p.vG;x.hasNext=p.SB;x.playerTime=p.S;x.playerTimeAt=p.C;x.seekableStart=p.Z;x.seekableEnd=p.V;x.duration=p.j;x.loadedTime=p.Y;x.liveIngestionTime=p.U;return x},ti=function(p,x){g.Fx.call(this); var a=this;this.j=0;this.B=p;this.S=[];this.C=new PMX;this.Z=this.U=null;this.T=(0,g.dR)(this.Nr5,this);this.V=(0,g.dR)(this.Fm,this);this.Y=(0,g.dR)(this.Ld$,this);this.Zt=(0,g.dR)(this.HId,this);var v=0;p?(v=p.getProxyState(),v!=3&&(p.subscribe("proxyStateChange",this.VI,this),mQ$(this))):v=3;v!=0&&(x?this.VI(v):g.dT(function(){a.VI(v)},0)); (p=kKZ())&&oY(this,p);this.subscribe("yt-remote-cast2-session-change",this.Zt)},zO=function(p){return new SN(p.B.getPlayerContextData())},mQ$=function(p){g.ej("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(x){this.S.push(this.B.subscribe(x,g.bZ(this.VV5,x),this))},p)},S0V=function(p){g.ej(p.S,function(x){this.B.unsubscribeByKey(x)},p); p.S.length=0},wJ=function(p){return p.getState()==1},EK=function(p,x){var a=p.C; a.U.length+a.Z.length<50&&p.C.enqueue(x)},fZy=function(p,x,a){var v=zO(p); Cd(v,a);v.playerState!=-1E3&&(v.playerState=x);yG(p,v)},gJ=function(p,x,a){p.B.sendMessage(x,a)},yG=function(p,x){S0V(p); p.B.setPlayerContextData(QjQ(x));mQ$(p)},oY=function(p,x){p.Z&&(p.Z.removeUpdateListener(p.T),p.Z.removeMediaListener(p.V),p.Fm(null)); p.Z=x;p.Z&&(pd("Setting cast session: "+p.Z.sessionId),p.Z.addUpdateListener(p.T),p.Z.addMediaListener(p.V),p.Z.media.length&&p.Fm(p.Z.media[0]))},CCw=function(p){var x=p.U.media,a=p.U.customData; if(x&&a){var v=zO(p);x.contentId!=v.videoId&&pd("Cast changing video to: "+x.contentId);v.videoId=x.contentId;v.playerState=a.playerState;Cd(v,p.U.getEstimatedTime());yG(p,v)}else pd("No cast media video. Ignoring state update.")},ZK=function(p,x,a){return(0,g.dR)(function(v){this.I9("Failed to "+x+" with cast v2 channel. Error code: "+v.code); v.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.I9("Retrying "+x+" using MDx browser channel."),gJ(this,x,a))},p)},N1=function(p,x,a,v){v=v===void 0?!1:v; g.Fx.call(this);var c=this;this.S=NaN;this.u$=!1;this.T=this.Y=this.pI=this.O7=NaN;this.Zt=[];this.C=this.V=this.B=this.U=this.Z=null;this.hG=p;this.qT=v;this.Zt.push(g.hX(window,"beforeunload",function(){c.zO(2)})); this.j=[];this.U=new SN;this.V6=x.id;this.F5=x.idType;this.Z=L8t(this.hG,a,this.Lx,this.F5=="shortLived",this.V6);this.Z.listen("channelOpened",function(){X1E(c)}); this.Z.listen("channelClosed",function(){GO("Channel closed");isNaN(c.S)?bv(!0):bv();c.dispose()}); this.Z.listen("channelError",function(J){bv();isNaN(c.wL())?(J==1&&c.F5=="shortLived"&&c.publish("browserChannelAuthError",J),GO("Channel error: "+J+" without reconnection"),c.dispose()):(c.u$=!0,GO("Channel error: "+J+" with reconnection in "+c.wL()+" ms"),OK(c,2))}); this.Z.listen("channelMessage",function(J){iX$(c,J)}); this.Z.j_(x.token);this.subscribe("remoteQueueChange",function(){var J=c.U.videoId;g.fP()&&g.Qe("yt-remote-session-video-id",J)})},oZO=function(p){return g.ME(p.j,function(x){return x.type=="LOUNGE_SCREEN"})},GO=function(p){FQ("conn",p)},OK=function(p,x){p.publish("proxyStateChange",x)},t4w=function(p){p.S=g.dT(function(){GO("Connecting timeout"); p.zO(1)},2E4)},z1G=function(p){g.rT(p.S); p.S=NaN},w1$=function(p){g.rT(p.O7); p.O7=NaN},yJ$=function(p){EZX(p); p.pI=g.dT(function(){Ai(p,"getNowPlaying")},2E4)},EZX=function(p){g.rT(p.pI); p.pI=NaN},X1E=function(p){GO("Channel opened"); p.u$&&(p.u$=!1,w1$(p),p.O7=g.dT(function(){GO("Timing out waiting for a screen.");p.zO(1)},15E3))},ZXO=function(p,x){var a=null; if(x){var v=oZO(p);v&&(a={clientName:v.clientName,deviceMake:v.brand,deviceModel:v.model,osVersion:v.osVersion})}g.pG("yt.mdx.remote.remoteClient_",a);x&&(z1G(p),w1$(p));a=p.Z.VF()&&isNaN(p.S);x==a?x&&(OK(p,1),Ai(p,"getSubtitlesTrack")):x?(p.PT()&&p.U.reset(),OK(p,1),Ai(p,"getNowPlaying"),gZR(p)):p.zO(1)},GKG=function(p,x){var a=x.params.videoId; delete x.params.videoId;a==p.U.videoId&&(g.lu(x.params)?p.U.trackData=null:p.U.trackData=x.params,p.publish("remotePlayerChange"))},OXt=function(p,x,a){var v=x.params.videoId||x.params.video_id,c=parseInt(x.params.currentIndex,10); p.U.listId=x.params.listId||p.U.listId;iB(p.U,v,c);p.publish("remoteQueueChange",a)},AJO=function(p,x){x.params=x.params||{}; OXt(p,x,"NOW_PLAYING_MAY_CHANGE");NSw(p,x);p.publish("autoplayDismissed")},NSw=function(p,x){var a=parseInt(x.params.currentTime||x.params.current_time,10); Cd(p.U,isNaN(a)?0:a);a=parseInt(x.params.state,10);a=isNaN(a)?-1:a;a==-1&&p.U.playerState==-1E3&&(a=-1E3);p.U.playerState=a;a=Number(x.params.loadedTime);p.U.Y=isNaN(a)?0:a;p.U.xb(Number(x.params.duration));a=p.U;var v=Number(x.params.liveIngestionTime);a.U=v;a.B=isNaN(v)?!1:!0;a=p.U;v=Number(x.params.seekableStartTime);x=Number(x.params.seekableEndTime);a.Z=isNaN(v)?0:v;a.V=isNaN(x)?0:x;p.U.playerState==1?yJ$(p):EZX(p);p.publish("remotePlayerChange")},PCt=function(p,x){if(p.U.playerState!=-1E3){var a= 1085; switch(parseInt(x.params.adState,10)){case 1:a=1081;break;case 2:a=1084;break;case 0:a=1083}p.U.playerState=a;x=parseInt(x.params.currentTime,10);Cd(p.U,isNaN(x)?0:x);p.publish("remotePlayerChange")}},q0y=function(p,x){var a=x.params.muted=="true"; p.U.volume=parseInt(x.params.volume,10);p.U.muted=a;p.publish("remotePlayerChange")},nZO=function(p,x){p.V=x.params.videoId; p.publish("nowAutoplaying",parseInt(x.params.timeout,10))},e1v=function(p,x){p.V=x.params.videoId||null; p.publish("autoplayUpNext",p.V)},uJR=function(p,x){p.C=x.params.autoplayMode; p.publish("autoplayModeChange",p.C);p.C=="DISABLED"&&p.publish("autoplayDismissed")},V4E=function(p,x){var a=x.params.hasNext=="true"; p.U.vG=x.params.hasPrevious=="true";p.U.SB=a;p.publish("previousNextChange")},iX$=function(p,x){x=x.message; x.params?GO("Received: action="+x.action+", params="+g.Z9(x.params)):GO("Received: action="+x.action+" {}");switch(x.action){case "loungeStatus":x=Fm(x.params.devices);p.j=g.IT(x,function(v){return new sI(v)}); x=!!g.ME(p.j,function(v){return v.type=="LOUNGE_SCREEN"}); ZXO(p,x);x=p.Bq("mlm");p.publish("multiStateLoopEnabled",x);break;case "loungeScreenDisconnected":g.Sj(p.j,function(v){return v.type=="LOUNGE_SCREEN"}); ZXO(p,!1);break;case "remoteConnected":var a=new sI(Fm(x.params.device));g.ME(p.j,function(v){return v.equals(a)})||FdQ(p.j,a); break;case "remoteDisconnected":a=new sI(Fm(x.params.device));g.Sj(p.j,function(v){return v.equals(a)}); break;case "gracefulDisconnect":break;case "playlistModified":OXt(p,x,"QUEUE_MODIFIED");break;case "nowPlaying":AJO(p,x);break;case "onStateChange":NSw(p,x);break;case "onAdStateChange":PCt(p,x);break;case "onVolumeChanged":q0y(p,x);break;case "onSubtitlesTrackChanged":GKG(p,x);break;case "nowAutoplaying":nZO(p,x);break;case "autoplayDismissed":p.publish("autoplayDismissed");break;case "autoplayUpNext":e1v(p,x);break;case "onAutoplayModeChanged":uJR(p,x);break;case "onHasPreviousNextChanged":V4E(p, x);break;case "requestAssistedSignIn":p.publish("assistedSignInRequested",x.params.authCode);break;case "onLoopModeChanged":p.publish("loopModeChange",x.params.loopMode);break;default:GO("Unrecognized action: "+x.action)}},gZR=function(p){g.rT(p.T); p.T=g.dT(function(){p.zO(1)},864E5)},Ai=function(p,x,a){a?GO("Sending: action="+x+", params="+g.Z9(a)):GO("Sending: action="+x); p.Z.sendMessage(x,a)},FQy=function(p){sK.call(this,"ScreenServiceProxy"); this.IB=p;this.U=[];this.U.push(this.IB.$_s("screenChange",(0,g.dR)(this.o7,this)));this.U.push(this.IB.$_s("onlineScreenChange",(0,g.dR)(this.Ql7,this)))},s1R=function(p,x){F4y(); if(!rQ||!rQ.get("yt-remote-disable-remote-module-for-dev")){x=g.gx("MDX_CONFIG")||x;OyQ();qiZ();Pj||(Pj=new e8(x?x.loungeApiHost:void 0),pbw()&&(Pj.U="/api/loungedev"));q1||(q1=g.$t("yt.mdx.remote.deferredProxies_")||[],g.pG("yt.mdx.remote.deferredProxies_",q1));pp$();var a=nd();if(!a){var v=new Kd(Pj,x?x.disableAutomaticScreenCache||!1:!1);g.pG("yt.mdx.remote.screenService_",v);a=nd();var c={};x&&(c={appId:x.appId,disableDial:x.disableDial,theme:x.theme,loadCastApiSetupScript:x.loadCastApiSetupScript, disableCastApi:x.disableCastApi,enableDialLoungeToken:x.enableDialLoungeToken,enableCastLoungeToken:x.enableCastLoungeToken,forceMirroring:x.forceMirroring});g.pG("yt.mdx.remote.enableConnectWithInitialState_",x?x.enableConnectWithInitialState||!1:!1);h1Z(p,v,function(J){J?eN()&&mp(eN(),"YouTube TV"):v.subscribe("onlineScreenChange",function(){BI("yt-remote-receiver-availability-change")})},c)}x&&!g.$t("yt.mdx.remote.initialized_")&&(g.pG("yt.mdx.remote.initialized_",!0),uB("Initializing: "+g.Z9(x)), VG.push(g.nh("yt-remote-cast2-api-ready",function(){BI("yt-remote-api-ready")})),VG.push(g.nh("yt-remote-cast2-availability-change",function(){BI("yt-remote-receiver-availability-change")})),VG.push(g.nh("yt-remote-cast2-receiver-selected",function(){F8(null); BI("yt-remote-auto-connect","cast-selector-receiver")})),VG.push(g.nh("yt-remote-cast2-receiver-resumed",function(){BI("yt-remote-receiver-resumed","cast-selector-receiver")})),VG.push(g.nh("yt-remote-cast2-session-change",xSj)),VG.push(g.nh("yt-remote-connection-change",function(J){J?mp(eN(),"YouTube TV"):po()||(mp(null,null),WQX())})),VG.push(g.nh("yt-remote-cast2-session-failed",function(){BI("yt-remote-connection-failed")})),p=$Sv(),x.isAuto&&(p.id+="#dial"),c=x.capabilities||[],c.length>0&&(p.capabilities= c),p.name=x.device,p.app=x.app,(x=x.theme)&&(p.theme=x),uB(" -- with channel params: "+g.Z9(p)),p?(g.Qe("yt-remote-session-app",p.app),g.Qe("yt-remote-session-name",p.name)):(g.Sh("yt-remote-session-app"),g.Sh("yt-remote-session-name")),g.pG("yt.mdx.remote.channelParams_",p),a.start(),eN()||aqt())}},viR=function(){var p=nd().IB.$_gos(); var x=xV();x&&$V()&&(GSV(p,x)||p.push(x));return Zy$(p)},JqQ=function(){var p=cqZ(); !p&&TO()&&M4$()&&(p={key:"cast-selector-receiver",name:M4$()});return p},cqZ=function(){var p=viR(),x=xV(); x||(x=po());return g.ME(p,function(a){return x&&cI(x,a.key)?!0:!1})},xV=function(){var p=eN(); if(!p)return null;var x=nd().Fu();return Rg(x,p)},xSj=function(p){uB("remote.onCastSessionChange_: "+J9(p)); if(p){var x=xV();if(x&&x.id==p.id){if(mp(x.id,"YouTube TV"),p.idType=="shortLived"&&(p=p.token))aq&&(aq.token=p),(x=$V())&&x.j_(p)}else x&&v6(),c6(p,1)}else $V()&&v6()},v6=function(){QG()?Hj().stopSession():UK("stopSession called before API ready."); var p=$V();p&&(p.disconnect(1),RDX(null))},K_t=function(){var p=$V(); return!!p&&p.getProxyState()!=3},uB=function(p){FQ("remote",p)},nd=function(){if(!dSG){var p=g.$t("yt.mdx.remote.screenService_"); dSG=p?new FQy(p):null}return dSG},eN=function(){return g.$t("yt.mdx.remote.currentScreenId_")},brw=function(p){g.pG("yt.mdx.remote.currentScreenId_",p)},rqQ=function(){return g.$t("yt.mdx.remote.connectData_")},F8=function(p){g.pG("yt.mdx.remote.connectData_",p)},$V=function(){return g.$t("yt.mdx.remote.connection_")},RDX=function(p){var x=$V(); F8(null);p||brw("");g.pG("yt.mdx.remote.connection_",p);q1&&(g.ej(q1,function(a){a(p)}),q1.length=0); x&&!p?BI("yt-remote-connection-change",!1):!x&&p&&BI("yt-remote-connection-change",!0)},po=function(){var p=g.fP(); if(!p)return null;var x=nd();if(!x)return null;x=x.Fu();return Rg(x,p)},c6=function(p,x){eN(); xV()&&xV();if(J_)aq=p;else{brw(p.id);var a=g.$t("yt.mdx.remote.enableConnectWithInitialState_")||!1;p=new N1(Pj,p,$Sv(),a);p.connect(x,rqQ());p.subscribe("beforeDisconnect",function(v){BI("yt-remote-before-disconnect",v)}); p.subscribe("beforeDispose",function(){$V()&&($V(),RDX(null))}); p.subscribe("browserChannelAuthError",function(){var v=xV();v&&v.idType=="shortLived"&&(QG()?Hj().handleBrowserChannelAuthError():UK("refreshLoungeToken called before API ready."))}); RDX(p)}},aqt=function(){var p=po(); p?(uB("Resume connection to: "+J9(p)),c6(p,0)):(bv(),WQX(),uB("Skipping connecting because no session screen found."))},pp$=function(){var p=$Sv(); if(g.lu(p)){p=dQ();var x=g.mD("yt-remote-session-name")||"",a=g.mD("yt-remote-session-app")||"";p={device:"REMOTE_CONTROL",id:p,name:x,app:a,mdxVersion:3};p.authuser=String(g.gx("SESSION_INDEX","0"));(x=g.gx("DELEGATED_SESSION_ID"))&&(p.pageId=String(x));g.pG("yt.mdx.remote.channelParams_",p)}},$Sv=function(){return g.$t("yt.mdx.remote.channelParams_")||{}},L_E=function(p,x,a){g.y.call(this); var v=this;this.U=p;this.W=x;this.HX=a;this.events=new g.II(this);this.C=!1;this.S=new g.hL(64);this.Z=new g.AW(this.g5,500,this);this.j=new g.AW(this.L9,1E3,this);this.Y=new Y7(this.l9T,0,this);this.B={};this.T=new g.AW(this.rG,1E3,this);this.V=new g.eR(this.seekTo,1E3,this);this.Zt=this.events.X(this.W,"onVolumeChange",function(c){B6O(v,c)}); g.Z(this,this.events);this.events.X(x,"onCaptionsTrackListChanged",this.htG);this.events.X(x,"captionschanged",this.atI);this.events.X(x,"captionssettingschanged",this.ke);this.events.X(x,"videoplayerreset",this.Mn);this.events.X(x,"mdxautoplaycancel",function(){v.HX.Wz()}); x.D("enable_mdx_video_play_directly")&&this.events.X(x,"videodatachange",function(){lqG(v.U)||Rq(v)||Ko(v,0)}); p=this.HX;p.b$();p.subscribe("proxyStateChange",this.zM,this);p.subscribe("remotePlayerChange",this.hV,this);p.subscribe("remoteQueueChange",this.Mn,this);p.subscribe("previousNextChange",this.oo,this);p.subscribe("nowAutoplaying",this.NS,this);p.subscribe("autoplayDismissed",this.Vz,this);g.Z(this,this.Z);g.Z(this,this.j);g.Z(this,this.Y);g.Z(this,this.T);g.Z(this,this.V);this.ke();this.Mn();this.hV()},B6O=function(p,x){if(Rq(p)){p.HX.unsubscribe("remotePlayerChange",p.hV,p); var a=Math.round(x.volume);x=!!x.muted;var v=zO(p.HX);if(a!==v.volume||x!==v.muted)p.HX.setVolume(a,x),p.T.start();p.HX.subscribe("remotePlayerChange",p.hV,p)}},YqX=function(p){p.SV(0); p.Z.stop();p.yp(new g.hL(64))},hDX=function(p,x){if(Rq(p)&&!p.C){var a=null; x&&(a={style:p.W.getSubtitlesUserSettings()},Object.assign(a,x));p.HX.gJ(p.W.getVideoData(1).videoId,a);p.B=zO(p.HX).trackData}},Ko=function(p,x){var a=p.W.getPlaylist(); if(a==null?0:a.listId){var v=a.index;var c=a.listId.toString()}a=p.W.getVideoData(1);p.HX.playVideo(a.videoId,x,v,c,a.playerParams,a.hG,Viy(a));p.yp(new g.hL(1))},j1O=function(p,x){if(x){var a=p.W.getOption("captions","tracklist",{o4:1}); a&&a.length?(p.W.setOption("captions","track",x),p.C=!1):(p.W.loadModule("captions"),p.C=!0)}else p.W.setOption("captions","track",{})},Rq=function(p){return zO(p.HX).videoId===p.W.getVideoData(1).videoId},IqX=function(p,x){g.P9.call(this,p); this.U=x},da=function(){g.N.call(this,{J:"div", K:"ytp-mdx-popup-dialog",G:{role:"dialog"},N:[{J:"div",K:"ytp-mdx-popup-dialog-inner-content",N:[{J:"div",K:"ytp-mdx-popup-title",wr:"Voc\u00ea n\u00e3o fez login"},{J:"div",K:"ytp-mdx-popup-description",wr:"Os v\u00eddeos que voc\u00ea assistir poder\u00e3o ser adicionados ao hist\u00f3rico de visualiza\u00e7\u00e3o da TV e influenciar\u00e3o as recomenda\u00e7\u00f5es dela. Para evitar isso, cancele e fa\u00e7a login no YouTube em um computador."},{J:"div",K:"ytp-mdx-privacy-popup-buttons",N:[{J:"button", CI:["ytp-button","ytp-mdx-privacy-popup-cancel"],wr:"Cancelar"},{J:"button",CI:["ytp-button","ytp-mdx-privacy-popup-confirm"],wr:"Confirmar"}]}]}]});this.fade=new g.qp(this,250);this.cancelButton=this.BO("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.BO("ytp-mdx-privacy-popup-confirm");g.Z(this,this.fade);this.X(this.cancelButton,"click",this.U);this.X(this.confirmButton,"click",this.Z)},bi=function(p){g.N.call(this,{J:"div", K:"ytp-remote",N:[{J:"div",K:"ytp-remote-display-status",N:[{J:"div",K:"ytp-remote-display-status-icon",N:[g.bPx()]},{J:"div",K:"ytp-remote-display-status-text",wr:"{{statustext}}"}]}]});this.api=p;this.fade=new g.qp(this,250);g.Z(this,this.fade);this.X(p,"presentingplayerstatechange",this.onStateChange);this.XX(p.getPlayerStateObject())},ra=function(p,x){g.w$.call(this,"Reproduzir em",1,p,x); this.W=p;this.Os={};this.X(p,"onMdxReceiversChange",this.B);this.X(p,"presentingplayerstatechange",this.B);this.B()},MJE=function(p){g.Tf.call(this,p); this.lY={key:gEV(),name:"Este computador"};this.TF=null;this.subscriptions=[];this.KQ=this.HX=null;this.Os=[this.lY];this.He=this.lY;this.Ai=new g.hL(64);this.Db=0;this.I5=-1;this.aW=!1;this.uf=this.AV=this.a8=null;if(!g.$O(this.player.L())&&!g.SG(this.player.L())){p=this.player;var x=g.S9(p);x&&(x=x.Im())&&(x=new ra(p,x),g.Z(this,x));x=new bi(p);g.Z(this,x);g.qh(p,x.element,4);this.a8=new da;g.Z(this,this.a8);g.qh(p,this.a8.element,4);this.aW=!!po()}},B6=function(p){p.AV&&(p.player.removeEventListener("presentingplayerstatechange", p.AV),p.AV=null)},W_v=function(p,x,a){p.Ai=a; p.player.publish("presentingplayerstatechange",new g.vC(a,x))},li=function(p,x){if(x.key!==p.He.key)if(x.key===p.lY.key)v6(); else if(lqG(p)&&k4t(p),p.He=x,!p.player.L().D("disable_mdx_connection_in_mdx_module_for_music_web")||!g.SG(p.player.L())){var a=p.player.getPlaylistId();var v=p.player.getVideoData(1);var c=v.videoId;if(!a&&!c||(p.player.getAppState()===2||p.player.getAppState()===1)&&p.player.L().D("should_clear_video_data_on_player_cued_unstarted"))v=null;else{var J=p.player.getPlaylist();if(J){var R=[];for(var d=0;d2*this.size&&ag(this),!0):!1}; g.I.get=function(p,x){return x7(this.Z,p)?this.Z[p]:x}; g.I.set=function(p,x){x7(this.Z,p)||(this.size+=1,this.U.push(p),this.g4++);this.Z[p]=x}; g.I.forEach=function(p,x){for(var a=this.KD(),v=0;v=v.U.length)return g.Kg;var J=v.U[x++];return g.UM(p?J:v.Z[J])}; return c}; var YiX={DrO:"atp",ob$:"ska",SRI:"que",tBr:"mus",ymT:"sus",jm5:"dsp",Gca:"seq",hMT:"mic",CH5:"dpa",MB7:"mlm",Wa7:"dsdtr",mFr:"ntb",An6:"vsp",x1A:"scn",hX7:"rpe",JZr:"dcn",II4:"dcp",EH5:"pas",ula:"drq",NUA:"opf",Yxr:"els",X$g:"isg",ahg:"svq",KxA:"mvp",bGa:"ads",jOG:"stcp",N_5:"sads",Far:"dloc",iT$:"dcw",VgT:"asw",qNO:"apw"},hm$={v9g:"u",LeA:"cl",lMA:"k",b0$:"i",ZTA:"cr",XMG:"m",fII:"g",Xh:"up"},xHw={uv:"adPlaying",Wr:"onAdStateChange"},$HG={aWr:"nowPlaying",HY$:"onStateChange",uv:"adPlaying",Wr:"onAdStateChange", Fh:"nowPlayingShorts",SR:"onShortsStateChange"},a2t={Fh:"nowPlayingShorts",SR:"onShortsStateChange"};sI.prototype.equals=function(p){return p?this.id==p.id:!1}; var PFO="",rQ=null;g.M(xlw,g.C5);var lv,KDX=avQ("loadCastFramework")||avQ("loadCastApplicationFramework"),rXv=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.LG(Y7,g.y);g.I=Y7.prototype;g.I.Vi=function(p){this.B=arguments;this.U=!1;this.x$?this.j=g.BQ()+this.eU:this.x$=g.wA(this.C,this.eU)}; g.I.stop=function(){this.x$&&(g.Fg.clearTimeout(this.x$),this.x$=null);this.j=null;this.U=!1;this.B=[]}; g.I.pause=function(){++this.Z}; g.I.resume=function(){this.Z&&(--this.Z,!this.Z&&this.U&&(this.U=!1,this.S.apply(null,this.B)))}; g.I.PO=function(){this.stop();Y7.dk.PO.call(this)}; g.I.n8=function(){this.x$&&(g.Fg.clearTimeout(this.x$),this.x$=null);this.j?(this.x$=g.wA(this.C,this.j-g.BQ()),this.j=null):this.Z?this.U=!0:(this.U=!1,this.S.apply(null,this.B))};h9.prototype.stringify=function(p){return g.Fg.JSON.stringify(p,void 0)}; h9.prototype.parse=function(p){return g.Fg.JSON.parse(p,void 0)};g.LG(lvV,g.PL);g.LG(LDQ,g.PL);var YUX=null;g.LG(jQy,g.PL);g.LG(IvO,g.PL);g.LG(Mhv,g.PL);WI.prototype.debug=function(){}; WI.prototype.info=function(){}; WI.prototype.warning=function(){};var mlE={},QQO={};g.I=k7.prototype;g.I.setTimeout=function(p){this.HO=p}; g.I.K8=function(p){p=p.target;var x=this.gr;x&&g.q0(p)==3?x.tB():this.ub(p)}; g.I.ub=function(p){try{if(p==this.U)a:{var x=g.q0(this.U),a=this.U.Z,v=this.U.getStatus();if(!(x<3)&&(x!=3||this.U&&(this.Z.j||g.el(this.U)||g.uJ(this.U)))){this.qT||x!=4||a==7||(a==8||v<=0?j8(3):j8(2));CoO(this);var c=this.U.getStatus();this.US=c;var J=TrV(this);if(this.S=c==200){if(this.Zp&&!this.tG){b:{if(this.U){var R=g.VD(this.U,"X-HTTP-Initial-Response");if(R&&!g.CZ(R)){var d=R;break b}}d=null}if(p=d)this.tG=!0,gzw(this,p);else{this.S=!1;this.C=3;Ig(12);UI(this);HI(this);break a}}if(this.F5){p= !0;for(var b;!this.qT&&this.V0&&!this.OS&&(this.OS=!0,this.j.Az(this)):(UI(this),HI(this))}else gzw(this,J);x==4&&UI(this);this.S&&!this.qT&&(x==4?XbO(this.j,this):(this.S=!1,Dr(this)))}else g.IBz(this.U),c==400&&J.indexOf("Unknown SID")> 0?(this.C=3,Ig(12)):(this.C=0,Ig(13)),UI(this),HI(this)}}}catch(r){}finally{}}; g.I.cancel=function(){this.qT=!0;UI(this)}; g.I.MM=function(){this.Zt=null;var p=Date.now();p-this.T4>=0?(this.V6!=2&&(j8(3),Ig(17)),UI(this),this.C=2,HI(this)):fvO(this,this.T4-p)}; g.I.getLastError=function(){return this.C}; g.I.lN=function(){return this.U};GWy.prototype.cancel=function(){this.j=NrO(this);if(this.Z)this.Z.cancel(),this.Z=null;else if(this.U&&this.U.size!==0){for(var p=g.k(this.U.values()),x=p.next();!x.done;x=p.next())x.value.cancel();this.U.clear()}};g.I=nzy.prototype;g.I.WP=8;g.I.rh=1;g.I.connect=function(p,x,a,v){Ig(0);this.KW=p;this.qT=x||{};a&&v!==void 0&&(this.qT.OSID=a,this.qT.OAID=v);this.tG=this.G$;this.hG=wb$(this,null,this.KW);S8(this)}; g.I.disconnect=function(){uKO(this);if(this.rh==3){var p=this.LI++,x=this.hG.clone();g.dg(x,"SID",this.B);g.dg(x,"RID",p);g.dg(x,"TYPE","terminate");XQ(this,x);p=new k7(this,this.B,p);p.V6=2;p.Y=ut(x.clone());x=!1;if(g.Fg.navigator&&g.Fg.navigator.sendBeacon)try{x=g.Fg.navigator.sendBeacon(p.Y.toString(),"")}catch(a){}!x&&g.Fg.Image&&((new Image).src=p.Y,x=!0);x||(p.U=Ulv(p.j,null),p.U.send(p.Y));p.O7=Date.now();Dr(p)}aHj(this)}; g.I.TC=function(){return this.rh==0}; g.I.getState=function(){return this.rh}; g.I.Cx=function(p){if(this.S)if(this.S=null,this.rh==1){if(!p){this.LI=Math.floor(Math.random()*1E5);p=this.LI++;var x=new k7(this,"",p),a=this.T;this.US&&(a?(a=g.hp(a),g.IJ(a,this.US)):a=this.US);this.V!==null||this.T4||(x.hG=a,a=null);var v;if(this.oa)a:{for(var c=v=0;c4096){v=c;break a}if(v===4096||c===this.j.length-1){v=c+1;break a}}v= 1E3}else v=1E3;v=pRG(this,x,v);c=this.hG.clone();g.dg(c,"RID",p);g.dg(c,"CVER",22);this.F5&&g.dg(c,"X-HTTP-Session-Id",this.F5);XQ(this,c);a&&(this.T4?v="headers="+g.mn(g.Z8J(a))+"&"+v:this.V&&g.ld(c,this.V,a));zyX(this.Z,x);this.Y_&&g.dg(c,"TYPE","init");this.oa?(g.dg(c,"$req",v),g.dg(c,"SID","null"),x.Zp=!0,Dlj(x,c,null)):Dlj(x,c,v);this.rh=2}}else this.rh==3&&(p?xMj(this,p):this.j.length==0||OPt(this.Z)||xMj(this))}; g.I.Su=function(){this.Y=null;$My(this);if(this.vX&&!(this.HO||this.U==null||this.FX<=0)){var p=4*this.FX;this.u$=MU((0,g.dR)(this.AG5,this),p)}}; g.I.AG5=function(){this.u$&&(this.u$=null,this.tG=!1,this.HO=!0,Ig(10),Qt(this),$My(this))}; g.I.Az=function(p){this.U==p&&this.vX&&!this.HO&&(eyX(this),this.HO=!0,Ig(11))}; g.I.t6=function(){this.Zt!=null&&(this.Zt=null,Qt(this),ozw(this),Ig(19))}; g.I.Mha=function(p){p?Ig(2):Ig(1)}; g.I.isActive=function(){return!!this.C&&this.C.isActive(this)}; g.I=vlR.prototype;g.I.bb=function(){}; g.I.DH=function(){}; g.I.ib=function(){}; g.I.hH=function(){}; g.I.isActive=function(){return!0}; g.I.Xe=function(){};g.LG(og,g.Bm);og.prototype.open=function(){this.U.C=this.j;this.S&&(this.U.V6=!0);this.U.connect(this.C,this.Z||void 0)}; og.prototype.close=function(){this.U.disconnect()}; og.prototype.send=function(p){var x=this.U;if(typeof p==="string"){var a={};a.__data__=p;p=a}else this.B&&(a={},a.__data__=g.Z9(p),p=a);x.j.push(new ZPX(x.L3++,p));x.rh==3&&S8(x)}; og.prototype.PO=function(){this.U.C=null;delete this.j;this.U.disconnect();delete this.U;og.dk.PO.call(this)}; g.LG(Jxy,lvV);g.LG(RsZ,LDQ);g.LG(iv,vlR);iv.prototype.bb=function(){this.U.dispatchEvent("m")}; iv.prototype.DH=function(p){this.U.dispatchEvent(new Jxy(p))}; iv.prototype.ib=function(p){this.U.dispatchEvent(new RsZ(p))}; iv.prototype.hH=function(){this.U.dispatchEvent("n")};var zq=new g.Bm;g.M(bFX,g.PL);g.I=EI.prototype;g.I.yD=null;g.I.b7=!1;g.I.hK=null;g.I.gg=null;g.I.ZO=null;g.I.iZ=null;g.I.dN=null;g.I.hB=null;g.I.o2=null;g.I.B$=null;g.I.bZ=0;g.I.hs=null;g.I.Dv=null;g.I.ly=null;g.I.Uh=-1;g.I.WR=!0;g.I.zP=!1;g.I.Ar=0;g.I.Cl=null;var hsV={},YjQ={};g.I=EI.prototype;g.I.setTimeout=function(p){this.Z=p}; g.I.xz=function(p){p=p.target;var x=this.Cl;x&&g.q0(p)==3?x.tB():this.q$(p)}; g.I.q$=function(p){try{if(p==this.B$)a:{var x=g.q0(this.B$),a=this.B$.Z,v=this.B$.getStatus();if(g.bP&&!g.gu("420+")){if(x<4)break a}else if(x<3||x==3&&!g.el(this.B$))break a;this.zP||x!=4||a==7||(a==8||v<=0?this.U.QE(3):this.U.QE(2));Mkw(this);var c=this.B$.getStatus();this.Uh=c;var J=g.el(this.B$);if(this.b7=c==200){x==4&&gQ(this);if(this.F5){for(p=!0;!this.zP&&this.bZ0?(this.ly=3,wQ(13)):(this.ly=0,wQ(14)),gQ(this),WAy(this)}}catch(d){}finally{}}; g.I.cancel=function(){this.zP=!0;gQ(this)}; g.I.Yz=function(){this.hK=null;var p=Date.now();p-this.gg>=0?(this.iZ!=2&&this.U.QE(3),gQ(this),this.ly=2,wQ(18),WAy(this)):IHO(this,this.gg-p)}; g.I.getLastError=function(){return this.ly};g.I=HFQ.prototype;g.I.Nf=null;g.I.dw=null;g.I.jx=!1;g.I.HS=null;g.I.LY=null;g.I.Hj=-1;g.I.qe=null;g.I.l5=null;g.I.connect=function(p){this.HS=p;p=Gq(this.U,null,this.HS);wQ(3);Date.now();var x=this.U.T;x!=null?(this.qe=x[0],(this.l5=x[1])?(this.LY=1,TdX(this)):(this.LY=2,QbV(this))):(Vu(p,"MODE","init"),this.dw=new EI(this),this.dw.yD=this.Nf,lHO(this.dw,p,!1,null,!0),this.LY=0)}; g.I.FE=function(p){if(p)this.LY=2,QbV(this);else{wQ(4);var x=this.U;x.pD=x.LA.Hj;PI(x,9)}p&&this.QE(2)}; g.I.Le=function(p){return this.U.Le(p)}; g.I.abort=function(){this.dw&&(this.dw.cancel(),this.dw=null);this.Hj=-1}; g.I.TC=function(){return!1}; g.I.Vk=function(p,x){this.Hj=p.Uh;if(this.LY==0)if(x){try{var a=this.Z.parse(x)}catch(v){p=this.U;p.pD=this.Hj;PI(p,2);return}this.qe=a[0];this.l5=a[1]}else p=this.U,p.pD=this.Hj,PI(p,2);else this.LY==2&&(this.jx?(wQ(7),Date.now()):x=="11111"?(wQ(6),this.jx=!0,Date.now(),this.Hj=200,this.dw.cancel(),wQ(12),OI(this.U,this,!0)):(wQ(8),Date.now(),this.jx=!1))}; g.I.cS=function(){this.Hj=this.dw.Uh;if(this.dw.b7)this.LY==0?this.l5?(this.LY=1,TdX(this)):(this.LY=2,QbV(this)):this.LY==2&&(this.jx?(wQ(12),OI(this.U,this,!0)):(wQ(11),OI(this.U,this,!1)));else{this.LY==0?wQ(9):this.LY==2&&wQ(10);var p=this.U;this.dw.getLastError();p.pD=this.Hj;PI(p,2)}}; g.I.pm=function(){return this.U.pm()}; g.I.isActive=function(){return this.U.isActive()}; g.I.QE=function(p){this.U.QE(p)};g.I=mMO.prototype;g.I.NF=null;g.I.jm=null;g.I.s5=null;g.I.zQ=null;g.I.rg=null;g.I.VX=null;g.I.nx=null;g.I.eT=null;g.I.wX=0;g.I.Gu=0;g.I.TQ=null;g.I.qP=null;g.I.e6=null;g.I.kW=null;g.I.LA=null;g.I.WS=null;g.I.Vl=-1;g.I.M$=-1;g.I.pD=-1;g.I.qj=0;g.I.D7=0;g.I.Es=8;var DSE={OK:0,VQO:2,J3G:4,gHI:5,R8a:6,STOP:7,Ir:8,niI:9,bd6:10,VUd:11,nOr:12};g.LG(fHy,g.PL);g.LG(CMZ,g.PL);g.I=mMO.prototype; g.I.connect=function(p,x,a,v,c){wQ(0);this.rg=x;this.jm=a||{};v&&c!==void 0&&(this.jm.OSID=v,this.jm.OAID=c);this.Y?(t9((0,g.dR)(this.ri,this,p),100),iFj(this)):this.ri(p)}; g.I.disconnect=function(){olV(this);if(this.U==3){var p=this.wX++,x=this.VX.clone();g.dg(x,"SID",this.B);g.dg(x,"RID",p);g.dg(x,"TYPE","terminate");A9(this,x);p=new EI(this,this.B,p);p.iZ=2;p.dN=ut(x.clone());(new Image).src=p.dN.toString();p.ZO=Date.now();LAQ(p)}Nd$(this)}; g.I.ri=function(p){this.LA=new HFQ(this);this.LA.Nf=this.NF;this.LA.Z=this.C;this.LA.connect(p)}; g.I.TC=function(){return this.U==0}; g.I.getState=function(){return this.U}; g.I.tH=function(p){this.qP=null;yxO(this,p)}; g.I.Kx=function(){this.e6=null;this.zQ=new EI(this,this.B,"rpc",this.V);this.zQ.yD=this.NF;this.zQ.Ar=0;var p=this.nx.clone();g.dg(p,"RID","rpc");g.dg(p,"SID",this.B);g.dg(p,"CI",this.WS?"0":"1");g.dg(p,"AID",this.Vl);A9(this,p);g.dg(p,"TYPE","xmlhttp");lHO(this.zQ,p,!0,this.eT,!1)}; g.I.Vk=function(p,x){if(this.U!=0&&(this.zQ==p||this.s5==p))if(this.pD=p.Uh,this.s5==p&&this.U==3)if(this.Es>7){try{var a=this.C.parse(x)}catch(v){a=null}if(Array.isArray(a)&&a.length==3)if(p=a,p[0]==0)a:{if(!this.e6){if(this.zQ)if(this.zQ.ZO+3E30)){if(v=x==1)this.s5||this.qP||this.U==1||this.qj>=2?v=!1:(this.qP=t9((0,g.dR)(this.tH,this,p),ZFG(this,this.qj)),this.qj++, v=!0);v=!(v||x==2&&GbO(this))}if(v)switch(a){case 1:PI(this,5);break;case 4:PI(this,10);break;case 3:PI(this,6);break;case 7:PI(this,12);break;default:PI(this,2)}}}; g.I.Qi=function(p){if(!g.kt(arguments,this.U))throw Error("Unexpected channel state: "+this.U);}; g.I.nLG=function(p){p?wQ(2):(wQ(1),OFv(this,8))}; g.I.Le=function(p){if(p)throw Error("Can't create secondary domain capable XhrIo object.");p=new g.N0;p.V=!1;return p}; g.I.isActive=function(){return!!this.TQ&&this.TQ.isActive(this)}; g.I.QE=function(p){var x=zq;x.dispatchEvent(new CMZ(x,p))}; g.I.pm=function(){return!1}; g.I=Axj.prototype;g.I.xA=function(){}; g.I.YA=function(){}; g.I.Qk=function(){}; g.I.XH=function(){}; g.I.yg=function(){}; g.I.GK=function(){return{}}; g.I.isActive=function(){return!0};g.I=PMX.prototype;g.I.enqueue=function(p){this.Z.push(p)}; g.I.isEmpty=function(){return this.U.length===0&&this.Z.length===0}; g.I.clear=function(){this.U=[];this.Z=[]}; g.I.contains=function(p){return g.kt(this.U,p)||g.kt(this.Z,p)}; g.I.remove=function(p){var x=this.U;var a=(0,g.DEZ)(x,p);a>=0?(g.DX(x,a),x=!0):x=!1;return x||g.UV(this.Z,p)}; g.I.sR=function(){for(var p=[],x=this.U.length-1;x>=0;--x)p.push(this.U[x]);x=this.Z.length;for(var a=0;a=USO.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(p=USO[this.Z],this.x$=g.dT((0,g.dR)(this.Yc,this),p),this.Z++):this.publish("pairingFailed",Error("Server error "+p.status))}; g.I.gs=function(){this.U=null;this.publish("pairingFailed",Error("Server not responding"))}; var USO=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.LG(cj,sK);g.I=cj.prototype;g.I.start=function(){vj(this)&&this.publish("screenChange");!g.mD("yt-remote-lounge-token-expiration")&&QFV(this);g.rT(this.U);this.U=g.dT((0,g.dR)(this.start,this),1E4)}; g.I.add=function(p,x){vj(this);DHG(this,p);Ji(this,!1);this.publish("screenChange");x(p);p.token||QFV(this)}; g.I.remove=function(p,x){var a=vj(this);HhV(this,p)&&(Ji(this,!1),a=!0);x(p);a&&this.publish("screenChange")}; g.I.Fj=function(p,x,a,v){var c=vj(this),J=this.get(p.id);J?(J.name!=x&&(J.name=x,Ji(this,!1),c=!0),a(p)):v(Error("no such local screen."));c&&this.publish("screenChange")}; g.I.PO=function(){g.rT(this.U);cj.dk.PO.call(this)}; g.I.GE=function(p){vj(this);var x=this.screens.length;p=p&&p.screens||[];for(var a=p.length,v=0;v20)break a;d=x(J,R)}J=d}c.name=J}a(dJ(this,c))},this), onError:(0,g.dR)(function(c){v(Error("pairing request failed: "+c.status))},this), onTimeout:(0,g.dR)(function(){v(Error("pairing request timed out."))},this)})}; g.I.PO=function(){g.aZ(this.Z);g.aZ(this.U);Kd.dk.PO.call(this)}; g.I.H8=function(){yQX(this);this.publish("screenChange");this.U.update()}; Kd.prototype.dispose=Kd.prototype.dispose;g.LG(bB,g.Fx);g.I=bB.prototype;g.I.YD=function(p){this.b$()||(p&&(Bj(this,""+p),this.publish("sessionFailed")),this.U=null,this.publish("sessionScreen",null))}; g.I.info=function(p){FQ(this.F5,p)}; g.I.mK=function(){return null}; g.I.iT=function(p){var x=this.Z;p?(x.displayStatus=new chrome.cast.ReceiverDisplayStatus(p,[]),x.displayStatus.showStop=!0):x.displayStatus=null;chrome.cast.setReceiverDisplayStatus(x,(0,g.dR)(function(){this.info("Updated receiver status for "+x.friendlyName+": "+p)},this),(0,g.dR)(function(){Bj(this,"Failed to update receiver status for: "+x.friendlyName)},this))}; g.I.PO=function(){this.iT("");bB.dk.PO.call(this)};g.M(lB,bB);g.I=lB.prototype;g.I.Ci=function(p){if(this.j){if(this.j==p)return;Bj(this,"Overriding cast session with new session object");V6R(this);this.O7=!1;this.T="unknown";this.j.removeUpdateListener(this.pI);this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u$)}this.j=p;this.j.addUpdateListener(this.pI);this.j.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.u$);PVV(this,"getMdxSessionStatus")}; g.I.pu=function(p){this.info("launchWithParams no-op for Cast: "+g.Z9(p))}; g.I.stop=function(){this.j?this.j.stop((0,g.dR)(function(){this.YD()},this),(0,g.dR)(function(){this.YD(Error("Failed to stop receiver app."))},this)):this.YD(Error("Stopping cast device without session."))}; g.I.iT=function(){}; g.I.PO=function(){this.info("disposeInternal");V6R(this);this.j&&(this.j.removeUpdateListener(this.pI),this.j.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.u$));this.j=null;bB.prototype.PO.call(this)}; g.I.V36=function(p,x){if(!this.b$())if(x)if(x=Fm(x),g.cQ(x))switch(p=""+x.type,x=x.data||{},this.info("onYoutubeMessage_: "+p+" "+g.Z9(x)),p){case "mdxSessionStatus":OhR(this,x);break;case "loungeToken":qLV(this,x);break;default:Bj(this,"Unknown youtube message: "+p)}else Bj(this,"Unable to parse message.");else Bj(this,"No data in message.")}; g.I.FK=function(p,x,a,v){g.rT(this.Y);this.Y=0;zBG(this.B,this.Z.label,p,this.Z.friendlyName,(0,g.dR)(function(c){c?x(c):v>=0?(Bj(this,"Screen "+p+" appears to be offline. "+v+" retries left."),this.Y=g.dT((0,g.dR)(this.FK,this,p,x,a,v-1),300)):a(Error("Unable to fetch screen."))},this),a)}; g.I.mK=function(){return this.j}; g.I.Hl=function(p){this.b$()||p||(Bj(this,"Cast session died."),this.YD())};g.M(Ld,bB);g.I=Ld.prototype;g.I.Ci=function(p){this.j=p;this.j.addUpdateListener(this.qT)}; g.I.pu=function(p){this.hG=p;this.Zt()}; g.I.stop=function(){cJQ(this);this.j?this.j.stop((0,g.dR)(this.YD,this,null),(0,g.dR)(this.YD,this,"Failed to stop DIAL device.")):this.YD()}; g.I.PO=function(){cJQ(this);this.j&&this.j.removeUpdateListener(this.qT);this.j=null;bB.prototype.PO.call(this)}; g.I.ej=function(p){this.b$()||p||(Bj(this,"DIAL session died."),this.C(),this.C=function(){},this.YD())};g.M(jN,bB);jN.prototype.stop=function(){this.YD()}; jN.prototype.Ci=function(){}; jN.prototype.pu=function(){g.rT(this.j);this.j=NaN;var p=Rg(this.B.Fu(),this.Z.label);p?rJ(this,p):this.YD(Error("No such screen"))}; jN.prototype.PO=function(){g.rT(this.j);this.j=NaN;bB.prototype.PO.call(this)};g.M(IY,g.Fx);g.I=IY.prototype; g.I.init=function(p,x){chrome.cast.timeout.requestSession=3E4;var a=new chrome.cast.SessionRequest(this.Y,[chrome.cast.Capability.AUDIO_OUT]);g.Ly("desktop_enable_cast_connect")&&(a.androidReceiverCompatible=!0);this.T||(a.dialRequest=new chrome.cast.DialRequest("YouTube"));var v=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;p=p||this.S?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var c=(0,g.dR)(this.YzT,this);a=new chrome.cast.ApiConfig(a,(0,g.dR)(this.Zg, this),c,v,p);a.customDialLaunchCallback=(0,g.dR)(this.k4g,this);chrome.cast.initialize(a,(0,g.dR)(function(){this.b$()||(chrome.cast.addReceiverActionListener(this.C),I2Q(),this.Z.subscribe("onlineScreenChange",(0,g.dR)(this.aH,this)),this.j=KQt(this),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.dR)(function(J){this.I9("Failed to set initial custom receivers: "+g.Z9(J))},this)),this.publish("yt-remote-cast2-availability-change",Wj(this)),x(!0))},this),(0,g.dR)(function(J){this.I9("Failed to initialize API: "+ g.Z9(J)); x(!1)},this))}; g.I.Nkd=function(p,x){M1("Setting connected screen ID: "+p+" -> "+x);if(this.U){var a=this.U.U;if(!p||a&&a.id!=p)M1("Unsetting old screen status: "+this.U.Z.friendlyName),kR(this,null)}if(p&&x){if(!this.U){p=Rg(this.Z.Fu(),p);if(!p){M1("setConnectedScreenStatus: Unknown screen.");return}if(p.idType=="shortLived"){M1("setConnectedScreenStatus: Screen with id type to be short lived.");return}a=JJX(this,p);a||(M1("setConnectedScreenStatus: Connected receiver not custom..."),a=new chrome.cast.Receiver(p.uuid? p.uuid:p.id,p.name),a.receiverType=chrome.cast.ReceiverType.CUSTOM,this.j.push(a),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.dR)(function(v){this.I9("Failed to set initial custom receivers: "+g.Z9(v))},this))); M1("setConnectedScreenStatus: new active receiver: "+a.friendlyName);kR(this,new jN(this.Z,a),!0)}this.U.iT(x)}else M1("setConnectedScreenStatus: no screen.")}; g.I.fKT=function(p){this.b$()?this.I9("Setting connection data on disposed cast v2"):this.U?this.U.pu(p):this.I9("Setting connection data without a session")}; g.I.Tu=function(){this.b$()?this.I9("Stopping session on disposed cast v2"):this.U?(this.U.stop(),kR(this,null)):M1("Stopping non-existing session")}; g.I.requestSession=function(){chrome.cast.requestSession((0,g.dR)(this.Zg,this),(0,g.dR)(this.E$r,this))}; g.I.PO=function(){this.Z.unsubscribe("onlineScreenChange",(0,g.dR)(this.aH,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.C);var p=YLX,x=g.$t("yt.mdx.remote.debug.handlers_");g.UV(x||[],p);g.aZ(this.U);g.Fx.prototype.PO.call(this)}; g.I.I9=function(p){FQ("Controller",p)}; g.I.wO=function(p,x){this.U==p&&(x||kR(this,null),this.publish("yt-remote-cast2-session-change",x))}; g.I.KFr=function(p,x){if(!this.b$())if(p)switch(p.friendlyName=chrome.cast.unescape(p.friendlyName),M1("onReceiverAction_ "+p.label+" / "+p.friendlyName+"-- "+x),x){case chrome.cast.ReceiverAction.CAST:if(this.U)if(this.U.Z.label!=p.label)M1("onReceiverAction_: Stopping active receiver: "+this.U.Z.friendlyName),this.U.stop();else{M1("onReceiverAction_: Casting to active receiver.");this.U.U&&this.publish("yt-remote-cast2-session-change",this.U.U);break}switch(p.receiverType){case chrome.cast.ReceiverType.CUSTOM:kR(this, new jN(this.Z,p));break;case chrome.cast.ReceiverType.DIAL:kR(this,new Ld(this.Z,p,this.B,this.config_));break;case chrome.cast.ReceiverType.CAST:kR(this,new lB(this.Z,p,this.config_));break;default:this.I9("Unknown receiver type: "+p.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.U&&this.U.Z.label==p.label?this.U.stop():this.I9("Stopping receiver w/o session: "+p.friendlyName)}else this.I9("onReceiverAction_ called without receiver.")}; g.I.k4g=function(p){if(this.b$())return Promise.reject(Error("disposed"));var x=p.receiver;x.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.I9("Not DIAL receiver: "+x.friendlyName),x.receiverType=chrome.cast.ReceiverType.DIAL);var a=this.U?this.U.Z:null;if(!a||a.label!=x.label)return this.I9("Receiving DIAL launch request for non-clicked DIAL receiver: "+x.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(a&&a.label==x.label&&a.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.U.U)return M1("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.U.U),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.I9('Changing CAST intent from "'+a.receiverType+'" to "dial" for '+x.friendlyName);kR(this,new Ld(this.Z,x,this.B,this.config_))}x=this.U;x.Y=p;x.Y.appState==chrome.cast.DialAppState.RUNNING?(p=x.Y.extraData||{},a=p.screenId||null,YR(x)&&p.loungeToken?p.loungeTokenRefreshIntervalMs?p=aZZ(x,{name:x.Z.friendlyName,screenId:p.screenId,loungeToken:p.loungeToken,dialId:x.Y.receiver.label, screenIdType:"shortLived"},p.loungeTokenRefreshIntervalMs):(g.Aa(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(p)+".")),p=sj$(x,a)):p=sj$(x,a)):p=xQV(x);return p}; g.I.Zg=function(p){var x=this;if(!this.b$()&&!this.S){M1("New cast session ID: "+p.sessionId);var a=p.receiver;if(a.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.U)if(a.receiverType==chrome.cast.ReceiverType.CAST)M1("Got resumed cast session before resumed mdx connection."),a.friendlyName=chrome.cast.unescape(a.friendlyName),kR(this,new lB(this.Z,a,this.config_),!0);else{this.I9("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var v=this.U.Z,c=Rg(this.Z.Fu(), v.label);c&&cI(c,a.label)&&v.receiverType!=chrome.cast.ReceiverType.CAST&&a.receiverType==chrome.cast.ReceiverType.CAST&&(M1("onSessionEstablished_: manual to cast session change "+a.friendlyName),g.aZ(this.U),this.U=new lB(this.Z,a,this.config_),this.U.subscribe("sessionScreen",(0,g.dR)(this.wO,this,this.U)),this.U.subscribe("sessionFailed",function(){return R1Q(x,x.U)}),this.U.pu(null)); this.U.Ci(p)}}}; g.I.f8=function(){return this.U?this.U.mK():null}; g.I.E$r=function(p){this.b$()||(this.I9("Failed to estabilish a session: "+g.Z9(p)),p.code!=chrome.cast.ErrorCode.CANCEL&&kR(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.I.YzT=function(p){M1("Receiver availability updated: "+p);if(!this.b$()){var x=Wj(this);this.V=p==chrome.cast.ReceiverAvailability.AVAILABLE;Wj(this)!=x&&this.publish("yt-remote-cast2-availability-change",Wj(this))}}; g.I.aH=function(){this.b$()||(this.j=KQt(this),M1("Updating custom receivers: "+g.Z9(this.j)),chrome.cast.setCustomReceivers(this.j,function(){},(0,g.dR)(function(){this.I9("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",Wj(this)))}; IY.prototype.setLaunchParams=IY.prototype.fKT;IY.prototype.setConnectedScreenStatus=IY.prototype.Nkd;IY.prototype.stopSession=IY.prototype.Tu;IY.prototype.getCastSession=IY.prototype.f8;IY.prototype.requestSession=IY.prototype.requestSession;IY.prototype.init=IY.prototype.init;IY.prototype.dispose=IY.prototype.dispose;var HrX=g.Y1(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),IZy=[],Y0j=g.Fw(HrX);g.I=SN.prototype; g.I.reset=function(p){this.listId="";this.index=-1;this.videoId="";HXt(this);this.volume=-1;this.muted=!1;p&&(this.index=p.index,this.listId=p.listId,this.videoId=p.videoId,this.playerState=p.playerState,this.volume=p.volume,this.muted=p.muted,this.audioTrackId=p.audioTrackId,this.trackData=p.trackData,this.vG=p.hasPrevious,this.SB=p.hasNext,this.S=p.playerTime,this.C=p.playerTimeAt,this.Z=p.seekableStart,this.V=p.seekableEnd,this.j=p.duration,this.Y=p.loadedTime,this.U=p.liveIngestionTime,this.B= !isNaN(this.U))}; g.I.isPlaying=function(){return this.playerState==1}; g.I.isBuffering=function(){return this.playerState==3}; g.I.xb=function(p){this.j=isNaN(p)?0:p}; g.I.getDuration=function(){return this.B?this.j+fd(this):this.j}; g.I.clone=function(){return new SN(QjQ(this))};g.M(ti,g.Fx);g.I=ti.prototype;g.I.getState=function(){return this.j}; g.I.wp=function(){return this.B.getReconnectTimeout()}; g.I.Y4=function(){this.B.reconnect()}; g.I.play=function(){wJ(this)?(this.U?this.U.play(null,g.ot,ZK(this,"play")):gJ(this,"play"),fZy(this,1,X8(zO(this))),this.publish("remotePlayerChange")):EK(this,this.play)}; g.I.pause=function(){wJ(this)?(this.U?this.U.pause(null,g.ot,ZK(this,"pause")):gJ(this,"pause"),fZy(this,2,X8(zO(this))),this.publish("remotePlayerChange")):EK(this,this.pause)}; g.I.seekTo=function(p){if(wJ(this)){if(this.U){var x=zO(this),a=new chrome.cast.media.SeekRequest;a.currentTime=p;x.isPlaying()||x.isBuffering()?a.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:a.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.U.seek(a,g.ot,ZK(this,"seekTo",{newTime:p}))}else gJ(this,"seekTo",{newTime:p});fZy(this,3,p);this.publish("remotePlayerChange")}else EK(this,g.bZ(this.seekTo,p))}; g.I.stop=function(){if(wJ(this)){this.U?this.U.stop(null,g.ot,ZK(this,"stopVideo")):gJ(this,"stopVideo");var p=zO(this);p.index=-1;p.videoId="";HXt(p);yG(this,p);this.publish("remotePlayerChange")}else EK(this,this.stop)}; g.I.setVolume=function(p,x){if(wJ(this)){var a=zO(this);if(this.Z){if(a.volume!=p){var v=Math.round(p)/100;this.Z.setReceiverVolumeLevel(v,(0,g.dR)(function(){pd("set receiver volume: "+v)},this),(0,g.dR)(function(){this.I9("failed to set receiver volume.")},this))}a.muted!=x&&this.Z.setReceiverMuted(x,(0,g.dR)(function(){pd("set receiver muted: "+x)},this),(0,g.dR)(function(){this.I9("failed to set receiver muted.")},this))}else{var c={volume:p, muted:x};a.volume!=-1&&(c.delta=p-a.volume);gJ(this,"setVolume",c)}a.muted=x;a.volume=p;yG(this,a)}else EK(this,g.bZ(this.setVolume,p,x))}; g.I.gJ=function(p,x){if(wJ(this)){var a=zO(this);p={videoId:p};x&&(a.trackData={trackName:x.name,languageCode:x.languageCode,sourceLanguageCode:x.translationLanguage?x.translationLanguage.languageCode:"",languageName:x.languageName,kind:x.kind},p.style=g.Z9(x.style),g.IJ(p,a.trackData));gJ(this,"setSubtitlesTrack",p);yG(this,a)}else EK(this,g.bZ(this.gJ,p,x))}; g.I.setAudioTrack=function(p,x){wJ(this)?(x=x.getLanguageInfo().getId(),gJ(this,"setAudioTrack",{videoId:p,audioTrackId:x}),p=zO(this),p.audioTrackId=x,yG(this,p)):EK(this,g.bZ(this.setAudioTrack,p,x))}; g.I.playVideo=function(p,x,a,v,c,J,R){v=v===void 0?null:v;c=c===void 0?null:c;J=J===void 0?null:J;R=R===void 0?null:R;var d=zO(this),b={videoId:p};a!==void 0&&(b.currentIndex=a);iB(d,p,a||0);x!==void 0&&(Cd(d,x),b.currentTime=x);v&&(b.listId=v);c&&(b.playerParams=c);J&&(b.clickTrackingParams=J);R&&(b.locationInfo=g.Z9(R));gJ(this,"setPlaylist",b);v||yG(this,d)}; g.I.lS=function(p,x){if(wJ(this)){if(p&&x){var a=zO(this);iB(a,p,x);yG(this,a)}gJ(this,"previous")}else EK(this,g.bZ(this.lS,p,x))}; g.I.nextVideo=function(p,x){if(wJ(this)){if(p&&x){var a=zO(this);iB(a,p,x);yG(this,a)}gJ(this,"next")}else EK(this,g.bZ(this.nextVideo,p,x))}; g.I.wD=function(){if(wJ(this)){gJ(this,"clearPlaylist");var p=zO(this);p.reset();yG(this,p);this.publish("remotePlayerChange")}else EK(this,this.wD)}; g.I.Wz=function(){wJ(this)?gJ(this,"dismissAutoplay"):EK(this,this.Wz)}; g.I.dispose=function(){if(this.j!=3){var p=this.j;this.j=3;this.publish("proxyStateChange",p,this.j)}g.Fx.prototype.dispose.call(this)}; g.I.PO=function(){S0V(this);this.B=null;this.C.clear();oY(this,null);g.Fx.prototype.PO.call(this)}; g.I.VI=function(p){if((p!=this.j||p==2)&&this.j!=3&&p!=0){var x=this.j;this.j=p;this.publish("proxyStateChange",x,p);if(p==1)for(;!this.C.isEmpty();)x=p=this.C,x.U.length===0&&(x.U=x.Z,x.U.reverse(),x.Z=[]),p.U.pop().apply(this);else p==3&&this.dispose()}}; g.I.VV5=function(p,x){this.publish(p,x)}; g.I.Nr5=function(p){if(!p)this.Fm(null),oY(this,null);else if(this.Z.receiver.volume){p=this.Z.receiver.volume;var x=zO(this),a=Math.round(100*p.level||0);if(x.volume!=a||x.muted!=p.muted)pd("Cast volume update: "+p.level+(p.muted?" muted":"")),x.volume=a,x.muted=!!p.muted,yG(this,x)}}; g.I.Fm=function(p){pd("Cast media: "+!!p);this.U&&this.U.removeUpdateListener(this.Y);if(this.U=p)this.U.addUpdateListener(this.Y),CCw(this),this.publish("remotePlayerChange")}; g.I.Ld$=function(p){p?(CCw(this),this.publish("remotePlayerChange")):this.Fm(null)}; g.I.sJ=function(){gJ(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.I.HId=function(){var p=kKZ();p&&oY(this,p)}; g.I.I9=function(p){FQ("CP",p)};g.M(N1,g.Fx);g.I=N1.prototype; g.I.connect=function(p,x){if(x){var a=x.listId,v=x.videoId,c=x.videoIds,J=x.playerParams,R=x.clickTrackingParams,d=x.index,b={videoId:v},r=x.currentTime,B=x.locationInfo;x=x.loopMode;r!==void 0&&(b.currentTime=r<=5?0:r);J&&(b.playerParams=J);B&&(b.locationInfo=B);R&&(b.clickTrackingParams=R);a&&(b.listId=a);c&&c.length>0&&(b.videoIds=c.join(","));d!==void 0&&(b.currentIndex=d);this.qT&&(b.loopMode=x||"LOOP_MODE_OFF");a&&(this.U.listId=a);this.U.videoId=v;this.U.index=d||0;this.U.state=3;Cd(this.U, r);this.C="UNSUPPORTED";a=this.qT?"setInitialState":"setPlaylist";GO("Connecting with "+a+" and params: "+g.Z9(b));this.Z.connect({method:a,params:g.Z9(b)},p,nEV())}else GO("Connecting without params"),this.Z.connect({},p,nEV());t4w(this)}; g.I.j_=function(p){this.Z.j_(p)}; g.I.dispose=function(){this.b$()||(g.pG("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),OK(this,3));g.Fx.prototype.dispose.call(this)}; g.I.PO=function(){z1G(this);EZX(this);w1$(this);g.rT(this.Y);this.Y=NaN;g.rT(this.T);this.T=NaN;this.B=null;g.jh(this.Zt);this.Zt.length=0;this.Z.dispose();g.Fx.prototype.PO.call(this);this.C=this.V=this.j=this.U=this.Z=null}; g.I.Bq=function(p){if(!this.j||this.j.length===0)return!1;for(var x=g.k(this.j),a=x.next();!a.done;a=x.next())if(!a.value.capabilities.has(p))return!1;return!0}; g.I.Jw=function(){var p=3;this.b$()||(p=0,isNaN(this.wL())?this.Z.VF()&&isNaN(this.S)&&(p=1):p=2);return p}; g.I.zO=function(p){GO("Disconnecting with "+p);g.pG("yt.mdx.remote.remoteClient_",null);z1G(this);this.publish("beforeDisconnect",p);p==1&&bv();this.Z.disconnect(p);this.dispose()}; g.I.pV=function(){var p=this.U;this.B&&(p=this.U.clone(),iB(p,this.B,p.index));return QjQ(p)}; g.I.yU4=function(p){var x=this,a=new SN(p);a.videoId&&a.videoId!=this.U.videoId&&(this.B=a.videoId,g.rT(this.Y),this.Y=g.dT(function(){if(x.B){var c=x.B;x.B=null;x.U.videoId!=c&&Ai(x,"getNowPlaying")}},5E3)); var v=[];this.U.listId==a.listId&&this.U.videoId==a.videoId&&this.U.index==a.index||v.push("remoteQueueChange");this.U.playerState==a.playerState&&this.U.volume==a.volume&&this.U.muted==a.muted&&X8(this.U)==X8(a)&&g.Z9(this.U.trackData)==g.Z9(a.trackData)||v.push("remotePlayerChange");this.U.reset(p);g.ej(v,function(c){this.publish(c)},this)}; g.I.PT=function(){var p=this.Z.getDeviceId(),x=g.ME(this.j,function(a){return a.type=="REMOTE_CONTROL"&&a.id!=p}); return x?x.id:""}; g.I.wL=function(){return this.Z.wp()}; g.I.gE=function(){return this.C||"UNSUPPORTED"}; g.I.Lt=function(){return this.V||""}; g.I.lm=function(){!isNaN(this.wL())&&this.Z.Y4()}; g.I.AUg=function(p,x){Ai(this,p,x);gZR(this)}; g.I.Lx=function(){var p=g.Cy("SAPISID","")||g.Cy("__Secure-1PAPISID")||"",x=g.Cy("__Secure-3PAPISID","")||"";if(!p&&!x)return"";p=g.m2(g.QR(p),2);x=g.m2(g.QR(x),2);return g.m2(g.QR(","+p+","+x),2)}; N1.prototype.subscribe=N1.prototype.subscribe;N1.prototype.unsubscribeByKey=N1.prototype.fG;N1.prototype.getProxyState=N1.prototype.Jw;N1.prototype.disconnect=N1.prototype.zO;N1.prototype.getPlayerContextData=N1.prototype.pV;N1.prototype.setPlayerContextData=N1.prototype.yU4;N1.prototype.getOtherConnectedRemoteId=N1.prototype.PT;N1.prototype.getReconnectTimeout=N1.prototype.wL;N1.prototype.getAutoplayMode=N1.prototype.gE;N1.prototype.getAutoplayVideoId=N1.prototype.Lt;N1.prototype.reconnect=N1.prototype.lm; N1.prototype.sendMessage=N1.prototype.AUg;N1.prototype.getXsrfToken=N1.prototype.Lx;N1.prototype.isCapabilitySupportedOnConnectedDevices=N1.prototype.Bq;g.M(FQy,sK);g.I=FQy.prototype;g.I.Fu=function(p){return this.IB.$_gs(p)}; g.I.contains=function(p){return!!this.IB.$_c(p)}; g.I.get=function(p){return this.IB.$_g(p)}; g.I.start=function(){this.IB.$_st()}; g.I.add=function(p,x,a){this.IB.$_a(p,x,a)}; g.I.remove=function(p,x,a){this.IB.$_r(p,x,a)}; g.I.Fj=function(p,x,a,v){this.IB.$_un(p,x,a,v)}; g.I.PO=function(){for(var p=this.U.length,x=0;x1&&!this.W.getOption("remote","quickCast")?(this.Os=g.uZ(p,this.U,this),this.U1(g.IT(p,this.U)),p=this.W.getOption("remote","currentReceiver"),p=this.U(p),this.options[p]&&this.oB(p),this.enable(!0)):this.enable(!1)}; ra.prototype.U=function(p){return p.key}; ra.prototype.yf=function(p){return p==="cast-selector-receiver"?"Elenco...":this.Os[p].name}; ra.prototype.UN=function(p){g.w$.prototype.UN.call(this,p);this.W.setOption("remote","currentReceiver",this.Os[p]);this.PX.iV()};g.M(MJE,g.Tf);g.I=MJE.prototype; g.I.create=function(){var p=this.player.L(),x=g.xO(p);p={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:p.D("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:p.D("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:p.D("enable_cast_short_lived_lounge_token")};s1R(x,p);this.subscriptions.push(g.nh("yt-remote-before-disconnect",this.mTa,this));this.subscriptions.push(g.nh("yt-remote-connection-change",this.x67,this));this.subscriptions.push(g.nh("yt-remote-receiver-availability-change",this.du, this));this.subscriptions.push(g.nh("yt-remote-auto-connect",this.XE4,this));this.subscriptions.push(g.nh("yt-remote-receiver-resumed",this.tVr,this));this.subscriptions.push(g.nh("mdx-privacy-popup-confirm",this.knr,this));this.subscriptions.push(g.nh("mdx-privacy-popup-cancel",this.EN$,this));this.du()}; g.I.load=function(){this.player.cancelPlayback();g.Tf.prototype.load.call(this);this.uf=new IqX(this.player.L(),this);this.player.VM(this.uf);this.TF=new L_E(this,this.player,this.HX);var p=(p=rqQ())?p.currentTime:0;var x=K_t()?new ti($V(),void 0):null;p==0&&x&&(p=X8(zO(x)));p!==0&&this.SV(p);W_v(this,this.Ai,this.Ai);this.player.h2(6)}; g.I.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.pB();this.He=this.lY;g.sM(this.TF,this.HX);this.HX=this.uf=this.TF=null;g.Tf.prototype.unload.call(this);this.player.h2(5);B6(this)}; g.I.PO=function(){g.e6(this.subscriptions);g.Tf.prototype.PO.call(this)}; g.I.sB=function(p){var x=g.g_.apply(1,arguments);this.loaded&&this.TF.u9.apply(this.TF,[p].concat(g.lf(x)))}; g.I.getAdState=function(){return this.I5}; g.I.vG=function(){return this.HX?zO(this.HX).vG:!1}; g.I.SB=function(){return this.HX?zO(this.HX).SB:!1}; g.I.SV=function(p,x){this.Db=p||0;this.player.publish("progresssync",p,x);this.player.dV("onVideoProgress",p||0)}; g.I.getCurrentTime=function(){return this.Db}; g.I.getDuration=function(){return zO(this.HX).getDuration()||0}; g.I.Ez=function(){var p=zO(this.HX);return p.B?p.U+fd(p):p.U}; g.I.BU=function(){return zO(this.HX).Y}; g.I.iH=function(){return TSV(zO(this.HX))}; g.I.sH=function(){var p=zO(this.HX);return p.Z>0?p.Z+fd(p):p.Z}; g.I.getProgressState=function(){var p=zO(this.HX),x=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:p.playerState!=1081&&this.player.yu(),clipEnd:x.clipEnd,clipStart:x.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.Ez(),isAtLiveHead:this.isAtLiveHead(),loaded:this.BU(),seekableEnd:this.iH(),seekableStart:this.sH(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.I.isAtLiveHead=function(){return TSV(zO(this.HX))-this.getCurrentTime()<=1}; g.I.nextVideo=function(){this.HX&&this.HX.nextVideo()}; g.I.lS=function(){this.HX&&this.HX.lS()}; g.I.mTa=function(p){p===1&&(this.KQ=this.HX?zO(this.HX):null)}; g.I.x67=function(){var p=K_t()?new ti($V(),void 0):null;if(p){var x=this.He;this.loaded&&this.unload();this.HX=p;this.KQ=null;x.key!==this.lY.key&&(this.He=x,this.load())}else g.aZ(this.HX),this.HX=null,this.loaded&&(this.unload(),(p=this.KQ)&&p.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(p.videoId,X8(p)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.I.du=function(){var p=[this.lY],x=p.concat,a=viR();TO()&&g.mD("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});this.Os=x.call(p,a);p=JqQ()||this.lY;li(this,p);this.player.dV("onMdxReceiversChange")}; g.I.XE4=function(){var p=JqQ();li(this,p)}; g.I.tVr=function(){this.He=JqQ()}; g.I.knr=function(){this.aW=!0;B6(this);J_=!1;aq&&c6(aq,1);aq=null}; g.I.EN$=function(){this.aW=!1;B6(this);li(this,this.lY);this.He=this.lY;J_=!1;aq=null;this.player.playVideo()}; g.I.EN=function(p,x){switch(p){case "casting":return this.loaded;case "receivers":return this.Os;case "currentReceiver":return x&&(x.key==="cast-selector-receiver"?DQw():li(this,x)),this.loaded?this.He:this.lY;case "quickCast":return this.Os.length===2&&this.Os[1].key==="cast-selector-receiver"?(x&&DQw(),!0):!1}}; g.I.sJ=function(){this.HX.sJ()}; g.I.Qs=function(){return!1}; g.I.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.I.isLoggedIn=function(){var p,x;return((p=g.gx("PLAYER_CONFIG"))==null?void 0:(x=p.args)==null?void 0:x.authuser)!==void 0?!0:!(!g.gx("SESSION_INDEX")&&!g.gx("LOGGED_IN"))};g.He("remote",MJE);})(_yt_player);