(function(g){var window=this;var Osa=function(a,b){return g.Rb(a,b)},Y5=function(a,b,c){a.w.set(b,c)},Z5=function(a){Y5(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.H)()).toString(36));
return a},$5=function(a,b,c){g.Fa(c)||(c=[String(c)]);
g.Ym(a.w,b,c)},Psa=function(a,b){var c=[];
g.ek(b,function(d){try{var e=g.$n.prototype.u.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.Zn(e)&&c.push(d)},a);
return c},Qsa=function(a,b){var c=Psa(a,b);
(0,g.y)(c,function(d){g.$n.prototype.remove.call(this,d)},a)},Rsa=function(a,b){g.Va(a,b)||a.push(b)},a6=function(a){var b=0,c;
for(c in a)b++;return b},Ssa=function(a,b){var c=b instanceof g.wc?b:g.Ac(b,/^data:image\//i.test(b));
a.src=g.xc(c)},b6=function(){},Tsa=function(a){try{return g.v.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);},Usa=function(a){if(a.xd&&"function"==typeof a.xd)return a.xd();
if("string"===typeof a)return a.split("");if(g.Ga(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Nb(a)},Vsa=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.Ga(a)||"string"===typeof a)(0,g.y)(a,b,void 0);else{if(a.qe&&"function"==typeof a.qe)var c=a.qe();else if(a.xd&&"function"==typeof a.xd)c=void 0;else if(g.Ga(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Ob(a);d=Usa(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},Wsa=function(a,b,c,d){var e=new g.Mm(null,void 0);
a&&g.Nm(e,a);b&&g.Om(e,b);c&&g.Pm(e,c);d&&(e.u=d);return e},c6=function(a,b){g.Ho[a]=!0;
var c=g.Fo();c&&c.publish.apply(c,arguments);g.Ho[a]=!1},d6=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.w=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Jm;this.o=this.u="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Xsa(this,a.capabilities||""),Ysa(this,a.experiments||""),this.u=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey||
"")},Xsa=function(a,b){a.capabilities.clear();
(0,g.Wd)(b.split(","),g.La(Osa,Zsa)).forEach(function(c){a.capabilities.add(c)})},Ysa=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},e6=function(a){a=a||{};
this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},f6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},$sa=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},ata=function(a){return new e6(a)},bta=function(a){return g.Fa(a)?(0,g.Fc)(a,ata):[]},g6=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},h6=function(a){return g.Fa(a)?"["+(0,g.Fc)(a,g6).join(",")+"]":"null"},i6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0;
return("x"==a?b:b&3|8).toString(16)})},cta=function(a){return(0,g.Fc)(a,function(b){return{key:b.id,
name:b.name}})},j6=function(a,b){return g.Sa(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},k6=function(a,b){return g.Sa(a,function(c){return f6(c,b)})},l6=function(a){try{var b=(0,g.is)(),c=(0,g.hs)();
b&&b.remove(a);c&&c.remove(a)}catch(d){}},dta=function(){var a=(0,g.hs)();
a&&Qsa(a,a.o.Ff(!0))},m6=function(){var a=g.ks("yt-remote-connected-devices")||[];
g.nb(a);return a},eta=function(a){if(g.Wa(a))return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.Fc)(a,function(d,e){return 0==e?d:d.substring(c.length)})},fta=function(a){g.js("yt-remote-connected-devices",a,86400)},o6=function(){if(n6)return n6;
var a=g.ks("yt-remote-device-id");a||(a=i6(),g.js("yt-remote-device-id",a,31536E3));for(var b=m6(),c=1,d=a;g.Va(b,d);)c++,d=a+"#"+c;return n6=d},p6=function(){var a=m6(),b=o6();
g.Va(a,b);g.ls()&&g.pb(a,b);a=eta(a);if(g.Wa(a))try{g.Wq("remote_sid")}catch(c){}else try{g.Vq("remote_sid",a.join(","),-1)}catch(c){}},gta=function(){return g.ks("yt-remote-session-browser-channel")},hta=function(){return g.ks("yt-remote-local-screens")||[]},ita=function(){g.js("yt-remote-lounge-token-expiration",!0,86400)},jta=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.Fc)(hta(),function(d){return d.loungeToken}),c=(0,g.Fc)(a,function(d){return d.loungeToken});
(0,g.oi)(c,function(d){return!g.Va(b,d)})&&ita();
g.js("yt-remote-local-screens",a,31536E3)},kta=function(a,b){g.js("yt-remote-session-browser-channel",a);
g.js("yt-remote-session-screen-id",b);var c=m6(),d=o6();g.Va(c,d)||c.push(d);fta(c);p6()},q6=function(a){a||(l6("yt-remote-session-screen-id"),l6("yt-remote-session-video-id"));
p6();a=m6();g.Za(a,o6());fta(a)},lta=function(){if(!r6){var a=g.lo();
a&&(r6=new g.Un(a))}return r6?!!r6.get("yt-remote-use-staging-server"):!1},mta=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},nta=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},s6=function(a){a.length?ota(a.shift(),function(){s6(a)}):t6()},pta=function(a){return"chrome-extension://"+a+"/cast_sender.js"},ota=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);d.src=a;(document.head||document.documentElement).appendChild(d)},t6=function(){var a=nta();
a&&a(!1,"No cast extension found")},rta=function(){if(qta){var a=2,b=nta(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;ota("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",t6,c)}},sta=function(){rta();
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);s6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},u6=function(){},tta=function(){},vta=function(a){return(a=uta(a))?new ActiveXObject(a):new XMLHttpRequest},uta=function(a){if(!a.u&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0",
"MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.u=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.u},v6=function(a,b,c){g.A.call(this);
this.w=null!=c?(0,g.x)(a,c):a;this.ld=b;this.u=(0,g.x)(this.NE,this);this.o=[]},w6=function(a){a.Ga=g.xf(a.u,a.ld);
a.w.apply(null,a.o)},x6=function(a,b,c,d){this.o=a;
this.w=b;this.G=c;this.F=d||1;this.B=45E3;this.A=new g.y1(this);this.u=new g.wf;this.u.setInterval(250)},xta=function(a,b,c){a.Ji=1;
a.tg=Z5(b.clone());a.Yh=c;a.C=!0;wta(a,null)},y6=function(a,b,c,d,e){a.Ji=1;
a.tg=Z5(b.clone());a.Yh=null;a.C=c;e&&(a.lB=!1);wta(a,d)},wta=function(a,b){a.wj=(0,g.H)();
z6(a);a.Zg=a.tg.clone();$5(a.Zg,"t",a.F);a.Sl=0;a.Gc=a.o.fq(a.o.Fl()?b:null);0<a.Pq&&(a.Do=new v6((0,g.x)(a.oC,a,a.Gc),a.Pq));a.A.ga(a.Gc,"readystatechange",a.NN);var c=a.Dh?g.Yb(a.Dh):{};a.Yh?(a.ip="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Gc.send(a.Zg,a.ip,a.Yh,c)):(a.ip="GET",a.lB&&!g.Ld&&(c.Connection="close"),a.Gc.send(a.Zg,a.ip,null,c));a.o.Pe(1)},Ata=function(a,b,c){for(var d=!0;!a.lh&&a.Sl<c.length;){var e=yta(a,c);
if(e==A6){4==b&&(a.Fg=4,B6(15),d=!1);break}else if(e==zta){a.Fg=4;B6(16);d=!1;break}else C6(a,e)}4==b&&0==c.length&&(a.Fg=1,B6(17),d=!1);a.Qe=a.Qe&&d;d||(D6(a),E6(a))},yta=function(a,b){var c=a.Sl,d=b.indexOf("\n",c);
if(-1==d)return A6;c=Number(b.substring(c,d));if(isNaN(c))return zta;d+=1;if(d+c>b.length)return A6;var e=b.substr(d,c);a.Sl=d+c;return e},Cta=function(a,b){a.wj=(0,g.H)();
z6(a);var c=b?window.location.hostname:"";a.Zg=a.tg.clone();Y5(a.Zg,"DOMAIN",c);Y5(a.Zg,"t",a.F);try{a.Ue=new ActiveXObject("htmlfile")}catch(n){D6(a);a.Fg=7;B6(22);E6(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var k=c.charAt(f);if("<"==k)e+="\\x3c";else if(">"==k)e+="\\x3e";else{var l=k;if(l in F6)k=F6[l];else if(l in Bta)k=F6[l]=Bta[l];else{var m=l.charCodeAt(0);if(31<m&&127>m)k=l;else{if(256>m){if(k="\\x",16>m||256<m)k+="0"}else k="\\u",4096>m&&(k+="0");k+=m.toString(16).toUpperCase()}k=
F6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Sc(g.nc("b/12014412"),d+"</body></html>");a.Ue.open();a.Ue.write(g.Nc(c));a.Ue.close();a.Ue.parentWindow.m=(0,g.x)(a.hN,a);a.Ue.parentWindow.d=(0,g.x)(a.uA,a,!0);a.Ue.parentWindow.rpcClose=(0,g.x)(a.uA,a,!1);c=a.Ue.createElement("DIV");a.Ue.parentWindow.document.body.appendChild(c);d=g.zc(a.Zg.toString());d=g.Zc(g.xc(d));d=g.Sc(g.nc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.Tc(c,d);a.o.Pe(1)},z6=function(a){a.mu=(0,g.H)()+a.B;
Dta(a,a.B)},Dta=function(a,b){if(null!=a.Jj)throw Error("WatchDog timer not null");
a.Jj=G6((0,g.x)(a.oN,a),b)},H6=function(a){a.Jj&&(g.v.clearTimeout(a.Jj),a.Jj=null)},E6=function(a){a.o.Yw()||a.lh||a.o.vo(a)},D6=function(a){H6(a);
g.ie(a.Do);a.Do=null;a.u.stop();g.A1(a.A);if(a.Gc){var b=a.Gc;a.Gc=null;b.abort();b.dispose()}a.Ue&&(a.Ue=null)},C6=function(a,b){try{a.o.oA(a,b),a.o.Pe(4)}catch(c){}},Fta=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;Eta(a,b,function(k){k?c(!0):g.v.setTimeout(function(){Fta(a,b,c,d,f)},f)})}},Eta=function(a,b,c){var d=new Image;
d.onload=function(){try{I6(d),c(!0)}catch(e){}};
d.onerror=function(){try{I6(d),c(!1)}catch(e){}};
d.onabort=function(){try{I6(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{I6(d),c(!1)}catch(e){}};
g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
Ssa(d,a)},I6=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},J6=function(){},Gta=function(a){this.o=a;
this.u=new J6},Hta=function(a){var b=K6(a.o,a.Uj,"/mail/images/cleardot.gif");
Z5(b);Fta(b.toString(),5E3,(0,g.x)(a.ID,a),3,2E3);a.Pe(1)},M6=function(a){var b=a.o.H;
if(null!=b)B6(5),b?(B6(11),L6(a.o,a,!1)):(B6(12),L6(a.o,a,!0));else if(a.Ld=new x6(a,void 0,void 0,void 0),a.Ld.Dh=a.Nq,b=a.o,b=K6(b,b.Fl()?a.rk:null,a.Oq),B6(5),!g.Jd||g.md(10))$5(b,"TYPE","xmlhttp"),y6(a.Ld,b,!1,a.rk,!1);else{$5(b,"TYPE","html");var c=a.Ld;a=!!a.rk;c.Ji=3;c.tg=Z5(b.clone());Cta(c,a)}},N6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return Tsa(a)},O6=function(a){g.Ie.call(this);
this.headers=new g.Jm;this.S=a||null;this.w=!1;this.O=this.o=null;this.da=this.H="";this.C=0;this.A="";this.B=this.Z=this.G=this.V=!1;this.F=0;this.M=null;this.ma="";this.J=this.U=!1},Ita=function(a){return g.Jd&&g.ld(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},Jta=function(a){return"content-type"==a.toLowerCase()},Lta=function(a,b){a.w=!1;
a.o&&(a.B=!0,a.o.abort(),a.B=!1);a.A=b;a.C=5;Kta(a);P6(a)},Kta=function(a){a.V||(a.V=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},Nta=function(a){if(a.w&&"undefined"!=typeof g.G1)if(a.O[1]&&4==Q6(a)&&2==a.getStatus())R6(a,"Local request error detected and ignored");
else if(a.G&&4==Q6(a))g.xf(a.ax,0,a);else if(a.dispatchEvent("readystatechange"),4==Q6(a)){R6(a,"Request complete");a.w=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=g.Rg(1,String(a.H));if(!f&&g.v.self&&g.v.self.location){var k=g.v.self.location.protocol;f=k.substr(0,k.length-1)}e=!Mta.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{a.C=6;try{var l=2<Q6(a)?a.o.statusText:""}catch(m){l=""}a.A=l+" ["+a.getStatus()+"]";Kta(a)}}finally{P6(a)}}},P6=function(a,b){if(a.o){Ota(a);
var c=a.o,d=a.O[0]?g.Ca:null;a.o=null;a.O=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},Ota=function(a){a.o&&a.J&&(a.o.ontimeout=null);
a.M&&(g.v.clearTimeout(a.M),a.M=null)},Q6=function(a){return a.o?a.o.readyState:0},S6=function(a){try{return a.o?a.o.responseText:""}catch(b){return""}},R6=function(a,b){return b+" ["+a.da+" "+a.H+" "+a.getStatus()+"]"},T6=function(a,b,c){this.o=1;
this.u=[];this.A=[];this.B=new J6;this.G=a||null;this.H=null!=b?b:null;this.C=c||!1},Pta=function(a,b){this.o=a;
this.map=b;this.context=null},Qta=function(a){g.ke.call(this,"statevent",a)},Rta=function(a,b){g.ke.call(this,"timingevent",a);
this.size=b},Sta=function(a){g.ke.call(this,"serverreachability",a)},Vta=function(a){Tta(a);
if(3==a.o){var b=a.jl++,c=a.Vm.clone();Y5(c,"SID",a.w);Y5(c,"RID",b);Y5(c,"TYPE","terminate");U6(a,c);b=new x6(a,a.w,b,void 0);b.Ji=2;b.tg=Z5(c.clone());Ssa(new Image,b.tg.toString());b.wj=(0,g.H)();z6(b)}Uta(a)},Wta=function(a){a.fE(1,0);
a.Vm=K6(a,null,a.Mq);V6(a)},Tta=function(a){a.xg&&(a.xg.abort(),a.xg=null);
a.Zb&&(a.Zb.cancel(),a.Zb=null);a.If&&(g.v.clearTimeout(a.If),a.If=null);W6(a);a.Fd&&(a.Fd.cancel(),a.Fd=null);a.Bg&&(g.v.clearTimeout(a.Bg),a.Bg=null)},Xta=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed");
a.u.push(new Pta(a.zJ++,b));2!=a.o&&3!=a.o||V6(a)},V6=function(a){a.Fd||a.Bg||(a.Bg=G6((0,g.x)(a.tA,a),0),a.Di=0)},Zta=function(a,b){if(1==a.o){if(!b){a.jl=Math.floor(1E5*Math.random());
var c=a.jl++,d=new x6(a,"",c,void 0);d.Dh=null;var e=X6(a),f=a.Vm.clone();Y5(f,"RID",c);Y5(f,"CVER","1");U6(a,f);xta(d,f,e);a.Fd=d;a.o=2}}else 3==a.o&&(b?Yta(a,b):0==a.u.length||a.Fd||Yta(a))},Yta=function(a,b){if(b)if(6<a.mh){a.u=a.A.concat(a.u);
a.A.length=0;var c=a.jl-1;var d=X6(a)}else c=b.G,d=b.Yh;else c=a.jl++,d=X6(a);var e=a.Vm.clone();Y5(e,"SID",a.w);Y5(e,"RID",c);Y5(e,"AID",a.Wi);U6(a,e);c=new x6(a,a.w,c,a.Di+1);c.Dh=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Fd=c;xta(c,e,d)},U6=function(a,b){if(a.hd){var c=a.hd.xw();
c&&g.Hb(c,function(d,e){Y5(b,e,d)})}},X6=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b];
if(6<a.mh&&0<b){var d=a.u[0].o;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.u[e].o,k=a.u[e].map;f=6>=a.mh?e:f-d;try{g.Hb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.A=a.A.concat(a.u.splice(0,b));
return c.join("&")},$ta=function(a){a.Zb||a.If||(a.F=1,a.If=G6((0,g.x)(a.sA,a),0),a.wi=0)},Y6=function(a){if(a.Zb||a.If||3<=a.wi)return!1;
a.F++;a.If=G6((0,g.x)(a.sA,a),aua(a,a.wi));a.wi++;return!0},L6=function(a,b,c){a.gp=c;
a.df=b.Uf;a.C||Wta(a)},W6=function(a){null!=a.qh&&(g.v.clearTimeout(a.qh),a.qh=null)},aua=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},Z6=function(a,b){if(2==b||9==b){var c=null;
a.hd&&(c=null);var d=(0,g.x)(a.yO,a);c||(c=new g.Mm("//www.google.com/images/cleardot.gif"),Z5(c));Eta(c.toString(),1E4,d)}else B6(2);bua(a,b)},bua=function(a,b){a.o=0;
a.hd&&a.hd.Lv(b);Uta(a);Tta(a)},Uta=function(a){a.o=0;
a.df=-1;if(a.hd)if(0==a.A.length&&0==a.u.length)a.hd.Vp();else{g.cb(a.A);var b=g.cb(a.u);a.A.length=0;a.u.length=0;a.hd.Vp(b)}},K6=function(a,b,c){var d=g.Um(c);
if(""!=d.o)b&&g.Om(d,b+"."+d.o),g.Pm(d,d.B);else{var e=window.location;d=Wsa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.fk&&g.Hb(a.fk,function(f,k){Y5(d,k,f)});
Y5(d,"VER",a.mh);U6(a,d);return d},G6=function(a,b){if(!g.Ha(a))throw Error("Fn must not be null and must be a function");
return g.v.setTimeout(function(){a()},b)},B6=function(a){$6.dispatchEvent(new Qta($6,a))},cua=function(){},a7=function(a,b,c){g.A.call(this);
this.C=null!=c?(0,g.x)(a,c):a;this.ld=b;this.B=(0,g.x)(this.ME,this);this.o=!1;this.u=0;this.w=this.Ga=null;this.A=[]},dua=function(){this.o=[];
this.u=[]},eua=function(a,b){this.action=a;
this.params=b||{}},b7=function(a,b){g.A.call(this);
this.o=new g.I(this.YM,0,this);g.B(this,this.o);this.ld=5E3;this.u=0;if(g.Ha(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Ha(a.handleEvent))a=(0,g.x)(a.handleEvent,a);else throw Error("Invalid listener argument");this.w=a},c7=function(a,b,c){this.M=a;
this.C=b;this.w=new g.Tn;this.u=new b7(this.cO,this);this.o=null;this.tb=!1;this.B=null;this.H="";this.G=this.A=0;this.F=[];this.J=c||!1},fua=function(a){return{firstTestResults:[""],
secondTestResults:!a.o.gp,sessionId:a.o.w,arrayId:a.o.Wi}},gua=function(a,b){a.G=b||0;
a.u.stop();a.o&&(3==a.o.o&&Zta(a.o),Vta(a.o));a.G=0},d7=function(a){return!!a.o&&3==a.o.o},hua=function(a,b){(a.C.loungeIdToken=b)||a.u.stop()},e7=function(a){this.port=this.domain="";
this.o="/api/lounge";this.u=!0;a=a||document.location.href;var b=Number(g.Rg(4,a))||"";b&&(this.port=":"+b);this.domain=g.Sg(a)||"";a=g.Fb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Eb(a,"10.0")&&(this.u=!1))},f7=function(a,b){var c=a.o;
a.u&&(c="https://"+a.domain+a.port+a.o);return g.ah(c+b,{})},g7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.La(a.A,d,!0),onError:g.La(a.w,e),Hd:g.La(a.B,e)};c&&(a.yb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.Dp(b,a)},lua=function(){var a=iua;
jua();h7.push(a);kua(h7)},i7=function(a,b){jua();
var c=h7,d=mua(a,String(b));g.Wa(c)?nua(d):(kua(c),(0,g.y)(c,function(e){e(d)}))},jua=function(){h7||(h7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ba("yt.mdx.remote.debug.handlers_",h7,void 0))},nua=function(a){var b=(j7+1)%50;
j7=b;k7[b]=a;l7||(l7=49==b)},kua=function(a){var b=k7;
if(b[0]){var c=j7,d=l7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.y)(a,function(f){f(e)})}while(d!=c);
k7=Array(50);j7=-1;l7=!1}},mua=function(a,b){var c=((0,g.H)()-oua)/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("")},m7=function(a){g.P.call(this);
this.F=a;this.o=[]},pua=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.o.push(b);return!0},qua=function(a,b){var c=a.o.length!=b.length;
a.o=(0,g.Wd)(a.o,function(f){return!!j6(b,f)});
for(var d=0,e=b.length;d<e;d++)c=pua(a,b[d])||c;return c},rua=function(a,b){var c=a.o.length;
a.o=(0,g.Wd)(a.o,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.o.length<c},n7=function(a,b,c,d){g.P.call(this);
this.C=a;this.A=b;this.B=c;this.w=d;this.u=0;this.o=null;this.Ga=NaN},p7=function(a){m7.call(this,"LocalScreenService");
this.w=a;this.u=NaN;o7(this);this.info("Initializing with "+h6(this.o))},sua=function(a){if(a.o.length){var b=(0,g.Fc)(a.o,function(d){return d.id}),c=f7(a.w,"/pairing/get_lounge_token_batch");
g7(a.w,c,{screen_ids:b.join(",")},(0,g.x)(a.WE,a),(0,g.x)(a.VE,a))}},o7=function(a){var b=bta(hta());
b=(0,g.Wd)(b,function(c){return!c.uuid});
return qua(a,b)},q7=function(a,b){jta((0,g.Fc)(a.o,$sa));
b&&ita()},s7=function(a,b){g.P.call(this);
this.C=b;var c=g.ks("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.C(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.Va(c,l)}this.o=d;this.B=a;this.w=this.A=NaN;this.u=null;r7("Initialized with "+g.Gk(this.o))},tua=function(a,b,c){var d=f7(a.B,"/pairing/get_screen_availability");
g7(a.B,d,{lounge_token:b.token},(0,g.x)(function(e){e=e.screens||[];for(var f=0,k=e.length;f<k;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.x)(function(){c(!1)},a))},t7=function(a,b){a:if(a6(b)!=a6(a.o))var c=!1;
else{c=g.Ob(b);for(var d=0,e=c.length;d<e;++d)if(!a.o[c[d]]){c=!1;break a}c=!0}c||(r7("Updated online screens: "+g.Gk(a.o)),a.o=b,a.R("screenChange"));uua(a)},u7=function(a){isNaN(a.w)||g.Eo(a.w);
a.w=g.Co((0,g.x)(a.At,a),0<a.A&&a.A<(0,g.H)()?2E4:1E4)},r7=function(a){i7("OnlineScreenService",a)},vua=function(a){var b={};
(0,g.y)(a.C(),function(c){c.token?b[c.token]=c.id:this.Rb("Requesting availability of screen w/o lounge token.")});
return b},uua=function(a){a=g.Ob(g.Ib(a.o,function(b){return b}));
g.nb(a);a.length?g.js("yt-remote-online-screen-ids",a.join(","),60):l6("yt-remote-online-screen-ids")},v7=function(a){m7.call(this,"ScreenService");
this.C=a;this.u=this.w=null;this.A=[];this.B={};wua(this)},yua=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.B[b]);var k=a.Xd();if(k=(c?k6(k,c):null)||k6(k,b)){k.uuid=b;var l=w7(a,k);tua(a.u,l,function(m){e(m?l:null)})}else c?xua(a,c,(0,g.x)(function(m){var n=w7(this,new e6({name:d,
screenId:c,loungeToken:m,dialId:b||""}));tua(this.u,n,function(q){e(q?n:null)})},a),f):e(null)},zua=function(a,b){for(var c=0,d=a.o.length;c<d;++c)if(a.o[c].name==b)return a.o[c];
return null},xua=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={yb:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,k){var l=k&&k.screens||[];l[0]&&l[0].screenId==b?c(l[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.Dp(f7(a.C,"/pairing/get_lounge_token_batch"),e)},Aua=function(a){a.o=a.w.Xd();
var b=a.B,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.o.length;b<d;++b){var e=a.o[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+h6(a.o))},wua=function(a){x7(a);
a.w=new p7(a.C);a.w.subscribe("screenChange",(0,g.x)(a.eF,a));Aua(a);a.A=bta(g.ks("yt-remote-automatic-screen-cache")||[]);x7(a);a.info("Initializing automatic screens: "+h6(a.A));a.u=new s7(a.C,(0,g.x)(a.Xd,a,!0));a.u.subscribe("screenChange",(0,g.x)(function(){this.R("onlineScreenChange")},a))},w7=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=k6(a.A,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.A.push(b),g.js("yt-remote-automatic-screen-cache",(0,g.Fc)(a.A,$sa)));x7(a);a.B[b.uuid]=b.id;g.js("yt-remote-device-id-map",a.B,31536E3);return b},x7=function(a){a.B=g.ks("yt-remote-device-id-map")||{}},y7=function(a,b,c){g.P.call(this);
this.O=c;this.H=a;this.u=b;this.w=null},z7=function(a,b){i7(a.O,b)},A7=function(a,b){y7.call(this,a,b,"CastSession");
this.o=null;this.A=0;this.C=(0,g.x)(this.iP,this);this.B=(0,g.x)(this.wN,this);this.A=g.Co((0,g.x)(function(){Bua(this,null)},this),12E4)},Cua=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Gk(void 0));
var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ca,(0,g.x)(function(){z7(this,"Failed to send message: getMdxSessionStatus.")},a)):z7(a,"Sending yt message without session: "+g.Gk(b))},Bua=function(a,b){g.Eo(a.A);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.w||a.w.id!=b){var c=(0,g.x)(a.xo,a),d=(0,g.x)(a.ee,a);a.Qw(b,c,d,5)}}else a.ee(Error("Waiting for session status timed out."))},B7=function(a,b,c){y7.call(this,a,b,"DialSession");
this.A=this.G=null;this.M="";this.S=c;this.B=null;this.F=g.Ca;this.C=NaN;this.J=(0,g.x)(this.lP,this);this.o=g.Ca},Dua=function(a){a.o=a.H.uC(a.M,a.u.label,a.u.friendlyName,(0,g.x)(function(b){this.o=g.Ca;
this.xo(b)},a),(0,g.x)(function(b){this.o=g.Ca;
this.ee(b)},a))},Eua=function(a){var b={};
b.pairingCode=a.M;b.theme=a.S;if(a.B){var c=a.B.currentTime||0;b.v=a.B.videoId;b.t=c}lta()&&(b.env_useStageMdx=1);return g.Zg(b)},C7=function(a,b){y7.call(this,a,b,"ManualSession");
this.o=g.Co((0,g.x)(this.Xi,this,null),150)},D7=function(a,b,c,d){g.P.call(this);
this.u=a;this.F=b||"233637DE";this.C=c||"cl";this.G=d||!1;this.o=null;this.B=!1;this.w=[];this.A=(0,g.x)(this.gM,this)},Fua=function(a,b){return b?g.Sa(a.w,function(c){return f6(b,c.label)},a):null},E7=function(a){i7("Controller",a)},iua=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},F7=function(a){return a.B||!!a.w.length||!!a.o},G7=function(a,b,c){b!=a.o&&(g.ie(a.o),(a.o=b)?(c?a.R("yt-remote-cast2-receiver-resumed",b.u):a.R("yt-remote-cast2-receiver-selected",
b.u),b.subscribe("sessionScreen",(0,g.x)(a.rA,a,b)),b.w?a.R("yt-remote-cast2-session-change",b.w):c&&a.o.Xi(null)):a.R("yt-remote-cast2-session-change",null))},Gua=function(a){var b=a.u.tC(),c=a.o&&a.o.u;
a=(0,g.Fc)(b,function(d){c&&f6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=Fua(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},Mua=function(a,b,c,d,e,f,k){Hua()?Iua(b,e,f,k)&&(I7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Jua(a,c):(window.__onGCastApiAvailable=function(l,m){l?Jua(a,c):(J7("Failed to load cast API: "+m),K7(!1),I7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Kua(),c(!1))},d?g.Po("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):
0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?sta():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?t6():(rta(),s6(Lua.map(pta))))):H7("Cannot initialize because not running Chrome")},Kua=function(){H7("dispose");
var a=L7();a&&a.dispose();g.Ba("yt.mdx.remote.cloudview.instance_",null,void 0);Nua(!1);g.Ko(M7);M7.length=0},N7=function(){return!!g.ks("yt-remote-cast-installed")},Oua=function(){var a=g.ks("yt-remote-cast-receiver");
return a?a.friendlyName:null},Pua=function(){H7("clearCurrentReceiver");
l6("yt-remote-cast-receiver")},Qua=function(){return N7()?L7()?L7().getCastSession():(J7("getCastSelector: Cast is not initialized."),null):(J7("getCastSelector: Cast API is not installed!"),null)},P7=function(){N7()?L7()?O7()?(H7("Requesting cast selector."),L7().requestSession()):(H7("Wait for cast API to be ready to request the session."),M7.push(g.Jo("yt-remote-cast2-api-ready",P7))):J7("requestCastSelector: Cast is not initialized."):J7("requestCastSelector: Cast API is not installed!")},Q7=
function(a,b){O7()?L7().setConnectedScreenStatus(a,b):J7("setConnectedScreenStatus called before ready.")},Hua=function(){var a=0<=g.Fb.search(/ (CrMo|Chrome|CriOS)\//);
return g.Bv||a},Rua=function(a,b){L7().init(a,b)},Iua=function(a,b,c,d){var e=!1;
L7()||(a=new D7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.js("yt-remote-cast-available",f);c6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){H7("onReceiverSelected: "+f.friendlyName);
g.js("yt-remote-cast-receiver",f);c6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){H7("onReceiverResumed: "+f.friendlyName);
g.js("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){H7("onSessionChange: "+g6(f));
f||l6("yt-remote-cast-receiver");c6("yt-remote-cast2-session-change",f)}),g.Ba("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
H7("cloudview.createSingleton_: "+e);return e},L7=function(){return g.w("yt.mdx.remote.cloudview.instance_")},Jua=function(a,b){K7(!0);
I7(!1);Rua(a,function(c){c?(Nua(!0),g.Mo("yt-remote-cast2-api-ready")):(J7("Failed to initialize cast API."),K7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Kua());b(c)})},H7=function(a){i7("cloudview",a)},J7=function(a){i7("cloudview",a)},K7=function(a){H7("setCastInstalled_ "+a);
g.js("yt-remote-cast-installed",a)},O7=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},Nua=function(a){H7("setApiReady_ "+a);
g.Ba("yt.mdx.remote.cloudview.apiReady_",a,void 0)},I7=function(a){g.Ba("yt.mdx.remote.cloudview.initializing_",a,void 0)},R7=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.F=0;this.o=null;this.hasNext=this.ff=!1;this.H=this.G=this.u=this.A=0;this.w=NaN;this.B=!1;this.reset(a)},S7=function(a){a.audioTrackId=null;
a.o=null;a.playerState=-1;a.ff=!1;a.hasNext=!1;a.F=0;a.C=(0,g.H)();a.A=0;a.u=0;a.G=0;a.H=0;a.w=NaN;a.B=!1},T7=function(a){return 1==a.playerState?((0,g.H)()-a.C)/1E3:0},U7=function(a,b){a.F=b;
a.C=(0,g.H)()},V7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.H)()-a.C)/1E3+a.F;
case -1E3:return 0}return a.F},W7=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&S7(a)},X7=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.Zb(a.o);b.hasPrevious=a.ff;b.hasNext=a.hasNext;b.playerTime=a.F;b.playerTimeAt=a.C;b.seekableStart=a.A;b.seekableEnd=a.u;b.duration=a.G;b.loadedTime=a.H;b.liveIngestionTime=a.w;return b},Z7=function(a,b){g.P.call(this);
this.o=0;this.A=a;this.C=[];this.B=new dua;this.w=this.u=null;this.H=(0,g.x)(this.hK,this);this.F=(0,g.x)(this.ll,this);this.G=(0,g.x)(this.gK,this);this.M=(0,g.x)(this.sK,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.pu,this),Sua(this))):c=3;0!=c&&(b?this.pu(c):g.Co((0,g.x)(function(){this.pu(c)},this),0));
var d=Qua();d&&Y7(this,d);this.subscribe("yt-remote-cast2-session-change",this.M)},$7=function(a){return new R7(a.A.getPlayerContextData())},Sua=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.C.push(this.A.subscribe(b,g.La(this.dM,b),this))},a)},Tua=function(a){(0,g.y)(a.C,function(b){this.A.unsubscribeByKey(b)},a);
a.C.length=0},a8=function(a,b){var c=a.B;
50>c.o.length+c.u.length&&a.B.u.push(b)},c8=function(a,b,c){var d=$7(a);
U7(d,c);-1E3!=d.playerState&&(d.playerState=b);b8(a,d)},d8=function(a,b,c){a.A.sendMessage(b,c)},b8=function(a,b){Tua(a);
a.A.setPlayerContextData(X7(b));Sua(a)},Y7=function(a,b){a.w&&(a.w.removeUpdateListener(a.H),a.w.removeMediaListener(a.F),a.ll(null));
a.w=b;a.w&&(i7("CP","Setting cast session: "+a.w.sessionId),a.w.addUpdateListener(a.H),a.w.addMediaListener(a.F),a.w.media.length&&a.ll(a.w.media[0]))},Uua=function(a){var b=a.u.media,c=a.u.customData;
if(b&&c){var d=$7(a);b.contentId!=d.videoId&&i7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;U7(d,a.u.getEstimatedTime());b8(a,d)}else i7("CP","No cast media video. Ignoring state update.")},e8=function(a,b,c){return(0,g.x)(function(d){this.Rb("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Rb("Retrying "+b+" using MDx browser channel."),d8(this,b,c))},a)},f8=function(a,b,c){g.P.call(this);
this.B=NaN;this.J=!1;this.G=this.F=this.H=this.M=NaN;this.O=[];this.A=this.C=this.w=this.Sa=this.o=null;this.V=a;this.O.push(g.yq(window,"beforeunload",(0,g.x)(this.PE,this)));this.u=[];this.Sa=new R7;this.S=b.id;this.o=Vua(this,c);this.o.subscribe("handlerOpened",this.lK,this);this.o.subscribe("handlerClosed",this.iK,this);this.o.subscribe("handlerError",this.jK,this);this.o.subscribe("handlerMessage",this.kK,this);hua(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Sa.videoId;
g.ls()&&g.js("yt-remote-session-video-id",d)},this)},g8=function(a){i7("conn",a)},Vua=function(a,b){return new c7(f7(a.V,"/bc"),b)},h8=function(a,b){a.R("proxyStateChange",b)},Wua=function(a){a.B=g.Co((0,g.x)(function(){g8("Connecting timeout");
this.Ci(1)},a),2E4)},i8=function(a){g.Eo(a.B);
a.B=NaN},j8=function(a){g.Eo(a.M);
a.M=NaN},Xua=function(a){k8(a);
a.H=g.Co((0,g.x)(function(){l8(this,"getNowPlaying")},a),2E4)},k8=function(a){g.Eo(a.H);
a.H=NaN},Zua=function(a,b){b&&(i8(a),j8(a));
b==(d7(a.o)&&isNaN(a.B))?b&&(h8(a,1),l8(a,"getSubtitlesTrack")):b?(a.Ow()&&a.Sa.reset(),h8(a,1),l8(a,"getNowPlaying"),Yua(a)):a.Ci(1)},$ua=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Sa.videoId&&(g.Vb(b.params)?a.Sa.o=null:a.Sa.o=b.params,a.R("remotePlayerChange"))},ava=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.Sa.listId=b.params.listId||a.Sa.listId;W7(a.Sa,c,d);a.R("remoteQueueChange")},cva=function(a,b){b.params=b.params||{};
ava(a,b);bva(a,b);a.R("autoplayDismissed")},bva=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
U7(a.Sa,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Sa.playerState&&(c=-1E3);a.Sa.playerState=c;c=Number(b.params.loadedTime);a.Sa.H=isNaN(c)?0:c;c=Number(b.params.duration);a.Sa.G=isNaN(c)?0:c;c=a.Sa;var d=Number(b.params.liveIngestionTime);c.w=d;c.B=isNaN(d)?!1:!0;c=a.Sa;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.A=isNaN(d)?0:d;c.u=isNaN(e)?0:e;1==a.Sa.playerState?Xua(a):k8(a);a.R("remotePlayerChange")},dva=function(a,b){if(-1E3!=
a.Sa.playerState){var c=1085;
switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.Sa.playerState=c;c=parseInt(b.params.currentTime,10);U7(a.Sa,isNaN(c)?0:c);a.R("remotePlayerChange")}},eva=function(a,b){var c="true"==b.params.muted;
a.Sa.volume=parseInt(b.params.volume,10);a.Sa.muted=c;a.R("remotePlayerChange")},fva=function(a,b){a.C=b.params.videoId;
a.R("nowAutoplaying",parseInt(b.params.timeout,10))},gva=function(a,b){var c="true"==b.params.hasNext;
a.Sa.ff="true"==b.params.hasPrevious;a.Sa.hasNext=c;a.R("previousNextChange")},Yua=function(a){g.Eo(a.G);
a.G=g.Co((0,g.x)(a.Ci,a,1),864E5)},l8=function(a,b,c){c?g8("Sending: action="+b+", params="+g.Gk(c)):g8("Sending: action="+b);
a.o.sendMessage(b,c)},m8=function(a){m7.call(this,"ScreenServiceProxy");
this.kd=a;this.u=[];this.u.push(this.kd.$_s("screenChange",(0,g.x)(this.gP,this)));this.u.push(this.kd.$_s("onlineScreenChange",(0,g.x)(this.IL,this)))},lva=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.L("MDX_CONFIG")||b;dta();p6();n8||(n8=new e7(b?b.loungeApiHost:void 0),lta()&&(n8.o="/api/loungedev"));o8||(o8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ba("yt.mdx.remote.deferredProxies_",o8,void 0));hva();var c=p8();if(!c){var d=new v7(n8);g.Ba("yt.mdx.remote.screenService_",d,void 0);c=p8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);Mua(a,d,function(m){m?q8()&&Q7(q8(),"YouTube TV"):d.subscribe("onlineScreenChange",
function(){c6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Ba("yt.mdx.remote.initialized_",!0,void 0),r8("Initializing: "+g.Gk(b)),s8.push(g.Jo("yt-remote-cast2-availability-change",function(){c6("yt-remote-receiver-availability-change")})),s8.push(g.Jo("yt-remote-cast2-receiver-selected",function(){t8(null);
c6("yt-remote-auto-connect","cast-selector-receiver")})),s8.push(g.Jo("yt-remote-cast2-receiver-resumed",function(){c6("yt-remote-receiver-resumed","cast-selector-receiver")})),s8.push(g.Jo("yt-remote-cast2-session-change",iva)),s8.push(g.Jo("yt-remote-connection-change",function(m){m?Q7(q8(),"YouTube TV"):u8()||(Q7(null,null),Pua())})),a=v8(),b.isAuto&&(a.id+="#dial"),g.tp("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),r8(" -- with channel params: "+
g.Gk(a)),jva(a),c.start(),q8()||kva())},nva=function(){var a=mva();
N7()&&g.ks("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},mva=function(){var a=p8().kd.$_gos();
var b=w8();b&&x8()&&(j6(a,b)||a.push(b));return cta(a)},y8=function(){var a=ova();
!a&&N7()&&Oua()&&(a={key:"cast-selector-receiver",name:Oua()});return a},ova=function(){var a=mva(),b=w8();
b||(b=u8());return g.Sa(a,function(c){return b&&f6(b,c.key)?!0:!1})},w8=function(){var a=q8();
if(!a)return null;var b=p8().Xd();return k6(b,a)},iva=function(a){r8("remote.onCastSessionChange_: "+g6(a));
if(a){var b=w8();b&&b.id==a.id?Q7(b.id,"YouTube TV"):(b&&z8(),A8(a,1))}else x8()&&z8()},z8=function(){O7()?L7().stopSession():J7("stopSession called before API ready.");
var a=x8();a&&(a.disconnect(1),B8(null))},C8=function(){var a=x8();
return!!a&&3!=a.getProxyState()},r8=function(a){i7("remote",a)},p8=function(){if(!D8){var a=g.w("yt.mdx.remote.screenService_");
D8=a?new m8(a):null}return D8},q8=function(){return g.w("yt.mdx.remote.currentScreenId_")},pva=function(a){g.Ba("yt.mdx.remote.currentScreenId_",a,void 0)},qva=function(){return g.w("yt.mdx.remote.connectData_")},t8=function(a){g.Ba("yt.mdx.remote.connectData_",a,void 0)},x8=function(){return g.w("yt.mdx.remote.connection_")},B8=function(a){var b=x8();
t8(null);a||pva("");g.Ba("yt.mdx.remote.connection_",a,void 0);o8&&((0,g.y)(o8,function(c){c(a)}),o8.length=0);
b&&!a?c6("yt-remote-connection-change",!1):!b&&a&&c6("yt-remote-connection-change",!0)},u8=function(){var a=g.ls();
if(!a)return null;var b=p8().Xd();return k6(b,a)},A8=function(a,b){q8();
w8()&&w8();if(E8)F8=a;else{pva(a.id);var c=new f8(n8,a,v8());c.connect(b,qva());c.subscribe("beforeDisconnect",function(d){c6("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){x8()&&(x8(),B8(null))});
B8(c)}},kva=function(){var a=u8();
a?(r8("Resume connection to: "+g6(a)),A8(a,0)):(q6(),Pua(),r8("Skipping connecting because no session screen found."))},hva=function(){var a=v8();
if(g.Vb(a)){a=o6();var b=g.ks("yt-remote-session-name")||"",c=g.ks("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ba("yt.mdx.remote.channelParams_",a,void 0)}},v8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},jva=function(a){a?(g.js("yt-remote-session-app",a.app),g.js("yt-remote-session-name",a.name)):(l6("yt-remote-session-app"),l6("yt-remote-session-name"));
g.Ba("yt.mdx.remote.channelParams_",a,void 0)},G8=function(a,b,c){g.A.call(this);
this.B=a;this.u=b;this.w=new g.O(this);g.B(this,this.w);this.w.L(b,"onCaptionsTrackListChanged",this.eL);this.w.L(b,"captionschanged",this.fK);this.w.L(b,"captionssettingschanged",this.GB);this.w.L(b,"videoplayerreset",this.yo);this.w.L(b,"mdxautoplaycancel",this.HD);this.S=this.w.L(b,"onVolumeChange",this.Yz);this.G=!1;this.o=c;c.subscribe("proxyStateChange",this.nA,this);c.subscribe("remotePlayerChange",this.pl,this);c.subscribe("remoteQueueChange",this.yo,this);c.subscribe("autoplayUpNext",this.Oz,
this);c.subscribe("previousNextChange",this.kA,this);c.subscribe("nowAutoplaying",this.gA,this);c.subscribe("autoplayDismissed",this.Nz,this);this.suggestion=null;this.H=new g.iD(64);this.A=new g.I(this.CB,500,this);g.B(this,this.A);this.C=new g.I(this.DB,1E3,this);g.B(this,this.C);this.J=new a7(this.IO,0,this);g.B(this,this.J);this.F={};this.O=new g.I(this.hC,1E3,this);g.B(this,this.O);this.M=new v6(this.HH,1E3,this);g.B(this,this.M);this.V=g.Ca;this.GB();this.yo();this.pl()},H8=function(a,b){var c=
a.B,d=a.u.getVideoData().lengthSeconds;
c.O=b||0;c.player.R("progresssync",b,d)},rva=function(a){H8(a,0);
a.A.stop();I8(a,new g.iD(64))},K8=function(a,b){if(J8(a)&&!a.G){var c=null;
b&&(c={style:a.u.getSubtitlesUserSettings()},g.ac(c,b));a.o.rB(a.u.getVideoData(1).videoId,c);a.F=$7(a.o).o}},L8=function(a,b){var c=a.u.getPlaylist();
if(c){var d=c.Wa;var e=c.listId.toString()}c=a.u.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.hf,g.sB(c));I8(a,new g.iD(1))},sva=function(a,b){if(b){var c=a.u.getOption("captions","tracklist",{dT:1});
c&&c.length?(a.u.setOption("captions","track",b),a.G=!1):(a.u.loadModule("captions"),a.G=!0)}else a.u.setOption("captions","track",{})},J8=function(a){return $7(a.o).videoId==a.u.getVideoData(1).videoId},I8=function(a,b){a.C.stop();
var c=a.H;if(!g.oD(c,b)){var d=g.V(b,2);d!=g.V(a.H,2)&&g.TS(a.u.app,d);a.H=b;tva(a.B,c,b)}},M8=function(){g.U.call(this,{D:"div",
I:"ytp-mdx-popup-dialog",N:{role:"dialog"},K:[{D:"div",I:"ytp-mdx-popup-dialog-inner-content",K:[{D:"div",I:"ytp-mdx-popup-title",W:"You're signed out"},{D:"div",I:"ytp-mdx-popup-description",W:"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."},{D:"div",I:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-cancel"],W:"Cancel"},{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-confirm"],
W:"Confirm"}]}]}]});this.u=new g.WL(this,250);g.B(this,this.u);this.C=this.o["ytp-mdx-privacy-popup-cancel"];this.L(this.C,"click",this.w);this.A=this.o["ytp-mdx-privacy-popup-confirm"];this.L(this.A,"click",this.B)},N8=function(a){g.U.call(this,{D:"div",
I:"ytp-remote",K:[{D:"div",I:"ytp-remote-display-status",K:[{D:"div",I:"ytp-remote-display-status-icon",K:[g.YL()]},{D:"div",I:"ytp-remote-display-status-text",W:"{{statustext}}"}]}]});this.u=new g.WL(this,250);g.B(this,this.u);this.w=a;this.L(a,"presentingplayerstatechange",this.A);uva(this,g.kL(a))},uva=function(a,b){if(3==a.w.getPresentingPlayerType()){var c={RECEIVER_NAME:a.w.getOption("remote","currentReceiver").name};
c=g.V(b,128)?g.BM("Error on $RECEIVER_NAME",c):g.pD(b)||g.V(b,4)?g.BM("Playing on $RECEIVER_NAME",c):g.BM("Connected to $RECEIVER_NAME",c);a.ha("statustext",c);a.u.show()}else a.u.hide()},O8=function(a,b){g.jO.call(this,"Play on",0,a,b);
this.u=a;this.C={};this.L(a,"onMdxReceiversChange",this.J);this.L(a,"presentingplayerstatechange",this.J);this.J()},P8=function(a){g.sP.call(this,a);
this.u={key:i6(),name:"This computer"};this.B=null;this.A=[];this.S=this.o=null;this.M=[this.u];this.w=this.u;this.F=new g.iD(64);this.O=0;this.H=-1;this.C=null;if(!g.Ex(this.player.P())){a=this.player;var b=g.PC(a);b&&(b=b.Yk())&&(b=new O8(a,b),g.B(this,b));b=new N8(a);g.B(this,b);g.CL(a,b.element,4);this.C=new M8;g.B(this,this.C);g.CL(a,this.C.element,4);this.J=!!u8()}this.G=null},Q8=function(a){a.G&&(a.player.removeEventListener("presentingplayerstatechange",a.G),a.G=null)},tva=function(a,b,c){a.F=
c;
a.player.R("presentingplayerstatechange",new g.uD(c,b))},R8=function(a,b){if(b.key!=a.w.key)if(b.key==a.u.key)z8();
else{var c;(c=!g.Q(a.player.P().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.L("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.L("SESSION_INDEX")&&!g.L("LOGGED_IN")))||a.J||!a.C);if(c?0:g.Nx(a.player.P())||"WEB_EMBEDDED_PLAYER"==a.player.P().deviceParams.c)g.pD(g.kL(a.player))?a.player.pauseVideo():(a.G=(0,g.x)(a.BN,a),a.player.addEventListener("presentingplayerstatechange",a.G)),a.C&&a.C.u.show(),x8()||(E8=!0);a.w=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);
var e=c.videoId;if(!d&&!e||(2==a.player.app.V||1==a.player.app.V)&&g.Q(a.player.P().experiments,"should_clear_video_data_on_player_cued_unstarted"))c=null;else{var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.wa(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.hf,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=g.sB(c))&&(d.locationInfo=c);c=d}r8("Connecting to: "+
g.Gk(b));"cast-selector-receiver"==b.key?(t8(c||null),c=c||null,O7()?L7().setLaunchParams(c):J7("setLaunchParams called before ready.")):!c&&C8()&&q8()==b.key?c6("yt-remote-connection-change",!0):(z8(),t8(c||null),c=p8().Xd(),(c=k6(c,b.key))&&A8(c,1))}},Bta={"\x00":"\\0",
"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},F6={"'":"\\'"},vva={},Zsa={JP:"atp",pS:"ska",eS:"que",wR:"mus",oS:"sus",IQ:"dsp",lS:"seq"};
d6.prototype.yg=function(){var a=new d6({id:this.id,name:this.name,app:this.app,type:this.type,user:this.username,userAvatarUri:this.avatar,obfuscatedGaiaId:this.obfuscatedGaiaId,theme:this.theme,capabilities:Array.from(this.capabilities.values()).join(","),experiments:Array.from(this.experiments.values()).join(",")});a.w=this.w;a.u=this.u;a.o=this.o};
var r6,n6="",qta=mta("loadCastFramework")||mta("loadCastApplicationFramework"),Lua=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];u6.prototype.o=null;u6.prototype.getOptions=function(){var a;(a=this.o)||(a={},uta(this)&&(a[0]=!0,a[1]=!0),a=this.o=a);return a};var S8;g.Na(tta,u6);S8=new tta;/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
g.Na(v6,g.A);g.h=v6.prototype;g.h.Ii=!1;g.h.qk=0;g.h.Ga=null;g.h.Xw=function(a){this.o=arguments;this.Ga||this.qk?this.Ii=!0:w6(this)};
g.h.stop=function(){this.Ga&&(g.v.clearTimeout(this.Ga),this.Ga=null,this.Ii=!1,this.o=[])};
g.h.pause=function(){this.qk++};
g.h.resume=function(){this.qk--;this.qk||!this.Ii||this.Ga||(this.Ii=!1,w6(this))};
g.h.Y=function(){v6.Eb.Y.call(this);this.stop()};
g.h.NE=function(){this.Ga=null;this.Ii&&!this.qk&&(this.Ii=!1,w6(this))};g.h=x6.prototype;g.h.Dh=null;g.h.Qe=!1;g.h.Jj=null;g.h.mu=null;g.h.wj=null;g.h.Ji=null;g.h.tg=null;g.h.Zg=null;g.h.Yh=null;g.h.Gc=null;g.h.Sl=0;g.h.Ue=null;g.h.ip=null;g.h.Fg=null;g.h.tk=-1;g.h.lB=!0;g.h.lh=!1;g.h.Pq=0;g.h.Do=null;var zta={},A6={};g.h=x6.prototype;g.h.setTimeout=function(a){this.B=a};
g.h.NN=function(a){a=a.target;var b=this.Do;b&&3==Q6(a)?b.Xw():this.oC(a)};
g.h.oC=function(a){try{if(a==this.Gc)a:{var b=Q6(this.Gc),c=this.Gc.C,d=this.Gc.getStatus();if(g.Jd&&!g.md(10)||g.Ld&&!g.ld("420+")){if(4>b)break a}else if(3>b||3==b&&!g.sh&&!S6(this.Gc))break a;this.lh||4!=b||7==c||(8==c||0>=d?this.o.Pe(3):this.o.Pe(2));H6(this);var e=this.Gc.getStatus();this.tk=e;var f=S6(this.Gc);(this.Qe=200==e)?(4==b&&D6(this),this.C?(Ata(this,b,f),g.sh&&this.Qe&&3==b&&(this.A.ga(this.u,"tick",this.HN),this.u.start())):C6(this,f),this.Qe&&!this.lh&&(4==b?this.o.vo(this):(this.Qe=
!1,z6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Fg=3,B6(13)):(this.Fg=0,B6(14)),D6(this),E6(this))}}catch(k){this.Gc&&S6(this.Gc)}finally{}};
g.h.HN=function(){var a=Q6(this.Gc),b=S6(this.Gc);this.Sl<b.length&&(H6(this),Ata(this,a,b),this.Qe&&4!=a&&z6(this))};
g.h.hN=function(a){G6((0,g.x)(this.gN,this,a),0)};
g.h.gN=function(a){this.lh||(H6(this),C6(this,a),z6(this))};
g.h.uA=function(a){G6((0,g.x)(this.fN,this,a),0)};
g.h.fN=function(a){this.lh||(D6(this),this.Qe=a,this.o.vo(this),this.o.Pe(4))};
g.h.cancel=function(){this.lh=!0;D6(this)};
g.h.oN=function(){this.Jj=null;var a=(0,g.H)();0<=a-this.mu?(2!=this.Ji&&this.o.Pe(3),D6(this),this.Fg=2,B6(18),E6(this)):Dta(this,this.mu-a)};
g.h.getLastError=function(){return this.Fg};J6.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)};
J6.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};g.h=Gta.prototype;g.h.Nq=null;g.h.Ld=null;g.h.Eo=!1;g.h.Zw=null;g.h.Tm=null;g.h.zr=null;g.h.Oq=null;g.h.te=null;g.h.Uf=-1;g.h.rk=null;g.h.Uj=null;g.h.connect=function(a){this.Oq=a;a=K6(this.o,null,this.Oq);B6(3);this.Zw=(0,g.H)();var b=this.o.G;null!=b?(this.rk=b[0],(this.Uj=b[1])?(this.te=1,Hta(this)):(this.te=2,M6(this))):($5(a,"MODE","init"),this.Ld=new x6(this,void 0,void 0,void 0),this.Ld.Dh=this.Nq,y6(this.Ld,a,!1,null,!0),this.te=0)};
g.h.ID=function(a){if(a)this.te=2,M6(this);else{B6(4);var b=this.o;b.df=b.xg.Uf;Z6(b,9)}a&&this.Pe(2)};
g.h.fq=function(a){return this.o.fq(a)};
g.h.abort=function(){this.Ld&&(this.Ld.cancel(),this.Ld=null);this.Uf=-1};
g.h.Yw=function(){return!1};
g.h.oA=function(a,b){this.Uf=a.tk;if(0==this.te)if(b){try{var c=this.u.parse(b)}catch(d){c=this.o;c.df=this.Uf;Z6(c,2);return}this.rk=c[0];this.Uj=c[1]}else c=this.o,c.df=this.Uf,Z6(c,2);else if(2==this.te)if(this.Eo)B6(7),this.zr=(0,g.H)();else if("11111"==b){if(B6(6),this.Eo=!0,this.Tm=(0,g.H)(),c=this.Tm-this.Zw,!g.Jd||g.md(10)||500>c)this.Uf=200,this.Ld.cancel(),B6(12),L6(this.o,this,!0)}else B6(8),this.Tm=this.zr=(0,g.H)(),this.Eo=!1};
g.h.vo=function(){this.Uf=this.Ld.tk;if(this.Ld.Qe)0==this.te?this.Uj?(this.te=1,Hta(this)):(this.te=2,M6(this)):2==this.te&&((!g.Jd||g.md(10)?!this.Eo:200>this.zr-this.Tm)?(B6(11),L6(this.o,this,!1)):(B6(12),L6(this.o,this,!0)));else{0==this.te?B6(9):2==this.te&&B6(10);var a=this.o;this.Ld.getLastError();a.df=this.Uf;Z6(a,2)}};
g.h.Fl=function(){return this.o.Fl()};
g.h.isActive=function(){return this.o.isActive()};
g.h.Pe=function(a){this.o.Pe(a)};g.Na(O6,g.Ie);var Mta=/^https?$/i,wva=["POST","PUT"];g.h=O6.prototype;
g.h.send=function(a,b,c,d){if(this.o)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+a);b=b?b.toUpperCase():"GET";this.H=a;this.A="";this.C=0;this.da=b;this.V=!1;this.w=!0;this.o=this.S?vta(this.S):vta(S8);this.O=this.S?this.S.getOptions():S8.getOptions();this.o.onreadystatechange=(0,g.x)(this.ax,this);try{b6(R6(this,"Opening Xhr")),this.Z=!0,this.o.open(b,String(a),!0),this.Z=!1}catch(f){b6(R6(this,"Error opening Xhr: "+f.message));Lta(this,f);return}a=c||
"";var e=this.headers.clone();d&&Vsa(d,function(f,k){e.set(k,f)});
d=g.Sa(e.qe(),Jta);c=g.v.FormData&&a instanceof g.v.FormData;!g.Va(wva,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,k){this.o.setRequestHeader(k,f)},this);
this.ma&&(this.o.responseType=this.ma);"withCredentials"in this.o&&this.o.withCredentials!==this.U&&(this.o.withCredentials=this.U);try{Ota(this),0<this.F&&(this.J=Ita(this.o),b6(R6(this,"Will abort after "+this.F+"ms if incomplete, xhr2 "+this.J)),this.J?(this.o.timeout=this.F,this.o.ontimeout=(0,g.x)(this.bx,this)):this.M=g.xf(this.bx,this.F,this)),b6(R6(this,"Sending request")),this.G=!0,this.o.send(a),this.G=!1}catch(f){b6(R6(this,"Send error: "+f.message)),Lta(this,f)}};
g.h.bx=function(){"undefined"!=typeof g.G1&&this.o&&(this.A="Timed out after "+this.F+"ms, aborting",this.C=8,R6(this,this.A),this.dispatchEvent("timeout"),this.abort(8))};
g.h.abort=function(a){this.o&&this.w&&(R6(this,"Aborting"),this.w=!1,this.B=!0,this.o.abort(),this.B=!1,this.C=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),P6(this))};
g.h.Y=function(){this.o&&(this.w&&(this.w=!1,this.B=!0,this.o.abort(),this.B=!1),P6(this,!0));O6.Eb.Y.call(this)};
g.h.ax=function(){this.ka()||(this.Z||this.G||this.B?Nta(this):this.fM())};
g.h.fM=function(){Nta(this)};
g.h.isActive=function(){return!!this.o};
g.h.getStatus=function(){try{return 2<Q6(this)?this.o.status:-1}catch(a){return-1}};
g.h.getLastError=function(){return"string"===typeof this.A?this.A:String(this.A)};g.h=T6.prototype;g.h.fk=null;g.h.Fd=null;g.h.Zb=null;g.h.Mq=null;g.h.Vm=null;g.h.zv=null;g.h.kn=null;g.h.jl=0;g.h.zJ=0;g.h.hd=null;g.h.Bg=null;g.h.If=null;g.h.qh=null;g.h.xg=null;g.h.gp=null;g.h.Wi=-1;g.h.Nx=-1;g.h.df=-1;g.h.Di=0;g.h.wi=0;g.h.mh=8;var $6=new g.Ie;g.Na(Qta,g.ke);g.Na(Rta,g.ke);g.Na(Sta,g.ke);g.h=T6.prototype;g.h.connect=function(a,b,c,d,e){B6(0);this.Mq=b;this.fk=c||{};d&&void 0!==e&&(this.fk.OSID=d,this.fk.OAID=e);this.C?(G6((0,g.x)(this.Rv,this,a),100),Wta(this)):this.Rv(a)};
g.h.Rv=function(a){this.xg=new Gta(this);this.xg.Nq=null;this.xg.u=this.B;this.xg.connect(a)};
g.h.Yw=function(){return 0==this.o};
g.h.tA=function(a){this.Bg=null;Zta(this,a)};
g.h.sA=function(){this.If=null;this.Zb=new x6(this,this.w,"rpc",this.F);this.Zb.Dh=null;this.Zb.Pq=0;var a=this.zv.clone();Y5(a,"RID","rpc");Y5(a,"SID",this.w);Y5(a,"CI",this.gp?"0":"1");Y5(a,"AID",this.Wi);U6(this,a);if(!g.Jd||g.md(10))Y5(a,"TYPE","xmlhttp"),y6(this.Zb,a,!0,this.kn,!1);else{Y5(a,"TYPE","html");var b=this.Zb,c=!!this.kn;b.Ji=3;b.tg=Z5(a.clone());Cta(b,c)}};
g.h.oA=function(a,b){if(0!=this.o&&(this.Zb==a||this.Fd==a))if(this.df=a.tk,this.Fd==a&&3==this.o)if(7<this.mh){try{var c=this.B.parse(b)}catch(f){c=null}if(g.Fa(c)&&3==c.length)if(0==c[0])a:{if(!this.If){if(this.Zb)if(this.Zb.wj+3E3<this.Fd.wj)W6(this),this.Zb.cancel(),this.Zb=null;else break a;Y6(this);B6(19)}}else this.Nx=c[1],0<this.Nx-this.Wi&&37500>c[2]&&this.gp&&0==this.wi&&!this.qh&&(this.qh=G6((0,g.x)(this.bK,this),6E3));else Z6(this,11)}else b!=vva.gQ.o&&Z6(this,11);else if(this.Zb==a&&
W6(this),!g.tb(b)){c=this.B.parse(b);g.Fa(c);for(var d=0;d<c.length;d++){var e=c[d];this.Wi=e[0];e=e[1];2==this.o?"c"==e[0]?(this.w=e[1],this.kn=e[2],e=e[3],null!=e?this.mh=e:this.mh=6,this.o=3,this.hd&&this.hd.Nv(),this.zv=K6(this,this.Fl()?this.kn:null,this.Mq),$ta(this)):"stop"==e[0]&&Z6(this,7):3==this.o&&("stop"==e[0]?Z6(this,7):"noop"!=e[0]&&this.hd&&this.hd.Mv(e),this.wi=0)}}};
g.h.bK=function(){null!=this.qh&&(this.qh=null,this.Zb.cancel(),this.Zb=null,Y6(this),B6(20))};
g.h.vo=function(a){if(this.Zb==a){W6(this);this.Zb=null;var b=2}else if(this.Fd==a)this.Fd=null,b=1;else return;this.df=a.tk;if(0!=this.o)if(a.Qe)1==b?(b=(0,g.H)()-a.wj,$6.dispatchEvent(new Rta($6,a.Yh?a.Yh.length:0,b,this.Di)),V6(this),this.A.length=0):$ta(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.df)){if(d=1==b)this.Fd||this.Bg||1==this.o||2<=this.Di?d=!1:(this.Bg=G6((0,g.x)(this.tA,this,a),aua(this,this.Di)),this.Di++,d=!0);d=!(d||2==b&&Y6(this))}if(d)switch(c){case 1:Z6(this,
5);break;case 4:Z6(this,10);break;case 3:Z6(this,6);break;case 7:Z6(this,12);break;default:Z6(this,2)}}};
g.h.fE=function(a){if(!g.Va(arguments,this.o))throw Error("Unexpected channel state: "+this.o);};
g.h.yO=function(a){a?B6(2):(B6(1),bua(this,8))};
g.h.fq=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new O6;a.U=!1;return a};
g.h.isActive=function(){return!!this.hd&&this.hd.isActive(this)};
g.h.Pe=function(a){$6.dispatchEvent(new Sta($6,a))};
g.h.Fl=function(){return!(!g.Jd||g.md(10))};
g.h=cua.prototype;g.h.Nv=function(){};
g.h.Mv=function(){};
g.h.Lv=function(){};
g.h.Vp=function(){};
g.h.xw=function(){return{}};
g.h.isActive=function(){return!0};g.Na(a7,g.A);g.h=a7.prototype;g.h.LE=function(a){this.A=arguments;this.o=!1;this.Ga?this.w=(0,g.H)()+this.ld:this.Ga=g.xf(this.B,this.ld)};
g.h.stop=function(){this.Ga&&(g.v.clearTimeout(this.Ga),this.Ga=null);this.w=null;this.o=!1;this.A=[]};
g.h.pause=function(){++this.u};
g.h.resume=function(){this.u&&(--this.u,!this.u&&this.o&&(this.o=!1,this.C.apply(null,this.A)))};
g.h.Y=function(){this.stop();a7.Eb.Y.call(this)};
g.h.ME=function(){this.w?(this.Ga=g.xf(this.B,this.w-(0,g.H)()),this.w=null):(this.Ga=null,this.u?this.o=!0:(this.o=!1,this.C.apply(null,this.A)))};g.h=dua.prototype;g.h.isEmpty=function(){return g.Wa(this.o)&&g.Wa(this.u)};
g.h.clear=function(){this.o=[];this.u=[]};
g.h.contains=function(a){return g.Va(this.o,a)||g.Va(this.u,a)};
g.h.remove=function(a){var b=this.o;var c=(0,g.joa)(b,a);0<=c?(g.Ya(b,c),b=!0):b=!1;return b||g.Za(this.u,a)};
g.h.xd=function(){for(var a=[],b=this.o.length-1;0<=b;--b)a.push(this.o[b]);var c=this.u.length;for(b=0;b<c;++b)a.push(this.u[b]);return a};g.Na(b7,g.A);g.h=b7.prototype;g.h.YM=function(){this.ld=Math.min(3E5,2*this.ld);this.w();this.u&&this.start()};
g.h.start=function(){var a=this.ld+15E3*Math.random();g.vn(this.o,a);this.u=(0,g.H)()+a};
g.h.stop=function(){this.o.stop();this.u=0};
g.h.isActive=function(){return this.o.isActive()};
g.h.reset=function(){this.o.stop();this.ld=5E3};g.Na(c7,cua);g.h=c7.prototype;g.h.subscribe=function(a,b,c){return this.w.subscribe(a,b,c)};
g.h.unsubscribe=function(a,b,c){return this.w.unsubscribe(a,b,c)};
g.h.gg=function(a){return this.w.Eh(a)};
g.h.R=function(a,b){return this.w.R.apply(this.w,arguments)};
g.h.dispose=function(){this.tb||(this.tb=!0,g.ie(this.w),gua(this),g.ie(this.u),this.u=null)};
g.h.ka=function(){return this.tb};
g.h.connect=function(a,b,c){if(!this.o||2!=this.o.o){this.H="";this.u.stop();this.B=a||null;this.A=b||0;a=this.M+"/test";b=this.M+"/bind";var d=new T6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.J),e=this.o;e&&(e.hd=null);d.hd=this;this.o=d;e?this.o.connect(a,b,this.C,e.w,e.Wi):c?this.o.connect(a,b,this.C,c.sessionId,c.arrayId):this.o.connect(a,b,this.C)}};
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.ac(c,b);this.u.isActive()||2==(this.o?this.o.o:0)?this.F.push(c):d7(this)&&Xta(this.o,c)};
g.h.Nv=function(){this.u.reset();this.B=null;this.A=0;if(this.F.length){var a=this.F;this.F=[];for(var b=0,c=a.length;b<c;++b)Xta(this.o,a[b])}this.R("handlerOpened")};
g.h.Lv=function(a){var b=2==a&&401==this.o.df;4==a||b||this.u.start();this.R("handlerError",a)};
g.h.Vp=function(a){if(!this.u.isActive())this.R("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.F.push(d)}};
g.h.xw=function(){var a={v:2};this.H&&(a.gsessionid=this.H);0!=this.A&&(a.ui=""+this.A);0!=this.G&&(a.ui=""+this.G);this.B&&g.ac(a,this.B);return a};
g.h.Mv=function(a){"S"==a[0]?this.H=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),Vta(this.o)):this.R("handlerMessage",new eua(a[0],a[1]))};
g.h.cO=function(){this.u.isActive();var a=this.o,b=0;a.Zb&&b++;a.Fd&&b++;0==b&&this.connect(this.B,this.A)};e7.prototype.A=function(a,b,c,d){b?a(d):a({text:c.responseText})};
e7.prototype.w=function(a,b){a(Error("Request error: "+b.status))};
e7.prototype.B=function(a){a(Error("request timed out"))};var oua=(0,g.H)(),h7=null,k7=Array(50),j7=-1,l7=!1;g.Na(m7,g.P);m7.prototype.Xd=function(){return this.o};
m7.prototype.contains=function(a){return!!j6(this.o,a)};
m7.prototype.get=function(a){return a?k6(this.o,a):null};
m7.prototype.info=function(a){i7(this.F,a)};g.r(n7,g.P);g.h=n7.prototype;g.h.start=function(){!this.o&&isNaN(this.Ga)&&this.sC()};
g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Ga)||(g.Eo(this.Ga),this.Ga=NaN)};
g.h.Y=function(){this.stop();g.P.prototype.Y.call(this)};
g.h.sC=function(){this.Ga=NaN;this.o=g.Dp(f7(this.C,"/pairing/get_screen"),{method:"POST",yb:{pairing_code:this.A},timeout:5E3,onSuccess:(0,g.x)(this.eP,this),onError:(0,g.x)(this.dP,this),Hd:(0,g.x)(this.fP,this)})};
g.h.eP=function(a,b){this.o=null;var c=b.screen||{};c.dialId=this.B;c.name=this.w;this.R("pairingComplete",new e6(c))};
g.h.dP=function(a){this.o=null;a.status&&404==a.status?this.u>=xva.length?this.R("pairingFailed",Error("DIAL polling timed out")):(a=xva[this.u],this.Ga=g.Co((0,g.x)(this.sC,this),a),this.u++):this.R("pairingFailed",Error("Server error "+a.status))};
g.h.fP=function(){this.o=null;this.R("pairingFailed",Error("Server not responding"))};
var xva=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Na(p7,m7);g.h=p7.prototype;g.h.start=function(){o7(this)&&this.R("screenChange");!g.ks("yt-remote-lounge-token-expiration")&&sua(this);g.Eo(this.u);this.u=g.Co((0,g.x)(this.start,this),1E4)};
g.h.add=function(a,b){o7(this);pua(this,a);q7(this,!1);this.R("screenChange");b(a);a.token||sua(this)};
g.h.remove=function(a,b){var c=o7(this);rua(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.R("screenChange")};
g.h.cp=function(a,b,c,d){var e=o7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,q7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.R("screenChange")};
g.h.Y=function(){g.Eo(this.u);p7.Eb.Y.call(this)};
g.h.WE=function(a){o7(this);var b=this.o.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}q7(this,!b);b&&i7(this.F,"Missed "+b+" lounge tokens.")};
g.h.VE=function(a){i7(this.F,"Requesting lounge tokens failed: "+a)};g.r(s7,g.P);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.ks("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.H)()-144E5<a?0:a)?u7(this):(this.A=(0,g.H)()+3E5,g.js("yt-remote-fast-check-period",this.A),this.At())};
g.h.isEmpty=function(){return g.Vb(this.o)};
g.h.update=function(){r7("Updating availability on schedule.");var a=this.C(),b=g.Ib(this.o,function(c,d){return c&&!!k6(a,d)},this);
t7(this,b)};
g.h.Y=function(){g.Eo(this.w);this.w=NaN;this.u&&(this.u.abort(),this.u=null);g.P.prototype.Y.call(this)};
g.h.At=function(){g.Eo(this.w);this.w=NaN;this.u&&this.u.abort();var a=vua(this);if(a6(a)){var b=f7(this.B,"/pairing/get_screen_availability");this.u=g7(this.B,b,{lounge_token:g.Ob(a).join(",")},(0,g.x)(this.BM,this,a),(0,g.x)(this.AM,this))}else t7(this,{}),u7(this)};
g.h.BM=function(a,b){this.u=null;var c=g.Ob(vua(this));if(g.ob(c,g.Ob(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;t7(this,d);u7(this)}else this.Rb("Changing Screen set during request."),this.At()};
g.h.AM=function(a){this.Rb("Screen availability failed: "+a);this.u=null;u7(this)};
g.h.Rb=function(a){i7("OnlineScreenService",a)};g.Na(v7,m7);g.h=v7.prototype;g.h.start=function(){this.w.start();this.u.start();this.o.length&&(this.R("screenChange"),this.u.isEmpty()||this.R("onlineScreenChange"))};
g.h.add=function(a,b,c){this.w.add(a,b,c)};
g.h.remove=function(a,b,c){this.w.remove(a,b,c);this.u.update()};
g.h.cp=function(a,b,c,d){this.w.contains(a)?this.w.cp(a,b,c,d):(a="Updating name of unknown screen: "+a.name,i7(this.F,a),d(Error(a)))};
g.h.Xd=function(a){return a?this.o:g.bb(this.o,(0,g.Wd)(this.A,function(b){return!this.contains(b)},this))};
g.h.tC=function(){return(0,g.Wd)(this.Xd(!0),function(a){return!!this.u.o[a.id]},this)};
g.h.uC=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new n7(this.C,a,b,c);f.subscribe("pairingComplete",(0,g.x)(function(k){g.ie(f);d(w7(this,k))},this));
f.subscribe("pairingFailed",function(k){g.ie(f);e(k)});
f.start();return(0,g.x)(f.stop,f)};
g.h.hP=function(a,b,c,d){g.Dp(f7(this.C,"/pairing/get_screen"),{method:"POST",yb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new e6(f.screen||{});if(!k.name||zua(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);zua(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(w7(this,k))},this),
onError:(0,g.x)(function(e){d(Error("pairing request failed: "+e.status))},this),
Hd:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})};
g.h.Y=function(){g.ie(this.w);g.ie(this.u);v7.Eb.Y.call(this)};
g.h.eF=function(){Aua(this);this.R("screenChange");this.u.update()};
v7.prototype.dispose=v7.prototype.dispose;g.Na(y7,g.P);g.h=y7.prototype;g.h.xo=function(a){this.w=a;this.R("sessionScreen",this.w)};
g.h.ee=function(a){this.ka()||(a&&z7(this,""+a),this.w=null,this.R("sessionScreen",null))};
g.h.info=function(a){i7(this.O,a)};
g.h.wC=function(){return null};
g.h.Jt=function(a){var b=this.u;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.x)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.x)(function(){z7(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.h.Y=function(){this.Jt("");y7.Eb.Y.call(this)};g.Na(A7,y7);g.h=A7.prototype;g.h.It=function(a){if(this.o){if(this.o==a)return;z7(this,"Overriding cast sesison with new session object");this.o.removeUpdateListener(this.C);this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B)}this.o=a;this.o.addUpdateListener(this.C);this.o.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.B);Cua(this)};
g.h.Xi=function(a){this.info("launchWithParams no-op for Cast: "+g.Gk(a))};
g.h.stop=function(){this.o?this.o.stop((0,g.x)(function(){this.ee()},this),(0,g.x)(function(){this.ee(Error("Failed to stop receiver app."))},this)):this.ee(Error("Stopping cast device witout session."))};
g.h.Jt=g.Ca;g.h.Y=function(){this.info("disposeInternal");g.Eo(this.A);this.A=0;this.o&&(this.o.removeUpdateListener(this.C),this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B));this.o=null;A7.Eb.Y.call(this)};
g.h.wN=function(a,b){if(!this.ka())if(b){var c=N6(b);if(g.Ia(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Gk(c));switch(d){case "mdxSessionStatus":Bua(this,c.screenId);break;default:z7(this,"Unknown youtube message: "+d)}}else z7(this,"Unable to parse message.")}else z7(this,"No data in message.")};
g.h.Qw=function(a,b,c,d){yua(this.H,this.u.label,a,this.u.friendlyName,(0,g.x)(function(e){e?b(e):0<=d?(z7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Co((0,g.x)(this.Qw,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.wC=function(){return this.o};
g.h.iP=function(a){this.ka()||a||(z7(this,"Cast session died."),this.ee())};g.Na(B7,y7);g.h=B7.prototype;g.h.It=function(a){this.A=a;this.A.addUpdateListener(this.J)};
g.h.Xi=function(a){this.B=a;this.F()};
g.h.stop=function(){this.o();this.o=g.Ca;g.Eo(this.C);this.A?this.A.stop((0,g.x)(this.ee,this,null),(0,g.x)(this.ee,this,"Failed to stop DIAL device.")):this.ee()};
g.h.Y=function(){this.o();this.o=g.Ca;g.Eo(this.C);this.A&&this.A.removeUpdateListener(this.J);this.A=null;B7.Eb.Y.call(this)};
g.h.lP=function(a){this.ka()||a||(z7(this,"DIAL session died."),this.o(),this.o=g.Ca,this.ee())};
g.h.ar=function(a){this.M=i6();if(this.B){var b=new chrome.cast.DialLaunchResponse(!0,Eua(this));a(b);Dua(this)}else this.F=(0,g.x)(function(){g.Eo(this.C);this.F=g.Ca;this.C=NaN;var c=new chrome.cast.DialLaunchResponse(!0,Eua(this));a(c);Dua(this)},this),this.C=g.Co((0,g.x)(function(){this.F()},this),100)};
g.h.yF=function(a,b,c){yua(this.H,this.G.receiver.label,a,this.u.friendlyName,(0,g.x)(function(d){d&&d.token?(this.xo(d),b(new chrome.cast.DialLaunchResponse(!1))):this.ar(b,c)},this),(0,g.x)(function(d){z7(this,"Failed to get DIAL screen: "+d);
this.ar(b,c)},this))};g.Na(C7,y7);C7.prototype.stop=function(){this.ee()};
C7.prototype.It=g.Ca;C7.prototype.Xi=function(){g.Eo(this.o);this.o=NaN;var a=k6(this.H.Xd(),this.u.label);a?this.xo(a):this.ee(Error("No such screen"))};
C7.prototype.Y=function(){g.Eo(this.o);this.o=NaN;C7.Eb.Y.call(this)};g.Na(D7,g.P);g.h=D7.prototype;
g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.F);this.G||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,f=(0,g.x)(this.kM,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.qA,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.AK,this);chrome.cast.initialize(c,(0,g.x)(function(){this.ka()||
(chrome.cast.addReceiverActionListener(this.A),lua(),this.u.subscribe("onlineScreenChange",(0,g.x)(this.vC,this)),this.w=Gua(this),chrome.cast.setCustomReceivers(this.w,g.Ca,(0,g.x)(function(k){this.Rb("Failed to set initial custom receivers: "+g.Gk(k))},this)),this.R("yt-remote-cast2-availability-change",F7(this)),b(!0))},this),(0,g.x)(function(k){this.Rb("Failed to initialize API: "+g.Gk(k));
b(!1)},this))};
g.h.kO=function(a,b){E7("Setting connected screen ID: "+a+" -> "+b);if(this.o){var c=this.o.w;if(!a||c&&c.id!=a)E7("Unsetting old screen status: "+this.o.u.friendlyName),G7(this,null)}if(a&&b){if(!this.o){c=k6(this.u.Xd(),a);if(!c){E7("setConnectedScreenStatus: Unknown screen.");return}var d=Fua(this,c);d||(E7("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.w.push(d),chrome.cast.setCustomReceivers(this.w,
g.Ca,(0,g.x)(function(e){this.Rb("Failed to set initial custom receivers: "+g.Gk(e))},this)));
E7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);G7(this,new C7(this.u,d),!0)}this.o.Jt(b)}else E7("setConnectedScreenStatus: no screen.")};
g.h.lO=function(a){this.ka()?this.Rb("Setting connection data on disposed cast v2"):this.o?this.o.Xi(a):this.Rb("Setting connection data without a session")};
g.h.kP=function(){this.ka()?this.Rb("Stopping session on disposed cast v2"):this.o?(this.o.stop(),G7(this,null)):E7("Stopping non-existing session")};
g.h.requestSession=function(){chrome.cast.requestSession((0,g.x)(this.qA,this),(0,g.x)(this.FM,this))};
g.h.Y=function(){this.u.unsubscribe("onlineScreenChange",(0,g.x)(this.vC,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);var a=iua,b=g.w("yt.mdx.remote.debug.handlers_");g.Za(b||[],a);g.ie(this.o);D7.Eb.Y.call(this)};
g.h.Rb=function(a){i7("Controller",a)};
g.h.rA=function(a,b){this.o==a&&(b||G7(this,null),this.R("yt-remote-cast2-session-change",b))};
g.h.gM=function(a,b){if(!this.ka())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),E7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.o)if(this.o.u.label!=a.label)E7("onReceiverAction_: Stopping active receiver: "+this.o.u.friendlyName),this.o.stop();else{E7("onReceiverAction_: Casting to active receiver.");this.o.w&&this.R("yt-remote-cast2-session-change",this.o.w);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:G7(this,
new C7(this.u,a));break;case chrome.cast.ReceiverType.DIAL:G7(this,new B7(this.u,a,this.C));break;case chrome.cast.ReceiverType.CAST:G7(this,new A7(this.u,a));break;default:this.Rb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.o&&this.o.u.label==a.label?this.o.stop():this.Rb("Stopping receiver w/o session: "+a.friendlyName)}else this.Rb("onReceiverAction_ called without receiver.")};
g.h.AK=function(a){if(this.ka())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Rb("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.o?this.o.u:null;if(!c||c.label!=b.label)return this.Rb("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.o.w)return E7("Reselecting dial screen."),
this.R("yt-remote-cast2-session-change",this.o.w),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Rb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);G7(this,new B7(this.u,b,this.C))}b=this.o;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.x)(b.yF,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.x)(b.ar,b))};
g.h.qA=function(a){if(!this.ka()){E7("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.o)if(b.receiverType==chrome.cast.ReceiverType.CAST)E7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),G7(this,new A7(this.u,b),!0);else{this.Rb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.o.u,d=k6(this.u.Xd(),c.label);d&&f6(d,b.label)&&
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(E7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.ie(this.o),this.o=new A7(this.u,b),this.o.subscribe("sessionScreen",(0,g.x)(this.rA,this,this.o)),this.o.Xi(null));this.o.It(a)}}};
g.h.jP=function(){return this.o?this.o.wC():null};
g.h.FM=function(a){this.ka()||(this.Rb("Failed to estabilish a session: "+g.Gk(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&G7(this,null))};
g.h.kM=function(a){E7("Receiver availability updated: "+a);if(!this.ka()){var b=F7(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;F7(this)!=b&&this.R("yt-remote-cast2-availability-change",F7(this))}};
g.h.vC=function(){this.ka()||(this.w=Gua(this),E7("Updating custom receivers: "+g.Gk(this.w)),chrome.cast.setCustomReceivers(this.w,g.Ca,(0,g.x)(function(){this.Rb("Failed to set custom receivers.")},this)),this.R("yt-remote-cast2-availability-change",F7(this)))};
D7.prototype.setLaunchParams=D7.prototype.lO;D7.prototype.setConnectedScreenStatus=D7.prototype.kO;D7.prototype.stopSession=D7.prototype.kP;D7.prototype.getCastSession=D7.prototype.jP;D7.prototype.requestSession=D7.prototype.requestSession;D7.prototype.init=D7.prototype.init;D7.prototype.dispose=D7.prototype.dispose;var M7=[];R7.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";S7(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.o=a.trackData,this.ff=a.hasPrevious,this.hasNext=a.hasNext,this.F=a.playerTime,this.C=a.playerTimeAt,this.A=a.seekableStart,this.u=a.seekableEnd,this.G=a.duration,this.H=a.loadedTime,this.w=a.liveIngestionTime,this.B=
!isNaN(this.w))};
R7.prototype.isAdPlaying=function(){return 1081==this.playerState};
R7.prototype.getDuration=function(){return this.B?this.G+T7(this):this.G};
R7.prototype.clone=function(){return new R7(X7(this))};g.r(Z7,g.P);g.h=Z7.prototype;g.h.play=function(){1==this.o?(this.u?this.u.play(null,g.Ca,e8(this,"play")):d8(this,"play"),c8(this,1,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.play)};
g.h.pause=function(){1==this.o?(this.u?this.u.pause(null,g.Ca,e8(this,"pause")):d8(this,"pause"),c8(this,2,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.pause)};
g.h.seekTo=function(a){if(1==this.o){if(this.u){var b=$7(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.playerState||3==b.playerState?chrome.cast.media.ResumeState.PLAYBACK_START:chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.u.seek(c,g.Ca,e8(this,"seekTo",{newTime:a}))}else d8(this,"seekTo",{newTime:a});c8(this,3,a);this.R("remotePlayerChange")}else a8(this,g.La(this.seekTo,a))};
g.h.stop=function(){if(1==this.o){this.u?this.u.stop(null,g.Ca,e8(this,"stopVideo")):d8(this,"stopVideo");var a=$7(this);a.index=-1;a.videoId="";S7(a);b8(this,a);this.R("remotePlayerChange")}else a8(this,this.stop)};
g.h.setVolume=function(a,b){if(1==this.o){var c=$7(this);if(this.w){if(c.volume!=a){var d=Math.round(a)/100;this.w.setReceiverVolumeLevel(d,(0,g.x)(function(){i7("CP","set receiver volume: "+d)},this),(0,g.x)(function(){this.Rb("failed to set receiver volume.")},this))}c.muted!=b&&this.w.setReceiverMuted(b,(0,g.x)(function(){i7("CP","set receiver muted: "+b)},this),(0,g.x)(function(){this.Rb("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);d8(this,"setVolume",e)}c.muted=b;c.volume=a;b8(this,c)}else a8(this,g.La(this.setVolume,a,b))};
g.h.rB=function(a,b){if(1==this.o){var c=$7(this),d={videoId:a};b&&(c.o={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Gk(b.style),g.ac(d,c.o));d8(this,"setSubtitlesTrack",d);b8(this,c)}else a8(this,g.La(this.rB,a,b))};
g.h.setAudioTrack=function(a,b){if(1==this.o){var c=b.getLanguageInfo().getId();d8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=$7(this);d.audioTrackId=c;b8(this,d)}else a8(this,g.La(this.setAudioTrack,a,b))};
g.h.playVideo=function(a,b,c,d,e,f,k){var l=$7(this);c=c||0;var m={videoId:a,currentIndex:c};W7(l,a,c);void 0!==b&&(U7(l,b),m.currentTime=b);void 0!==d&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.Gk(k));d8(this,"setPlaylist",m);d||b8(this,l)};
g.h.rC=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"previous")}else a8(this,g.La(this.rC,a,b))};
g.h.nextVideo=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"next")}else a8(this,g.La(this.nextVideo,a,b))};
g.h.Zv=function(){1==this.o?d8(this,"dismissAutoplay"):a8(this,this.Zv)};
g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.R("proxyStateChange",a,this.o)}g.P.prototype.dispose.call(this)};
g.h.Y=function(){Tua(this);this.A=null;this.B.clear();Y7(this,null);g.P.prototype.Y.call(this)};
g.h.pu=function(a){if((a!=this.o||2==a)&&3!=this.o&&0!=a){var b=this.o;this.o=a;this.R("proxyStateChange",b,a);if(1==a)for(;!this.B.isEmpty();)b=a=this.B,g.Wa(b.o)&&(b.o=b.u,b.o.reverse(),b.u=[]),a.o.pop().apply(this);else 3==a&&this.dispose()}};
g.h.dM=function(a,b){this.R(a,b)};
g.h.hK=function(a){if(!a)this.ll(null),Y7(this,null);else if(this.w.receiver.volume){a=this.w.receiver.volume;var b=$7(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)i7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,b8(this,b)}};
g.h.ll=function(a){i7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.G);if(this.u=a)this.u.addUpdateListener(this.G),Uua(this),this.R("remotePlayerChange")};
g.h.gK=function(a){a?(Uua(this),this.R("remotePlayerChange")):this.ll(null)};
g.h.sK=function(){var a=Qua();a&&Y7(this,a)};
g.h.Rb=function(a){i7("CP",a)};g.r(f8,g.P);g.h=f8.prototype;
g.h.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,k=b.index,l={videoId:d},m=b.currentTime,n=b.locationInfo;void 0!==m&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);void 0!==k&&(l.currentIndex=k);c&&(this.Sa.listId=c);this.Sa.videoId=d;this.Sa.index=k||0;this.Sa.state=3;U7(this.Sa,m);this.A="UNSUPPORTED";g8("Connecting with setPlaylist and params: "+g.Gk(l));this.o.connect({method:"setPlaylist",
params:g.Gk(l)},a,gta())}else g8("Connecting without params"),this.o.connect({},a,gta());Wua(this)};
g.h.dispose=function(){this.ka()||(this.R("beforeDispose"),h8(this,3));g.P.prototype.dispose.call(this)};
g.h.Y=function(){i8(this);k8(this);j8(this);g.Eo(this.F);this.F=NaN;g.Eo(this.G);this.G=NaN;this.w=null;g.zq(this.O);this.O.length=0;this.o.dispose();g.P.prototype.Y.call(this);this.A=this.C=this.u=this.Sa=this.o=null};
g.h.PE=function(){this.Ci(2)};
g.h.lK=function(){g8("Channel opened");this.J&&(this.J=!1,j8(this),this.M=g.Co((0,g.x)(function(){g8("Timing out waiting for a screen.");this.Ci(1)},this),15E3));
kta(fua(this.o),this.S)};
g.h.iK=function(){g8("Channel closed");isNaN(this.B)?q6(!0):q6();this.dispose()};
g.h.jK=function(a){q6();isNaN(this.kk())?(g8("Channel error: "+a+" without reconnection"),this.dispose()):(this.J=!0,g8("Channel error: "+a+" with reconnection in "+this.kk()+" ms"),h8(this,2))};
g.h.kK=function(a){a.params?g8("Received: action="+a.action+", params="+g.Gk(a.params)):g8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=N6(a.params.devices);this.u=(0,g.Fc)(a,function(c){return new d6(c)});
a=!!g.Sa(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
Zua(this,a);break;case "loungeScreenDisconnected":g.$a(this.u,function(c){return"LOUNGE_SCREEN"==c.type});
Zua(this,!1);break;case "remoteConnected":var b=new d6(N6(a.params.device));g.Sa(this.u,function(c){return b?c.id==b.id:!1})||Rsa(this.u,b);
break;case "remoteDisconnected":b=new d6(N6(a.params.device));g.$a(this.u,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":ava(this,a);break;case "nowPlaying":cva(this,a);break;case "onStateChange":bva(this,a);break;case "onAdStateChange":dva(this,a);break;case "onVolumeChanged":eva(this,a);break;case "onSubtitlesTrackChanged":$ua(this,a);break;case "nowAutoplaying":fva(this,a);break;case "autoplayDismissed":this.R("autoplayDismissed");break;case "autoplayUpNext":this.C=a.params.videoId||null;this.R("autoplayUpNext",this.C);break;case "onAutoplayModeChanged":this.A=
a.params.autoplayMode;this.R("autoplayModeChange",this.A);"DISABLED"==this.A&&this.R("autoplayDismissed");break;case "onHasPreviousNextChanged":gva(this,a);break;case "requestAssistedSignIn":this.R("assistedSignInRequested",a.params.authCode);break;default:g8("Unrecognized action: "+a.action)}};
g.h.YN=function(){if(this.w){var a=this.w;this.w=null;this.Sa.videoId!=a&&l8(this,"getNowPlaying")}};
g.h.EE=function(){var a=3;this.ka()||(a=0,isNaN(this.kk())?d7(this.o)&&isNaN(this.B)&&(a=1):a=2);return a};
g.h.Ci=function(a){g8("Disconnecting with "+a);i8(this);this.R("beforeDisconnect",a);1==a&&q6();gua(this.o,a);this.dispose()};
g.h.DE=function(){var a=this.Sa;this.w&&(a=this.Sa.clone(),W7(a,this.w,a.index));return X7(a)};
g.h.mO=function(a){var b=new R7(a);b.videoId&&b.videoId!=this.Sa.videoId&&(this.w=b.videoId,g.Eo(this.F),this.F=g.Co((0,g.x)(this.YN,this),5E3));var c=[];this.Sa.listId==b.listId&&this.Sa.videoId==b.videoId&&this.Sa.index==b.index||c.push("remoteQueueChange");this.Sa.playerState==b.playerState&&this.Sa.volume==b.volume&&this.Sa.muted==b.muted&&V7(this.Sa)==V7(b)&&g.Gk(this.Sa.o)==g.Gk(b.o)||c.push("remotePlayerChange");this.Sa.reset(a);(0,g.y)(c,function(d){this.R(d)},this)};
g.h.Ow=function(){var a=this.o.C.id,b=g.Sa(this.u,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.h.kk=function(){var a=this.o;return a.u.isActive()?a.u.u-(0,g.H)():NaN};
g.h.sE=function(){return this.A||"UNSUPPORTED"};
g.h.tE=function(){return this.C||""};
g.h.cP=function(){if(!isNaN(this.kk())){var a=this.o.u;g.wn(a.o);a.start()}};
g.h.hO=function(a,b){l8(this,a,b);Yua(this)};
f8.prototype.subscribe=f8.prototype.subscribe;f8.prototype.unsubscribeByKey=f8.prototype.gg;f8.prototype.getProxyState=f8.prototype.EE;f8.prototype.disconnect=f8.prototype.Ci;f8.prototype.getPlayerContextData=f8.prototype.DE;f8.prototype.setPlayerContextData=f8.prototype.mO;f8.prototype.getOtherConnectedRemoteId=f8.prototype.Ow;f8.prototype.getReconnectTimeout=f8.prototype.kk;f8.prototype.getAutoplayMode=f8.prototype.sE;f8.prototype.getAutoplayVideoId=f8.prototype.tE;f8.prototype.reconnect=f8.prototype.cP;
f8.prototype.sendMessage=f8.prototype.hO;g.r(m8,m7);g.h=m8.prototype;g.h.Xd=function(a){return this.kd.$_gs(a)};
g.h.contains=function(a){return!!this.kd.$_c(a)};
g.h.get=function(a){return this.kd.$_g(a)};
g.h.start=function(){this.kd.$_st()};
g.h.add=function(a,b,c){this.kd.$_a(a,b,c)};
g.h.remove=function(a,b,c){this.kd.$_r(a,b,c)};
g.h.cp=function(a,b,c,d){this.kd.$_un(a,b,c,d)};
g.h.Y=function(){for(var a=0,b=this.u.length;a<b;++a)this.kd.$_ubk(this.u[a]);this.u.length=0;this.kd=null;m7.prototype.Y.call(this)};
g.h.gP=function(){this.R("screenChange")};
g.h.IL=function(){this.R("onlineScreenChange")};
v7.prototype.$_st=v7.prototype.start;v7.prototype.$_gspc=v7.prototype.hP;v7.prototype.$_gsppc=v7.prototype.uC;v7.prototype.$_c=v7.prototype.contains;v7.prototype.$_g=v7.prototype.get;v7.prototype.$_a=v7.prototype.add;v7.prototype.$_un=v7.prototype.cp;v7.prototype.$_r=v7.prototype.remove;v7.prototype.$_gs=v7.prototype.Xd;v7.prototype.$_gos=v7.prototype.tC;v7.prototype.$_s=v7.prototype.subscribe;v7.prototype.$_ubk=v7.prototype.gg;var F8=null,E8=!1,n8=null,o8=null,D8=null,s8=[];g.r(G8,g.A);g.h=G8.prototype;
g.h.Y=function(){g.A.prototype.Y.call(this);this.A.stop();this.C.stop();this.J.stop();this.V();this.o.unsubscribe("proxyStateChange",this.nA,this);this.o.unsubscribe("remotePlayerChange",this.pl,this);this.o.unsubscribe("remoteQueueChange",this.yo,this);this.o.unsubscribe("autoplayUpNext",this.Oz,this);this.o.unsubscribe("previousNextChange",this.kA,this);this.o.unsubscribe("nowAutoplaying",this.gA,this);this.o.unsubscribe("autoplayDismissed",this.Nz,this);this.o=this.B=null};
g.h.Ny=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.o.o)if(J8(this)){if(!$7(this.o).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==$7(this.o).playerState?this.o.pause():this.o.play();break;case "control_play":this.o.play();break;case "control_pause":this.o.pause();break;case "control_seek":this.M.Xw(c[0],c[1]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId,
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.u.getCurrentTime();L8(this,0==c?void 0:c);break;case "control_seek":L8(this,c[0]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId,c)}};
g.h.fK=function(a){this.J.LE(a)};
g.h.IO=function(a){this.Ny("control_subtitles_set_track",g.Vb(a)?null:a)};
g.h.GB=function(){var a=this.u.getOption("captions","track");g.Vb(a)||K8(this,a)};
g.h.Yz=function(a){if(J8(this)){this.o.unsubscribe("remotePlayerChange",this.pl,this);var b=Math.round(a.volume);a=!!a.muted;var c=$7(this.o);if(b!=c.volume||a!=c.muted)this.o.setVolume(b,a),this.O.start();this.o.subscribe("remotePlayerChange",this.pl,this)}};
g.h.eL=function(){g.Vb(this.F)||sva(this,this.F);this.G=!1};
g.h.nA=function(a,b){this.C.stop();2==b&&this.DB()};
g.h.pl=function(){if(J8(this)){this.A.stop();var a=$7(this.o);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.B.H=1;break;case 1082:case 1083:this.B.H=0;break;default:this.B.H=-1}switch(a.playerState){case 1081:case 1:I8(this,new g.iD(8));this.CB();break;case 1085:case 3:I8(this,new g.iD(9));break;case 1083:case 0:I8(this,new g.iD(2));this.M.stop();H8(this,this.u.getVideoData().lengthSeconds);break;case 1084:I8(this,new g.iD(4));break;case 2:I8(this,new g.iD(4));H8(this,V7(a));
break;case -1:I8(this,new g.iD(64));break;case -1E3:I8(this,new g.iD(128,{errorCode:"mdx.remoteerror",errorMessage:"This video is not available for remote playback."}))}a=$7(this.o).o;var b=this.F;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.F=a,sva(this,a));a=$7(this.o);-1==a.volume||Math.round(this.u.getVolume())==a.volume&&this.u.isMuted()==a.muted||this.O.isActive()||this.hC()}else rva(this)};
g.h.kA=function(){this.u.R("mdxpreviousnextchange")};
g.h.yo=function(){J8(this)||rva(this)};
g.h.HD=function(){this.o.Zv()};
g.h.Oz=function(){};
g.h.gA=function(a){isNaN(a)||this.u.R("mdxnowautoplaying",a)};
g.h.Nz=function(){this.u.R("mdxautoplaycanceled")};
g.h.HH=function(a,b){-1==$7(this.o).playerState?L8(this,a):b&&this.o.seekTo(a)};
g.h.hC=function(){if(J8(this)){var a=$7(this.o);this.w.Xa(this.S);a.muted?this.u.mute():this.u.unMute();this.u.setVolume(a.volume);this.S=this.w.L(this.u,"onVolumeChange",this.Yz)}};
g.h.CB=function(){this.A.stop();if(!this.o.ka()){var a=$7(this.o);1==a.playerState&&I8(this,new g.iD(8));H8(this,V7(a));this.A.start()}};
g.h.DB=function(){this.C.stop();this.A.stop();var a=this.o.A.getReconnectTimeout();2==this.o.o&&!isNaN(a)&&this.C.start()};g.r(M8,g.U);M8.prototype.w=function(){c6("mdx-privacy-popup-cancel");this.u.hide()};
M8.prototype.B=function(){c6("mdx-privacy-popup-confirm");this.u.hide()};g.r(N8,g.U);N8.prototype.A=function(a){uva(this,a.state)};g.r(O8,g.jO);O8.prototype.J=function(){var a=this.u.getOption("remote","receivers");a&&1<a.length&&!this.u.getOption("remote","quickCast")?(this.C=g.qb(a,this.B,this),g.lO(this,(0,g.Fc)(a,this.B)),a=this.u.getOption("remote","currentReceiver"),this.ye(this.B(a)),this.enable(!0)):this.enable(!1)};
O8.prototype.B=function(a){return a.key};
O8.prototype.Ne=function(a){return"cast-selector-receiver"==a?"Cast...":this.C[a].name};
O8.prototype.Wc=function(a){g.jO.prototype.Wc.call(this,a);this.u.setOption("remote","currentReceiver",this.C[a]);this.w.gb()};g.r(P8,g.sP);g.h=P8.prototype;
g.h.create=function(){lva(g.vx(this.player.P()));this.A.push(g.Jo("yt-remote-before-disconnect",this.cK,this));this.A.push(g.Jo("yt-remote-connection-change",this.lM,this));this.A.push(g.Jo("yt-remote-receiver-availability-change",this.lA,this));this.A.push(g.Jo("yt-remote-auto-connect",this.jM,this));this.A.push(g.Jo("yt-remote-receiver-resumed",this.iM,this));this.A.push(g.Jo("mdx-privacy-popup-confirm",this.KN,this));this.A.push(g.Jo("mdx-privacy-popup-cancel",this.JN,this));this.lA()};
g.h.load=function(){this.player.cancelPlayback();g.sP.prototype.load.call(this);this.B=new G8(this,this.player,this.o);var a=(a=qva())?a.currentTime:0;var b=C8()?new Z7(x8(),void 0):null;0==a&&b&&(a=V7($7(b)));0!=a&&(this.O=a||0,this.player.R("progresssync",a,void 0));tva(this,this.F,this.F);g.ZS(this.player.app,6)};
g.h.unload=function(){this.player.R("mdxautoplaycanceled");this.w=this.u;g.je(this.B,this.o);this.o=this.B=null;g.sP.prototype.unload.call(this);g.ZS(this.player.app,5);Q8(this)};
g.h.Y=function(){g.Ko(this.A);g.sP.prototype.Y.call(this)};
g.h.Wk=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.Ny.apply(this.B,[a].concat(g.ea(c)))};
g.h.getAdState=function(){return this.H};
g.h.GE=function(){return this.loaded?this.B.suggestion:null};
g.h.ff=function(){return this.o?$7(this.o).ff:!1};
g.h.hasNext=function(){return this.o?$7(this.o).hasNext:!1};
g.h.getCurrentTime=function(){return this.O};
g.h.getProgressState=function(){var a=$7(this.o),b=this.player.getVideoData();return{allowSeeking:g.Q(this.player.P().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.Nc():!a.isAdPlaying()&&this.player.Nc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.w+T7(a):a.w,isAtLiveHead:1>=(a.B?a.u+T7(a):a.u)-this.getCurrentTime(),loaded:a.H,seekableEnd:a.B?a.u+T7(a):a.u,seekableStart:0<a.A?a.A+T7(a):
a.A}};
g.h.nextVideo=function(){this.o&&this.o.nextVideo()};
g.h.nH=function(){this.o&&this.o.rC()};
g.h.cK=function(a){1==a&&(this.S=this.o?$7(this.o):null)};
g.h.lM=function(){var a=C8()?new Z7(x8(),void 0):null;if(a){var b=this.w;this.loaded&&this.unload();this.o=a;this.S=null;b.key!=this.u.key&&(this.w=b,this.load())}else g.ie(this.o),this.o=null,this.loaded&&(this.unload(),(a=this.S)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,V7(a)));this.player.R("videodatachange","newdata",this.player.getVideoData(),3)};
g.h.lA=function(){this.M=[this.u].concat(nva());var a=y8()||this.u;R8(this,a);this.player.la("onMdxReceiversChange")};
g.h.BN=function(a){!this.J&&g.wD(a,8)&&(this.player.pauseVideo(),Q8(this))};
g.h.jM=function(){var a=y8();R8(this,a)};
g.h.iM=function(){this.w=y8()};
g.h.KN=function(){this.J=!0;Q8(this);E8=!1;F8&&A8(F8,1);F8=null};
g.h.JN=function(){this.J=!1;Q8(this);R8(this,this.u);this.w=this.u;E8=!1;F8=null;this.player.playVideo()};
g.h.Ic=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.M;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?P7():R8(this,b)),this.loaded?this.w:this.u;case "quickCast":return 2==this.M.length&&"cast-selector-receiver"==this.M[1].key?(b&&P7(),!0):!1}};
g.h.oH=function(){d8(this.o,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.xf=function(){return!1};
g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.HP.remote=P8;})(_yt_player);
