5da7fc8a672d1875430bd940540efc20471d240a09bf4a5799345fbc8ceea651

Source Code:

(function(g){var window=this;var vHa=function(a,b){return g.Tb(a,b)},Z5=function(a,b,c){a.C.set(b,c)},$5=function(a){Z5(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.A()).toString(36));
return a},a6=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
g.gn(a.C,b,c)},wHa=function(a,b){var c=[];
g.$i(b,function(d){try{var e=g.Vn.prototype.B.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.Un(e)&&c.push(d)},a);
return c},xHa=function(a,b){var c=wHa(a,b);
g.Fb(c,function(d){g.Vn.prototype.remove.call(this,d)},a)},yHa=function(a){if(a.ae){if(a.ae.locationOverrideToken)return{locationOverrideToken:a.ae.locationOverrideToken};
if(null!=a.ae.latitudeE7&&null!=a.ae.longitudeE7)return{latitudeE7:a.ae.latitudeE7,longitudeE7:a.ae.longitudeE7}}return null},zHa=function(a,b){g.nb(a,b)||a.push(b)},b6=function(a){var b=0,c;
for(c in a)b++;return b},AHa=function(a,b){var c=b instanceof g.Fc?b:g.Lc(b,/^data:image\//i.test(b));
a.src=g.Gc(c)},c6=function(){},BHa=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);},CHa=function(a){if(a.rf&&"function"==typeof a.rf)return a.rf();
if("string"===typeof a)return a.split("");if(g.Ra(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Pb(a)},DHa=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.Ra(a)||"string"===typeof a)g.Fb(a,b,void 0);else{if(a.xg&&"function"==typeof a.xg)var c=a.xg();else if(a.rf&&"function"==typeof a.rf)c=void 0;else if(g.Ra(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Qb(a);d=CHa(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},EHa=function(a,b,c,d){var e=new g.Vm(null,void 0);
a&&g.Wm(e,a);b&&g.Xm(e,b);c&&g.Ym(e,c);d&&(e.B=d);return e},d6=function(a,b){g.Ho[a]=!0;
var c=g.Fo();c&&c.publish.apply(c,arguments);g.Ho[a]=!1},e6=function(a){this.app=this.name=this.id="";
this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Sm;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",FHa(this,a.capabilities||""),GHa(this,a.experiments||""))},FHa=function(a,b){a.capabilities.clear();
g.Je(b.split(","),g.Va(vHa,HHa)).forEach(function(c){a.capabilities.add(c)})},GHa=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},f6=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||""},g6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},IHa=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid}},JHa=function(a){return new f6(a)},KHa=function(a){return Array.isArray(a)?g.Pc(a,JHa):[]},h6=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"},i6=function(a){return Array.isArray(a)?"["+g.Pc(a,h6).join(",")+"]":"null"},j6=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)})},LHa=function(a){return g.Pc(a,function(b){return{key:b.id,
name:b.name}})},k6=function(a,b){return g.jb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},l6=function(a,b){return g.jb(a,function(c){return g6(c,b)})},MHa=function(){var a=(0,g.qt)();
a&&xHa(a,a.u.Ui(!0))},m6=function(){var a=g.ut("yt-remote-connected-devices")||[];
g.Cb(a);return a},NHa=function(a){if(g.ob(a))return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.Pc(a,function(d,e){return 0==e?d:d.substring(c.length)})},OHa=function(a){g.tt("yt-remote-connected-devices",a,86400)},o6=function(){if(n6)return n6;
var a=g.ut("yt-remote-device-id");a||(a=j6(),g.tt("yt-remote-device-id",a,31536E3));for(var b=m6(),c=1,d=a;g.nb(b,d);)c++,d=a+"#"+c;return n6=d},p6=function(){var a=m6(),b=o6();
g.nb(a,b);g.wt()&&g.Eb(a,b);a=NHa(a);if(g.ob(a))try{g.tq("remote_sid")}catch(c){}else try{g.rq("remote_sid",a.join(","),-1)}catch(c){}},PHa=function(){return g.ut("yt-remote-session-browser-channel")},QHa=function(){return g.ut("yt-remote-local-screens")||[]},RHa=function(){g.tt("yt-remote-lounge-token-expiration",!0,86400)},SHa=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=g.Pc(QHa(),function(d){return d.loungeToken}),c=g.Pc(a,function(d){return d.loungeToken});
g.gh(c,function(d){return!g.nb(b,d)})&&RHa();
g.tt("yt-remote-local-screens",a,31536E3)},THa=function(a,b){g.tt("yt-remote-session-browser-channel",a);
g.tt("yt-remote-session-screen-id",b);var c=m6(),d=o6();g.nb(c,d)||c.push(d);OHa(c);p6()},q6=function(a){a||(g.vt("yt-remote-session-screen-id"),g.vt("yt-remote-session-video-id"));
p6();a=m6();g.rb(a,o6());OHa(a)},UHa=function(){if(!r6){var a=g.fo();
a&&(r6=new g.Pn(a))}return r6?!!r6.get("yt-remote-use-staging-server"):!1},VHa=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},WHa=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},s6=function(a){a.length?XHa(a.shift(),function(){s6(a)}):t6()},YHa=function(a){return"chrome-extension://"+a+"/cast_sender.js"},XHa=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);g.jd(d,g.jg(a));(document.head||document.documentElement).appendChild(d)},t6=function(){var a=WHa();
a&&a(!1,"No cast extension found")},$Ha=function(){if(ZHa){var a=2,b=WHa(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;XHa("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",t6,c)}},aIa=function(){$Ha();
var a=(a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/))?parseInt(a[1],10):0;var b=[];if(0!=a){var c=a-1;b.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");b.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}b.push("//www.gstatic.com/eureka/clank/cast_sender.js");s6(b)},u6=function(a,b,c){g.B.call(this);
this.G=null!=c?(0,g.z)(a,c):a;this.df=b;this.F=(0,g.z)(this.kJ,this);this.u=!1;this.B=0;this.C=this.Va=null;this.D=[]},v6=function(a,b,c){g.B.call(this);
this.D=null!=c?a.bind(c):a;this.df=b;this.C=null;this.u=!1;this.B=0;this.Va=null},w6=function(a){a.Va=g.Qm(function(){a.Va=null;
a.u&&!a.B&&(a.u=!1,w6(a))},a.df);
var b=a.C;a.C=null;a.D.apply(null,b)},x6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return BHa(a)},y6=function(){},z6=function(a,b){if("function"!==typeof a)throw Error("Fn must not be null and must be a function");
return g.v.setTimeout(function(){a()},b)},B6=function(a){A6.dispatchEvent(new bIa(A6,a))},bIa=function(a){g.Il.call(this,"statevent",a)},C6=function(){},cIa=function(){},eIa=function(a){return(a=dIa(a))?new ActiveXObject(a):new XMLHttpRequest},dIa=function(a){if(!a.B&&"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.B=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.B},D6=function(a,b,c,d){this.u=a;
this.B=b;this.P=c;this.K=d||1;this.F=45E3;this.D=new g.k1(this);this.C=new g.Pm;this.C.setInterval(250)},gIa=function(a,b,c){a.Xn=1;
a.Vj=$5(b.clone());a.im=c;a.G=!0;fIa(a,null)},E6=function(a,b,c,d,e){a.Xn=1;
a.Vj=$5(b.clone());a.im=null;a.G=c;e&&(a.LF=!1);fIa(a,d)},fIa=function(a,b){a.On=g.A();
F6(a);a.Kk=a.Vj.clone();a6(a.Kk,"t",a.K);a.Iq=0;a.ee=a.u.Jv(a.u.qq()?b:null);0<a.Bw&&(a.Xt=new v6((0,g.z)(a.KG,a,a.ee),a.Bw));a.D.wa(a.ee,"readystatechange",a.sQ);var c=a.Gl?g.Zb(a.Gl):{};a.im?(a.Fu="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.ee.send(a.Kk,a.Fu,a.im,c)):(a.Fu="GET",a.LF&&!g.ze&&(c.Connection="close"),a.ee.send(a.Kk,a.Fu,null,c));a.u.wh(1)},jIa=function(a,b,c){for(var d=!0;!a.ll&&a.Iq<c.length;){var e=hIa(a,c);
if(e==G6){4==b&&(a.lk=4,B6(15),d=!1);break}else if(e==iIa){a.lk=4;B6(16);d=!1;break}else H6(a,e)}4==b&&0==c.length&&(a.lk=1,B6(17),d=!1);a.Fh=a.Fh&&d;d||(I6(a),J6(a))},hIa=function(a,b){var c=a.Iq,d=b.indexOf("\n",c);
if(-1==d)return G6;c=Number(b.substring(c,d));if(isNaN(c))return iIa;d+=1;if(d+c>b.length)return G6;var e=b.substr(d,c);a.Iq=d+c;return e},lIa=function(a,b){a.On=g.A();
F6(a);var c=b?window.location.hostname:"";a.Kk=a.Vj.clone();Z5(a.Kk,"DOMAIN",c);Z5(a.Kk,"t",a.K);try{a.Kh=new ActiveXObject("htmlfile")}catch(n){I6(a);a.lk=7;B6(22);J6(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var h=c.charAt(f);if("<"==h)h=e+"\\x3c";else if(">"==h)h=e+"\\x3e";else{if(h in K6)h=K6[h];else if(h in kIa)h=K6[h]=kIa[h];else{var l=h.charCodeAt(0);if(31<l&&127>l)var m=h;else{if(256>l){if(m="\\x",16>l||256<l)m+="0"}else m="\\u",4096>l&&(m+="0");m+=l.toString(16).toUpperCase()}h=
K6[h]=m}h=e+h}e=h}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.gd(g.jc("b/12014412"),d+"</body></html>");a.Kh.open();a.Kh.write(g.cd(c));a.Kh.close();a.Kh.parentWindow.m=(0,g.z)(a.GP,a);a.Kh.parentWindow.d=(0,g.z)(a.KE,a,!0);a.Kh.parentWindow.rpcClose=(0,g.z)(a.KE,a,!1);c=a.Kh.createElement("DIV");a.Kh.parentWindow.document.body.appendChild(c);d=g.Kc(a.Kk.toString());d=g.nd(g.Gc(d));d=g.gd(g.jc("b/12014412"),'<iframe src="'+d+'"></iframe>');g.hd(c,d);a.u.wh(1)},F6=function(a){a.pz=g.A()+a.F;
mIa(a,a.F)},mIa=function(a,b){if(null!=a.fo)throw Error("WatchDog timer not null");
a.fo=z6((0,g.z)(a.SP,a),b)},L6=function(a){a.fo&&(g.v.clearTimeout(a.fo),a.fo=null)},J6=function(a){a.u.LB()||a.ll||a.u.ls(a)},I6=function(a){L6(a);
g.ag(a.Xt);a.Xt=null;a.C.stop();g.IBa(a.D);if(a.ee){var b=a.ee;a.ee=null;b.abort();b.dispose()}a.Kh&&(a.Kh=null)},H6=function(a,b){try{a.u.CE(a,b),a.u.wh(4)}catch(c){}},oIa=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;nIa(a,b,function(h){h?c(!0):g.v.setTimeout(function(){oIa(a,b,c,d,f)},f)})}},nIa=function(a,b,c){var d=new Image;
d.onload=function(){try{M6(d),c(!0)}catch(e){}};
d.onerror=function(){try{M6(d),c(!1)}catch(e){}};
d.onabort=function(){try{M6(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{M6(d),c(!1)}catch(e){}};
g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
AHa(d,a)},M6=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},N6=function(a){g.fm.call(this);
this.headers=new g.Sm;this.ba=a||null;this.C=!1;this.Y=this.u=null;this.ra=this.N="";this.G=0;this.D="";this.F=this.ia=this.P=this.ea=!1;this.K=0;this.W=null;this.Aa="";this.X=this.da=!1},pIa=function(a){return g.ve&&g.Yd(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},qIa=function(a){return"content-type"==a.toLowerCase()},sIa=function(a,b){a.C=!1;
a.u&&(a.F=!0,a.u.abort(),a.F=!1);a.D=b;a.G=5;rIa(a);O6(a)},rIa=function(a){a.ea||(a.ea=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},uIa=function(a){if(a.C&&"undefined"!=typeof g.p1)if(a.Y[1]&&4==P6(a)&&2==a.getStatus())Q6(a,"Local request error detected and ignored");
else if(a.P&&4==P6(a))g.Qm(a.zE,0,a);else if(a.dispatchEvent("readystatechange"),4==P6(a)){Q6(a,"Request complete");a.C=!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.wd(1,String(a.N));if(!f&&g.v.self&&g.v.self.location){var h=g.v.self.location.protocol;f=h.substr(0,h.length-1)}e=!tIa.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success");
else{a.G=6;try{var l=2<P6(a)?a.u.statusText:""}catch(m){l=""}a.D=l+" ["+a.getStatus()+"]";rIa(a)}}finally{O6(a)}}},O6=function(a,b){if(a.u){vIa(a);
var c=a.u,d=a.Y[0]?g.Oa:null;a.u=null;a.Y=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},vIa=function(a){a.u&&a.X&&(a.u.ontimeout=null);
a.W&&(g.v.clearTimeout(a.W),a.W=null)},P6=function(a){return a.u?a.u.readyState:0},R6=function(a){try{return a.u?a.u.responseText:""}catch(b){return""}},Q6=function(a,b){return b+" ["+a.ra+" "+a.N+" "+a.getStatus()+"]"},wIa=function(a){this.u=a;
this.B=new y6},xIa=function(a){var b=S6(a.u,a.xo,"/mail/images/cleardot.gif");
$5(b);oIa(b.toString(),5E3,(0,g.z)(a.hI,a),3,2E3);a.wh(1)},U6=function(a){var b=a.u.P;
if(null!=b)B6(5),b?(B6(11),T6(a.u,a,!1)):(B6(12),T6(a.u,a,!0));else if(a.Qf=new D6(a,void 0,void 0,void 0),a.Qf.Gl=a.zw,b=a.u,b=S6(b,b.qq()?a.bp:null,a.Aw),B6(5),!g.ve||g.Zd(10))a6(b,"TYPE","xmlhttp"),E6(a.Qf,b,!1,a.bp,!1);else{a6(b,"TYPE","html");var c=a.Qf;a=!!a.bp;c.Xn=3;c.Vj=$5(b.clone());lIa(c,a)}},V6=function(a,b,c){this.Ha=1;
this.u=[];this.C=[];this.D=new y6;this.K=a||null;this.P=null!=b?b:null;this.F=c||!1},zIa=function(a,b){this.u=a;
this.map=b;this.context=null},AIa=function(a,b,c,d){g.Il.call(this,"timingevent",a);
this.size=b;this.gq=d},BIa=function(a){g.Il.call(this,"serverreachability",a)},EIa=function(a){CIa(a);
if(3==a.Ha){var b=a.Lp++,c=a.Kr.clone();Z5(c,"SID",a.B);Z5(c,"RID",b);Z5(c,"TYPE","terminate");W6(a,c);b=new D6(a,a.B,b,void 0);b.Xn=2;b.Vj=$5(c.clone());AHa(new Image,b.Vj.toString());b.On=g.A();F6(b)}DIa(a)},FIa=function(a){a.HI(1,0);
a.Kr=S6(a,null,a.yw);X6(a)},CIa=function(a){a.ak&&(a.ak.abort(),a.ak=null);
a.zd&&(a.zd.cancel(),a.zd=null);a.Wi&&(g.v.clearTimeout(a.Wi),a.Wi=null);Y6(a);a.Hf&&(a.Hf.cancel(),a.Hf=null);a.ek&&(g.v.clearTimeout(a.ek),a.ek=null)},GIa=function(a,b){if(0==a.Ha)throw Error("Invalid operation: sending map when state is closed");
a.u.push(new zIa(a.qM++,b));2!=a.Ha&&3!=a.Ha||X6(a)},HIa=function(a){var b=0;
a.zd&&b++;a.Hf&&b++;return b},X6=function(a){a.Hf||a.ek||(a.ek=z6((0,g.z)(a.JE,a),0),a.Tm=0)},JIa=function(a,b){if(1==a.Ha){if(!b){a.Lp=Math.floor(1E5*Math.random());
var c=a.Lp++,d=new D6(a,"",c,void 0);d.Gl=a.Ym;var e=Z6(a),f=a.Kr.clone();Z5(f,"RID",c);Z5(f,"CVER","1");W6(a,f);gIa(d,f,e);a.Hf=d;a.Ha=2}}else 3==a.Ha&&(b?IIa(a,b):0==a.u.length||a.Hf||IIa(a))},IIa=function(a,b){if(b)if(6<a.nl){a.u=a.C.concat(a.u);
a.C.length=0;var c=a.Lp-1;var d=Z6(a)}else c=b.P,d=b.im;else c=a.Lp++,d=Z6(a);var e=a.Kr.clone();Z5(e,"SID",a.B);Z5(e,"RID",c);Z5(e,"AID",a.hn);W6(a,e);c=new D6(a,a.B,c,a.Tm+1);c.Gl=a.Ym;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Hf=c;gIa(c,e,d)},W6=function(a,b){if(a.af){var c=a.af.nB();
c&&g.Ib(c,function(d,e){Z5(b,e,d)})}},Z6=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b];
if(6<a.nl&&0<b){var d=a.u[0].u;c.push("ofs="+d)}else d=0;for(var e={},f=0;f<b;e={Am:e.Am},f++){e.Am=a.u[f].u;var h=a.u[f].map;e.Am=6>=a.nl?f:e.Am-d;try{g.Ib(h,function(l){return function(m,n){c.push("req"+l.Am+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.Am+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.u.splice(0,b));
return c.join("&")},KIa=function(a){a.zd||a.Wi||(a.G=1,a.Wi=z6((0,g.z)(a.IE,a),0),a.Em=0)},$6=function(a){if(a.zd||a.Wi||3<=a.Em)return!1;
a.G++;a.Wi=z6((0,g.z)(a.IE,a),LIa(a,a.Em));a.Em++;return!0},T6=function(a,b,c){a.Cu=c;
a.hi=b.jj;a.F||FIa(a)},Y6=function(a){null!=a.sl&&(g.v.clearTimeout(a.sl),a.sl=null)},LIa=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},a7=function(a,b){if(2==b||9==b){var c=null;
a.af&&(c=null);var d=(0,g.z)(a.bR,a);c||(c=new g.Vm("//www.google.com/images/cleardot.gif"),$5(c));nIa(c.toString(),1E4,d)}else B6(2);MIa(a,b)},MIa=function(a,b){a.Ha=0;
a.af&&a.af.AA(b);DIa(a);CIa(a)},DIa=function(a){a.Ha=0;
a.hi=-1;if(a.af)if(0==a.C.length&&0==a.u.length)a.af.xv();else{g.ub(a.C);var b=g.ub(a.u);a.C.length=0;a.u.length=0;a.af.xv(b)}},S6=function(a,b,c){var d=g.cn(c);
if(""!=d.u)b&&g.Xm(d,b+"."+d.u),g.Ym(d,d.D);else{var e=window.location;d=EHa(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.No&&g.Ib(a.No,function(f,h){Z5(d,h,f)});
Z5(d,"VER",a.nl);W6(a,d);return d},NIa=function(){},OIa=function(){this.u=[];
this.B=[]},PIa=function(a,b){this.action=a;
this.params=b||{}},b7=function(a,b){g.B.call(this);
this.u=new g.F(this.zP,0,this);g.C(this,this.u);this.df=5E3;this.B=0;if("function"===typeof a)b&&(a=(0,g.z)(a,b));else if(a&&"function"===typeof a.handleEvent)a=(0,g.z)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},c7=function(a,b,c,d){c=void 0===c?!1:c;
d=void 0===d?function(){return""}:d;
this.W=a;this.G=b;this.C=new g.On;this.B=new b7(this.EQ,this);this.u=null;this.Rd=!1;this.F=null;this.N="";this.P=this.D=0;this.K=[];this.Y=c;this.X=d},QIa=function(a){return{firstTestResults:[""],
secondTestResults:!a.u.Cu,sessionId:a.u.B,arrayId:a.u.hn}},RIa=function(a,b){a.P=b||0;
a.B.stop();d7(a);a.u&&(3==a.u.getState()&&JIa(a.u),EIa(a.u));a.P=0},e7=function(a){return!!a.u&&3==a.u.getState()},d7=function(a){if(a.u){var b=a.X(),c=a.u.Ym||{};
b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.u.Ym=c}},SIa=function(a,b){(a.G.loungeIdToken=b)||a.B.stop()},f7=function(a){this.scheme="https";
this.port=this.domain="";this.u="/api/lounge";this.B=!0;a=a||document.location.href;var b=Number(g.wd(4,a))||"";b&&(this.port=":"+b);this.domain=g.xd(a)||"";a=g.Vc;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.Dc(a,"10.0")&&(this.B=!1))},g7=function(a,b){var c=a.u;
a.B&&(c=a.scheme+"://"+a.domain+a.port+a.u);return g.Id(c+b,{})},h7=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Va(a.D,d,!0),onError:g.Va(a.C,e),kg:g.Va(a.F,e)};c&&(a.dc=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.lq(b,a)},WIa=function(){var a=TIa;
UIa();i7.push(a);VIa(i7)},j7=function(a,b){UIa();
var c=i7,d=XIa(a,String(b));g.ob(c)?YIa(d):(VIa(c),g.Fb(c,function(e){e(d)}))},UIa=function(){i7||(i7=g.Na("yt.mdx.remote.debug.handlers_")||[],g.Ja("yt.mdx.remote.debug.handlers_",i7,void 0))},YIa=function(a){var b=(k7+1)%50;
k7=b;l7[b]=a;m7||(m7=49==b)},VIa=function(a){var b=l7;
if(b[0]){var c=k7,d=m7?c:-1;do{d=(d+1)%50;var e=b[d];g.Fb(a,function(f){f(e)})}while(d!=c);
l7=Array(50);k7=-1;m7=!1}},XIa=function(a,b){var c=(g.A()-ZIa)/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("")},n7=function(a){g.O.call(this);
this.G=a;this.screens=[]},$Ia=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.screens.push(b);return!0},aJa=function(a,b){var c=a.screens.length!=b.length;
a.screens=g.Je(a.screens,function(f){return!!k6(b,f)});
for(var d=0,e=b.length;d<e;d++)c=$Ia(a,b[d])||c;return c},bJa=function(a,b){var c=a.screens.length;
a.screens=g.Je(a.screens,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.screens.length<c},o7=function(a,b,c,d){g.O.call(this);
this.G=a;this.F=b;this.C=c;this.D=d;this.B=0;this.u=null;this.Va=NaN},q7=function(a){n7.call(this,"LocalScreenService");
this.B=a;this.u=NaN;p7(this);this.info("Initializing with "+i6(this.screens))},cJa=function(a){if(a.screens.length){var b=g.Pc(a.screens,function(d){return d.id}),c=g7(a.B,"/pairing/get_lounge_token_batch");
h7(a.B,c,{screen_ids:b.join(",")},(0,g.z)(a.tJ,a),(0,g.z)(a.sJ,a))}},p7=function(a){if(g.ro("deprecate_pair_servlet_enabled"))return aJa(a,[]);
var b=KHa(QHa());b=g.Je(b,function(c){return!c.uuid});
return aJa(a,b)},r7=function(a,b){SHa(g.Pc(a.screens,IHa));
b&&RHa()},t7=function(a,b){g.O.call(this);
this.G=b;var c=g.ut("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.G(),f=0,h=e.length;f<h;++f){var l=e[f].id;d[l]=g.nb(c,l)}this.u=d;this.F=a;this.C=this.D=NaN;this.B=null;s7("Initialized with "+g.Cj(this.u))},dJa=function(a,b,c){var d=g7(a.F,"/pairing/get_screen_availability");
h7(a.F,d,{lounge_token:b.token},(0,g.z)(function(e){e=e.screens||[];for(var f=0,h=e.length;f<h;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.z)(function(){c(!1)},a))},u7=function(a,b){a:if(b6(b)!=b6(a.u))var c=!1;
else{c=g.Qb(b);for(var d=0,e=c.length;d<e;++d)if(!a.u[c[d]]){c=!1;break a}c=!0}c||(s7("Updated online screens: "+g.Cj(a.u)),a.u=b,a.V("screenChange"));eJa(a)},v7=function(a){isNaN(a.C)||g.Eo(a.C);
a.C=g.Co((0,g.z)(a.qy,a),0<a.D&&a.D<g.A()?2E4:1E4)},s7=function(a){j7("OnlineScreenService",a)},fJa=function(a){var b={};
g.Fb(a.G(),function(c){c.token?b[c.token]=c.id:this.dd("Requesting availability of screen w/o lounge token.")});
return b},eJa=function(a){a=g.Qb(g.Jb(a.u,function(b){return b}));
g.Cb(a);a.length?g.tt("yt-remote-online-screen-ids",a.join(","),60):g.vt("yt-remote-online-screen-ids")},w7=function(a){n7.call(this,"ScreenService");
this.F=a;this.u=this.B=null;this.C=[];this.D={};gJa(this)},iJa=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.D[b]);var h=a.Yf();if(h=(c?l6(h,c):null)||l6(h,b)){h.uuid=b;var l=x7(a,h);dJa(a.u,l,function(m){e(m?l:null)})}else c?hJa(a,c,(0,g.z)(function(m){var n=x7(this,new f6({name:d,
screenId:c,loungeToken:m,dialId:b||""}));dJa(this.u,n,function(p){e(p?n:null)})},a),f):e(null)},jJa=function(a,b){for(var c=0,d=a.screens.length;c<d;++c)if(a.screens[c].name==b)return a.screens[c];
return null},hJa=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={dc:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,h){var l=h&&h.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.lq(g7(a.F,"/pairing/get_lounge_token_batch"),e)},kJa=function(a){a.screens=a.B.Yf();
var b=a.D,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.screens.length;b<d;++b){var e=a.screens[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+i6(a.screens))},gJa=function(a){y7(a);
a.B=new q7(a.F);a.B.subscribe("screenChange",(0,g.z)(a.AJ,a));kJa(a);a.C=KHa(g.ut("yt-remote-automatic-screen-cache")||[]);y7(a);a.info("Initializing automatic screens: "+i6(a.C));a.u=new t7(a.F,(0,g.z)(a.Yf,a,!0));a.u.subscribe("screenChange",(0,g.z)(function(){this.V("onlineScreenChange")},a))},x7=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=l6(a.C,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.C.push(b),g.tt("yt-remote-automatic-screen-cache",g.Pc(a.C,IHa)));y7(a);a.D[b.uuid]=b.id;g.tt("yt-remote-device-id-map",a.D,31536E3);return b},y7=function(a){a.D=g.ut("yt-remote-device-id-map")||{}},z7=function(a,b,c){g.O.call(this);
this.Y=c;this.P=a;this.u=b;this.K=null},A7=function(a,b){j7(a.Y,b)},B7=function(a,b){z7.call(this,a,b,"CastSession");
this.B=null;this.C=0;this.F=(0,g.z)(this.MR,this);this.D=(0,g.z)(this.ZP,this);this.C=g.Co((0,g.z)(function(){lJa(this,null)},this),12E4)},mJa=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Cj(void 0));
var b={type:"getMdxSessionStatus"};a.B?a.B.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Oa,(0,g.z)(function(){A7(this,"Failed to send message: getMdxSessionStatus.")},a)):A7(a,"Sending yt message without session: "+g.Cj(b))},lJa=function(a,b){g.Eo(a.C);
if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.getScreen()||a.getScreen().id!=b){var c=(0,g.z)(a.Nt,a),d=(0,g.z)(a.hg,a);a.EB(b,c,d,5)}}else a.hg(Error("Waiting for session status timed out."))},C7=function(a,b,c){z7.call(this,a,b,"DialSession");
this.C=this.G=null;this.N="";this.ba=c;this.W=null;this.F=g.Oa;this.D=NaN;this.X=(0,g.z)(this.PR,this);this.B=g.Oa},nJa=function(a){a.B=a.P.SG(a.N,a.u.label,a.u.friendlyName,(0,g.z)(function(b){this.B=g.Oa;
this.Nt(b)},a),(0,g.z)(function(b){this.B=g.Oa;
this.hg(b)},a))},oJa=function(a){var b={};
b.pairingCode=a.N;b.theme=a.ba;UHa()&&(b.env_useStageMdx=1);return g.Gd(b)},D7=function(a,b){z7.call(this,a,b,"ManualSession");
this.B=g.Co((0,g.z)(this.jn,this,null),150)},E7=function(a,b,c,d){g.O.call(this);
this.B=a;this.K=b||"233637DE";this.G=c||"cl";this.P=d||!1;this.u=null;this.F=!1;this.C=[];this.D=(0,g.z)(this.RO,this)},pJa=function(a,b){return b?g.jb(a.C,function(c){return g6(b,c.label)},a):null},F7=function(a){j7("Controller",a)},TIa=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},G7=function(a){return a.F||!!a.C.length||!!a.u},H7=function(a,b,c){b!=a.u&&(g.ag(a.u),(a.u=b)?(c?a.V("yt-remote-cast2-receiver-resumed",b.u):a.V("yt-remote-cast2-receiver-selected",
b.u),b.subscribe("sessionScreen",(0,g.z)(a.GE,a,b)),b.getScreen()?a.V("yt-remote-cast2-session-change",b.getScreen()):c&&a.u.jn(null)):a.V("yt-remote-cast2-session-change",null))},qJa=function(a){var b=a.B.QG(),c=a.u&&a.u.u;
a=g.Pc(b,function(d){c&&g6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=pJa(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},wJa=function(a,b,c,d,e,f,h){rJa()?sJa(b,e,f,h)&&(J7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?tJa(a,c):(window.__onGCastApiAvailable=function(l,m){l?tJa(a,c):(K7("Failed to load cast API: "+m),L7(!1),J7(!1),g.vt("yt-remote-cast-available"),g.vt("yt-remote-cast-receiver"),uJa(),c(!1))},d?g.Oo("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?aIa():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?t6():($Ha(),s6(vJa.map(YHa))))):I7("Cannot initialize because not running Chrome")},uJa=function(){I7("dispose");
var a=M7();a&&a.dispose();g.Ja("yt.mdx.remote.cloudview.instance_",null,void 0);xJa(!1);g.Ko(N7);N7.length=0},O7=function(){return!!g.ut("yt-remote-cast-installed")},yJa=function(){var a=g.ut("yt-remote-cast-receiver");
return a?a.friendlyName:null},zJa=function(){I7("clearCurrentReceiver");
g.vt("yt-remote-cast-receiver")},AJa=function(){return O7()?M7()?M7().getCastSession():(K7("getCastSelector: Cast is not initialized."),null):(K7("getCastSelector: Cast API is not installed!"),null)},Q7=function(){O7()?M7()?P7()?(I7("Requesting cast selector."),M7().requestSession()):(I7("Wait for cast API to be ready to request the session."),N7.push(g.Jo("yt-remote-cast2-api-ready",Q7))):K7("requestCastSelector: Cast is not initialized."):K7("requestCastSelector: Cast API is not installed!")},R7=
function(a,b){P7()?M7().setConnectedScreenStatus(a,b):K7("setConnectedScreenStatus called before ready.")},rJa=function(){var a=0<=g.Vc.search(/ (CrMo|Chrome|CriOS)\//);
return g.DB||a},BJa=function(a,b){M7().init(a,b)},sJa=function(a,b,c,d){var e=!1;
M7()||(a=new E7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.tt("yt-remote-cast-available",f);d6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){I7("onReceiverSelected: "+f.friendlyName);
g.tt("yt-remote-cast-receiver",f);d6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){I7("onReceiverResumed: "+f.friendlyName);
g.tt("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){I7("onSessionChange: "+h6(f));
f||g.vt("yt-remote-cast-receiver");d6("yt-remote-cast2-session-change",f)}),g.Ja("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0);
I7("cloudview.createSingleton_: "+e);return e},M7=function(){return g.Na("yt.mdx.remote.cloudview.instance_")},tJa=function(a,b){L7(!0);
J7(!1);BJa(a,function(c){c?(xJa(!0),g.Lo("yt-remote-cast2-api-ready")):(K7("Failed to initialize cast API."),L7(!1),g.vt("yt-remote-cast-available"),g.vt("yt-remote-cast-receiver"),uJa());b(c)})},I7=function(a){j7("cloudview",a)},K7=function(a){j7("cloudview",a)},L7=function(a){I7("setCastInstalled_ "+a);
g.tt("yt-remote-cast-installed",a)},P7=function(){return!!g.Na("yt.mdx.remote.cloudview.apiReady_")},xJa=function(a){I7("setApiReady_ "+a);
g.Ja("yt.mdx.remote.cloudview.apiReady_",a,void 0)},J7=function(a){g.Ja("yt.mdx.remote.cloudview.initializing_",a,void 0)},S7=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.G=this.K=0;this.u=null;this.hasNext=this.ji=!1;this.N=this.P=this.B=this.F=0;this.D=NaN;this.C=!1;this.reset(a)},T7=function(a){a.audioTrackId=null;
a.u=null;a.playerState=-1;a.ji=!1;a.hasNext=!1;a.K=0;a.G=g.A();a.F=0;a.B=0;a.P=0;a.N=0;a.D=NaN;a.C=!1},U7=function(a){return a.Jb()?(g.A()-a.G)/1E3:0},V7=function(a,b){a.K=b;
a.G=g.A()},W7=function(a){switch(a.playerState){case 1:case 1081:return(g.A()-a.G)/1E3+a.K;
case -1E3:return 0}return a.K},X7=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&T7(a)},Y7=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.$b(a.u);b.hasPrevious=a.ji;b.hasNext=a.hasNext;b.playerTime=a.K;b.playerTimeAt=a.G;b.seekableStart=a.F;b.seekableEnd=a.B;b.duration=a.P;b.loadedTime=a.N;b.liveIngestionTime=a.D;return b},$7=function(a,b){g.O.call(this);
this.Ha=0;this.C=a;this.F=[];this.D=new OIa;this.B=this.u=null;this.P=(0,g.z)(this.fN,this);this.G=(0,g.z)(this.Np,this);this.K=(0,g.z)(this.eN,this);this.N=(0,g.z)(this.mN,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.sz,this),CJa(this))):c=3;0!=c&&(b?this.sz(c):g.Co((0,g.z)(function(){this.sz(c)},this),0));
var d=AJa();d&&Z7(this,d);this.subscribe("yt-remote-cast2-session-change",this.N)},a8=function(a){return new S7(a.C.getPlayerContextData())},CJa=function(a){g.Fb("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.F.push(this.C.subscribe(b,g.Va(this.NO,b),this))},a)},DJa=function(a){g.Fb(a.F,function(b){this.C.unsubscribeByKey(b)},a);
a.F.length=0},b8=function(a){return 1==a.getState()},c8=function(a,b){var c=a.D;
50>c.u.length+c.B.length&&a.D.B.push(b)},e8=function(a,b,c){var d=a8(a);
V7(d,c);-1E3!=d.playerState&&(d.playerState=b);d8(a,d)},f8=function(a,b,c){a.C.sendMessage(b,c)},d8=function(a,b){DJa(a);
a.C.setPlayerContextData(Y7(b));CJa(a)},Z7=function(a,b){a.B&&(a.B.removeUpdateListener(a.P),a.B.removeMediaListener(a.G),a.Np(null));
a.B=b;a.B&&(j7("CP","Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.P),a.B.addMediaListener(a.G),a.B.media.length&&a.Np(a.B.media[0]))},EJa=function(a){var b=a.u.media,c=a.u.customData;
if(b&&c){var d=a8(a);b.contentId!=d.videoId&&j7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;V7(d,a.u.getEstimatedTime());d8(a,d)}else j7("CP","No cast media video. Ignoring state update.")},g8=function(a,b,c){return(0,g.z)(function(d){this.dd("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.dd("Retrying "+b+" using MDx browser channel."),f8(this,b,c))},a)},h8=function(a,b,c){g.O.call(this);
this.F=NaN;this.X=!1;this.P=this.K=this.N=this.W=NaN;this.Y=[];this.D=this.G=this.C=this.Cb=this.u=null;this.ea=a;this.Y.push(g.$o(window,"beforeunload",(0,g.z)(this.mJ,this)));this.B=[];this.Cb=new S7;this.ba=b.id;this.u=FJa(this,c);this.u.subscribe("handlerOpened",this.jN,this);this.u.subscribe("handlerClosed",this.gN,this);this.u.subscribe("handlerError",this.hN,this);this.u.subscribe("handlerMessage",this.iN,this);SIa(this.u,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Cb.videoId;
g.wt()&&g.tt("yt-remote-session-video-id",d)},this)},i8=function(a){j7("conn",a)},FJa=function(a,b){return new c7(g7(a.ea,"/bc"),b,!1,function(){return a.NG()})},j8=function(a,b){a.V("proxyStateChange",b)},GJa=function(a){a.F=g.Co((0,g.z)(function(){i8("Connecting timeout");
this.Om(1)},a),2E4)},k8=function(a){g.Eo(a.F);
a.F=NaN},l8=function(a){g.Eo(a.W);
a.W=NaN},HJa=function(a){m8(a);
a.N=g.Co((0,g.z)(function(){n8(this,"getNowPlaying")},a),2E4)},m8=function(a){g.Eo(a.N);
a.N=NaN},JJa=function(a,b){b&&(k8(a),l8(a));
var c=e7(a.u)&&isNaN(a.F);b==c?b&&(j8(a,1),n8(a,"getSubtitlesTrack")):b?(a.CB()&&a.Cb.reset(),j8(a,1),n8(a,"getNowPlaying"),IJa(a)):a.Om(1)},KJa=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.Cb.videoId&&(g.Wb(b.params)?a.Cb.u=null:a.Cb.u=b.params,a.V("remotePlayerChange"))},LJa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);
a.Cb.listId=b.params.listId||a.Cb.listId;X7(a.Cb,c,d);a.V("remoteQueueChange")},NJa=function(a,b){b.params=b.params||{};
LJa(a,b);MJa(a,b);a.V("autoplayDismissed")},MJa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
V7(a.Cb,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Cb.playerState&&(c=-1E3);a.Cb.playerState=c;c=Number(b.params.loadedTime);a.Cb.N=isNaN(c)?0:c;c=Number(b.params.duration);a.Cb.P=isNaN(c)?0:c;c=a.Cb;var d=Number(b.params.liveIngestionTime);c.D=d;c.C=isNaN(d)?!1:!0;c=a.Cb;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.F=isNaN(d)?0:d;c.B=isNaN(e)?0:e;1==a.Cb.playerState?HJa(a):m8(a);a.V("remotePlayerChange")},OJa=function(a,b){if(-1E3!=
a.Cb.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.Cb.playerState=c;c=parseInt(b.params.currentTime,10);V7(a.Cb,isNaN(c)?0:c);a.V("remotePlayerChange")}},PJa=function(a,b){var c="true"==b.params.muted;
a.Cb.volume=parseInt(b.params.volume,10);a.Cb.muted=c;a.V("remotePlayerChange")},QJa=function(a,b){a.G=b.params.videoId;
a.V("nowAutoplaying",parseInt(b.params.timeout,10))},RJa=function(a,b){var c="true"==b.params.hasNext;
a.Cb.ji="true"==b.params.hasPrevious;a.Cb.hasNext=c;a.V("previousNextChange")},IJa=function(a){g.Eo(a.P);
a.P=g.Co((0,g.z)(a.Om,a,1),864E5)},n8=function(a,b,c){c?i8("Sending: action="+b+", params="+g.Cj(c)):i8("Sending: action="+b);
a.u.sendMessage(b,c)},o8=function(a){n7.call(this,"ScreenServiceProxy");
this.cf=a;this.u=[];this.u.push(this.cf.$_s("screenChange",(0,g.z)(this.KR,this)));this.u.push(this.cf.$_s("onlineScreenChange",(0,g.z)(this.sO,this)))},WJa=function(a,b){b=g.K("MDX_CONFIG")||b;
MHa();p6();p8||(p8=new f7(b?b.loungeApiHost:void 0),UHa()&&(p8.u="/api/loungedev"));q8||(q8=g.Na("yt.mdx.remote.deferredProxies_")||[],g.Ja("yt.mdx.remote.deferredProxies_",q8,void 0));SJa();var c=r8();if(!c){var d=new w7(p8);g.Ja("yt.mdx.remote.screenService_",d,void 0);c=r8();var e=!1,f=void 0,h=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,h=b.theme,l=!!b.disableDial);wJa(a,d,function(m){m?s8()&&R7(s8(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){d6("yt-remote-receiver-availability-change")})},
e,f,h,l)}b&&!g.Na("yt.mdx.remote.initialized_")&&(g.Ja("yt.mdx.remote.initialized_",!0,void 0),t8("Initializing: "+g.Cj(b)),u8.push(g.Jo("yt-remote-cast2-availability-change",function(){d6("yt-remote-receiver-availability-change")})),u8.push(g.Jo("yt-remote-cast2-receiver-selected",function(){v8(null);
d6("yt-remote-auto-connect","cast-selector-receiver")})),u8.push(g.Jo("yt-remote-cast2-receiver-resumed",function(){d6("yt-remote-receiver-resumed","cast-selector-receiver")})),u8.push(g.Jo("yt-remote-cast2-session-change",TJa)),u8.push(g.Jo("yt-remote-connection-change",function(m){m?R7(s8(),"YouTube TV"):w8()||(R7(null,null),zJa())})),e=x8(),b.isAuto&&(e.id+="#dial"),g.ro("desktop_enable_autoplay")&&(e.capabilities=["atp"]),e.name=b.device,e.app=b.app,(h=b.theme)&&(e.theme=h),t8(" -- with channel params: "+
g.Cj(e)),UJa(e),c.start(),s8()||VJa())},YJa=function(){var a=XJa();
O7()&&g.ut("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},XJa=function(){var a=r8().cf.$_gos();
var b=y8();b&&z8()&&(k6(a,b)||a.push(b));return LHa(a)},A8=function(){var a=ZJa();
!a&&O7()&&yJa()&&(a={key:"cast-selector-receiver",name:yJa()});return a},ZJa=function(){var a=XJa(),b=y8();
b||(b=w8());return g.jb(a,function(c){return b&&g6(b,c.key)?!0:!1})},y8=function(){var a=s8();
if(!a)return null;var b=r8().Yf();return l6(b,a)},TJa=function(a){t8("remote.onCastSessionChange_: "+h6(a));
if(a){var b=y8();b&&b.id==a.id?R7(b.id,"YouTube TV"):(b&&B8(),C8(a,1))}else z8()&&B8()},B8=function(){P7()?M7().stopSession():K7("stopSession called before API ready.");
var a=z8();a&&(a.disconnect(1),D8(null))},E8=function(){var a=z8();
return!!a&&3!=a.getProxyState()},t8=function(a){j7("remote",a)},r8=function(){if(!F8){var a=g.Na("yt.mdx.remote.screenService_");
F8=a?new o8(a):null}return F8},s8=function(){return g.Na("yt.mdx.remote.currentScreenId_")},$Ja=function(a){g.Ja("yt.mdx.remote.currentScreenId_",a,void 0)},aKa=function(){return g.Na("yt.mdx.remote.connectData_")},v8=function(a){g.Ja("yt.mdx.remote.connectData_",a,void 0)},z8=function(){return g.Na("yt.mdx.remote.connection_")},D8=function(a){var b=z8();
v8(null);a||$Ja("");g.Ja("yt.mdx.remote.connection_",a,void 0);q8&&(g.Fb(q8,function(c){c(a)}),q8.length=0);
b&&!a?d6("yt-remote-connection-change",!1):!b&&a&&d6("yt-remote-connection-change",!0)},w8=function(){var a=g.wt();
if(!a)return null;var b=r8();if(!b)return null;b=b.Yf();return l6(b,a)},C8=function(a,b){s8();
y8()&&y8();if(G8)H8=a;else{$Ja(a.id);var c=new h8(p8,a,x8());c.connect(b,aKa());c.subscribe("beforeDisconnect",function(d){d6("yt-remote-before-disconnect",d)});
c.subscribe("beforeDispose",function(){z8()&&(z8(),D8(null))});
D8(c)}},VJa=function(){var a=w8();
a?(t8("Resume connection to: "+h6(a)),C8(a,0)):(q6(),zJa(),t8("Skipping connecting because no session screen found."))},SJa=function(){var a=x8();
if(g.Wb(a)){a=o6();var b=g.ut("yt-remote-session-name")||"",c=g.ut("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ja("yt.mdx.remote.channelParams_",a,void 0)}},x8=function(){return g.Na("yt.mdx.remote.channelParams_")||{}},UJa=function(a){a?(g.tt("yt-remote-session-app",a.app),g.tt("yt-remote-session-name",a.name)):(g.vt("yt-remote-session-app"),g.vt("yt-remote-session-name"));
g.Ja("yt.mdx.remote.channelParams_",a,void 0)},I8=function(a,b,c){g.B.call(this);
var d=this;this.B=a;this.J=b;this.ub=c;this.events=new g.nR(this);this.W=this.events.R(this.J,"onVolumeChange",function(e){bKa(d,e)});
this.F=!1;this.suggestion=null;this.G=new g.zL(64);this.u=new g.F(this.UF,500,this);this.C=new g.F(this.VF,1E3,this);this.P=new u6(this.oR,0,this);this.D={};this.N=new g.F(this.yG,1E3,this);this.K=new v6(this.seekTo,1E3,this);this.X=g.Oa;g.C(this,this.events);this.events.R(b,"onCaptionsTrackListChanged",this.WN);this.events.R(b,"captionschanged",this.cN);this.events.R(b,"captionssettingschanged",this.YF);this.events.R(b,"videoplayerreset",this.Ot);this.events.R(b,"mdxautoplaycancel",function(){d.ub.XA()});
a=this.ub;a.la();a.subscribe("proxyStateChange",this.BE,this);a.subscribe("remotePlayerChange",this.Sp,this);a.subscribe("remoteQueueChange",this.Ot,this);a.subscribe("previousNextChange",this.yE,this);a.subscribe("nowAutoplaying",this.tE,this);a.subscribe("autoplayDismissed",this.VD,this);g.C(this,this.u);g.C(this,this.C);g.C(this,this.P);g.C(this,this.N);g.C(this,this.K);this.YF();this.Ot();this.Sp()},bKa=function(a,b){if(J8(a)){a.ub.unsubscribe("remotePlayerChange",a.Sp,a);
var c=Math.round(b.volume),d=!!b.muted,e=a8(a.ub);if(c!==e.volume||d!==e.muted)a.ub.setVolume(c,d),a.N.start();a.ub.subscribe("remotePlayerChange",a.Sp,a)}},cKa=function(a){a.Hc(0);
a.u.stop();a.Pd(new g.zL(64))},K8=function(a,b){if(J8(a)&&!a.F){var c=null;
b&&(c={style:a.J.getSubtitlesUserSettings()},g.bc(c,b));a.ub.OG(a.J.getVideoData(1).videoId,c);a.D=a8(a.ub).u}},L8=function(a,b){var c=a.J.getPlaylist();
if(c){var d=c.index;var e=c.listId.toString()}c=a.J.getVideoData(1);a.ub.playVideo(c.videoId,b,d,e,c.playerParams,c.Ag,yHa(c));a.Pd(new g.zL(1))},dKa=function(a,b){if(b){var c=a.J.getOption("captions","tracklist",{bC:1});
c&&c.length?(a.J.setOption("captions","track",b),a.F=!1):(a.J.loadModule("captions"),a.F=!0)}else a.J.setOption("captions","track",{})},J8=function(a){return a8(a.ub).videoId===a.J.getVideoData(1).videoId},M8=function(){g.V.call(this,{I:"div",
L:"ytp-mdx-manual-pairing-popup-dialog",U:{role:"dialog"},S:[{I:"div",L:"ytp-mdx-manual-pairing-popup-dialog-inner-content",S:[{I:"div",L:"ytp-mdx-manual-pairing-popup-title",Z:"\u30a6\u30a7\u30d6\u3067\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30ec\u30d3\u306b\u63a5\u7d9a\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u306f\u3001\u307e\u3082\u306a\u304f\u3054\u5229\u7528\u3044\u305f\u3060\u3051\u306a\u304f\u306a\u308a\u307e\u3059\u3002"},{I:"div",L:"ytp-mdx-manual-pairing-popup-buttons",S:[{I:"button",
ha:["ytp-button","ytp-mdx-manual-pairing-popup-learn-more"],Z:"\u8a73\u7d30"},{I:"button",ha:["ytp-button","ytp-mdx-manual-pairing-popup-ok"],Z:"OK"}]}]}]});this.u=new g.fO(this,250);this.learnMoreButton=this.ga("ytp-mdx-manual-pairing-popup-learn-more");this.okButton=this.ga("ytp-mdx-manual-pairing-popup-ok");g.C(this,this.u);this.R(this.learnMoreButton,"click",this.B);this.R(this.okButton,"click",this.C)},N8=function(){g.V.call(this,{I:"div",
L:"ytp-mdx-popup-dialog",U:{role:"dialog"},S:[{I:"div",L:"ytp-mdx-popup-dialog-inner-content",S:[{I:"div",L:"ytp-mdx-popup-title",Z:"\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f"},{I:"div",L:"ytp-mdx-popup-description",Z:"\u8996\u8074\u3057\u305f\u52d5\u753b\u306f\u30c6\u30ec\u30d3\u306e\u518d\u751f\u5c65\u6b74\u306b\u8ffd\u52a0\u3055\u308c\u3001\u30c6\u30ec\u30d3\u306e\u304a\u3059\u3059\u3081\u306b\u5f71\u97ff\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u907f\u3051\u308b\u306b\u306f\u3001\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u3066\u30d1\u30bd\u30b3\u30f3\u304b\u3089\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002"},
{I:"div",L:"ytp-mdx-privacy-popup-buttons",S:[{I:"button",ha:["ytp-button","ytp-mdx-privacy-popup-cancel"],Z:"\u30ad\u30e3\u30f3\u30bb\u30eb"},{I:"button",ha:["ytp-button","ytp-mdx-privacy-popup-confirm"],Z:"\u78ba\u8a8d"}]}]}]});this.u=new g.fO(this,250);this.cancelButton=this.ga("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.ga("ytp-mdx-privacy-popup-confirm");g.C(this,this.u);this.R(this.cancelButton,"click",this.B);this.R(this.confirmButton,"click",this.C)},O8=function(a){g.V.call(this,
{I:"div",
L:"ytp-remote",S:[{I:"div",L:"ytp-remote-display-status",S:[{I:"div",L:"ytp-remote-display-status-icon",S:[g.IN()]},{I:"div",L:"ytp-remote-display-status-text",Z:"{{statustext}}"}]}]});this.api=a;this.u=new g.fO(this,250);g.C(this,this.u);this.R(a,"presentingplayerstatechange",this.B);eKa(this,g.uJ(a))},eKa=function(a,b){if(3===a.api.getPresentingPlayerType()){var c={RECEIVER_NAME:a.api.getOption("remote","currentReceiver").name};
c=g.U(b,128)?g.sK("$RECEIVER_NAME \u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f",c):b.Jb()||g.U(b,4)?g.sK("$RECEIVER_NAME \u3067\u518d\u751f\u3057\u3066\u3044\u307e\u3059",c):g.sK("$RECEIVER_NAME \u306b\u63a5\u7d9a\u3057\u307e\u3057\u305f",c);a.xa("statustext",c);a.u.show()}else a.u.hide()},P8=function(a,b){g.ZZ.call(this,"\u518d\u751f\u30c7\u30d0\u30a4\u30b9",0,a,b);
this.J=a;this.Jk={};this.R(a,"onMdxReceiversChange",this.D);this.R(a,"presentingplayerstatechange",this.D);this.D()},Q8=function(a){g.AS.call(this,a);
this.mh={key:j6(),name:"\u3053\u306e\u30d1\u30bd\u30b3\u30f3"};this.Uh=null;this.subscriptions=[];this.ay=this.ub=null;this.Jk=[this.mh];this.ck=this.mh;this.Bc=new g.zL(64);this.xC=0;this.pe=-1;this.ln=null;this.Up=this.Us=!1;this.hm=this.Jn=null;if(!g.VC(this.player.T())){a=this.player;var b=g.TW(a);b&&(b=b.Dl())&&(b=new P8(a,b),g.C(this,b));b=new O8(a);g.C(this,b);g.uP(a,b.element,4);this.Jn=new N8;g.C(this,this.Jn);g.uP(a,this.Jn.element,4);g.Q(this.player.T().experiments,"pair_servlet_deprecation_warning_enabled")&&
!g.Q(this.player.T().experiments,"deprecate_pair_servlet_enabled")&&(this.ln=new M8,g.C(this,this.ln),g.uP(a,this.ln.element,4));this.Up=!!w8();this.Us=!!g.ut("yt-remote-manual-pairing-warning-shown")}},R8=function(a){a.hm&&(a.player.removeEventListener("presentingplayerstatechange",a.hm),a.hm=null)},fKa=function(a,b,c){a.Bc=c;
a.player.V("presentingplayerstatechange",new g.EJ(c,b))},gKa=function(a,b,c){var d=!1;
1===b?d=!a.Up:2===b&&(d=!a.Us);d&&g.GJ(c,8)&&(a.player.pauseVideo(),R8(a))},S8=function(a,b){if(b.key!==a.ck.key)if(b.key===a.mh.key)B8();
else{if(a.ln&&!a.Us&&b!==a.mh&&"cast-selector-receiver"!==b.key&&g.eD(a.player.T()))hKa(a);else{var c;(c=!g.Q(a.player.T().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.K("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.K("SESSION_INDEX")&&!g.K("LOGGED_IN")))||a.Up||!a.Jn);(c?0:g.eD(a.player.T())||g.iD(a.player.T()))&&iKa(a)}a.ck=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);var e=c.videoId;if(!d&&!e||(2===a.player.getAppState()||1===a.player.getAppState())&&
g.Q(a.player.T().experiments,"should_clear_video_data_on_player_cued_unstarted"))c=null;else{var f=a.player.getPlaylist();if(f){var h=[];for(var l=0;l<f.getLength();l++)h[l]=f.Ka(l).videoId}else h=[e];f=a.player.getCurrentTime(1);d={videoIds:h,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.Ag,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0===f?void 0:f};(c=yHa(c))&&(d.locationInfo=c);c=d}t8("Connecting to: "+g.Cj(b));"cast-selector-receiver"==b.key?(v8(c||null),c=
c||null,P7()?M7().setLaunchParams(c):K7("setLaunchParams called before ready.")):!c&&E8()&&s8()==b.key?d6("yt-remote-connection-change",!0):(B8(),v8(c||null),c=r8().Yf(),(c=l6(c,b.key))&&C8(c,1))}},iKa=function(a){g.uJ(a.player).Jb()?a.player.pauseVideo():(a.hm=function(b){gKa(a,1,b)},a.player.addEventListener("presentingplayerstatechange",a.hm));
a.Jn&&a.Jn.tc();z8()||(G8=!0)},hKa=function(a){g.uJ(a.player).Jb()?a.player.pauseVideo():(a.hm=function(b){gKa(a,2,b)},a.player.addEventListener("presentingplayerstatechange",a.hm));
a.ln&&a.ln.tc();z8()||(G8=!0)},kIa={"\x00":"\\0",
"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},K6={"'":"\\'"},jKa={},HHa={FS:"atp",D1:"ska",A0:"que",LZ:"mus",C1:"sus",gW:"dsp",R0:"seq",rZ:"mic",gV:"dpa"},r6,n6="",ZHa=VHa("loadCastFramework")||VHa("loadCastApplicationFramework"),vJa=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
g.Ya(u6,g.B);g.k=u6.prototype;g.k.jJ=function(a){this.D=arguments;this.u=!1;this.Va?this.C=g.A()+this.df:this.Va=g.Qm(this.F,this.df)};
g.k.stop=function(){this.Va&&(g.v.clearTimeout(this.Va),this.Va=null);this.C=null;this.u=!1;this.D=[]};
g.k.pause=function(){++this.B};
g.k.resume=function(){this.B&&(--this.B,!this.B&&this.u&&(this.u=!1,this.G.apply(null,this.D)))};
g.k.aa=function(){this.stop();u6.od.aa.call(this)};
g.k.kJ=function(){this.C?(this.Va=g.Qm(this.F,this.C-g.A()),this.C=null):(this.Va=null,this.B?this.u=!0:(this.u=!1,this.G.apply(null,this.D)))};g.u(v6,g.B);g.k=v6.prototype;g.k.OC=function(a){this.C=arguments;this.Va||this.B?this.u=!0:w6(this)};
g.k.stop=function(){this.Va&&(g.v.clearTimeout(this.Va),this.Va=null,this.u=!1,this.C=null)};
g.k.pause=function(){this.B++};
g.k.resume=function(){this.B--;this.B||!this.u||this.Va||(this.u=!1,w6(this))};
g.k.aa=function(){g.B.prototype.aa.call(this);this.stop()};y6.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)};
y6.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};var A6=new g.fm;g.u(bIa,g.Il);C6.prototype.u=null;C6.prototype.getOptions=function(){var a;(a=this.u)||(a={},dIa(this)&&(a[0]=!0,a[1]=!0),a=this.u=a);return a};var T8;g.Ya(cIa,C6);T8=new cIa;g.k=D6.prototype;g.k.Gl=null;g.k.Fh=!1;g.k.fo=null;g.k.pz=null;g.k.On=null;g.k.Xn=null;g.k.Vj=null;g.k.Kk=null;g.k.im=null;g.k.ee=null;g.k.Iq=0;g.k.Kh=null;g.k.Fu=null;g.k.lk=null;g.k.ep=-1;g.k.LF=!0;g.k.ll=!1;g.k.Bw=0;g.k.Xt=null;var iIa={},G6={};g.k=D6.prototype;g.k.setTimeout=function(a){this.F=a};
g.k.sQ=function(a){a=a.target;var b=this.Xt;b&&3==P6(a)?b.OC():this.KG(a)};
g.k.KG=function(a){try{if(a==this.ee)a:{var b=P6(this.ee),c=this.ee.G,d=this.ee.getStatus();if(g.ve&&!g.Zd(10)||g.ze&&!g.Yd("420+")){if(4>b)break a}else if(3>b||3==b&&!g.og&&!R6(this.ee))break a;this.ll||4!=b||7==c||(8==c||0>=d?this.u.wh(3):this.u.wh(2));L6(this);var e=this.ee.getStatus();this.ep=e;var f=R6(this.ee);(this.Fh=200==e)?(4==b&&I6(this),this.G?(jIa(this,b,f),g.og&&this.Fh&&3==b&&(this.D.wa(this.C,"tick",this.nQ),this.C.start())):H6(this,f),this.Fh&&!this.ll&&(4==b?this.u.ls(this):(this.Fh=
!1,F6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.lk=3,B6(13)):(this.lk=0,B6(14)),I6(this),J6(this))}}catch(h){this.ee&&R6(this.ee)}finally{}};
g.k.nQ=function(){var a=P6(this.ee),b=R6(this.ee);this.Iq<b.length&&(L6(this),jIa(this,a,b),this.Fh&&4!=a&&F6(this))};
g.k.GP=function(a){z6((0,g.z)(this.FP,this,a),0)};
g.k.FP=function(a){this.ll||(L6(this),H6(this,a),F6(this))};
g.k.KE=function(a){z6((0,g.z)(this.EP,this,a),0)};
g.k.EP=function(a){this.ll||(I6(this),this.Fh=a,this.u.ls(this),this.u.wh(4))};
g.k.cancel=function(){this.ll=!0;I6(this)};
g.k.SP=function(){this.fo=null;var a=g.A();0<=a-this.pz?(2!=this.Xn&&this.u.wh(3),I6(this),this.lk=2,B6(18),J6(this)):mIa(this,this.pz-a)};
g.k.getLastError=function(){return this.lk};g.Ya(N6,g.fm);var tIa=/^https?$/i,kKa=["POST","PUT"];g.k=N6.prototype;
g.k.send=function(a,b,c,d){if(this.u)throw Error("[goog.net.XhrIo] Object is active with another request="+this.N+"; newUri="+a);b=b?b.toUpperCase():"GET";this.N=a;this.D="";this.G=0;this.ra=b;this.ea=!1;this.C=!0;this.u=this.ba?eIa(this.ba):eIa(T8);this.Y=this.ba?this.ba.getOptions():T8.getOptions();this.u.onreadystatechange=(0,g.z)(this.zE,this);try{c6(Q6(this,"Opening Xhr")),this.ia=!0,this.u.open(b,String(a),!0),this.ia=!1}catch(f){c6(Q6(this,"Error opening Xhr: "+f.message));sIa(this,f);return}a=
c||"";var e=this.headers.clone();d&&DHa(d,function(f,h){e.set(h,f)});
d=g.jb(e.xg(),qIa);c=g.v.FormData&&a instanceof g.v.FormData;!g.nb(kKa,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,h){this.u.setRequestHeader(h,f)},this);
this.Aa&&(this.u.responseType=this.Aa);"withCredentials"in this.u&&this.u.withCredentials!==this.da&&(this.u.withCredentials=this.da);try{vIa(this),0<this.K&&(this.X=pIa(this.u),c6(Q6(this,"Will abort after "+this.K+"ms if incomplete, xhr2 "+this.X)),this.X?(this.u.timeout=this.K,this.u.ontimeout=(0,g.z)(this.NB,this)):this.W=g.Qm(this.NB,this.K,this)),c6(Q6(this,"Sending request")),this.P=!0,this.u.send(a),this.P=!1}catch(f){c6(Q6(this,"Send error: "+f.message)),sIa(this,f)}};
g.k.NB=function(){"undefined"!=typeof g.p1&&this.u&&(this.D="Timed out after "+this.K+"ms, aborting",this.G=8,Q6(this,this.D),this.dispatchEvent("timeout"),this.abort(8))};
g.k.abort=function(a){this.u&&this.C&&(Q6(this,"Aborting"),this.C=!1,this.F=!0,this.u.abort(),this.F=!1,this.G=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),O6(this))};
g.k.aa=function(){this.u&&(this.C&&(this.C=!1,this.F=!0,this.u.abort(),this.F=!1),O6(this,!0));N6.od.aa.call(this)};
g.k.zE=function(){this.la()||(this.ia||this.P||this.F?uIa(this):this.QO())};
g.k.QO=function(){uIa(this)};
g.k.isActive=function(){return!!this.u};
g.k.getStatus=function(){try{return 2<P6(this)?this.u.status:-1}catch(a){return-1}};
g.k.getLastError=function(){return"string"===typeof this.D?this.D:String(this.D)};g.k=wIa.prototype;g.k.zw=null;g.k.Qf=null;g.k.Yt=!1;g.k.MB=null;g.k.Ir=null;g.k.jx=null;g.k.Aw=null;g.k.Ha=null;g.k.jj=-1;g.k.bp=null;g.k.xo=null;g.k.connect=function(a){this.Aw=a;a=S6(this.u,null,this.Aw);B6(3);this.MB=g.A();var b=this.u.K;null!=b?(this.bp=b[0],(this.xo=b[1])?(this.Ha=1,xIa(this)):(this.Ha=2,U6(this))):(a6(a,"MODE","init"),this.Qf=new D6(this,void 0,void 0,void 0),this.Qf.Gl=this.zw,E6(this.Qf,a,!1,null,!0),this.Ha=0)};
g.k.hI=function(a){if(a)this.Ha=2,U6(this);else{B6(4);var b=this.u;b.hi=b.ak.jj;a7(b,9)}a&&this.wh(2)};
g.k.Jv=function(a){return this.u.Jv(a)};
g.k.abort=function(){this.Qf&&(this.Qf.cancel(),this.Qf=null);this.jj=-1};
g.k.LB=function(){return!1};
g.k.CE=function(a,b){this.jj=a.ep;if(0==this.Ha)if(b){try{var c=this.B.parse(b)}catch(d){c=this.u;c.hi=this.jj;a7(c,2);return}this.bp=c[0];this.xo=c[1]}else c=this.u,c.hi=this.jj,a7(c,2);else if(2==this.Ha)if(this.Yt)B6(7),this.jx=g.A();else if("11111"==b){if(B6(6),this.Yt=!0,this.Ir=g.A(),c=this.Ir-this.MB,!g.ve||g.Zd(10)||500>c)this.jj=200,this.Qf.cancel(),B6(12),T6(this.u,this,!0)}else B6(8),this.Ir=this.jx=g.A(),this.Yt=!1};
g.k.ls=function(){this.jj=this.Qf.ep;if(this.Qf.Fh)0==this.Ha?this.xo?(this.Ha=1,xIa(this)):(this.Ha=2,U6(this)):2==this.Ha&&((!g.ve||g.Zd(10)?!this.Yt:200>this.jx-this.Ir)?(B6(11),T6(this.u,this,!1)):(B6(12),T6(this.u,this,!0)));else{0==this.Ha?B6(9):2==this.Ha&&B6(10);var a=this.u;this.Qf.getLastError();a.hi=this.jj;a7(a,2)}};
g.k.qq=function(){return this.u.qq()};
g.k.isActive=function(){return this.u.isActive()};
g.k.wh=function(a){this.u.wh(a)};g.k=V6.prototype;g.k.Ym=null;g.k.No=null;g.k.Hf=null;g.k.zd=null;g.k.yw=null;g.k.Kr=null;g.k.pA=null;g.k.ks=null;g.k.Lp=0;g.k.qM=0;g.k.af=null;g.k.ek=null;g.k.Wi=null;g.k.sl=null;g.k.ak=null;g.k.Cu=null;g.k.hn=-1;g.k.wC=-1;g.k.hi=-1;g.k.Tm=0;g.k.Em=0;g.k.nl=8;g.Ya(AIa,g.Il);g.Ya(BIa,g.Il);g.k=V6.prototype;g.k.connect=function(a,b,c,d,e){B6(0);this.yw=b;this.No=c||{};d&&void 0!==e&&(this.No.OSID=d,this.No.OAID=e);this.F?(z6((0,g.z)(this.GA,this,a),100),FIa(this)):this.GA(a)};
g.k.GA=function(a){this.ak=new wIa(this);this.ak.zw=this.Ym;this.ak.B=this.D;this.ak.connect(a)};
g.k.LB=function(){return 0==this.Ha};
g.k.getState=function(){return this.Ha};
g.k.JE=function(a){this.ek=null;JIa(this,a)};
g.k.IE=function(){this.Wi=null;this.zd=new D6(this,this.B,"rpc",this.G);this.zd.Gl=this.Ym;this.zd.Bw=0;var a=this.pA.clone();Z5(a,"RID","rpc");Z5(a,"SID",this.B);Z5(a,"CI",this.Cu?"0":"1");Z5(a,"AID",this.hn);W6(this,a);if(!g.ve||g.Zd(10))Z5(a,"TYPE","xmlhttp"),E6(this.zd,a,!0,this.ks,!1);else{Z5(a,"TYPE","html");var b=this.zd,c=!!this.ks;b.Xn=3;b.Vj=$5(a.clone());lIa(b,c)}};
g.k.CE=function(a,b){if(0!=this.Ha&&(this.zd==a||this.Hf==a))if(this.hi=a.ep,this.Hf==a&&3==this.Ha)if(7<this.nl){try{var c=this.D.parse(b)}catch(f){c=null}if(Array.isArray(c)&&3==c.length)if(0==c[0])a:{if(!this.Wi){if(this.zd)if(this.zd.On+3E3<this.Hf.On)Y6(this),this.zd.cancel(),this.zd=null;else break a;$6(this);B6(19)}}else this.wC=c[1],0<this.wC-this.hn&&37500>c[2]&&this.Cu&&0==this.Em&&!this.sl&&(this.sl=z6((0,g.z)(this.WM,this),6E3));else a7(this,11)}else b!=jKa.WU.u&&a7(this,11);else if(this.zd==
a&&Y6(this),!g.rc(b)){c=this.D.parse(b);for(var d=0;d<c.length;d++){var e=c[d];this.hn=e[0];e=e[1];2==this.Ha?"c"==e[0]?(this.B=e[1],this.ks=e[2],e=e[3],null!=e?this.nl=e:this.nl=6,this.Ha=3,this.af&&this.af.CA(),this.pA=S6(this,this.qq()?this.ks:null,this.yw),KIa(this)):"stop"==e[0]&&a7(this,7):3==this.Ha&&("stop"==e[0]?a7(this,7):"noop"!=e[0]&&this.af&&this.af.BA(e),this.Em=0)}}};
g.k.WM=function(){null!=this.sl&&(this.sl=null,this.zd.cancel(),this.zd=null,$6(this),B6(20))};
g.k.ls=function(a){if(this.zd==a){Y6(this);this.zd=null;var b=2}else if(this.Hf==a)this.Hf=null,b=1;else return;this.hi=a.ep;if(0!=this.Ha)if(a.Fh)1==b?(b=A6,b.dispatchEvent(new AIa(b,a.im?a.im.length:0,g.A()-a.On,this.Tm)),X6(this),this.C.length=0):KIa(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.hi)){if(d=1==b)this.Hf||this.ek||1==this.Ha||2<=this.Tm?d=!1:(this.ek=z6((0,g.z)(this.JE,this,a),LIa(this,this.Tm)),this.Tm++,d=!0);d=!(d||2==b&&$6(this))}if(d)switch(c){case 1:a7(this,
5);break;case 4:a7(this,10);break;case 3:a7(this,6);break;case 7:a7(this,12);break;default:a7(this,2)}}};
g.k.HI=function(a){if(!g.nb(arguments,this.Ha))throw Error("Unexpected channel state: "+this.Ha);};
g.k.bR=function(a){a?B6(2):(B6(1),MIa(this,8))};
g.k.Jv=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new N6;a.da=!1;return a};
g.k.isActive=function(){return!!this.af&&this.af.isActive(this)};
g.k.wh=function(a){var b=A6;b.dispatchEvent(new BIa(b,a))};
g.k.qq=function(){return!(!g.ve||g.Zd(10))};
g.k=NIa.prototype;g.k.CA=function(){};
g.k.BA=function(){};
g.k.AA=function(){};
g.k.xv=function(){};
g.k.nB=function(){return{}};
g.k.isActive=function(){return!0};g.k=OIa.prototype;g.k.isEmpty=function(){return g.ob(this.u)&&g.ob(this.B)};
g.k.clear=function(){this.u=[];this.B=[]};
g.k.contains=function(a){return g.nb(this.u,a)||g.nb(this.B,a)};
g.k.remove=function(a){var b=this.u;var c=(0,g.NBa)(b,a);0<=c?(g.qb(b,c),b=!0):b=!1;return b||g.rb(this.B,a)};
g.k.rf=function(){for(var a=[],b=this.u.length-1;0<=b;--b)a.push(this.u[b]);var c=this.B.length;for(b=0;b<c;++b)a.push(this.B[b]);return a};g.Ya(b7,g.B);g.k=b7.prototype;g.k.zP=function(){this.df=Math.min(3E5,2*this.df);this.C();this.B&&this.start()};
g.k.start=function(){var a=this.df+15E3*Math.random();this.u.Gb(a);this.B=g.A()+a};
g.k.stop=function(){this.u.stop();this.B=0};
g.k.isActive=function(){return this.u.isActive()};
g.k.reset=function(){this.u.stop();this.df=5E3};g.Ya(c7,NIa);g.k=c7.prototype;g.k.subscribe=function(a,b,c){return this.C.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.C.unsubscribe(a,b,c)};
g.k.Dk=function(a){return this.C.Hl(a)};
g.k.V=function(a,b){return this.C.V.apply(this.C,arguments)};
g.k.dispose=function(){this.Rd||(this.Rd=!0,g.ag(this.C),RIa(this),g.ag(this.B),this.B=null,this.X=function(){return""})};
g.k.la=function(){return this.Rd};
g.k.connect=function(a,b,c){if(!this.u||2!=this.u.getState()){this.N="";this.B.stop();this.F=a||null;this.D=b||0;a=this.W+"/test";b=this.W+"/bind";var d=new V6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.Y),e=this.u;e&&(e.af=null);d.af=this;this.u=d;d7(this);e?(3!=e.getState()&&0==HIa(e)||e.getState(),this.u.connect(a,b,this.G,e.B,e.hn)):c?this.u.connect(a,b,this.G,c.sessionId,c.arrayId):this.u.connect(a,b,this.G)}};
g.k.sendMessage=function(a,b){var c={_sc:a};b&&g.bc(c,b);this.B.isActive()||2==(this.u?this.u.getState():0)?this.K.push(c):e7(this)&&(d7(this),GIa(this.u,c))};
g.k.CA=function(){this.B.reset();this.F=null;this.D=0;if(this.K.length){var a=this.K;this.K=[];for(var b=0,c=a.length;b<c;++b)GIa(this.u,a[b])}this.V("handlerOpened")};
g.k.AA=function(a){var b=2==a&&401==this.u.hi;4==a||b||this.B.start();this.V("handlerError",a)};
g.k.xv=function(a){if(!this.B.isActive())this.V("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.K.push(d)}};
g.k.nB=function(){var a={v:2};this.N&&(a.gsessionid=this.N);0!=this.D&&(a.ui=""+this.D);0!=this.P&&(a.ui=""+this.P);this.F&&g.bc(a,this.F);return a};
g.k.BA=function(a){"S"==a[0]?this.N=a[1]:"gracefulReconnect"==a[0]?(this.B.start(),EIa(this.u)):this.V("handlerMessage",new PIa(a[0],a[1]))};
g.k.EQ=function(){this.B.isActive();0==HIa(this.u)&&this.connect(this.F,this.D)};f7.prototype.D=function(a,b,c,d){b?a(d):a({text:c.responseText})};
f7.prototype.C=function(a,b){a(Error("Request error: "+b.status))};
f7.prototype.F=function(a){a(Error("request timed out"))};var ZIa=g.A(),i7=null,l7=Array(50),k7=-1,m7=!1;g.Ya(n7,g.O);n7.prototype.Yf=function(){return this.screens};
n7.prototype.contains=function(a){return!!k6(this.screens,a)};
n7.prototype.get=function(a){return a?l6(this.screens,a):null};
n7.prototype.info=function(a){j7(this.G,a)};g.u(o7,g.O);g.k=o7.prototype;g.k.start=function(){!this.u&&isNaN(this.Va)&&this.PG()};
g.k.stop=function(){this.u&&(this.u.abort(),this.u=null);isNaN(this.Va)||(g.Eo(this.Va),this.Va=NaN)};
g.k.aa=function(){this.stop();g.O.prototype.aa.call(this)};
g.k.PG=function(){this.Va=NaN;this.u=g.lq(g7(this.G,"/pairing/get_screen"),{method:"POST",dc:{pairing_code:this.F},timeout:5E3,onSuccess:(0,g.z)(this.IR,this),onError:(0,g.z)(this.HR,this),kg:(0,g.z)(this.JR,this)})};
g.k.IR=function(a,b){this.u=null;var c=b.screen||{};c.dialId=this.C;c.name=this.D;this.V("pairingComplete",new f6(c))};
g.k.HR=function(a){this.u=null;a.status&&404==a.status?this.B>=lKa.length?this.V("pairingFailed",Error("DIAL polling timed out")):(a=lKa[this.B],this.Va=g.Co((0,g.z)(this.PG,this),a),this.B++):this.V("pairingFailed",Error("Server error "+a.status))};
g.k.JR=function(){this.u=null;this.V("pairingFailed",Error("Server not responding"))};
var lKa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ya(q7,n7);g.k=q7.prototype;g.k.start=function(){p7(this)&&this.V("screenChange");!g.ut("yt-remote-lounge-token-expiration")&&cJa(this);g.Eo(this.u);this.u=g.Co((0,g.z)(this.start,this),1E4)};
g.k.add=function(a,b){p7(this);$Ia(this,a);r7(this,!1);this.V("screenChange");b(a);a.token||cJa(this)};
g.k.remove=function(a,b){var c=p7(this);bJa(this,a)&&(r7(this,!1),c=!0);b(a);c&&this.V("screenChange")};
g.k.Au=function(a,b,c,d){var e=p7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,r7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.V("screenChange")};
g.k.aa=function(){g.Eo(this.u);q7.od.aa.call(this)};
g.k.tJ=function(a){p7(this);var b=this.screens.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)}r7(this,!b);b&&j7(this.G,"Missed "+b+" lounge tokens.")};
g.k.sJ=function(a){j7(this.G,"Requesting lounge tokens failed: "+a)};g.u(t7,g.O);g.k=t7.prototype;g.k.start=function(){var a=parseInt(g.ut("yt-remote-fast-check-period")||"0",10);(this.D=g.A()-144E5<a?0:a)?v7(this):(this.D=g.A()+3E5,g.tt("yt-remote-fast-check-period",this.D),this.qy())};
g.k.isEmpty=function(){return g.Wb(this.u)};
g.k.update=function(){s7("Updating availability on schedule.");var a=this.G(),b=g.Jb(this.u,function(c,d){return c&&!!l6(a,d)},this);
u7(this,b)};
g.k.aa=function(){g.Eo(this.C);this.C=NaN;this.B&&(this.B.abort(),this.B=null);g.O.prototype.aa.call(this)};
g.k.qy=function(){g.Eo(this.C);this.C=NaN;this.B&&this.B.abort();var a=fJa(this);if(b6(a)){var b=g7(this.F,"/pairing/get_screen_availability");this.B=h7(this.F,b,{lounge_token:g.Qb(a).join(",")},(0,g.z)(this.kP,this,a),(0,g.z)(this.jP,this))}else u7(this,{}),v7(this)};
g.k.kP=function(a,b){this.B=null;var c=g.Qb(fJa(this));if(g.Db(c,g.Qb(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;u7(this,d);v7(this)}else this.dd("Changing Screen set during request."),this.qy()};
g.k.jP=function(a){this.dd("Screen availability failed: "+a);this.B=null;v7(this)};
g.k.dd=function(a){j7("OnlineScreenService",a)};g.Ya(w7,n7);g.k=w7.prototype;g.k.start=function(){this.B.start();this.u.start();this.screens.length&&(this.V("screenChange"),this.u.isEmpty()||this.V("onlineScreenChange"))};
g.k.add=function(a,b,c){this.B.add(a,b,c)};
g.k.remove=function(a,b,c){this.B.remove(a,b,c);this.u.update()};
g.k.Au=function(a,b,c,d){this.B.contains(a)?this.B.Au(a,b,c,d):(a="Updating name of unknown screen: "+a.name,j7(this.G,a),d(Error(a)))};
g.k.Yf=function(a){return a?this.screens:g.tb(this.screens,g.Je(this.C,function(b){return!this.contains(b)},this))};
g.k.QG=function(){return g.Je(this.Yf(!0),function(a){return!!this.u.u[a.id]},this)};
g.k.SG=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new o7(this.F,a,b,c);f.subscribe("pairingComplete",(0,g.z)(function(h){g.ag(f);d(x7(this,h))},this));
f.subscribe("pairingFailed",function(h){g.ag(f);e(h)});
f.start();return(0,g.z)(f.stop,f)};
g.k.LR=function(a,b,c,d){g.lq(g7(this.F,"/pairing/get_screen"),{method:"POST",dc:{pairing_code:a},timeout:5E3,onSuccess:(0,g.z)(function(e,f){var h=new f6(f.screen||{});if(!h.name||jJa(this,h.name)){a:{var l=h.name;for(var m=2,n=b(l,m);jJa(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}h.name=l}c(x7(this,h))},this),
onError:(0,g.z)(function(e){d(Error("pairing request failed: "+e.status))},this),
kg:(0,g.z)(function(){d(Error("pairing request timed out."))},this)})};
g.k.aa=function(){g.ag(this.B);g.ag(this.u);w7.od.aa.call(this)};
g.k.AJ=function(){kJa(this);this.V("screenChange");this.u.update()};
w7.prototype.dispose=w7.prototype.dispose;g.Ya(z7,g.O);g.k=z7.prototype;g.k.getScreen=function(){return this.K};
g.k.Nt=function(a){this.K=a;this.V("sessionScreen",this.K)};
g.k.hg=function(a){this.la()||(a&&A7(this,""+a),this.K=null,this.V("sessionScreen",null))};
g.k.info=function(a){j7(this.Y,a)};
g.k.UG=function(){return null};
g.k.By=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.z)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.z)(function(){A7(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.k.aa=function(){this.By("");z7.od.aa.call(this)};g.u(B7,z7);g.k=B7.prototype;g.k.Ay=function(a){if(this.B){if(this.B==a)return;A7(this,"Overriding cast sesison with new session object");this.B.removeUpdateListener(this.F);this.B.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D)}this.B=a;this.B.addUpdateListener(this.F);this.B.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.D);mJa(this)};
g.k.jn=function(a){this.info("launchWithParams no-op for Cast: "+g.Cj(a))};
g.k.stop=function(){this.B?this.B.stop((0,g.z)(function(){this.hg()},this),(0,g.z)(function(){this.hg(Error("Failed to stop receiver app."))},this)):this.hg(Error("Stopping cast device witout session."))};
g.k.By=function(){};
g.k.aa=function(){this.info("disposeInternal");g.Eo(this.C);this.C=0;this.B&&(this.B.removeUpdateListener(this.F),this.B.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D));this.B=null;z7.prototype.aa.call(this)};
g.k.ZP=function(a,b){if(!this.la())if(b){var c=x6(b);if(g.Sa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Cj(c));switch(d){case "mdxSessionStatus":lJa(this,c.screenId);break;default:A7(this,"Unknown youtube message: "+d)}}else A7(this,"Unable to parse message.")}else A7(this,"No data in message.")};
g.k.EB=function(a,b,c,d){iJa(this.P,this.u.label,a,this.u.friendlyName,(0,g.z)(function(e){e?b(e):0<=d?(A7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Co((0,g.z)(this.EB,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.k.UG=function(){return this.B};
g.k.MR=function(a){this.la()||a||(A7(this,"Cast session died."),this.hg())};g.u(C7,z7);g.k=C7.prototype;g.k.Ay=function(a){this.C=a;this.C.addUpdateListener(this.X)};
g.k.jn=function(a){this.W=a;this.F()};
g.k.stop=function(){this.B();this.B=g.Oa;g.Eo(this.D);this.C?this.C.stop((0,g.z)(this.hg,this,null),(0,g.z)(this.hg,this,"Failed to stop DIAL device.")):this.hg()};
g.k.aa=function(){this.B();this.B=g.Oa;g.Eo(this.D);this.C&&this.C.removeUpdateListener(this.X);this.C=null;z7.prototype.aa.call(this)};
g.k.PR=function(a){this.la()||a||(A7(this,"DIAL session died."),this.B(),this.B=g.Oa,this.hg())};
g.k.Mw=function(a){this.N=j6();if(this.W){var b=new chrome.cast.DialLaunchResponse(!0,oJa(this));a(b);nJa(this)}else this.F=(0,g.z)(function(){g.Eo(this.D);this.F=g.Oa;this.D=NaN;var c=new chrome.cast.DialLaunchResponse(!0,oJa(this));a(c);nJa(this)},this),this.D=g.Co((0,g.z)(function(){this.F()},this),100)};
g.k.RJ=function(a,b,c){iJa(this.P,this.G.receiver.label,a,this.u.friendlyName,(0,g.z)(function(d){d&&d.token?(this.Nt(d),b(new chrome.cast.DialLaunchResponse(!1))):this.Mw(b,c)},this),(0,g.z)(function(d){A7(this,"Failed to get DIAL screen: "+d);
this.Mw(b,c)},this))};g.u(D7,z7);D7.prototype.stop=function(){this.hg()};
D7.prototype.Ay=function(){};
D7.prototype.jn=function(){g.Eo(this.B);this.B=NaN;var a=l6(this.P.Yf(),this.u.label);a?this.Nt(a):this.hg(Error("No such screen"))};
D7.prototype.aa=function(){g.Eo(this.B);this.B=NaN;z7.prototype.aa.call(this)};g.u(E7,g.O);g.k=E7.prototype;
g.k.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.K);this.P||(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.z)(this.UO,this);c=new chrome.cast.ApiConfig(c,(0,g.z)(this.EE,this),f,d,e);c.customDialLaunchCallback=(0,g.z)(this.uN,this);chrome.cast.initialize(c,(0,g.z)(function(){this.la()||
(chrome.cast.addReceiverActionListener(this.D),WIa(),this.B.subscribe("onlineScreenChange",(0,g.z)(this.TG,this)),this.C=qJa(this),chrome.cast.setCustomReceivers(this.C,g.Oa,(0,g.z)(function(h){this.dd("Failed to set initial custom receivers: "+g.Cj(h))},this)),this.V("yt-remote-cast2-availability-change",G7(this)),b(!0))},this),(0,g.z)(function(h){this.dd("Failed to initialize API: "+g.Cj(h));
b(!1)},this))};
g.k.JQ=function(a,b){F7("Setting connected screen ID: "+a+" -> "+b);if(this.u){var c=this.u.getScreen();if(!a||c&&c.id!=a)F7("Unsetting old screen status: "+this.u.u.friendlyName),H7(this,null)}if(a&&b){if(!this.u){c=l6(this.B.Yf(),a);if(!c){F7("setConnectedScreenStatus: Unknown screen.");return}var d=pJa(this,c);d||(F7("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.C.push(d),chrome.cast.setCustomReceivers(this.C,
g.Oa,(0,g.z)(function(e){this.dd("Failed to set initial custom receivers: "+g.Cj(e))},this)));
F7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);H7(this,new D7(this.B,d),!0)}this.u.By(b)}else F7("setConnectedScreenStatus: no screen.")};
g.k.KQ=function(a){this.la()?this.dd("Setting connection data on disposed cast v2"):this.u?this.u.jn(a):this.dd("Setting connection data without a session")};
g.k.OR=function(){this.la()?this.dd("Stopping session on disposed cast v2"):this.u?(this.u.stop(),H7(this,null)):F7("Stopping non-existing session")};
g.k.requestSession=function(){chrome.cast.requestSession((0,g.z)(this.EE,this),(0,g.z)(this.mP,this))};
g.k.aa=function(){this.B.unsubscribe("onlineScreenChange",(0,g.z)(this.TG,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.D);var a=TIa,b=g.Na("yt.mdx.remote.debug.handlers_");g.rb(b||[],a);g.ag(this.u);g.O.prototype.aa.call(this)};
g.k.dd=function(a){j7("Controller",a)};
g.k.GE=function(a,b){this.u==a&&(b||H7(this,null),this.V("yt-remote-cast2-session-change",b))};
g.k.RO=function(a,b){if(!this.la())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),F7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.u)if(this.u.u.label!=a.label)F7("onReceiverAction_: Stopping active receiver: "+this.u.u.friendlyName),this.u.stop();else{F7("onReceiverAction_: Casting to active receiver.");this.u.getScreen()&&this.V("yt-remote-cast2-session-change",this.u.getScreen());break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:H7(this,
new D7(this.B,a));break;case chrome.cast.ReceiverType.DIAL:H7(this,new C7(this.B,a,this.G));break;case chrome.cast.ReceiverType.CAST:H7(this,new B7(this.B,a));break;default:this.dd("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.u&&this.u.u.label==a.label?this.u.stop():this.dd("Stopping receiver w/o session: "+a.friendlyName)}else this.dd("onReceiverAction_ called without receiver.")};
g.k.uN=function(a){if(this.la())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dd("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.u?this.u.u:null;if(!c||c.label!=b.label)return this.dd("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.u.getScreen())return F7("Reselecting dial screen."),
this.V("yt-remote-cast2-session-change",this.u.getScreen()),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dd('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);H7(this,new C7(this.B,b,this.G))}b=this.u;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.z)(b.RJ,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.z)(b.Mw,b))};
g.k.EE=function(a){if(!this.la()){F7("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.u)if(b.receiverType==chrome.cast.ReceiverType.CAST)F7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),H7(this,new B7(this.B,b),!0);else{this.dd("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.u.u,d=l6(this.B.Yf(),c.label);d&&g6(d,b.label)&&
c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(F7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.ag(this.u),this.u=new B7(this.B,b),this.u.subscribe("sessionScreen",(0,g.z)(this.GE,this,this.u)),this.u.jn(null));this.u.Ay(a)}}};
g.k.NR=function(){return this.u?this.u.UG():null};
g.k.mP=function(a){this.la()||(this.dd("Failed to estabilish a session: "+g.Cj(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&H7(this,null))};
g.k.UO=function(a){F7("Receiver availability updated: "+a);if(!this.la()){var b=G7(this);this.F=a==chrome.cast.ReceiverAvailability.AVAILABLE;G7(this)!=b&&this.V("yt-remote-cast2-availability-change",G7(this))}};
g.k.TG=function(){this.la()||(this.C=qJa(this),F7("Updating custom receivers: "+g.Cj(this.C)),chrome.cast.setCustomReceivers(this.C,g.Oa,(0,g.z)(function(){this.dd("Failed to set custom receivers.")},this)),this.V("yt-remote-cast2-availability-change",G7(this)))};
E7.prototype.setLaunchParams=E7.prototype.KQ;E7.prototype.setConnectedScreenStatus=E7.prototype.JQ;E7.prototype.stopSession=E7.prototype.OR;E7.prototype.getCastSession=E7.prototype.NR;E7.prototype.requestSession=E7.prototype.requestSession;E7.prototype.init=E7.prototype.init;E7.prototype.dispose=E7.prototype.dispose;var N7=[];g.k=S7.prototype;
g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";T7(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.u=a.trackData,this.ji=a.hasPrevious,this.hasNext=a.hasNext,this.K=a.playerTime,this.G=a.playerTimeAt,this.F=a.seekableStart,this.B=a.seekableEnd,this.P=a.duration,this.N=a.loadedTime,this.D=a.liveIngestionTime,this.C=!isNaN(this.D))};
g.k.Jb=function(){return 1==this.playerState};
g.k.isAdPlaying=function(){return 1081==this.playerState};
g.k.getDuration=function(){return this.C?this.P+U7(this):this.P};
g.k.clone=function(){return new S7(Y7(this))};g.u($7,g.O);g.k=$7.prototype;g.k.getState=function(){return this.Ha};
g.k.play=function(){b8(this)?(this.u?this.u.play(null,g.Oa,g8(this,"play")):f8(this,"play"),e8(this,1,W7(a8(this))),this.V("remotePlayerChange")):c8(this,this.play)};
g.k.pause=function(){b8(this)?(this.u?this.u.pause(null,g.Oa,g8(this,"pause")):f8(this,"pause"),e8(this,2,W7(a8(this))),this.V("remotePlayerChange")):c8(this,this.pause)};
g.k.seekTo=function(a){if(b8(this)){if(this.u){var b=a8(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.Jb()||3==b.playerState?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.u.seek(c,g.Oa,g8(this,"seekTo",{newTime:a}))}else f8(this,"seekTo",{newTime:a});e8(this,3,a);this.V("remotePlayerChange")}else c8(this,g.Va(this.seekTo,a))};
g.k.stop=function(){if(b8(this)){this.u?this.u.stop(null,g.Oa,g8(this,"stopVideo")):f8(this,"stopVideo");var a=a8(this);a.index=-1;a.videoId="";T7(a);d8(this,a);this.V("remotePlayerChange")}else c8(this,this.stop)};
g.k.setVolume=function(a,b){if(b8(this)){var c=a8(this);if(this.B){if(c.volume!=a){var d=Math.round(a)/100;this.B.setReceiverVolumeLevel(d,(0,g.z)(function(){j7("CP","set receiver volume: "+d)},this),(0,g.z)(function(){this.dd("failed to set receiver volume.")},this))}c.muted!=b&&this.B.setReceiverMuted(b,(0,g.z)(function(){j7("CP","set receiver muted: "+b)},this),(0,g.z)(function(){this.dd("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);f8(this,"setVolume",e)}c.muted=b;c.volume=a;d8(this,c)}else c8(this,g.Va(this.setVolume,a,b))};
g.k.OG=function(a,b){if(b8(this)){var c=a8(this),d={videoId:a};b&&(c.u={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Cj(b.style),g.bc(d,c.u));f8(this,"setSubtitlesTrack",d);d8(this,c)}else c8(this,g.Va(this.OG,a,b))};
g.k.setAudioTrack=function(a,b){if(b8(this)){var c=b.getLanguageInfo().getId();f8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=a8(this);d.audioTrackId=c;d8(this,d)}else c8(this,g.Va(this.setAudioTrack,a,b))};
g.k.playVideo=function(a,b,c,d,e,f,h){var l=a8(this);c=c||0;var m={videoId:a,currentIndex:c};X7(l,a,c);void 0!==b&&(V7(l,b),m.currentTime=b);void 0!==d&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=h&&(m.locationInfo=g.Cj(h));f8(this,"setPlaylist",m);d||d8(this,l)};
g.k.Tt=function(a,b){if(b8(this)){if(a&&b){var c=a8(this);X7(c,a,b);d8(this,c)}f8(this,"previous")}else c8(this,g.Va(this.Tt,a,b))};
g.k.nextVideo=function(a,b){if(b8(this)){if(a&&b){var c=a8(this);X7(c,a,b);d8(this,c)}f8(this,"next")}else c8(this,g.Va(this.nextVideo,a,b))};
g.k.XA=function(){b8(this)?f8(this,"dismissAutoplay"):c8(this,this.XA)};
g.k.dispose=function(){if(3!=this.Ha){var a=this.Ha;this.Ha=3;this.V("proxyStateChange",a,this.Ha)}g.O.prototype.dispose.call(this)};
g.k.aa=function(){DJa(this);this.C=null;this.D.clear();Z7(this,null);g.O.prototype.aa.call(this)};
g.k.sz=function(a){if((a!=this.Ha||2==a)&&3!=this.Ha&&0!=a){var b=this.Ha;this.Ha=a;this.V("proxyStateChange",b,a);if(1==a)for(;!this.D.isEmpty();)b=a=this.D,g.ob(b.u)&&(b.u=b.B,b.u.reverse(),b.B=[]),a.u.pop().apply(this);else 3==a&&this.dispose()}};
g.k.NO=function(a,b){this.V(a,b)};
g.k.fN=function(a){if(!a)this.Np(null),Z7(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var b=a8(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)j7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,d8(this,b)}};
g.k.Np=function(a){j7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.K);if(this.u=a)this.u.addUpdateListener(this.K),EJa(this),this.V("remotePlayerChange")};
g.k.eN=function(a){a?(EJa(this),this.V("remotePlayerChange")):this.Np(null)};
g.k.Uy=function(){f8(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.k.mN=function(){var a=AJa();a&&Z7(this,a)};
g.k.dd=function(a){j7("CP",a)};g.u(h8,g.O);g.k=h8.prototype;
g.k.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,h=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!==h&&(l.currentIndex=h);c&&(this.Cb.listId=c);this.Cb.videoId=d;this.Cb.index=h||0;this.Cb.state=3;V7(this.Cb,m);this.D="UNSUPPORTED";i8("Connecting with setPlaylist and params: "+g.Cj(l));this.u.connect({method:"setPlaylist",
params:g.Cj(l)},a,PHa())}else i8("Connecting without params"),this.u.connect({},a,PHa());GJa(this)};
g.k.dispose=function(){this.la()||(this.V("beforeDispose"),j8(this,3));g.O.prototype.dispose.call(this)};
g.k.aa=function(){k8(this);m8(this);l8(this);g.Eo(this.K);this.K=NaN;g.Eo(this.P);this.P=NaN;this.C=null;g.ap(this.Y);this.Y.length=0;this.u.dispose();g.O.prototype.aa.call(this);this.D=this.G=this.B=this.Cb=this.u=null};
g.k.mJ=function(){this.Om(2)};
g.k.jN=function(){i8("Channel opened");this.X&&(this.X=!1,l8(this),this.W=g.Co((0,g.z)(function(){i8("Timing out waiting for a screen.");this.Om(1)},this),15E3));
THa(QIa(this.u),this.ba)};
g.k.gN=function(){i8("Channel closed");isNaN(this.F)?q6(!0):q6();this.dispose()};
g.k.hN=function(a){q6();isNaN(this.Wo())?(i8("Channel error: "+a+" without reconnection"),this.dispose()):(this.X=!0,i8("Channel error: "+a+" with reconnection in "+this.Wo()+" ms"),j8(this,2))};
g.k.iN=function(a){a.params?i8("Received: action="+a.action+", params="+g.Cj(a.params)):i8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=x6(a.params.devices);this.B=g.Pc(a,function(c){return new e6(c)});
a=!!g.jb(this.B,function(c){return"LOUNGE_SCREEN"==c.type});
JJa(this,a);break;case "loungeScreenDisconnected":g.sb(this.B,function(c){return"LOUNGE_SCREEN"==c.type});
JJa(this,!1);break;case "remoteConnected":var b=new e6(x6(a.params.device));g.jb(this.B,function(c){return b?c.id==b.id:!1})||zHa(this.B,b);
break;case "remoteDisconnected":b=new e6(x6(a.params.device));g.sb(this.B,function(c){return b?c.id==b.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":LJa(this,a);break;case "nowPlaying":NJa(this,a);break;case "onStateChange":MJa(this,a);break;case "onAdStateChange":OJa(this,a);break;case "onVolumeChanged":PJa(this,a);break;case "onSubtitlesTrackChanged":KJa(this,a);break;case "nowAutoplaying":QJa(this,a);break;case "autoplayDismissed":this.V("autoplayDismissed");break;case "autoplayUpNext":this.G=a.params.videoId||null;this.V("autoplayUpNext",this.G);break;case "onAutoplayModeChanged":this.D=
a.params.autoplayMode;this.V("autoplayModeChange",this.D);"DISABLED"==this.D&&this.V("autoplayDismissed");break;case "onHasPreviousNextChanged":RJa(this,a);break;case "requestAssistedSignIn":this.V("assistedSignInRequested",a.params.authCode);break;default:i8("Unrecognized action: "+a.action)}};
g.k.AQ=function(){if(this.C){var a=this.C;this.C=null;this.Cb.videoId!=a&&n8(this,"getNowPlaying")}};
g.k.dJ=function(){var a=3;this.la()||(a=0,isNaN(this.Wo())?e7(this.u)&&isNaN(this.F)&&(a=1):a=2);return a};
g.k.Om=function(a){i8("Disconnecting with "+a);k8(this);this.V("beforeDisconnect",a);1==a&&q6();RIa(this.u,a);this.dispose()};
g.k.bJ=function(){var a=this.Cb;this.C&&(a=this.Cb.clone(),X7(a,this.C,a.index));return Y7(a)};
g.k.LQ=function(a){var b=new S7(a);b.videoId&&b.videoId!=this.Cb.videoId&&(this.C=b.videoId,g.Eo(this.K),this.K=g.Co((0,g.z)(this.AQ,this),5E3));var c=[];this.Cb.listId==b.listId&&this.Cb.videoId==b.videoId&&this.Cb.index==b.index||c.push("remoteQueueChange");this.Cb.playerState==b.playerState&&this.Cb.volume==b.volume&&this.Cb.muted==b.muted&&W7(this.Cb)==W7(b)&&g.Cj(this.Cb.u)==g.Cj(b.u)||c.push("remotePlayerChange");this.Cb.reset(a);g.Fb(c,function(d){this.V(d)},this)};
g.k.CB=function(){var a=this.u.G.id,b=g.jb(this.B,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.k.Wo=function(){var a=this.u;return a.B.isActive()?a.B.B-g.A():NaN};
g.k.QI=function(){return this.D||"UNSUPPORTED"};
g.k.RI=function(){return this.G||""};
g.k.GR=function(){if(!isNaN(this.Wo())){var a=this.u.B;g.pn(a.u);a.start()}};
g.k.HQ=function(a,b){n8(this,a,b);IJa(this)};
g.k.NG=function(){var a=g.sq("SID","")||"",b=g.sq("SAPISID","")||"",c=g.sq("__Secure-3PAPISID","")||"";if(!a&&!b&&!c)return"";a=g.nf(g.Ue(a),2);b=g.nf(g.Ue(b),2);c=g.nf(g.Ue(c),2);return g.nf(g.Ue(a+","+b+","+c),2)};
h8.prototype.subscribe=h8.prototype.subscribe;h8.prototype.unsubscribeByKey=h8.prototype.Dk;h8.prototype.getProxyState=h8.prototype.dJ;h8.prototype.disconnect=h8.prototype.Om;h8.prototype.getPlayerContextData=h8.prototype.bJ;h8.prototype.setPlayerContextData=h8.prototype.LQ;h8.prototype.getOtherConnectedRemoteId=h8.prototype.CB;h8.prototype.getReconnectTimeout=h8.prototype.Wo;h8.prototype.getAutoplayMode=h8.prototype.QI;h8.prototype.getAutoplayVideoId=h8.prototype.RI;h8.prototype.reconnect=h8.prototype.GR;
h8.prototype.sendMessage=h8.prototype.HQ;h8.prototype.getXsrfToken=h8.prototype.NG;g.u(o8,n7);g.k=o8.prototype;g.k.Yf=function(a){return this.cf.$_gs(a)};
g.k.contains=function(a){return!!this.cf.$_c(a)};
g.k.get=function(a){return this.cf.$_g(a)};
g.k.start=function(){this.cf.$_st()};
g.k.add=function(a,b,c){this.cf.$_a(a,b,c)};
g.k.remove=function(a,b,c){this.cf.$_r(a,b,c)};
g.k.Au=function(a,b,c,d){this.cf.$_un(a,b,c,d)};
g.k.aa=function(){for(var a=0,b=this.u.length;a<b;++a)this.cf.$_ubk(this.u[a]);this.u.length=0;this.cf=null;n7.prototype.aa.call(this)};
g.k.KR=function(){this.V("screenChange")};
g.k.sO=function(){this.V("onlineScreenChange")};
w7.prototype.$_st=w7.prototype.start;w7.prototype.$_gspc=w7.prototype.LR;w7.prototype.$_gsppc=w7.prototype.SG;w7.prototype.$_c=w7.prototype.contains;w7.prototype.$_g=w7.prototype.get;w7.prototype.$_a=w7.prototype.add;w7.prototype.$_un=w7.prototype.Au;w7.prototype.$_r=w7.prototype.remove;w7.prototype.$_gs=w7.prototype.Yf;w7.prototype.$_gos=w7.prototype.QG;w7.prototype.$_s=w7.prototype.subscribe;w7.prototype.$_ubk=w7.prototype.Dk;var H8=null,G8=!1,p8=null,q8=null,F8=null,u8=[];g.u(I8,g.B);g.k=I8.prototype;g.k.aa=function(){g.B.prototype.aa.call(this);this.u.stop();this.C.stop();this.P.stop();this.X();var a=this.ub;a.unsubscribe("proxyStateChange",this.BE,this);a.unsubscribe("remotePlayerChange",this.Sp,this);a.unsubscribe("remoteQueueChange",this.Ot,this);a.unsubscribe("previousNextChange",this.yE,this);a.unsubscribe("nowAutoplaying",this.tE,this);a.unsubscribe("autoplayDismissed",this.VD,this);this.ub=this.B=null};
g.k.gD=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.ub.Ha)if(J8(this)){if(!a8(this.ub).isAdPlaying()||"control_seek"!==a)switch(a){case "control_toggle_play_pause":a8(this.ub).Jb()?this.ub.pause():this.ub.play();break;case "control_play":this.ub.play();break;case "control_pause":this.ub.pause();break;case "control_seek":this.K.OC(c[0],c[1]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":this.setAudioTrack(c[0])}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=
this.J.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":this.setAudioTrack(c[0])}};
g.k.cN=function(a){this.P.jJ(a)};
g.k.oR=function(a){this.gD("control_subtitles_set_track",g.Wb(a)?null:a)};
g.k.YF=function(){var a=this.J.getOption("captions","track");g.Wb(a)||K8(this,a)};
g.k.Hc=function(a){this.B.Hc(a,this.J.getVideoData().lengthSeconds)};
g.k.WN=function(){g.Wb(this.D)||dKa(this,this.D);this.F=!1};
g.k.BE=function(a,b){this.C.stop();2===b&&this.VF()};
g.k.Sp=function(){if(J8(this)){this.u.stop();var a=a8(this.ub);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.B.pe=1;break;case 1082:case 1083:this.B.pe=0;break;default:this.B.pe=-1}switch(a.playerState){case 1081:case 1:this.Pd(new g.zL(8));this.UF();break;case 1085:case 3:this.Pd(new g.zL(9));break;case 1083:case 0:this.Pd(new g.zL(2));this.K.stop();this.Hc(this.J.getVideoData().lengthSeconds);break;case 1084:this.Pd(new g.zL(4));break;case 2:this.Pd(new g.zL(4));this.Hc(W7(a));
break;case -1:this.Pd(new g.zL(64));break;case -1E3:this.Pd(new g.zL(128,{errorCode:"mdx.remoteerror",errorMessage:"\u3053\u306e\u52d5\u753b\u306f\u30ea\u30e2\u30fc\u30c8\u518d\u751f\u3067\u304d\u307e\u305b\u3093\u3002"}))}a=a8(this.ub).u;var b=this.D;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.D=a,dKa(this,a));a=a8(this.ub);-1===a.volume||Math.round(this.J.getVolume())===a.volume&&this.J.isMuted()===a.muted||this.N.isActive()||
this.yG()}else cKa(this)};
g.k.yE=function(){this.J.V("mdxpreviousnextchange")};
g.k.Ot=function(){J8(this)||cKa(this)};
g.k.tE=function(a){isNaN(a)||this.J.V("mdxnowautoplaying",a)};
g.k.VD=function(){this.J.V("mdxautoplaycanceled")};
g.k.setAudioTrack=function(a){J8(this)&&this.ub.setAudioTrack(this.J.getVideoData(1).videoId,a)};
g.k.seekTo=function(a,b){-1===a8(this.ub).playerState?L8(this,a):b&&this.ub.seekTo(a)};
g.k.yG=function(){var a=this;if(J8(this)){var b=a8(this.ub);this.events.Db(this.W);b.muted?this.J.mute():this.J.unMute();this.J.setVolume(b.volume);this.W=this.events.R(this.J,"onVolumeChange",function(c){bKa(a,c)})}};
g.k.UF=function(){this.u.stop();if(!this.ub.la()){var a=a8(this.ub);a.Jb()&&this.Pd(new g.zL(8));this.Hc(W7(a));this.u.start()}};
g.k.VF=function(){this.C.stop();this.u.stop();var a=this.ub.C.getReconnectTimeout();2==this.ub.Ha&&!isNaN(a)&&this.C.start()};
g.k.Pd=function(a){this.C.stop();var b=this.G;if(!g.EL(b,a)){var c=g.U(a,2);c!==g.U(this.G,2)&&g.K0(this.J.app,c);this.G=a;fKa(this.B,b,a)}};g.u(M8,g.V);M8.prototype.tc=function(){this.u.show()};
M8.prototype.fb=function(){this.u.hide()};
M8.prototype.B=function(){g.QK("https://support.google.com/youtube/answer/7640706")};
M8.prototype.C=function(){d6("mdx-manual-pairing-popup-ok");this.fb()};g.u(N8,g.V);N8.prototype.tc=function(){this.u.show()};
N8.prototype.fb=function(){this.u.hide()};
N8.prototype.B=function(){d6("mdx-privacy-popup-cancel");this.fb()};
N8.prototype.C=function(){d6("mdx-privacy-popup-confirm");this.fb()};g.u(O8,g.V);O8.prototype.B=function(a){eKa(this,a.state)};g.u(P8,g.ZZ);P8.prototype.D=function(){var a=this.J.getOption("remote","receivers");a&&1<a.length&&!this.J.getOption("remote","quickCast")?(this.Jk=g.Hb(a,this.u,this),g.$Z(this,g.Pc(a,this.u)),a=this.J.getOption("remote","currentReceiver"),this.yc(this.u(a)),this.enable(!0)):this.enable(!1)};
P8.prototype.u=function(a){return a.key};
P8.prototype.qh=function(a){return"cast-selector-receiver"===a?"\u30ad\u30e3\u30b9\u30c8...":this.Jk[a].name};
P8.prototype.He=function(a){g.ZZ.prototype.He.call(this,a);this.J.setOption("remote","currentReceiver",this.Jk[a]);this.Ua.fb()};g.u(Q8,g.AS);g.k=Q8.prototype;
g.k.create=function(){var a=this.player.T(),b=g.LC(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:g.Q(a.experiments,"mdx_load_cast_api_bootstrap_script")};WJa(b,a);this.subscriptions.push(g.Jo("yt-remote-before-disconnect",this.aN,this));this.subscriptions.push(g.Jo("yt-remote-connection-change",this.VO,this));this.subscriptions.push(g.Jo("yt-remote-receiver-availability-change",this.AE,this));this.subscriptions.push(g.Jo("yt-remote-auto-connect",this.TO,this));this.subscriptions.push(g.Jo("yt-remote-receiver-resumed",
this.SO,this));this.subscriptions.push(g.Jo("mdx-privacy-popup-confirm",this.qQ,this));this.subscriptions.push(g.Jo("mdx-privacy-popup-cancel",this.pQ,this));this.subscriptions.push(g.Jo("mdx-manual-pairing-popup-ok",this.fK,this));this.AE()};
g.k.load=function(){this.player.cancelPlayback();g.AS.prototype.load.call(this);this.Uh=new I8(this,this.player,this.ub);var a=(a=aKa())?a.currentTime:0;var b=E8()?new $7(z8(),void 0):null;0==a&&b&&(a=W7(a8(b)));0!==a&&this.Hc(a);fKa(this,this.Bc,this.Bc);g.S0(this.player.app,6)};
g.k.unload=function(){this.player.V("mdxautoplaycanceled");this.ck=this.mh;g.bg(this.Uh,this.ub);this.ub=this.Uh=null;g.AS.prototype.unload.call(this);g.S0(this.player.app,5);R8(this)};
g.k.aa=function(){g.Ko(this.subscriptions);g.AS.prototype.aa.call(this)};
g.k.Bi=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.Uh.gD.apply(this.Uh,[a].concat(g.la(c)))};
g.k.getAdState=function(){return this.pe};
g.k.fJ=function(){return this.loaded?this.Uh.suggestion:null};
g.k.ji=function(){return this.ub?a8(this.ub).ji:!1};
g.k.hasNext=function(){return this.ub?a8(this.ub).hasNext:!1};
g.k.Hc=function(a,b){this.xC=a||0;this.player.V("progresssync",a,b)};
g.k.getCurrentTime=function(){return this.xC};
g.k.getProgressState=function(){var a=a8(this.ub),b=this.player.getVideoData();return{allowSeeking:g.Q(this.player.T().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.ne():!a.isAdPlaying()&&this.player.ne(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.C?a.D+U7(a):a.D,isAtLiveHead:1>=(a.C?a.B+U7(a):a.B)-this.getCurrentTime(),loaded:a.N,seekableEnd:a.C?a.B+U7(a):a.B,seekableStart:0<a.F?a.F+
U7(a):a.F}};
g.k.nextVideo=function(){this.ub&&this.ub.nextVideo()};
g.k.Tt=function(){this.ub&&this.ub.Tt()};
g.k.aN=function(a){1===a&&(this.ay=this.ub?a8(this.ub):null)};
g.k.VO=function(){var a=E8()?new $7(z8(),void 0):null;if(a){var b=this.ck;this.loaded&&this.unload();this.ub=a;this.ay=null;b.key!==this.mh.key&&(this.ck=b,this.load())}else g.ag(this.ub),this.ub=null,this.loaded&&(this.unload(),(a=this.ay)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,W7(a)));this.player.V("videodatachange","newdata",this.player.getVideoData(),3)};
g.k.AE=function(){this.Jk=[this.mh].concat(YJa());var a=A8()||this.mh;S8(this,a);this.player.va("onMdxReceiversChange")};
g.k.TO=function(){var a=A8();S8(this,a)};
g.k.SO=function(){this.ck=A8()};
g.k.qQ=function(){this.Up=!0;R8(this);G8=!1;H8&&C8(H8,1);H8=null};
g.k.pQ=function(){this.Up=!1;R8(this);S8(this,this.mh);this.ck=this.mh;G8=!1;H8=null;this.player.playVideo()};
g.k.fK=function(){this.Us=!0;R8(this);g.tt("yt-remote-manual-pairing-warning-shown",!0,2592E3);G8=!1;H8&&C8(H8,1);H8=null};
g.k.je=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.Jk;case "currentReceiver":return b&&("cast-selector-receiver"===b.key?Q7():S8(this,b)),this.loaded?this.ck:this.mh;case "quickCast":return 2===this.Jk.length&&"cast-selector-receiver"===this.Jk[1].key?(b&&Q7(),!0):!1}};
g.k.Uy=function(){this.ub.Uy()};
g.k.Eh=function(){return!1};
g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.CX.remote=Q8;})(_yt_player);