(function(g){var window=this;var aka=function(a,b){return g.ic(a,b)},m4=function(){},bka=function(a){if(a.qc&&"function"==typeof a.qc)return a.qc();
if(g.v(a))return a.split("");if(g.Da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.ec(a)},cka=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.Da(a)||g.v(a))(0,g.C)(a,b,void 0);else{if(a.od&&"function"==typeof a.od)var c=a.od();else if(a.qc&&"function"==typeof a.qc)c=void 0;else if(g.Da(a)||g.v(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.fc(a);d=bka(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},n4=function(a){g.Ro(a,"zx",g.Ob());
return a},o4=function(a,b,c){g.Ca(c)||(c=[String(c)]);
g.Xo(a.o,b,c)},p4=function(a){if(!a.l&&"undefined"==typeof window.XMLHttpRequest&&"undefined"!=typeof window.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 window.ActiveXObject(d),a.l=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.l},q4=function(a){var b;
(b=a.g)||(b={},p4(a)&&(b[0]=!0,b[1]=!0),b=a.g=b);return b},r4=function(a){return(a=p4(a))?new window.ActiveXObject(a):new window.XMLHttpRequest},s4=function(a,b){return b+" ["+a.X+" "+a.I+" "+a.getStatus()+"]"},dka=function(a){return"content-type"==a.toLowerCase()},t4=function(a){a.g&&a.L&&(a.g.ontimeout=null);
a.F&&(g.x.clearTimeout(a.F),a.F=null)},eka=function(a){return g.Kd&&g.Fc(9)&&g.va(a.timeout)&&g.t(a.ontimeout)},u4=function(a){a.T||(a.T=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},v4=function(a,b){if(a.g){t4(a);
var c=a.g,d=a.N[0]?g.za:null;a.g=null;a.N=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},w4=function(a,b){a.l=!1;
a.g&&(a.o=!0,a.g.abort(),a.o=!1);a.B=b;a.A=5;u4(a);v4(a)},x4=function(a){return a.g?a.g.readyState:0},y4=function(a){if(a.l&&"undefined"!=typeof g.yW)if(a.N[1]&&4==x4(a)&&2==a.getStatus())s4(a,"Local request error detected and ignored");
else if(a.G&&4==x4(a))g.Cg(a.qt,0,a);else if(a.dispatchEvent("readystatechange"),4==x4(a)){s4(a,"Request complete");a.l=!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.Ug(String(a.I))[1]||null;if(!f&&g.x.self&&g.x.self.location){var k=g.x.self.location.protocol;f=k.substr(0,k.length-1)}e=!fka.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{a.A=6;try{var l=2<x4(a)?a.g.statusText:""}catch(m){l=""}a.B=l+" ["+a.getStatus()+"]";u4(a)}}finally{v4(a)}}},z4=function(a){g.Ff.call(this);
this.headers=new g.Eo;this.R=a||null;this.l=!1;this.N=this.g=null;this.X=this.I="";this.A=0;this.B="";this.o=this.Y=this.G=this.T=!1;this.C=0;this.F=null;this.ea="";this.L=this.Z=!1},A4=function(a){try{return a.g?a.g.responseText:""}catch(b){return""}},gka=function(a,b){var c=[];
g.tl(b,function(a){try{var b=g.Tq.prototype.l.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.t(b)?g.Sq(b)&&c.push(a):c.push(a)},a);
return c},hka=function(a,b){var c=gka(a,b);
(0,g.C)(c,function(a){g.Tq.prototype.remove.call(this,a)},a)},B4=function(a){if(a.Lc){if(a.Lc.locationOverrideToken)return{locationOverrideToken:a.Lc.locationOverrideToken};
if(null!=a.Lc.latitudeE7&&null!=a.Lc.longitudeE7)return{latitudeE7:a.Lc.latitudeE7,longitudeE7:a.Lc.longitudeE7}}return null},ika=function(a,b,c,d){var e=new g.Ho(null,void 0);
a&&g.Io(e,a);b&&g.Jo(e,b);c&&g.Ko(e,c);d&&(e.l=d);return e},C4=function(){this.g=[];
this.l=[]},D4=function(a){g.Tt[a]&&(a=g.Tt[a],(0,g.C)(a,function(a){g.Rt[a]&&delete g.Rt[a]}),a.length=0)},jka=function(a){var b=g.Qt();
if(b)if(b.clear(a),a)D4(a);else for(var c in g.Tt)D4(c)},E4=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.o=!1;this.capabilities=new window.Set;this.experiments=new window.Set;this.theme="u";new g.Eo;this.g=this.l="";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",kka(this,a.capabilities||""),lka(this,a.experiments||""),this.l=a.remoteControllerUrl||"",
this.g=a.localChannelEncryptionKey||"")},kka=function(a,b){a.capabilities.clear();
(0,g.$d)(b.split(","),g.La(aka,mka)).forEach(function(b){a.capabilities.add(b)})},lka=function(a,b){a.experiments.clear();
b.split(",").forEach(function(b){a.experiments.add(b)})},F4=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||""},G4=function(a,b){return!!b&&(a.id==b||a.uuid==b)},H4=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},nka=function(a){return new F4(a)},I4=function(a){return g.Ca(a)?(0,g.E)(a,nka):[]},J4=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"},K4=function(a){return g.Ca(a)?"["+(0,g.E)(a,J4).join(",")+"]":"null"},L4=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)})},oka=function(a){return(0,g.E)(a,function(a){return{key:a.id,
name:a.name}})},M4=function(a,b){return g.Ra(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})},N4=function(a,b){return g.Ra(a,function(a){return G4(a,b)})},pka=function(){var a=(0,g.Nu)();
a&&hka(a,a.g.Pe(!0))},O4=function(){var a=g.Qu("yt-remote-connected-devices")||[];
g.ob(a);return a},qka=function(a){if(0==a.length)return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.E)(a,function(a,b){return 0==b?a:a.substring(c.length)})},P4=function(a){g.Pu("yt-remote-connected-devices",a,86400)},R4=function(){if(Q4)return Q4;
var a=g.Qu("yt-remote-device-id");a||(a=L4(),g.Pu("yt-remote-device-id",a,31536E3));for(var b=O4(),c=1,d=a;g.Va(b,d);)c++,d=a+"#"+c;return Q4=d},S4=function(){var a=O4(),b=R4();
g.Va(a,b);g.Su()&&g.tb(a,b);a=qka(a);if(0==a.length)try{g.zu("remote_sid")}catch(c){}else try{g.yu("remote_sid",a.join(","),-1)}catch(c){}},T4=function(){return g.Qu("yt-remote-session-browser-channel")},U4=function(){return g.Qu("yt-remote-local-screens")||[]},V4=function(){g.Pu("yt-remote-lounge-token-expiration",!0,86400)},rka=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=(0,g.E)(U4(),function(a){return a.loungeToken}),c=(0,g.E)(a,function(a){return a.loungeToken});
(0,g.jo)(c,function(a){return!g.Va(b,a)})&&V4();
g.Pu("yt-remote-local-screens",a,31536E3)},ska=function(a,b){g.Pu("yt-remote-session-browser-channel",a);
g.Pu("yt-remote-session-screen-id",b);var c=O4(),d=R4();g.Va(c,d)||c.push(d);P4(c);S4()},W4=function(a){a||(g.Ru("yt-remote-session-screen-id"),g.Ru("yt-remote-session-video-id"));
S4();a=O4();g.Za(a,R4());P4(a)},Y4=function(){if(!X4){var a=g.er();
a&&(X4=new g.Nq(a))}return X4?!!X4.get("yt-remote-use-staging-server"):!1},tka=function(){var a=window.document.createElement("a");
g.ld(a,"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js");a=a.href.replace(/^[a-zA-Z]+:\/\//,"//");return"js-"+g.Sb(a)},uka=function(a,b){var c=g.Td("SCRIPT");
c.id=a;c.onload=function(){b&&(0,window.setTimeout)(b,0)};
c.onreadystatechange=function(){switch(c.readyState){case "loaded":case "complete":c.onload()}};
g.md(c,g.pe("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"));var d=window.document.getElementsByTagName("head")[0]||window.document.body;d.insertBefore(c,d.firstChild);return c},vka=function(){var a=tka(),b=window.document.getElementById(a),c=b&&g.dt(b,"loaded");
c||b&&!c||(b=uka(a,function(){g.dt(b,"loaded")||(g.ct(b,"loaded","true"),g.Xt(a),g.Vr(g.La(jka,a),0))}))},Z4=function(a){return!!window.document.currentScript&&(-1!=window.document.currentScript.src.indexOf("?"+a)||-1!=window.document.currentScript.src.indexOf("&"+a))},$4=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},b5=function(a){a.length?a5(a.shift(),function(){b5(a)}):c5()},wka=function(a){return"chrome-extension://"+a+d5},a5=function(a,b,
c){var d=window.document.createElement("script");
d.onerror=b;c&&(d.onload=c);d.src=a;(window.document.head||window.document.documentElement).appendChild(d)},e5=function(a){return 0<=window.navigator.userAgent.indexOf(a)},c5=function(){var a=$4();
a&&a(!1,"No cast extension found")},f5=function(){if(xka){var a=2,b=$4(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;a5("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",c5,c)}},yka=function(){var a=window.__gCrWeb&&window.__gCrWeb.message&&window.__gCrWeb.message.invokeOnHost;
a&&(f5(),a({command:"cast.sender.init"}))},zka=function(){f5();
var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);b5(["//www.gstatic.com/eureka/clank/"+(a?(0,window.parseInt)(a[1],10):0)+d5,"//www.gstatic.com/eureka/clank"+d5])},g5=function(a,b,c){g.G.call(this);
this.C=null!=c?(0,g.A)(a,c):a;this.Gc=b;this.B=(0,g.A)(this.YA,this);this.g=!1;this.l=0;this.o=this.Aa=null;this.A=[]},h5=function(){},i5=function(a,b,c,d){this.g=a;
this.o=b;this.F=c;this.C=d||1;this.A=45E3;this.ba=new g.Yo(this);this.l=new g.Bg;this.l.setInterval(250)},k5=function(a,b,c){a.yh=1;
a.Mf=n4(b.clone());a.Sg=c;a.B=!0;j5(a,null)},l5=function(a,b,c,d,e){a.yh=1;
a.Mf=n4(b.clone());a.Sg=null;a.B=c;e&&(a.Lx=!1);j5(a,d)},j5=function(a,b){a.di=(0,g.D)();
m5(a);a.cg=a.Mf.clone();o4(a.cg,"t",a.C);a.Tj=0;a.fc=a.g.En(a.g.Jj()?b:null);0<a.fo&&(a.fm=new g.tm((0,g.A)(a.Wy,a,a.fc),a.fo));a.ba.da(a.fc,"readystatechange",a.NK);var c=a.xg?g.qc(a.xg):{};a.Sg?(a.Mm="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.fc.send(a.cg,a.Mm,a.Sg,c)):(a.Mm="GET",a.Lx&&!g.Md&&(c.Connection="close"),a.fc.send(a.cg,a.Mm,null,c));a.g.fe(1)},t5=function(a,b,c){for(var d=!0;!a.og&&a.Tj<c.length;){var e=Aka(a,c);
if(e==n5){4==b&&(a.Nf=4,o5(15),d=!1);break}else if(e==p5){a.Nf=4;o5(16);d=!1;break}else q5(a,e)}4==b&&0==c.length&&(a.Nf=1,o5(17),d=!1);a.je=a.je&&d;d||(r5(a),s5(a))},Aka=function(a,b){var c=a.Tj,d=b.indexOf("\n",c);
if(-1==d)return n5;c=Number(b.substring(c,d));if((0,window.isNaN)(c))return p5;d+=1;if(d+c>b.length)return n5;var e=b.substr(d,c);a.Tj=d+c;return e},w5=function(a,b){a.di=(0,g.D)();
m5(a);var c=b?window.location.hostname:"";a.cg=a.Mf.clone();g.Ro(a.cg,"DOMAIN",c);g.Ro(a.cg,"t",a.C);try{a.ke=new window.ActiveXObject("htmlfile")}catch(n){r5(a);a.Nf=7;o5(22);s5(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 u5)k=u5[l];else if(l in v5)k=u5[l]=v5[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=
u5[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}d+="</body></html>";c=g.nd(g.Lc("b/12014412"),d);a.ke.open();a.ke.write(g.hd(c));a.ke.close();a.ke.parentWindow.m=(0,g.A)(a.hK,a);a.ke.parentWindow.d=(0,g.A)(a.Rw,a,!0);a.ke.parentWindow.rpcClose=(0,g.A)(a.Rw,a,!1);c=a.ke.createElement("DIV");a.ke.parentWindow.document.body.appendChild(c);d=g.Wc(a.cg.toString());d=g.Ib(g.Tc(d));d=g.nd(g.Lc("b/12014412"),'<iframe src="'+d+'"></iframe>');c.innerHTML=g.hd(d);a.g.fe(1)},m5=function(a){a.Lq=
(0,g.D)()+a.A;
x5(a,a.A)},x5=function(a,b){if(null!=a.ri)throw Error("WatchDog timer not null");
a.ri=y5((0,g.A)(a.sK,a),b)},z5=function(a){a.ri&&(g.x.clearTimeout(a.ri),a.ri=null)},s5=function(a){a.g.mt()||a.og||a.g.Ql(a)},r5=function(a){z5(a);
g.$e(a.fm);a.fm=null;a.l.stop();g.$o(a.ba);if(a.fc){var b=a.fc;a.fc=null;b.abort();b.dispose()}a.ke&&(a.ke=null)},q5=function(a,b){try{a.g.Lw(a,b),a.g.fe(4)}catch(c){}},B5=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;A5(a,b,function(e){e?c(!0):g.x.setTimeout(function(){B5(a,b,c,d,f)},f)})}},A5=function(a,b,c){var d=new window.Image;
d.onload=function(){try{C5(d),c(!0)}catch(e){}};
d.onerror=function(){try{C5(d),c(!1)}catch(e){}};
d.onabort=function(){try{C5(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{C5(d),c(!1)}catch(e){}};
g.x.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
d.src=a},C5=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},D5=function(a){this.g=a;
this.l=new h5},F5=function(a){var b=E5(a.g,a.Ci,"/mail/images/cleardot.gif");
n4(b);B5(b.toString(),5E3,(0,g.A)(a.xA,a),3,2E3);a.fe(1)},H5=function(a){var b=a.g.I;
if(null!=b)o5(5),b?(o5(11),G5(a.g,a,!1)):(o5(12),G5(a.g,a,!0));else if(a.xd=new i5(a,void 0,void 0,void 0),a.xd.xg=a.co,b=a.g,b=E5(b,b.Jj()?a.Xi:null,a.eo),o5(5),!g.Kd||g.Hc(10))o4(b,"TYPE","xmlhttp"),l5(a.xd,b,!1,a.Xi,!1);else{o4(b,"TYPE","html");var c=a.xd;a=!!a.Xi;c.yh=3;c.Mf=n4(b.clone());w5(c,a)}},I5=function(a,b,c){this.g=1;
this.l=[];this.A=[];this.B=new h5;this.G=a||null;this.I=null!=b?b:null;this.C=c||!1},Bka=function(a,b){this.g=a;
this.map=b;this.context=null},J5=function(a){g.bf.call(this,"statevent",a)},K5=function(a,b){g.bf.call(this,"timingevent",a);
this.size=b},L5=function(a){g.bf.call(this,"serverreachability",a)},P5=function(a){M5(a);
if(3==a.g){var b=a.wj++,c=a.Mk.clone();g.Ro(c,"SID",a.o);g.Ro(c,"RID",b);g.Ro(c,"TYPE","terminate");N5(a,c);b=new i5(a,a.o,b,void 0);b.yh=2;b.Mf=n4(c.clone());(new window.Image).src=b.Mf;b.di=(0,g.D)();m5(b)}O5(a)},R5=function(a){a.IA(1,0);
a.Mk=E5(a,null,a.bo);Q5(a)},M5=function(a){a.Ef&&(a.Ef.abort(),a.Ef=null);
a.Jb&&(a.Jb.cancel(),a.Jb=null);a.Re&&(g.x.clearTimeout(a.Re),a.Re=null);S5(a);a.hd&&(a.hd.cancel(),a.hd=null);a.Hf&&(g.x.clearTimeout(a.Hf),a.Hf=null)},T5=function(a,b){if(0==a.g)throw Error("Invalid operation: sending map when state is closed");
a.l.push(new Bka(a.tG++,b));2!=a.g&&3!=a.g||Q5(a)},Q5=function(a){a.hd||a.Hf||(a.Hf=y5((0,g.A)(a.Pw,a),0),a.rh=0)},W5=function(a,b){if(1==a.g){if(!b){a.wj=Math.floor(1E5*Math.random());
var c=a.wj++,d=new i5(a,"",c,void 0);d.xg=null;var e=U5(a),f=a.Mk.clone();g.Ro(f,"RID",c);g.Ro(f,"CVER","1");N5(a,f);k5(d,f,e);a.hd=d;a.g=2}}else 3==a.g&&(b?V5(a,b):0==a.l.length||a.hd||V5(a))},V5=function(a,b){if(b)if(6<a.pg){a.l=a.A.concat(a.l);
a.A.length=0;var c=a.wj-1;var d=U5(a)}else c=b.F,d=b.Sg;else c=a.wj++,d=U5(a);var e=a.Mk.clone();g.Ro(e,"SID",a.o);g.Ro(e,"RID",c);g.Ro(e,"AID",a.Fh);N5(a,e);c=new i5(a,a.o,c,a.rh+1);c.xg=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.hd=c;k5(c,e,d)},N5=function(a,b){if(a.Fc){var c=a.Fc.Rs();
c&&g.Zb(c,function(a,c){g.Ro(b,c,a)})}},U5=function(a){var b=Math.min(a.l.length,1E3),c=["count="+b];
if(6<a.pg&&0<b){var d=a.l[0].g;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.l[e].g,k=a.l[e].map;f=6>=a.pg?e:f-d;try{g.Zb(k,function(a,b){c.push("req"+f+"_"+b+"="+(0,window.encodeURIComponent)(a))})}catch(l){c.push("req"+f+"_type="+(0,window.encodeURIComponent)("_badmap"))}}a.A=a.A.concat(a.l.splice(0,b));
return c.join("&")},X5=function(a){a.Jb||a.Re||(a.F=1,a.Re=y5((0,g.A)(a.Ow,a),0),a.kh=0)},Z5=function(a){if(a.Jb||a.Re||3<=a.kh)return!1;
a.F++;a.Re=y5((0,g.A)(a.Ow,a),Y5(a,a.kh));a.kh++;return!0},G5=function(a,b,c){a.Lm=c;
a.Be=b.bf;a.C||R5(a)},S5=function(a){null!=a.rg&&(g.x.clearTimeout(a.rg),a.rg=null)},Y5=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},a6=function(a,b){if(2==b||9==b){var c=null;
a.Fc&&(c=null);var d=(0,g.A)(a.qL,a);c||(c=new g.Ho("//www.google.com/images/cleardot.gif"),n4(c));A5(c.toString(),1E4,d)}else o5(2);$5(a,b)},$5=function(a,b){a.g=0;
a.Fc&&a.Fc.Qr(b);O5(a);M5(a)},O5=function(a){a.g=0;
a.Be=-1;if(a.Fc)if(0==a.A.length&&0==a.l.length)a.Fc.wn();else{g.db(a.A);var b=g.db(a.l);a.A.length=0;a.l.length=0;a.Fc.wn(b)}},E5=function(a,b,c){var d=g.So(c);
if(""!=d.g)b&&g.Jo(d,b+"."+d.g),g.Ko(d,d.B);else{var e=window.location;d=ika(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.Ki&&g.Zb(a.Ki,function(a,b){g.Ro(d,b,a)});
g.Ro(d,"VER",a.pg);N5(a,d);return d},y5=function(a,b){if(!g.Ea(a))throw Error("Fn must not be null and must be a function");
return g.x.setTimeout(function(){a()},b)},o5=function(a){b6.dispatchEvent(new J5(b6,a))},c6=function(){},Cka=function(a,b){this.action=a;
this.params=b||{}},d6=function(a,b){g.G.call(this);
this.g=new g.L(this.aK,0,this);g.I(this,this.g);this.Gc=5E3;this.l=0;if(g.Ea(a))b&&(a=(0,g.A)(a,b));else if(a&&g.Ea(a.handleEvent))a=(0,g.A)(a.handleEvent,a);else throw Error("Invalid listener argument");this.o=a},e6=function(a,b,c){this.L=a;
this.C=b;this.o=new g.Lq;this.l=new d6(this.SL,this);this.g=null;this.J=!1;this.B=null;this.I="";this.G=this.A=0;this.F=[];this.N=c||!1},Dka=function(a){return{firstTestResults:[""],
secondTestResults:!a.g.Lm,sessionId:a.g.o,arrayId:a.g.Fh}},f6=function(a,b){a.G=b||0;
a.l.stop();a.g&&(3==a.g.g&&W5(a.g),P5(a.g));a.G=0},g6=function(a){return!!a.g&&3==a.g.g},Eka=function(a,b){(a.C.loungeIdToken=b)||a.l.stop()},h6=function(a){this.port=this.domain="";
this.g="/api/lounge";this.l=!0;a=a||window.document.location.href;var b=g.Xg(a)||"";b&&(this.port=":"+b);this.domain=g.Wg(a)||"";a=g.Xb;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Rb(a,"10.0")&&(this.l=!1))},i6=function(a,b){var c=a.g;
if(g.t(void 0)?0:a.l)c="https://"+a.domain+a.port+a.g;return g.fh(c+b,{})},j6=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.o,e),Xc:g.La(a.B,e)};c&&(a.fb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.ms(b,a)},Fka=function(){var a=k6;
l6();m6.push(a);n6(m6)},o6=function(a,b){l6();
var c=m6,d=Gka(a,String(b));0==c.length?Hka(d):(n6(c),(0,g.C)(c,function(a){a(d)}))},l6=function(){m6||(m6=g.z("yt.mdx.remote.debug.handlers_")||[],g.y("yt.mdx.remote.debug.handlers_",m6,void 0))},Hka=function(a){var b=(p6+1)%50;
p6=b;q6[b]=a;r6||(r6=49==b)},n6=function(a){var b=q6;
if(b[0]){var c=p6,d=r6?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.C)(a,function(a){a(e)})}while(d!=c);
q6=Array(50);p6=-1;r6=!1}},Gka=function(a,b){var c=((0,g.D)()-Ika)/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("")},s6=function(a){g.O.call(this);
this.F=a;this.g=[]},t6=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.g.push(b);return!0},Jka=function(a,b){var c=a.g.length!=b.length;
a.g=(0,g.$d)(a.g,function(a){return!!M4(b,a)});
for(var d=0,e=b.length;d<e;d++)c=t6(a,b[d])||c;return c},Kka=function(a,b){var c=a.g.length;
a.g=(0,g.$d)(a.g,function(a){return!(a||b?!a!=!b?0:a.id==b.id:1)});
return a.g.length<c},u6=function(a,b,c,d){g.O.call(this);
this.C=a;this.B=b;this.o=c;this.A=d;this.l=0;this.g=null;this.Aa=window.NaN},w6=function(a){s6.call(this,"LocalScreenService");
this.o=a;this.l=window.NaN;v6(this);this.info("Initializing with "+K4(this.g))},x6=function(a){if(a.g.length){var b=(0,g.E)(a.g,function(a){return a.id}),c=i6(a.o,"/pairing/get_lounge_token_batch");
j6(a.o,c,{screen_ids:b.join(",")},(0,g.A)(a.jB,a),(0,g.A)(a.iB,a))}},v6=function(a){var b=I4(U4());
b=(0,g.$d)(b,function(a){return!a.uuid});
return Jka(a,b)},y6=function(a,b){rka((0,g.E)(a.g,H4));
b&&V4()},A6=function(a,b){g.O.call(this);
this.C=b;var c=g.Qu("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.g=d;this.B=a;this.o=this.A=window.NaN;this.l=null;z6("Initialized with "+g.Mg(this.g))},B6=function(a,b,c){var d=i6(a.B,"/pairing/get_screen_availability");
j6(a.B,d,{lounge_token:b.token},(0,g.A)(function(a){a=a.screens||[];for(var d=0,e=a.length;d<e;++d)if(a[d].loungeToken==b.token){c("online"==a[d].status);return}c(!1)},a),(0,g.A)(function(){c(!1)},a))},C6=function(a,b){a:if(g.cc(b)!=g.cc(a.g))var c=!1;
else{c=g.fc(b);for(var d=0,e=c.length;d<e;++d)if(!a.g[c[d]]){c=!1;break a}c=!0}c||(z6("Updated online screens: "+g.Mg(a.g)),a.g=b,a.P("screenChange"));Lka(a)},D6=function(a){(0,window.isNaN)(a.o)||g.Xr(a.o);
a.o=g.Vr((0,g.A)(a.jq,a),0<a.A&&a.A<(0,g.D)()?2E4:1E4)},z6=function(a){o6("OnlineScreenService",a)},E6=function(a){var b={};
(0,g.C)(a.C(),function(a){a.token?b[a.token]=a.id:this.zb("Requesting availability of screen w/o lounge token.")});
return b},Lka=function(a){a=g.fc(g.$b(a.g,function(a){return a}));
g.ob(a);a.length?g.Pu("yt-remote-online-screen-ids",a.join(","),60):g.Ru("yt-remote-online-screen-ids")},F6=function(a){s6.call(this,"ScreenService");
this.C=a;this.l=this.o=null;this.A=[];this.B={};Mka(this)},H6=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.B[b]);var k=a.qd();if(k=(c?N4(k,c):null)||N4(k,b)){k.uuid=b;var l=G6(a,k);B6(a.l,l,function(a){e(a?l:null)})}else c?Nka(a,c,(0,g.A)(function(a){var f=G6(this,new F4({name:d,
screenId:c,loungeToken:a,dialId:b||""}));B6(this.l,f,function(a){e(a?f:null)})},a),f):e(null)},I6=function(a,b){for(var c=0,d=a.g.length;c<d;++c)if(a.g[c].name==b)return a.g[c];
return null},Nka=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={fb:{screen_ids:b},method:"POST",context:a,onSuccess:function(a,e){var f=e&&e.screens||[];f[0]&&f[0].screenId==b?c(f[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.ms(i6(a.C,"/pairing/get_lounge_token_batch"),e)},J6=function(a){a.g=a.o.qd();
var b=a.B,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.g.length;b<d;++b){var e=a.g[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+K4(a.g))},Mka=function(a){K6(a);
a.o=new w6(a.C);a.o.subscribe("screenChange",(0,g.A)(a.vB,a));J6(a);a.A=I4(g.Qu("yt-remote-automatic-screen-cache")||[]);K6(a);a.info("Initializing automatic screens: "+K4(a.A));a.l=new A6(a.C,(0,g.A)(a.qd,a,!0));a.l.subscribe("screenChange",(0,g.A)(function(){this.P("onlineScreenChange")},a))},G6=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=N4(a.A,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.A.push(b),g.Pu("yt-remote-automatic-screen-cache",(0,g.E)(a.A,H4)));K6(a);a.B[b.uuid]=b.id;g.Pu("yt-remote-device-id-map",a.B,31536E3);return b},K6=function(a){a.B=g.Qu("yt-remote-device-id-map")||{}},L6=function(a,b,c){g.O.call(this);
this.N=c;this.I=a;this.l=b;this.o=null},M6=function(a,b){o6(a.N,b)},O6=function(a,b){L6.call(this,a,b,"CastSession");
this.g=null;this.A=0;this.C=(0,g.A)(this.YL,this);this.B=(0,g.A)(this.DK,this);this.A=g.Vr((0,g.A)(function(){N6(this,null)},this),12E4)},Oka=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Mg(void 0));
var b={type:"getMdxSessionStatus"};a.g?a.g.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.za,(0,g.A)(function(){M6(this,"Failed to send message: getMdxSessionStatus.")},a)):M6(a,"Sending yt message without session: "+g.Mg(b))},N6=function(a,b){g.Xr(a.A);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.o||a.o.id!=b){var c=(0,g.A)(a.Rl,a),d=(0,g.A)(a.wd,a);a.ct(b,c,d,5)}}else a.wd(Error("Waiting for session status timed out."))},P6=function(a,b,c){L6.call(this,a,b,"DialSession");
this.A=this.G=null;this.J="";this.R=c;this.B=null;this.F=g.za;this.C=window.NaN;this.L=(0,g.A)(this.bM,this);this.g=g.za},Q6=function(a){a.g=a.I.dz(a.J,a.l.label,a.l.friendlyName,(0,g.A)(function(a){this.g=g.za;
this.Rl(a)},a),(0,g.A)(function(a){this.g=g.za;
this.wd(a)},a))},R6=function(a){var b={};
b.pairingCode=a.J;b.theme=a.R;if(a.B){var c=a.B.currentTime||0;b.v=a.B.videoId;b.t=c}Y4()&&(b.env_useStageMdx=1);return g.dh(b)},S6=function(a,b){L6.call(this,a,b,"ManualSession");
this.g=g.Vr((0,g.A)(this.Gh,this,null),150)},T6=function(a,b,c,d){g.O.call(this);
this.l=a;this.F=b||"233637DE";this.C=c||"cl";this.G=d||!1;this.g=null;this.B=!1;this.o=[];this.A=(0,g.A)(this.mJ,this)},U6=function(a,b){return b?g.Ra(a.o,function(a){return G4(b,a.label)},a):null},V6=function(a){o6("Controller",a)},k6=function(a){window.chrome&&window.chrome.cast&&window.chrome.cast.logMessage&&window.chrome.cast.logMessage(a)},W6=function(a){return a.B||!!a.o.length||!!a.g},X6=function(a,b,c){b!=a.g&&(g.$e(a.g),(a.g=b)?(c?a.P("yt-remote-cast2-receiver-resumed",b.l):a.P("yt-remote-cast2-receiver-selected",
b.l),b.subscribe("sessionScreen",(0,g.A)(a.Nw,a,b)),b.o?a.P("yt-remote-cast2-session-change",b.o):c&&a.g.Gh(null)):a.P("yt-remote-cast2-session-change",null))},Y6=function(a){var b=a.l.cz(),c=a.g&&a.g.l;
a=(0,g.E)(b,function(a){c&&G4(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,d=U6(this,a);d?(d.label=b,d.friendlyName=a.name):(d=new window.chrome.cast.Receiver(b,a.name),d.receiverType=window.chrome.cast.ReceiverType.CUSTOM);return d},a);
c&&(c.receiverType!=window.chrome.cast.ReceiverType.CUSTOM&&(c=new window.chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=window.chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},Ska=function(a,b,c,d,e,f,k){Pka()?Qka(b,e,f,k)&&($6(!0),window.chrome&&window.chrome.cast&&window.chrome.cast.isAvailable?a7(a,c):(window.__onGCastApiAvailable=function(b,d){b?a7(a,c):(b7("Failed to load cast API: "+d),c7(!1),$6(!1),g.Ru("yt-remote-cast-available"),g.Ru("yt-remote-cast-receiver"),d7(),c(!1))},
d?window.spf?window.spf.script.load("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js","",void 0):vka():e5("CriOS")?yka():e5("Android")&&e5("Chrome/")&&window.navigator.presentation?zka():window.chrome&&window.navigator.presentation&&!e5("Edge")?(f5(),b5(Rka.map(wka))):c5())):Z6("Cannot initialize because not running Chrome")},d7=function(){Z6("dispose");
var a=e7();a&&a.dispose();g.y("yt.mdx.remote.cloudview.instance_",null,void 0);f7(!1);g.Vt(g7);g7.length=0},h7=function(){return!!g.Qu("yt-remote-cast-installed")},i7=function(){var a=g.Qu("yt-remote-cast-receiver");
return a?a.friendlyName:null},j7=function(){Z6("clearCurrentReceiver");
g.Ru("yt-remote-cast-receiver")},k7=function(){return h7()?e7()?e7().getCastSession():(b7("getCastSelector: Cast is not initialized."),null):(b7("getCastSelector: Cast API is not installed!"),null)},m7=function(){h7()?e7()?l7()?(Z6("Requesting cast selector."),e7().requestSession()):(Z6("Wait for cast API to be ready to request the session."),g7.push(g.Ut("yt-remote-cast2-api-ready",m7))):b7("requestCastSelector: Cast is not initialized."):b7("requestCastSelector: Cast API is not installed!")},n7=
function(a,b){l7()?e7().setConnectedScreenStatus(a,b):b7("setConnectedScreenStatus called before ready.")},Pka=function(){var a=0<=g.Xb.search(/ (CrMo|Chrome|CriOS)\//);
return g.Ew||a},Tka=function(a,b){e7().init(a,b)},Qka=function(a,b,c,d){var e=!1;
e7()||(a=new T6(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(a){g.Pu("yt-remote-cast-available",a);g.Yt("yt-remote-cast2-availability-change",a)}),a.subscribe("yt-remote-cast2-receiver-selected",function(a){Z6("onReceiverSelected: "+a.friendlyName);
g.Pu("yt-remote-cast-receiver",a);g.Yt("yt-remote-cast2-receiver-selected",a)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(a){Z6("onReceiverResumed: "+a.friendlyName);
g.Pu("yt-remote-cast-receiver",a)}),a.subscribe("yt-remote-cast2-session-change",function(a){Z6("onSessionChange: "+J4(a));
a||g.Ru("yt-remote-cast-receiver");g.Yt("yt-remote-cast2-session-change",a)}),g.y("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
Z6("cloudview.createSingleton_: "+e);return e},e7=function(){return g.z("yt.mdx.remote.cloudview.instance_")},a7=function(a,b){c7(!0);
$6(!1);Tka(a,function(a){a?(f7(!0),g.Xt("yt-remote-cast2-api-ready")):(b7("Failed to initialize cast API."),c7(!1),g.Ru("yt-remote-cast-available"),g.Ru("yt-remote-cast-receiver"),d7());b(a)})},Z6=function(a){o6("cloudview",a)},b7=function(a){o6("cloudview",a)},c7=function(a){Z6("setCastInstalled_ "+a);
g.Pu("yt-remote-cast-installed",a)},l7=function(){return!!g.z("yt.mdx.remote.cloudview.apiReady_")},f7=function(a){Z6("setApiReady_ "+a);
g.y("yt.mdx.remote.cloudview.apiReady_",a,void 0)},$6=function(a){g.y("yt.mdx.remote.cloudview.initializing_",a,void 0)},o7=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.g=-1;this.muted=!1;this.audioTrackId=null;this.F=this.G=0;this.l=null;this.hasNext=this.Ce=!1;this.J=this.I=this.o=this.B=0;this.A=window.NaN;this.C=!1;this.reset(a)},p7=function(a){a.audioTrackId=null;
a.l=null;a.g=-1;a.Ce=!1;a.hasNext=!1;a.G=0;a.F=(0,g.D)();a.B=0;a.o=0;a.I=0;a.J=0;a.A=window.NaN;a.C=!1},q7=function(a){return 1==a.g?((0,g.D)()-a.F)/1E3:0},r7=function(a,b){a.G=b;
a.F=(0,g.D)()},s7=function(a){switch(a.g){case 1:case 1081:return((0,g.D)()-a.F)/1E3+a.G;
case -1E3:return 0}return a.G},t7=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&p7(a)},u7=function(a){var b={};
b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.g;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.rc(a.l);b.hasPrevious=a.Ce;b.hasNext=a.hasNext;b.playerTime=a.G;b.playerTimeAt=a.F;b.seekableStart=a.B;b.seekableEnd=a.o;b.duration=a.I;b.loadedTime=a.J;b.liveIngestionTime=a.A;return b},x7=function(a,b){g.O.call(this);
this.g=0;this.A=a;this.C=[];this.B=new C4;this.o=this.l=null;this.I=(0,g.A)(this.cH,this);this.F=(0,g.A)(this.yj,this);this.G=(0,g.A)(this.bH,this);this.J=(0,g.A)(this.oH,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.Nq,this),v7(this))):c=3;0!=c&&(b?this.Nq(c):g.Vr((0,g.A)(function(){this.Nq(c)},this),0));
var d=k7();d&&w7(this,d);this.subscribe("yt-remote-cast2-session-change",this.J)},y7=function(a){return new o7(a.A.getPlayerContextData())},v7=function(a){(0,g.C)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(a){this.C.push(this.A.subscribe(a,g.La(this.iJ,a),this))},a)},z7=function(a){(0,g.C)(a.C,function(a){this.A.unsubscribeByKey(a)},a);
a.C.length=0},A7=function(a,b){var c=a.B;
50>c.g.length+c.l.length&&a.B.l.push(b)},C7=function(a,b,c){var d=y7(a);
r7(d,c);-1E3!=d.g&&(d.g=b);B7(a,d)},D7=function(a,b,c){a.A.sendMessage(b,c)},B7=function(a,b){z7(a);
a.A.setPlayerContextData(u7(b));v7(a)},w7=function(a,b){a.o&&(a.o.removeUpdateListener(a.I),a.o.removeMediaListener(a.F),a.yj(null));
a.o=b;a.o&&(o6("CP","Setting cast session: "+a.o.sessionId),a.o.addUpdateListener(a.I),a.o.addMediaListener(a.F),a.o.media.length&&a.yj(a.o.media[0]))},E7=function(a){var b=a.l.media,c=a.l.customData;
if(b&&c){var d=y7(a);b.contentId!=d.videoId&&o6("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.g=c.playerState;r7(d,a.l.getEstimatedTime());B7(a,d)}else o6("CP","No cast media video. Ignoring state update.")},F7=function(a,b,c){return(0,g.A)(function(a){this.zb("Failed to "+b+" with cast v2 channel. Error code: "+a.code);
a.code!=window.chrome.cast.ErrorCode.TIMEOUT&&(this.zb("Retrying "+b+" using MDx browser channel."),D7(this,b,c))},a)},G7=function(a,b,c){g.O.call(this);
this.B=window.NaN;this.R=!1;this.J=this.I=this.L=this.N=window.NaN;this.T=[];this.A=this.F=this.o=this.Ka=this.g=null;this.ra=a;this.T.push(g.rt(window,"beforeunload",(0,g.A)(this.cB,this)));this.l=[];this.Ka=new o7;this.Y=b.id;this.g=Uka(this,c);this.g.subscribe("handlerOpened",this.gH,this);this.g.subscribe("handlerClosed",this.dH,this);this.g.subscribe("handlerError",this.eH,this);this.g.subscribe("handlerMessage",this.fH,this);Eka(this.g,b.token);this.subscribe("remoteQueueChange",function(){var a=
this.Ka.videoId;g.Su()&&g.Pu("yt-remote-session-video-id",a)},this)},H7=function(a){o6("conn",a)},Uka=function(a,b){return new e6(i6(a.ra,"/bc"),b)},I7=function(a,b){a.P("proxyStateChange",b)},Vka=function(a){a.B=g.Vr((0,g.A)(function(){H7("Connecting timeout");
this.C(1)},a),2E4)},J7=function(a){g.Xr(a.B);
a.B=window.NaN},K7=function(a){g.Xr(a.N);
a.N=window.NaN},Wka=function(a){L7(a);
a.L=g.Vr((0,g.A)(function(){M7(this,"getNowPlaying")},a),2E4)},L7=function(a){g.Xr(a.L);
a.L=window.NaN},O7=function(a,b){b&&(J7(a),K7(a));
b==(g6(a.g)&&(0,window.isNaN)(a.B))?b&&(I7(a,1),M7(a,"getSubtitlesTrack")):b?(a.Z()&&a.Ka.reset(),I7(a,1),M7(a,"getNowPlaying"),N7(a)):a.C(1)},Xka=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Ka.videoId&&(g.lc(b.params)?a.Ka.l=null:a.Ka.l=b.params,a.P("remotePlayerChange"))},P7=function(a,b){var c=b.params.videoId||b.params.video_id,d=(0,window.parseInt)(b.params.currentIndex,10);
a.Ka.listId=b.params.listId||a.Ka.listId;t7(a.Ka,c,d);a.P("remoteQueueChange")},Yka=function(a,b){b.params=b.params||{};
P7(a,b);Q7(a,b);a.P("autoplayDismissed")},Q7=function(a,b){var c=(0,window.parseInt)(b.params.currentTime||b.params.current_time,10);
r7(a.Ka,(0,window.isNaN)(c)?0:c);c=(0,window.parseInt)(b.params.state,10);c=(0,window.isNaN)(c)?-1:c;-1==c&&-1E3==a.Ka.g&&(c=-1E3);a.Ka.g=c;c=Number(b.params.loadedTime);a.Ka.J=(0,window.isNaN)(c)?0:c;c=Number(b.params.duration);a.Ka.I=(0,window.isNaN)(c)?0:c;c=a.Ka;var d=Number(b.params.liveIngestionTime);c.A=d;c.C=(0,window.isNaN)(d)?!1:!0;c=a.Ka;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.B=(0,window.isNaN)(d)?0:d;c.o=(0,window.isNaN)(e)?0:e;1==a.Ka.g?Wka(a):L7(a);
a.P("remotePlayerChange")},Zka=function(a,b){if(-1E3!=a.Ka.g){var c=1085;
switch((0,window.parseInt)(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.Ka.g=c;c=(0,window.parseInt)(b.params.currentTime,10);r7(a.Ka,(0,window.isNaN)(c)?0:c);a.P("remotePlayerChange")}},$ka=function(a,b){var c="true"==b.params.muted;
a.Ka.volume=(0,window.parseInt)(b.params.volume,10);a.Ka.muted=c;a.P("remotePlayerChange")},ala=function(a,b){a.F=b.params.videoId;
a.P("nowAutoplaying",(0,window.parseInt)(b.params.timeout,10))},bla=function(a,b){var c="true"==b.params.hasNext;
a.Ka.Ce="true"==b.params.hasPrevious;a.Ka.hasNext=c;a.P("previousNextChange")},N7=function(a){g.Xr(a.J);
a.J=g.Vr((0,g.A)(a.C,a,1),864E5)},M7=function(a,b,c){c?H7("Sending: action="+b+", params="+g.Mg(c)):H7("Sending: action="+b);
a.g.sendMessage(b,c)},R7=function(a){s6.call(this,"ScreenServiceProxy");
this.yc=a;this.l=[];this.l.push(this.yc.$_s("screenChange",(0,g.A)(this.WL,this)));this.l.push(this.yc.$_s("onlineScreenChange",(0,g.A)(this.NI,this)))},hla=function(a){var b={device:"Desktop",
app:"youtube-desktop"};b=g.Or("MDX_CONFIG")||b;pka();S4();S7||(S7=new h6(b?b.loungeApiHost:void 0),Y4()&&(S7.g="/api/loungedev"));T7||(T7=g.z("yt.mdx.remote.deferredProxies_")||[],g.y("yt.mdx.remote.deferredProxies_",T7,void 0));dla();var c=U7();if(!c){var d=new F6(S7);g.y("yt.mdx.remote.screenService_",d,void 0);c=U7();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);Ska(a,d,function(a){a?V7()&&n7(V7(),"YouTube TV"):d.subscribe("onlineScreenChange",
function(){g.Yt("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.z("yt.mdx.remote.initialized_")&&(g.y("yt.mdx.remote.initialized_",!0,void 0),W7("Initializing: "+g.Mg(b)),X7.push(g.Ut("yt-remote-cast2-availability-change",function(){g.Yt("yt-remote-receiver-availability-change")})),X7.push(g.Ut("yt-remote-cast2-receiver-selected",function(){Y7(null);
g.Yt("yt-remote-auto-connect","cast-selector-receiver")})),X7.push(g.Ut("yt-remote-cast2-receiver-resumed",function(){g.Yt("yt-remote-receiver-resumed","cast-selector-receiver")})),X7.push(g.Ut("yt-remote-cast2-session-change",ela)),X7.push(g.Ut("yt-remote-connection-change",function(a){a?n7(V7(),"YouTube TV"):Z7()||(n7(null,null),j7())})),a=$7(),b.isAuto&&(a.id+="#dial"),g.Ot("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),W7(" -- with channel params: "+
g.Mg(a)),fla(a),c.start(),V7()||gla())},ila=function(){var a=a8();
h7()&&g.Qu("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},a8=function(){var a=U7().yc.$_gos();
var b=b8();b&&c8()&&(M4(a,b)||a.push(b));return oka(a)},d8=function(){var a=jla();
!a&&h7()&&i7()&&(a={key:"cast-selector-receiver",name:i7()});return a},jla=function(){var a=a8(),b=b8();
b||(b=Z7());return g.Ra(a,function(a){return b&&G4(b,a.key)?!0:!1})},b8=function(){var a=V7();
if(!a)return null;var b=U7().qd();return N4(b,a)},ela=function(a){W7("remote.onCastSessionChange_: "+J4(a));
if(a){var b=b8();b&&b.id==a.id?n7(b.id,"YouTube TV"):(b&&e8(),f8(a,1))}else c8()&&e8()},e8=function(){l7()?e7().stopSession():b7("stopSession called before API ready.");
var a=c8();a&&(a.disconnect(1),g8(null))},h8=function(){var a=c8();
return!!a&&3!=a.getProxyState()},W7=function(a){o6("remote",a)},U7=function(){if(!i8){var a=g.z("yt.mdx.remote.screenService_");
i8=a?new R7(a):null}return i8},V7=function(){return g.z("yt.mdx.remote.currentScreenId_")},j8=function(a){g.y("yt.mdx.remote.currentScreenId_",a,void 0)},k8=function(){return g.z("yt.mdx.remote.connectData_")},Y7=function(a){g.y("yt.mdx.remote.connectData_",a,void 0)},c8=function(){return g.z("yt.mdx.remote.connection_")},g8=function(a){var b=c8();
Y7(null);a||j8("");g.y("yt.mdx.remote.connection_",a,void 0);T7&&((0,g.C)(T7,function(b){b(a)}),T7.length=0);
b&&!a?g.Yt("yt-remote-connection-change",!1):!b&&a&&g.Yt("yt-remote-connection-change",!0)},Z7=function(){var a=g.Su();
if(!a)return null;var b=U7().qd();return N4(b,a)},f8=function(a,b){b8()&&b8();
j8(a.id);var c=new G7(S7,a,$7());c.connect(b,k8());c.subscribe("beforeDisconnect",function(a){g.Yt("yt-remote-before-disconnect",a)});
c.subscribe("beforeDispose",function(){c8()&&g8(null)});
g8(c)},gla=function(){var a=Z7();
a?(W7("Resume connection to: "+J4(a)),f8(a,0)):(W4(),j7(),W7("Skipping connecting because no session screen found."))},dla=function(){var a=$7();
if(g.lc(a)){a=R4();var b=g.Qu("yt-remote-session-name")||"",c=g.Qu("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.y("yt.mdx.remote.channelParams_",a,void 0)}},$7=function(){return g.z("yt.mdx.remote.channelParams_")||{}},fla=function(a){a?(g.Pu("yt-remote-session-app",a.app),g.Pu("yt-remote-session-name",a.name)):(g.Ru("yt-remote-session-app"),g.Ru("yt-remote-session-name"));
g.y("yt.mdx.remote.channelParams_",a,void 0)},l8=function(a,b,c){g.G.call(this);
this.G=a;this.l=b;this.o=new g.Gt(this);g.I(this,this.o);this.o.M(b,"onCaptionsTrackListChanged",this.dI);this.o.M(b,"captionschanged",this.aH);this.o.M(b,"captionssettingschanged",this.oy);this.o.M(b,"videoplayerreset",this.Sl);this.o.M(b,"mdxautoplaycancel",this.wA);this.T=this.o.M(b,"onVolumeChange",this.Bw);this.F=!1;this.g=c;c.subscribe("proxyStateChange",this.Kw,this);c.subscribe("remotePlayerChange",this.zj,this);c.subscribe("remoteQueueChange",this.Sl,this);c.subscribe("autoplayUpNext",this.lw,
this);c.subscribe("previousNextChange",this.Hw,this);c.subscribe("nowAutoplaying",this.Dw,this);c.subscribe("autoplayDismissed",this.kw,this);this.suggestion=null;this.I=new g.tD(64);this.A=new g.L(this.ly,500,this);g.I(this,this.A);this.B=new g.L(this.my,1E3,this);g.I(this,this.B);this.L=new g5(this.DL,0,this);g.I(this,this.L);this.C={};this.N=new g.L(this.Oy,1E3,this);g.I(this,this.N);this.J=new g.tm(this.QE,1E3,this);g.I(this,this.J);this.R=g.za;this.oy();this.Sl();this.zj()},m8=function(a,b){var c=
a.G,d=a.l.getVideoData().lengthSeconds;
c.I=b||0;c.g.P("progresssync",b,d)},o8=function(a){m8(a,0);
a.A.stop();n8(a,new g.tD(64))},q8=function(a,b){if(p8(a)&&!a.F){var c=null;
b&&(c={style:a.l.Og()},g.tc(c,b));a.g.Zx(a.l.getVideoData(1).videoId,c);a.C=y7(a.g).l}},r8=function(a,b){var c=a.l.Fe();
if(c){var d=c.Oa;var e=c.listId.toString()}var f=a.l.getVideoData(1);c=a.g;var k=f.videoId,l=d;d=f.playerParams;var m=f.Bh;f=B4(f);var n=y7(c);l=l||0;var q={videoId:k,currentIndex:l};t7(n,k,l);g.t(b)&&(r7(n,b),q.currentTime=b);g.t(e)&&(q.listId=e);null!=d&&(q.playerParams=d);null!=m&&(q.clickTrackingParams=m);null!=f&&(q.locationInfo=g.Mg(f));D7(c,"setPlaylist",q);e||B7(c,n);n8(a,new g.tD(1))},s8=function(a,b){if(b){var c=a.l.Mb("captions","tracklist",{Pt:1});
c&&c.length?(a.l.Vc("captions","track",b),a.F=!1):(a.l.Nh("captions"),a.F=!0)}else a.l.Vc("captions","track",{})},p8=function(a){return y7(a.g).videoId==a.l.getVideoData(1).videoId},n8=function(a,b){a.B.stop();
var c=a.I;if(!g.yD(c,b)){var d=g.U(b,2);d!=g.U(a.I,2)&&g.$J(a.l,d);a.I=b;t8(a.G,c,b)}},v8=function(a){g.R.call(this,{D:"div",
H:"ytp-remote",K:[{D:"div",H:"ytp-remote-display-status",K:[{D:"div",H:"ytp-remote-display-status-icon",K:[g.nO()]},{D:"div",H:"ytp-remote-display-status-text",V:"{{statustext}}"}]}]});this.l=new g.eP(this,250);g.I(this,this.l);this.o=a;this.M(a,"presentingplayerstatechange",this.A);u8(this,g.XJ(a))},u8=function(a,b){if(3==a.o.Da()){var c={RECEIVER_NAME:a.o.Mb("remote","currentReceiver").name};
c=g.U(b,128)?g.uW('\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.zD(b)||g.U(b,4)?g.uW('\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.uW('\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 "$RECEIVER_NAME"',
c);a.updateValue("statustext",c);a.l.show()}else a.l.hide()},w8=function(a,b){g.JT.call(this,"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430",0,a,b);
this.l=a;this.G={};this.M(a,"onMdxReceiversChange",this.J);this.M(a,"presentingplayerstatechange",this.J);this.J()},x8=function(a){g.HK.call(this,a);
this.o={key:L4(),name:"\u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440"};this.B=null;this.C=[];this.J=this.l=null;this.G=[this.o];this.A=this.o;this.F=new g.tD(64);this.I=0;if(!g.XA(g.V(this.g))){a=this.g;var b=g.Hv(a);b&&(b=b.sl())&&(b=new w8(a,b),g.I(this,b));b=new v8(a);g.I(this,b);g.tK(a,b.element,4)}},t8=function(a,b,c){a.F=c;
a.g.P("presentingplayerstatechange",new g.ED(c,b))},y8=function(a,b){if(b.key!=a.A.key)if(b.key==a.o.key)e8();
else{a.A=b;var c=a.g.getPlaylistId();var d=a.g.getVideoData(1);var e=d.videoId;if(c||e){var f=a.g.Fe();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.sb(l).videoId}else k=[e];f=a.g.getCurrentTime(1);c={videoIds:k,listId:c,videoId:e,playerParams:d.playerParams,clickTrackingParams:d.Bh,index:Math.max(a.g.Nu(),0),currentTime:0==f?void 0:f};(d=B4(d))&&(c.locationInfo=d);d=c}else d=null;W7("Connecting to: "+g.Mg(b));"cast-selector-receiver"==b.key?(Y7(d||null),l7()?e7().setLaunchParams(d||null):
b7("setLaunchParams called before ready.")):!d&&h8()&&V7()==b.key?g.Yt("yt-remote-connection-change",!0):(e8(),Y7(d||null),d=U7().qd(),(d=N4(d,b.key))&&f8(d,1))}},fka=/^https?$/i,kla=["POST",
"PUT"];g.B(z4,g.Ff);g.h=z4.prototype;
g.h.send=function(a,b,c,d){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+a);b=b?b.toUpperCase():"GET";this.I=a;this.B="";this.A=0;this.X=b;this.T=!1;this.l=!0;this.g=this.R?r4(this.R):r4(g.VW);this.N=this.R?q4(this.R):q4(g.VW);this.g.onreadystatechange=(0,g.A)(this.qt,this);try{m4(s4(this,"Opening Xhr")),this.Y=!0,this.g.open(b,String(a),!0),this.Y=!1}catch(f){m4(s4(this,"Error opening Xhr: "+f.message));w4(this,f);return}a=c||"";var e=this.headers.clone();
d&&cka(d,function(a,b){e.set(b,a)});
d=g.Ra(e.od(),dka);c=g.x.FormData&&a instanceof g.x.FormData;!g.Va(kla,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(a,b){this.g.setRequestHeader(b,a)},this);
this.ea&&(this.g.responseType=this.ea);"withCredentials"in this.g&&this.g.withCredentials!==this.Z&&(this.g.withCredentials=this.Z);try{t4(this),0<this.C&&(this.L=eka(this.g),m4(s4(this,"Will abort after "+this.C+"ms if incomplete, xhr2 "+this.L)),this.L?(this.g.timeout=this.C,this.g.ontimeout=(0,g.A)(this.tt,this)):this.F=g.Cg(this.tt,this.C,this)),m4(s4(this,"Sending request")),this.G=!0,this.g.send(a),this.G=!1}catch(f){m4(s4(this,"Send error: "+f.message)),w4(this,f)}};
g.h.tt=function(){"undefined"!=typeof g.yW&&this.g&&(this.B="Timed out after "+this.C+"ms, aborting",this.A=8,s4(this,this.B),this.dispatchEvent("timeout"),this.abort(8))};
g.h.abort=function(a){this.g&&this.l&&(s4(this,"Aborting"),this.l=!1,this.o=!0,this.g.abort(),this.o=!1,this.A=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),v4(this))};
g.h.U=function(){this.g&&(this.l&&(this.l=!1,this.o=!0,this.g.abort(),this.o=!1),v4(this,!0));z4.wa.U.call(this)};
g.h.qt=function(){this.ga()||(this.Y||this.G||this.o?y4(this):this.lJ())};
g.h.lJ=function(){y4(this)};
g.h.isActive=function(){return!!this.g};
g.h.getStatus=function(){try{return 2<x4(this)?this.g.status:-1}catch(a){return-1}};
var v5={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"<"},u5={"'":"\\'"},lla={};g.h=C4.prototype;g.h.isEmpty=function(){return 0==this.g.length&&0==this.l.length};
g.h.clear=function(){this.g=[];this.l=[]};
g.h.contains=function(a){return g.Va(this.g,a)||g.Va(this.l,a)};
g.h.remove=function(a){var b=this.g;var c=(0,g.aga)(b,a);0<=c?(g.Ya(b,c),b=!0):b=!1;return b||g.Za(this.l,a)};
g.h.qc=function(){for(var a=[],b=this.g.length-1;0<=b;--b)a.push(this.g[b]);var c=this.l.length;for(b=0;b<c;++b)a.push(this.l[b]);return a};
var mka={lM:"atp",vO:"ska",kO:"que",LN:"mus",uO:"sus",bN:"dsp"};E4.prototype.vk=function(){var a=new E4({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.o=this.o;a.l=this.l;a.g=this.g};
var X4,Q4="",d5=Z4("loadGamesSDK")?"/cast_game_sender.js":"/cast_sender.js",xka=Z4("loadCastFramework")||Z4("loadCastApplicationFramework"),Rka=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.B(g5,g.G);g.h=g5.prototype;g.h.XA=function(a){this.A=arguments;this.g=!1;this.Aa?this.o=(0,g.D)()+this.Gc:this.Aa=g.Cg(this.B,this.Gc)};
g.h.stop=function(){this.Aa&&(g.x.clearTimeout(this.Aa),this.Aa=null);this.o=null;this.g=!1;this.A=[]};
g.h.pause=function(){++this.l};
g.h.resume=function(){this.l&&(--this.l,!this.l&&this.g&&(this.g=!1,this.C.apply(null,this.A)))};
g.h.U=function(){this.stop();g5.wa.U.call(this)};
g.h.YA=function(){this.o?(this.Aa=g.Cg(this.B,this.o-(0,g.D)()),this.o=null):(this.Aa=null,this.l?this.g=!0:(this.g=!1,this.C.apply(null,this.A)))};h5.prototype.stringify=function(a){return g.x.JSON.stringify(a,void 0)};
h5.prototype.parse=function(a){return g.x.JSON.parse(a,void 0)};g.h=i5.prototype;g.h.xg=null;g.h.je=!1;g.h.ri=null;g.h.Lq=null;g.h.di=null;g.h.yh=null;g.h.Mf=null;g.h.cg=null;g.h.Sg=null;g.h.fc=null;g.h.Tj=0;g.h.ke=null;g.h.Mm=null;g.h.Nf=null;g.h.Yi=-1;g.h.Lx=!0;g.h.og=!1;g.h.fo=0;g.h.fm=null;var p5={},n5={};g.h=i5.prototype;g.h.setTimeout=function(a){this.A=a};
g.h.NK=function(a){a=a.target;var b=this.fm;b&&3==x4(a)?b.wh():this.Wy(a)};
g.h.Wy=function(a){try{if(a==this.fc)a:{var b=x4(this.fc),c=this.fc.A,d=this.fc.getStatus();if(g.Kd&&!g.Hc(10)||g.Md&&!g.Fc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Lh&&!A4(this.fc))break a;this.og||4!=b||7==c||(8==c||0>=d?this.g.fe(3):this.g.fe(2));z5(this);var e=this.fc.getStatus();this.Yi=e;var f=A4(this.fc);(this.je=200==e)?(4==b&&r5(this),this.B?(t5(this,b,f),g.Lh&&this.je&&3==b&&(this.ba.da(this.l,"tick",this.JK),this.l.start())):q5(this,f),this.je&&!this.og&&(4==b?this.g.Ql(this):(this.je=
!1,m5(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Nf=3,o5(13)):(this.Nf=0,o5(14)),r5(this),s5(this))}}catch(k){this.fc&&A4(this.fc)}finally{}};
g.h.JK=function(){var a=x4(this.fc),b=A4(this.fc);this.Tj<b.length&&(z5(this),t5(this,a,b),this.je&&4!=a&&m5(this))};
g.h.hK=function(a){y5((0,g.A)(this.gK,this,a),0)};
g.h.gK=function(a){this.og||(z5(this),q5(this,a),m5(this))};
g.h.Rw=function(a){y5((0,g.A)(this.fK,this,a),0)};
g.h.fK=function(a){this.og||(r5(this),this.je=a,this.g.Ql(this),this.g.fe(4))};
g.h.cancel=function(){this.og=!0;r5(this)};
g.h.sK=function(){this.ri=null;var a=(0,g.D)();0<=a-this.Lq?(2!=this.yh&&this.g.fe(3),r5(this),this.Nf=2,o5(18),s5(this)):x5(this,this.Lq-a)};g.h=D5.prototype;g.h.co=null;g.h.xd=null;g.h.gm=!1;g.h.ot=null;g.h.Ik=null;g.h.Go=null;g.h.eo=null;g.h.Gd=null;g.h.bf=-1;g.h.Xi=null;g.h.Ci=null;g.h.connect=function(a){this.eo=a;a=E5(this.g,null,this.eo);o5(3);this.ot=(0,g.D)();var b=this.g.G;null!=b?(this.Xi=b[0],(this.Ci=b[1])?(this.Gd=1,F5(this)):(this.Gd=2,H5(this))):(o4(a,"MODE","init"),this.xd=new i5(this,void 0,void 0,void 0),this.xd.xg=this.co,l5(this.xd,a,!1,null,!0),this.Gd=0)};
g.h.xA=function(a){if(a)this.Gd=2,H5(this);else{o5(4);var b=this.g;b.Be=b.Ef.bf;a6(b,9)}a&&this.fe(2)};
g.h.En=function(a){return this.g.En(a)};
g.h.abort=function(){this.xd&&(this.xd.cancel(),this.xd=null);this.bf=-1};
g.h.mt=function(){return!1};
g.h.Lw=function(a,b){this.bf=a.Yi;if(0==this.Gd)if(b){try{var c=this.l.parse(b)}catch(d){c=this.g;c.Be=this.bf;a6(c,2);return}this.Xi=c[0];this.Ci=c[1]}else c=this.g,c.Be=this.bf,a6(c,2);else if(2==this.Gd)if(this.gm)o5(7),this.Go=(0,g.D)();else if("11111"==b){if(o5(6),this.gm=!0,this.Ik=(0,g.D)(),c=this.Ik-this.ot,!g.Kd||g.Hc(10)||500>c)this.bf=200,this.xd.cancel(),o5(12),G5(this.g,this,!0)}else o5(8),this.Ik=this.Go=(0,g.D)(),this.gm=!1};
g.h.Ql=function(){this.bf=this.xd.Yi;if(this.xd.je)0==this.Gd?this.Ci?(this.Gd=1,F5(this)):(this.Gd=2,H5(this)):2==this.Gd&&((!g.Kd||g.Hc(10)?!this.gm:200>this.Go-this.Ik)?(o5(11),G5(this.g,this,!1)):(o5(12),G5(this.g,this,!0)));else{0==this.Gd?o5(9):2==this.Gd&&o5(10);var a=this.g;a.Be=this.bf;a6(a,2)}};
g.h.Jj=function(){return this.g.Jj()};
g.h.isActive=function(){return this.g.isActive()};
g.h.fe=function(a){this.g.fe(a)};g.h=I5.prototype;g.h.Ki=null;g.h.hd=null;g.h.Jb=null;g.h.bo=null;g.h.Mk=null;g.h.Jr=null;g.h.Uk=null;g.h.wj=0;g.h.tG=0;g.h.Fc=null;g.h.Hf=null;g.h.Re=null;g.h.rg=null;g.h.Ef=null;g.h.Lm=null;g.h.Fh=-1;g.h.hu=-1;g.h.Be=-1;g.h.rh=0;g.h.kh=0;g.h.pg=8;var b6=new g.Ff;g.B(J5,g.bf);g.B(K5,g.bf);g.B(L5,g.bf);g.h=I5.prototype;g.h.connect=function(a,b,c,d,e){o5(0);this.bo=b;this.Ki=c||{};d&&g.t(e)&&(this.Ki.OSID=d,this.Ki.OAID=e);this.C?(y5((0,g.A)(this.hs,this,a),100),R5(this)):this.hs(a)};
g.h.hs=function(a){this.Ef=new D5(this);this.Ef.co=null;this.Ef.l=this.B;this.Ef.connect(a)};
g.h.mt=function(){return 0==this.g};
g.h.Pw=function(a){this.Hf=null;W5(this,a)};
g.h.Ow=function(){this.Re=null;this.Jb=new i5(this,this.o,"rpc",this.F);this.Jb.xg=null;this.Jb.fo=0;var a=this.Jr.clone();g.Ro(a,"RID","rpc");g.Ro(a,"SID",this.o);g.Ro(a,"CI",this.Lm?"0":"1");g.Ro(a,"AID",this.Fh);N5(this,a);if(!g.Kd||g.Hc(10))g.Ro(a,"TYPE","xmlhttp"),l5(this.Jb,a,!0,this.Uk,!1);else{g.Ro(a,"TYPE","html");var b=this.Jb,c=!!this.Uk;b.yh=3;b.Mf=n4(a.clone());w5(b,c)}};
g.h.Lw=function(a,b){if(0!=this.g&&(this.Jb==a||this.hd==a))if(this.Be=a.Yi,this.hd==a&&3==this.g)if(7<this.pg){try{var c=this.B.parse(b)}catch(f){c=null}if(g.Ca(c)&&3==c.length)if(0==c[0])a:{if(!this.Re){if(this.Jb)if(this.Jb.di+3E3<this.hd.di)S5(this),this.Jb.cancel(),this.Jb=null;else break a;Z5(this);o5(19)}}else this.hu=c[1],0<this.hu-this.Fh&&37500>c[2]&&this.Lm&&0==this.kh&&!this.rg&&(this.rg=y5((0,g.A)(this.WG,this),6E3));else a6(this,11)}else b!=lla.LM.g&&a6(this,11);else if(this.Jb==a&&
S5(this),!g.yb(b)){c=this.B.parse(b);g.Ca(c);for(var d=0;d<c.length;d++){var e=c[d];this.Fh=e[0];e=e[1];2==this.g?"c"==e[0]?(this.o=e[1],this.Uk=e[2],e=e[3],null!=e?this.pg=e:this.pg=6,this.g=3,this.Fc&&this.Fc.Sr(),this.Jr=E5(this,this.Jj()?this.Uk:null,this.bo),X5(this)):"stop"==e[0]&&a6(this,7):3==this.g&&("stop"==e[0]?a6(this,7):"noop"!=e[0]&&this.Fc&&this.Fc.Rr(e),this.kh=0)}}};
g.h.WG=function(){null!=this.rg&&(this.rg=null,this.Jb.cancel(),this.Jb=null,Z5(this),o5(20))};
g.h.Ql=function(a){if(this.Jb==a){S5(this);this.Jb=null;var b=2}else if(this.hd==a)this.hd=null,b=1;else return;this.Be=a.Yi;if(0!=this.g)if(a.je)1==b?(b=(0,g.D)()-a.di,b6.dispatchEvent(new K5(b6,a.Sg?a.Sg.length:0,b,this.rh)),Q5(this),this.A.length=0):X5(this);else{var c=a.Nf,d;if(!(d=3==c||7==c||0==c&&0<this.Be)){if(d=1==b)this.hd||this.Hf||1==this.g||2<=this.rh?d=!1:(this.Hf=y5((0,g.A)(this.Pw,this,a),Y5(this,this.rh)),this.rh++,d=!0);d=!(d||2==b&&Z5(this))}if(d)switch(c){case 1:a6(this,5);break;
case 4:a6(this,10);break;case 3:a6(this,6);break;case 7:a6(this,12);break;default:a6(this,2)}}};
g.h.IA=function(a){if(!g.Va(arguments,this.g))throw Error("Unexpected channel state: "+this.g);};
g.h.qL=function(a){a?o5(2):(o5(1),$5(this,8))};
g.h.En=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new z4;a.Z=!1;return a};
g.h.isActive=function(){return!!this.Fc&&this.Fc.isActive(this)};
g.h.fe=function(a){b6.dispatchEvent(new L5(b6,a))};
g.h.Jj=function(){return!(!g.Kd||g.Hc(10))};
g.h=c6.prototype;g.h.Sr=function(){};
g.h.Rr=function(){};
g.h.Qr=function(){};
g.h.wn=function(){};
g.h.Rs=function(){return{}};
g.h.isActive=function(){return!0};g.B(d6,g.G);g.h=d6.prototype;g.h.aK=function(){this.Gc=Math.min(3E5,2*this.Gc);this.o();this.l&&this.start()};
g.h.start=function(){var a=this.Gc+15E3*Math.random();g.sq(this.g,a);this.l=(0,g.D)()+a};
g.h.stop=function(){this.g.stop();this.l=0};
g.h.isActive=function(){return this.g.isActive()};
g.h.reset=function(){this.g.stop();this.Gc=5E3};g.B(e6,c6);g.h=e6.prototype;g.h.subscribe=function(a,b,c){return this.o.subscribe(a,b,c)};
g.h.unsubscribe=function(a,b,c){return this.o.unsubscribe(a,b,c)};
g.h.Ac=function(a){return this.o.Ac(a)};
g.h.P=function(a,b){return this.o.P.apply(this.o,arguments)};
g.h.dispose=function(){this.J||(this.J=!0,g.$e(this.o),f6(this),g.$e(this.l),this.l=null)};
g.h.ga=function(){return this.J};
g.h.connect=function(a,b,c){if(!this.g||2!=this.g.g){this.I="";this.l.stop();this.B=a||null;this.A=b||0;a=this.L+"/test";b=this.L+"/bind";var d=new I5(c?c.firstTestResults:null,c?c.secondTestResults:null,this.N),e=this.g;e&&(e.Fc=null);d.Fc=this;this.g=d;e?this.g.connect(a,b,this.C,e.o,e.Fh):c?this.g.connect(a,b,this.C,c.sessionId,c.arrayId):this.g.connect(a,b,this.C)}};
g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.tc(c,b);this.l.isActive()||2==(this.g?this.g.g:0)?this.F.push(c):g6(this)&&T5(this.g,c)};
g.h.Sr=function(){this.l.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)T5(this.g,a[b])}this.P("handlerOpened")};
g.h.Qr=function(a){var b=2==a&&401==this.g.Be;4==a||b||this.l.start();this.P("handlerError",a)};
g.h.wn=function(a){if(!this.l.isActive())this.P("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.Rs=function(){var a={v:2};this.I&&(a.gsessionid=this.I);0!=this.A&&(a.ui=""+this.A);0!=this.G&&(a.ui=""+this.G);this.B&&g.tc(a,this.B);return a};
g.h.Rr=function(a){"S"==a[0]?this.I=a[1]:"gracefulReconnect"==a[0]?(this.l.start(),P5(this.g)):this.P("handlerMessage",new Cka(a[0],a[1]))};
g.h.SL=function(){this.l.isActive();var a=this.g,b=0;a.Jb&&b++;a.hd&&b++;0!=b||this.connect(this.B,this.A)};h6.prototype.A=function(a,b,c,d){b?a(d):a({text:c.responseText})};
h6.prototype.o=function(a,b){a(Error("Request error: "+b.status))};
h6.prototype.B=function(a){a(Error("request timed out"))};var Ika=(0,g.D)(),m6=null,q6=Array(50),p6=-1,r6=!1;g.B(s6,g.O);s6.prototype.qd=function(){return this.g};
s6.prototype.contains=function(a){return!!M4(this.g,a)};
s6.prototype.get=function(a){return a?N4(this.g,a):null};
s6.prototype.info=function(a){o6(this.F,a)};g.B(u6,g.O);var z8=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.h=u6.prototype;g.h.start=function(){!this.g&&(0,window.isNaN)(this.Aa)&&this.bz()};
g.h.stop=function(){this.g&&(this.g.abort(),this.g=null);(0,window.isNaN)(this.Aa)||(g.Xr(this.Aa),this.Aa=window.NaN)};
g.h.U=function(){this.stop();u6.wa.U.call(this)};
g.h.bz=function(){this.Aa=window.NaN;this.g=g.ms(i6(this.C,"/pairing/get_screen"),{method:"POST",fb:{pairing_code:this.B},timeout:5E3,onSuccess:(0,g.A)(this.UL,this),onError:(0,g.A)(this.TL,this),Xc:(0,g.A)(this.VL,this)})};
g.h.UL=function(a,b){this.g=null;var c=b.screen||{};c.dialId=this.o;c.name=this.A;this.P("pairingComplete",new F4(c))};
g.h.TL=function(a){this.g=null;a.status&&404==a.status?this.l>=z8.length?this.P("pairingFailed",Error("DIAL polling timed out")):(a=z8[this.l],this.Aa=g.Vr((0,g.A)(this.bz,this),a),this.l++):this.P("pairingFailed",Error("Server error "+a.status))};
g.h.VL=function(){this.g=null;this.P("pairingFailed",Error("Server not responding"))};g.B(w6,s6);g.h=w6.prototype;g.h.start=function(){v6(this)&&this.P("screenChange");!g.Qu("yt-remote-lounge-token-expiration")&&x6(this);g.Xr(this.l);this.l=g.Vr((0,g.A)(this.start,this),1E4)};
g.h.add=function(a,b){v6(this);t6(this,a);y6(this,!1);this.P("screenChange");b(a);a.token||x6(this)};
g.h.remove=function(a,b){var c=v6(this);Kka(this,a)&&(y6(this,!1),c=!0);b(a);c&&this.P("screenChange")};
g.h.Gm=function(a,b,c,d){var e=v6(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,y6(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.P("screenChange")};
g.h.U=function(){g.Xr(this.l);w6.wa.U.call(this)};
g.h.jB=function(a){v6(this);var b=this.g.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)}y6(this,!b);b&&o6(this.F,"Missed "+b+" lounge tokens.")};
g.h.iB=function(a){o6(this.F,"Requesting lounge tokens failed: "+a)};g.B(A6,g.O);g.h=A6.prototype;g.h.start=function(){var a=(0,window.parseInt)(g.Qu("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.D)()-144E5<a?0:a)?D6(this):(this.A=(0,g.D)()+3E5,g.Pu("yt-remote-fast-check-period",this.A),this.jq())};
g.h.isEmpty=function(){return g.lc(this.g)};
g.h.update=function(){z6("Updating availability on schedule.");var a=this.C(),b=g.$b(this.g,function(b,d){return b&&!!N4(a,d)},this);
C6(this,b)};
g.h.U=function(){g.Xr(this.o);this.o=window.NaN;this.l&&(this.l.abort(),this.l=null);A6.wa.U.call(this)};
g.h.jq=function(){g.Xr(this.o);this.o=window.NaN;this.l&&this.l.abort();var a=E6(this);if(g.cc(a)){var b=i6(this.B,"/pairing/get_screen_availability");this.l=j6(this.B,b,{lounge_token:g.fc(a).join(",")},(0,g.A)(this.GJ,this,a),(0,g.A)(this.FJ,this))}else C6(this,{}),D6(this)};
g.h.GJ=function(a,b){this.l=null;var c=g.fc(E6(this));if(g.rb(c,g.fc(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;C6(this,d);D6(this)}else this.zb("Changing Screen set during request."),this.jq()};
g.h.FJ=function(a){this.zb("Screen availability failed: "+a);this.l=null;D6(this)};
g.h.zb=function(a){o6("OnlineScreenService",a)};g.B(F6,s6);g.h=F6.prototype;g.h.start=function(){this.o.start();this.l.start();this.g.length&&(this.P("screenChange"),this.l.isEmpty()||this.P("onlineScreenChange"))};
g.h.add=function(a,b,c){this.o.add(a,b,c)};
g.h.remove=function(a,b,c){this.o.remove(a,b,c);this.l.update()};
g.h.Gm=function(a,b,c,d){this.o.contains(a)?this.o.Gm(a,b,c,d):(a="Updating name of unknown screen: "+a.name,o6(this.F,a),d(Error(a)))};
g.h.qd=function(a){return a?this.g:g.cb(this.g,(0,g.$d)(this.A,function(a){return!this.contains(a)},this))};
g.h.cz=function(){return(0,g.$d)(this.qd(!0),function(a){return!!this.l.g[a.id]},this)};
g.h.dz=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new u6(this.C,a,b,c);f.subscribe("pairingComplete",(0,g.A)(function(a){g.$e(f);d(G6(this,a))},this));
f.subscribe("pairingFailed",function(a){g.$e(f);e(a)});
f.start();return(0,g.A)(f.stop,f)};
g.h.XL=function(a,b,c,d){g.ms(i6(this.C,"/pairing/get_screen"),{method:"POST",fb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.A)(function(a,d){var e=new F4(d.screen||{});if(!e.name||I6(this,e.name)){a:{var f=e.name;for(var m=2,n=b(f,m);I6(this,n);){m++;if(20<m)break a;n=b(f,m)}f=n}e.name=f}c(G6(this,e))},this),
onError:(0,g.A)(function(a){d(Error("pairing request failed: "+a.status))},this),
Xc:(0,g.A)(function(){d(Error("pairing request timed out."))},this)})};
g.h.U=function(){g.$e(this.o);g.$e(this.l);F6.wa.U.call(this)};
g.h.vB=function(){J6(this);this.P("screenChange");this.l.update()};
F6.prototype.dispose=F6.prototype.dispose;g.B(L6,g.O);g.h=L6.prototype;g.h.Rl=function(a){this.o=a;this.P("sessionScreen",this.o)};
g.h.wd=function(a){this.ga()||(a&&M6(this,""+a),this.o=null,this.P("sessionScreen",null))};
g.h.info=function(a){o6(this.N,a)};
g.h.fz=function(){return null};
g.h.oq=function(a){var b=this.l;a?(b.displayStatus=new window.chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;window.chrome.cast.setReceiverDisplayStatus(b,(0,g.A)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.A)(function(){M6(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.h.U=function(){this.oq("");L6.wa.U.call(this)};g.B(O6,L6);g.h=O6.prototype;g.h.nq=function(a){if(this.g){if(this.g==a)return;M6(this,"Overriding cast sesison with new session object");this.g.removeUpdateListener(this.C);this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B)}this.g=a;this.g.addUpdateListener(this.C);this.g.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.B);Oka(this)};
g.h.Gh=function(a){this.info("launchWithParams no-op for Cast: "+g.Mg(a))};
g.h.stop=function(){this.g?this.g.stop((0,g.A)(function(){this.wd()},this),(0,g.A)(function(){this.wd(Error("Failed to stop receiver app."))},this)):this.wd(Error("Stopping cast device witout session."))};
g.h.oq=g.za;g.h.U=function(){this.info("disposeInternal");g.Xr(this.A);this.A=0;this.g&&(this.g.removeUpdateListener(this.C),this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B));this.g=null;O6.wa.U.call(this)};
g.h.DK=function(a,b){if(!this.ga())if(b){var c=g.Dq(b);if(g.Fa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Mg(c));switch(d){case "mdxSessionStatus":N6(this,c.screenId);break;default:M6(this,"Unknown youtube message: "+d)}}else M6(this,"Unable to parse message.")}else M6(this,"No data in message.")};
g.h.ct=function(a,b,c,d){H6(this.I,this.l.label,a,this.l.friendlyName,(0,g.A)(function(e){e?b(e):0<=d?(M6(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Vr((0,g.A)(this.ct,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.h.fz=function(){return this.g};
g.h.YL=function(a){this.ga()||a||(M6(this,"Cast session died."),this.wd())};g.B(P6,L6);g.h=P6.prototype;g.h.nq=function(a){this.A=a;this.A.addUpdateListener(this.L)};
g.h.Gh=function(a){this.B=a;this.F()};
g.h.stop=function(){this.g();this.g=g.za;g.Xr(this.C);this.A?this.A.stop((0,g.A)(this.wd,this,null),(0,g.A)(this.wd,this,"Failed to stop DIAL device.")):this.wd()};
g.h.U=function(){this.g();this.g=g.za;g.Xr(this.C);this.A&&this.A.removeUpdateListener(this.L);this.A=null;P6.wa.U.call(this)};
g.h.bM=function(a){this.ga()||a||(M6(this,"DIAL session died."),this.g(),this.g=g.za,this.wd())};
g.h.uo=function(a){this.J=L4();if(this.B){var b=new window.chrome.cast.DialLaunchResponse(!0,R6(this));a(b);Q6(this)}else this.F=(0,g.A)(function(){g.Xr(this.C);this.F=g.za;this.C=window.NaN;var b=new window.chrome.cast.DialLaunchResponse(!0,R6(this));a(b);Q6(this)},this),this.C=g.Vr((0,g.A)(function(){this.F()},this),100)};
g.h.RB=function(a,b,c){H6(this.I,this.G.receiver.label,a,this.l.friendlyName,(0,g.A)(function(a){a&&a.token?(this.Rl(a),b(new window.chrome.cast.DialLaunchResponse(!1))):this.uo(b,c)},this),(0,g.A)(function(a){M6(this,"Failed to get DIAL screen: "+a);
this.uo(b,c)},this))};g.B(S6,L6);S6.prototype.stop=function(){this.wd()};
S6.prototype.nq=g.za;S6.prototype.Gh=function(){g.Xr(this.g);this.g=window.NaN;var a=N4(this.I.qd(),this.l.label);a?this.Rl(a):this.wd(Error("No such screen"))};
S6.prototype.U=function(){g.Xr(this.g);this.g=window.NaN;S6.wa.U.call(this)};g.B(T6,g.O);g.h=T6.prototype;
g.h.init=function(a,b){window.chrome.cast.timeout.requestSession=3E4;var c=new window.chrome.cast.SessionRequest(this.F);this.G||(c.dialRequest=new window.chrome.cast.DialRequest("YouTube"));var d=window.chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?window.chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:window.chrome.cast.DefaultActionPolicy.CREATE_SESSION;c=new window.chrome.cast.ApiConfig(c,(0,g.A)(this.Mw,this),(0,g.A)(this.qJ,this),d,e);c.customDialLaunchCallback=(0,g.A)(this.xH,this);window.chrome.cast.initialize(c,
(0,g.A)(function(){this.ga()||(window.chrome.cast.addReceiverActionListener(this.A),Fka(),this.l.subscribe("onlineScreenChange",(0,g.A)(this.ez,this)),this.o=Y6(this),window.chrome.cast.setCustomReceivers(this.o,g.za,(0,g.A)(function(a){this.zb("Failed to set initial custom receivers: "+g.Mg(a))},this)),this.P("yt-remote-cast2-availability-change",W6(this)),b(!0))},this),(0,g.A)(function(a){this.zb("Failed to initialize API: "+g.Mg(a));
b(!1)},this))};
g.h.iL=function(a,b){V6("Setting connected screen ID: "+a+" -> "+b);if(this.g){var c=this.g.o;if(!a||c&&c.id!=a)V6("Unsetting old screen status: "+this.g.l.friendlyName),X6(this,null)}if(a&&b){if(!this.g){c=N4(this.l.qd(),a);if(!c){V6("setConnectedScreenStatus: Unknown screen.");return}var d=U6(this,c);d||(V6("setConnectedScreenStatus: Connected receiver not custom..."),d=new window.chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=window.chrome.cast.ReceiverType.CUSTOM,this.o.push(d),
window.chrome.cast.setCustomReceivers(this.o,g.za,(0,g.A)(function(a){this.zb("Failed to set initial custom receivers: "+g.Mg(a))},this)));
V6("setConnectedScreenStatus: new active receiver: "+d.friendlyName);X6(this,new S6(this.l,d),!0)}this.g.oq(b)}else V6("setConnectedScreenStatus: no screen.")};
g.h.jL=function(a){this.ga()?this.zb("Setting connection data on disposed cast v2"):this.g?this.g.Gh(a):this.zb("Setting connection data without a session")};
g.h.aM=function(){this.ga()?this.zb("Stopping session on disposed cast v2"):this.g?(this.g.stop(),X6(this,null)):V6("Stopping non-existing session")};
g.h.requestSession=function(){window.chrome.cast.requestSession((0,g.A)(this.Mw,this),(0,g.A)(this.MJ,this))};
g.h.U=function(){this.l.unsubscribe("onlineScreenChange",(0,g.A)(this.ez,this));window.chrome&&window.chrome.cast&&window.chrome.cast.removeReceiverActionListener(this.A);g.Za(g.z("yt.mdx.remote.debug.handlers_")||[],k6);g.$e(this.g);T6.wa.U.call(this)};
g.h.zb=function(a){o6("Controller",a)};
g.h.Nw=function(a,b){this.g==a&&(b||X6(this,null),this.P("yt-remote-cast2-session-change",b))};
g.h.mJ=function(a,b){if(!this.ga())if(a)switch(a.friendlyName=window.chrome.cast.unescape(a.friendlyName),V6("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case window.chrome.cast.ReceiverAction.CAST:if(this.g)if(this.g.l.label!=a.label)V6("onReceiverAction_: Stopping active receiver: "+this.g.l.friendlyName),this.g.stop();else{V6("onReceiverAction_: Casting to active receiver.");this.g.o&&this.P("yt-remote-cast2-session-change",this.g.o);break}switch(a.receiverType){case window.chrome.cast.ReceiverType.CUSTOM:X6(this,
new S6(this.l,a));break;case window.chrome.cast.ReceiverType.DIAL:X6(this,new P6(this.l,a,this.C));break;case window.chrome.cast.ReceiverType.CAST:X6(this,new O6(this.l,a));break;default:this.zb("Unknown receiver type: "+a.receiverType)}break;case window.chrome.cast.ReceiverAction.STOP:this.g&&this.g.l.label==a.label?this.g.stop():this.zb("Stopping receiver w/o session: "+a.friendlyName)}else this.zb("onReceiverAction_ called without receiver.")};
g.h.xH=function(a){if(this.ga())return window.Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=window.chrome.cast.ReceiverType.DIAL&&(this.zb("Not DIAL receiver: "+b.friendlyName),b.receiverType=window.chrome.cast.ReceiverType.DIAL);var c=this.g?this.g.l:null;if(!c||c.label!=b.label)return this.zb("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),window.Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=window.chrome.cast.ReceiverType.DIAL){if(this.g.o)return V6("Reselecting dial screen."),
this.P("yt-remote-cast2-session-change",this.g.o),window.Promise.resolve(new window.chrome.cast.DialLaunchResponse(!1));this.zb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);X6(this,new P6(this.l,b,this.C))}b=this.g;b.G=a;return b.G.appState==window.chrome.cast.DialAppState.RUNNING?new window.Promise((0,g.A)(b.RB,b,(b.G.extraData||{}).screenId||null)):new window.Promise((0,g.A)(b.uo,b))};
g.h.Mw=function(a){if(!this.ga()){V6("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=window.chrome.cast.ReceiverType.CUSTOM){if(!this.g)if(b.receiverType==window.chrome.cast.ReceiverType.CAST)V6("Got resumed cast session before resumed mdx connection."),b.friendlyName=window.chrome.cast.unescape(b.friendlyName),X6(this,new O6(this.l,b),!0);else{this.zb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.g.l,d=N4(this.l.qd(),c.label);
d&&G4(d,b.label)&&c.receiverType!=window.chrome.cast.ReceiverType.CAST&&b.receiverType==window.chrome.cast.ReceiverType.CAST&&(V6("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.$e(this.g),this.g=new O6(this.l,b),this.g.subscribe("sessionScreen",(0,g.A)(this.Nw,this,this.g)),this.g.Gh(null));this.g.nq(a)}}};
g.h.ZL=function(){return this.g?this.g.fz():null};
g.h.MJ=function(a){this.ga()||(this.zb("Failed to estabilish a session: "+g.Mg(a)),a.code!=window.chrome.cast.ErrorCode.CANCEL&&X6(this,null))};
g.h.qJ=function(a){V6("Receiver availability updated: "+a);if(!this.ga()){var b=W6(this);this.B=a==window.chrome.cast.ReceiverAvailability.AVAILABLE;W6(this)!=b&&this.P("yt-remote-cast2-availability-change",W6(this))}};
g.h.ez=function(){this.ga()||(this.o=Y6(this),V6("Updating custom receivers: "+g.Mg(this.o)),window.chrome.cast.setCustomReceivers(this.o,g.za,(0,g.A)(function(){this.zb("Failed to set custom receivers.")},this)),this.P("yt-remote-cast2-availability-change",W6(this)))};
T6.prototype.setLaunchParams=T6.prototype.jL;T6.prototype.setConnectedScreenStatus=T6.prototype.iL;T6.prototype.stopSession=T6.prototype.aM;T6.prototype.getCastSession=T6.prototype.ZL;T6.prototype.requestSession=T6.prototype.requestSession;T6.prototype.init=T6.prototype.init;T6.prototype.dispose=T6.prototype.dispose;var g7=[];o7.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";p7(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.g=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.l=a.trackData,this.Ce=a.hasPrevious,this.hasNext=a.hasNext,this.G=a.playerTime,this.F=a.playerTimeAt,this.B=a.seekableStart,this.o=a.seekableEnd,this.I=a.duration,this.J=a.loadedTime,this.A=a.liveIngestionTime,this.C=!(0,window.isNaN)(this.A))};
o7.prototype.isAdPlaying=function(){return 1081==this.g};
o7.prototype.clone=function(){return new o7(u7(this))};g.B(x7,g.O);g.h=x7.prototype;g.h.play=function(){1==this.g?(this.l?this.l.play(null,g.za,F7(this,"play")):D7(this,"play"),C7(this,1,s7(y7(this))),this.P("remotePlayerChange")):A7(this,this.play)};
g.h.pause=function(){1==this.g?(this.l?this.l.pause(null,g.za,F7(this,"pause")):D7(this,"pause"),C7(this,2,s7(y7(this))),this.P("remotePlayerChange")):A7(this,this.pause)};
g.h.az=function(a){if(1==this.g){if(this.l){var b=y7(this),c=new window.chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.g||3==b.g?window.chrome.cast.media.ResumeState.PLAYBACK_START:window.chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.l.seek(c,g.za,F7(this,"seekTo",{newTime:a}))}else D7(this,"seekTo",{newTime:a});C7(this,3,a);this.P("remotePlayerChange")}else A7(this,g.La(this.az,a))};
g.h.stop=function(){if(1==this.g){this.l?this.l.stop(null,g.za,F7(this,"stopVideo")):D7(this,"stopVideo");var a=y7(this);a.index=-1;a.videoId="";p7(a);B7(this,a);this.P("remotePlayerChange")}else A7(this,this.stop)};
g.h.setVolume=function(a,b){if(1==this.g){var c=y7(this);if(this.o){if(c.volume!=a){var d=Math.round(a)/100;this.o.setReceiverVolumeLevel(d,(0,g.A)(function(){o6("CP","set receiver volume: "+d)},this),(0,g.A)(function(){this.zb("failed to set receiver volume.")},this))}c.muted!=b&&this.o.setReceiverMuted(b,(0,g.A)(function(){o6("CP","set receiver muted: "+b)},this),(0,g.A)(function(){this.zb("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);D7(this,"setVolume",e)}c.muted=b;c.volume=a;B7(this,c)}else A7(this,g.La(this.setVolume,a,b))};
g.h.Zx=function(a,b){if(1==this.g){var c=y7(this),d={videoId:a};b&&(c.l={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,format:b.format,kind:b.kind},d.style=g.Mg(b.style),g.tc(d,c.l));D7(this,"setSubtitlesTrack",d);B7(this,c)}else A7(this,g.La(this.Zx,a,b))};
g.h.Mq=function(a,b){if(1==this.g){D7(this,"setAudioTrack",{videoId:a,audioTrackId:b.ab.id});var c=y7(this);c.audioTrackId=b.ab.id;B7(this,c)}else A7(this,g.La(this.Mq,a,b))};
g.h.Zy=function(a,b){if(1==this.g){if(a&&b){var c=y7(this);t7(c,a,b);B7(this,c)}D7(this,"previous")}else A7(this,g.La(this.Zy,a,b))};
g.h.Yy=function(a,b){if(1==this.g){if(a&&b){var c=y7(this);t7(c,a,b);B7(this,c)}D7(this,"next")}else A7(this,g.La(this.Yy,a,b))};
g.h.Ds=function(){1==this.g?D7(this,"dismissAutoplay"):A7(this,this.Ds)};
g.h.dispose=function(){if(3!=this.g){var a=this.g;this.g=3;this.P("proxyStateChange",a,this.g)}x7.wa.dispose.call(this)};
g.h.U=function(){z7(this);this.A=null;this.B.clear();w7(this,null);x7.wa.U.call(this)};
g.h.Nq=function(a){if((a!=this.g||2==a)&&3!=this.g&&0!=a){var b=this.g;this.g=a;this.P("proxyStateChange",b,a);if(1==a)for(;!this.B.isEmpty();)b=a=this.B,0==b.g.length&&(b.g=b.l,b.g.reverse(),b.l=[]),a.g.pop().apply(this);else 3==a&&this.dispose()}};
g.h.iJ=function(a,b){this.P(a,b)};
g.h.cH=function(a){if(!a)this.yj(null),w7(this,null);else if(this.o.receiver.volume){a=this.o.receiver.volume;var b=y7(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)o6("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,B7(this,b)}};
g.h.yj=function(a){o6("CP","Cast media: "+!!a);this.l&&this.l.removeUpdateListener(this.G);if(this.l=a)this.l.addUpdateListener(this.G),E7(this),this.P("remotePlayerChange")};
g.h.bH=function(a){a?(E7(this),this.P("remotePlayerChange")):this.yj(null)};
g.h.oH=function(){var a=k7();a&&w7(this,a)};
g.h.zb=function(a){o6("CP",a)};g.B(G7,g.O);g.h=G7.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;g.t(m)&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);g.t(k)&&(l.currentIndex=k);c&&(this.Ka.listId=c);this.Ka.videoId=d;this.Ka.index=k||0;this.Ka.state=3;r7(this.Ka,m);this.A="UNSUPPORTED";H7("Connecting with setPlaylist and params: "+g.Mg(l));this.g.connect({method:"setPlaylist",params:g.Mg(l)},
a,T4())}else H7("Connecting without params"),this.g.connect({},a,T4());Vka(this)};
g.h.dispose=function(){this.ga()||(this.P("beforeDispose"),I7(this,3));G7.wa.dispose.call(this)};
g.h.U=function(){J7(this);L7(this);K7(this);g.Xr(this.I);this.I=window.NaN;g.Xr(this.J);this.J=window.NaN;this.o=null;g.tt(this.T);this.T.length=0;this.g.dispose();G7.wa.U.call(this);this.A=this.F=this.l=this.Ka=this.g=null};
g.h.cB=function(){this.C(2)};
g.h.gH=function(){H7("Channel opened");this.R&&(this.R=!1,K7(this),this.N=g.Vr((0,g.A)(function(){H7("Timing out waiting for a screen.");this.C(1)},this),15E3));
ska(Dka(this.g),this.Y)};
g.h.dH=function(){H7("Channel closed");(0,window.isNaN)(this.B)?W4(!0):W4();this.dispose()};
g.h.eH=function(a){W4();(0,window.isNaN)(this.G())?(H7("Channel error: "+a+" without reconnection"),this.dispose()):(this.R=!0,H7("Channel error: "+a+" with reconnection in "+this.G()+" ms"),I7(this,2))};
g.h.fH=function(a){a.params?H7("Received: action="+a.action+", params="+g.Mg(a.params)):H7("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=g.Dq(a.params.devices);this.l=(0,g.E)(a,function(a){return new E4(a)});
a=!!g.Ra(this.l,function(a){return"LOUNGE_SCREEN"==a.type});
O7(this,a);break;case "loungeScreenDisconnected":g.ab(this.l,function(a){return"LOUNGE_SCREEN"==a.type});
O7(this,!1);break;case "remoteConnected":var b=new E4(g.Dq(a.params.device));g.Ra(this.l,function(a){return b?a.id==b.id:!1})||g.Xa(this.l,b);
break;case "remoteDisconnected":b=new E4(g.Dq(a.params.device));g.ab(this.l,function(a){return b?a.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":P7(this,a);break;case "nowPlaying":Yka(this,a);break;case "onStateChange":Q7(this,a);break;case "onAdStateChange":Zka(this,a);break;case "onVolumeChanged":$ka(this,a);break;case "onSubtitlesTrackChanged":Xka(this,a);break;case "nowAutoplaying":ala(this,a);break;case "autoplayDismissed":this.P("autoplayDismissed");break;case "autoplayUpNext":this.F=a.params.videoId||null;this.P("autoplayUpNext",this.F);break;case "onAutoplayModeChanged":this.A=
a.params.autoplayMode;this.P("autoplayModeChange",this.A);"DISABLED"==this.A&&this.P("autoplayDismissed");break;case "onHasPreviousNextChanged":bla(this,a);break;case "requestAssistedSignIn":this.P("assistedSignInRequested",a.params.authCode);break;default:H7("Unrecognized action: "+a.action)}};
g.h.WK=function(){if(this.o){var a=this.o;this.o=null;this.Ka.videoId!=a&&M7(this,"getNowPlaying")}};
G7.prototype.subscribe=G7.prototype.subscribe;G7.prototype.unsubscribeByKey=G7.prototype.Ac;G7.prototype.ia=function(){var a=3;this.ga()||(a=0,(0,window.isNaN)(this.G())?g6(this.g)&&(0,window.isNaN)(this.B)&&(a=1):a=2);return a};
G7.prototype.getProxyState=G7.prototype.ia;G7.prototype.C=function(a){H7("Disconnecting with "+a);J7(this);this.P("beforeDisconnect",a);1==a&&W4();f6(this.g,a);this.dispose()};
G7.prototype.disconnect=G7.prototype.C;G7.prototype.fa=function(){var a=this.Ka;this.o&&(a=this.Ka.clone(),t7(a,this.o,a.index));return u7(a)};
G7.prototype.getPlayerContextData=G7.prototype.fa;
G7.prototype.na=function(a){var b=new o7(a);b.videoId&&b.videoId!=this.Ka.videoId&&(this.o=b.videoId,g.Xr(this.I),this.I=g.Vr((0,g.A)(this.WK,this),5E3));var c=[];this.Ka.listId==b.listId&&this.Ka.videoId==b.videoId&&this.Ka.index==b.index||c.push("remoteQueueChange");this.Ka.g==b.g&&this.Ka.volume==b.volume&&this.Ka.muted==b.muted&&s7(this.Ka)==s7(b)&&g.Mg(this.Ka.l)==g.Mg(b.l)||c.push("remotePlayerChange");this.Ka.reset(a);(0,g.C)(c,function(a){this.P(a)},this)};
G7.prototype.setPlayerContextData=G7.prototype.na;G7.prototype.Z=function(){var a=this.g.C.id,b=g.Ra(this.l,function(b){return"REMOTE_CONTROL"==b.type&&b.id!=a});
return b?b.id:""};
G7.prototype.getOtherConnectedRemoteId=G7.prototype.Z;G7.prototype.G=function(){var a=this.g;return a.l.isActive()?a.l.l-(0,g.D)():window.NaN};
G7.prototype.getReconnectTimeout=G7.prototype.G;G7.prototype.X=function(){return this.A||"UNSUPPORTED"};
G7.prototype.getAutoplayMode=G7.prototype.X;G7.prototype.ea=function(){return this.F||""};
G7.prototype.getAutoplayVideoId=G7.prototype.ea;G7.prototype.va=function(){if(!(0,window.isNaN)(this.G())){var a=this.g.l;g.tq(a.g);a.start()}};
G7.prototype.reconnect=G7.prototype.va;G7.prototype.la=function(a,b){M7(this,a,b);N7(this)};
G7.prototype.sendMessage=G7.prototype.la;g.B(R7,s6);g.h=R7.prototype;g.h.qd=function(a){return this.yc.$_gs(a)};
g.h.contains=function(a){return!!this.yc.$_c(a)};
g.h.get=function(a){return this.yc.$_g(a)};
g.h.start=function(){this.yc.$_st()};
g.h.add=function(a,b,c){this.yc.$_a(a,b,c)};
g.h.remove=function(a,b,c){this.yc.$_r(a,b,c)};
g.h.Gm=function(a,b,c,d){this.yc.$_un(a,b,c,d)};
g.h.U=function(){for(var a=0,b=this.l.length;a<b;++a)this.yc.$_ubk(this.l[a]);this.l.length=0;this.yc=null;R7.wa.U.call(this)};
g.h.WL=function(){this.P("screenChange")};
g.h.NI=function(){this.P("onlineScreenChange")};
F6.prototype.$_st=F6.prototype.start;F6.prototype.$_gspc=F6.prototype.XL;F6.prototype.$_gsppc=F6.prototype.dz;F6.prototype.$_c=F6.prototype.contains;F6.prototype.$_g=F6.prototype.get;F6.prototype.$_a=F6.prototype.add;F6.prototype.$_un=F6.prototype.Gm;F6.prototype.$_r=F6.prototype.remove;F6.prototype.$_gs=F6.prototype.qd;F6.prototype.$_gos=F6.prototype.cz;F6.prototype.$_s=F6.prototype.subscribe;F6.prototype.$_ubk=F6.prototype.Ac;var S7=null,T7=null,i8=null,X7=[];g.r(l8,g.G);g.h=l8.prototype;
g.h.U=function(){g.G.prototype.U.call(this);this.A.stop();this.B.stop();this.L.stop();this.R();this.g.unsubscribe("proxyStateChange",this.Kw,this);this.g.unsubscribe("remotePlayerChange",this.zj,this);this.g.unsubscribe("remoteQueueChange",this.Sl,this);this.g.unsubscribe("autoplayUpNext",this.lw,this);this.g.unsubscribe("previousNextChange",this.Hw,this);this.g.unsubscribe("nowAutoplaying",this.Dw,this);this.g.unsubscribe("autoplayDismissed",this.kw,this);this.g=this.G=null};
g.h.jv=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.g.g)if(p8(this)){if(!y7(this.g).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==y7(this.g).g?this.g.pause():this.g.play();break;case "control_play":this.g.play();break;case "control_pause":this.g.pause();break;case "control_seek":this.J.wh(c[0],c[1]);break;case "control_subtitles_set_track":q8(this,c[0]);break;case "control_set_audio_track":c=c[0],p8(this)&&this.g.Mq(this.l.getVideoData(1).videoId,
c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.l.getCurrentTime();r8(this,0==c?void 0:c);break;case "control_seek":r8(this,c[0]);break;case "control_subtitles_set_track":q8(this,c[0]);break;case "control_set_audio_track":c=c[0],p8(this)&&this.g.Mq(this.l.getVideoData(1).videoId,c)}};
g.h.aH=function(a){this.L.XA(a)};
g.h.DL=function(a){this.jv("control_subtitles_set_track",g.lc(a)?null:a)};
g.h.oy=function(){var a=this.l.Mb("captions","track");g.lc(a)||q8(this,a)};
g.h.Bw=function(a){if(p8(this)){this.g.unsubscribe("remotePlayerChange",this.zj,this);var b=Math.round(a.volume);a=!!a.muted;var c=y7(this.g);if(b!=c.volume||a!=c.muted)this.g.setVolume(b,a),this.N.start();this.g.subscribe("remotePlayerChange",this.zj,this)}};
g.h.dI=function(){g.lc(this.C)||s8(this,this.C);this.F=!1};
g.h.Kw=function(a,b){this.B.stop();2==b&&this.my()};
g.h.zj=function(){if(p8(this)){this.A.stop();var a=y7(this.g);switch(a.g){case 1081:case 1:n8(this,new g.tD(8));this.ly();break;case 1085:case 3:n8(this,new g.tD(9));break;case 1083:case 0:n8(this,new g.tD(2));this.J.stop();m8(this,this.l.getVideoData().lengthSeconds);break;case 1084:n8(this,new g.tD(4));break;case 2:n8(this,new g.tD(4));m8(this,s7(a));break;case -1:n8(this,new g.tD(64));break;case -1E3:n8(this,new g.tD(128,{errorCode:"mdx.remoteerror",message:"\u0412\u0438\u0434\u0435\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f."}))}a=
y7(this.g).l;var b=this.C;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.format==b.format&&a.kind==b.kind:1)||(this.C=a,s8(this,a));a=y7(this.g);-1==a.volume||Math.round(this.l.Bb())==a.volume&&this.l.isMuted()==a.muted||this.N.isActive()||this.Oy()}else o8(this)};
g.h.Hw=function(){this.l.P("mdxpreviousnextchange")};
g.h.Sl=function(){p8(this)||o8(this)};
g.h.wA=function(){this.g.Ds()};
g.h.lw=function(a){a&&(a=g.ms("/watch_queue_ajax",{method:"GET",wc:{action_get_watch_queue_item:1,video_id:a},onSuccess:(0,g.A)(this.lK,this)}))&&(this.R=(0,g.A)(a.abort,a))};
g.h.lK=function(a,b){var c=new g.nC({videoId:b.videoId,title:b.title,author:b.author,murlmq_webp:b.url});this.suggestion=c;this.l.P("mdxautoplayupnext",c)};
g.h.Dw=function(a){(0,window.isNaN)(a)||this.l.P("mdxnowautoplaying",a)};
g.h.kw=function(){this.l.P("mdxautoplaycanceled")};
g.h.QE=function(a,b){-1==y7(this.g).g?r8(this,a):b&&this.g.az(a)};
g.h.Oy=function(){if(p8(this)){var a=y7(this.g);this.o.Na(this.T);a.muted?this.l.mute():this.l.Ge();this.l.setVolume(a.volume);this.T=this.o.M(this.l,"onVolumeChange",this.Bw)}};
g.h.ly=function(){this.A.stop();if(!this.g.ga()){var a=y7(this.g);1==a.g&&n8(this,new g.tD(8));m8(this,s7(a));this.A.start()}};
g.h.my=function(){this.B.stop();this.A.stop();var a=this.g.A.getReconnectTimeout();2==this.g.g&&!(0,window.isNaN)(a)&&this.B.start()};g.r(v8,g.R);v8.prototype.A=function(a){u8(this,a.state)};g.r(w8,g.JT);w8.prototype.J=function(){var a=this.l.Mb("remote","receivers");a&&1<a.length&&!this.l.Mb("remote","quickCast")?(this.G=g.ub(a,this.B,this),g.KT(this,(0,g.E)(a,this.B)),a=this.l.Mb("remote","currentReceiver"),this.ee(this.B(a)),this.enable(!0)):this.enable(!1)};
w8.prototype.B=function(a){return a.key};
w8.prototype.de=function(a){return"cast-selector-receiver"==a?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":this.G[a].name};
w8.prototype.Ic=function(a){g.JT.prototype.Ic.call(this,a);this.l.Vc("remote","currentReceiver",this.G[a]);this.A.nb()};g.r(x8,g.HK);g.h=x8.prototype;g.h.create=function(){hla(g.KA(g.V(this.g)));this.C.push(g.Ut("yt-remote-before-disconnect",this.XG,this));this.C.push(g.Ut("yt-remote-connection-change",this.rJ,this));this.C.push(g.Ut("yt-remote-receiver-availability-change",this.Iw,this));this.C.push(g.Ut("yt-remote-auto-connect",this.pJ,this));this.C.push(g.Ut("yt-remote-receiver-resumed",this.oJ,this));this.Iw()};
g.h.load=function(){this.g.mp();g.HK.prototype.load.call(this);this.B=new l8(this,this.g,this.l);var a=(a=k8())?a.currentTime:0;var b=h8()?new x7(c8(),void 0):null;0==a&&b&&(a=s7(y7(b)));0!=a&&(this.I=a||0,this.g.P("progresssync",a,void 0));t8(this,this.F,this.F);g.GV(this.g.app,6)};
g.h.unload=function(){this.g.P("mdxautoplaycanceled");this.A=this.o;g.af(this.B,this.l);this.l=this.B=null;g.HK.prototype.unload.call(this);g.GV(this.g.app,5)};
g.h.U=function(){g.Vt(this.C);g.HK.prototype.U.call(this)};
g.h.rj=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.jv.apply(this.B,[a].concat(g.oa(c)))};
g.h.UA=function(){return this.loaded?this.B.suggestion:null};
g.h.Ce=function(){return this.l?y7(this.l).Ce:!1};
g.h.hasNext=function(){return this.l?y7(this.l).hasNext:!1};
g.h.getCurrentTime=function(){return this.I};
g.h.GE=function(){var a=y7(this.l),b=this.g.getVideoData();return{allowSeeking:this.g.zc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.C?a.I+q7(a):a.I,ingestionTime:a.C?a.A+q7(a):a.A,isPeggedToLive:1>=(a.C?a.o+q7(a):a.o)-this.getCurrentTime(),loaded:a.J,seekableEnd:a.C?a.o+q7(a):a.o,seekableStart:0<a.B?a.B+q7(a):a.B}};
g.h.HE=function(){this.l&&this.l.Yy()};
g.h.IE=function(){this.l&&this.l.Zy()};
g.h.XG=function(a){1==a&&(this.J=this.l?y7(this.l):null)};
g.h.rJ=function(){var a=h8()?new x7(c8(),void 0):null;if(a){var b=this.A;this.loaded&&this.unload();this.l=a;this.J=null;b.key!=this.o.key&&(this.A=b,this.load())}else g.$e(this.l),this.l=null,this.loaded&&(this.unload(),(a=this.J)&&a.videoId==this.g.getVideoData().videoId&&this.g.Mu(a.videoId,s7(a)));this.g.P("videodatachange","newdata",this.g.getVideoData(),3)};
g.h.Iw=function(){this.G=[this.o].concat(ila());var a=d8()||this.o;y8(this,a);this.g.ma("onMdxReceiversChange")};
g.h.pJ=function(){var a=d8();y8(this,a)};
g.h.oJ=function(){this.A=d8()};
g.h.FE=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.G;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?m7():y8(this,b)),this.loaded?this.A:this.o;case "quickCast":return 2==this.G.length&&"cast-selector-receiver"==this.G[1].key?(b&&m7(),!0):!1}};
g.h.JE=function(){D7(this.l,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.h.Wb=function(){return!1};g.MQ.remote=x8;})(_yt_player);
