(function(g){var window=this;'use strict';var c7=function(a){g.qk(a,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.$a()).toString(36));return a},d7=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Fga(a.D,b,c)},mqb=function(a){if(a instanceof g.fn)return a; if(typeof a.nm=="function")return a.nm(!1);if(g.Sa(a)){var b=0,c=new g.fn;c.next=function(){for(;;){if(b>=a.length)return g.r1;if(b in a)return g.gn(a[b++]);b++}}; return c}throw Error("Not implemented");},nqb=function(a,b,c){if(g.Sa(a))g.Mb(a,b,c); else for(a=mqb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},oqb=function(a,b){var c=[]; nqb(b,function(d){try{var e=g.Kp.prototype.B.call(this,d,!0)}catch(f){if(f=="Storage: Invalid value was encountered")return;throw f;}e===void 0?c.push(d):g.zla(e)&&c.push(d)},a); return c},pqb=function(a,b){oqb(a,b).forEach(function(c){g.Kp.prototype.remove.call(this,c)},a)},qqb=function(a){if(a.qa){if(a.qa.locationOverrideToken)return{locationOverrideToken:a.qa.locationOverrideToken}; if(a.qa.latitudeE7!=null&&a.qa.longitudeE7!=null)return{latitudeE7:a.qa.latitudeE7,longitudeE7:a.qa.longitudeE7}}return null},rqb=function(a,b){g.rb(a,b)||a.push(b)},sqb=function(a){var b=0,c; for(c in a)b++;return b},tqb=function(a,b){return g.Ec(a,b)},uqb=function(a){try{return g.La.JSON.parse(a)}catch(b){}a=String(a); if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},e7=function(a){if(g.La.JSON)try{return g.La.JSON.parse(a)}catch(b){}return uqb(a)},vqb=function(a){if(a.Im&&typeof a.Im=="function")return a.Im(); if(typeof Map!=="undefined"&&a instanceof Map||typeof Set!=="undefined"&&a instanceof Set)return Array.from(a.values());if(typeof a==="string")return a.split("");if(g.Sa(a)){for(var b=[],c=a.length,d=0;d1){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d5&&(a=a.slice(a.length-5)); var b=g.Bl(crb(),function(d){return d.loungeToken}),c=g.Bl(a,function(d){return d.loungeToken}); g.Cl(c,function(d){return!g.rb(b,d)})&&drb(); g.zt("yt-remote-local-screens",a,31536E3)},p7=function(a){a||(g.Bt("yt-remote-session-screen-id"),g.Bt("yt-remote-session-video-id")); arb();a=n7();g.ub(a,o7());Zqb(a)},frb=function(){if(!q7){var a=g.Qp(); a&&(q7=new g.Hp(a))}},grb=function(){frb(); return q7?!!q7.get("yt-remote-use-staging-server"):!1},r7=function(a,b){g.aw[a]=!0; var c=g.Zv();c&&c.publish.apply(c,arguments);g.aw[a]=!1},hrb=function(){},f7=function(){if(!s7){s7=new g.Te(new hrb); var a=g.ls("client_streamz_web_flush_count",-1);a!==-1&&(s7.C=a)}return s7},irb=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return a?parseInt(a[1],10):0},jrb=function(a){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+a)!=-1||document.currentScript.src.indexOf("&"+a)!=-1)},krb=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},t7=function(a){a.length?lrb(a.shift(),function(){t7(a)}):mrb()},nrb=function(a){return"chrome-extension://"+a+"/cast_sender.js"},lrb=function(a,b,c){var d=document.createElement("script"); d.onerror=b;c&&(d.onload=c);g.Ud(d,g.Jq(a));(document.head||document.documentElement).appendChild(d)},orb=function(){var a=irb(),b=[]; if(a>1){var c=a-1;b.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");b.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}return b},mrb=function(){var a=krb(); a&&a(!1,"No cast extension found")},qrb=function(){if(prb){var a=2,b=krb(),c=function(){a--; a==0&&b&&b(!0)}; window.__onGCastApiAvailable=c;lrb("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",mrb,c)}},rrb=function(){qrb(); var a=orb();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");t7(a)},trb=function(){qrb(); var a=orb();a.push.apply(a,g.w(srb.map(nrb)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");t7(a)},u7=function(a,b,c){g.K.call(this); this.K=c!=null?(0,g.Xa)(a,c):a;this.Xi=b;this.G=(0,g.Xa)(this.J4,this);this.j=!1;this.B=0;this.C=this.qd=null;this.D=[]},v7=function(a,b,c){g.K.call(this); this.D=c!=null?a.bind(c):a;this.Xi=b;this.C=null;this.j=!1;this.B=0;this.qd=null},urb=function(a){a.qd=g.Re(function(){a.qd=null; a.j&&!a.B&&(a.j=!1,urb(a))},a.Xi); var b=a.C;a.C=null;a.D.apply(null,b)},w7=function(){},vrb=function(){g.lb.call(this,"p")},wrb=function(){g.lb.call(this,"o")},yrb=function(){return xrb=xrb||new g.Zc},zrb=function(a){g.lb.call(this,"serverreachability",a)},x7=function(a){var b=yrb(); b.dispatchEvent(new zrb(b,a))},Arb=function(a){g.lb.call(this,"statevent",a)},y7=function(a){var b=yrb(); b.dispatchEvent(new Arb(b,a))},Brb=function(a,b,c,d){g.lb.call(this,"timingevent",a); this.size=b;this.retries=d},z7=function(a,b){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.La.setTimeout(function(){a()},b)},A7=function(){},B7=function(a,b,c,d){this.C=a; this.D=b;this.Tb=c;this.Nb=d||1;this.Bb=new g.vk(this);this.fb=45E3;this.Na=null;this.K=!1;this.Y=this.bb=this.Z=this.Ra=this.Ca=this.rb=this.qa=null;this.ra=[];this.j=null;this.N=0;this.G=this.Ga=null;this.Jb=-1;this.Ka=!1;this.Xa=0;this.Wa=null;this.Kb=this.Va=this.zb=this.Fa=!1;this.B=new Crb},Crb=function(){this.C=null; this.j="";this.B=!1},Erb=function(a,b,c){a.Ra=1; a.Z=c7(b.clone());a.Y=c;a.Fa=!0;Drb(a,null)},Drb=function(a,b){a.Ca=Date.now(); C7(a);a.bb=a.Z.clone();d7(a.bb,"t",a.Nb);a.N=0;var c=a.C.Ra;a.B=new Crb;a.j=Frb(a.C,c?b:null,!a.Y);a.Xa>0&&(a.Wa=new v7((0,g.Xa)(a.RU,a,a.j),a.Xa));a.Bb.listen(a.j,"readystatechange",a.L4);b=a.Na?g.Jc(a.Na):{};a.Y?(a.Ga||(a.Ga="POST"),b["Content-Type"]="application/x-www-form-urlencoded",a.j.send(a.bb,a.Ga,a.Y,b)):(a.Ga="GET",a.j.send(a.bb,a.Ga,null,b));x7(1)},Hrb=function(a){if(!Grb(a))return g.jj(a.j); var b=g.kj(a.j);if(b==="")return"";var c="",d=b.length,e=g.hj(a.j)==4;if(!a.B.C){if(typeof TextDecoder==="undefined")return D7(a),E7(a),"";a.B.C=new g.La.TextDecoder}for(var f=0;fb.length)return Irb;b=b.slice(d,d+c);a.N=d+c;return b},C7=function(a){a.rb=Date.now()+a.fb; Lrb(a,a.fb)},Lrb=function(a,b){if(a.qa!=null)throw Error("WatchDog timer not null"); a.qa=z7((0,g.Xa)(a.K4,a),b)},Mrb=function(a){a.qa&&(g.La.clearTimeout(a.qa),a.qa=null)},E7=function(a){a.C.Og()||a.Ka||Nrb(a.C,a)},D7=function(a){Mrb(a); g.fb(a.Wa);a.Wa=null;a.Bb.removeAll();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},Vrb=function(a,b){try{var c=a.C; if(c.Qh!=0&&(c.j==a||Orb(c.B,a)))if(!a.Va&&Orb(c.B,a)&&c.Qh==3){try{var d=c.rf.j.parse(b)}catch(x){d=null}if(Array.isArray(d)&&d.length==3){var e=d;if(e[0]==0)a:{if(!c.Z){if(c.j)if(c.j.Ca+3E30&&(c.Xa=1.5*l);d=c;var m=a.aQ();if(m){var n=g.lj(m,"X-Client-Wire-Protocol");if(n){var p=d.B;!p.j&&(g.Sb(n,"spdy")||g.Sb(n,"quic")||g.Sb(n,"h2"))&&(p.D=p.G,p.j=new Set,p.B&&(Rrb(p,p.B),p.B=null))}if(d.Fa){var q=g.lj(m,"X-HTTP-Session-Id");q&&(d.Ae=q,g.qk(d.Na,d.Fa,q))}}c.Qh=3;c.G&&c.G.YU();c.Bc&&(c.Xc=Date.now()-a.Ca);d=c;var r=a;d.Dd=Srb(d,d.Ra?d.Nb:null,d.Tb);if(r.Va){Trb(d.B, r);var t=r,u=d.Xa;u&&t.setTimeout(u);t.qa&&(Mrb(t),C7(t));d.j=r}else Urb(d);c.C.length>0&&I7(c)}else f[0]!="stop"&&f[0]!="close"||H7(c,7);else c.Qh==3&&(f[0]=="stop"||f[0]=="close"?f[0]=="stop"?H7(c,7):c.disconnect():f[0]!="noop"&&c.G&&c.G.XU(f),c.ra=0)}x7(4)}catch(x){}},Wrb=function(a,b){this.j=a; this.map=b;this.context=null},Xrb=function(a){this.G=a||10; g.La.PerformanceNavigationTiming?(a=g.La.performance.getEntriesByType("navigation"),a=a.length>0&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(g.La.chrome&&g.La.chrome.loadTimes&&g.La.chrome.loadTimes()&&g.La.chrome.loadTimes().wasFetchedViaSpdy);this.D=a?this.G:1;this.j=null;this.D>1&&(this.j=new Set);this.B=null;this.C=[]},Yrb=function(a){return a.B?!0:a.j?a.j.size>=a.D:!1},Qrb=function(a){return a.B?1:a.j?a.j.size:0},Orb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},Rrb= function(a,b){a.j?a.j.add(b):a.B=b},Trb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},Zrb=function(a){if(a.B!=null)return a.C.concat(a.B.ra); if(a.j!=null&&a.j.size!==0){var b=a.C;a=g.v(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.ra);return b}return g.zb(a.C)},$rb=function(a,b){var c=new A7; if(g.La.Image){var d=new Image;d.onload=g.Za(J7,c,"TestLoadImage: loaded",!0,b,d);d.onerror=g.Za(J7,c,"TestLoadImage: error",!1,b,d);d.onabort=g.Za(J7,c,"TestLoadImage: abort",!1,b,d);d.ontimeout=g.Za(J7,c,"TestLoadImage: timeout",!1,b,d);g.La.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4); d.src=a}else b(!1)},asb=function(a,b){var c=new A7,d=new AbortController,e=setTimeout(function(){d.abort(); J7(c,"TestPingServer: timeout",!1,b)},1E4); fetch(a,{signal:d.signal}).then(function(f){clearTimeout(e);f.ok?J7(c,"TestPingServer: ok",!0,b):J7(c,"TestPingServer: server error",!1,b)}).catch(function(){clearTimeout(e); J7(c,"TestPingServer: error",!1,b)})},J7=function(a,b,c,d,e){try{e&&(e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null),d(c)}catch(f){}},bsb=function(){this.j=new w7},csb=function(a,b,c){var d=c||""; try{xqb(a,function(e,f){var h=e;g.Ta(e)&&(h=g.Li(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e; }},K7=function(a,b,c){return c&&c.K9?c.K9[a]||b:b},dsb=function(a){this.C=[]; this.Nb=this.Dd=this.Na=this.Tb=this.j=this.Ae=this.Fa=this.Ka=this.N=this.Jb=this.Y=null;this.Rf=this.bb=0;this.Qf=K7("failFast",!1,a);this.Va=this.qa=this.Z=this.K=this.G=null;this.qc=!0;this.ke=this.Wa=-1;this.Kb=this.ra=this.Ca=0;this.Pf=K7("baseRetryDelayMs",5E3,a);this.Sf=K7("retryDelaySeedMs",1E4,a);this.uh=K7("forwardChannelMaxRetries",2,a);this.Ed=K7("forwardChannelRequestTimeoutMs",2E4,a);this.Yd=a&&a.Lpa||void 0;this.Uf=a&&a.Eoa||void 0;this.jf=a&&a.Ipa||!1;this.Xa=void 0;this.Ra=a&&a.gea|| !1;this.D="";this.B=new Xrb(a&&a.Pma);this.rf=new bsb;this.Bb=a&&a.gna||!1;this.rb=a&&a.Vma||!1;this.Bb&&this.rb&&(this.rb=!1);this.Tf=a&&a.Gma||!1;a&&a.ina&&(this.qc=!1);this.Bc=!this.Bb&&this.qc&&a&&a.Tma||!1;this.Td=void 0;a&&a.h_&&a.h_>0&&(this.Td=a.h_);this.Lc=void 0;this.Xc=0;this.fb=!1;this.zb=this.Ga=null},G7=function(a){a.j&&(esb(a),a.j.cancel(),a.j=null)},fsb=function(a){G7(a); a.Z&&(g.La.clearTimeout(a.Z),a.Z=null);F7(a);a.B.cancel();a.K&&(typeof a.K==="number"&&g.La.clearTimeout(a.K),a.K=null)},I7=function(a){Yrb(a.B)||a.K||(a.K=!0,g.Ge(a.UU,a),a.Ca=0)},hsb=function(a,b){if(Qrb(a.B)>=a.B.D-(a.K?1:0))return!1; if(a.K)return a.C=b.ra.concat(a.C),!0;if(a.Qh==1||a.Qh==2||a.Ca>=(a.Qf?0:a.uh))return!1;a.K=z7((0,g.Xa)(a.UU,a,b),gsb(a,a.Ca));a.Ca++;return!0},jsb=function(a,b){var c; b?c=b.Tb:c=a.bb++;var d=a.Na.clone();g.qk(d,"SID",a.D);g.qk(d,"RID",c);g.qk(d,"AID",a.Wa);L7(a,d);a.N&&a.Y&&g.uk(d,a.N,a.Y);c=new B7(a,a.D,c,a.Ca+1);a.N===null&&(c.Na=a.Y);b&&(a.C=b.ra.concat(a.C));b=isb(a,c,1E3);c.setTimeout(Math.round(a.Ed*.5)+Math.round(a.Ed*.5*Math.random()));Rrb(a.B,c);Erb(c,d,b)},L7=function(a,b){a.Ka&&g.vc(a.Ka,function(c,d){g.qk(b,d,c)}); a.G&&xqb({},function(c,d){g.qk(b,d,c)})},isb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.Xa)(a.G.N4,a.G,a):null;a:{for(var e=a.C,f=-1;;){var h=["count="+c];f==-1?c>0?(f=e[0].j,h.push("ofs="+f)):f=0:h.push("ofs="+f);for(var l=!0,m=0;m=3)return!1; a.Kb++;a.Z=z7((0,g.Xa)(a.TU,a),gsb(a,a.ra));a.ra++;return!0},esb=function(a){a.Ga!=null&&(g.La.clearTimeout(a.Ga),a.Ga=null)},ksb=function(a){a.j=new B7(a,a.D,"rpc",a.Kb); a.N===null&&(a.j.Na=a.Y);a.j.Xa=0;var b=a.Dd.clone();g.qk(b,"RID","rpc");g.qk(b,"SID",a.D);g.qk(b,"AID",a.Wa);g.qk(b,"CI",a.Va?"0":"1");!a.Va&&a.Td&&g.qk(b,"TO",a.Td);g.qk(b,"TYPE","xmlhttp");L7(a,b);a.N&&a.Y&&g.uk(b,a.N,a.Y);a.Xa&&a.j.setTimeout(a.Xa);var c=a.j;a=a.Nb;c.Ra=1;c.Z=c7(b.clone());c.Y=null;c.Fa=!0;Drb(c,a)},F7=function(a){a.qa!=null&&(g.La.clearTimeout(a.qa),a.qa=null)},Nrb=function(a,b){var c=null; if(a.j==b){F7(a);esb(a);a.j=null;var d=2}else if(Orb(a.B,b))c=b.ra,Trb(a.B,b),d=1;else return;if(a.Qh!=0)if(b.K)if(d==1){c=b.Y?b.Y.length:0;b=Date.now()-b.Ca;var e=a.Ca;d=yrb();d.dispatchEvent(new Brb(d,c,b,e));I7(a)}else Urb(a);else{var f=b.Jb;e=b.getLastError();if(e==3||e==0&&f>0||!(d==1&&hsb(a,b)||d==2&&Prb(a)))switch(c&&c.length>0&&(b=a.B,b.C=b.C.concat(c)),e){case 1:H7(a,5);break;case 4:H7(a,10);break;case 3:H7(a,6);break;default:H7(a,2)}}},gsb=function(a,b){var c=a.Pf+Math.floor(Math.random()* a.Sf); a.isActive()||(c*=2);return c*b},H7=function(a,b){if(b==2){var c=(0,g.Xa)(a.oea,a),d=a.Uf,e=!d; d=new g.ik(d||"//www.google.com/images/cleardot.gif");g.La.location&&g.La.location.protocol=="http"||g.jk(d,"https");c7(d);e?$rb(d.toString(),c):asb(d.toString(),c)}else y7(2);a.Qh=0;a.G&&a.G.WU(b);lsb(a);fsb(a)},lsb=function(a){a.Qh=0; a.zb=[];if(a.G){var b=Zrb(a.B);if(b.length!=0||a.C.length!=0)g.Bb(a.zb,b),g.Bb(a.zb,a.C),a.B.C.length=0,g.zb(a.C),a.C.length=0;a.G.VU()}},msb=function(a){if(a.Qh==0)return a.zb; var b=[];g.Bb(b,Zrb(a.B));g.Bb(b,a.C);return b},Srb=function(a,b,c){var d=g.rk(c); d.j!=""?(b&&g.kk(d,b+"."+d.j),g.lk(d,d.C)):(d=g.La.location,d=yqb(d.protocol,b?b+"."+d.hostname:d.hostname,+d.port,c));b=a.Fa;c=a.Ae;b&&c&&g.qk(d,b,c);g.qk(d,"VER",a.SU);L7(a,d);return d},Frb=function(a,b,c){if(b&&!a.Ra)throw Error("Can't create secondary domain capable XhrIo object."); b=a.jf&&!a.Yd?new g.ej(new g.ek({w2:c})):new g.ej(a.Yd);b.K=a.Ra;return b},nsb=function(){},osb=function(){},N7=function(a,b){g.Zc.call(this); this.j=new dsb(b);this.G=a;this.B=b&&b.x$||null;a=b&&b.w$||null;b&&b.Nma&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.j.Y=a;a=b&&b.moa||null;b&&b.t_&&(a?a["X-WebChannel-Content-Type"]=b.t_:a={"X-WebChannel-Content-Type":b.t_});b&&b.qX&&(a?a["X-WebChannel-Client-Profile"]=b.qX:a={"X-WebChannel-Client-Profile":b.qX});this.j.Jb=a;(a=b&&b.loa)&&!g.Qb(a)&&(this.j.N=a);this.K=b&&b.gea||!1;this.D=b&&b.epa||!1;(b=b&&b.G9)&&!g.Qb(b)&&(this.j.Fa=b,g.Dc(this.B,b)&&(a=this.B, b in a&&delete a[b]));this.C=new M7(this)},psb=function(a){vrb.call(this); a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var b=a.__sm__;b?this.data=(this.j=g.Ac(b))?g.Hc(b,this.j):b:this.data=a},qsb=function(a){wrb.call(this); this.status=1;this.errorCode=a},M7=function(a){this.j=a},rsb=function(a,b){this.B=a; this.j=b},ssb=function(a){return msb(a.j).map(function(b){var c=a.B; b=b.map;"__data__"in b?(b=b.__data__,c=c.D?uqb(b):b):c=b;return c})},O7=function(a,b){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.La.setTimeout(function(){a()},b)},Q7=function(a){P7.dispatchEvent(new tsb(P7,a))},tsb=function(a){g.lb.call(this,"statevent",a)},R7=function(a,b,c,d){this.j=a; this.D=b;this.N=c;this.K=d||1;this.B=45E3;this.C=new g.vk(this);this.G=new g.Qe;this.G.setInterval(250)},vsb=function(a,b,c){a.mI=1; a.lD=c7(b.clone());a.Wv=c;a.Fa=!0;usb(a,null)},wsb=function(a,b,c,d,e){a.mI=1; a.lD=c7(b.clone());a.Wv=null;a.Fa=c;e&&(a.L1=!1);usb(a,d)},usb=function(a,b){a.oD=Date.now(); xsb(a);a.lI=a.lD.clone();d7(a.lI,"t",a.K);a.oI=0;a.nj=a.j.gN(a.j.pD()?b:null);a.eN>0&&(a.kI=new v7((0,g.Xa)(a.ZU,a,a.nj),a.eN));a.C.listen(a.nj,"readystatechange",a.P4);b=a.Uv?g.Jc(a.Uv):{};a.Wv?(a.nI="POST",b["Content-Type"]="application/x-www-form-urlencoded",a.nj.send(a.lI,a.nI,a.Wv,b)):(a.nI="GET",a.L1&&!g.rc&&(b.Connection="close"),a.nj.send(a.lI,a.nI,null,b));a.j.ys(1)},Asb=function(a,b){var c=a.oI,d=b.indexOf("\n",c); if(d==-1)return ysb;c=Number(b.substring(c,d));if(isNaN(c))return zsb;d+=1;if(d+c>b.length)return ysb;b=b.slice(d,d+c);a.oI=d+c;return b},xsb=function(a){a.fN=Date.now()+a.B; Bsb(a,a.B)},Bsb=function(a,b){if(a.fz!=null)throw Error("WatchDog timer not null"); a.fz=O7((0,g.Xa)(a.O4,a),b)},Csb=function(a){a.fz&&(g.La.clearTimeout(a.fz),a.fz=null)},Dsb=function(a){a.j.Og()||a.mD||a.j.iN(a)},S7=function(a){Csb(a); g.fb(a.kI);a.kI=null;a.G.stop();a.C.removeAll();if(a.nj){var b=a.nj;a.nj=null;b.abort();b.dispose()}a.Q2&&(a.Q2=null)},Esb=function(a,b){try{a.j.aV(a,b),a.j.ys(4)}catch(c){}},Gsb=function(a,b,c,d,e){if(d==0)c(!1); else{var f=e||0;d--;Fsb(a,b,function(h){h?c(!0):g.La.setTimeout(function(){Gsb(a,b,c,d,f)},f)})}},Fsb=function(a,b,c){var d=new Image; d.onload=function(){try{T7(d),c(!0)}catch(e){}}; d.onerror=function(){try{T7(d),c(!1)}catch(e){}}; d.onabort=function(){try{T7(d),c(!1)}catch(e){}}; d.ontimeout=function(){try{T7(d),c(!1)}catch(e){}}; g.La.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b); d.src=a},T7=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},Hsb=function(a){this.j=a; this.B=new w7},Isb=function(a){var b=U7(a.j,a.hE,"/mail/images/cleardot.gif"); c7(b);Gsb(b.toString(),5E3,(0,g.Xa)(a.g7,a),3,2E3);a.ys(1)},Jsb=function(a){var b=a.j.K; b!=null?(Q7(5),b?(Q7(11),V7(a.j,a,!1)):(Q7(12),V7(a.j,a,!0))):(a.Xk=new R7(a),a.Xk.Uv=a.hN,b=a.j,b=U7(b,b.pD()?a.pI:null,a.jN),Q7(5),d7(b,"TYPE","xmlhttp"),wsb(a.Xk,b,!1,a.pI,!1))},Ksb=function(a,b,c){this.j=1; this.B=[];this.C=[];this.G=new w7;this.Y=a||null;this.K=b!=null?b:null;this.Z=c||!1},Lsb=function(a,b){this.j=a; this.map=b;this.context=null},Msb=function(a,b,c,d){g.lb.call(this,"timingevent",a); this.size=b;this.retries=d},Nsb=function(a){g.lb.call(this,"serverreachability",a)},Psb=function(a){a.Q4(1,0); a.qI=U7(a,null,a.lN);Osb(a)},Qsb=function(a){a.Jt&&(a.Jt.abort(),a.Jt=null); a.Wg&&(a.Wg.cancel(),a.Wg=null);a.gr&&(g.La.clearTimeout(a.gr),a.gr=null);W7(a);a.nk&&(a.nk.cancel(),a.nk=null);a.nt&&(g.La.clearTimeout(a.nt),a.nt=null)},Rsb=function(a,b){if(a.j==0)throw Error("Invalid operation: sending map when state is closed"); a.B.push(new Lsb(a.R4++,b));a.j!=2&&a.j!=3||Osb(a)},Ssb=function(a){var b=0; a.Wg&&b++;a.nk&&b++;return b},Osb=function(a){a.nk||a.nt||(a.nt=O7((0,g.Xa)(a.eV,a),0),a.iz=0)},Vsb=function(a,b){if(a.j==1){if(!b){a.rD=Math.floor(Math.random()*1E5); b=a.rD++;var c=new R7(a,"",b);c.Uv=a.pp;var d=Tsb(a),e=a.qI.clone();g.qk(e,"RID",b);g.qk(e,"CVER","1");X7(a,e);vsb(c,e,d);a.nk=c;a.j=2}}else a.j==3&&(b?Usb(a,b):a.B.length==0||a.nk||Usb(a))},Usb=function(a,b){if(b)if(a.Xv>6){a.B=a.C.concat(a.B); a.C.length=0;var c=a.rD-1;b=Tsb(a)}else c=b.N,b=b.Wv;else c=a.rD++,b=Tsb(a);var d=a.qI.clone();g.qk(d,"SID",a.D);g.qk(d,"RID",c);g.qk(d,"AID",a.jz);X7(a,d);c=new R7(a,a.D,c,a.iz+1);c.Uv=a.pp;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.nk=c;vsb(c,d,b)},X7=function(a,b){a.Qi&&(a=a.Qi.iV())&&g.vc(a,function(c,d){g.qk(b,d,c)})},Tsb=function(a){var b=Math.min(a.B.length,1E3),c=["count="+b]; if(a.Xv>6&&b>0){var d=a.B[0].j;c.push("ofs="+d)}else d=0;for(var e={},f=0;f=3)return!1; a.N++;a.gr=O7((0,g.Xa)(a.dV,a),Xsb(a,a.gz));a.gz++;return!0},V7=function(a,b,c){a.QM=a.K==null?c:!a.K; a.qp=b.er;a.Z||Psb(a)},W7=function(a){a.Yv!=null&&(g.La.clearTimeout(a.Yv),a.Yv=null)},Xsb=function(a,b){var c=5E3+Math.floor(Math.random()*1E4); a.isActive()||(c*=2);return c*b},Y7=function(a,b){if(b==2||b==9){var c=null; a.Qi&&(c=null);var d=(0,g.Xa)(a.nea,a);c||(c=new g.ik("//www.google.com/images/cleardot.gif"),c7(c));Fsb(c.toString(),1E4,d)}else Q7(2);Zsb(a,b)},Zsb=function(a,b){a.j=0; a.Qi&&a.Qi.fV(b);$sb(a);Qsb(a)},$sb=function(a){a.j=0; a.qp=-1;if(a.Qi)if(a.C.length==0&&a.B.length==0)a.Qi.mN();else{var b=g.zb(a.C),c=g.zb(a.B);a.C.length=0;a.B.length=0;a.Qi.mN(b,c)}},U7=function(a,b,c){var d=g.rk(c); if(d.j!="")b&&g.kk(d,b+"."+d.j),g.lk(d,d.C);else{var e=window.location;d=yqb(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.qD&&g.vc(a.qD,function(f,h){g.qk(d,h,f)}); g.qk(d,"VER",a.Xv);X7(a,d);return d},atb=function(){},btb=function(){this.j=[]; this.B=[]},ctb=function(a){g.lb.call(this,"channelMessage"); this.message=a},dtb=function(a){g.lb.call(this,"channelError"); this.error=a},etb=function(a,b){this.action=a; this.params=b||{}},Z7=function(a,b){g.K.call(this); this.j=new g.fp(this.gca,0,this);g.Q(this,this.j);this.Xi=5E3;this.B=0;if(typeof a==="function")b&&(a=(0,g.Xa)(a,b));else if(a&&typeof a.handleEvent==="function")a=(0,g.Xa)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},ftb=function(a,b,c,d,e){c=c===void 0?!1:c; d=d===void 0?function(){return""}:d; e=e===void 0?!1:e;this.Ca=a;this.N=b;this.C=new g.Gp;this.B=new Z7(this.uda,this);this.j=null;this.qa=!1;this.K=null;this.Y="";this.Z=this.G=0;this.D=[];this.Ra=c;this.ra=d;this.Va=e;this.Na=new zqb;this.Ga=new Bqb;this.Ka=new Dqb;this.Fa=new Fqb;this.Wa=new Hqb;this.bb=new Iqb},gtb=function(a){if(a.j){var b=a.ra(),c=a.j.pp||{}; b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.pp=c}},$7=function(a){this.scheme="https"; this.port=this.domain="";this.j="/api/lounge";this.B=!0;a=a||document.location.href;var b=Number(g.Ui(4,a))||"";b&&(this.port=":"+b);this.domain=g.Vi(a)||"";a=g.Zb();a.search("MSIE")>=0&&(a=a.match(/MSIE ([\d.]+)/)[1],g.Yb(a,"10.0")<0&&(this.B=!1))},a8=function(a,b){var c=a.j; a.B&&(c=a.scheme+"://"+a.domain+a.port+a.j);return g.aj(c+b,{})},htb=function(a,b){g.Zc.call(this); var c=this;this.Gd=a();this.Gd.subscribe("handlerOpened",this.T4,this);this.Gd.subscribe("handlerClosed",this.onClosed,this);this.Gd.subscribe("handlerError",function(d,e){c.onError(e)}); this.Gd.subscribe("handlerMessage",this.onMessage,this);this.j=b},itb=function(a,b,c){var d=this; c=c===void 0?function(){return""}:c; var e=e===void 0?new osb:e;var f=f===void 0?new g.Gp:f;this.pathPrefix=a;this.j=b;this.Ca=c;this.G=f;this.Z=null;this.Y=this.N=0;this.channel=null;this.K=0;this.C=new Z7(function(){d.C.isActive();var h;((h=d.channel)==null?void 0:Qrb((new rsb(h,h.j)).j.B))===0&&d.connect(d.Z,d.N)}); this.D={};this.B={};this.qa=!1;this.logger=null;this.ra=[];this.Ag=void 0;this.Na=new zqb;this.Ga=new Bqb;this.Ka=new Dqb;this.Fa=new Fqb},jtb=function(a){g.Rc(a.channel,"m",function(){a.K=3; a.C.reset();a.Z=null;a.N=0;for(var b=g.v(a.ra),c=b.next();!c.done;c=b.next())c=c.value,a.channel&&a.channel.send(c);a.ra=[];a.publish("webChannelOpened");Aqb(a.Na,"WEB_CHANNEL")}); g.Rc(a.channel,"n",function(){a.K=0;a.C.isActive()||a.publish("webChannelClosed");var b,c=(b=a.channel)==null?void 0:ssb(new rsb(b,b.j));c&&(a.ra=[].concat(g.w(c)));Cqb(a.Ga,"WEB_CHANNEL")}); g.Rc(a.channel,"p",function(b){var c=b.data;c[0]==="gracefulReconnect"?(a.C.start(),a.channel&&a.channel.close()):a.publish("webChannelMessage",new etb(c[0],c[1]));a.Ag=b.statusCode;Eqb(a.Ka,"WEB_CHANNEL")}); g.Rc(a.channel,"o",function(){a.Ag===401||a.C.start();a.publish("webChannelError");Gqb(a.Fa,"WEB_CHANNEL")})},ktb=function(a){var b=a.Ca(); b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},ltb=function(a){g.Zc.call(this); this.j=a();this.j.subscribe("webChannelOpened",this.U4,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},mtb=function(a,b,c,d,e){function f(){return new ftb(a8(a,"/bc"),b,!1,c,d)} c=c===void 0?function(){return""}:c; return g.ks("enable_mdx_web_channel_desktop")?new ltb(function(){return new itb(a8(a,"/wc"),b,c)}):new htb(f,e)},qtb=function(){var a=ntb; otb();b8.push(a);ptb()},c8=function(a,b){otb(); var c=rtb(a,String(b));b8.length==0?stb(c):(ptb(),g.Mb(b8,function(d){d(c)}))},d8=function(a){c8("CP",a)},otb=function(){b8||(b8=g.Pa("yt.mdx.remote.debug.handlers_")||[],g.Ma("yt.mdx.remote.debug.handlers_",b8))},stb=function(a){var b=(e8+1)%50; e8=b;f8[b]=a;g8||(g8=b==49)},ptb=function(){var a=b8; if(f8[0]){var b=g8?e8:-1;do{b=(b+1)%50;var c=f8[b];g.Mb(a,function(d){d(c)})}while(b!=e8); f8=Array(50);e8=-1;g8=!1}},rtb=function(a,b){var c=(Date.now()-ttb)/1E3; c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},h8=function(a){g.iy.call(this); this.K=a;this.screens=[]},utb=function(a,b){var c=a.get(b.uuid)||a.get(b.id); if(c)return a=c.name,c.id=b.id||c.id,c.name=b.name,c.token=b.token,c.uuid=b.uuid||c.uuid,c.name!=a;a.screens.push(b);return!0},vtb=function(a,b){var c=a.screens.length!=b.length; a.screens=g.ln(a.screens,function(f){return!!Wqb(b,f)}); for(var d=0,e=b.length;d0&&a.D0&&u8(a,c)},function(b){a.G=function(){}; a.Ej(b)})},Ytb=function(a){var b={}; b.pairingCode=a.Ga;b.theme=a.Ra;grb()&&(b.env_useStageMdx=1);return g.$i(b)},Ztb=function(a){return new Promise(function(b){a.Ga=Uqb(); if(a.Na){var c=new chrome.cast.DialLaunchResponse(!0,Ytb(a));b(c);Xtb(a)}else a.qa=function(){g.hs(a.Y);a.qa=function(){}; a.Y=NaN;var d=new chrome.cast.DialLaunchResponse(!0,Ytb(a));b(d);Xtb(a)},a.Y=g.fs(function(){a.qa()},100)})},aub=function(a,b,c){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(b)); var d=new j7(b);return(new Promise(function(e){$tb(a,d,function(f){f?(a.ra=!0,n8(a.D,d),p8(a,d),u8(a,c)):g.Or(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online."));e(f)},5)})).then(function(e){return e?new chrome.cast.DialLaunchResponse(!1):Ztb(a)})},bub=function(a,b){var c=a.Z.receiver.label,d=a.B.friendlyName; return(new Promise(function(e){Htb(a.D,c,b,d,function(f){f&&f.token&&p8(a,f);e(f)},function(f){q8(a,"Failed to get DIAL screen: "+f); e(null)})})).then(function(e){return e&&e.token?new chrome.cast.DialLaunchResponse(!1):Ztb(a)})},$tb=function(a,b,c,d){g.hs(a.K); a.K=0;Jtb(a.D,b,function(e){e||d<0?c(e):a.K=g.fs(function(){$tb(a,b,c,d-1)},300)})},u8=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b); t8(a)&&(g.hs(a.N),a.N=0,b==0?cub(a):a.N=g.fs(function(){cub(a)},b))},cub=function(a){t8(a)&&a.C.getDialAppInfo(function(b){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b)); b=b.extraData||{};var c=null;if(b.loungeToken){var d;((d=a.j)==null?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(a.Ca=c,u8(a,3E4)):(a.ra=!1,a.Ca="unknown",Ntb(a,b.loungeToken),u8(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b); a.Ca="noLoungeTokenResponse";u8(a,3E4)})},dub=function(a){g.hs(a.K); a.K=0;g.hs(a.N);a.N=0;a.G();a.G=function(){}; g.hs(a.Y)},v8=function(a,b){o8.call(this,a,b,"ManualSession"); this.C=g.fs((0,g.Xa)(this.ZA,this,null),150)},w8=function(a,b){g.iy.call(this); this.config_=b;this.B=a;this.Z=b.appId||"233637DE";this.D=b.theme||"cl";this.Y=b.disableCastApi||!1;this.K=b.forceMirroring||!1;this.j=null;this.N=!1;this.C=[];this.G=(0,g.Xa)(this.tba,this)},eub=function(a,b){return b?g.pb(a.C,function(c){return k7(b,c.label)},a):null},x8=function(a){c8("Controller",a)},ntb=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},y8=function(a){return a.N||!!a.C.length||!!a.j},z8=function(a,b,c){b!=a.j&&(g.fb(a.j),(a.j=b)?(c?a.publish("yt-remote-cast2-receiver-resumed", b.B):a.publish("yt-remote-cast2-receiver-selected",b.B),b.subscribe("sessionScreen",(0,g.Xa)(a.s0,a,b)),b.subscribe("sessionFailed",function(){return fub(a,b)}),b.j?a.publish("yt-remote-cast2-session-change",b.j):c&&a.j.ZA(null)):a.publish("yt-remote-cast2-session-change",null))},fub=function(a,b){a.j==b&&a.publish("yt-remote-cast2-session-failed")},gub=function(a){var b=a.B.jV(),c=a.j&&a.j.B; a=g.Bl(b,function(d){c&&k7(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=eub(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a); c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},nub=function(a,b,c,d){d.disableCastApi?A8("Cannot initialize because disabled by Mdx config."):hub()?iub(b,d)&&(jub(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?kub(a,c):(window.__onGCastApiAvailable=function(e,f){e?kub(a,c):(B8("Failed to load cast API: "+f),lub(!1),jub(!1),g.Bt("yt-remote-cast-available"),g.Bt("yt-remote-cast-receiver"), mub(),c(!1))},d.loadCastApiSetupScript?g.fw("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?irb()>=60&&rrb():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?mrb():irb()>=89?trb():(qrb(),t7(srb.map(nrb))))):A8("Cannot initialize because not running Chrome")},mub=function(){A8("dispose"); var a=C8();a&&a.dispose();g.Ma("yt.mdx.remote.cloudview.instance_",null);oub(!1);g.dw(pub);pub.length=0},D8=function(){return!!g.At("yt-remote-cast-installed")},qub=function(){var a=g.At("yt-remote-cast-receiver"); return a?a.friendlyName:null},rub=function(){A8("clearCurrentReceiver"); g.Bt("yt-remote-cast-receiver")},sub=function(){return D8()?C8()?C8().getCastSession():(B8("getCastSelector: Cast is not initialized."),null):(B8("getCastSelector: Cast API is not installed!"),null)},tub=function(){D8()?C8()?E8()?(A8("Requesting cast selector."),C8().requestSession()):(A8("Wait for cast API to be ready to request the session."),pub.push(g.cw("yt-remote-cast2-api-ready",tub))):B8("requestCastSelector: Cast is not initialized."):B8("requestCastSelector: Cast API is not installed!")}, F8=function(a,b){E8()?C8().setConnectedScreenStatus(a,b):B8("setConnectedScreenStatus called before ready.")},hub=function(){var a=g.Zb().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.AF||a},uub=function(a,b){C8().init(a,b)},iub=function(a,b){var c=!1; C8()||(a=new w8(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.zt("yt-remote-cast-available",d);r7("yt-remote-cast2-availability-change",d)}),a.subscribe("yt-remote-cast2-receiver-selected",function(d){A8("onReceiverSelected: "+d.friendlyName); g.zt("yt-remote-cast-receiver",d);r7("yt-remote-cast2-receiver-selected",d)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(d){A8("onReceiverResumed: "+d.friendlyName); g.zt("yt-remote-cast-receiver",d);r7("yt-remote-cast2-receiver-resumed",d)}),a.subscribe("yt-remote-cast2-session-change",function(d){A8("onSessionChange: "+l7(d)); d||g.Bt("yt-remote-cast-receiver");r7("yt-remote-cast2-session-change",d)}),g.Ma("yt.mdx.remote.cloudview.instance_",a),c=!0); A8("cloudview.createSingleton_: "+c);return c},C8=function(){return g.Pa("yt.mdx.remote.cloudview.instance_")},kub=function(a,b){lub(!0); jub(!1);uub(a,function(c){c?(oub(!0),g.ew("yt-remote-cast2-api-ready")):(B8("Failed to initialize cast API."),lub(!1),g.Bt("yt-remote-cast-available"),g.Bt("yt-remote-cast-receiver"),mub());b(c)})},A8=function(a){c8("cloudview",a)},B8=function(a){c8("cloudview",a)},lub=function(a){A8("setCastInstalled_ "+a); g.zt("yt-remote-cast-installed",a)},E8=function(){return!!g.Pa("yt.mdx.remote.cloudview.apiReady_")},oub=function(a){A8("setApiReady_ "+a); g.Ma("yt.mdx.remote.cloudview.apiReady_",a)},jub=function(a){g.Ma("yt.mdx.remote.cloudview.initializing_",a)},G8=function(a){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.N=0;this.trackData=null;this.zl=this.Vp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},vub=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.Vp=!1;a.zl=!1;a.N=0;a.K=g.$a();a.D=0;a.j=0;a.G=0;a.Z=0;a.C=NaN;a.B=!1},H8=function(a){return a.isPlaying()?(g.$a()-a.K)/1E3:0},I8=function(a,b){a.N=b; a.K=g.$a()},J8=function(a){switch(a.playerState){case 1:case 1081:return(g.$a()-a.K)/1E3+a.N; case -1E3:return 0}return a.N},K8=function(a,b,c){var d=a.videoId; a.videoId=b;a.index=c;b!=d&&vub(a)},wub=function(a){var b={}; b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.Kc(a.trackData);b.hasPrevious=a.Vp;b.hasNext=a.zl;b.playerTime=a.N;b.playerTimeAt=a.K;b.seekableStart=a.D;b.seekableEnd=a.j;b.duration=a.G;b.loadedTime=a.Z;b.liveIngestionTime=a.C;return b},M8=function(a,b){g.iy.call(this); var c=this;this.C=0;this.D=a;this.K=[];this.G=new btb;this.B=this.j=null;this.Y=(0,g.Xa)(this.eaa,this);this.N=(0,g.Xa)(this.mG,this);this.Z=(0,g.Xa)(this.daa,this);this.qa=(0,g.Xa)(this.haa,this);var d=0;a?(d=a.getProxyState(),d!=3&&(a.subscribe("proxyStateChange",this.tT,this),xub(this))):d=3;d!=0&&(b?this.tT(d):g.fs(function(){c.tT(d)},0)); (a=sub())&&L8(this,a);this.subscribe("yt-remote-cast2-session-change",this.qa)},N8=function(a){return new G8(a.D.getPlayerContextData())},xub=function(a){g.Mb("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.K.push(this.D.subscribe(b,g.Za(this.qba,b),this))},a)},yub=function(a){g.Mb(a.K,function(b){this.D.unsubscribeByKey(b)},a); a.K.length=0},O8=function(a){return a.getState()==1},P8=function(a,b){var c=a.G; c.j.length+c.B.length<50&&a.G.enqueue(b)},zub=function(a,b,c){var d=N8(a); I8(d,c);d.playerState!=-1E3&&(d.playerState=b);Q8(a,d)},R8=function(a,b,c){a.D.sendMessage(b,c)},Q8=function(a,b){yub(a); a.D.setPlayerContextData(wub(b));xub(a)},L8=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.mG(null)); a.B=b;a.B&&(d8("Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.Y),a.B.addMediaListener(a.N),a.B.media.length&&a.mG(a.B.media[0]))},Aub=function(a){var b=a.j.media,c=a.j.customData; if(b&&c){var d=N8(a);b.contentId!=d.videoId&&d8("Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;I8(d,a.j.getEstimatedTime());Q8(a,d)}else d8("No cast media video. Ignoring state update.")},S8=function(a,b,c){return(0,g.Xa)(function(d){this.gg("Failed to "+b+" with cast v2 channel. Error code: "+d.code); d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.gg("Retrying "+b+" using MDx browser channel."),R8(this,b,c))},a)},V8=function(a,b,c,d){d=d===void 0?!1:d; g.iy.call(this);var e=this;this.K=NaN;this.Ga=!1;this.Y=this.Z=this.ra=this.Ca=NaN;this.qa=[];this.G=this.N=this.D=this.j=this.B=null;this.Na=a;this.Ka=d;this.qa.push(g.mt(window,"beforeunload",function(){e.Yz(2)})); this.C=[];this.j=new G8;this.Ra=b.id;this.Fa=b.idType;this.B=mtb(this.Na,c,this.oV,this.Fa=="shortLived",this.Ra);this.B.listen("channelOpened",function(){Bub(e)}); this.B.listen("channelClosed",function(){T8("Channel closed");isNaN(e.K)?p7(!0):p7();e.dispose()}); this.B.listen("channelError",function(f){p7();isNaN(e.jF())?(f==1&&e.Fa=="shortLived"&&e.publish("browserChannelAuthError",f),T8("Channel error: "+f+" without reconnection"),e.dispose()):(e.Ga=!0,T8("Channel error: "+f+" with reconnection in "+e.jF()+" ms"),U8(e,2))}); this.B.listen("channelMessage",function(f){Cub(e,f)}); this.B.Ms(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.Ct()&&g.zt("yt-remote-session-video-id",f)})},Dub=function(a){return g.pb(a.C,function(b){return b.type=="LOUNGE_SCREEN"})},T8=function(a){c8("conn",a)},U8=function(a,b){a.publish("proxyStateChange",b)},Eub=function(a){a.K=g.fs(function(){T8("Connecting timeout"); a.Yz(1)},2E4)},Fub=function(a){g.hs(a.K); a.K=NaN},Gub=function(a){g.hs(a.Ca); a.Ca=NaN},Iub=function(a){Hub(a); a.ra=g.fs(function(){W8(a,"getNowPlaying")},2E4)},Hub=function(a){g.hs(a.ra); a.ra=NaN},Bub=function(a){T8("Channel opened"); a.Ga&&(a.Ga=!1,Gub(a),a.Ca=g.fs(function(){T8("Timing out waiting for a screen.");a.Yz(1)},15E3))},Kub=function(a,b){var c=null; if(b){var d=Dub(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Ma("yt.mdx.remote.remoteClient_",c);b&&(Fub(a),Gub(a));c=a.B.KA()&&isNaN(a.K);b==c?b&&(U8(a,1),W8(a,"getSubtitlesTrack")):b?(a.vY()&&a.j.reset(),U8(a,1),W8(a,"getNowPlaying"),Jub(a)):a.Yz(1)},Lub=function(a,b){var c=b.params.videoId; delete b.params.videoId;c==a.j.videoId&&(g.Gc(b.params)?a.j.trackData=null:a.j.trackData=b.params,a.publish("remotePlayerChange"))},Mub=function(a,b,c){var d=b.params.videoId||b.params.video_id,e=parseInt(b.params.currentIndex,10); a.j.listId=b.params.listId||a.j.listId;K8(a.j,d,e);a.publish("remoteQueueChange",c)},Oub=function(a,b){b.params=b.params||{}; Mub(a,b,"NOW_PLAYING_MAY_CHANGE");Nub(a,b);a.publish("autoplayDismissed")},Nub=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10); I8(a.j,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;c==-1&&a.j.playerState==-1E3&&(c=-1E3);a.j.playerState=c;c=Number(b.params.loadedTime);a.j.Z=isNaN(c)?0:c;a.j.Wo(Number(b.params.duration));c=a.j;var d=Number(b.params.liveIngestionTime);c.C=d;c.B=isNaN(d)?!1:!0;c=a.j;d=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);c.D=isNaN(d)?0:d;c.j=isNaN(b)?0:b;a.j.playerState==1?Iub(a):Hub(a);a.publish("remotePlayerChange")},Pub=function(a,b){if(a.j.playerState!=-1E3){var c= 1085; switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.j.playerState=c;b=parseInt(b.params.currentTime,10);I8(a.j,isNaN(b)?0:b);a.publish("remotePlayerChange")}},Qub=function(a,b){var c=b.params.muted=="true"; a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.publish("remotePlayerChange")},Rub=function(a,b){a.N=b.params.videoId; a.publish("nowAutoplaying",parseInt(b.params.timeout,10))},Sub=function(a,b){a.N=b.params.videoId||null; a.publish("autoplayUpNext",a.N)},Tub=function(a,b){a.G=b.params.autoplayMode; a.publish("autoplayModeChange",a.G);a.G=="DISABLED"&&a.publish("autoplayDismissed")},Uub=function(a,b){var c=b.params.hasNext=="true"; a.j.Vp=b.params.hasPrevious=="true";a.j.zl=c;a.publish("previousNextChange")},Cub=function(a,b){b=b.message; b.params?T8("Received: action="+b.action+", params="+g.Li(b.params)):T8("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=e7(b.params.devices);a.C=g.Bl(b,function(d){return new Nqb(d)}); b=!!g.pb(a.C,function(d){return d.type=="LOUNGE_SCREEN"}); Kub(a,b);b=a.yZ("mlm");a.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.vb(a.C,function(d){return d.type=="LOUNGE_SCREEN"}); Kub(a,!1);break;case "remoteConnected":var c=new Nqb(e7(b.params.device));g.pb(a.C,function(d){return c?d.id==c.id:!1})||rqb(a.C,c); break;case "remoteDisconnected":c=new Nqb(e7(b.params.device));g.vb(a.C,function(d){return c?d.id==c.id:!1}); break;case "gracefulDisconnect":break;case "playlistModified":Mub(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":Oub(a,b);break;case "onStateChange":Nub(a,b);break;case "onAdStateChange":Pub(a,b);break;case "onVolumeChanged":Qub(a,b);break;case "onSubtitlesTrackChanged":Lub(a,b);break;case "nowAutoplaying":Rub(a,b);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":Sub(a,b);break;case "onAutoplayModeChanged":Tub(a,b);break;case "onHasPreviousNextChanged":Uub(a, b);break;case "requestAssistedSignIn":a.publish("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":a.publish("loopModeChange",b.params.loopMode);break;default:T8("Unrecognized action: "+b.action)}},Jub=function(a){g.hs(a.Y); a.Y=g.fs(function(){a.Yz(1)},864E5)},W8=function(a,b,c){c?T8("Sending: action="+b+", params="+g.Li(c)):T8("Sending: action="+b); a.B.sendMessage(b,c)},Vub=function(a){h8.call(this,"ScreenServiceProxy"); this.ih=a;this.j=[];this.j.push(this.ih.$_s("screenChange",(0,g.Xa)(this.e5,this)));this.j.push(this.ih.$_s("onlineScreenChange",(0,g.Xa)(this.Xaa,this)))},$ub=function(a,b){frb(); if(!q7||!q7.get("yt-remote-disable-remote-module-for-dev")){b=g.Lr("MDX_CONFIG")||b;Xqb();arb();X8||(X8=new $7(b?b.loungeApiHost:void 0),grb()&&(X8.j="/api/loungedev"));Y8||(Y8=g.Pa("yt.mdx.remote.deferredProxies_")||[],g.Ma("yt.mdx.remote.deferredProxies_",Y8));Wub();var c=Z8();if(!c){var d=new m8(X8,b?b.disableAutomaticScreenCache||!1:!1);g.Ma("yt.mdx.remote.screenService_",d);c=Z8();var e={};b&&(e={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.Ma("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);nub(a,d,function(f){f?$8()&&F8($8(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){r7("yt-remote-receiver-availability-change")})},e)}b&&!g.Pa("yt.mdx.remote.initialized_")&&(g.Ma("yt.mdx.remote.initialized_",!0),a9("Initializing: "+g.Li(b)), b9.push(g.cw("yt-remote-cast2-api-ready",function(){r7("yt-remote-api-ready")})),b9.push(g.cw("yt-remote-cast2-availability-change",function(){r7("yt-remote-receiver-availability-change")})),b9.push(g.cw("yt-remote-cast2-receiver-selected",function(){c9(null); r7("yt-remote-auto-connect","cast-selector-receiver")})),b9.push(g.cw("yt-remote-cast2-receiver-resumed",function(){r7("yt-remote-receiver-resumed","cast-selector-receiver")})),b9.push(g.cw("yt-remote-cast2-session-change",Xub)),b9.push(g.cw("yt-remote-connection-change",function(f){f?F8($8(),"YouTube TV"):d9()||(F8(null,null),rub())})),b9.push(g.cw("yt-remote-cast2-session-failed",function(){r7("yt-remote-connection-failed")})),a=Yub(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.ks("desktop_enable_autoplay")&& e.push("atp"),e.length>0&&(a.capabilities=e),a.name=b.device,a.app=b.app,(b=b.theme)&&(a.theme=b),a9(" -- with channel params: "+g.Li(a)),a?(g.zt("yt-remote-session-app",a.app),g.zt("yt-remote-session-name",a.name)):(g.Bt("yt-remote-session-app"),g.Bt("yt-remote-session-name")),g.Ma("yt.mdx.remote.channelParams_",a),c.start(),$8()||Zub())}},avb=function(){var a=Z8().ih.$_gos(); var b=e9();b&&f9()&&(Wqb(a,b)||a.push(b));return Vqb(a)},cvb=function(){var a=bvb(); !a&&D8()&&qub()&&(a={key:"cast-selector-receiver",name:qub()});return a},bvb=function(){var a=avb(),b=e9(); b||(b=d9());return g.pb(a,function(c){return b&&k7(b,c.key)?!0:!1})},e9=function(){var a=$8(); if(!a)return null;var b=Z8().wl();return m7(b,a)},Xub=function(a){a9("remote.onCastSessionChange_: "+l7(a)); if(a){var b=e9();if(b&&b.id==a.id){if(F8(b.id,"YouTube TV"),a.idType=="shortLived"&&(a=a.token))g9&&(g9.token=a),(b=f9())&&b.Ms(a)}else b&&h9(),i9(a,1)}else f9()&&h9()},h9=function(){E8()?C8().stopSession():B8("stopSession called before API ready."); var a=f9();a&&(a.disconnect(1),dvb(null))},evb=function(){var a=f9(); return!!a&&a.getProxyState()!=3},a9=function(a){c8("remote",a)},Z8=function(){if(!fvb){var a=g.Pa("yt.mdx.remote.screenService_"); fvb=a?new Vub(a):null}return fvb},$8=function(){return g.Pa("yt.mdx.remote.currentScreenId_")},gvb=function(a){g.Ma("yt.mdx.remote.currentScreenId_",a)},hvb=function(){return g.Pa("yt.mdx.remote.connectData_")},c9=function(a){g.Ma("yt.mdx.remote.connectData_",a)},f9=function(){return g.Pa("yt.mdx.remote.connection_")},dvb=function(a){var b=f9(); c9(null);a||gvb("");g.Ma("yt.mdx.remote.connection_",a);Y8&&(g.Mb(Y8,function(c){c(a)}),Y8.length=0); b&&!a?r7("yt-remote-connection-change",!1):!b&&a&&r7("yt-remote-connection-change",!0)},d9=function(){var a=g.Ct(); if(!a)return null;var b=Z8();if(!b)return null;b=b.wl();return m7(b,a)},i9=function(a,b){$8(); e9()&&e9();if(j9)g9=a;else{gvb(a.id);var c=g.Pa("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new V8(X8,a,Yub(),c);a.connect(b,hvb());a.subscribe("beforeDisconnect",function(d){r7("yt-remote-before-disconnect",d)}); a.subscribe("beforeDispose",function(){f9()&&(f9(),dvb(null))}); a.subscribe("browserChannelAuthError",function(){var d=e9();d&&d.idType=="shortLived"&&(E8()?C8().handleBrowserChannelAuthError():B8("refreshLoungeToken called before API ready."))}); dvb(a)}},Zub=function(){var a=d9(); a?(a9("Resume connection to: "+l7(a)),i9(a,0)):(p7(),rub(),a9("Skipping connecting because no session screen found."))},Wub=function(){var a=Yub(); if(g.Gc(a)){a=o7();var b=g.At("yt-remote-session-name")||"",c=g.At("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};a.authuser=String(g.Lr("SESSION_INDEX","0"));(b=g.Lr("DELEGATED_SESSION_ID"))&&(a.pageId=String(b));g.Ma("yt.mdx.remote.channelParams_",a)}},Yub=function(){return g.Pa("yt.mdx.remote.channelParams_")||{}},kvb=function(a,b,c){g.K.call(this); var d=this;this.module=a;this.J=b;this.Ic=c;this.events=new g.EF(this);this.Y=this.events.T(this.J,"onVolumeChange",function(e){ivb(d,e)}); this.D=!1;this.G=new g.BG(64);this.j=new g.fp(this.q2,500,this);this.B=new g.fp(this.s2,1E3,this);this.N=new u7(this.Lea,0,this);this.C={};this.Z=new g.fp(this.r3,1E3,this);this.K=new v7(this.seekTo,1E3,this);g.Q(this,this.events);this.events.T(b,"onCaptionsTrackListChanged",this.Iaa);this.events.T(b,"captionschanged",this.baa);this.events.T(b,"captionssettingschanged",this.C2);this.events.T(b,"videoplayerreset",this.vL);this.events.T(b,"mdxautoplaycancel",function(){d.Ic.GX()}); b.L("enable_mdx_video_play_directly")&&this.events.T(b,"videodatachange",function(){jvb(d.module)||k9(d)||l9(d,0)}); a=this.Ic;a.Ma();a.subscribe("proxyStateChange",this.n0,this);a.subscribe("remotePlayerChange",this.wG,this);a.subscribe("remoteQueueChange",this.vL,this);a.subscribe("previousNextChange",this.k0,this);a.subscribe("nowAutoplaying",this.f0,this);a.subscribe("autoplayDismissed",this.M_,this);g.Q(this,this.j);g.Q(this,this.B);g.Q(this,this.N);g.Q(this,this.Z);g.Q(this,this.K);this.C2();this.vL();this.wG()},ivb=function(a,b){if(k9(a)){a.Ic.unsubscribe("remotePlayerChange",a.wG,a); var c=Math.round(b.volume);b=!!b.muted;var d=N8(a.Ic);if(c!==d.volume||b!==d.muted)a.Ic.setVolume(c,b),a.Z.start();a.Ic.subscribe("remotePlayerChange",a.wG,a)}},lvb=function(a){a.Sc(0); a.j.stop();a.Gc(new g.BG(64))},mvb=function(a,b){if(k9(a)&&!a.D){var c=null; b&&(c={style:a.J.getSubtitlesUserSettings()},g.Lc(c,b));a.Ic.nV(a.J.getVideoData(1).videoId,c);a.C=N8(a.Ic).trackData}},l9=function(a,b){var c=a.J.getPlaylist(); if(c==null?0:c.listId){var d=c.index;var e=c.listId.toString()}c=a.J.getVideoData(1);a.Ic.playVideo(c.videoId,b,d,e,c.playerParams,c.ra,qqb(c));a.Gc(new g.BG(1))},nvb=function(a,b){if(b){var c=a.J.getOption("captions","tracklist",{lZ:1}); c&&c.length?(a.J.setOption("captions","track",b),a.D=!1):(a.J.loadModule("captions"),a.D=!0)}else a.J.setOption("captions","track",{})},k9=function(a){return N8(a.Ic).videoId===a.J.getVideoData(1).videoId},m9=function(){g.T.call(this,{I:"div", S:"ytp-mdx-popup-dialog",W:{role:"dialog"},V:[{I:"div",S:"ytp-mdx-popup-dialog-inner-content",V:[{I:"div",S:"ytp-mdx-popup-title",va:"You're signed out"},{I:"div",S:"ytp-mdx-popup-description",va:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{I:"div",S:"ytp-mdx-privacy-popup-buttons",V:[{I:"button",La:["ytp-button","ytp-mdx-privacy-popup-cancel"],va:"Cancel"},{I:"button",La:["ytp-button", "ytp-mdx-privacy-popup-confirm"],va:"Confirm"}]}]}]});this.j=new g.gz(this,250);this.cancelButton=this.Ea("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Ea("ytp-mdx-privacy-popup-confirm");g.Q(this,this.j);this.T(this.cancelButton,"click",this.B);this.T(this.confirmButton,"click",this.C)},n9=function(a){g.T.call(this,{I:"div", S:"ytp-remote",V:[{I:"div",S:"ytp-remote-display-status",V:[{I:"div",S:"ytp-remote-display-status-icon",V:[g.Zra()]},{I:"div",S:"ytp-remote-display-status-text",va:"{{statustext}}"}]}]});this.api=a;this.j=new g.gz(this,250);g.Q(this,this.j);this.T(a,"presentingplayerstatechange",this.onStateChange);this.xd(a.getPlayerStateObject())},o9=function(a,b){g.DT.call(this,"Play on",1,a,b); this.J=a;this.fv={};this.T(a,"onMdxReceiversChange",this.D);this.T(a,"presentingplayerstatechange",this.D);this.D()},ovb=function(a){g.jU.call(this,a); this.kq={key:Uqb(),name:"This computer"};this.qm=null;this.subscriptions=[];this.AS=this.Ic=null;this.fv=[this.kq];this.Mt=this.kq;this.Ge=new g.BG(64);this.MZ=0;this.gi=-1;this.PG=!1;this.OG=this.UB=null;if(!g.LP(this.player.U())&&!g.Lz(this.player.U())){a=this.player;var b=g.eS(a);b&&(b=b.Hm())&&(b=new o9(a,b),g.Q(this,b));b=new n9(a);g.Q(this,b);g.KS(a,b.element,4);this.UB=new m9;g.Q(this,this.UB);g.KS(a,this.UB.element,4);this.PG=!!d9()}},p9=function(a){a.OG&&(a.player.removeEventListener("presentingplayerstatechange", a.OG),a.OG=null)},pvb=function(a,b,c){a.Ge=c; a.player.publish("presentingplayerstatechange",new g.rz(c,b))},q9=function(a,b){if(b.key!==a.Mt.key)if(b.key===a.kq.key)h9(); else if(jvb(a)&&qvb(a),a.Mt=b,!a.player.U().L("disable_mdx_connection_in_mdx_module_for_music_web")||!g.Lz(a.player.U())){var c=a.player.getPlaylistId();var d=a.player.getVideoData(1);var e=d.videoId;if(!c&&!e||(a.player.getAppState()===2||a.player.getAppState()===1)&&a.player.U().L("should_clear_video_data_on_player_cued_unstarted"))d=null;else{var f=a.player.getPlaylist();if(f){var h=[];for(var l=0;l2*this.size&&i7(this),!0):!1}; g.k.get=function(a,b){return g7(this.B,a)?this.B[a]:b}; g.k.set=function(a,b){g7(this.B,a)||(this.size+=1,this.j.push(a),this.Iv++);this.B[a]=b}; g.k.forEach=function(a,b){for(var c=this.Vn(),d=0;d=d.j.length)return g.r1;var f=d.j[b++];return g.gn(a?f:d.B[f])}; return e}; var Oqb={Ufa:"atp",Oka:"ska",kka:"que",wja:"mus",Mka:"sus",Eha:"dsp",zka:"seq",nja:"mic",Rga:"dpa",cga:"cds",uja:"mlm",Pga:"dsdtr",Dja:"ntb",Dla:"vsp",cha:"scn",mka:"rpe",Mga:"dcn",Nga:"dcp",Sja:"pas",Oga:"drq",Ija:"opf",bha:"els",Eka:"svq",vja:"mvp"},Pqb={Cla:"u",nga:"cl",Tia:"k",Vha:"i",Ega:"cr",xja:"m",rha:"g",J6:"up"},$qb="",q7=null; hrb.prototype.flush=function(a,b){a=a===void 0?[]:a;b=b===void 0?!1:b;if(g.ks("enable_client_streamz_web")){a=g.v(a);for(var c=a.next();!c.done;c=a.next())c=g.efa(c.value),c={serializedIncrementBatch:g.Xe(c.j())},g.bu("streamzIncremented",c,{sendIsolatedPayload:b})}}; var s7,prb=jrb("loadCastFramework")||jrb("loadCastApplicationFramework"),srb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.ab(u7,g.K);g.k=u7.prototype;g.k.I4=function(a){this.D=arguments;this.j=!1;this.qd?this.C=g.$a()+this.Xi:this.qd=g.Re(this.G,this.Xi)}; g.k.stop=function(){this.qd&&(g.La.clearTimeout(this.qd),this.qd=null);this.C=null;this.j=!1;this.D=[]}; g.k.pause=function(){++this.B}; g.k.resume=function(){this.B&&(--this.B,!this.B&&this.j&&(this.j=!1,this.K.apply(null,this.D)))}; g.k.xa=function(){this.stop();u7.Of.xa.call(this)}; g.k.J4=function(){this.qd&&(g.La.clearTimeout(this.qd),this.qd=null);this.C?(this.qd=g.Re(this.G,this.C-g.$a()),this.C=null):this.B?this.j=!0:(this.j=!1,this.K.apply(null,this.D))};g.z(v7,g.K);g.k=v7.prototype;g.k.dN=function(a){this.C=arguments;this.qd||this.B?this.j=!0:urb(this)}; g.k.stop=function(){this.qd&&(g.La.clearTimeout(this.qd),this.qd=null,this.j=!1,this.C=null)}; g.k.pause=function(){this.B++}; g.k.resume=function(){this.B--;this.B||!this.j||this.qd||(this.j=!1,urb(this))}; g.k.xa=function(){g.K.prototype.xa.call(this);this.stop()};w7.prototype.stringify=function(a){return g.La.JSON.stringify(a,void 0)}; w7.prototype.parse=function(a){return g.La.JSON.parse(a,void 0)};g.ab(vrb,g.lb);g.ab(wrb,g.lb);var xrb=null;g.ab(zrb,g.lb);g.ab(Arb,g.lb);g.ab(Brb,g.lb);A7.prototype.debug=function(){}; A7.prototype.info=function(){}; A7.prototype.warning=function(){};var Jrb={},Irb={};g.k=B7.prototype;g.k.setTimeout=function(a){this.fb=a}; g.k.L4=function(a){a=a.target;var b=this.Wa;b&&g.hj(a)==3?b.dN():this.RU(a)}; g.k.RU=function(a){try{if(a==this.j)a:{var b=g.hj(this.j),c=this.j.B,d=this.j.getStatus();if(!(b<3)&&(b!=3||this.j&&(this.B.B||g.jj(this.j)||g.kj(this.j)))){this.Ka||b!=4||c==7||(c==8||d<=0?x7(3):x7(2));Mrb(this);var e=this.j.getStatus();this.Jb=e;var f=Hrb(this);if(this.K=e==200){if(this.zb&&!this.Va){b:{if(this.j){var h=g.lj(this.j,"X-HTTP-Initial-Response");if(h&&!g.Qb(h)){var l=h;break b}}l=null}if(a=l)this.Va=!0,Vrb(this,a);else{this.K=!1;this.G=3;y7(12);D7(this);E7(this);break a}}if(this.Fa){a= !0;for(var m;!this.Ka&&this.N0&&!this.Kb&&(this.Kb=!0,this.C.JR(this)):(D7(this),E7(this))}else Vrb(this,f);b==4&&D7(this);this.K&&!this.Ka&&(b==4?Nrb(this.C,this):(this.K=!1,C7(this)))}else g.Sfa(this.j),e==400&&f.indexOf("Unknown SID")> 0?(this.G=3,y7(12)):(this.G=0,y7(13)),D7(this),E7(this)}}}catch(n){}finally{}}; g.k.cancel=function(){this.Ka=!0;D7(this)}; g.k.K4=function(){this.qa=null;var a=Date.now();a-this.rb>=0?(this.Ra!=2&&(x7(3),y7(17)),D7(this),this.G=2,E7(this)):Lrb(this,this.rb-a)}; g.k.getLastError=function(){return this.G}; g.k.aQ=function(){return this.j};Xrb.prototype.cancel=function(){this.C=Zrb(this);if(this.B)this.B.cancel(),this.B=null;else if(this.j&&this.j.size!==0){for(var a=g.v(this.j.values()),b=a.next();!b.done;b=a.next())b.value.cancel();this.j.clear()}};g.k=dsb.prototype;g.k.SU=8;g.k.Qh=1;g.k.connect=function(a,b,c,d){y7(0);this.Tb=a;this.Ka=b||{};c&&d!==void 0&&(this.Ka.OSID=c,this.Ka.OAID=d);this.Va=this.qc;this.Na=Srb(this,null,this.Tb);I7(this)}; g.k.disconnect=function(){fsb(this);if(this.Qh==3){var a=this.bb++,b=this.Na.clone();g.qk(b,"SID",this.D);g.qk(b,"RID",a);g.qk(b,"TYPE","terminate");L7(this,b);a=new B7(this,this.D,a);a.Ra=2;a.Z=c7(b.clone());b=!1;if(g.La.navigator&&g.La.navigator.sendBeacon)try{b=g.La.navigator.sendBeacon(a.Z.toString(),"")}catch(c){}!b&&g.La.Image&&((new Image).src=a.Z,b=!0);b||(a.j=Frb(a.C,null),a.j.send(a.Z));a.Ca=Date.now();C7(a)}lsb(this)}; g.k.Og=function(){return this.Qh==0}; g.k.getState=function(){return this.Qh}; g.k.UU=function(a){if(this.K)if(this.K=null,this.Qh==1){if(!a){this.bb=Math.floor(Math.random()*1E5);a=this.bb++;var b=new B7(this,"",a),c=this.Y;this.Jb&&(c?(c=g.Jc(c),g.Lc(c,this.Jb)):c=this.Jb);this.N!==null||this.rb||(b.Na=c,c=null);var d;if(this.Bb)a:{for(var e=d=0;e4096){d=e;break a}if(d===4096||e===this.C.length-1){d=e+1;break a}}d= 1E3}else d=1E3;d=isb(this,b,d);e=this.Na.clone();g.qk(e,"RID",a);g.qk(e,"CVER",22);this.Fa&&g.qk(e,"X-HTTP-Session-Id",this.Fa);L7(this,e);c&&(this.rb?d="headers="+g.Vd(g.Gga(c))+"&"+d:this.N&&g.uk(e,this.N,c));Rrb(this.B,b);this.Tf&&g.qk(e,"TYPE","init");this.Bb?(g.qk(e,"$req",d),g.qk(e,"SID","null"),b.zb=!0,Erb(b,e,null)):Erb(b,e,d);this.Qh=2}}else this.Qh==3&&(a?jsb(this,a):this.C.length==0||Yrb(this.B)||jsb(this))}; g.k.TU=function(){this.Z=null;ksb(this);if(this.Bc&&!(this.fb||this.j==null||this.Xc<=0)){var a=2*this.Xc;this.Ga=z7((0,g.Xa)(this.aaa,this),a)}}; g.k.aaa=function(){this.Ga&&(this.Ga=null,this.Va=!1,this.fb=!0,y7(10),G7(this),ksb(this))}; g.k.JR=function(a){this.j==a&&this.Bc&&!this.fb&&(esb(this),this.fb=!0,y7(11))}; g.k.M4=function(){this.qa!=null&&(this.qa=null,G7(this),Prb(this),y7(19))}; g.k.oea=function(a){a?y7(2):y7(1)}; g.k.isActive=function(){return!!this.G&&this.G.isActive(this)}; g.k=nsb.prototype;g.k.YU=function(){}; g.k.XU=function(){}; g.k.WU=function(){}; g.k.VU=function(){}; g.k.isActive=function(){return!0}; g.k.N4=function(){};g.ab(N7,g.Zc);N7.prototype.open=function(){this.j.G=this.C;this.K&&(this.j.Ra=!0);this.j.connect(this.G,this.B||void 0)}; N7.prototype.close=function(){this.j.disconnect()}; N7.prototype.send=function(a){var b=this.j;if(typeof a==="string"){var c={};c.__data__=a;a=c}else this.D&&(c={},c.__data__=g.Li(a),a=c);b.C.push(new Wrb(b.Rf++,a));b.Qh==3&&I7(b)}; N7.prototype.xa=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;N7.Of.xa.call(this)}; g.ab(psb,vrb);g.ab(qsb,wrb);g.ab(M7,nsb);M7.prototype.YU=function(){this.j.dispatchEvent("m")}; M7.prototype.XU=function(a){this.j.dispatchEvent(new psb(a))}; M7.prototype.WU=function(a){this.j.dispatchEvent(new qsb(a))}; M7.prototype.VU=function(){this.j.dispatchEvent("n")};var P7=new g.Zc;g.z(tsb,g.lb);g.k=R7.prototype;g.k.Uv=null;g.k.kt=!1;g.k.fz=null;g.k.fN=null;g.k.oD=null;g.k.mI=null;g.k.lD=null;g.k.lI=null;g.k.Wv=null;g.k.nj=null;g.k.oI=0;g.k.Q2=null;g.k.nI=null;g.k.Vv=null;g.k.nD=-1;g.k.L1=!0;g.k.mD=!1;g.k.eN=0;g.k.kI=null;var zsb={},ysb={};g.k=R7.prototype;g.k.setTimeout=function(a){this.B=a}; g.k.P4=function(a){a=a.target;var b=this.kI;b&&g.hj(a)==3?b.dN():this.ZU(a)}; g.k.ZU=function(a){try{if(a==this.nj)a:{var b=g.hj(this.nj),c=this.nj.B,d=this.nj.getStatus();if(g.rc&&!g.qc("420+")){if(b<4)break a}else if(b<3||b==3&&!g.jj(this.nj))break a;this.mD||b!=4||c==7||(c==8||d<=0?this.j.ys(3):this.j.ys(2));Csb(this);var e=this.nj.getStatus();this.nD=e;var f=g.jj(this.nj);if(this.kt=e==200){b==4&&S7(this);if(this.Fa){for(a=!0;!this.mD&&this.oI0?(this.Vv=3,Q7(13)):(this.Vv=0,Q7(14)),S7(this),Dsb(this)}}catch(l){}finally{}}; g.k.cancel=function(){this.mD=!0;S7(this)}; g.k.O4=function(){this.fz=null;var a=Date.now();a-this.fN>=0?(this.mI!=2&&this.j.ys(3),S7(this),this.Vv=2,Q7(18),Dsb(this)):Bsb(this,this.fN-a)}; g.k.getLastError=function(){return this.Vv};g.k=Hsb.prototype;g.k.hN=null;g.k.Xk=null;g.k.TL=!1;g.k.jN=null;g.k.Zl=null;g.k.er=-1;g.k.pI=null;g.k.hE=null;g.k.connect=function(a){this.jN=a;a=U7(this.j,null,this.jN);Q7(3);Date.now();var b=this.j.Y;b!=null?(this.pI=b[0],(this.hE=b[1])?(this.Zl=1,Isb(this)):(this.Zl=2,Jsb(this))):(d7(a,"MODE","init"),this.Xk=new R7(this),this.Xk.Uv=this.hN,wsb(this.Xk,a,!1,null,!0),this.Zl=0)}; g.k.g7=function(a){if(a)this.Zl=2,Jsb(this);else{Q7(4);var b=this.j;b.qp=b.Jt.er;Y7(b,9)}a&&this.ys(2)}; g.k.gN=function(a){return this.j.gN(a)}; g.k.abort=function(){this.Xk&&(this.Xk.cancel(),this.Xk=null);this.er=-1}; g.k.Og=function(){return!1}; g.k.aV=function(a,b){this.er=a.nD;if(this.Zl==0)if(b){try{var c=this.B.parse(b)}catch(d){a=this.j;a.qp=this.er;Y7(a,2);return}this.pI=c[0];this.hE=c[1]}else a=this.j,a.qp=this.er,Y7(a,2);else this.Zl==2&&(this.TL?(Q7(7),Date.now()):b=="11111"?(Q7(6),this.TL=!0,Date.now(),this.er=200,this.Xk.cancel(),Q7(12),V7(this.j,this,!0)):(Q7(8),Date.now(),this.TL=!1))}; g.k.iN=function(){this.er=this.Xk.nD;if(this.Xk.kt)this.Zl==0?this.hE?(this.Zl=1,Isb(this)):(this.Zl=2,Jsb(this)):this.Zl==2&&(this.TL?(Q7(12),V7(this.j,this,!0)):(Q7(11),V7(this.j,this,!1)));else{this.Zl==0?Q7(9):this.Zl==2&&Q7(10);var a=this.j;this.Xk.getLastError();a.qp=this.er;Y7(a,2)}}; g.k.pD=function(){return this.j.pD()}; g.k.isActive=function(){return this.j.isActive()}; g.k.ys=function(a){this.j.ys(a)};g.k=Ksb.prototype;g.k.pp=null;g.k.qD=null;g.k.nk=null;g.k.Wg=null;g.k.lN=null;g.k.qI=null;g.k.bV=null;g.k.kN=null;g.k.rD=0;g.k.R4=0;g.k.Qi=null;g.k.nt=null;g.k.gr=null;g.k.Yv=null;g.k.Jt=null;g.k.QM=null;g.k.jz=-1;g.k.cV=-1;g.k.qp=-1;g.k.iz=0;g.k.gz=0;g.k.Xv=8;g.ab(Msb,g.lb);g.ab(Nsb,g.lb);g.k=Ksb.prototype;g.k.connect=function(a,b,c,d,e){Q7(0);this.lN=b;this.qD=c||{};d&&e!==void 0&&(this.qD.OSID=d,this.qD.OAID=e);this.Z?(O7((0,g.Xa)(this.sX,this,a),100),Psb(this)):this.sX(a)}; g.k.disconnect=function(){Qsb(this);if(this.j==3){var a=this.rD++,b=this.qI.clone();g.qk(b,"SID",this.D);g.qk(b,"RID",a);g.qk(b,"TYPE","terminate");X7(this,b);a=new R7(this,this.D,a);a.mI=2;a.lD=c7(b.clone());(new Image).src=a.lD.toString();a.oD=Date.now();xsb(a)}$sb(this)}; g.k.sX=function(a){this.Jt=new Hsb(this);this.Jt.hN=this.pp;this.Jt.B=this.G;this.Jt.connect(a)}; g.k.Og=function(){return this.j==0}; g.k.getState=function(){return this.j}; g.k.eV=function(a){this.nt=null;Vsb(this,a)}; g.k.dV=function(){this.gr=null;this.Wg=new R7(this,this.D,"rpc",this.N);this.Wg.Uv=this.pp;this.Wg.eN=0;var a=this.bV.clone();g.qk(a,"RID","rpc");g.qk(a,"SID",this.D);g.qk(a,"CI",this.QM?"0":"1");g.qk(a,"AID",this.jz);X7(this,a);g.qk(a,"TYPE","xmlhttp");wsb(this.Wg,a,!0,this.kN,!1)}; g.k.aV=function(a,b){if(this.j!=0&&(this.Wg==a||this.nk==a))if(this.qp=a.nD,this.nk==a&&this.j==3)if(this.Xv>7){try{var c=this.G.parse(b)}catch(d){c=null}if(Array.isArray(c)&&c.length==3)if(a=c,a[0]==0)a:{if(!this.gr){if(this.Wg)if(this.Wg.oD+3E30)){if(d=b==1)this.nk||this.nt||this.j==1||this.iz>=2?d=!1:(this.nt=O7((0,g.Xa)(this.eV,this,a),Xsb(this,this.iz)),this.iz++,d=!0);d=!(d||b==2&&Ysb(this))}if(d)switch(c){case 1:Y7(this, 5);break;case 4:Y7(this,10);break;case 3:Y7(this,6);break;case 7:Y7(this,12);break;default:Y7(this,2)}}}; g.k.Q4=function(a){if(!g.rb(arguments,this.j))throw Error("Unexpected channel state: "+this.j);}; g.k.nea=function(a){a?Q7(2):(Q7(1),Zsb(this,8))}; g.k.gN=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.ej;a.K=!1;return a}; g.k.isActive=function(){return!!this.Qi&&this.Qi.isActive(this)}; g.k.ys=function(a){var b=P7;b.dispatchEvent(new Nsb(b,a))}; g.k.pD=function(){return!1}; g.k=atb.prototype;g.k.hV=function(){}; g.k.gV=function(){}; g.k.fV=function(){}; g.k.mN=function(){}; g.k.iV=function(){return{}}; g.k.isActive=function(){return!0};g.k=btb.prototype;g.k.enqueue=function(a){this.B.push(a)}; g.k.isEmpty=function(){return this.j.length===0&&this.B.length===0}; g.k.clear=function(){this.j=[];this.B=[]}; g.k.contains=function(a){return g.rb(this.j,a)||g.rb(this.B,a)}; g.k.remove=function(a){var b=this.j;var c=(0,g.l9a)(b,a);c>=0?(g.tb(b,c),b=!0):b=!1;return b||g.ub(this.B,a)}; g.k.Im=function(){for(var a=[],b=this.j.length-1;b>=0;--b)a.push(this.j[b]);var c=this.B.length;for(b=0;b=rvb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=rvb[this.B],this.qd=g.fs((0,g.Xa)(this.P0,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.k.X4=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))}; var rvb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.ab(j8,h8);g.k=j8.prototype;g.k.start=function(){i8(this)&&this.publish("screenChange");!g.At("yt-remote-lounge-token-expiration")&&ytb(this);g.hs(this.j);this.j=g.fs((0,g.Xa)(this.start,this),1E4)}; g.k.add=function(a,b){i8(this);utb(this,a);k8(this,!1);this.publish("screenChange");b(a);a.token||ytb(this)}; g.k.remove=function(a,b){var c=i8(this);wtb(this,a)&&(k8(this,!1),c=!0);b(a);c&&this.publish("screenChange")}; g.k.PM=function(a,b,c,d){var e=i8(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,k8(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.publish("screenChange")}; g.k.xa=function(){g.hs(this.j);j8.Of.xa.call(this)}; g.k.f9=function(a){i8(this);var b=this.screens.length;a=a&&a.screens||[];for(var c=0,d=a.length;c20)break a;l=b(f,h)}f=l}e.name=f}c(n8(this,e))},this), onError:(0,g.Xa)(function(e){d(Error("pairing request failed: "+e.status))},this), onTimeout:(0,g.Xa)(function(){d(Error("pairing request timed out."))},this)})}; g.k.xa=function(){g.fb(this.B);g.fb(this.j);m8.Of.xa.call(this)}; g.k.p9=function(){Ktb(this);this.publish("screenChange");this.j.update()}; m8.prototype.dispose=m8.prototype.dispose;g.ab(o8,g.iy);g.k=o8.prototype;g.k.Ej=function(a){this.Ma()||(a&&(q8(this,""+a),this.publish("sessionFailed")),this.j=null,this.publish("sessionScreen",null))}; g.k.info=function(a){c8(this.Fa,a)}; g.k.lV=function(){return null}; g.k.pT=function(a){var b=this.B;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.Xa)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.Xa)(function(){q8(this,"Failed to update receiver status for: "+b.friendlyName)},this))}; g.k.xa=function(){this.pT("");o8.Of.xa.call(this)};g.z(r8,o8);g.k=r8.prototype;g.k.mT=function(a){if(this.C){if(this.C==a)return;q8(this,"Overriding cast session with new session object");Wtb(this);this.Ca=!1;this.Y="unknown";this.C.removeUpdateListener(this.ra);this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ga)}this.C=a;this.C.addUpdateListener(this.ra);this.C.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ga);Rtb(this,"getMdxSessionStatus")}; g.k.ZA=function(a){this.info("launchWithParams no-op for Cast: "+g.Li(a))}; g.k.stop=function(){this.C?this.C.stop((0,g.Xa)(function(){this.Ej()},this),(0,g.Xa)(function(){this.Ej(Error("Failed to stop receiver app."))},this)):this.Ej(Error("Stopping cast device without session."))}; g.k.pT=function(){}; g.k.xa=function(){this.info("disposeInternal");Wtb(this);this.C&&(this.C.removeUpdateListener(this.ra),this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ga));this.C=null;o8.prototype.xa.call(this)}; g.k.tca=function(a,b){if(!this.Ma())if(b)if(b=e7(b),g.Ta(b))switch(a=""+b.type,b=b.data||{},this.info("onYoutubeMessage_: "+a+" "+g.Li(b)),a){case "mdxSessionStatus":Otb(this,b);break;case "loungeToken":Stb(this,b);break;default:q8(this,"Unknown youtube message: "+a)}else q8(this,"Unable to parse message.");else q8(this,"No data in message.")}; g.k.AY=function(a,b,c,d){g.hs(this.Z);this.Z=0;Htb(this.D,this.B.label,a,this.B.friendlyName,(0,g.Xa)(function(e){e?b(e):d>=0?(q8(this,"Screen "+a+" appears to be offline. "+d+" retries left."),this.Z=g.fs((0,g.Xa)(this.AY,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)}; g.k.lV=function(){return this.C}; g.k.Z4=function(a){this.Ma()||a||(q8(this,"Cast session died."),this.Ej())};g.z(s8,o8);g.k=s8.prototype;g.k.mT=function(a){this.C=a;this.C.addUpdateListener(this.Ka)}; g.k.ZA=function(a){this.Na=a;this.qa()}; g.k.stop=function(){dub(this);this.C?this.C.stop((0,g.Xa)(this.Ej,this,null),(0,g.Xa)(this.Ej,this,"Failed to stop DIAL device.")):this.Ej()}; g.k.xa=function(){dub(this);this.C&&this.C.removeUpdateListener(this.Ka);this.C=null;o8.prototype.xa.call(this)}; g.k.a5=function(a){this.Ma()||a||(q8(this,"DIAL session died."),this.G(),this.G=function(){},this.Ej())};g.z(v8,o8);v8.prototype.stop=function(){this.Ej()}; v8.prototype.mT=function(){}; v8.prototype.ZA=function(){g.hs(this.C);this.C=NaN;var a=m7(this.D.wl(),this.B.label);a?p8(this,a):this.Ej(Error("No such screen"))}; v8.prototype.xa=function(){g.hs(this.C);this.C=NaN;o8.prototype.xa.call(this)};g.z(w8,g.iy);g.k=w8.prototype; g.k.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);g.ks("desktop_enable_cast_connect")&&(c.androidReceiverCompatible=!0);this.Y||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.K?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var e=(0,g.Xa)(this.wba,this);c=new chrome.cast.ApiConfig(c,(0,g.Xa)(this.q0, this),e,d,a);c.customDialLaunchCallback=(0,g.Xa)(this.qaa,this);chrome.cast.initialize(c,(0,g.Xa)(function(){this.Ma()||(chrome.cast.addReceiverActionListener(this.G),qtb(),this.B.subscribe("onlineScreenChange",(0,g.Xa)(this.mV,this)),this.C=gub(this),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.Xa)(function(f){this.gg("Failed to set initial custom receivers: "+g.Li(f))},this)),this.publish("yt-remote-cast2-availability-change",y8(this)),b(!0))},this),(0,g.Xa)(function(f){this.gg("Failed to initialize API: "+ g.Li(f)); b(!1)},this))}; g.k.Gda=function(a,b){x8("Setting connected screen ID: "+a+" -> "+b);if(this.j){var c=this.j.j;if(!a||c&&c.id!=a)x8("Unsetting old screen status: "+this.j.B.friendlyName),z8(this,null)}if(a&&b){if(!this.j){a=m7(this.B.wl(),a);if(!a){x8("setConnectedScreenStatus: Unknown screen.");return}if(a.idType=="shortLived"){x8("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=eub(this,a);c||(x8("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(a.uuid? a.uuid:a.id,a.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.C.push(c),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.Xa)(function(d){this.gg("Failed to set initial custom receivers: "+g.Li(d))},this))); x8("setConnectedScreenStatus: new active receiver: "+c.friendlyName);z8(this,new v8(this.B,c),!0)}this.j.pT(b)}else x8("setConnectedScreenStatus: no screen.")}; g.k.Jda=function(a){this.Ma()?this.gg("Setting connection data on disposed cast v2"):this.j?this.j.ZA(a):this.gg("Setting connection data without a session")}; g.k.c5=function(){this.Ma()?this.gg("Stopping session on disposed cast v2"):this.j?(this.j.stop(),z8(this,null)):x8("Stopping non-existing session")}; g.k.requestSession=function(){chrome.cast.requestSession((0,g.Xa)(this.q0,this),(0,g.Xa)(this.Rba,this))}; g.k.xa=function(){this.B.unsubscribe("onlineScreenChange",(0,g.Xa)(this.mV,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=ntb,b=g.Pa("yt.mdx.remote.debug.handlers_");g.ub(b||[],a);g.fb(this.j);g.iy.prototype.xa.call(this)}; g.k.gg=function(a){c8("Controller",a)}; g.k.s0=function(a,b){this.j==a&&(b||z8(this,null),this.publish("yt-remote-cast2-session-change",b))}; g.k.tba=function(a,b){if(!this.Ma())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),x8("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.B.label!=a.label)x8("onReceiverAction_: Stopping active receiver: "+this.j.B.friendlyName),this.j.stop();else{x8("onReceiverAction_: Casting to active receiver.");this.j.j&&this.publish("yt-remote-cast2-session-change",this.j.j);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:z8(this, new v8(this.B,a));break;case chrome.cast.ReceiverType.DIAL:z8(this,new s8(this.B,a,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:z8(this,new r8(this.B,a,this.config_));break;default:this.gg("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.B.label==a.label?this.j.stop():this.gg("Stopping receiver w/o session: "+a.friendlyName)}else this.gg("onReceiverAction_ called without receiver.")}; g.k.qaa=function(a){if(this.Ma())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.gg("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.B:null;if(!c||c.label!=b.label)return this.gg("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.j)return x8("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.j.j),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.gg('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);z8(this,new s8(this.B,b,this.D,this.config_))}b=this.j;b.Z=a;b.Z.appState==chrome.cast.DialAppState.RUNNING?(a=b.Z.extraData||{},c=a.screenId||null,t8(b)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=aub(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.Or(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=bub(b,c)):a=bub(b,c)):a=Ztb(b);return a}; g.k.q0=function(a){var b=this;if(!this.Ma()&&!this.K){x8("New cast session ID: "+a.sessionId);var c=a.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(c.receiverType==chrome.cast.ReceiverType.CAST)x8("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),z8(this,new r8(this.B,c,this.config_),!0);else{this.gg("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.B,e=m7(this.B.wl(), d.label);e&&k7(e,c.label)&&d.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(x8("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.fb(this.j),this.j=new r8(this.B,c,this.config_),this.j.subscribe("sessionScreen",(0,g.Xa)(this.s0,this,this.j)),this.j.subscribe("sessionFailed",function(){return fub(b,b.j)}),this.j.ZA(null)); this.j.mT(a)}}}; g.k.b5=function(){return this.j?this.j.lV():null}; g.k.Rba=function(a){this.Ma()||(this.gg("Failed to estabilish a session: "+g.Li(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&z8(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.k.wba=function(a){x8("Receiver availability updated: "+a);if(!this.Ma()){var b=y8(this);this.N=a==chrome.cast.ReceiverAvailability.AVAILABLE;y8(this)!=b&&this.publish("yt-remote-cast2-availability-change",y8(this))}}; g.k.mV=function(){this.Ma()||(this.C=gub(this),x8("Updating custom receivers: "+g.Li(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.Xa)(function(){this.gg("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",y8(this)))}; w8.prototype.setLaunchParams=w8.prototype.Jda;w8.prototype.setConnectedScreenStatus=w8.prototype.Gda;w8.prototype.stopSession=w8.prototype.c5;w8.prototype.getCastSession=w8.prototype.b5;w8.prototype.requestSession=w8.prototype.requestSession;w8.prototype.init=w8.prototype.init;w8.prototype.dispose=w8.prototype.dispose;var pub=[];g.k=G8.prototype; g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";vub(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.trackData=a.trackData,this.Vp=a.hasPrevious,this.zl=a.hasNext,this.N=a.playerTime,this.K=a.playerTimeAt,this.D=a.seekableStart,this.j=a.seekableEnd,this.G=a.duration,this.Z=a.loadedTime,this.C=a.liveIngestionTime,this.B= !isNaN(this.C))}; g.k.isPlaying=function(){return this.playerState==1}; g.k.isBuffering=function(){return this.playerState==3}; g.k.Al=function(){return this.playerState==1081}; g.k.Wo=function(a){this.G=isNaN(a)?0:a}; g.k.getDuration=function(){return this.B?this.G+H8(this):this.G}; g.k.clone=function(){return new G8(wub(this))};g.z(M8,g.iy);g.k=M8.prototype;g.k.getState=function(){return this.C}; g.k.au=function(){return this.D.getReconnectTimeout()}; g.k.yy=function(){this.D.reconnect()}; g.k.play=function(){O8(this)?(this.j?this.j.play(null,g.cd,S8(this,"play")):R8(this,"play"),zub(this,1,J8(N8(this))),this.publish("remotePlayerChange")):P8(this,this.play)}; g.k.pause=function(){O8(this)?(this.j?this.j.pause(null,g.cd,S8(this,"pause")):R8(this,"pause"),zub(this,2,J8(N8(this))),this.publish("remotePlayerChange")):P8(this,this.pause)}; g.k.seekTo=function(a){if(O8(this)){if(this.j){var b=N8(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.isPlaying()||b.isBuffering()?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(c,g.cd,S8(this,"seekTo",{newTime:a}))}else R8(this,"seekTo",{newTime:a});zub(this,3,a);this.publish("remotePlayerChange")}else P8(this,g.Za(this.seekTo,a))}; g.k.stop=function(){if(O8(this)){this.j?this.j.stop(null,g.cd,S8(this,"stopVideo")):R8(this,"stopVideo");var a=N8(this);a.index=-1;a.videoId="";vub(a);Q8(this,a);this.publish("remotePlayerChange")}else P8(this,this.stop)}; g.k.setVolume=function(a,b){if(O8(this)){var c=N8(this);if(this.B){if(c.volume!=a){var d=Math.round(a)/100;this.B.setReceiverVolumeLevel(d,(0,g.Xa)(function(){d8("set receiver volume: "+d)},this),(0,g.Xa)(function(){this.gg("failed to set receiver volume.")},this))}c.muted!=b&&this.B.setReceiverMuted(b,(0,g.Xa)(function(){d8("set receiver muted: "+b)},this),(0,g.Xa)(function(){this.gg("failed to set receiver muted.")},this))}else{var e={volume:a, muted:b};c.volume!=-1&&(e.delta=a-c.volume);R8(this,"setVolume",e)}c.muted=b;c.volume=a;Q8(this,c)}else P8(this,g.Za(this.setVolume,a,b))}; g.k.nV=function(a,b){if(O8(this)){var c=N8(this);a={videoId:a};b&&(c.trackData={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},a.style=g.Li(b.style),g.Lc(a,c.trackData));R8(this,"setSubtitlesTrack",a);Q8(this,c)}else P8(this,g.Za(this.nV,a,b))}; g.k.setAudioTrack=function(a,b){O8(this)?(b=b.getLanguageInfo().getId(),R8(this,"setAudioTrack",{videoId:a,audioTrackId:b}),a=N8(this),a.audioTrackId=b,Q8(this,a)):P8(this,g.Za(this.setAudioTrack,a,b))}; g.k.playVideo=function(a,b,c,d,e,f,h){d=d===void 0?null:d;e=e===void 0?null:e;f=f===void 0?null:f;h=h===void 0?null:h;var l=N8(this),m={videoId:a};c!==void 0&&(m.currentIndex=c);K8(l,a,c||0);b!==void 0&&(I8(l,b),m.currentTime=b);d&&(m.listId=d);e&&(m.playerParams=e);f&&(m.clickTrackingParams=f);h&&(m.locationInfo=g.Li(h));R8(this,"setPlaylist",m);d||Q8(this,l)}; g.k.NL=function(a,b){if(O8(this)){if(a&&b){var c=N8(this);K8(c,a,b);Q8(this,c)}R8(this,"previous")}else P8(this,g.Za(this.NL,a,b))}; g.k.nextVideo=function(a,b){if(O8(this)){if(a&&b){var c=N8(this);K8(c,a,b);Q8(this,c)}R8(this,"next")}else P8(this,g.Za(this.nextVideo,a,b))}; g.k.EO=function(){if(O8(this)){R8(this,"clearPlaylist");var a=N8(this);a.reset();Q8(this,a);this.publish("remotePlayerChange")}else P8(this,this.EO)}; g.k.GX=function(){O8(this)?R8(this,"dismissAutoplay"):P8(this,this.GX)}; g.k.dispose=function(){if(this.C!=3){var a=this.C;this.C=3;this.publish("proxyStateChange",a,this.C)}g.iy.prototype.dispose.call(this)}; g.k.xa=function(){yub(this);this.D=null;this.G.clear();L8(this,null);g.iy.prototype.xa.call(this)}; g.k.tT=function(a){if((a!=this.C||a==2)&&this.C!=3&&a!=0){var b=this.C;this.C=a;this.publish("proxyStateChange",b,a);if(a==1)for(;!this.G.isEmpty();)b=a=this.G,b.j.length===0&&(b.j=b.B,b.j.reverse(),b.B=[]),a.j.pop().apply(this);else a==3&&this.dispose()}}; g.k.qba=function(a,b){this.publish(a,b)}; g.k.eaa=function(a){if(!a)this.mG(null),L8(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var b=N8(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)d8("Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,Q8(this,b)}}; g.k.mG=function(a){d8("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.Z);if(this.j=a)this.j.addUpdateListener(this.Z),Aub(this),this.publish("remotePlayerChange")}; g.k.daa=function(a){a?(Aub(this),this.publish("remotePlayerChange")):this.mG(null)}; g.k.ZT=function(){R8(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.k.haa=function(){var a=sub();a&&L8(this,a)}; g.k.gg=function(a){c8("CP",a)};g.z(V8,g.iy);g.k=V8.prototype; g.k.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.videoIds,f=b.playerParams,h=b.clickTrackingParams,l=b.index,m={videoId:d},n=b.currentTime,p=b.locationInfo;b=b.loopMode;n!==void 0&&(m.currentTime=n<=5?0:n);f&&(m.playerParams=f);p&&(m.locationInfo=p);h&&(m.clickTrackingParams=h);c&&(m.listId=c);e&&e.length>0&&(m.videoIds=e.join(","));l!==void 0&&(m.currentIndex=l);this.Ka&&(m.loopMode=b||"LOOP_MODE_OFF");c&&(this.j.listId=c);this.j.videoId=d;this.j.index=l||0;this.j.state=3;I8(this.j, n);this.G="UNSUPPORTED";c=this.Ka?"setInitialState":"setPlaylist";T8("Connecting with "+c+" and params: "+g.Li(m));this.B.connect({method:c,params:g.Li(m)},a,brb())}else T8("Connecting without params"),this.B.connect({},a,brb());Eub(this)}; g.k.Ms=function(a){this.B.Ms(a)}; g.k.dispose=function(){this.Ma()||(g.Ma("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),U8(this,3));g.iy.prototype.dispose.call(this)}; g.k.xa=function(){Fub(this);Hub(this);Gub(this);g.hs(this.Z);this.Z=NaN;g.hs(this.Y);this.Y=NaN;this.D=null;g.nt(this.qa);this.qa.length=0;this.B.dispose();g.iy.prototype.xa.call(this);this.G=this.N=this.C=this.j=this.B=null}; g.k.yZ=function(a){if(!this.C||this.C.length===0)return!1;for(var b=g.v(this.C),c=b.next();!c.done;c=b.next())if(!c.value.capabilities.has(a))return!1;return!0}; g.k.L8=function(){var a=3;this.Ma()||(a=0,isNaN(this.jF())?this.B.KA()&&isNaN(this.K)&&(a=1):a=2);return a}; g.k.Yz=function(a){T8("Disconnecting with "+a);g.Ma("yt.mdx.remote.remoteClient_",null);Fub(this);this.publish("beforeDisconnect",a);a==1&&p7();this.B.disconnect(a);this.dispose()}; g.k.F8=function(){var a=this.j;this.D&&(a=this.j.clone(),K8(a,this.D,a.index));return wub(a)}; g.k.Mda=function(a){var b=this,c=new G8(a);c.videoId&&c.videoId!=this.j.videoId&&(this.D=c.videoId,g.hs(this.Z),this.Z=g.fs(function(){if(b.D){var e=b.D;b.D=null;b.j.videoId!=e&&W8(b,"getNowPlaying")}},5E3)); var d=[];this.j.listId==c.listId&&this.j.videoId==c.videoId&&this.j.index==c.index||d.push("remoteQueueChange");this.j.playerState==c.playerState&&this.j.volume==c.volume&&this.j.muted==c.muted&&J8(this.j)==J8(c)&&g.Li(this.j.trackData)==g.Li(c.trackData)||d.push("remotePlayerChange");this.j.reset(a);g.Mb(d,function(e){this.publish(e)},this)}; g.k.vY=function(){var a=this.B.getDeviceId(),b=g.pb(this.C,function(c){return c.type=="REMOTE_CONTROL"&&c.id!=a}); return b?b.id:""}; g.k.jF=function(){return this.B.au()}; g.k.p8=function(){return this.G||"UNSUPPORTED"}; g.k.q8=function(){return this.N||""}; g.k.d5=function(){!isNaN(this.jF())&&this.B.yy()}; g.k.Dda=function(a,b){W8(this,a,b);Jub(this)}; g.k.oV=function(){var a=g.Bs("SAPISID","")||g.Bs("__Secure-1PAPISID")||"",b=g.Bs("__Secure-3PAPISID","")||"";if(!a&&!b)return"";a=g.Xe(g.We(a),2);b=g.Xe(g.We(b),2);return g.Xe(g.We(","+a+","+b),2)}; V8.prototype.subscribe=V8.prototype.subscribe;V8.prototype.unsubscribeByKey=V8.prototype.Ph;V8.prototype.getProxyState=V8.prototype.L8;V8.prototype.disconnect=V8.prototype.Yz;V8.prototype.getPlayerContextData=V8.prototype.F8;V8.prototype.setPlayerContextData=V8.prototype.Mda;V8.prototype.getOtherConnectedRemoteId=V8.prototype.vY;V8.prototype.getReconnectTimeout=V8.prototype.jF;V8.prototype.getAutoplayMode=V8.prototype.p8;V8.prototype.getAutoplayVideoId=V8.prototype.q8;V8.prototype.reconnect=V8.prototype.d5; V8.prototype.sendMessage=V8.prototype.Dda;V8.prototype.getXsrfToken=V8.prototype.oV;V8.prototype.isCapabilitySupportedOnConnectedDevices=V8.prototype.yZ;g.z(Vub,h8);g.k=Vub.prototype;g.k.wl=function(a){return this.ih.$_gs(a)}; g.k.contains=function(a){return!!this.ih.$_c(a)}; g.k.get=function(a){return this.ih.$_g(a)}; g.k.start=function(){this.ih.$_st()}; g.k.add=function(a,b,c){this.ih.$_a(a,b,c)}; g.k.remove=function(a,b,c){this.ih.$_r(a,b,c)}; g.k.PM=function(a,b,c,d){this.ih.$_un(a,b,c,d)}; g.k.xa=function(){for(var a=0,b=this.j.length;a1&&!this.J.getOption("remote","quickCast")?(this.fv=g.Nb(a,this.j,this),g.ET(this,g.Bl(a,this.j)),a=this.J.getOption("remote","currentReceiver"),a=this.j(a),this.options[a]&&this.Ri(a),this.enable(!0)):this.enable(!1)}; o9.prototype.j=function(a){return a.key}; o9.prototype.Zk=function(a){return a==="cast-selector-receiver"?"Cast...":this.fv[a].name}; o9.prototype.Ig=function(a){g.DT.prototype.Ig.call(this,a);this.J.setOption("remote","currentReceiver",this.fv[a]);this.Fb.Mb()};g.z(ovb,g.jU);g.k=ovb.prototype; g.k.create=function(){var a=this.player.U(),b=g.KP(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.L("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.L("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.L("enable_cast_short_lived_lounge_token")};$ub(b,a);this.subscriptions.push(g.cw("yt-remote-before-disconnect",this.Z$,this));this.subscriptions.push(g.cw("yt-remote-connection-change",this.xba,this));this.subscriptions.push(g.cw("yt-remote-receiver-availability-change",this.m0, this));this.subscriptions.push(g.cw("yt-remote-auto-connect",this.vba,this));this.subscriptions.push(g.cw("yt-remote-receiver-resumed",this.uba,this));this.subscriptions.push(g.cw("mdx-privacy-popup-confirm",this.Qca,this));this.subscriptions.push(g.cw("mdx-privacy-popup-cancel",this.Pca,this));this.m0()}; g.k.load=function(){this.player.cancelPlayback();g.jU.prototype.load.call(this);this.qm=new kvb(this,this.player,this.Ic);var a=(a=hvb())?a.currentTime:0;var b=evb()?new M8(f9(),void 0):null;a==0&&b&&(a=J8(N8(b)));a!==0&&this.Sc(a);pvb(this,this.Ge,this.Ge);this.player.Jq(6)}; g.k.unload=function(){this.player.publish("mdxautoplaycanceled");this.Mt=this.kq;g.gb(this.qm,this.Ic);this.Ic=this.qm=null;g.jU.prototype.unload.call(this);this.player.Jq(5);p9(this)}; g.k.xa=function(){g.dw(this.subscriptions);g.jU.prototype.xa.call(this)}; g.k.rG=function(a){var b=g.Fa.apply(1,arguments);this.loaded&&this.qm.yl.apply(this.qm,[a].concat(g.w(b)))}; g.k.getAdState=function(){return this.gi}; g.k.Vp=function(){return this.Ic?N8(this.Ic).Vp:!1}; g.k.zl=function(){return this.Ic?N8(this.Ic).zl:!1}; g.k.Sc=function(a,b){this.MZ=a||0;this.player.publish("progresssync",a,b);this.player.Ac("onVideoProgress",a||0)}; g.k.getCurrentTime=function(){return this.MZ}; g.k.getProgressState=function(){var a=N8(this.Ic),b=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!a.Al()&&this.player.ai(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.C+H8(a):a.C,isAtLiveHead:(a.B?a.j+H8(a):a.j)-this.getCurrentTime()<=1,loaded:a.Z,seekableEnd:a.B?a.j+H8(a):a.j,seekableStart:a.D>0?a.D+H8(a):a.D,offset:0,viewerLivestreamJoinMediaTime:0}}; g.k.nextVideo=function(){this.Ic&&this.Ic.nextVideo()}; g.k.NL=function(){this.Ic&&this.Ic.NL()}; g.k.Z$=function(a){a===1&&(this.AS=this.Ic?N8(this.Ic):null)}; g.k.xba=function(){var a=evb()?new M8(f9(),void 0):null;if(a){var b=this.Mt;this.loaded&&this.unload();this.Ic=a;this.AS=null;b.key!==this.kq.key&&(this.Mt=b,this.load())}else g.fb(this.Ic),this.Ic=null,this.loaded&&(this.unload(),(a=this.AS)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,J8(a)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.k.m0=function(){var a=[this.kq],b=a.concat,c=avb();D8()&&g.At("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.fv=b.call(a,c);a=cvb()||this.kq;q9(this,a);this.player.Ac("onMdxReceiversChange")}; g.k.vba=function(){var a=cvb();q9(this,a)}; g.k.uba=function(){this.Mt=cvb()}; g.k.Qca=function(){this.PG=!0;p9(this);j9=!1;g9&&i9(g9,1);g9=null}; g.k.Pca=function(){this.PG=!1;p9(this);q9(this,this.kq);this.Mt=this.kq;j9=!1;g9=null;this.player.playVideo()}; g.k.Sh=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.fv;case "currentReceiver":return b&&(b.key==="cast-selector-receiver"?tub():q9(this,b)),this.loaded?this.Mt:this.kq;case "quickCast":return this.fv.length===2&&this.fv[1].key==="cast-selector-receiver"?(b&&tub(),!0):!1}}; g.k.ZT=function(){this.Ic.ZT()}; g.k.jn=function(){return!1}; g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.k.isLoggedIn=function(){var a,b;return((a=g.Lr("PLAYER_CONFIG"))==null?void 0:(b=a.args)==null?void 0:b.authuser)!==void 0?!0:!(!g.Lr("SESSION_INDEX")&&!g.Lr("LOGGED_IN"))};g.iU("remote",ovb);})(_yt_player);