uawdijnntqw1x1x1
IP : 216.73.216.30
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
.
/
files
/
need-2-delete
/
mini-borishof.ru1
/
.
/
.
/
.
/
upload
/
models
/
mini
/
remote.js
/
/
(function(g){var window=this;var Gua=function(a,b){return g.Lb(a,b)},Y5=function(a,b,c){a.w.set(b,c)},Z5=function(a){Y5(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^(0,g.H)()).toString(36)); return a},$5=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.dn(a.w,b,c)},Hua=function(a,b){var c=[]; g.kk(b,function(d){try{var e=g.go.prototype.u.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.fo(e)&&c.push(d)},a); return c},Iua=function(a,b){var c=Hua(a,b); (0,g.y)(c,function(d){g.go.prototype.remove.call(this,d)},a)},Jua=function(a){if(a.Qc){if(a.Qc.locationOverrideToken)return{locationOverrideToken:a.Qc.locationOverrideToken}; if(null!=a.Qc.latitudeE7&&null!=a.Qc.longitudeE7)return{latitudeE7:a.Qc.latitudeE7,longitudeE7:a.Qc.longitudeE7}}return null},Kua=function(a,b){g.cb(a,b)||a.push(b)},a6=function(a){var b=0,c; for(c in a)b++;return b},Lua=function(a,b){var c=b instanceof g.vc?b:g.Ac(b,/^data:image\//i.test(b)); a.src=g.xc(c)},b6=function(){},Mua=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);},Nua=function(a){if(a.Cd&&"function"==typeof a.Cd)return a.Cd(); if("string"===typeof a)return a.split("");if(g.Na(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.Hb(a)},Oua=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0); else if(g.Na(a)||"string"===typeof a)(0,g.y)(a,b,void 0);else{if(a.xe&&"function"==typeof a.xe)var c=a.xe();else if(a.Cd&&"function"==typeof a.Cd)c=void 0;else if(g.Na(a)||"string"===typeof a){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=g.Ib(a);d=Nua(a);e=d.length;for(var f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}},Pua=function(a,b,c,d){var e=new g.Sm(null,void 0); a&&g.Tm(e,a);b&&g.Um(e,b);c&&g.Vm(e,c);d&&(e.u=d);return e},c6=function(a,b){g.Po[a]=!0; var c=g.No();c&&c.publish.apply(c,arguments);g.Po[a]=!1},d6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.w=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Pm;this.o=this.u="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Qua(this,a.capabilities||""),Rua(this,a.experiments||""),this.u=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey|| "")},Qua=function(a,b){a.capabilities.clear(); (0,g.ve)(b.split(","),g.Sa(Gua,Sua)).forEach(function(c){a.capabilities.add(c)})},Rua=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},e6=function(a){a=a||{}; this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},f6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Tua=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},Uua=function(a){return new e6(a)},Vua=function(a){return g.Ma(a)?(0,g.Fc)(a,Uua):[]},g6=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},h6=function(a){return g.Ma(a)?"["+(0,g.Fc)(a,g6).join(",")+"]":"null"},i6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0; return("x"==a?b:b&3|8).toString(16)})},Wua=function(a){return(0,g.Fc)(a,function(b){return{key:b.id, name:b.name}})},j6=function(a,b){return g.$a(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},k6=function(a,b){return g.$a(a,function(c){return f6(c,b)})},l6=function(a){try{var b=(0,g.ps)(),c=(0,g.os)(); b&&b.remove(a);c&&c.remove(a)}catch(d){}},Xua=function(){var a=(0,g.os)(); a&&Iua(a,a.o.Mf(!0))},m6=function(){var a=g.rs("yt-remote-connected-devices")||[]; g.tb(a);return a},Yua=function(a){if(g.db(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.Fc)(a,function(d,e){return 0==e?d:d.substring(c.length)})},Zua=function(a){g.qs("yt-remote-connected-devices",a,86400)},o6=function(){if(n6)return n6; var a=g.rs("yt-remote-device-id");a||(a=i6(),g.qs("yt-remote-device-id",a,31536E3));for(var b=m6(),c=1,d=a;g.cb(b,d);)c++,d=a+"#"+c;return n6=d},p6=function(){var a=m6(),b=o6(); g.cb(a,b);g.ts()&&g.wb(a,b);a=Yua(a);if(g.db(a))try{g.Hq("remote_sid")}catch(c){}else try{g.Fq("remote_sid",a.join(","),-1)}catch(c){}},$ua=function(){return g.rs("yt-remote-session-browser-channel")},ava=function(){return g.rs("yt-remote-local-screens")||[]},bva=function(){g.qs("yt-remote-lounge-token-expiration",!0,86400)},cva=function(a){5<a.length&&(a=a.slice(a.length-5)); var b=(0,g.Fc)(ava(),function(d){return d.loungeToken}),c=(0,g.Fc)(a,function(d){return d.loungeToken}); (0,g.ui)(c,function(d){return!g.cb(b,d)})&&bva(); g.qs("yt-remote-local-screens",a,31536E3)},dva=function(a,b){g.qs("yt-remote-session-browser-channel",a); g.qs("yt-remote-session-screen-id",b);var c=m6(),d=o6();g.cb(c,d)||c.push(d);Zua(c);p6()},q6=function(a){a||(l6("yt-remote-session-screen-id"),l6("yt-remote-session-video-id")); p6();a=m6();g.gb(a,o6());Zua(a)},eva=function(){if(!r6){var a=g.ro(); a&&(r6=new g.$n(a))}return r6?!!r6.get("yt-remote-use-staging-server"):!1},fva=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},gva=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},s6=function(a){a.length?hva(a.shift(),function(){s6(a)}):t6()},iva=function(a){return"chrome-extension://"+a+"/cast_sender.js"},hva=function(a,b,c){var d=document.createElement("script"); d.onerror=b;c&&(d.onload=c);d.src=a;(document.head||document.documentElement).appendChild(d)},t6=function(){var a=gva(); a&&a(!1,"No cast extension found")},kva=function(){if(jva){var a=2,b=gva(),c=function(){a--; 0==a&&b&&b(!0)}; window.__onGCastApiAvailable=c;hva("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",t6,c)}},lva=function(){kva(); var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);s6(["//www.gstatic.com/eureka/clank/"+(a?parseInt(a[1],10):0)+"/cast_sender.js","//www.gstatic.com/eureka/clank/cast_sender.js"])},u6=function(){},mva=function(){},ova=function(a){return(a=nva(a))?new ActiveXObject(a):new XMLHttpRequest},nva=function(a){if(!a.u&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.u=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.u},v6=function(a,b,c){g.A.call(this); this.w=null!=c?(0,g.x)(a,c):a;this.sd=b;this.u=(0,g.x)(this.pF,this);this.o=[]},w6=function(a){a.Da=g.Wf(a.u,a.sd); a.w.apply(null,a.o)},x6=function(a,b,c,d){this.o=a; this.w=b;this.G=c;this.F=d||1;this.B=45E3;this.A=new g.R1(this);this.u=new g.Vf;this.u.setInterval(250)},qva=function(a,b,c){a.cj=1; a.Hg=Z5(b.clone());a.wi=c;a.C=!0;pva(a,null)},y6=function(a,b,c,d,e){a.cj=1; a.Hg=Z5(b.clone());a.wi=null;a.C=c;e&&(a.WB=!1);pva(a,d)},pva=function(a,b){a.Lj=(0,g.H)(); z6(a);a.uh=a.Hg.clone();$5(a.uh,"t",a.F);a.wm=0;a.Jc=a.o.Sq(a.o.im()?b:null);0<a.Fr&&(a.gp=new v6((0,g.x)(a.XC,a,a.Jc),a.Fr));a.A.ia(a.Jc,"readystatechange",a.oO);var c=a.Yh?g.Rb(a.Yh):{};a.wi?(a.Op="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.Jc.send(a.uh,a.Op,a.wi,c)):(a.Op="GET",a.WB&&!g.ke&&(c.Connection="close"),a.Jc.send(a.uh,a.Op,null,c));a.o.Ye(1)},tva=function(a,b,c){for(var d=!0;!a.Kh&&a.wm<c.length;){var e=rva(a,c); if(e==A6){4==b&&(a.Vg=4,B6(15),d=!1);break}else if(e==sva){a.Vg=4;B6(16);d=!1;break}else C6(a,e)}4==b&&0==c.length&&(a.Vg=1,B6(17),d=!1);a.Ze=a.Ze&&d;d||(D6(a),E6(a))},rva=function(a,b){var c=a.wm,d=b.indexOf("\n",c); if(-1==d)return A6;c=Number(b.substring(c,d));if(isNaN(c))return sva;d+=1;if(d+c>b.length)return A6;var e=b.substr(d,c);a.wm=d+c;return e},vva=function(a,b){a.Lj=(0,g.H)(); z6(a);var c=b?window.location.hostname:"";a.uh=a.Hg.clone();Y5(a.uh,"DOMAIN",c);Y5(a.uh,"t",a.F);try{a.df=new ActiveXObject("htmlfile")}catch(n){D6(a);a.Vg=7;B6(22);E6(a);return}var d="<html><body>";if(b){for(var e="",f=0;f<c.length;f++){var k=c.charAt(f);if("<"==k)e+="\\x3c";else if(">"==k)e+="\\x3e";else{var l=k;if(l in F6)k=F6[l];else if(l in uva)k=F6[l]=uva[l];else{var m=l.charCodeAt(0);if(31<m&&127>m)k=l;else{if(256>m){if(k="\\x",16>m||256<m)k+="0"}else k="\\u",4096>m&&(k+="0");k+=m.toString(16).toUpperCase()}k= F6[l]=k}e+=k}}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.Zc(g.$b("b/12014412"),d+"</body></html>");a.df.open();a.df.write(g.Uc(c));a.df.close();a.df.parentWindow.m=(0,g.x)(a.HN,a);a.df.parentWindow.d=(0,g.x)(a.fB,a,!0);a.df.parentWindow.rpcClose=(0,g.x)(a.fB,a,!1);c=a.df.createElement("DIV");a.df.parentWindow.document.body.appendChild(c);d=g.zc(a.uh.toString());d=g.fd(g.xc(d));d=g.Zc(g.$b("b/12014412"),'<iframe src="'+d+'"></iframe>');g.$c(c,d);a.o.Ye(1)},z6=function(a){a.Su=(0,g.H)()+a.B; wva(a,a.B)},wva=function(a,b){if(null!=a.Zj)throw Error("WatchDog timer not null"); a.Zj=G6((0,g.x)(a.PN,a),b)},H6=function(a){a.Zj&&(g.v.clearTimeout(a.Zj),a.Zj=null)},E6=function(a){a.o.Kx()||a.Kh||a.o.Wo(a)},D6=function(a){H6(a); g.He(a.gp);a.gp=null;a.u.stop();g.Gpa(a.A);if(a.Jc){var b=a.Jc;a.Jc=null;b.abort();b.dispose()}a.df&&(a.df=null)},C6=function(a,b){try{a.o.ZA(a,b),a.o.Ye(4)}catch(c){}},yva=function(a,b,c,d,e){if(0==d)c(!1); else{var f=e||0;d--;xva(a,b,function(k){k?c(!0):g.v.setTimeout(function(){yva(a,b,c,d,f)},f)})}},xva=function(a,b,c){var d=new Image; d.onload=function(){try{I6(d),c(!0)}catch(e){}}; d.onerror=function(){try{I6(d),c(!1)}catch(e){}}; d.onabort=function(){try{I6(d),c(!1)}catch(e){}}; d.ontimeout=function(){try{I6(d),c(!1)}catch(e){}}; g.v.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b); Lua(d,a)},I6=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},J6=function(){},zva=function(a){this.o=a; this.u=new J6},Ava=function(a){var b=K6(a.o,a.lk,"/mail/images/cleardot.gif"); Z5(b);yva(b.toString(),5E3,(0,g.x)(a.kE,a),3,2E3);a.Ye(1)},M6=function(a){var b=a.o.H; if(null!=b)B6(5),b?(B6(11),L6(a.o,a,!1)):(B6(12),L6(a.o,a,!0));else if(a.Rd=new x6(a,void 0,void 0,void 0),a.Rd.Yh=a.Dr,b=a.o,b=K6(b,b.im()?a.Mk:null,a.Er),B6(5),!g.ie||g.Nd(10))$5(b,"TYPE","xmlhttp"),y6(a.Rd,b,!1,a.Mk,!1);else{$5(b,"TYPE","html");var c=a.Rd;a=!!a.Mk;c.cj=3;c.Hg=Z5(b.clone());vva(c,a)}},N6=function(a){if(g.v.JSON)try{return g.v.JSON.parse(a)}catch(b){}return Mua(a)},O6=function(a){g.gf.call(this); this.headers=new g.Pm;this.S=a||null;this.w=!1;this.O=this.o=null;this.da=this.H="";this.C=0;this.A="";this.B=this.Z=this.G=this.U=!1;this.F=0;this.J=null;this.ea="";this.P=this.V=!1},Bva=function(a){return g.ie&&g.Md(9)&&"number"===typeof a.timeout&&void 0!==a.ontimeout},Cva=function(a){return"content-type"==a.toLowerCase()},Eva=function(a,b){a.w=!1; a.o&&(a.B=!0,a.o.abort(),a.B=!1);a.A=b;a.C=5;Dva(a);P6(a)},Dva=function(a){a.U||(a.U=!0,a.dispatchEvent("complete"),a.dispatchEvent("error"))},Gva=function(a){if(a.w&&"undefined"!=typeof g.W1)if(a.O[1]&&4==Q6(a)&&2==a.getStatus())R6(a,"Local request error detected and ignored"); else if(a.G&&4==Q6(a))g.Wf(a.Mx,0,a);else if(a.dispatchEvent("readystatechange"),4==Q6(a)){R6(a,"Request complete");a.w=!1;try{var b=a.getStatus();a:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var c=!0;break a;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=g.pd(1,String(a.H));if(!f&&g.v.self&&g.v.self.location){var k=g.v.self.location.protocol;f=k.substr(0,k.length-1)}e=!Fva.test(f?f.toLowerCase():"")}d=e}if(d)a.dispatchEvent("complete"),a.dispatchEvent("success"); else{a.C=6;try{var l=2<Q6(a)?a.o.statusText:""}catch(m){l=""}a.A=l+" ["+a.getStatus()+"]";Dva(a)}}finally{P6(a)}}},P6=function(a,b){if(a.o){Hva(a); var c=a.o,d=a.O[0]?g.Ja:null;a.o=null;a.O=null;b||a.dispatchEvent("ready");try{c.onreadystatechange=d}catch(e){}}},Hva=function(a){a.o&&a.P&&(a.o.ontimeout=null); a.J&&(g.v.clearTimeout(a.J),a.J=null)},Q6=function(a){return a.o?a.o.readyState:0},S6=function(a){try{return a.o?a.o.responseText:""}catch(b){return""}},R6=function(a,b){return b+" ["+a.da+" "+a.H+" "+a.getStatus()+"]"},T6=function(a,b,c){this.o=1; this.u=[];this.A=[];this.B=new J6;this.G=a||null;this.H=null!=b?b:null;this.C=c||!1},Iva=function(a,b){this.o=a; this.map=b;this.context=null},Jva=function(a){g.Je.call(this,"statevent",a)},Kva=function(a,b){g.Je.call(this,"timingevent",a); this.size=b},Lva=function(a){g.Je.call(this,"serverreachability",a)},Ova=function(a){Mva(a); if(3==a.o){var b=a.Il++,c=a.zn.clone();Y5(c,"SID",a.w);Y5(c,"RID",b);Y5(c,"TYPE","terminate");U6(a,c);b=new x6(a,a.w,b,void 0);b.cj=2;b.Hg=Z5(c.clone());Lua(new Image,b.Hg.toString());b.Lj=(0,g.H)();z6(b)}Nva(a)},Pva=function(a){a.HE(1,0); a.zn=K6(a,null,a.Cr);V6(a)},Mva=function(a){a.Lg&&(a.Lg.abort(),a.Lg=null); a.hc&&(a.hc.cancel(),a.hc=null);a.Of&&(g.v.clearTimeout(a.Of),a.Of=null);W6(a);a.Ld&&(a.Ld.cancel(),a.Ld=null);a.Qg&&(g.v.clearTimeout(a.Qg),a.Qg=null)},Qva=function(a,b){if(0==a.o)throw Error("Invalid operation: sending map when state is closed"); a.u.push(new Iva(a.ZJ++,b));2!=a.o&&3!=a.o||V6(a)},V6=function(a){a.Ld||a.Qg||(a.Qg=G6((0,g.x)(a.eB,a),0),a.Wi=0)},Sva=function(a,b){if(1==a.o){if(!b){a.Il=Math.floor(1E5*Math.random()); var c=a.Il++,d=new x6(a,"",c,void 0);d.Yh=null;var e=X6(a),f=a.zn.clone();Y5(f,"RID",c);Y5(f,"CVER","1");U6(a,f);qva(d,f,e);a.Ld=d;a.o=2}}else 3==a.o&&(b?Rva(a,b):0==a.u.length||a.Ld||Rva(a))},Rva=function(a,b){if(b)if(6<a.Lh){a.u=a.A.concat(a.u); a.A.length=0;var c=a.Il-1;var d=X6(a)}else c=b.G,d=b.wi;else c=a.Il++,d=X6(a);var e=a.zn.clone();Y5(e,"SID",a.w);Y5(e,"RID",c);Y5(e,"AID",a.oj);U6(a,e);c=new x6(a,a.w,c,a.Wi+1);c.Yh=null;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.Ld=c;qva(c,e,d)},U6=function(a,b){if(a.od){var c=a.od.gx(); c&&g.Bb(c,function(d,e){Y5(b,e,d)})}},X6=function(a){var b=Math.min(a.u.length,1E3),c=["count="+b]; if(6<a.Lh&&0<b){var d=a.u[0].o;c.push("ofs="+d)}else d=0;for(var e=0;e<b;e++){var f=a.u[e].o,k=a.u[e].map;f=6>=a.Lh?e:f-d;try{g.Bb(k,function(l,m){c.push("req"+f+"_"+m+"="+encodeURIComponent(l))})}catch(l){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.A=a.A.concat(a.u.splice(0,b)); return c.join("&")},Tva=function(a){a.hc||a.Of||(a.F=1,a.Of=G6((0,g.x)(a.dB,a),0),a.Pi=0)},Y6=function(a){if(a.hc||a.Of||3<=a.Pi)return!1; a.F++;a.Of=G6((0,g.x)(a.dB,a),Uva(a,a.Pi));a.Pi++;return!0},L6=function(a,b,c){a.Mp=c; a.nf=b.ag;a.C||Pva(a)},W6=function(a){null!=a.Ph&&(g.v.clearTimeout(a.Ph),a.Ph=null)},Uva=function(a,b){var c=5E3+Math.floor(1E4*Math.random()); a.isActive()||(c*=2);return c*b},Z6=function(a,b){if(2==b||9==b){var c=null; a.od&&(c=null);var d=(0,g.x)(a.bP,a);c||(c=new g.Sm("//www.google.com/images/cleardot.gif"),Z5(c));xva(c.toString(),1E4,d)}else B6(2);Vva(a,b)},Vva=function(a,b){a.o=0; a.od&&a.od.tw(b);Nva(a);Mva(a)},Nva=function(a){a.o=0; a.nf=-1;if(a.od)if(0==a.A.length&&0==a.u.length)a.od.Kq();else{g.kb(a.A);var b=g.kb(a.u);a.A.length=0;a.u.length=0;a.od.Kq(b)}},K6=function(a,b,c){var d=g.$m(c); if(""!=d.o)b&&g.Um(d,b+"."+d.o),g.Vm(d,d.B);else{var e=window.location;d=Pua(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.zk&&g.Bb(a.zk,function(f,k){Y5(d,k,f)}); Y5(d,"VER",a.Lh);U6(a,d);return d},G6=function(a,b){if(!g.Oa(a))throw Error("Fn must not be null and must be a function"); return g.v.setTimeout(function(){a()},b)},B6=function(a){$6.dispatchEvent(new Jva($6,a))},Wva=function(){},a7=function(a,b,c){g.A.call(this); this.C=null!=c?(0,g.x)(a,c):a;this.sd=b;this.B=(0,g.x)(this.oF,this);this.o=!1;this.u=0;this.w=this.Da=null;this.A=[]},Xva=function(){this.o=[]; this.u=[]},Yva=function(a,b){this.action=a; this.params=b||{}},b7=function(a,b){g.A.call(this); this.o=new g.I(this.yN,0,this);g.C(this,this.o);this.sd=5E3;this.u=0;if(g.Oa(a))b&&(a=(0,g.x)(a,b));else if(a&&g.Oa(a.handleEvent))a=(0,g.x)(a.handleEvent,a);else throw Error("Invalid listener argument");this.w=a},c7=function(a,b,c){this.J=a; this.C=b;this.w=new g.Zn;this.u=new b7(this.DO,this);this.o=null;this.vb=!1;this.B=null;this.H="";this.G=this.A=0;this.F=[];this.P=c||!1},Zva=function(a){return{firstTestResults:[""], secondTestResults:!a.o.Mp,sessionId:a.o.w,arrayId:a.o.oj}},$va=function(a,b){a.G=b||0; a.u.stop();a.o&&(3==a.o.o&&Sva(a.o),Ova(a.o));a.G=0},d7=function(a){return!!a.o&&3==a.o.o},awa=function(a,b){(a.C.loungeIdToken=b)||a.u.stop()},e7=function(a){this.port=this.domain=""; this.o="/api/lounge";this.u=!0;a=a||document.location.href;var b=Number(g.pd(4,a))||"";b&&(this.port=":"+b);this.domain=g.qd(a)||"";a=g.Mc;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.sc(a,"10.0")&&(this.u=!1))},f7=function(a,b){var c=a.o; a.u&&(c="https://"+a.domain+a.port+a.o);return g.Ad(c+b,{})},g7=function(a,b,c,d,e){a={format:"JSON", method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.Sa(a.A,d,!0),onError:g.Sa(a.w,e),Nd:g.Sa(a.B,e)};c&&(a.zb=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.xq(b,a)},ewa=function(){var a=bwa; cwa();h7.push(a);dwa(h7)},i7=function(a,b){cwa(); var c=h7,d=fwa(a,String(b));g.db(c)?gwa(d):(dwa(c),(0,g.y)(c,function(e){e(d)}))},cwa=function(){h7||(h7=g.w("yt.mdx.remote.debug.handlers_")||[],g.Ia("yt.mdx.remote.debug.handlers_",h7,void 0))},gwa=function(a){var b=(j7+1)%50; j7=b;k7[b]=a;l7||(l7=49==b)},dwa=function(a){var b=k7; if(b[0]){var c=j7,d=l7?c:-1;do{d=(d+1)%50;var e=b[d];(0,g.y)(a,function(f){f(e)})}while(d!=c); k7=Array(50);j7=-1;l7=!1}},fwa=function(a,b){var c=((0,g.H)()-hwa)/1E3; c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},m7=function(a){g.P.call(this); this.F=a;this.o=[]},iwa=function(a,b){var c=a.get(b.uuid)||a.get(b.id); if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.o.push(b);return!0},jwa=function(a,b){var c=a.o.length!=b.length; a.o=(0,g.ve)(a.o,function(f){return!!j6(b,f)}); for(var d=0,e=b.length;d<e;d++)c=iwa(a,b[d])||c;return c},kwa=function(a,b){var c=a.o.length; a.o=(0,g.ve)(a.o,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)}); return a.o.length<c},n7=function(a,b,c,d){g.P.call(this); this.C=a;this.A=b;this.B=c;this.w=d;this.u=0;this.o=null;this.Da=NaN},p7=function(a){m7.call(this,"LocalScreenService"); this.w=a;this.u=NaN;o7(this);this.info("Initializing with "+h6(this.o))},lwa=function(a){if(a.o.length){var b=(0,g.Fc)(a.o,function(d){return d.id}),c=f7(a.w,"/pairing/get_lounge_token_batch"); g7(a.w,c,{screen_ids:b.join(",")},(0,g.x)(a.zF,a),(0,g.x)(a.yF,a))}},o7=function(a){var b=Vua(ava()); b=(0,g.ve)(b,function(c){return!c.uuid}); return jwa(a,b)},q7=function(a,b){cva((0,g.Fc)(a.o,Tua)); b&&bva()},s7=function(a,b){g.P.call(this); this.C=b;var c=g.rs("yt-remote-online-screen-ids")||"";c=c?c.split(","):[];for(var d={},e=this.C(),f=0,k=e.length;f<k;++f){var l=e[f].id;d[l]=g.cb(c,l)}this.o=d;this.B=a;this.w=this.A=NaN;this.u=null;r7("Initialized with "+g.Mk(this.o))},mwa=function(a,b,c){var d=f7(a.B,"/pairing/get_screen_availability"); g7(a.B,d,{lounge_token:b.token},(0,g.x)(function(e){e=e.screens||[];for(var f=0,k=e.length;f<k;++f)if(e[f].loungeToken==b.token){c("online"==e[f].status);return}c(!1)},a),(0,g.x)(function(){c(!1)},a))},t7=function(a,b){a:if(a6(b)!=a6(a.o))var c=!1; else{c=g.Ib(b);for(var d=0,e=c.length;d<e;++d)if(!a.o[c[d]]){c=!1;break a}c=!0}c||(r7("Updated online screens: "+g.Mk(a.o)),a.o=b,a.R("screenChange"));nwa(a)},u7=function(a){isNaN(a.w)||g.Mo(a.w); a.w=g.Ko((0,g.x)(a.gu,a),0<a.A&&a.A<(0,g.H)()?2E4:1E4)},r7=function(a){i7("OnlineScreenService",a)},owa=function(a){var b={}; (0,g.y)(a.C(),function(c){c.token?b[c.token]=c.id:this.Tb("Requesting availability of screen w/o lounge token.")}); return b},nwa=function(a){a=g.Ib(g.Cb(a.o,function(b){return b})); g.tb(a);a.length?g.qs("yt-remote-online-screen-ids",a.join(","),60):l6("yt-remote-online-screen-ids")},v7=function(a){m7.call(this,"ScreenService"); this.C=a;this.u=this.w=null;this.A=[];this.B={};pwa(this)},rwa=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b); c||(c=a.B[b]);var k=a.de();if(k=(c?k6(k,c):null)||k6(k,b)){k.uuid=b;var l=w7(a,k);mwa(a.u,l,function(m){e(m?l:null)})}else c?qwa(a,c,(0,g.x)(function(m){var n=w7(this,new e6({name:d, screenId:c,loungeToken:m,dialId:b||""}));mwa(this.u,n,function(p){e(p?n:null)})},a),f):e(null)},swa=function(a,b){for(var c=0,d=a.o.length;c<d;++c)if(a.o[c].name==b)return a.o[c]; return null},qwa=function(a,b,c,d){a.info("requestLoungeToken_ for "+b); var e={zb:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,k){var l=k&&k.screens||[];l[0]&&l[0].screenId==b?c(l[0].loungeToken):d(Error("Missing lounge token in token response"))}, onError:function(){d(Error("Request screen lounge token failed"))}}; g.xq(f7(a.C,"/pairing/get_lounge_token_batch"),e)},twa=function(a){a.o=a.w.de(); var b=a.B,c={},d;for(d in b)c[b[d]]=d;b=0;for(d=a.o.length;b<d;++b){var e=a.o[b];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+h6(a.o))},pwa=function(a){x7(a); a.w=new p7(a.C);a.w.subscribe("screenChange",(0,g.x)(a.HF,a));twa(a);a.A=Vua(g.rs("yt-remote-automatic-screen-cache")||[]);x7(a);a.info("Initializing automatic screens: "+h6(a.A));a.u=new s7(a.C,(0,g.x)(a.de,a,!0));a.u.subscribe("screenChange",(0,g.x)(function(){this.R("onlineScreenChange")},a))},w7=function(a,b){var c=a.get(b.id); c?(c.uuid=b.uuid,b=c):((c=k6(a.A,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.A.push(b),g.qs("yt-remote-automatic-screen-cache",(0,g.Fc)(a.A,Tua)));x7(a);a.B[b.uuid]=b.id;g.qs("yt-remote-device-id-map",a.B,31536E3);return b},x7=function(a){a.B=g.rs("yt-remote-device-id-map")||{}},y7=function(a,b,c){g.P.call(this); this.O=c;this.H=a;this.u=b;this.w=null},z7=function(a,b){i7(a.O,b)},A7=function(a,b){y7.call(this,a,b,"CastSession"); this.o=null;this.A=0;this.C=(0,g.x)(this.MP,this);this.B=(0,g.x)(this.XN,this);this.A=g.Ko((0,g.x)(function(){uwa(this,null)},this),12E4)},vwa=function(a){a.info("sendYoutubeMessage_: getMdxSessionStatus "+g.Mk(void 0)); var b={type:"getMdxSessionStatus"};a.o?a.o.sendMessage("urn:x-cast:com.google.youtube.mdx",b,g.Ja,(0,g.x)(function(){z7(this,"Failed to send message: getMdxSessionStatus.")},a)):z7(a,"Sending yt message without session: "+g.Mk(b))},uwa=function(a,b){g.Mo(a.A); if(b){if(a.info("onConnectedScreenId_: Received screenId: "+b),!a.w||a.w.id!=b){var c=(0,g.x)(a.Yo,a),d=(0,g.x)(a.je,a);a.Bx(b,c,d,5)}}else a.je(Error("Waiting for session status timed out."))},B7=function(a,b,c){y7.call(this,a,b,"DialSession"); this.A=this.G=null;this.J="";this.S=c;this.B=null;this.F=g.Ja;this.C=NaN;this.P=(0,g.x)(this.PP,this);this.o=g.Ja},wwa=function(a){a.o=a.H.dD(a.J,a.u.label,a.u.friendlyName,(0,g.x)(function(b){this.o=g.Ja; this.Yo(b)},a),(0,g.x)(function(b){this.o=g.Ja; this.je(b)},a))},xwa=function(a){var b={}; b.pairingCode=a.J;b.theme=a.S;if(a.B){var c=a.B.currentTime||0;b.v=a.B.videoId;b.t=c}eva()&&(b.env_useStageMdx=1);return g.xd(b)},C7=function(a,b){y7.call(this,a,b,"ManualSession"); this.o=g.Ko((0,g.x)(this.pj,this,null),150)},D7=function(a,b,c,d){g.P.call(this); this.u=a;this.F=b||"233637DE";this.C=c||"cl";this.G=d||!1;this.o=null;this.B=!1;this.w=[];this.A=(0,g.x)(this.FM,this)},ywa=function(a,b){return b?g.$a(a.w,function(c){return f6(b,c.label)},a):null},E7=function(a){i7("Controller",a)},bwa=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},F7=function(a){return a.B||!!a.w.length||!!a.o},G7=function(a,b,c){b!=a.o&&(g.He(a.o),(a.o=b)?(c?a.R("yt-remote-cast2-receiver-resumed",b.u):a.R("yt-remote-cast2-receiver-selected", b.u),b.subscribe("sessionScreen",(0,g.x)(a.cB,a,b)),b.w?a.R("yt-remote-cast2-session-change",b.w):c&&a.o.pj(null)):a.R("yt-remote-cast2-session-change",null))},zwa=function(a){var b=a.u.cD(),c=a.o&&a.o.u; a=(0,g.Fc)(b,function(d){c&&f6(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=ywa(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},Fwa=function(a,b,c,d,e,f,k){Awa()?Bwa(b,e,f,k)&&(I7(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Cwa(a,c):(window.__onGCastApiAvailable=function(l,m){l?Cwa(a,c):(J7("Failed to load cast API: "+m),K7(!1),I7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Dwa(),c(!1))},d?g.Wo("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?lva():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?t6():(kva(),s6(Ewa.map(iva))))):H7("Cannot initialize because not running Chrome")},Dwa=function(){H7("dispose"); var a=L7();a&&a.dispose();g.Ia("yt.mdx.remote.cloudview.instance_",null,void 0);Gwa(!1);g.So(M7);M7.length=0},N7=function(){return!!g.rs("yt-remote-cast-installed")},Hwa=function(){var a=g.rs("yt-remote-cast-receiver"); return a?a.friendlyName:null},Iwa=function(){H7("clearCurrentReceiver"); l6("yt-remote-cast-receiver")},Jwa=function(){return N7()?L7()?L7().getCastSession():(J7("getCastSelector: Cast is not initialized."),null):(J7("getCastSelector: Cast API is not installed!"),null)},P7=function(){N7()?L7()?O7()?(H7("Requesting cast selector."),L7().requestSession()):(H7("Wait for cast API to be ready to request the session."),M7.push(g.Ro("yt-remote-cast2-api-ready",P7))):J7("requestCastSelector: Cast is not initialized."):J7("requestCastSelector: Cast API is not installed!")},Q7= function(a,b){O7()?L7().setConnectedScreenStatus(a,b):J7("setConnectedScreenStatus called before ready.")},Awa=function(){var a=0<=g.Mc.search(/ (CrMo|Chrome|CriOS)\//); return g.Iv||a},Kwa=function(a,b){L7().init(a,b)},Bwa=function(a,b,c,d){var e=!1; L7()||(a=new D7(a,b,c,d),a.subscribe("yt-remote-cast2-availability-change",function(f){g.qs("yt-remote-cast-available",f);c6("yt-remote-cast2-availability-change",f)}),a.subscribe("yt-remote-cast2-receiver-selected",function(f){H7("onReceiverSelected: "+f.friendlyName); g.qs("yt-remote-cast-receiver",f);c6("yt-remote-cast2-receiver-selected",f)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(f){H7("onReceiverResumed: "+f.friendlyName); g.qs("yt-remote-cast-receiver",f)}),a.subscribe("yt-remote-cast2-session-change",function(f){H7("onSessionChange: "+g6(f)); f||l6("yt-remote-cast-receiver");c6("yt-remote-cast2-session-change",f)}),g.Ia("yt.mdx.remote.cloudview.instance_",a,void 0),e=!0); H7("cloudview.createSingleton_: "+e);return e},L7=function(){return g.w("yt.mdx.remote.cloudview.instance_")},Cwa=function(a,b){K7(!0); I7(!1);Kwa(a,function(c){c?(Gwa(!0),g.To("yt-remote-cast2-api-ready")):(J7("Failed to initialize cast API."),K7(!1),l6("yt-remote-cast-available"),l6("yt-remote-cast-receiver"),Dwa());b(c)})},H7=function(a){i7("cloudview",a)},J7=function(a){i7("cloudview",a)},K7=function(a){H7("setCastInstalled_ "+a); g.qs("yt-remote-cast-installed",a)},O7=function(){return!!g.w("yt.mdx.remote.cloudview.apiReady_")},Gwa=function(a){H7("setApiReady_ "+a); g.Ia("yt.mdx.remote.cloudview.apiReady_",a,void 0)},I7=function(a){g.Ia("yt.mdx.remote.cloudview.initializing_",a,void 0)},R7=function(a){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.C=this.F=0;this.o=null;this.hasNext=this.qf=!1;this.H=this.G=this.u=this.A=0;this.w=NaN;this.B=!1;this.reset(a)},S7=function(a){a.audioTrackId=null; a.o=null;a.playerState=-1;a.qf=!1;a.hasNext=!1;a.F=0;a.C=(0,g.H)();a.A=0;a.u=0;a.G=0;a.H=0;a.w=NaN;a.B=!1},T7=function(a){return 1==a.playerState?((0,g.H)()-a.C)/1E3:0},U7=function(a,b){a.F=b; a.C=(0,g.H)()},V7=function(a){switch(a.playerState){case 1:case 1081:return((0,g.H)()-a.C)/1E3+a.F; case -1E3:return 0}return a.F},W7=function(a,b,c){var d=a.videoId; a.videoId=b;a.index=c;b!=d&&S7(a)},X7=function(a){var b={}; b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.Sb(a.o);b.hasPrevious=a.qf;b.hasNext=a.hasNext;b.playerTime=a.F;b.playerTimeAt=a.C;b.seekableStart=a.A;b.seekableEnd=a.u;b.duration=a.G;b.loadedTime=a.H;b.liveIngestionTime=a.w;return b},Z7=function(a,b){g.P.call(this); this.o=0;this.A=a;this.C=[];this.B=new Xva;this.w=this.u=null;this.H=(0,g.x)(this.GK,this);this.F=(0,g.x)(this.Kl,this);this.G=(0,g.x)(this.FK,this);this.J=(0,g.x)(this.RK,this);var c=0;a?(c=a.getProxyState(),3!=c&&(a.subscribe("proxyStateChange",this.Vu,this),Lwa(this))):c=3;0!=c&&(b?this.Vu(c):g.Ko((0,g.x)(function(){this.Vu(c)},this),0)); var d=Jwa();d&&Y7(this,d);this.subscribe("yt-remote-cast2-session-change",this.J)},$7=function(a){return new R7(a.A.getPlayerContextData())},Lwa=function(a){(0,g.y)("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange".split(" "),function(b){this.C.push(this.A.subscribe(b,g.Sa(this.CM,b),this))},a)},Mwa=function(a){(0,g.y)(a.C,function(b){this.A.unsubscribeByKey(b)},a); a.C.length=0},a8=function(a,b){var c=a.B; 50>c.o.length+c.u.length&&a.B.u.push(b)},c8=function(a,b,c){var d=$7(a); U7(d,c);-1E3!=d.playerState&&(d.playerState=b);b8(a,d)},d8=function(a,b,c){a.A.sendMessage(b,c)},b8=function(a,b){Mwa(a); a.A.setPlayerContextData(X7(b));Lwa(a)},Y7=function(a,b){a.w&&(a.w.removeUpdateListener(a.H),a.w.removeMediaListener(a.F),a.Kl(null)); a.w=b;a.w&&(i7("CP","Setting cast session: "+a.w.sessionId),a.w.addUpdateListener(a.H),a.w.addMediaListener(a.F),a.w.media.length&&a.Kl(a.w.media[0]))},Nwa=function(a){var b=a.u.media,c=a.u.customData; if(b&&c){var d=$7(a);b.contentId!=d.videoId&&i7("CP","Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;U7(d,a.u.getEstimatedTime());b8(a,d)}else i7("CP","No cast media video. Ignoring state update.")},e8=function(a,b,c){return(0,g.x)(function(d){this.Tb("Failed to "+b+" with cast v2 channel. Error code: "+d.code); d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.Tb("Retrying "+b+" using MDx browser channel."),d8(this,b,c))},a)},f8=function(a,b,c){g.P.call(this); this.B=NaN;this.P=!1;this.G=this.F=this.H=this.J=NaN;this.O=[];this.A=this.C=this.w=this.Ta=this.o=null;this.U=a;this.O.push(g.yp(window,"beforeunload",(0,g.x)(this.rF,this)));this.u=[];this.Ta=new R7;this.S=b.id;this.o=Owa(this,c);this.o.subscribe("handlerOpened",this.KK,this);this.o.subscribe("handlerClosed",this.HK,this);this.o.subscribe("handlerError",this.IK,this);this.o.subscribe("handlerMessage",this.JK,this);awa(this.o,b.token);this.subscribe("remoteQueueChange",function(){var d=this.Ta.videoId; g.ts()&&g.qs("yt-remote-session-video-id",d)},this)},g8=function(a){i7("conn",a)},Owa=function(a,b){return new c7(f7(a.U,"/bc"),b)},h8=function(a,b){a.R("proxyStateChange",b)},Pwa=function(a){a.B=g.Ko((0,g.x)(function(){g8("Connecting timeout"); this.Ui(1)},a),2E4)},i8=function(a){g.Mo(a.B); a.B=NaN},j8=function(a){g.Mo(a.J); a.J=NaN},Qwa=function(a){k8(a); a.H=g.Ko((0,g.x)(function(){l8(this,"getNowPlaying")},a),2E4)},k8=function(a){g.Mo(a.H); a.H=NaN},Swa=function(a,b){b&&(i8(a),j8(a)); b==(d7(a.o)&&isNaN(a.B))?b&&(h8(a,1),l8(a,"getSubtitlesTrack")):b?(a.zx()&&a.Ta.reset(),h8(a,1),l8(a,"getNowPlaying"),Rwa(a)):a.Ui(1)},Twa=function(a,b){var c=b.params.videoId; delete b.params.videoId;c==a.Ta.videoId&&(g.Ob(b.params)?a.Ta.o=null:a.Ta.o=b.params,a.R("remotePlayerChange"))},Uwa=function(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10); a.Ta.listId=b.params.listId||a.Ta.listId;W7(a.Ta,c,d);a.R("remoteQueueChange")},Wwa=function(a,b){b.params=b.params||{}; Uwa(a,b);Vwa(a,b);a.R("autoplayDismissed")},Vwa=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10); U7(a.Ta,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.Ta.playerState&&(c=-1E3);a.Ta.playerState=c;c=Number(b.params.loadedTime);a.Ta.H=isNaN(c)?0:c;c=Number(b.params.duration);a.Ta.G=isNaN(c)?0:c;c=a.Ta;var d=Number(b.params.liveIngestionTime);c.w=d;c.B=isNaN(d)?!1:!0;c=a.Ta;d=Number(b.params.seekableStartTime);var e=Number(b.params.seekableEndTime);c.A=isNaN(d)?0:d;c.u=isNaN(e)?0:e;1==a.Ta.playerState?Qwa(a):k8(a);a.R("remotePlayerChange")},Xwa=function(a,b){if(-1E3!= a.Ta.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.Ta.playerState=c;c=parseInt(b.params.currentTime,10);U7(a.Ta,isNaN(c)?0:c);a.R("remotePlayerChange")}},Ywa=function(a,b){var c="true"==b.params.muted; a.Ta.volume=parseInt(b.params.volume,10);a.Ta.muted=c;a.R("remotePlayerChange")},Zwa=function(a,b){a.C=b.params.videoId; a.R("nowAutoplaying",parseInt(b.params.timeout,10))},$wa=function(a,b){var c="true"==b.params.hasNext; a.Ta.qf="true"==b.params.hasPrevious;a.Ta.hasNext=c;a.R("previousNextChange")},Rwa=function(a){g.Mo(a.G); a.G=g.Ko((0,g.x)(a.Ui,a,1),864E5)},l8=function(a,b,c){c?g8("Sending: action="+b+", params="+g.Mk(c)):g8("Sending: action="+b); a.o.sendMessage(b,c)},m8=function(a){m7.call(this,"ScreenServiceProxy"); this.rd=a;this.u=[];this.u.push(this.rd.$_s("screenChange",(0,g.x)(this.KP,this)));this.u.push(this.rd.$_s("onlineScreenChange",(0,g.x)(this.hM,this)))},exa=function(a){var b={device:"Desktop", app:"youtube-desktop"};b=g.L("MDX_CONFIG")||b;Xua();p6();n8||(n8=new e7(b?b.loungeApiHost:void 0),eva()&&(n8.o="/api/loungedev"));o8||(o8=g.w("yt.mdx.remote.deferredProxies_")||[],g.Ia("yt.mdx.remote.deferredProxies_",o8,void 0));axa();var c=p8();if(!c){var d=new v7(n8);g.Ia("yt.mdx.remote.screenService_",d,void 0);c=p8();var e=!1,f=void 0,k=void 0,l=!1;b&&(e=!!b.loadCastApiSetupScript,f=b.appId,k=b.theme,l=!!b.disableDial);Fwa(a,d,function(m){m?q8()&&Q7(q8(),"YouTube TV"):d.subscribe("onlineScreenChange", function(){c6("yt-remote-receiver-availability-change")})},e,f,k,l)}b&&!g.w("yt.mdx.remote.initialized_")&&(g.Ia("yt.mdx.remote.initialized_",!0,void 0),r8("Initializing: "+g.Mk(b)),s8.push(g.Ro("yt-remote-cast2-availability-change",function(){c6("yt-remote-receiver-availability-change")})),s8.push(g.Ro("yt-remote-cast2-receiver-selected",function(){t8(null); c6("yt-remote-auto-connect","cast-selector-receiver")})),s8.push(g.Ro("yt-remote-cast2-receiver-resumed",function(){c6("yt-remote-receiver-resumed","cast-selector-receiver")})),s8.push(g.Ro("yt-remote-cast2-session-change",bxa)),s8.push(g.Ro("yt-remote-connection-change",function(m){m?Q7(q8(),"YouTube TV"):u8()||(Q7(null,null),Iwa())})),a=v8(),b.isAuto&&(a.id+="#dial"),g.$o("desktop_enable_autoplay")&&(a.capabilities=["atp"]),a.name=b.device,a.app=b.app,(k=b.theme)&&(a.theme=k),r8(" -- with channel params: "+ g.Mk(a)),cxa(a),c.start(),q8()||dxa())},gxa=function(){var a=fxa(); N7()&&g.rs("yt-remote-cast-available")&&a.push({key:"cast-selector-receiver",name:"Cast..."});return a},fxa=function(){var a=p8().rd.$_gos(); var b=w8();b&&x8()&&(j6(a,b)||a.push(b));return Wua(a)},y8=function(){var a=hxa(); !a&&N7()&&Hwa()&&(a={key:"cast-selector-receiver",name:Hwa()});return a},hxa=function(){var a=fxa(),b=w8(); b||(b=u8());return g.$a(a,function(c){return b&&f6(b,c.key)?!0:!1})},w8=function(){var a=q8(); if(!a)return null;var b=p8().de();return k6(b,a)},bxa=function(a){r8("remote.onCastSessionChange_: "+g6(a)); if(a){var b=w8();b&&b.id==a.id?Q7(b.id,"YouTube TV"):(b&&z8(),A8(a,1))}else x8()&&z8()},z8=function(){O7()?L7().stopSession():J7("stopSession called before API ready."); var a=x8();a&&(a.disconnect(1),B8(null))},C8=function(){var a=x8(); return!!a&&3!=a.getProxyState()},r8=function(a){i7("remote",a)},p8=function(){if(!D8){var a=g.w("yt.mdx.remote.screenService_"); D8=a?new m8(a):null}return D8},q8=function(){return g.w("yt.mdx.remote.currentScreenId_")},ixa=function(a){g.Ia("yt.mdx.remote.currentScreenId_",a,void 0)},jxa=function(){return g.w("yt.mdx.remote.connectData_")},t8=function(a){g.Ia("yt.mdx.remote.connectData_",a,void 0)},x8=function(){return g.w("yt.mdx.remote.connection_")},B8=function(a){var b=x8(); t8(null);a||ixa("");g.Ia("yt.mdx.remote.connection_",a,void 0);o8&&((0,g.y)(o8,function(c){c(a)}),o8.length=0); b&&!a?c6("yt-remote-connection-change",!1):!b&&a&&c6("yt-remote-connection-change",!0)},u8=function(){var a=g.ts(); if(!a)return null;var b=p8().de();return k6(b,a)},A8=function(a,b){q8(); w8()&&w8();if(E8)F8=a;else{ixa(a.id);var c=new f8(n8,a,v8());c.connect(b,jxa());c.subscribe("beforeDisconnect",function(d){c6("yt-remote-before-disconnect",d)}); c.subscribe("beforeDispose",function(){x8()&&(x8(),B8(null))}); B8(c)}},dxa=function(){var a=u8(); a?(r8("Resume connection to: "+g6(a)),A8(a,0)):(q6(),Iwa(),r8("Skipping connecting because no session screen found."))},axa=function(){var a=v8(); if(g.Ob(a)){a=o6();var b=g.rs("yt-remote-session-name")||"",c=g.rs("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};g.Ia("yt.mdx.remote.channelParams_",a,void 0)}},v8=function(){return g.w("yt.mdx.remote.channelParams_")||{}},cxa=function(a){a?(g.qs("yt-remote-session-app",a.app),g.qs("yt-remote-session-name",a.name)):(l6("yt-remote-session-app"),l6("yt-remote-session-name")); g.Ia("yt.mdx.remote.channelParams_",a,void 0)},G8=function(a,b,c){g.A.call(this); this.B=a;this.u=b;this.w=new g.O(this);g.C(this,this.w);this.w.L(b,"onCaptionsTrackListChanged",this.DL);this.w.L(b,"captionschanged",this.EK);this.w.L(b,"captionssettingschanged",this.qC);this.w.L(b,"videoplayerreset",this.Zo);this.w.L(b,"mdxautoplaycancel",this.jE);this.S=this.w.L(b,"onVolumeChange",this.JA);this.G=!1;this.o=c;c.subscribe("proxyStateChange",this.YA,this);c.subscribe("remotePlayerChange",this.Pl,this);c.subscribe("remoteQueueChange",this.Zo,this);c.subscribe("autoplayUpNext",this.zA, this);c.subscribe("previousNextChange",this.VA,this);c.subscribe("nowAutoplaying",this.RA,this);c.subscribe("autoplayDismissed",this.yA,this);this.suggestion=null;this.H=new g.qD(64);this.A=new g.I(this.oC,500,this);g.C(this,this.A);this.C=new g.I(this.pC,1E3,this);g.C(this,this.C);this.P=new a7(this.mP,0,this);g.C(this,this.P);this.F={};this.O=new g.I(this.PC,1E3,this);g.C(this,this.O);this.J=new v6(this.kI,1E3,this);g.C(this,this.J);this.U=g.Ja;this.qC();this.Zo();this.Pl()},H8=function(a,b){var c= a.B,d=a.u.getVideoData().lengthSeconds; c.O=b||0;c.player.R("progresssync",b,d)},kxa=function(a){H8(a,0); a.A.stop();I8(a,new g.qD(64))},K8=function(a,b){if(J8(a)&&!a.G){var c=null; b&&(c={style:a.u.getSubtitlesUserSettings()},g.Ub(c,b));a.o.cC(a.u.getVideoData(1).videoId,c);a.F=$7(a.o).o}},L8=function(a,b){var c=a.u.getPlaylist(); if(c){var d=c.Za;var e=c.listId.toString()}c=a.u.getVideoData(1);a.o.playVideo(c.videoId,b,d,e,c.playerParams,c.sf,Jua(c));I8(a,new g.qD(1))},lxa=function(a,b){if(b){var c=a.u.getOption("captions","tracklist",{DT:1}); c&&c.length?(a.u.setOption("captions","track",b),a.G=!1):(a.u.loadModule("captions"),a.G=!0)}else a.u.setOption("captions","track",{})},J8=function(a){return $7(a.o).videoId==a.u.getVideoData(1).videoId},I8=function(a,b){a.C.stop(); var c=a.H;if(!g.wD(c,b)){var d=g.W(b,2);d!=g.W(a.H,2)&&g.tT(a.u.app,d);a.H=b;mxa(a.B,c,b)}},M8=function(){g.V.call(this,{D:"div", I:"ytp-mdx-popup-dialog",M:{role:"dialog"},K:[{D:"div",I:"ytp-mdx-popup-dialog-inner-content",K:[{D:"div",I:"ytp-mdx-popup-title",W:"\u0412\u044b \u0432\u044b\u0448\u043b\u0438 \u0438\u0437 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430"},{D:"div",I:"ytp-mdx-popup-description",W:'\u0420\u043e\u043b\u0438\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043d\u0430 \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0435, \u0447\u0442\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u044f\u0445. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 "\u041e\u0442\u043c\u0435\u043d\u0430" \u0438 \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.'}, {D:"div",I:"ytp-mdx-privacy-popup-buttons",K:[{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-cancel"],W:"\u041e\u0442\u043c\u0435\u043d\u0430"},{D:"button",X:["ytp-button","ytp-mdx-privacy-popup-confirm"],W:"\u041e\u041a"}]}]}]});this.u=new g.AM(this,250);g.C(this,this.u);this.C=this.o["ytp-mdx-privacy-popup-cancel"];this.L(this.C,"click",this.w);this.A=this.o["ytp-mdx-privacy-popup-confirm"];this.L(this.A,"click",this.B)},N8=function(a){g.V.call(this,{D:"div", I:"ytp-remote",K:[{D:"div",I:"ytp-remote-display-status",K:[{D:"div",I:"ytp-remote-display-status-icon",K:[g.CM()]},{D:"div",I:"ytp-remote-display-status-text",W:"{{statustext}}"}]}]});this.u=new g.AM(this,250);g.C(this,this.u);this.w=a;this.L(a,"presentingplayerstatechange",this.A);nxa(this,g.yL(a))},nxa=function(a,b){if(3==a.w.getPresentingPlayerType()){var c={RECEIVER_NAME:a.w.getOption("remote","currentReceiver").name}; c=g.W(b,128)?g.fN('\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.xD(b)||g.W(b,4)?g.fN('\u0412\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435 "$RECEIVER_NAME"',c):g.fN('\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 "$RECEIVER_NAME"', c);a.ha("statustext",c);a.u.show()}else a.u.hide()},O8=function(a,b){g.YO.call(this,"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430",0,a,b); this.u=a;this.C={};this.L(a,"onMdxReceiversChange",this.J);this.L(a,"presentingplayerstatechange",this.J);this.J()},P8=function(a){g.fM.call(this,a); this.u={key:i6(),name:"\u042d\u0442\u043e\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440"};this.B=null;this.A=[];this.S=this.o=null;this.J=[this.u];this.w=this.u;this.F=new g.qD(64);this.O=0;this.H=-1;this.C=null;if(!g.Kx(this.player.N())){a=this.player;var b=g.XC(a);b&&(b=b.zl())&&(b=new O8(a,b),g.C(this,b));b=new N8(a);g.C(this,b);g.QL(a,b.element,4);this.C=new M8;g.C(this,this.C);g.QL(a,this.C.element,4);this.P=!!u8()}this.G=null},Q8=function(a){a.G&&(a.player.removeEventListener("presentingplayerstatechange", a.G),a.G=null)},mxa=function(a,b,c){a.F=c; a.player.R("presentingplayerstatechange",new g.CD(c,b))},R8=function(a,b){if(b.key!=a.w.key)if(b.key==a.u.key)z8(); else{var c;(c=!g.Q(a.player.N().experiments,"mdx_enable_privacy_disclosure_ui"))||(c=((c=g.L("PLAYER_CONFIG"))&&c.args&&void 0!==c.args.authuser?!0:!(!g.L("SESSION_INDEX")&&!g.L("LOGGED_IN")))||a.P||!a.C);if(c?0:g.Tx(a.player.N())||g.Xx(a.player.N()))g.xD(g.yL(a.player))?a.player.pauseVideo():(a.G=(0,g.x)(a.cO,a),a.player.addEventListener("presentingplayerstatechange",a.G)),a.C&&a.C.u.show(),x8()||(E8=!0);a.w=b;var d=a.player.getPlaylistId();c=a.player.getVideoData(1);var e=c.videoId;if(!d&&!e||(2== a.player.app.U||1==a.player.app.U)&&g.Q(a.player.N().experiments,"should_clear_video_data_on_player_cued_unstarted"))c=null;else{var f=a.player.getPlaylist();if(f){var k=[];for(var l=0;l<f.getLength();l++)k[l]=f.wa(l).videoId}else k=[e];f=a.player.getCurrentTime(1);d={videoIds:k,listId:d,videoId:e,playerParams:c.playerParams,clickTrackingParams:c.sf,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0==f?void 0:f};(c=Jua(c))&&(d.locationInfo=c);c=d}r8("Connecting to: "+g.Mk(b));"cast-selector-receiver"== b.key?(t8(c||null),c=c||null,O7()?L7().setLaunchParams(c):J7("setLaunchParams called before ready.")):!c&&C8()&&q8()==b.key?c6("yt-remote-connection-change",!0):(z8(),t8(c||null),c=p8().de(),(c=k6(c,b.key))&&A8(c,1))}},uva={"\x00":"\\0", "\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},F6={"'":"\\'"},oxa={},Sua={nQ:"atp",RS:"ska",GS:"que",aS:"mus",QS:"sus",mR:"dsp",NS:"seq"}; d6.prototype.Mg=function(){var a=new d6({id:this.id,name:this.name,app:this.app,type:this.type,user:this.username,userAvatarUri:this.avatar,obfuscatedGaiaId:this.obfuscatedGaiaId,theme:this.theme,capabilities:Array.from(this.capabilities.values()).join(","),experiments:Array.from(this.experiments.values()).join(",")});a.w=this.w;a.u=this.u;a.o=this.o}; var r6,n6="",jva=fva("loadCastFramework")||fva("loadCastApplicationFramework"),Ewa=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];u6.prototype.o=null;u6.prototype.getOptions=function(){var a;(a=this.o)||(a={},nva(this)&&(a[0]=!0,a[1]=!0),a=this.o=a);return a};var S8;g.Ua(mva,u6);S8=new mva;/* Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ g.Ua(v6,g.A);g.h=v6.prototype;g.h.bj=!1;g.h.Lk=0;g.h.Da=null;g.h.Jx=function(a){this.o=arguments;this.Da||this.Lk?this.bj=!0:w6(this)}; g.h.stop=function(){this.Da&&(g.v.clearTimeout(this.Da),this.Da=null,this.bj=!1,this.o=[])}; g.h.pause=function(){this.Lk++}; g.h.resume=function(){this.Lk--;this.Lk||!this.bj||this.Da||(this.bj=!1,w6(this))}; g.h.Y=function(){v6.Gb.Y.call(this);this.stop()}; g.h.pF=function(){this.Da=null;this.bj&&!this.Lk&&(this.bj=!1,w6(this))};g.h=x6.prototype;g.h.Yh=null;g.h.Ze=!1;g.h.Zj=null;g.h.Su=null;g.h.Lj=null;g.h.cj=null;g.h.Hg=null;g.h.uh=null;g.h.wi=null;g.h.Jc=null;g.h.wm=0;g.h.df=null;g.h.Op=null;g.h.Vg=null;g.h.Nk=-1;g.h.WB=!0;g.h.Kh=!1;g.h.Fr=0;g.h.gp=null;var sva={},A6={};g.h=x6.prototype;g.h.setTimeout=function(a){this.B=a}; g.h.oO=function(a){a=a.target;var b=this.gp;b&&3==Q6(a)?b.Jx():this.XC(a)}; g.h.XC=function(a){try{if(a==this.Jc)a:{var b=Q6(this.Jc),c=this.Jc.C,d=this.Jc.getStatus();if(g.ie&&!g.Nd(10)||g.ke&&!g.Md("420+")){if(4>b)break a}else if(3>b||3==b&&!g.yh&&!S6(this.Jc))break a;this.Kh||4!=b||7==c||(8==c||0>=d?this.o.Ye(3):this.o.Ye(2));H6(this);var e=this.Jc.getStatus();this.Nk=e;var f=S6(this.Jc);(this.Ze=200==e)?(4==b&&D6(this),this.C?(tva(this,b,f),g.yh&&this.Ze&&3==b&&(this.A.ia(this.u,"tick",this.iO),this.u.start())):C6(this,f),this.Ze&&!this.Kh&&(4==b?this.o.Wo(this):(this.Ze= !1,z6(this)))):(400==e&&0<f.indexOf("Unknown SID")?(this.Vg=3,B6(13)):(this.Vg=0,B6(14)),D6(this),E6(this))}}catch(k){this.Jc&&S6(this.Jc)}finally{}}; g.h.iO=function(){var a=Q6(this.Jc),b=S6(this.Jc);this.wm<b.length&&(H6(this),tva(this,a,b),this.Ze&&4!=a&&z6(this))}; g.h.HN=function(a){G6((0,g.x)(this.GN,this,a),0)}; g.h.GN=function(a){this.Kh||(H6(this),C6(this,a),z6(this))}; g.h.fB=function(a){G6((0,g.x)(this.FN,this,a),0)}; g.h.FN=function(a){this.Kh||(D6(this),this.Ze=a,this.o.Wo(this),this.o.Ye(4))}; g.h.cancel=function(){this.Kh=!0;D6(this)}; g.h.PN=function(){this.Zj=null;var a=(0,g.H)();0<=a-this.Su?(2!=this.cj&&this.o.Ye(3),D6(this),this.Vg=2,B6(18),E6(this)):wva(this,this.Su-a)}; g.h.getLastError=function(){return this.Vg};J6.prototype.stringify=function(a){return g.v.JSON.stringify(a,void 0)}; J6.prototype.parse=function(a){return g.v.JSON.parse(a,void 0)};g.h=zva.prototype;g.h.Dr=null;g.h.Rd=null;g.h.hp=!1;g.h.Lx=null;g.h.vn=null;g.h.us=null;g.h.Er=null;g.h.Ae=null;g.h.ag=-1;g.h.Mk=null;g.h.lk=null;g.h.connect=function(a){this.Er=a;a=K6(this.o,null,this.Er);B6(3);this.Lx=(0,g.H)();var b=this.o.G;null!=b?(this.Mk=b[0],(this.lk=b[1])?(this.Ae=1,Ava(this)):(this.Ae=2,M6(this))):($5(a,"MODE","init"),this.Rd=new x6(this,void 0,void 0,void 0),this.Rd.Yh=this.Dr,y6(this.Rd,a,!1,null,!0),this.Ae=0)}; g.h.kE=function(a){if(a)this.Ae=2,M6(this);else{B6(4);var b=this.o;b.nf=b.Lg.ag;Z6(b,9)}a&&this.Ye(2)}; g.h.Sq=function(a){return this.o.Sq(a)}; g.h.abort=function(){this.Rd&&(this.Rd.cancel(),this.Rd=null);this.ag=-1}; g.h.Kx=function(){return!1}; g.h.ZA=function(a,b){this.ag=a.Nk;if(0==this.Ae)if(b){try{var c=this.u.parse(b)}catch(d){c=this.o;c.nf=this.ag;Z6(c,2);return}this.Mk=c[0];this.lk=c[1]}else c=this.o,c.nf=this.ag,Z6(c,2);else if(2==this.Ae)if(this.hp)B6(7),this.us=(0,g.H)();else if("11111"==b){if(B6(6),this.hp=!0,this.vn=(0,g.H)(),c=this.vn-this.Lx,!g.ie||g.Nd(10)||500>c)this.ag=200,this.Rd.cancel(),B6(12),L6(this.o,this,!0)}else B6(8),this.vn=this.us=(0,g.H)(),this.hp=!1}; g.h.Wo=function(){this.ag=this.Rd.Nk;if(this.Rd.Ze)0==this.Ae?this.lk?(this.Ae=1,Ava(this)):(this.Ae=2,M6(this)):2==this.Ae&&((!g.ie||g.Nd(10)?!this.hp:200>this.us-this.vn)?(B6(11),L6(this.o,this,!1)):(B6(12),L6(this.o,this,!0)));else{0==this.Ae?B6(9):2==this.Ae&&B6(10);var a=this.o;this.Rd.getLastError();a.nf=this.ag;Z6(a,2)}}; g.h.im=function(){return this.o.im()}; g.h.isActive=function(){return this.o.isActive()}; g.h.Ye=function(a){this.o.Ye(a)};g.Ua(O6,g.gf);var Fva=/^https?$/i,pxa=["POST","PUT"];g.h=O6.prototype; g.h.send=function(a,b,c,d){if(this.o)throw Error("[goog.net.XhrIo] Object is active with another request="+this.H+"; newUri="+a);b=b?b.toUpperCase():"GET";this.H=a;this.A="";this.C=0;this.da=b;this.U=!1;this.w=!0;this.o=this.S?ova(this.S):ova(S8);this.O=this.S?this.S.getOptions():S8.getOptions();this.o.onreadystatechange=(0,g.x)(this.Mx,this);try{b6(R6(this,"Opening Xhr")),this.Z=!0,this.o.open(b,String(a),!0),this.Z=!1}catch(f){b6(R6(this,"Error opening Xhr: "+f.message));Eva(this,f);return}a=c|| "";var e=this.headers.clone();d&&Oua(d,function(f,k){e.set(k,f)}); d=g.$a(e.xe(),Cva);c=g.v.FormData&&a instanceof g.v.FormData;!g.cb(pxa,b)||d||c||e.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");e.forEach(function(f,k){this.o.setRequestHeader(k,f)},this); this.ea&&(this.o.responseType=this.ea);"withCredentials"in this.o&&this.o.withCredentials!==this.V&&(this.o.withCredentials=this.V);try{Hva(this),0<this.F&&(this.P=Bva(this.o),b6(R6(this,"Will abort after "+this.F+"ms if incomplete, xhr2 "+this.P)),this.P?(this.o.timeout=this.F,this.o.ontimeout=(0,g.x)(this.Nx,this)):this.J=g.Wf(this.Nx,this.F,this)),b6(R6(this,"Sending request")),this.G=!0,this.o.send(a),this.G=!1}catch(f){b6(R6(this,"Send error: "+f.message)),Eva(this,f)}}; g.h.Nx=function(){"undefined"!=typeof g.W1&&this.o&&(this.A="Timed out after "+this.F+"ms, aborting",this.C=8,R6(this,this.A),this.dispatchEvent("timeout"),this.abort(8))}; g.h.abort=function(a){this.o&&this.w&&(R6(this,"Aborting"),this.w=!1,this.B=!0,this.o.abort(),this.B=!1,this.C=a||7,this.dispatchEvent("complete"),this.dispatchEvent("abort"),P6(this))}; g.h.Y=function(){this.o&&(this.w&&(this.w=!1,this.B=!0,this.o.abort(),this.B=!1),P6(this,!0));O6.Gb.Y.call(this)}; g.h.Mx=function(){this.la()||(this.Z||this.G||this.B?Gva(this):this.EM())}; g.h.EM=function(){Gva(this)}; g.h.isActive=function(){return!!this.o}; g.h.getStatus=function(){try{return 2<Q6(this)?this.o.status:-1}catch(a){return-1}}; g.h.getLastError=function(){return"string"===typeof this.A?this.A:String(this.A)};g.h=T6.prototype;g.h.zk=null;g.h.Ld=null;g.h.hc=null;g.h.Cr=null;g.h.zn=null;g.h.gw=null;g.h.Nn=null;g.h.Il=0;g.h.ZJ=0;g.h.od=null;g.h.Qg=null;g.h.Of=null;g.h.Ph=null;g.h.Lg=null;g.h.Mp=null;g.h.oj=-1;g.h.wy=-1;g.h.nf=-1;g.h.Wi=0;g.h.Pi=0;g.h.Lh=8;var $6=new g.gf;g.Ua(Jva,g.Je);g.Ua(Kva,g.Je);g.Ua(Lva,g.Je);g.h=T6.prototype;g.h.connect=function(a,b,c,d,e){B6(0);this.Cr=b;this.zk=c||{};d&&void 0!==e&&(this.zk.OSID=d,this.zk.OAID=e);this.C?(G6((0,g.x)(this.Bw,this,a),100),Pva(this)):this.Bw(a)}; g.h.Bw=function(a){this.Lg=new zva(this);this.Lg.Dr=null;this.Lg.u=this.B;this.Lg.connect(a)}; g.h.Kx=function(){return 0==this.o}; g.h.eB=function(a){this.Qg=null;Sva(this,a)}; g.h.dB=function(){this.Of=null;this.hc=new x6(this,this.w,"rpc",this.F);this.hc.Yh=null;this.hc.Fr=0;var a=this.gw.clone();Y5(a,"RID","rpc");Y5(a,"SID",this.w);Y5(a,"CI",this.Mp?"0":"1");Y5(a,"AID",this.oj);U6(this,a);if(!g.ie||g.Nd(10))Y5(a,"TYPE","xmlhttp"),y6(this.hc,a,!0,this.Nn,!1);else{Y5(a,"TYPE","html");var b=this.hc,c=!!this.Nn;b.cj=3;b.Hg=Z5(a.clone());vva(b,c)}}; g.h.ZA=function(a,b){if(0!=this.o&&(this.hc==a||this.Ld==a))if(this.nf=a.Nk,this.Ld==a&&3==this.o)if(7<this.Lh){try{var c=this.B.parse(b)}catch(f){c=null}if(Array.isArray(c)&&3==c.length)if(0==c[0])a:{if(!this.Of){if(this.hc)if(this.hc.Lj+3E3<this.Ld.Lj)W6(this),this.hc.cancel(),this.hc=null;else break a;Y6(this);B6(19)}}else this.wy=c[1],0<this.wy-this.oj&&37500>c[2]&&this.Mp&&0==this.Pi&&!this.Ph&&(this.Ph=G6((0,g.x)(this.AK,this),6E3));else Z6(this,11)}else b!=oxa.KQ.o&&Z6(this,11);else if(this.hc== a&&W6(this),!g.hc(b)){c=this.B.parse(b);for(var d=0;d<c.length;d++){var e=c[d];this.oj=e[0];e=e[1];2==this.o?"c"==e[0]?(this.w=e[1],this.Nn=e[2],e=e[3],null!=e?this.Lh=e:this.Lh=6,this.o=3,this.od&&this.od.ww(),this.gw=K6(this,this.im()?this.Nn:null,this.Cr),Tva(this)):"stop"==e[0]&&Z6(this,7):3==this.o&&("stop"==e[0]?Z6(this,7):"noop"!=e[0]&&this.od&&this.od.uw(e),this.Pi=0)}}}; g.h.AK=function(){null!=this.Ph&&(this.Ph=null,this.hc.cancel(),this.hc=null,Y6(this),B6(20))}; g.h.Wo=function(a){if(this.hc==a){W6(this);this.hc=null;var b=2}else if(this.Ld==a)this.Ld=null,b=1;else return;this.nf=a.Nk;if(0!=this.o)if(a.Ze)1==b?(b=(0,g.H)()-a.Lj,$6.dispatchEvent(new Kva($6,a.wi?a.wi.length:0,b,this.Wi)),V6(this),this.A.length=0):Tva(this);else{var c=a.getLastError(),d;if(!(d=3==c||7==c||0==c&&0<this.nf)){if(d=1==b)this.Ld||this.Qg||1==this.o||2<=this.Wi?d=!1:(this.Qg=G6((0,g.x)(this.eB,this,a),Uva(this,this.Wi)),this.Wi++,d=!0);d=!(d||2==b&&Y6(this))}if(d)switch(c){case 1:Z6(this, 5);break;case 4:Z6(this,10);break;case 3:Z6(this,6);break;case 7:Z6(this,12);break;default:Z6(this,2)}}}; g.h.HE=function(a){if(!g.cb(arguments,this.o))throw Error("Unexpected channel state: "+this.o);}; g.h.bP=function(a){a?B6(2):(B6(1),Vva(this,8))}; g.h.Sq=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new O6;a.V=!1;return a}; g.h.isActive=function(){return!!this.od&&this.od.isActive(this)}; g.h.Ye=function(a){$6.dispatchEvent(new Lva($6,a))}; g.h.im=function(){return!(!g.ie||g.Nd(10))}; g.h=Wva.prototype;g.h.ww=function(){}; g.h.uw=function(){}; g.h.tw=function(){}; g.h.Kq=function(){}; g.h.gx=function(){return{}}; g.h.isActive=function(){return!0};g.Ua(a7,g.A);g.h=a7.prototype;g.h.nF=function(a){this.A=arguments;this.o=!1;this.Da?this.w=(0,g.H)()+this.sd:this.Da=g.Wf(this.B,this.sd)}; g.h.stop=function(){this.Da&&(g.v.clearTimeout(this.Da),this.Da=null);this.w=null;this.o=!1;this.A=[]}; g.h.pause=function(){++this.u}; g.h.resume=function(){this.u&&(--this.u,!this.u&&this.o&&(this.o=!1,this.C.apply(null,this.A)))}; g.h.Y=function(){this.stop();a7.Gb.Y.call(this)}; g.h.oF=function(){this.w?(this.Da=g.Wf(this.B,this.w-(0,g.H)()),this.w=null):(this.Da=null,this.u?this.o=!0:(this.o=!1,this.C.apply(null,this.A)))};g.h=Xva.prototype;g.h.isEmpty=function(){return g.db(this.o)&&g.db(this.u)}; g.h.clear=function(){this.o=[];this.u=[]}; g.h.contains=function(a){return g.cb(this.o,a)||g.cb(this.u,a)}; g.h.remove=function(a){var b=this.o;var c=(0,g.Lpa)(b,a);0<=c?(g.fb(b,c),b=!0):b=!1;return b||g.gb(this.u,a)}; g.h.Cd=function(){for(var a=[],b=this.o.length-1;0<=b;--b)a.push(this.o[b]);var c=this.u.length;for(b=0;b<c;++b)a.push(this.u[b]);return a};g.Ua(b7,g.A);g.h=b7.prototype;g.h.yN=function(){this.sd=Math.min(3E5,2*this.sd);this.w();this.u&&this.start()}; g.h.start=function(){var a=this.sd+15E3*Math.random();g.Bn(this.o,a);this.u=(0,g.H)()+a}; g.h.stop=function(){this.o.stop();this.u=0}; g.h.isActive=function(){return this.o.isActive()}; g.h.reset=function(){this.o.stop();this.sd=5E3};g.Ua(c7,Wva);g.h=c7.prototype;g.h.subscribe=function(a,b,c){return this.w.subscribe(a,b,c)}; g.h.unsubscribe=function(a,b,c){return this.w.unsubscribe(a,b,c)}; g.h.tg=function(a){return this.w.Zh(a)}; g.h.R=function(a,b){return this.w.R.apply(this.w,arguments)}; g.h.dispose=function(){this.vb||(this.vb=!0,g.He(this.w),$va(this),g.He(this.u),this.u=null)}; g.h.la=function(){return this.vb}; g.h.connect=function(a,b,c){if(!this.o||2!=this.o.o){this.H="";this.u.stop();this.B=a||null;this.A=b||0;a=this.J+"/test";b=this.J+"/bind";var d=new T6(c?c.firstTestResults:null,c?c.secondTestResults:null,this.P),e=this.o;e&&(e.od=null);d.od=this;this.o=d;e?this.o.connect(a,b,this.C,e.w,e.oj):c?this.o.connect(a,b,this.C,c.sessionId,c.arrayId):this.o.connect(a,b,this.C)}}; g.h.sendMessage=function(a,b){var c={_sc:a};b&&g.Ub(c,b);this.u.isActive()||2==(this.o?this.o.o:0)?this.F.push(c):d7(this)&&Qva(this.o,c)}; g.h.ww=function(){this.u.reset();this.B=null;this.A=0;if(this.F.length){var a=this.F;this.F=[];for(var b=0,c=a.length;b<c;++b)Qva(this.o,a[b])}this.R("handlerOpened")}; g.h.tw=function(a){var b=2==a&&401==this.o.nf;4==a||b||this.u.start();this.R("handlerError",a)}; g.h.Kq=function(a){if(!this.u.isActive())this.R("handlerClosed");else if(a)for(var b=0,c=a.length;b<c;++b){var d=a[b].map;d&&this.F.push(d)}}; g.h.gx=function(){var a={v:2};this.H&&(a.gsessionid=this.H);0!=this.A&&(a.ui=""+this.A);0!=this.G&&(a.ui=""+this.G);this.B&&g.Ub(a,this.B);return a}; g.h.uw=function(a){"S"==a[0]?this.H=a[1]:"gracefulReconnect"==a[0]?(this.u.start(),Ova(this.o)):this.R("handlerMessage",new Yva(a[0],a[1]))}; g.h.DO=function(){this.u.isActive();var a=this.o,b=0;a.hc&&b++;a.Ld&&b++;0==b&&this.connect(this.B,this.A)};e7.prototype.A=function(a,b,c,d){b?a(d):a({text:c.responseText})}; e7.prototype.w=function(a,b){a(Error("Request error: "+b.status))}; e7.prototype.B=function(a){a(Error("request timed out"))};var hwa=(0,g.H)(),h7=null,k7=Array(50),j7=-1,l7=!1;g.Ua(m7,g.P);m7.prototype.de=function(){return this.o}; m7.prototype.contains=function(a){return!!j6(this.o,a)}; m7.prototype.get=function(a){return a?k6(this.o,a):null}; m7.prototype.info=function(a){i7(this.F,a)};g.r(n7,g.P);g.h=n7.prototype;g.h.start=function(){!this.o&&isNaN(this.Da)&&this.bD()}; g.h.stop=function(){this.o&&(this.o.abort(),this.o=null);isNaN(this.Da)||(g.Mo(this.Da),this.Da=NaN)}; g.h.Y=function(){this.stop();g.P.prototype.Y.call(this)}; g.h.bD=function(){this.Da=NaN;this.o=g.xq(f7(this.C,"/pairing/get_screen"),{method:"POST",zb:{pairing_code:this.A},timeout:5E3,onSuccess:(0,g.x)(this.IP,this),onError:(0,g.x)(this.HP,this),Nd:(0,g.x)(this.JP,this)})}; g.h.IP=function(a,b){this.o=null;var c=b.screen||{};c.dialId=this.B;c.name=this.w;this.R("pairingComplete",new e6(c))}; g.h.HP=function(a){this.o=null;a.status&&404==a.status?this.u>=qxa.length?this.R("pairingFailed",Error("DIAL polling timed out")):(a=qxa[this.u],this.Da=g.Ko((0,g.x)(this.bD,this),a),this.u++):this.R("pairingFailed",Error("Server error "+a.status))}; g.h.JP=function(){this.o=null;this.R("pairingFailed",Error("Server not responding"))}; var qxa=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Ua(p7,m7);g.h=p7.prototype;g.h.start=function(){o7(this)&&this.R("screenChange");!g.rs("yt-remote-lounge-token-expiration")&&lwa(this);g.Mo(this.u);this.u=g.Ko((0,g.x)(this.start,this),1E4)}; g.h.add=function(a,b){o7(this);iwa(this,a);q7(this,!1);this.R("screenChange");b(a);a.token||lwa(this)}; g.h.remove=function(a,b){var c=o7(this);kwa(this,a)&&(q7(this,!1),c=!0);b(a);c&&this.R("screenChange")}; g.h.Kp=function(a,b,c,d){var e=o7(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,q7(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.R("screenChange")}; g.h.Y=function(){g.Mo(this.u);p7.Gb.Y.call(this)}; g.h.zF=function(a){o7(this);var b=this.o.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}q7(this,!b);b&&i7(this.F,"Missed "+b+" lounge tokens.")}; g.h.yF=function(a){i7(this.F,"Requesting lounge tokens failed: "+a)};g.r(s7,g.P);g.h=s7.prototype;g.h.start=function(){var a=parseInt(g.rs("yt-remote-fast-check-period")||"0",10);(this.A=(0,g.H)()-144E5<a?0:a)?u7(this):(this.A=(0,g.H)()+3E5,g.qs("yt-remote-fast-check-period",this.A),this.gu())}; g.h.isEmpty=function(){return g.Ob(this.o)}; g.h.update=function(){r7("Updating availability on schedule.");var a=this.C(),b=g.Cb(this.o,function(c,d){return c&&!!k6(a,d)},this); t7(this,b)}; g.h.Y=function(){g.Mo(this.w);this.w=NaN;this.u&&(this.u.abort(),this.u=null);g.P.prototype.Y.call(this)}; g.h.gu=function(){g.Mo(this.w);this.w=NaN;this.u&&this.u.abort();var a=owa(this);if(a6(a)){var b=f7(this.B,"/pairing/get_screen_availability");this.u=g7(this.B,b,{lounge_token:g.Ib(a).join(",")},(0,g.x)(this.cN,this,a),(0,g.x)(this.bN,this))}else t7(this,{}),u7(this)}; g.h.cN=function(a,b){this.u=null;var c=g.Ib(owa(this));if(g.ub(c,g.Ib(a))){c=b.screens||[];for(var d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;t7(this,d);u7(this)}else this.Tb("Changing Screen set during request."),this.gu()}; g.h.bN=function(a){this.Tb("Screen availability failed: "+a);this.u=null;u7(this)}; g.h.Tb=function(a){i7("OnlineScreenService",a)};g.Ua(v7,m7);g.h=v7.prototype;g.h.start=function(){this.w.start();this.u.start();this.o.length&&(this.R("screenChange"),this.u.isEmpty()||this.R("onlineScreenChange"))}; g.h.add=function(a,b,c){this.w.add(a,b,c)}; g.h.remove=function(a,b,c){this.w.remove(a,b,c);this.u.update()}; g.h.Kp=function(a,b,c,d){this.w.contains(a)?this.w.Kp(a,b,c,d):(a="Updating name of unknown screen: "+a.name,i7(this.F,a),d(Error(a)))}; g.h.de=function(a){return a?this.o:g.jb(this.o,(0,g.ve)(this.A,function(b){return!this.contains(b)},this))}; g.h.cD=function(){return(0,g.ve)(this.de(!0),function(a){return!!this.u.o[a.id]},this)}; g.h.dD=function(a,b,c,d,e){this.info("getDialScreenByPairingCode "+a+" / "+b);var f=new n7(this.C,a,b,c);f.subscribe("pairingComplete",(0,g.x)(function(k){g.He(f);d(w7(this,k))},this)); f.subscribe("pairingFailed",function(k){g.He(f);e(k)}); f.start();return(0,g.x)(f.stop,f)}; g.h.LP=function(a,b,c,d){g.xq(f7(this.C,"/pairing/get_screen"),{method:"POST",zb:{pairing_code:a},timeout:5E3,onSuccess:(0,g.x)(function(e,f){var k=new e6(f.screen||{});if(!k.name||swa(this,k.name)){a:{var l=k.name;for(var m=2,n=b(l,m);swa(this,n);){m++;if(20<m)break a;n=b(l,m)}l=n}k.name=l}c(w7(this,k))},this), onError:(0,g.x)(function(e){d(Error("pairing request failed: "+e.status))},this), Nd:(0,g.x)(function(){d(Error("pairing request timed out."))},this)})}; g.h.Y=function(){g.He(this.w);g.He(this.u);v7.Gb.Y.call(this)}; g.h.HF=function(){twa(this);this.R("screenChange");this.u.update()}; v7.prototype.dispose=v7.prototype.dispose;g.Ua(y7,g.P);g.h=y7.prototype;g.h.Yo=function(a){this.w=a;this.R("sessionScreen",this.w)}; g.h.je=function(a){this.la()||(a&&z7(this,""+a),this.w=null,this.R("sessionScreen",null))}; g.h.info=function(a){i7(this.O,a)}; g.h.fD=function(){return null}; g.h.pu=function(a){var b=this.u;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.x)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.x)(function(){z7(this,"Failed to update receiver status for: "+b.friendlyName)},this))}; g.h.Y=function(){this.pu("");y7.Gb.Y.call(this)};g.Ua(A7,y7);g.h=A7.prototype;g.h.ou=function(a){if(this.o){if(this.o==a)return;z7(this,"Overriding cast sesison with new session object");this.o.removeUpdateListener(this.C);this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B)}this.o=a;this.o.addUpdateListener(this.C);this.o.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.B);vwa(this)}; g.h.pj=function(a){this.info("launchWithParams no-op for Cast: "+g.Mk(a))}; g.h.stop=function(){this.o?this.o.stop((0,g.x)(function(){this.je()},this),(0,g.x)(function(){this.je(Error("Failed to stop receiver app."))},this)):this.je(Error("Stopping cast device witout session."))}; g.h.pu=g.Ja;g.h.Y=function(){this.info("disposeInternal");g.Mo(this.A);this.A=0;this.o&&(this.o.removeUpdateListener(this.C),this.o.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.B));this.o=null;A7.Gb.Y.call(this)}; g.h.XN=function(a,b){if(!this.la())if(b){var c=N6(b);if(g.Pa(c)){var d=""+c.type;c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+g.Mk(c));switch(d){case "mdxSessionStatus":uwa(this,c.screenId);break;default:z7(this,"Unknown youtube message: "+d)}}else z7(this,"Unable to parse message.")}else z7(this,"No data in message.")}; g.h.Bx=function(a,b,c,d){rwa(this.H,this.u.label,a,this.u.friendlyName,(0,g.x)(function(e){e?b(e):0<=d?(z7(this,"Screen "+a+" appears to be offline. "+d+" retries left."),g.Ko((0,g.x)(this.Bx,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)}; g.h.fD=function(){return this.o}; g.h.MP=function(a){this.la()||a||(z7(this,"Cast session died."),this.je())};g.Ua(B7,y7);g.h=B7.prototype;g.h.ou=function(a){this.A=a;this.A.addUpdateListener(this.P)}; g.h.pj=function(a){this.B=a;this.F()}; g.h.stop=function(){this.o();this.o=g.Ja;g.Mo(this.C);this.A?this.A.stop((0,g.x)(this.je,this,null),(0,g.x)(this.je,this,"Failed to stop DIAL device.")):this.je()}; g.h.Y=function(){this.o();this.o=g.Ja;g.Mo(this.C);this.A&&this.A.removeUpdateListener(this.P);this.A=null;B7.Gb.Y.call(this)}; g.h.PP=function(a){this.la()||a||(z7(this,"DIAL session died."),this.o(),this.o=g.Ja,this.je())}; g.h.Or=function(a){this.J=i6();if(this.B){var b=new chrome.cast.DialLaunchResponse(!0,xwa(this));a(b);wwa(this)}else this.F=(0,g.x)(function(){g.Mo(this.C);this.F=g.Ja;this.C=NaN;var c=new chrome.cast.DialLaunchResponse(!0,xwa(this));a(c);wwa(this)},this),this.C=g.Ko((0,g.x)(function(){this.F()},this),100)}; g.h.bG=function(a,b,c){rwa(this.H,this.G.receiver.label,a,this.u.friendlyName,(0,g.x)(function(d){d&&d.token?(this.Yo(d),b(new chrome.cast.DialLaunchResponse(!1))):this.Or(b,c)},this),(0,g.x)(function(d){z7(this,"Failed to get DIAL screen: "+d); this.Or(b,c)},this))};g.Ua(C7,y7);C7.prototype.stop=function(){this.je()}; C7.prototype.ou=g.Ja;C7.prototype.pj=function(){g.Mo(this.o);this.o=NaN;var a=k6(this.H.de(),this.u.label);a?this.Yo(a):this.je(Error("No such screen"))}; C7.prototype.Y=function(){g.Mo(this.o);this.o=NaN;C7.Gb.Y.call(this)};g.Ua(D7,g.P);g.h=D7.prototype; g.h.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.F);this.G||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,f=(0,g.x)(this.JM,this);c=new chrome.cast.ApiConfig(c,(0,g.x)(this.bB,this),f,d,e);c.customDialLaunchCallback=(0,g.x)(this.ZK,this);chrome.cast.initialize(c,(0,g.x)(function(){this.la()|| (chrome.cast.addReceiverActionListener(this.A),ewa(),this.u.subscribe("onlineScreenChange",(0,g.x)(this.eD,this)),this.w=zwa(this),chrome.cast.setCustomReceivers(this.w,g.Ja,(0,g.x)(function(k){this.Tb("Failed to set initial custom receivers: "+g.Mk(k))},this)),this.R("yt-remote-cast2-availability-change",F7(this)),b(!0))},this),(0,g.x)(function(k){this.Tb("Failed to initialize API: "+g.Mk(k)); b(!1)},this))}; g.h.LO=function(a,b){E7("Setting connected screen ID: "+a+" -> "+b);if(this.o){var c=this.o.w;if(!a||c&&c.id!=a)E7("Unsetting old screen status: "+this.o.u.friendlyName),G7(this,null)}if(a&&b){if(!this.o){c=k6(this.u.de(),a);if(!c){E7("setConnectedScreenStatus: Unknown screen.");return}var d=ywa(this,c);d||(E7("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.w.push(d),chrome.cast.setCustomReceivers(this.w, g.Ja,(0,g.x)(function(e){this.Tb("Failed to set initial custom receivers: "+g.Mk(e))},this))); E7("setConnectedScreenStatus: new active receiver: "+d.friendlyName);G7(this,new C7(this.u,d),!0)}this.o.pu(b)}else E7("setConnectedScreenStatus: no screen.")}; g.h.MO=function(a){this.la()?this.Tb("Setting connection data on disposed cast v2"):this.o?this.o.pj(a):this.Tb("Setting connection data without a session")}; g.h.OP=function(){this.la()?this.Tb("Stopping session on disposed cast v2"):this.o?(this.o.stop(),G7(this,null)):E7("Stopping non-existing session")}; g.h.requestSession=function(){chrome.cast.requestSession((0,g.x)(this.bB,this),(0,g.x)(this.gN,this))}; g.h.Y=function(){this.u.unsubscribe("onlineScreenChange",(0,g.x)(this.eD,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.A);var a=bwa,b=g.w("yt.mdx.remote.debug.handlers_");g.gb(b||[],a);g.He(this.o);D7.Gb.Y.call(this)}; g.h.Tb=function(a){i7("Controller",a)}; g.h.cB=function(a,b){this.o==a&&(b||G7(this,null),this.R("yt-remote-cast2-session-change",b))}; g.h.FM=function(a,b){if(!this.la())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),E7("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.o)if(this.o.u.label!=a.label)E7("onReceiverAction_: Stopping active receiver: "+this.o.u.friendlyName),this.o.stop();else{E7("onReceiverAction_: Casting to active receiver.");this.o.w&&this.R("yt-remote-cast2-session-change",this.o.w);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:G7(this, new C7(this.u,a));break;case chrome.cast.ReceiverType.DIAL:G7(this,new B7(this.u,a,this.C));break;case chrome.cast.ReceiverType.CAST:G7(this,new A7(this.u,a));break;default:this.Tb("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.o&&this.o.u.label==a.label?this.o.stop():this.Tb("Stopping receiver w/o session: "+a.friendlyName)}else this.Tb("onReceiverAction_ called without receiver.")}; g.h.ZK=function(a){if(this.la())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.Tb("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.o?this.o.u:null;if(!c||c.label!=b.label)return this.Tb("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.o.w)return E7("Reselecting dial screen."), this.R("yt-remote-cast2-session-change",this.o.w),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.Tb('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);G7(this,new B7(this.u,b,this.C))}b=this.o;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise((0,g.x)(b.bG,b,(b.G.extraData||{}).screenId||null)):new Promise((0,g.x)(b.Or,b))}; g.h.bB=function(a){if(!this.la()){E7("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.o)if(b.receiverType==chrome.cast.ReceiverType.CAST)E7("Got resumed cast session before resumed mdx connection."),b.friendlyName=chrome.cast.unescape(b.friendlyName),G7(this,new A7(this.u,b),!0);else{this.Tb("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.o.u,d=k6(this.u.de(),c.label);d&&f6(d,b.label)&& c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==chrome.cast.ReceiverType.CAST&&(E7("onSessionEstablished_: manual to cast session change "+b.friendlyName),g.He(this.o),this.o=new A7(this.u,b),this.o.subscribe("sessionScreen",(0,g.x)(this.cB,this,this.o)),this.o.pj(null));this.o.ou(a)}}}; g.h.NP=function(){return this.o?this.o.fD():null}; g.h.gN=function(a){this.la()||(this.Tb("Failed to estabilish a session: "+g.Mk(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&G7(this,null))}; g.h.JM=function(a){E7("Receiver availability updated: "+a);if(!this.la()){var b=F7(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;F7(this)!=b&&this.R("yt-remote-cast2-availability-change",F7(this))}}; g.h.eD=function(){this.la()||(this.w=zwa(this),E7("Updating custom receivers: "+g.Mk(this.w)),chrome.cast.setCustomReceivers(this.w,g.Ja,(0,g.x)(function(){this.Tb("Failed to set custom receivers.")},this)),this.R("yt-remote-cast2-availability-change",F7(this)))}; D7.prototype.setLaunchParams=D7.prototype.MO;D7.prototype.setConnectedScreenStatus=D7.prototype.LO;D7.prototype.stopSession=D7.prototype.OP;D7.prototype.getCastSession=D7.prototype.NP;D7.prototype.requestSession=D7.prototype.requestSession;D7.prototype.init=D7.prototype.init;D7.prototype.dispose=D7.prototype.dispose;var M7=[];R7.prototype.reset=function(a){this.listId="";this.index=-1;this.videoId="";S7(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.o=a.trackData,this.qf=a.hasPrevious,this.hasNext=a.hasNext,this.F=a.playerTime,this.C=a.playerTimeAt,this.A=a.seekableStart,this.u=a.seekableEnd,this.G=a.duration,this.H=a.loadedTime,this.w=a.liveIngestionTime,this.B= !isNaN(this.w))}; R7.prototype.isAdPlaying=function(){return 1081==this.playerState}; R7.prototype.getDuration=function(){return this.B?this.G+T7(this):this.G}; R7.prototype.clone=function(){return new R7(X7(this))};g.r(Z7,g.P);g.h=Z7.prototype;g.h.play=function(){1==this.o?(this.u?this.u.play(null,g.Ja,e8(this,"play")):d8(this,"play"),c8(this,1,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.play)}; g.h.pause=function(){1==this.o?(this.u?this.u.pause(null,g.Ja,e8(this,"pause")):d8(this,"pause"),c8(this,2,V7($7(this))),this.R("remotePlayerChange")):a8(this,this.pause)}; g.h.seekTo=function(a){if(1==this.o){if(this.u){var b=$7(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;c.resumeState=1==b.playerState||3==b.playerState?chrome.cast.media.ResumeState.PLAYBACK_START:chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.u.seek(c,g.Ja,e8(this,"seekTo",{newTime:a}))}else d8(this,"seekTo",{newTime:a});c8(this,3,a);this.R("remotePlayerChange")}else a8(this,g.Sa(this.seekTo,a))}; g.h.stop=function(){if(1==this.o){this.u?this.u.stop(null,g.Ja,e8(this,"stopVideo")):d8(this,"stopVideo");var a=$7(this);a.index=-1;a.videoId="";S7(a);b8(this,a);this.R("remotePlayerChange")}else a8(this,this.stop)}; g.h.setVolume=function(a,b){if(1==this.o){var c=$7(this);if(this.w){if(c.volume!=a){var d=Math.round(a)/100;this.w.setReceiverVolumeLevel(d,(0,g.x)(function(){i7("CP","set receiver volume: "+d)},this),(0,g.x)(function(){this.Tb("failed to set receiver volume.")},this))}c.muted!=b&&this.w.setReceiverMuted(b,(0,g.x)(function(){i7("CP","set receiver muted: "+b)},this),(0,g.x)(function(){this.Tb("failed to set receiver muted.")},this))}else{var e={volume:a, muted:b};-1!=c.volume&&(e.delta=a-c.volume);d8(this,"setVolume",e)}c.muted=b;c.volume=a;b8(this,c)}else a8(this,g.Sa(this.setVolume,a,b))}; g.h.cC=function(a,b){if(1==this.o){var c=$7(this),d={videoId:a};b&&(c.o={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},d.style=g.Mk(b.style),g.Ub(d,c.o));d8(this,"setSubtitlesTrack",d);b8(this,c)}else a8(this,g.Sa(this.cC,a,b))}; g.h.setAudioTrack=function(a,b){if(1==this.o){var c=b.getLanguageInfo().getId();d8(this,"setAudioTrack",{videoId:a,audioTrackId:c});var d=$7(this);d.audioTrackId=c;b8(this,d)}else a8(this,g.Sa(this.setAudioTrack,a,b))}; g.h.playVideo=function(a,b,c,d,e,f,k){var l=$7(this);c=c||0;var m={videoId:a,currentIndex:c};W7(l,a,c);void 0!==b&&(U7(l,b),m.currentTime=b);void 0!==d&&(m.listId=d);null!=e&&(m.playerParams=e);null!=f&&(m.clickTrackingParams=f);null!=k&&(m.locationInfo=g.Mk(k));d8(this,"setPlaylist",m);d||b8(this,l)}; g.h.aD=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"previous")}else a8(this,g.Sa(this.aD,a,b))}; g.h.nextVideo=function(a,b){if(1==this.o){if(a&&b){var c=$7(this);W7(c,a,b);b8(this,c)}d8(this,"next")}else a8(this,g.Sa(this.nextVideo,a,b))}; g.h.Kw=function(){1==this.o?d8(this,"dismissAutoplay"):a8(this,this.Kw)}; g.h.dispose=function(){if(3!=this.o){var a=this.o;this.o=3;this.R("proxyStateChange",a,this.o)}g.P.prototype.dispose.call(this)}; g.h.Y=function(){Mwa(this);this.A=null;this.B.clear();Y7(this,null);g.P.prototype.Y.call(this)}; g.h.Vu=function(a){if((a!=this.o||2==a)&&3!=this.o&&0!=a){var b=this.o;this.o=a;this.R("proxyStateChange",b,a);if(1==a)for(;!this.B.isEmpty();)b=a=this.B,g.db(b.o)&&(b.o=b.u,b.o.reverse(),b.u=[]),a.o.pop().apply(this);else 3==a&&this.dispose()}}; g.h.CM=function(a,b){this.R(a,b)}; g.h.GK=function(a){if(!a)this.Kl(null),Y7(this,null);else if(this.w.receiver.volume){a=this.w.receiver.volume;var b=$7(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)i7("CP","Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,b8(this,b)}}; g.h.Kl=function(a){i7("CP","Cast media: "+!!a);this.u&&this.u.removeUpdateListener(this.G);if(this.u=a)this.u.addUpdateListener(this.G),Nwa(this),this.R("remotePlayerChange")}; g.h.FK=function(a){a?(Nwa(this),this.R("remotePlayerChange")):this.Kl(null)}; g.h.RK=function(){var a=Jwa();a&&Y7(this,a)}; g.h.Tb=function(a){i7("CP",a)};g.r(f8,g.P);g.h=f8.prototype; g.h.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.playerParams,f=b.clickTrackingParams,k=b.index,l={videoId:d},m=b.currentTime,n=b.locationInfo;void 0!==m&&(l.currentTime=5>=m?0:m);e&&(l.playerParams=e);n&&(l.locationInfo=n);f&&(l.clickTrackingParams=f);c&&(l.listId=c);void 0!==k&&(l.currentIndex=k);c&&(this.Ta.listId=c);this.Ta.videoId=d;this.Ta.index=k||0;this.Ta.state=3;U7(this.Ta,m);this.A="UNSUPPORTED";g8("Connecting with setPlaylist and params: "+g.Mk(l));this.o.connect({method:"setPlaylist", params:g.Mk(l)},a,$ua())}else g8("Connecting without params"),this.o.connect({},a,$ua());Pwa(this)}; g.h.dispose=function(){this.la()||(this.R("beforeDispose"),h8(this,3));g.P.prototype.dispose.call(this)}; g.h.Y=function(){i8(this);k8(this);j8(this);g.Mo(this.F);this.F=NaN;g.Mo(this.G);this.G=NaN;this.w=null;g.zp(this.O);this.O.length=0;this.o.dispose();g.P.prototype.Y.call(this);this.A=this.C=this.u=this.Ta=this.o=null}; g.h.rF=function(){this.Ui(2)}; g.h.KK=function(){g8("Channel opened");this.P&&(this.P=!1,j8(this),this.J=g.Ko((0,g.x)(function(){g8("Timing out waiting for a screen.");this.Ui(1)},this),15E3)); dva(Zva(this.o),this.S)}; g.h.HK=function(){g8("Channel closed");isNaN(this.B)?q6(!0):q6();this.dispose()}; g.h.IK=function(a){q6();isNaN(this.Gk())?(g8("Channel error: "+a+" without reconnection"),this.dispose()):(this.P=!0,g8("Channel error: "+a+" with reconnection in "+this.Gk()+" ms"),h8(this,2))}; g.h.JK=function(a){a.params?g8("Received: action="+a.action+", params="+g.Mk(a.params)):g8("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=N6(a.params.devices);this.u=(0,g.Fc)(a,function(c){return new d6(c)}); a=!!g.$a(this.u,function(c){return"LOUNGE_SCREEN"==c.type}); Swa(this,a);break;case "loungeScreenDisconnected":g.ib(this.u,function(c){return"LOUNGE_SCREEN"==c.type}); Swa(this,!1);break;case "remoteConnected":var b=new d6(N6(a.params.device));g.$a(this.u,function(c){return b?c.id==b.id:!1})||Kua(this.u,b); break;case "remoteDisconnected":b=new d6(N6(a.params.device));g.ib(this.u,function(c){return b?c.id==b.id:!1}); break;case "gracefulDisconnect":break;case "playlistModified":Uwa(this,a);break;case "nowPlaying":Wwa(this,a);break;case "onStateChange":Vwa(this,a);break;case "onAdStateChange":Xwa(this,a);break;case "onVolumeChanged":Ywa(this,a);break;case "onSubtitlesTrackChanged":Twa(this,a);break;case "nowAutoplaying":Zwa(this,a);break;case "autoplayDismissed":this.R("autoplayDismissed");break;case "autoplayUpNext":this.C=a.params.videoId||null;this.R("autoplayUpNext",this.C);break;case "onAutoplayModeChanged":this.A= a.params.autoplayMode;this.R("autoplayModeChange",this.A);"DISABLED"==this.A&&this.R("autoplayDismissed");break;case "onHasPreviousNextChanged":$wa(this,a);break;case "requestAssistedSignIn":this.R("assistedSignInRequested",a.params.authCode);break;default:g8("Unrecognized action: "+a.action)}}; g.h.zO=function(){if(this.w){var a=this.w;this.w=null;this.Ta.videoId!=a&&l8(this,"getNowPlaying")}}; g.h.gF=function(){var a=3;this.la()||(a=0,isNaN(this.Gk())?d7(this.o)&&isNaN(this.B)&&(a=1):a=2);return a}; g.h.Ui=function(a){g8("Disconnecting with "+a);i8(this);this.R("beforeDisconnect",a);1==a&&q6();$va(this.o,a);this.dispose()}; g.h.fF=function(){var a=this.Ta;this.w&&(a=this.Ta.clone(),W7(a,this.w,a.index));return X7(a)}; g.h.NO=function(a){var b=new R7(a);b.videoId&&b.videoId!=this.Ta.videoId&&(this.w=b.videoId,g.Mo(this.F),this.F=g.Ko((0,g.x)(this.zO,this),5E3));var c=[];this.Ta.listId==b.listId&&this.Ta.videoId==b.videoId&&this.Ta.index==b.index||c.push("remoteQueueChange");this.Ta.playerState==b.playerState&&this.Ta.volume==b.volume&&this.Ta.muted==b.muted&&V7(this.Ta)==V7(b)&&g.Mk(this.Ta.o)==g.Mk(b.o)||c.push("remotePlayerChange");this.Ta.reset(a);(0,g.y)(c,function(d){this.R(d)},this)}; g.h.zx=function(){var a=this.o.C.id,b=g.$a(this.u,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a}); return b?b.id:""}; g.h.Gk=function(){var a=this.o;return a.u.isActive()?a.u.u-(0,g.H)():NaN}; g.h.UE=function(){return this.A||"UNSUPPORTED"}; g.h.VE=function(){return this.C||""}; g.h.GP=function(){if(!isNaN(this.Gk())){var a=this.o.u;g.Cn(a.o);a.start()}}; g.h.IO=function(a,b){l8(this,a,b);Rwa(this)}; f8.prototype.subscribe=f8.prototype.subscribe;f8.prototype.unsubscribeByKey=f8.prototype.tg;f8.prototype.getProxyState=f8.prototype.gF;f8.prototype.disconnect=f8.prototype.Ui;f8.prototype.getPlayerContextData=f8.prototype.fF;f8.prototype.setPlayerContextData=f8.prototype.NO;f8.prototype.getOtherConnectedRemoteId=f8.prototype.zx;f8.prototype.getReconnectTimeout=f8.prototype.Gk;f8.prototype.getAutoplayMode=f8.prototype.UE;f8.prototype.getAutoplayVideoId=f8.prototype.VE;f8.prototype.reconnect=f8.prototype.GP; f8.prototype.sendMessage=f8.prototype.IO;g.r(m8,m7);g.h=m8.prototype;g.h.de=function(a){return this.rd.$_gs(a)}; g.h.contains=function(a){return!!this.rd.$_c(a)}; g.h.get=function(a){return this.rd.$_g(a)}; g.h.start=function(){this.rd.$_st()}; g.h.add=function(a,b,c){this.rd.$_a(a,b,c)}; g.h.remove=function(a,b,c){this.rd.$_r(a,b,c)}; g.h.Kp=function(a,b,c,d){this.rd.$_un(a,b,c,d)}; g.h.Y=function(){for(var a=0,b=this.u.length;a<b;++a)this.rd.$_ubk(this.u[a]);this.u.length=0;this.rd=null;m7.prototype.Y.call(this)}; g.h.KP=function(){this.R("screenChange")}; g.h.hM=function(){this.R("onlineScreenChange")}; v7.prototype.$_st=v7.prototype.start;v7.prototype.$_gspc=v7.prototype.LP;v7.prototype.$_gsppc=v7.prototype.dD;v7.prototype.$_c=v7.prototype.contains;v7.prototype.$_g=v7.prototype.get;v7.prototype.$_a=v7.prototype.add;v7.prototype.$_un=v7.prototype.Kp;v7.prototype.$_r=v7.prototype.remove;v7.prototype.$_gs=v7.prototype.de;v7.prototype.$_gos=v7.prototype.cD;v7.prototype.$_s=v7.prototype.subscribe;v7.prototype.$_ubk=v7.prototype.tg;var F8=null,E8=!1,n8=null,o8=null,D8=null,s8=[];g.r(G8,g.A);g.h=G8.prototype; g.h.Y=function(){g.A.prototype.Y.call(this);this.A.stop();this.C.stop();this.P.stop();this.U();this.o.unsubscribe("proxyStateChange",this.YA,this);this.o.unsubscribe("remotePlayerChange",this.Pl,this);this.o.unsubscribe("remoteQueueChange",this.Zo,this);this.o.unsubscribe("autoplayUpNext",this.zA,this);this.o.unsubscribe("previousNextChange",this.VA,this);this.o.unsubscribe("nowAutoplaying",this.RA,this);this.o.unsubscribe("autoplayDismissed",this.yA,this);this.o=this.B=null}; g.h.vz=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];if(2!=this.o.o)if(J8(this)){if(!$7(this.o).isAdPlaying()||"control_seek"!=a)switch(a){case "control_toggle_play_pause":1==$7(this.o).playerState?this.o.pause():this.o.play();break;case "control_play":this.o.play();break;case "control_pause":this.o.pause();break;case "control_seek":this.J.Jx(c[0],c[1]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId, c)}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":c=this.u.getCurrentTime();L8(this,0==c?void 0:c);break;case "control_seek":L8(this,c[0]);break;case "control_subtitles_set_track":K8(this,c[0]);break;case "control_set_audio_track":c=c[0],J8(this)&&this.o.setAudioTrack(this.u.getVideoData(1).videoId,c)}}; g.h.EK=function(a){this.P.nF(a)}; g.h.mP=function(a){this.vz("control_subtitles_set_track",g.Ob(a)?null:a)}; g.h.qC=function(){var a=this.u.getOption("captions","track");g.Ob(a)||K8(this,a)}; g.h.JA=function(a){if(J8(this)){this.o.unsubscribe("remotePlayerChange",this.Pl,this);var b=Math.round(a.volume);a=!!a.muted;var c=$7(this.o);if(b!=c.volume||a!=c.muted)this.o.setVolume(b,a),this.O.start();this.o.subscribe("remotePlayerChange",this.Pl,this)}}; g.h.DL=function(){g.Ob(this.F)||lxa(this,this.F);this.G=!1}; g.h.YA=function(a,b){this.C.stop();2==b&&this.pC()}; g.h.Pl=function(){if(J8(this)){this.A.stop();var a=$7(this.o);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.B.H=1;break;case 1082:case 1083:this.B.H=0;break;default:this.B.H=-1}switch(a.playerState){case 1081:case 1:I8(this,new g.qD(8));this.oC();break;case 1085:case 3:I8(this,new g.qD(9));break;case 1083:case 0:I8(this,new g.qD(2));this.J.stop();H8(this,this.u.getVideoData().lengthSeconds);break;case 1084:I8(this,new g.qD(4));break;case 2:I8(this,new g.qD(4));H8(this,V7(a)); break;case -1:I8(this,new g.qD(64));break;case -1E3:I8(this,new g.qD(128,{errorCode:"mdx.remoteerror",errorMessage:"\u0412\u0438\u0434\u0435\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f."}))}a=$7(this.o).o;var b=this.F;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&& a.kind==b.kind:1)||(this.F=a,lxa(this,a));a=$7(this.o);-1==a.volume||Math.round(this.u.getVolume())==a.volume&&this.u.isMuted()==a.muted||this.O.isActive()||this.PC()}else kxa(this)}; g.h.VA=function(){this.u.R("mdxpreviousnextchange")}; g.h.Zo=function(){J8(this)||kxa(this)}; g.h.jE=function(){this.o.Kw()}; g.h.zA=function(){}; g.h.RA=function(a){isNaN(a)||this.u.R("mdxnowautoplaying",a)}; g.h.yA=function(){this.u.R("mdxautoplaycanceled")}; g.h.kI=function(a,b){-1==$7(this.o).playerState?L8(this,a):b&&this.o.seekTo(a)}; g.h.PC=function(){if(J8(this)){var a=$7(this.o);this.w.Xa(this.S);a.muted?this.u.mute():this.u.unMute();this.u.setVolume(a.volume);this.S=this.w.L(this.u,"onVolumeChange",this.JA)}}; g.h.oC=function(){this.A.stop();if(!this.o.la()){var a=$7(this.o);1==a.playerState&&I8(this,new g.qD(8));H8(this,V7(a));this.A.start()}}; g.h.pC=function(){this.C.stop();this.A.stop();var a=this.o.A.getReconnectTimeout();2==this.o.o&&!isNaN(a)&&this.C.start()};g.r(M8,g.V);M8.prototype.w=function(){c6("mdx-privacy-popup-cancel");this.u.hide()}; M8.prototype.B=function(){c6("mdx-privacy-popup-confirm");this.u.hide()};g.r(N8,g.V);N8.prototype.A=function(a){nxa(this,a.state)};g.r(O8,g.YO);O8.prototype.J=function(){var a=this.u.getOption("remote","receivers");a&&1<a.length&&!this.u.getOption("remote","quickCast")?(this.C=g.xb(a,this.B,this),g.$O(this,(0,g.Fc)(a,this.B)),a=this.u.getOption("remote","currentReceiver"),this.Ee(this.B(a)),this.enable(!0)):this.enable(!1)}; O8.prototype.B=function(a){return a.key}; O8.prototype.We=function(a){return"cast-selector-receiver"==a?"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":this.C[a].name}; O8.prototype.Zc=function(a){g.YO.prototype.Zc.call(this,a);this.u.setOption("remote","currentReceiver",this.C[a]);this.w.nb()};g.r(P8,g.fM);g.h=P8.prototype; g.h.create=function(){exa(g.Bx(this.player.N()));this.A.push(g.Ro("yt-remote-before-disconnect",this.BK,this));this.A.push(g.Ro("yt-remote-connection-change",this.KM,this));this.A.push(g.Ro("yt-remote-receiver-availability-change",this.WA,this));this.A.push(g.Ro("yt-remote-auto-connect",this.IM,this));this.A.push(g.Ro("yt-remote-receiver-resumed",this.HM,this));this.A.push(g.Ro("mdx-privacy-popup-confirm",this.lO,this));this.A.push(g.Ro("mdx-privacy-popup-cancel",this.kO,this));this.WA()}; g.h.load=function(){this.player.cancelPlayback();g.fM.prototype.load.call(this);this.B=new G8(this,this.player,this.o);var a=(a=jxa())?a.currentTime:0;var b=C8()?new Z7(x8(),void 0):null;0==a&&b&&(a=V7($7(b)));0!=a&&(this.O=a||0,this.player.R("progresssync",a,void 0));mxa(this,this.F,this.F);g.zT(this.player.app,6)}; g.h.unload=function(){this.player.R("mdxautoplaycanceled");this.w=this.u;g.Ie(this.B,this.o);this.o=this.B=null;g.fM.prototype.unload.call(this);g.zT(this.player.app,5);Q8(this)}; g.h.Y=function(){g.So(this.A);g.fM.prototype.Y.call(this)}; g.h.sl=function(a,b){for(var c=[],d=1;d<arguments.length;++d)c[d-1]=arguments[d];this.loaded&&this.B.vz.apply(this.B,[a].concat(g.na(c)))}; g.h.getAdState=function(){return this.H}; g.h.iF=function(){return this.loaded?this.B.suggestion:null}; g.h.qf=function(){return this.o?$7(this.o).qf:!1}; g.h.hasNext=function(){return this.o?$7(this.o).hasNext:!1}; g.h.getCurrentTime=function(){return this.O}; g.h.getProgressState=function(){var a=$7(this.o),b=this.player.getVideoData();return{allowSeeking:g.Q(this.player.N().experiments,"web_player_mdx_allow_seeking_change_killswitch")?this.player.Oc():!a.isAdPlaying()&&this.player.Oc(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.w+T7(a):a.w,isAtLiveHead:1>=(a.B?a.u+T7(a):a.u)-this.getCurrentTime(),loaded:a.H,seekableEnd:a.B?a.u+T7(a):a.u,seekableStart:0<a.A?a.A+T7(a): a.A}}; g.h.nextVideo=function(){this.o&&this.o.nextVideo()}; g.h.FG=function(){this.o&&this.o.aD()}; g.h.BK=function(a){1==a&&(this.S=this.o?$7(this.o):null)}; g.h.KM=function(){var a=C8()?new Z7(x8(),void 0):null;if(a){var b=this.w;this.loaded&&this.unload();this.o=a;this.S=null;b.key!=this.u.key&&(this.w=b,this.load())}else g.He(this.o),this.o=null,this.loaded&&(this.unload(),(a=this.S)&&a.videoId==this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,V7(a)));this.player.R("videodatachange","newdata",this.player.getVideoData(),3)}; g.h.WA=function(){this.J=[this.u].concat(gxa());var a=y8()||this.u;R8(this,a);this.player.ma("onMdxReceiversChange")}; g.h.cO=function(a){!this.P&&g.ED(a,8)&&(this.player.pauseVideo(),Q8(this))}; g.h.IM=function(){var a=y8();R8(this,a)}; g.h.HM=function(){this.w=y8()}; g.h.lO=function(){this.P=!0;Q8(this);E8=!1;F8&&A8(F8,1);F8=null}; g.h.kO=function(){this.P=!1;Q8(this);R8(this,this.u);this.w=this.u;E8=!1;F8=null;this.player.playVideo()}; g.h.Mc=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.J;case "currentReceiver":return b&&("cast-selector-receiver"==b.key?P7():R8(this,b)),this.loaded?this.w:this.u;case "quickCast":return 2==this.J.length&&"cast-selector-receiver"==this.J[1].key?(b&&P7(),!0):!1}}; g.h.GG=function(){d8(this.o,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.h.Ff=function(){return!1}; g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};g.uM.remote=P8;})(_yt_player);
/var/./files/need-2-delete/mini-borishof.ru1/./././upload/models/mini/remote.js