123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750 |
- (function(g){var window=this;'use strict';var ed9=function(T){if(T instanceof g.Xy)return T;if(typeof T.Xu=="function")return T.Xu(!1);if(g.o_(T)){var Q=0,k=new g.Xy;k.next=function(){for(;;){if(Q>=T.length)return g.R6;if(Q in T)return g.wR(T[Q++]);Q++}};
- return k}throw Error("Not implemented");},Fae=function(T,Q,k){if(g.o_(T))g.EA(T,Q,k);
- else for(T=ed9(T);;){var l=T.next();if(l.done)break;Q.call(k,l.value,void 0,T)}},QL=function(T){g.Uz(T,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.R_()).toString(36));
- return T},jd=function(T,Q,k){Array.isArray(k)||(k=[String(k)]);
- g.OHt(T.Y,Q,k)},Eim=function(T,Q){var k=[];
- Fae(Q,function(l){try{var v=g.AJ.prototype.S.call(this,l,!0)}catch(L){if(L=="Storage: Invalid value was encountered")return;throw L;}v===void 0?k.push(l):g.yz5(v)&&k.push(l)},T);
- return k},yI$=function(T,Q){Eim(T,Q).forEach(function(k){g.AJ.prototype.remove.call(this,k)},T)},iep=function(T){if(T.F_){if(T.F_.locationOverrideToken)return{locationOverrideToken:T.F_.locationOverrideToken};
- if(T.F_.latitudeE7!=null&&T.F_.longitudeE7!=null)return{latitudeE7:T.F_.latitudeE7,longitudeE7:T.F_.longitudeE7}}return null},VmW=function(T,Q){g.CW(T,Q)||T.push(Q)},TVd=function(T){var Q=0,k;
- for(k in T)Q++;return Q},QUm=function(T,Q){return g.YZ(T,Q)},jUA=function(T){try{return g.VC.JSON.parse(T)}catch(Q){}T=String(T);
- if(/^\s*$/.test(T)?0:/^[\],:{}\s\u2028\u2029]*$/.test(T.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("("+T+")")}catch(Q){}throw Error("Invalid JSON string: "+T);},kU=function(T){if(g.VC.JSON)try{return g.VC.JSON.parse(T)}catch(Q){}return jUA(T)},kOp=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/channel/opened",g.ol("channel_type"))},lqW=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/channel/closed",g.ol("channel_type"))},o5A=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/channel/message_received",g.ol("channel_type"))},v5p=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/channel/success")},L6e=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/channel/error",g.ol("channel_type"),g.ol("error_type"))},qGA=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},g5d=function(){var T=l9();
- this.T=T;T.Rw("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},MSe=function(T,Q,k,l){var v=new g.lN(null);
- T&&g.oZ(v,T);Q&&g.v0(v,Q);k&&g.LV(v,k);l&&(v.S=l);return v},YGE=function(T,Q){return new g.QO(T,Q)},o7=function(T,Q){return Object.prototype.hasOwnProperty.call(T,Q)},U2p=function(T,Q){return T===Q},vo=function(T,Q){this.S={};
- this.T=[];this.iR=this.size=0;var k=arguments.length;if(k>1){if(k%2)throw Error("Uneven number of arguments");for(var l=0;l<k;l+=2)this.set(arguments[l],arguments[l+1])}else if(T)if(T instanceof vo)for(k=T.zG(),l=0;l<k.length;l++)this.set(k[l],T.get(k[l]));else for(l in T)this.set(l,T[l])},Lz=function(T){if(T.size!=T.T.length){for(var Q=0,k=0;Q<T.T.length;){var l=T.T[Q];
- o7(T.S,l)&&(T.T[k++]=l);Q++}T.T.length=k}if(T.size!=T.T.length){Q={};for(l=k=0;k<T.T.length;){var v=T.T[k];o7(Q,v)||(T.T[l++]=v,Q[v]=1);k++}T.T.length=l}},qb=function(T){this.name=this.id="";
- this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.ownerObfuscatedGaiaId=this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new vo;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";T&&(this.id=T.id||T.name,this.name=T.name,this.clientName=T.clientName?T.clientName.toUpperCase():"UNKNOWN_INTERFACE",
- this.app=T.app,this.type=T.type||"REMOTE_CONTROL",this.username=T.user||"",this.avatar=T.userAvatarUri||"",this.obfuscatedGaiaId=T.obfuscatedGaiaId||"",this.ownerObfuscatedGaiaId=T.ownerObfuscatedGaiaId||"",this.theme=T.theme||"u",RIe(this,T.capabilities||""),ZhW(this,T.compatibleSenderThemes||""),fqA(this,T.experiments||""),this.brand=T.brand||"",this.model=T.model||"",this.year=T.year||0,this.os=T.os||"",this.osVersion=T.osVersion||"",this.chipset=T.chipset||"",this.mdxDialServerType=T.mdxDialServerType||
- "MDX_DIAL_SERVER_TYPE_UNKNOWN",T=T.deviceInfo)&&(T=JSON.parse(T),this.brand=T.brand||"",this.model=T.model||"",this.year=T.year||0,this.os=T.os||"",this.osVersion=T.osVersion||"",this.chipset=T.chipset||"",this.clientName=T.clientName?T.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=T.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},RIe=function(T,Q){T.capabilities.clear();
- g.bl(Q.split(","),g.YE(QUm,GOv)).forEach(function(k){T.capabilities.add(k)})},ZhW=function(T,Q){T.compatibleSenderThemes.clear();
- g.bl(Q.split(","),g.YE(QUm,m2p)).forEach(function(k){T.compatibleSenderThemes.add(k)})},fqA=function(T,Q){T.experiments.clear();
- Q.split(",").forEach(function(k){T.experiments.add(k)})},ge=function(T){T=T||{};
- this.name=T.name||"";this.id=T.id||T.screenId||"";this.token=T.token||T.loungeToken||"";this.uuid=T.uuid||T.dialId||"";this.idType=T.screenIdType||"normal"},Mb=function(T,Q){return!!Q&&(T.id==Q||T.uuid==Q)},IqJ=function(T){return{name:T.name,
- screenId:T.id,loungeToken:T.token,dialId:T.uuid,screenIdType:T.idType}},hIW=function(T){return new ge(T)},x2A=function(T){return Array.isArray(T)?g.IQ(T,hIW):[]},YU=function(T){return T?'{name:"'+T.name+'",id:'+T.id.substr(0,6)+"..,token:"+((T.token?".."+T.token.slice(-6):"-")+",uuid:"+(T.uuid?".."+T.uuid.slice(-6):"-")+",idType:"+T.idType+"}"):"null"},PCE=function(T){return Array.isArray(T)?"["+g.IQ(T,YU).join(",")+"]":"null"},HhA=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
- function(T){var Q=Math.random()*16|0;
- return(T=="x"?Q:Q&3|8).toString(16)})},tSE=function(T){return g.IQ(T,function(Q){return{key:Q.id,
- name:Q.name}})},Oh$=function(T,Q){return g.sA(T,function(k){return k||Q?!k!=!Q?!1:k.id==Q.id:!0})},U1=function(T,Q){return g.sA(T,function(k){return Mb(k,Q)})},pDJ=function(){var T=(0,g.Ag)();
- T&&yI$(T,T.T.Xu(!0))},R7=function(){var T=g.cy("yt-remote-connected-devices")||[];
- g.JT(T);return T},W6W=function(T){if(T.length==0)return[];
- var Q=T[0].indexOf("#"),k=Q==-1?T[0]:T[0].substring(0,Q);return g.IQ(T,function(l,v){return v==0?l:l.substring(k.length)})},$2T=function(T){g.ri("yt-remote-connected-devices",T,86400)},Za=function(){if(JH$)return JH$;
- var T=g.cy("yt-remote-device-id");T||(T=HhA(),g.ri("yt-remote-device-id",T,31536E3));for(var Q=R7(),k=1,l=T;g.CW(Q,l);)k++,l=T+"#"+k;return JH$=l},eIW=function(){var T=R7(),Q=Za();
- g.a1()&&g.Fd(T,Q);T=W6W(T);if(T.length==0)try{g.nh("remote_sid")}catch(k){}else try{g.aU("remote_sid",T.join(","),-1)}catch(k){}},F6d=function(){return g.cy("yt-remote-session-browser-channel")},E5A=function(){return g.cy("yt-remote-local-screens")||[]},yH$=function(){g.ri("yt-remote-lounge-token-expiration",!0,86400)},ih_=function(T){T.length>5&&(T=T.slice(T.length-5));
- var Q=g.IQ(E5A(),function(l){return l.loungeToken}),k=g.IQ(T,function(l){return l.loungeToken});
- g.hm(k,function(l){return!g.CW(Q,l)})&&yH$();
- g.ri("yt-remote-local-screens",T,31536E3)},fz=function(T){T||(g.Dk("yt-remote-session-screen-id"),g.Dk("yt-remote-session-video-id"));
- eIW();T=R7();g.zv(T,Za());$2T(T)},VSd=function(){if(!Ga){var T=g.uw();
- T&&(Ga=new g.wl(T))}},TiE=function(){VSd();
- return Ga?!!Ga.get("yt-remote-use-staging-server"):!1},mi=function(T,Q){g.iM[T]=!0;
- var k=g.ES();k&&k.publish.apply(k,arguments);g.iM[T]=!1},Q1A=function(){},l9=function(){if(!I7){I7=new g.td(new Q1A);
- var T=g.sG("client_streamz_web_flush_count",-1);T!==-1&&(I7.L=T)}return I7},j1T=function(){var T=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
- return T?parseInt(T[1],10):0},kL_=function(T){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+T)!=-1||document.currentScript.src.indexOf("&"+T)!=-1)},lkE=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},hh=function(T){T.length?oq1(T.shift(),function(){hh(T)}):vqW()},LdW=function(T){return"chrome-extension://"+T+"/cast_sender.js"},oq1=function(T,Q,k){var l=document.createElement("script");
- l.onerror=Q;k&&(l.onload=k);g.SN(l,g.BN(T));(document.head||document.documentElement).appendChild(l)},qrA=function(){var T=j1T(),Q=[];
- if(T>1){var k=T-1;Q.push("//www.gstatic.com/eureka/clank/"+T+"/cast_sender.js");Q.push("//www.gstatic.com/eureka/clank/"+k+"/cast_sender.js")}return Q},vqW=function(){var T=lkE();
- T&&T(!1,"No cast extension found")},MG9=function(){if(gqm){var T=2,Q=lkE(),k=function(){T--;
- T==0&&Q&&Q(!0)};
- window.__onGCastApiAvailable=k;oq1("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",vqW,k)}},Yr$=function(){MG9();
- var T=qrA();T.push("//www.gstatic.com/eureka/clank/cast_sender.js");hh(T)},RYA=function(){MG9();
- var T=qrA();T.push.apply(T,g.ZH(U5m.map(LdW)));T.push("//www.gstatic.com/eureka/clank/cast_sender.js");hh(T)},s1=function(T,Q,k){g.x.call(this);
- this.B=k!=null?(0,g.Mp)(T,k):T;this.d8=Q;this.N=(0,g.Mp)(this.VI,this);this.T=!1;this.S=0;this.L=this.D8=null;this.Y=[]},Sd=function(){},ZY_=function(){g.Jz.call(this,"p")},fkA=function(){g.Jz.call(this,"o")},m5J=function(){return GLW=GLW||new g.fL},IkE=function(T){g.Jz.call(this,"serverreachability",T)},Cz=function(T){var Q=m5J();
- Q.dispatchEvent(new IkE(Q,T))},hYm=function(T){g.Jz.call(this,"statevent",T)},Bo=function(T){var Q=m5J();
- Q.dispatchEvent(new hYm(Q,T))},s1$=function(T,Q,k,l){g.Jz.call(this,"timingevent",T);
- this.size=Q;this.rtt=k;this.retries=l},za=function(T,Q){if(typeof T!=="function")throw Error("Fn must not be null and must be a function");
- return g.VC.setTimeout(function(){T()},Q)},Xm=function(){},we=function(T,Q,k,l){this.L=T;
- this.Y=Q;this.Ig=k;this.Gg=l||1;this.Tg=new g.mo(this);this.f_=45E3;this.Bd=null;this.B=!1;this.D=this.u9=this.j=this.sK=this.hj=this.zg=this.z9=null;this.qO=[];this.T=null;this.C=0;this.N=this.xm=null;this.QR=-1;this.e6=!1;this.K_=0;this.p_=null;this.d5=this.Jj=this.h3=this.i9=!1;this.S=new Sr9},Sr9=function(){this.S=null;
- this.T="";this.L=!1},Bi$=function(T,Q,k){T.sK=1;
- T.j=QL(Q.clone());T.D=k;T.i9=!0;CuA(T,null)},CuA=function(T,Q){T.hj=Date.now();
- de(T);T.u9=T.j.clone();jd(T.u9,"t",T.Gg);T.C=0;var k=T.L.sK;T.S=new Sr9;T.T=zYT(T.L,k?Q:null,!T.D);T.K_>0&&(T.p_=new g.Vq((0,g.Mp)(T.sV,T,T.T),T.K_));T.Tg.listen(T.T,"readystatechange",T.CD);Q=T.Bd?g.Gs(T.Bd):{};T.D?(T.xm||(T.xm="POST"),Q["Content-Type"]="application/x-www-form-urlencoded",T.T.send(T.u9,T.xm,T.D,Q)):(T.xm="GET",T.T.send(T.u9,T.xm,null,Q));Cz(1)},wyd=function(T){if(!XyA(T))return g.io(T.T);
- var Q=g.Vu(T.T);if(Q==="")return"";var k="",l=Q.length,v=g.EJ(T.T)==4;if(!T.S.S){if(typeof TextDecoder==="undefined")return Nb(T),Ah(T),"";T.S.S=new g.VC.TextDecoder}for(var L=0;L<l;L++)T.S.L=!0,k+=T.S.S.decode(Q[L],{stream:!(v&&L==l-1)});Q.length=0;T.S.T+=k;T.C=0;return T.S.T},XyA=function(T){return T.T?T.xm=="GET"&&T.sK!=2&&T.L.YP:!1},Ag_=function(T,Q){var k=T.C,l=Q.indexOf("\n",k);
- if(l==-1)return d5A;k=Number(Q.substring(k,l));if(isNaN(k))return Ni9;l+=1;if(l+k>Q.length)return d5A;Q=Q.slice(l,l+k);T.C=l+k;return Q},de=function(T){T.zg=Date.now()+T.f_;
- bY$(T,T.f_)},bY$=function(T,Q){if(T.z9!=null)throw Error("WatchDog timer not null");
- T.z9=za((0,g.Mp)(T.wu,T),Q)},rgA=function(T){T.z9&&(g.VC.clearTimeout(T.z9),T.z9=null)},Ah=function(T){T.L.FG()||T.e6||cgd(T.L,T)},Nb=function(T){rgA(T);
- g.od(T.p_);T.p_=null;T.Tg.removeAll();if(T.T){var Q=T.T;T.T=null;Q.abort();Q.dispose()}},HYW=function(T,Q){try{var k=T.L;
- if(k.i7!=0&&(k.T==T||D5A(k.S,T)))if(!T.Jj&&D5A(k.S,T)&&k.i7==3){try{var l=k.iK.T.parse(Q)}catch(z){l=null}if(Array.isArray(l)&&l.length==3){var v=l;if(v[0]==0)a:{if(!k.j){if(k.T)if(k.T.hj+3E3<T.hj)b9(k),re(k);else break a;ak$(k);Bo(18)}}else k.F_=v[1],0<k.F_-k.p_&&v[2]<37500&&k.Jj&&k.qO==0&&!k.z9&&(k.z9=za((0,g.Mp)(k.JE,k),6E3));if(u4v(k.S)<=1&&k.Fk){try{k.Fk()}catch(z){}k.Fk=void 0}}else co(k,11)}else if((T.Jj||k.T==T)&&b9(k),!g.bB(Q))for(v=k.iK.T.parse(Q),Q=0;Q<v.length;Q++){var L=v[Q];k.p_=L[0];
- L=L[1];if(k.i7==2)if(L[0]=="c"){k.Y=L[1];k.Gg=L[2];var q=L[3];q!=null&&(k.CE=q);var Y=L[5];Y!=null&&typeof Y==="number"&&Y>0&&(k.K_=1.5*Y);l=k;var U=T.kO();if(U){var R=g.Tc(U,"X-Client-Wire-Protocol");if(R){var Z=l.S;!Z.T&&(g.rz(R,"spdy")||g.rz(R,"quic")||g.rz(R,"h2"))&&(Z.Y=Z.N,Z.T=new Set,Z.S&&(nqe(Z,Z.S),Z.S=null))}if(l.i9){var f=g.Tc(U,"X-HTTP-Session-Id");f&&(l.vn=f,g.Uz(l.Bd,l.i9,f))}}k.i7=3;k.N&&k.N.bE();k.DP&&(k.Z8=Date.now()-T.hj);l=k;var G=T;l.Hn=KdE(l,l.sK?l.Gg:null,l.Ig);if(G.Jj){x5$(l.S,
- G);var m=G,I=l.K_;I&&m.setTimeout(I);m.z9&&(rgA(m),de(m));l.T=G}else Pu_(l);k.L.length>0&&Da(k)}else L[0]!="stop"&&L[0]!="close"||co(k,7);else k.i7==3&&(L[0]=="stop"||L[0]=="close"?L[0]=="stop"?co(k,7):k.disconnect():L[0]!="noop"&&k.N&&k.N.jJ(L),k.qO=0)}Cz(4)}catch(z){}},tGW=function(T,Q){this.T=T;
- this.map=Q;this.context=null},OYJ=function(T){this.N=T||10;
- g.VC.PerformanceNavigationTiming?(T=g.VC.performance.getEntriesByType("navigation"),T=T.length>0&&(T[0].nextHopProtocol=="hq"||T[0].nextHopProtocol=="h2")):T=!!(g.VC.chrome&&g.VC.chrome.loadTimes&&g.VC.chrome.loadTimes()&&g.VC.chrome.loadTimes().wasFetchedViaSpdy);this.Y=T?this.N:1;this.T=null;this.Y>1&&(this.T=new Set);this.S=null;this.L=[]},pyW=function(T){return T.S?!0:T.T?T.T.size>=T.Y:!1},u4v=function(T){return T.S?1:T.T?T.T.size:0},D5A=function(T,Q){return T.S?T.S==Q:T.T?T.T.has(Q):!1},nqe=
- function(T,Q){T.T?T.T.add(Q):T.S=Q},x5$=function(T,Q){T.S&&T.S==Q?T.S=null:T.T&&T.T.has(Q)&&T.T.delete(Q)},WdT=function(T){if(T.S!=null)return T.L.concat(T.S.qO);
- if(T.T!=null&&T.T.size!==0){var Q=T.L;T=g.B(T.T.values());for(var k=T.next();!k.done;k=T.next())Q=Q.concat(k.value.qO);return Q}return g.r$(T.L)},$5$=function(T,Q){var k=new Xm;
- if(g.VC.Image){var l=new Image;l.onload=g.YE(a7,k,"TestLoadImage: loaded",!0,Q,l);l.onerror=g.YE(a7,k,"TestLoadImage: error",!1,Q,l);l.onabort=g.YE(a7,k,"TestLoadImage: abort",!1,Q,l);l.ontimeout=g.YE(a7,k,"TestLoadImage: timeout",!1,Q,l);g.VC.setTimeout(function(){if(l.ontimeout)l.ontimeout()},1E4);
- l.src=T}else Q(!1)},JgA=function(T,Q){var k=new Xm,l=new AbortController,v=setTimeout(function(){l.abort();
- a7(k,"TestPingServer: timeout",!1,Q)},1E4);
- fetch(T,{signal:l.signal}).then(function(L){clearTimeout(v);L.ok?a7(k,"TestPingServer: ok",!0,Q):a7(k,"TestPingServer: server error",!1,Q)}).catch(function(){clearTimeout(v);
- a7(k,"TestPingServer: error",!1,Q)})},a7=function(T,Q,k,l,v){try{v&&(v.onload=null,v.onerror=null,v.onabort=null,v.ontimeout=null),l(k)}catch(L){}},eYp=function(){this.T=new Sd},u9=function(T,Q,k){return k&&k.Qx?k.Qx[T]||Q:Q},Fdm=function(T){this.L=[];
- this.Gg=this.Hn=this.Bd=this.Ig=this.T=this.vn=this.i9=this.e6=this.C=this.QR=this.D=null;this.Tw=this.u9=0;this.pG=u9("failFast",!1,T);this.Jj=this.z9=this.j=this.B=this.N=null;this.OG=!0;this.F_=this.p_=-1;this.d5=this.qO=this.hj=0;this.nG=u9("baseRetryDelayMs",5E3,T);this.Wk=u9("retryDelaySeedMs",1E4,T);this.uK=u9("forwardChannelMaxRetries",2,T);this.gt=u9("forwardChannelRequestTimeoutMs",2E4,T);this.Ah=T&&T.ecq||void 0;this.vk=T&&T.YEq||void 0;this.YP=T&&T.UTK||!1;this.K_=void 0;this.sK=T&&T.m_j||
- !1;this.Y="";this.S=new OYJ(T&&T.uLm);this.iK=new eYp;this.Tg=T&&T.dAB||!1;this.zg=T&&T.cVd||!1;this.Tg&&this.zg&&(this.zg=!1);this.OW=T&&T.jGd||!1;T&&T.RzK&&(this.OG=!1);this.DP=!this.Tg&&this.OG&&T&&T.f6B||!1;this.t6=void 0;T&&T.Tu&&T.Tu>0&&(this.t6=T.Tu);this.Fk=void 0;this.Z8=0;this.f_=!1;this.h3=this.xm=null},re=function(T){T.T&&(Eqd(T),T.T.cancel(),T.T=null)},ygA=function(T){re(T);
- T.j&&(g.VC.clearTimeout(T.j),T.j=null);b9(T);T.S.cancel();T.B&&(typeof T.B==="number"&&g.VC.clearTimeout(T.B),T.B=null)},Da=function(T){pyW(T.S)||T.B||(T.B=!0,g.Ad(T.Jf,T),T.hj=0)},VGd=function(T,Q){if(u4v(T.S)>=T.S.Y-(T.B?1:0))return!1;
- if(T.B)return T.L=Q.qO.concat(T.L),!0;if(T.i7==1||T.i7==2||T.hj>=(T.pG?0:T.uK))return!1;T.B=za((0,g.Mp)(T.Jf,T,Q),iYm(T,T.hj));T.hj++;return!0},QpA=function(T,Q){var k;
- Q?k=Q.Ig:k=T.u9++;var l=T.Bd.clone();g.Uz(l,"SID",T.Y);g.Uz(l,"RID",k);g.Uz(l,"AID",T.p_);nz(T,l);T.C&&T.D&&g.Gm(l,T.C,T.D);k=new we(T,T.Y,k,T.hj+1);T.C===null&&(k.Bd=T.D);Q&&(T.L=Q.qO.concat(T.L));Q=Tm$(T,k,1E3);k.setTimeout(Math.round(T.gt*.5)+Math.round(T.gt*.5*Math.random()));nqe(T.S,k);Bi$(k,l,Q)},nz=function(T,Q){T.e6&&g.VJ(T.e6,function(k,l){g.Uz(Q,l,k)});
- T.N&&g.VJ({},function(k,l){g.Uz(Q,l,k)})},Tm$=function(T,Q,k){k=Math.min(T.L.length,k);
- var l=T.N?(0,g.Mp)(T.N.Ze,T.N,T):null;a:{for(var v=T.L,L=-1;;){var q=["count="+k];L==-1?k>0?(L=v[0].T,q.push("ofs="+L)):L=0:q.push("ofs="+L);for(var Y=!0,U=0;U<k;U++){var R=v[U].T,Z=v[U].map;R-=L;if(R<0)L=Math.max(0,v[U].T-100),Y=!1;else try{R="req"+R+"_"||"";try{var f=Z instanceof Map?Z:Object.entries(Z);for(var G=g.B(f),m=G.next();!m.done;m=G.next()){var I=g.B(m.value),z=I.next().value,w=I.next().value,r=w;g.vm(w)&&(r=g.pL(w));q.push(R+z+"="+encodeURIComponent(r))}}catch(A){throw q.push(R+"type="+
- encodeURIComponent("_badmap")),A;}}catch(A){l&&l(Z)}}if(Y){f=q.join("&");break a}}f=void 0}T=T.L.splice(0,k);Q.qO=T;return f},Pu_=function(T){T.T||T.j||(T.d5=1,g.Ad(T.lE,T),T.qO=0)},ak$=function(T){if(T.T||T.j||T.qO>=3)return!1;
- T.d5++;T.j=za((0,g.Mp)(T.lE,T),iYm(T,T.qO));T.qO++;return!0},Eqd=function(T){T.xm!=null&&(g.VC.clearTimeout(T.xm),T.xm=null)},jpT=function(T){T.T=new we(T,T.Y,"rpc",T.d5);
- T.C===null&&(T.T.Bd=T.D);T.T.K_=0;var Q=T.Hn.clone();g.Uz(Q,"RID","rpc");g.Uz(Q,"SID",T.Y);g.Uz(Q,"AID",T.p_);g.Uz(Q,"CI",T.Jj?"0":"1");!T.Jj&&T.t6&&g.Uz(Q,"TO",T.t6);g.Uz(Q,"TYPE","xmlhttp");nz(T,Q);T.C&&T.D&&g.Gm(Q,T.C,T.D);T.K_&&T.T.setTimeout(T.K_);var k=T.T;T=T.Gg;k.sK=1;k.j=QL(Q.clone());k.D=null;k.i9=!0;CuA(k,T)},b9=function(T){T.z9!=null&&(g.VC.clearTimeout(T.z9),T.z9=null)},cgd=function(T,Q){var k=null;
- if(T.T==Q){b9(T);Eqd(T);T.T=null;var l=2}else if(D5A(T.S,Q))k=Q.qO,x5$(T.S,Q),l=1;else return;if(T.i7!=0)if(Q.B)if(l==1){k=Q.D?Q.D.length:0;Q=Date.now()-Q.hj;var v=T.hj;l=m5J();l.dispatchEvent(new s1$(l,k,Q,v));Da(T)}else Pu_(T);else{var L=Q.QR;v=Q.getLastError();if(v==3||v==0&&L>0||!(l==1&&VGd(T,Q)||l==2&&ak$(T)))switch(k&&k.length>0&&(Q=T.S,Q.L=Q.L.concat(k)),v){case 1:co(T,5);break;case 4:co(T,10);break;case 3:co(T,6);break;default:co(T,2)}}},iYm=function(T,Q){var k=T.nG+Math.floor(Math.random()*
- T.Wk);
- T.isActive()||(k*=2);return k*Q},co=function(T,Q){if(Q==2){var k=(0,g.Mp)(T.Bwk,T),l=T.vk,v=!l;
- l=new g.lN(l||"//www.google.com/images/cleardot.gif");g.VC.location&&g.VC.location.protocol=="http"||g.oZ(l,"https");QL(l);v?$5$(l.toString(),k):JgA(l.toString(),k)}else Bo(2);T.i7=0;T.N&&T.N.Af(Q);kBd(T);ygA(T)},kBd=function(T){T.i7=0;
- T.h3=[];if(T.N){var Q=WdT(T.S);if(Q.length!=0||T.L.length!=0)g.cm(T.h3,Q),g.cm(T.h3,T.L),T.S.L.length=0,g.r$(T.L),T.L.length=0;T.N.ZD()}},lAW=function(T){if(T.i7==0)return T.h3;
- var Q=[];g.cm(Q,WdT(T.S));g.cm(Q,T.L);return Q},KdE=function(T,Q,k){var l=g.RZ(k);
- l.T!=""?(Q&&g.v0(l,Q+"."+l.T),g.LV(l,l.L)):(l=g.VC.location,l=MSe(l.protocol,Q?Q+"."+l.hostname:l.hostname,+l.port,k));Q=T.i9;k=T.vn;Q&&k&&g.Uz(l,Q,k);g.Uz(l,"VER",T.CE);nz(T,l);return l},zYT=function(T,Q,k){if(Q&&!T.sK)throw Error("Can't create secondary domain capable XhrIo object.");
- Q=T.YP&&!T.Ah?new g.Jd(new g.Tm({yc:k})):new g.Jd(T.Ah);Q.C=T.sK;return Q},on$=function(){},vne=function(){},xU=function(T,Q){g.fL.call(this);
- this.T=new Fdm(Q);this.N=T;this.S=Q&&Q.omH||null;T=Q&&Q.cj9||null;Q&&Q.p5K&&(T?T["X-Client-Protocol"]="webchannel":T={"X-Client-Protocol":"webchannel"});this.T.D=T;T=Q&&Q.I_K||null;Q&&Q.iO&&(T?T["X-WebChannel-Content-Type"]=Q.iO:T={"X-WebChannel-Content-Type":Q.iO});Q&&Q.gB&&(T?T["X-WebChannel-Client-Profile"]=Q.gB:T={"X-WebChannel-Client-Profile":Q.gB});this.T.QR=T;(T=Q&&Q.bSe)&&!g.bB(T)&&(this.T.C=T);this.B=Q&&Q.m_j||!1;this.Y=Q&&Q.uxk||!1;(Q=Q&&Q.qQ)&&!g.bB(Q)&&(this.T.i9=Q,g.MM(this.S,Q)&&(T=
- this.S,Q in T&&delete T[Q]));this.L=new Kz(this)},LpJ=function(T){ZY_.call(this);
- T.__headers__&&(this.headers=T.__headers__,this.statusCode=T.__status__,delete T.__headers__,delete T.__status__);var Q=T.__sm__;Q?this.data=(this.T=g.kZ(Q))?g.ZW(Q,this.T):Q:this.data=T},qY9=function(T){fkA.call(this);
- this.status=1;this.errorCode=T},Kz=function(T){this.T=T},gnm=function(T,Q){this.S=T;
- this.T=Q},Moe=function(T){return lAW(T.T).map(function(Q){var k=T.S;
- Q=Q.map;"__data__"in Q?(Q=Q.__data__,k=k.Y?jUA(Q):Q):k=Q;return k})},Po=function(T,Q){if(typeof T!=="function")throw Error("Fn must not be null and must be a function");
- return g.VC.setTimeout(function(){T()},Q)},th=function(T){Ho.dispatchEvent(new YY$(Ho,T))},YY$=function(T){g.Jz.call(this,"statevent",T)},O1=function(T,Q,k,l){this.T=T;
- this.Y=Q;this.C=k;this.B=l||1;this.S=45E3;this.L=new g.mo(this);this.N=new g.x3;this.N.setInterval(250)},RpA=function(T,Q,k){T.Mi=1;
- T.sR=QL(Q.clone());T.s2=k;T.i9=!0;UhJ(T,null)},ZMJ=function(T,Q,k,l,v){T.Mi=1;
- T.sR=QL(Q.clone());T.s2=null;T.i9=k;v&&(T.UZ=!1);UhJ(T,l)},UhJ=function(T,Q){T.rq=Date.now();
- fAW(T);T.ac=T.sR.clone();jd(T.ac,"t",T.B);T.y9=0;T.j1=T.T.cq(T.T.JQ()?Q:null);T.TL>0&&(T.D5=new g.Vq((0,g.Mp)(T.Iv,T,T.j1),T.TL));T.L.listen(T.j1,"readystatechange",T.jc);Q=T.V$?g.Gs(T.V$):{};T.s2?(T.HK="POST",Q["Content-Type"]="application/x-www-form-urlencoded",T.j1.send(T.ac,T.HK,T.s2,Q)):(T.HK="GET",T.UZ&&!g.Y1&&(Q.Connection="close"),T.j1.send(T.ac,T.HK,null,Q));T.T.TR(1)},IAd=function(T,Q){var k=T.y9,l=Q.indexOf("\n",k);
- if(l==-1)return GBv;k=Number(Q.substring(k,l));if(isNaN(k))return mhA;l+=1;if(l+k>Q.length)return GBv;Q=Q.slice(l,l+k);T.y9=l+k;return Q},fAW=function(T){T.S8=Date.now()+T.S;
- hp9(T,T.S)},hp9=function(T,Q){if(T.Oc!=null)throw Error("WatchDog timer not null");
- T.Oc=Po((0,g.Mp)(T.AE,T),Q)},spA=function(T){T.Oc&&(g.VC.clearTimeout(T.Oc),T.Oc=null)},SYA=function(T){T.T.FG()||T.Ch||T.T.Qn(T)},pz=function(T){spA(T);
- g.od(T.D5);T.D5=null;T.N.stop();T.L.removeAll();if(T.j1){var Q=T.j1;T.j1=null;Q.abort();Q.dispose()}T.w1&&(T.w1=null)},Cnp=function(T,Q){try{T.T.KE(T,Q),T.T.TR(4)}catch(k){}},zpT=function(T,Q,k,l,v){if(l==0)k(!1);
- else{var L=v||0;l--;BmJ(T,Q,function(q){q?k(!0):g.VC.setTimeout(function(){zpT(T,Q,k,l,L)},L)})}},BmJ=function(T,Q,k){var l=new Image;
- l.onload=function(){try{Wo(l),k(!0)}catch(v){}};
- l.onerror=function(){try{Wo(l),k(!1)}catch(v){}};
- l.onabort=function(){try{Wo(l),k(!1)}catch(v){}};
- l.ontimeout=function(){try{Wo(l),k(!1)}catch(v){}};
- g.VC.setTimeout(function(){if(l.ontimeout)l.ontimeout()},Q);
- l.src=T},Wo=function(T){T.onload=null;
- T.onerror=null;T.onabort=null;T.ontimeout=null},XeJ=function(T){this.T=T;
- this.S=new Sd},weA=function(T){var Q=$U(T.T,T.Nq,"/mail/images/cleardot.gif");
- QL(Q);zpT(Q.toString(),5E3,(0,g.Mp)(T.qX,T),3,2E3);T.TR(1)},dhm=function(T){var Q=T.T.B;
- Q!=null?(th(5),Q?(th(11),Jh(T.T,T,!1)):(th(12),Jh(T.T,T,!0))):(T.Bc=new O1(T),T.Bc.V$=T.EJ,Q=T.T,Q=$U(Q,Q.JQ()?T.zJ:null,T.h$),th(5),jd(Q,"TYPE","xmlhttp"),ZMJ(T.Bc,Q,!1,T.zJ,!1))},NmW=function(T,Q,k){this.T=1;
- this.S=[];this.L=[];this.N=new Sd;this.D=T||null;this.B=Q!=null?Q:null;this.j=k||!1},AFm=function(T,Q){this.T=T;
- this.map=Q;this.context=null},bM$=function(T,Q,k,l){g.Jz.call(this,"timingevent",T);
- this.size=Q;this.rtt=k;this.retries=l},rFW=function(T){g.Jz.call(this,"serverreachability",T)},DhW=function(T){T.bb(1,0);
- T.q4=$U(T,null,T.Ff);cFm(T)},aAA=function(T){T.YV&&(T.YV.abort(),T.YV=null);
- T.Rn&&(T.Rn.cancel(),T.Rn=null);T.Yu&&(g.VC.clearTimeout(T.Yu),T.Yu=null);ed(T);T.Zz&&(T.Zz.cancel(),T.Zz=null);T.Mk&&(g.VC.clearTimeout(T.Mk),T.Mk=null)},uYW=function(T,Q){if(T.T==0)throw Error("Invalid operation: sending map when state is closed");
- T.S.push(new AFm(T.Iu++,Q));T.T!=2&&T.T!=3||cFm(T)},nn1=function(T){var Q=0;
- T.Rn&&Q++;T.Zz&&Q++;return Q},cFm=function(T){T.Zz||T.Mk||(T.Mk=Po((0,g.Mp)(T.pE,T),0),T.fR=0)},Pn1=function(T,Q){if(T.T==1){if(!Q){T.AQ=Math.floor(Math.random()*1E5);
- Q=T.AQ++;var k=new O1(T,"",Q);k.V$=T.Fu;var l=KpT(T),v=T.q4.clone();g.Uz(v,"RID",Q);g.Uz(v,"CVER","1");Fm(T,v);RpA(k,v,l);T.Zz=k;T.T=2}}else T.T==3&&(Q?xhv(T,Q):T.S.length==0||T.Zz||xhv(T))},xhv=function(T,Q){if(Q)if(T.C5>6){T.S=T.L.concat(T.S);
- T.L.length=0;var k=T.AQ-1;Q=KpT(T)}else k=Q.C,Q=Q.s2;else k=T.AQ++,Q=KpT(T);var l=T.q4.clone();g.Uz(l,"SID",T.Y);g.Uz(l,"RID",k);g.Uz(l,"AID",T.DA);Fm(T,l);k=new O1(T,T.Y,k,T.fR+1);k.V$=T.Fu;k.setTimeout(1E4+Math.round(1E4*Math.random()));T.Zz=k;RpA(k,l,Q)},Fm=function(T,Q){T.x_&&(T=T.x_.v_())&&g.VJ(T,function(k,l){g.Uz(Q,l,k)})},KpT=function(T){var Q=Math.min(T.S.length,1E3),k=["count="+Q];
- if(T.C5>6&&Q>0){var l=T.S[0].T;k.push("ofs="+l)}else l=0;for(var v={},L=0;L<Q;v={NW:void 0},L++){v.NW=T.S[L].T;var q=T.S[L].map;v.NW=T.C5<=6?L:v.NW-l;try{g.VJ(q,function(Y){return function(U,R){k.push("req"+Y.NW+"_"+R+"="+encodeURIComponent(U))}}(v))}catch(Y){k.push("req"+v.NW+"_type="+encodeURIComponent("_badmap"))}}T.L=T.L.concat(T.S.splice(0,Q));
- return k.join("&")},HMW=function(T){T.Rn||T.Yu||(T.C=1,T.Yu=Po((0,g.Mp)(T.nE,T),0),T.vt=0)},OMJ=function(T){if(T.Rn||T.Yu||T.vt>=3)return!1;
- T.C++;T.Yu=Po((0,g.Mp)(T.nE,T),tom(T,T.vt));T.vt++;return!0},Jh=function(T,Q,k){T.bM=T.B==null?k:!T.B;
- T.sx=Q.F3;T.j||DhW(T)},ed=function(T){T.lR!=null&&(g.VC.clearTimeout(T.lR),T.lR=null)},tom=function(T,Q){var k=5E3+Math.floor(Math.random()*1E4);
- T.isActive()||(k*=2);return k*Q},E1=function(T,Q){if(Q==2||Q==9){var k=null;
- T.x_&&(k=null);var l=(0,g.Mp)(T.Roe,T);k||(k=new g.lN("//www.google.com/images/cleardot.gif"),QL(k));BmJ(k.toString(),1E4,l)}else th(2);peA(T,Q)},peA=function(T,Q){T.T=0;
- T.x_&&T.x_.uE(Q);WpW(T);aAA(T)},WpW=function(T){T.T=0;
- T.sx=-1;if(T.x_)if(T.L.length==0&&T.S.length==0)T.x_.Yi();else{var Q=g.r$(T.L),k=g.r$(T.S);T.L.length=0;T.S.length=0;T.x_.Yi(Q,k)}},$U=function(T,Q,k){var l=g.RZ(k);
- if(l.T!="")Q&&g.v0(l,Q+"."+l.T),g.LV(l,l.L);else{var v=window.location;l=MSe(v.protocol,Q?Q+"."+v.hostname:v.hostname,+v.port,k)}T.ZM&&g.VJ(T.ZM,function(L,q){g.Uz(l,q,L)});
- g.Uz(l,"VER",T.C5);Fm(T,l);return l},$hd=function(){},JFm=function(){this.T=[];
- this.S=[]},epm=function(T){g.Jz.call(this,"channelMessage");
- this.message=T},Fpd=function(T){g.Jz.call(this,"channelError");
- this.error=T},EnE=function(T,Q){this.action=T;
- this.params=Q||{}},yL=function(T,Q){g.x.call(this);
- this.T=new g.FA(this.oMB,0,this);g.P(this,this.T);this.d8=5E3;this.S=0;if(typeof T==="function")Q&&(T=(0,g.Mp)(T,Q));else if(T&&typeof T.handleEvent==="function")T=(0,g.Mp)(T.handleEvent,T);else throw Error("Invalid listener argument");this.L=T},yFm=function(T,Q,k,l,v,L,q,Y,U,R,Z,f,G,m){k=k===void 0?!1:k;
- l=l===void 0?function(){return""}:l;
- v=v===void 0?!1:v;L=L===void 0?!1:L;q=q===void 0?!1:q;Y=Y===void 0?function(){return g.DT({})}:Y;
- U=U===void 0?!1:U;Z=Z===void 0?!1:Z;f=f===void 0?!1:f;G=G===void 0?!1:G;m=m===void 0?!1:m;this.sK=T;this.z9=Q;this.B=new g.XE;this.S=new yL(this.wk_,this);this.T=null;this.C=!1;this.D=null;this.hj="";this.qO=this.j=0;this.L=[];this.d5=k;this.i9=l;this.N=L;this.Bd=Y;this.e6=R;this.Gg=q;this.xm=null;this.Y=g.DT();this.Ig=v;this.h3=U;this.Tg=Z;this.zg=f;this.OG=G;this.QR=m;this.K_=new kOp;this.Jj=new lqW;this.f_=new v5p;this.u9=new o5A;this.p_=new L6e;this.DP=new qGA;this.Fk=new g5d},T7v=function(T,
- Q,k,l,v){iMW(T);
- if(T.T){var L=g.$i("ID_TOKEN"),q=T.T.Fu||{};L?q["x-youtube-identity-token"]=L:delete q["x-youtube-identity-token"];T.T.Fu=q}Vo9(T);l?(l.getState()!=3&&nn1(l)==0||l.getState(),T.T.connect(Q,k,T.z9,l.Y,l.DA)):v?T.T.connect(Q,k,T.z9,v.sessionId,v.arrayId):T.T.connect(Q,k,T.z9)},l2J=function(T,Q){return T.OG?!0:T.zg?Object.values(QKW).includes(Q):T.Tg?!Object.values(jK1).includes(Q):T.QR?Object.values(kP$).includes(Q):!1},L4m=function(T){var Q,k;
- g.a(function(l){if(l.S==1)return g.Xg(l,2),g.c(l,or$(T),2);g.aI(l);Q=T.L;T.L=[];k=Q.length;vr9(T,Q,k);i9(T);return g.n5(l,0)})},vr9=function(T,Q,k){for(var l=0;l<k;++l)uYW(T.T,Q[l]);
- i9(T)},i9=function(T){T.publish("handlerOpened");
- T.K_.ML("BROWSER_CHANNEL")},iMW=function(T){if(T.T){var Q=T.i9(),k=T.T.Fu||{};
- Q?k["x-youtube-lounge-xsrf-token"]=Q:delete k["x-youtube-lounge-xsrf-token"];T.T.Fu=k}},or$=function(T){if(T.h3)return g.DT();
- if(!T.Gg)return qSA(T);T.xm===null&&(T.xm=qSA(T));return T.xm},qSA=function(T){return g.nL(T.Bd().then(function(Q){gr_(T,Q)}).kE(function(){}),function(){T.xm=null})},gr_=function(T,Q){if(T.T){var k=T.T.Fu||{};
- Q&&Object.keys(Q).length>0?k=Object.assign({},k,Q):delete k.Authorization;T.T.Fu=k}},Vo9=function(T){T.e6&&!T.N&&gr_(T,T.e6())},VL=function(T){this.scheme="https";
- this.port=this.domain="";this.T="/api/lounge";this.S=!0;T=T||document.location.href;var Q=Number(g.UD(T)[4]||null)||"";Q&&(this.port=":"+Q);this.domain=g.Rq(T)||"";T=g.KJ();T.search("MSIE")>=0&&(T=T.match(/MSIE ([\d.]+)/)[1],g.nJ(T,"10.0")<0&&(this.S=!1))},TM=function(T,Q){var k=T.T;
- T.S&&(k=T.scheme+"://"+T.domain+T.port+T.T);return g.sD(k+Q,{})},MzT=function(T,Q){g.fL.call(this);
- var k=this;this.Qp=T();this.Qp.subscribe("handlerOpened",this.Gy,this);this.Qp.subscribe("handlerClosed",this.onClosed,this);this.Qp.subscribe("handlerError",function(l,v){k.onError(v)});
- this.Qp.subscribe("handlerMessage",this.onMessage,this);this.T=Q},YSv=function(T,Q,k){var l=this;
- k=k===void 0?function(){return""}:k;
- var v=v===void 0?new vne:v;var L=L===void 0?new g.XE:L;this.pathPrefix=T;this.T=Q;this.hj=k;this.N=L;this.j=null;this.D=this.C=0;this.channel=null;this.B=0;this.L=new yL(function(){l.L.isActive();var q;((q=l.channel)==null?void 0:u4v((new gnm(q,q.T)).T.S))===0&&l.connect(l.j,l.C)});
- this.Y={};this.S={};this.z9=!1;this.logger=null;this.qO=[];this.W1=void 0;this.Bd=new kOp;this.xm=new lqW;this.e6=new o5A;this.i9=new L6e},UUv=function(T){g.Qu(T.channel,"m",function(){T.B=3;
- T.L.reset();T.j=null;T.C=0;for(var Q=g.B(T.qO),k=Q.next();!k.done;k=Q.next())k=k.value,T.channel&&T.channel.send(k);T.qO=[];T.publish("webChannelOpened");T.Bd.ML("WEB_CHANNEL")});
- g.Qu(T.channel,"n",function(){T.B=0;T.L.isActive()||T.publish("webChannelClosed");var Q,k=(Q=T.channel)==null?void 0:Moe(new gnm(Q,Q.T));k&&(T.qO=[].concat(g.ZH(k)));T.xm.ML("WEB_CHANNEL")});
- g.Qu(T.channel,"p",function(Q){var k=Q.data;k[0]==="gracefulReconnect"?(T.L.start(),T.channel&&T.channel.close()):T.publish("webChannelMessage",new EnE(k[0],k[1]));T.W1=Q.statusCode;T.e6.ML("WEB_CHANNEL")});
- g.Qu(T.channel,"o",function(){T.W1===401||T.L.start();T.publish("webChannelError");T.i9.ML("WEB_CHANNEL","")})},RA9=function(T){var Q=T.hj();
- Q?T.Y["x-youtube-lounge-xsrf-token"]=Q:delete T.Y["x-youtube-lounge-xsrf-token"]},Zjd=function(T){g.fL.call(this);
- this.T=T();this.T.subscribe("webChannelOpened",this.PE,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},f2J=function(T,Q,k,l,v){function L(){return new yFm(TM(T,"/bc"),Q,!1,k,l)}
- k=k===void 0?function(){return""}:k;
- return g.hH("enable_mdx_web_channel_desktop")?new Zjd(function(){return new YSv(TM(T,"/wc"),Q,k)}):new MzT(L,v)},hAp=function(){var T=GPe;
- mUA();QF.push(T);I2m()},jR=function(T,Q){mUA();
- var k=sKT(T,String(Q));QF.length==0?SSd(k):(I2m(),g.EA(QF,function(l){l(k)}))},ko=function(T){jR("CP",T)},mUA=function(){QF||(QF=g.jA("yt.mdx.remote.debug.handlers_")||[],g.Tv("yt.mdx.remote.debug.handlers_",QF))},SSd=function(T){var Q=(lR+1)%50;
- lR=Q;oe[Q]=T;vF||(vF=Q==49)},I2m=function(){var T=QF;
- if(oe[0]){var Q=vF?lR:-1,k={};do k={D7:void 0},Q=(Q+1)%50,k.D7=oe[Q],g.EA(T,function(l){return function(v){v(l.D7)}}(k));
- while(Q!=lR);oe=Array(50);lR=-1;vF=!1}},sKT=function(T,Q){var k=(Date.now()-CMW)/1E3;
- k.toFixed&&(k=k.toFixed(3));var l=[];l.push("[",k+"s","] ");l.push("[","yt.mdx.remote","] ");l.push(T+": "+Q,"\n");return l.join("")},LK=function(T){g.ox.call(this);
- this.B=T;this.screens=[]},B7v=function(T,Q){var k=T.get(Q.uuid)||T.get(Q.id);
- if(k)return T=k.name,k.id=Q.id||k.id,k.name=Q.name,k.token=Q.token,k.uuid=Q.uuid||k.uuid,k.name!=T;T.screens.push(Q);return!0},zAE=function(T,Q){var k=T.screens.length!=Q.length;
- T.screens=g.bl(T.screens,function(L){return!!Oh$(Q,L)});
- for(var l=Q.length,v=0;v<l;v++)k=B7v(T,Q[v])||k;return k},XlA=function(T,Q){var k=T.screens.length;
- T.screens=g.bl(T.screens,function(l){return!(l||Q?!l!=!Q?0:l.id==Q.id:1)});
- return T.screens.length<k},wle=function(T,Q,k,l,v){g.ox.call(this);
- this.L=T;this.C=Q;this.Y=k;this.B=l;this.N=v;this.S=0;this.T=null;this.D8=NaN},gZ=function(T){LK.call(this,"LocalScreenService");
- this.S=T;this.T=NaN;qG(this);this.info("Initializing with "+PCE(this.screens))},dU$=function(T){if(T.screens.length){var Q=g.IQ(T.screens,function(l){return l.id}),k=TM(T.S,"/pairing/get_lounge_token_batch");
- T.S.sendRequest("POST",k,{screen_ids:Q.join(",")},(0,g.Mp)(T.wX,T),(0,g.Mp)(T.VJ,T))}},qG=function(T){if(g.hH("deprecate_pair_servlet_enabled"))return zAE(T,[]);
- var Q=x2A(E5A());Q=g.bl(Q,function(k){return!k.uuid});
- return zAE(T,Q)},MG=function(T,Q){ih_(g.IQ(T.screens,IqJ));
- Q&&yH$()},AxA=function(T,Q){g.ox.call(this);
- this.B=Q;Q=(Q=g.cy("yt-remote-online-screen-ids")||"")?Q.split(","):[];for(var k={},l=this.B(),v=l.length,L=0;L<v;++L){var q=l[L].id;k[q]=g.CW(Q,q)}this.T=k;this.N=T;this.L=this.Y=NaN;this.S=null;N79("Initialized with "+g.pL(this.T))},bj$=function(T,Q,k){var l=TM(T.N,"/pairing/get_screen_availability");
- T.N.sendRequest("POST",l,{lounge_token:Q.token},(0,g.Mp)(function(v){v=v.screens||[];for(var L=v.length,q=0;q<L;++q)if(v[q].loungeToken==Q.token){k(v[q].status=="online");return}k(!1)},T),(0,g.Mp)(function(){k(!1)},T))},cxe=function(T,Q){a:if(TVd(Q)!=TVd(T.T))var k=!1;
- else{k=g.gz(Q);for(var l=k.length,v=0;v<l;++v)if(!T.T[k[v]]){k=!1;break a}k=!0}k||(N79("Updated online screens: "+g.pL(T.T)),T.T=Q,T.publish("screenChange"));rxE(T)},Yo=function(T){isNaN(T.L)||g.GO(T.L);
- T.L=g.Zq((0,g.Mp)(T.Q7,T),T.Y>0&&T.Y<g.R_()?2E4:1E4)},N79=function(T){jR("OnlineScreenService",T)},DUT=function(T){var Q={};
- g.EA(T.B(),function(k){k.token?Q[k.token]=k.id:this.ww("Requesting availability of screen w/o lounge token.")});
- return Q},rxE=function(T){T=g.gz(g.Ts(T.T,function(Q){return Q}));
- g.JT(T);T.length?g.ri("yt-remote-online-screen-ids",T.join(","),60):g.Dk("yt-remote-online-screen-ids")},Ub=function(T,Q){Q=Q===void 0?!1:Q;
- LK.call(this,"ScreenService");this.Y=T;this.C=Q;this.T=this.S=null;this.L=[];this.N={};a2E(this)},nr_=function(T,Q,k,l,v,L){T.info("getAutomaticScreenByIds "+k+" / "+Q);
- k||(k=T.N[Q]);var q=T.b5(),Y=k?U1(q,k):null;k&&(T.C||Y)||(Y=U1(q,Q));if(Y){Y.uuid=Q;var U=Re(T,Y);bj$(T.T,U,function(R){v(R?U:null)})}else k?uhd(T,k,(0,g.Mp)(function(R){var Z=Re(this,new ge({name:l,
- screenId:k,loungeToken:R,dialId:Q||""}));bj$(this.T,Z,function(f){v(f?Z:null)})},T),L):v(null)},K4T=function(T,Q){for(var k=T.screens.length,l=0;l<k;++l)if(T.screens[l].name==Q)return T.screens[l];
- return null},xUJ=function(T,Q,k){bj$(T.T,Q,k)},uhd=function(T,Q,k,l){T.info("requestLoungeToken_ for "+Q);
- var v={postParams:{screen_ids:Q},method:"POST",context:T,onSuccess:function(L,q){L=q&&q.screens||[];L[0]&&L[0].screenId==Q?k(L[0].loungeToken):l(Error("Missing lounge token in token response"))},
- onError:function(){l(Error("Request screen lounge token failed"))}};
- g.zO(TM(T.Y,"/pairing/get_lounge_token_batch"),v)},PMJ=function(T){T.screens=T.S.b5();
- var Q=T.N,k={},l;for(l in Q)k[Q[l]]=l;Q=T.screens.length;for(l=0;l<Q;++l){var v=T.screens[l];v.uuid=k[v.id]||""}T.info("Updated manual screens: "+PCE(T.screens))},a2E=function(T){HjT(T);
- T.S=new gZ(T.Y);T.S.subscribe("screenChange",(0,g.Mp)(T.I1,T));PMJ(T);T.C||(T.L=x2A(g.cy("yt-remote-automatic-screen-cache")||[]));HjT(T);T.info("Initializing automatic screens: "+PCE(T.L));T.T=new AxA(T.Y,(0,g.Mp)(T.b5,T,!0));T.T.subscribe("screenChange",(0,g.Mp)(function(){this.publish("onlineScreenChange")},T))},Re=function(T,Q){var k=T.get(Q.id);
- k?(k.uuid=Q.uuid,Q=k):((k=U1(T.L,Q.uuid))?(k.id=Q.id,k.token=Q.token,Q=k):T.L.push(Q),T.C||tzW(T));HjT(T);T.N[Q.uuid]=Q.id;g.ri("yt-remote-device-id-map",T.N,31536E3);return Q},tzW=function(T){T=g.bl(T.L,function(Q){return Q.idType!="shortLived"});
- g.ri("yt-remote-automatic-screen-cache",g.IQ(T,IqJ))},HjT=function(T){T.N=g.cy("yt-remote-device-id-map")||{}},Zu=function(T,Q,k){g.ox.call(this);
- this.i9=k;this.Y=T;this.S=Q;this.T=null},fK=function(T,Q){T.T=Q;
- T.publish("sessionScreen",T.T)},OjT=function(T,Q){T.T&&(T.T.token=Q,Re(T.Y,T.T));
- T.publish("sessionScreen",T.T)},GM=function(T,Q){jR(T.i9,Q)},mg=function(T,Q,k){Zu.call(this,T,Q,"CastSession");
- var l=this;this.config_=k;this.L=null;this.qO=(0,g.Mp)(this.WE,this);this.xm=(0,g.Mp)(this.UFB,this);this.z9=g.Zq(function(){plp(l,null)},12E4);
- this.C=this.N=this.B=this.j=0;this.hj=!1;this.D="unknown"},$Ue=function(T,Q){g.GO(T.C);
- T.C=0;Q==0?W4A(T):T.C=g.Zq(function(){W4A(T)},Q)},W4A=function(T){Jxv(T,"getLoungeToken");
- g.GO(T.N);T.N=g.Zq(function(){eAm(T,null)},3E4)},Jxv=function(T,Q){T.info("sendYoutubeMessage_: "+Q+" "+g.pL());
- var k={};k.type=Q;T.L?T.L.sendMessage("urn:x-cast:com.google.youtube.mdx",k,function(){},(0,g.Mp)(function(){GM(this,"Failed to send message: "+Q+".")},T)):GM(T,"Sending yt message without session: "+g.pL(k))},F4v=function(T,Q){Q?(T.info("onConnectedScreenId_: Received screenId: "+Q),T.T&&T.T.id==Q||T.wU(Q,function(k){fK(T,k)},function(){return T.q1()},5)):T.q1(Error("Waiting for session status timed out."))},yxd=function(T,Q,k){T.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(Q));
- var l=new ge(Q);ErT(T,l,function(v){v?(T.hj=!0,Re(T.Y,l),fK(T,l),T.D="unknown",$Ue(T,k)):(g.FH(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(Q)+" is not online.")),T.q1())},5)},plp=function(T,Q){g.GO(T.z9);
- T.z9=0;Q?T.config_.enableCastLoungeToken&&Q.loungeToken?Q.deviceId?T.T&&T.T.uuid==Q.deviceId||(Q.loungeTokenRefreshIntervalMs?yxd(T,{name:T.S.friendlyName,screenId:Q.screenId,loungeToken:Q.loungeToken,dialId:Q.deviceId,screenIdType:"shortLived"},Q.loungeTokenRefreshIntervalMs):(g.FH(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(Q)+".")),F4v(T,Q.screenId))):(g.FH(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(Q)+".")),F4v(T,Q.screenId)):
- F4v(T,Q.screenId):T.q1(Error("Waiting for session status timed out."))},eAm=function(T,Q){g.GO(T.N);
- T.N=0;var k=null;if(Q)if(Q.loungeToken){var l;((l=T.T)==null?void 0:l.token)==Q.loungeToken&&(k="staleLoungeToken")}else k="missingLoungeToken";else k="noLoungeTokenResponse";k?(T.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(Q)+", error: "+k)),T.D=k,$Ue(T,3E4)):(OjT(T,Q.loungeToken),T.hj=!1,T.D="unknown",$Ue(T,Q.loungeTokenRefreshIntervalMs))},ErT=function(T,Q,k,l){g.GO(T.B);
- T.B=0;xUJ(T.Y,Q,function(v){v||l<0?k(v):T.B=g.Zq(function(){ErT(T,Q,k,l-1)},300)})},ij_=function(T){g.GO(T.j);
- T.j=0;g.GO(T.B);T.B=0;g.GO(T.z9);T.z9=0;g.GO(T.N);T.N=0;g.GO(T.C);T.C=0},Ie=function(T,Q,k,l){Zu.call(this,T,Q,"DialSession");
- this.config_=l;this.L=this.j=null;this.xm="";this.sK=k;this.Bd=null;this.z9=function(){};
- this.D=NaN;this.e6=(0,g.Mp)(this.Ow,this);this.N=function(){};
- this.C=this.B=0;this.qO=!1;this.hj="unknown"},hR=function(T){var Q;
- return!!(T.config_.enableDialLoungeToken&&((Q=T.L)==null?0:Q.getDialAppInfo))},Vz9=function(T){T.N=T.Y.DD(T.xm,T.S.label,T.S.friendlyName,hR(T),function(Q,k){T.N=function(){};
- T.qO=!0;fK(T,Q);Q.idType=="shortLived"&&k>0&&sb(T,k)},function(Q){T.N=function(){};
- T.q1(Q)})},T1m=function(T){var Q={};
- Q.pairingCode=T.xm;Q.theme=T.sK;TiE()&&(Q.env_useStageMdx=1);return g.h3(Q)},Q$E=function(T){return new Promise(function(Q){T.xm=HhA();
- if(T.Bd){var k=new chrome.cast.DialLaunchResponse(!0,T1m(T));Q(k);Vz9(T)}else T.z9=function(){g.GO(T.D);T.z9=function(){};
- T.D=NaN;var l=new chrome.cast.DialLaunchResponse(!0,T1m(T));Q(l);Vz9(T)},T.D=g.Zq(function(){T.z9()},100)})},kA$=function(T,Q,k){T.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(Q));
- var l=new ge(Q);return(new Promise(function(v){j$W(T,l,function(L){L?(T.qO=!0,Re(T.Y,l),fK(T,l),sb(T,k)):g.FH(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(Q)+" is not online."));v(L)},5)})).then(function(v){return v?new chrome.cast.DialLaunchResponse(!1):Q$E(T)})},lZT=function(T,Q){var k=T.j.receiver.label,l=T.S.friendlyName;
- return(new Promise(function(v){nr_(T.Y,k,Q,l,function(L){L&&L.token&&fK(T,L);v(L)},function(L){GM(T,"Failed to get DIAL screen: "+L);
- v(null)})})).then(function(v){return v&&v.token?new chrome.cast.DialLaunchResponse(!1):Q$E(T)})},j$W=function(T,Q,k,l){g.GO(T.B);
- T.B=0;xUJ(T.Y,Q,function(v){v||l<0?k(v):T.B=g.Zq(function(){j$W(T,Q,k,l-1)},300)})},sb=function(T,Q){T.info("getDialAppInfoWithTimeout_ "+Q);
- hR(T)&&(g.GO(T.C),T.C=0,Q==0?o_d(T):T.C=g.Zq(function(){o_d(T)},Q))},o_d=function(T){hR(T)&&T.L.getDialAppInfo(function(Q){T.info("getDialAppInfo dialLaunchData: "+JSON.stringify(Q));
- Q=Q.extraData||{};var k=null;if(Q.loungeToken){var l;((l=T.T)==null?void 0:l.token)==Q.loungeToken&&(k="staleLoungeToken")}else k="missingLoungeToken";k?(T.hj=k,sb(T,3E4)):(T.qO=!1,T.hj="unknown",OjT(T,Q.loungeToken),sb(T,Q.loungeTokenRefreshIntervalMs))},function(Q){T.info("getDialAppInfo error: "+Q);
- T.hj="noLoungeTokenResponse";sb(T,3E4)})},v_1=function(T){g.GO(T.B);
- T.B=0;g.GO(T.C);T.C=0;T.N();T.N=function(){};
- g.GO(T.D)},SR=function(T,Q){Zu.call(this,T,Q,"ManualSession");
- this.L=g.Zq((0,g.Mp)(this.Zl,this,null),150)},CK=function(T,Q){g.ox.call(this);
- this.config_=Q;this.S=T;this.j=Q.appId||"233637DE";this.Y=Q.theme||"cl";this.D=Q.disableCastApi||!1;this.B=Q.forceMirroring||!1;this.T=null;this.C=!1;this.L=[];this.N=(0,g.Mp)(this.Nnj,this)},LbA=function(T,Q){return Q?g.sA(T.L,function(k){return Mb(Q,k.label)},T):null},BF=function(T){jR("Controller",T)},GPe=function(T){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(T)},zM=function(T){return T.C||!!T.L.length||!!T.T},XF=function(T,Q,k){Q!=T.T&&(g.od(T.T),(T.T=Q)?(k?T.publish("yt-remote-cast2-receiver-resumed",
- Q.S):T.publish("yt-remote-cast2-receiver-selected",Q.S),Q.subscribe("sessionScreen",(0,g.Mp)(T.k8,T,Q)),Q.subscribe("sessionFailed",function(){return qqm(T,Q)}),Q.T?T.publish("yt-remote-cast2-session-change",Q.T):k&&T.T.Zl(null)):T.publish("yt-remote-cast2-session-change",null))},qqm=function(T,Q){T.T==Q&&T.publish("yt-remote-cast2-session-failed")},g_d=function(T){var Q=T.S.fE(),k=T.T&&T.T.S;
- T=g.IQ(Q,function(l){k&&Mb(l,k.label)&&(k=null);var v=l.uuid?l.uuid:l.id,L=LbA(this,l);L?(L.label=v,L.friendlyName=l.name):(L=new chrome.cast.Receiver(v,l.name),L.receiverType=chrome.cast.ReceiverType.CUSTOM);return L},T);
- k&&(k.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(k=new chrome.cast.Receiver(k.label,k.friendlyName),k.receiverType=chrome.cast.ReceiverType.CUSTOM),T.push(k));return T},mEA=function(T,Q,k,l){l.disableCastApi?wZ("Cannot initialize because disabled by Mdx config."):MVd()?YqJ(Q,l)&&(UEA(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?RZd(T,k):(window.__onGCastApiAvailable=function(v,L){v?RZd(T,k):(dZ("Failed to load cast API: "+L),ZZ$(!1),UEA(!1),g.Dk("yt-remote-cast-available"),g.Dk("yt-remote-cast-receiver"),
- fZv(),k(!1))},l.loadCastApiSetupScript?g.LZ(GA9):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?j1T()>=60&&Yr$():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?vqW():j1T()>=89?RYA():(MG9(),hh(U5m.map(LdW))))):wZ("Cannot initialize because not running Chrome")},fZv=function(){wZ("dispose");
- var T=NG();T&&T.dispose();g.Tv("yt.mdx.remote.cloudview.instance_",null);IZv(!1);g.o$(hZ$);hZ$.length=0},AR=function(){return!!g.cy("yt-remote-cast-installed")},s$E=function(){var T=g.cy("yt-remote-cast-receiver");
- return T?T.friendlyName:null},Sqe=function(){wZ("clearCurrentReceiver");
- g.Dk("yt-remote-cast-receiver")},CvW=function(){return AR()?NG()?NG().getCastSession():(dZ("getCastSelector: Cast is not initialized."),null):(dZ("getCastSelector: Cast API is not installed!"),null)},B1E=function(){AR()?NG()?bR()?(wZ("Requesting cast selector."),NG().requestSession()):(wZ("Wait for cast API to be ready to request the session."),hZ$.push(g.TA("yt-remote-cast2-api-ready",B1E))):dZ("requestCastSelector: Cast is not initialized."):dZ("requestCastSelector: Cast API is not installed!")},
- rZ=function(T,Q){bR()?NG().setConnectedScreenStatus(T,Q):dZ("setConnectedScreenStatus called before ready.")},MVd=function(){var T=g.KJ().search(/ (CrMo|Chrome|CriOS)\//)>=0;
- return g.hW||T},zZJ=function(T,Q){NG().init(T,Q)},YqJ=function(T,Q){var k=!1;
- NG()||(T=new CK(T,Q),T.subscribe("yt-remote-cast2-availability-change",function(l){g.ri("yt-remote-cast-available",l);mi("yt-remote-cast2-availability-change",l)}),T.subscribe("yt-remote-cast2-receiver-selected",function(l){wZ("onReceiverSelected: "+l.friendlyName);
- g.ri("yt-remote-cast-receiver",l);mi("yt-remote-cast2-receiver-selected",l)}),T.subscribe("yt-remote-cast2-receiver-resumed",function(l){wZ("onReceiverResumed: "+l.friendlyName);
- g.ri("yt-remote-cast-receiver",l);mi("yt-remote-cast2-receiver-resumed",l)}),T.subscribe("yt-remote-cast2-session-change",function(l){wZ("onSessionChange: "+YU(l));
- l||g.Dk("yt-remote-cast-receiver");mi("yt-remote-cast2-session-change",l)}),g.Tv("yt.mdx.remote.cloudview.instance_",T),k=!0);
- wZ("cloudview.createSingleton_: "+k);return k},NG=function(){return g.jA("yt.mdx.remote.cloudview.instance_")},RZd=function(T,Q){ZZ$(!0);
- UEA(!1);zZJ(T,function(k){k?(IZv(!0),g.vd("yt-remote-cast2-api-ready")):(dZ("Failed to initialize cast API."),ZZ$(!1),g.Dk("yt-remote-cast-available"),g.Dk("yt-remote-cast-receiver"),fZv());Q(k)})},wZ=function(T){jR("cloudview",T)},dZ=function(T){jR("cloudview",T)},ZZ$=function(T){wZ("setCastInstalled_ "+T);
- g.ri("yt-remote-cast-installed",T)},bR=function(){return!!g.jA("yt.mdx.remote.cloudview.apiReady_")},IZv=function(T){wZ("setApiReady_ "+T);
- g.Tv("yt.mdx.remote.cloudview.apiReady_",T)},UEA=function(T){g.Tv("yt.mdx.remote.cloudview.initializing_",T)},cF=function(T){this.index=-1;
- this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.N=this.B=0;this.trackData=null;this.G0=this.E_=!1;this.j=this.L=this.C=this.S=0;this.T=NaN;this.Y=!1;this.reset(T)},XdE=function(T){T.audioTrackId=null;
- T.trackData=null;T.playerState=-1;T.E_=!1;T.G0=!1;T.B=0;T.N=g.R_();T.S=0;T.C=0;T.L=0;T.j=0;T.T=NaN;T.Y=!1},Du=function(T){return T.isPlaying()?(g.R_()-T.N)/1E3:0},ae=function(T,Q){T.B=Q;
- T.N=g.R_()},uR=function(T){switch(T.playerState){case 1:case 1081:return(g.R_()-T.N)/1E3+T.B;
- case -1E3:return 0}return T.B},wd1=function(T){return T.Y?T.C+Du(T):T.C},nK=function(T,Q,k){var l=T.videoId;
- T.videoId=Q;T.index=k;Q!=l&&XdE(T)},dEE=function(T){var Q={};
- Q.index=T.index;Q.listId=T.listId;Q.videoId=T.videoId;Q.playerState=T.playerState;Q.volume=T.volume;Q.muted=T.muted;Q.audioTrackId=T.audioTrackId;Q.trackData=g.my(T.trackData);Q.hasPrevious=T.E_;Q.hasNext=T.G0;Q.playerTime=T.B;Q.playerTimeAt=T.N;Q.seekableStart=T.S;Q.seekableEnd=T.C;Q.duration=T.L;Q.loadedTime=T.j;Q.liveIngestionTime=T.T;return Q},xo=function(T,Q){g.ox.call(this);
- var k=this;this.L=0;this.Y=T;this.B=[];this.N=new JFm;this.S=this.T=null;this.D=(0,g.Mp)(this.Kek,this);this.C=(0,g.Mp)(this.pO,this);this.j=(0,g.Mp)(this.IVK,this);this.z9=(0,g.Mp)(this.P96,this);var l=0;T?(l=T.getProxyState(),l!=3&&(T.subscribe("proxyStateChange",this.PW,this),N1v(this))):l=3;l!=0&&(Q?this.PW(l):g.Zq(function(){k.PW(l)},0));
- (T=CvW())&&KK(this,T);this.subscribe("yt-remote-cast2-session-change",this.z9)},PF=function(T){return new cF(T.Y.getPlayerContextData())},N1v=function(T){g.EA("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(Q){this.B.push(this.Y.subscribe(Q,g.YE(this.U2O,Q),this))},T)},Au9=function(T){g.EA(T.B,function(Q){this.Y.unsubscribeByKey(Q)},T);
- T.B.length=0},HF=function(T){return T.getState()==1},tR=function(T,Q){var k=T.N;
- k.T.length+k.S.length<50&&T.N.enqueue(Q)},bZA=function(T,Q,k){var l=PF(T);
- ae(l,k);l.playerState!=-1E3&&(l.playerState=Q);Ob(T,l)},pK=function(T,Q,k){T.Y.sendMessage(Q,k)},Ob=function(T,Q){Au9(T);
- T.Y.setPlayerContextData(dEE(Q));N1v(T)},KK=function(T,Q){T.S&&(T.S.removeUpdateListener(T.D),T.S.removeMediaListener(T.C),T.pO(null));
- T.S=Q;T.S&&(ko("Setting cast session: "+T.S.sessionId),T.S.addUpdateListener(T.D),T.S.addMediaListener(T.C),T.S.media.length&&T.pO(T.S.media[0]))},rup=function(T){var Q=T.T.media,k=T.T.customData;
- if(Q&&k){var l=PF(T);Q.contentId!=l.videoId&&ko("Cast changing video to: "+Q.contentId);l.videoId=Q.contentId;l.playerState=k.playerState;ae(l,T.T.getEstimatedTime());Ob(T,l)}else ko("No cast media video. Ignoring state update.")},WF=function(T,Q,k){return(0,g.Mp)(function(l){this.ww("Failed to "+Q+" with cast v2 channel. Error code: "+l.code);
- l.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.ww("Retrying "+Q+" using MDx browser channel."),pK(this,Q,k))},T)},eR=function(T,Q,k,l){l=l===void 0?!1:l;
- g.ox.call(this);var v=this;this.B=NaN;this.xm=!1;this.D=this.j=this.qO=this.hj=NaN;this.z9=[];this.N=this.C=this.Y=this.T=this.S=null;this.Bd=T;this.e6=l;this.z9.push(g.SG(window,"beforeunload",function(){v.Cw(2)}));
- this.L=[];this.T=new cF;this.sK=Q.id;this.i9=Q.idType;this.S=f2J(this.Bd,k,this.zn,this.i9=="shortLived",this.sK);this.S.listen("channelOpened",function(){cuW(v)});
- this.S.listen("channelClosed",function(){$o("Channel closed");isNaN(v.B)?fz(!0):fz();v.dispose()});
- this.S.listen("channelError",function(L){fz();isNaN(v.CP())?(L==1&&v.i9=="shortLived"&&v.publish("browserChannelAuthError",L),$o("Channel error: "+L+" without reconnection"),v.dispose()):(v.xm=!0,$o("Channel error: "+L+" with reconnection in "+v.CP()+" ms"),JR(v,2))});
- this.S.listen("channelMessage",function(L){DEW(v,L)});
- this.S.Ca(Q.token);this.subscribe("remoteQueueChange",function(){var L=v.T.videoId;g.a1()&&g.ri("yt-remote-session-video-id",L)})},aZW=function(T){return g.sA(T.L,function(Q){return Q.type=="LOUNGE_SCREEN"})},$o=function(T){jR("conn",T)},JR=function(T,Q){T.publish("proxyStateChange",Q)},urJ=function(T){T.B=g.Zq(function(){$o("Connecting timeout");
- T.Cw(1)},2E4)},n_J=function(T){g.GO(T.B);
- T.B=NaN},KbA=function(T){g.GO(T.hj);
- T.hj=NaN},Pve=function(T){xEA(T);
- T.qO=g.Zq(function(){FF(T,"getNowPlaying")},2E4)},xEA=function(T){g.GO(T.qO);
- T.qO=NaN},cuW=function(T){$o("Channel opened");
- T.xm&&(T.xm=!1,KbA(T),T.hj=g.Zq(function(){$o("Timing out waiting for a screen.");T.Cw(1)},15E3))},tVe=function(T,Q){var k=null;
- if(Q){var l=aZW(T);l&&(k={clientName:l.clientName,deviceMake:l.brand,deviceModel:l.model,osVersion:l.osVersion})}g.Tv("yt.mdx.remote.remoteClient_",k);Q&&(n_J(T),KbA(T));k=T.S.zM()&&isNaN(T.B);Q==k?Q&&(JR(T,1),FF(T,"getSubtitlesTrack")):Q?(T.X6()&&T.T.reset(),JR(T,1),FF(T,"getNowPlaying"),HZd(T)):T.Cw(1)},OZJ=function(T,Q){var k=Q.params.videoId;
- delete Q.params.videoId;k==T.T.videoId&&(g.Rs(Q.params)?T.T.trackData=null:T.T.trackData=Q.params,T.publish("remotePlayerChange"))},pdA=function(T,Q,k){var l=Q.params.videoId||Q.params.video_id,v=parseInt(Q.params.currentIndex,10);
- T.T.listId=Q.params.listId||T.T.listId;nK(T.T,l,v);T.publish("remoteQueueChange",k)},$EW=function(T,Q){Q.params=Q.params||{};
- pdA(T,Q,"NOW_PLAYING_MAY_CHANGE");Wbe(T,Q);T.publish("autoplayDismissed")},Wbe=function(T,Q){var k=parseInt(Q.params.currentTime||Q.params.current_time,10);
- ae(T.T,isNaN(k)?0:k);k=parseInt(Q.params.state,10);k=isNaN(k)?-1:k;k==-1&&T.T.playerState==-1E3&&(k=-1E3);T.T.playerState=k;k=Number(Q.params.loadedTime);T.T.j=isNaN(k)?0:k;T.T.SR(Number(Q.params.duration));k=T.T;var l=Number(Q.params.liveIngestionTime);k.T=l;k.Y=isNaN(l)?!1:!0;k=T.T;l=Number(Q.params.seekableStartTime);Q=Number(Q.params.seekableEndTime);k.S=isNaN(l)?0:l;k.C=isNaN(Q)?0:Q;T.T.playerState==1?Pve(T):xEA(T);T.publish("remotePlayerChange")},JuW=function(T,Q){if(T.T.playerState!=-1E3){var k=
- 1085;
- switch(parseInt(Q.params.adState,10)){case 1:k=1081;break;case 2:k=1084;break;case 0:k=1083}T.T.playerState=k;Q=parseInt(Q.params.currentTime,10);ae(T.T,isNaN(Q)?0:Q);T.publish("remotePlayerChange")}},eZW=function(T,Q){var k=Q.params.muted=="true";
- T.T.volume=parseInt(Q.params.volume,10);T.T.muted=k;T.publish("remotePlayerChange")},Fbv=function(T,Q){T.C=Q.params.videoId;
- T.publish("nowAutoplaying",parseInt(Q.params.timeout,10))},E_A=function(T,Q){T.C=Q.params.videoId||null;
- T.publish("autoplayUpNext",T.C)},yuT=function(T,Q){T.N=Q.params.autoplayMode;
- T.publish("autoplayModeChange",T.N);T.N=="DISABLED"&&T.publish("autoplayDismissed")},iZW=function(T,Q){var k=Q.params.hasNext=="true";
- T.T.E_=Q.params.hasPrevious=="true";T.T.G0=k;T.publish("previousNextChange")},DEW=function(T,Q){Q=Q.message;
- Q.params?$o("Received: action="+Q.action+", params="+g.pL(Q.params)):$o("Received: action="+Q.action+" {}");switch(Q.action){case "loungeStatus":Q=kU(Q.params.devices);T.L=g.IQ(Q,function(l){return new qb(l)});
- Q=!!g.sA(T.L,function(l){return l.type=="LOUNGE_SCREEN"});
- tVe(T,Q);Q=T.Nj("mlm");T.publish("multiStateLoopEnabled",Q);break;case "loungeScreenDisconnected":g.AT(T.L,function(l){return l.type=="LOUNGE_SCREEN"});
- tVe(T,!1);break;case "remoteConnected":var k=new qb(kU(Q.params.device));g.sA(T.L,function(l){return l.equals(k)})||VmW(T.L,k);
- break;case "remoteDisconnected":k=new qb(kU(Q.params.device));g.AT(T.L,function(l){return l.equals(k)});
- break;case "gracefulDisconnect":break;case "playlistModified":pdA(T,Q,"QUEUE_MODIFIED");break;case "nowPlaying":$EW(T,Q);break;case "onStateChange":Wbe(T,Q);break;case "onAdStateChange":JuW(T,Q);break;case "onVolumeChanged":eZW(T,Q);break;case "onSubtitlesTrackChanged":OZJ(T,Q);break;case "nowAutoplaying":Fbv(T,Q);break;case "autoplayDismissed":T.publish("autoplayDismissed");break;case "autoplayUpNext":E_A(T,Q);break;case "onAutoplayModeChanged":yuT(T,Q);break;case "onHasPreviousNextChanged":iZW(T,
- Q);break;case "requestAssistedSignIn":T.publish("assistedSignInRequested",Q.params.authCode);break;case "onLoopModeChanged":T.publish("loopModeChange",Q.params.loopMode);break;default:$o("Unrecognized action: "+Q.action)}},HZd=function(T){g.GO(T.D);
- T.D=g.Zq(function(){T.Cw(1)},864E5)},FF=function(T,Q,k){k?$o("Sending: action="+Q+", params="+g.pL(k)):$o("Sending: action="+Q);
- T.S.sendMessage(Q,k)},VVd=function(T){LK.call(this,"ScreenServiceProxy");
- this.Zf=T;this.T=[];this.T.push(this.Zf.$_s("screenChange",(0,g.Mp)(this.au,this)));this.T.push(this.Zf.$_s("onlineScreenChange",(0,g.Mp)(this.sgK,this)))},lh$=function(T,Q){VSd();
- if(!Ga||!Ga.get("yt-remote-disable-remote-module-for-dev")){Q=g.$i("MDX_CONFIG")||Q;pDJ();eIW();Eb||(Eb=new VL(Q?Q.loungeApiHost:void 0),TiE()&&(Eb.T="/api/loungedev"));yF||(yF=g.jA("yt.mdx.remote.deferredProxies_")||[],g.Tv("yt.mdx.remote.deferredProxies_",yF));TBW();var k=iR();if(!k){var l=new Ub(Eb,Q?Q.disableAutomaticScreenCache||!1:!1);g.Tv("yt.mdx.remote.screenService_",l);k=iR();var v={};Q&&(v={appId:Q.appId,disableDial:Q.disableDial,theme:Q.theme,loadCastApiSetupScript:Q.loadCastApiSetupScript,
- disableCastApi:Q.disableCastApi,enableDialLoungeToken:Q.enableDialLoungeToken,enableCastLoungeToken:Q.enableCastLoungeToken,forceMirroring:Q.forceMirroring});g.Tv("yt.mdx.remote.enableConnectWithInitialState_",Q?Q.enableConnectWithInitialState||!1:!1);mEA(T,l,function(L){L?VF()&&rZ(VF(),"YouTube TV"):l.subscribe("onlineScreenChange",function(){mi("yt-remote-receiver-availability-change")})},v)}Q&&!g.jA("yt.mdx.remote.initialized_")&&(g.Tv("yt.mdx.remote.initialized_",!0),Ti("Initializing: "+g.pL(Q)),
- Qy.push(g.TA("yt-remote-cast2-api-ready",function(){mi("yt-remote-api-ready")})),Qy.push(g.TA("yt-remote-cast2-availability-change",function(){mi("yt-remote-receiver-availability-change")})),Qy.push(g.TA("yt-remote-cast2-receiver-selected",function(){j9(null);
- mi("yt-remote-auto-connect","cast-selector-receiver")})),Qy.push(g.TA("yt-remote-cast2-receiver-resumed",function(){mi("yt-remote-receiver-resumed","cast-selector-receiver")})),Qy.push(g.TA("yt-remote-cast2-session-change",QP9)),Qy.push(g.TA("yt-remote-connection-change",function(L){L?rZ(VF(),"YouTube TV"):kz()||(rZ(null,null),Sqe())})),Qy.push(g.TA("yt-remote-cast2-session-failed",function(){mi("yt-remote-connection-failed")})),T=jP_(),Q.isAuto&&(T.id+="#dial"),v=Q.capabilities||[],v.length>0&&(T.capabilities=
- v),T.name=Q.device,T.app=Q.app,(Q=Q.theme)&&(T.theme=Q),Ti(" -- with channel params: "+g.pL(T)),T?(g.ri("yt-remote-session-app",T.app),g.ri("yt-remote-session-name",T.name)):(g.Dk("yt-remote-session-app"),g.Dk("yt-remote-session-name")),g.Tv("yt.mdx.remote.channelParams_",T),k.start(),VF()||k$v())}},ouE=function(){var T=iR().Zf.$_gos();
- var Q=l6();Q&&ok()&&(Oh$(T,Q)||T.push(Q));return tSE(T)},LAm=function(){var T=vue();
- !T&&AR()&&s$E()&&(T={key:"cast-selector-receiver",name:s$E()});return T},vue=function(){var T=ouE(),Q=l6();
- Q||(Q=kz());return g.sA(T,function(k){return Q&&Mb(Q,k.key)?!0:!1})},l6=function(){var T=VF();
- if(!T)return null;var Q=iR().b5();return U1(Q,T)},QP9=function(T){Ti("remote.onCastSessionChange_: "+YU(T));
- if(T){var Q=l6();if(Q&&Q.id==T.id){if(rZ(Q.id,"YouTube TV"),T.idType=="shortLived"&&(T=T.token))vY&&(vY.token=T),(Q=ok())&&Q.Ca(T)}else Q&&L4(),qk(T,1)}else ok()&&L4()},L4=function(){bR()?NG().stopSession():dZ("stopSession called before API ready.");
- var T=ok();T&&(T.disconnect(1),q2_(null))},gu_=function(){var T=ok();
- return!!T&&T.getProxyState()!=3},Ti=function(T){jR("remote",T)},iR=function(){if(!MTW){var T=g.jA("yt.mdx.remote.screenService_");
- MTW=T?new VVd(T):null}return MTW},VF=function(){return g.jA("yt.mdx.remote.currentScreenId_")},Y29=function(T){g.Tv("yt.mdx.remote.currentScreenId_",T)},U8m=function(){return g.jA("yt.mdx.remote.connectData_")},j9=function(T){g.Tv("yt.mdx.remote.connectData_",T)},ok=function(){return g.jA("yt.mdx.remote.connection_")},q2_=function(T){var Q=ok();
- j9(null);T||Y29("");g.Tv("yt.mdx.remote.connection_",T);yF&&(g.EA(yF,function(k){k(T)}),yF.length=0);
- Q&&!T?mi("yt-remote-connection-change",!1):!Q&&T&&mi("yt-remote-connection-change",!0)},kz=function(){var T=g.a1();
- if(!T)return null;var Q=iR();if(!Q)return null;Q=Q.b5();return U1(Q,T)},qk=function(T,Q){VF();
- l6()&&l6();if(gP)vY=T;else{Y29(T.id);var k=g.jA("yt.mdx.remote.enableConnectWithInitialState_")||!1;T=new eR(Eb,T,jP_(),k);T.connect(Q,U8m());T.subscribe("beforeDisconnect",function(l){mi("yt-remote-before-disconnect",l)});
- T.subscribe("beforeDispose",function(){ok()&&(ok(),q2_(null))});
- T.subscribe("browserChannelAuthError",function(){var l=l6();l&&l.idType=="shortLived"&&(bR()?NG().handleBrowserChannelAuthError():dZ("refreshLoungeToken called before API ready."))});
- q2_(T)}},k$v=function(){var T=kz();
- T?(Ti("Resume connection to: "+YU(T)),qk(T,0)):(fz(),Sqe(),Ti("Skipping connecting because no session screen found."))},TBW=function(){var T=jP_();
- if(g.Rs(T)){T=Za();var Q=g.cy("yt-remote-session-name")||"",k=g.cy("yt-remote-session-app")||"";T={device:"REMOTE_CONTROL",id:T,name:Q,app:k,mdxVersion:3};T.authuser=String(g.$i("SESSION_INDEX","0"));(Q=g.$i("DELEGATED_SESSION_ID"))&&(T.pageId=String(Q));g.Tv("yt.mdx.remote.channelParams_",T)}},jP_=function(){return g.jA("yt.mdx.remote.channelParams_")||{}},fhm=function(T,Q,k){g.x.call(this);
- var l=this;this.T=T;this.U=Q;this.SV=k;this.events=new g.Bj(this);this.N=!1;this.B=new g.Cd(64);this.S=new g.FA(this.Wu,500,this);this.L=new g.FA(this.OZ,1E3,this);this.j=new s1(this.Oi9,0,this);this.Y={};this.D=new g.FA(this.zd,1E3,this);this.C=new g.Vq(this.seekTo,1E3,this);this.z9=this.events.Z(this.U,"onVolumeChange",function(v){RUT(l,v)});
- g.P(this,this.events);this.events.Z(Q,"onCaptionsTrackListChanged",this.YGm);this.events.Z(Q,"captionschanged",this.jkB);this.events.Z(Q,"captionssettingschanged",this.SW);this.events.Z(Q,"videoplayerreset",this.Hi);this.events.Z(Q,"mdxautoplaycancel",function(){l.SV.lQ()});
- Q.V("enable_mdx_video_play_directly")&&this.events.Z(Q,"videodatachange",function(){Z99(l.T)||Mk(l)||Yz(l,0)});
- T=this.SV;T.wd();T.subscribe("proxyStateChange",this.E9,this);T.subscribe("remotePlayerChange",this.vQ,this);T.subscribe("remoteQueueChange",this.Hi,this);T.subscribe("previousNextChange",this.TN,this);T.subscribe("nowAutoplaying",this.Ml,this);T.subscribe("autoplayDismissed",this.At,this);g.P(this,this.S);g.P(this,this.L);g.P(this,this.j);g.P(this,this.D);g.P(this,this.C);this.SW();this.Hi();this.vQ()},RUT=function(T,Q){if(Mk(T)){T.SV.unsubscribe("remotePlayerChange",T.vQ,T);
- var k=Math.round(Q.volume);Q=!!Q.muted;var l=PF(T.SV);if(k!==l.volume||Q!==l.muted)T.SV.setVolume(k,Q),T.D.start();T.SV.subscribe("remotePlayerChange",T.vQ,T)}},G$J=function(T){T.bC(0);
- T.S.stop();T.LA(new g.Cd(64))},m8W=function(T,Q){if(Mk(T)&&!T.N){var k=null;
- Q&&(k={style:T.U.getSubtitlesUserSettings()},Object.assign(k,Q));T.SV.yk(T.U.getVideoData(1).videoId,k);T.Y=PF(T.SV).trackData}},Yz=function(T,Q){var k=T.U.getPlaylist();
- if(k==null?0:k.listId){var l=k.index;var v=k.listId.toString()}k=T.U.getVideoData(1);T.SV.playVideo(k.videoId,Q,l,v,k.playerParams,k.Bd,iep(k));T.LA(new g.Cd(1))},Ih9=function(T,Q){if(Q){var k=T.U.getOption("captions","tracklist",{hR:1});
- k&&k.length?(T.U.setOption("captions","track",Q),T.N=!1):(T.U.loadModule("captions"),T.N=!0)}else T.U.setOption("captions","track",{})},Mk=function(T){return PF(T.SV).videoId===T.U.getVideoData(1).videoId},hUp=function(T,Q){g.yg.call(this,T);
- this.T=Q},UK=function(){g.p.call(this,{X:"div",
- J:"ytp-mdx-popup-dialog",K:{role:"dialog"},W:[{X:"div",J:"ytp-mdx-popup-dialog-inner-content",W:[{X:"div",J:"ytp-mdx-popup-title",S6:"\u4f60\u5df2\u9000\u51fa\u8d26\u53f7"},{X:"div",J:"ytp-mdx-popup-description",S6:"\u4f60\u89c2\u770b\u7684\u89c6\u9891\u53ef\u80fd\u4f1a\u6dfb\u52a0\u5230\u7535\u89c6\u7684\u89c2\u770b\u8bb0\u5f55\u4e2d\uff0c\u5e76\u5f71\u54cd\u7535\u89c6\u4e0a\u7684\u63a8\u8350\u5185\u5bb9\u3002\u4e3a\u907f\u514d\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\uff0c\u8bf7\u53d6\u6d88\u5e76\u5728\u8ba1\u7b97\u673a\u4e0a\u767b\u5f55 YouTube\u3002"},
- {X:"div",J:"ytp-mdx-privacy-popup-buttons",W:[{X:"button",Rk:["ytp-button","ytp-mdx-privacy-popup-cancel"],S6:"\u53d6\u6d88"},{X:"button",Rk:["ytp-button","ytp-mdx-privacy-popup-confirm"],S6:"\u786e\u8ba4"}]}]}]});this.fade=new g.TZ(this,250);this.cancelButton=this.L_("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.L_("ytp-mdx-privacy-popup-confirm");g.P(this,this.fade);this.Z(this.cancelButton,"click",this.T);this.Z(this.confirmButton,"click",this.S)},Rk=function(T){g.p.call(this,{X:"div",
- J:"ytp-remote",W:[{X:"div",J:"ytp-remote-display-status",W:[{X:"div",J:"ytp-remote-display-status-icon",W:[g.ZYI()]},{X:"div",J:"ytp-remote-display-status-text",S6:"{{statustext}}"}]}]});this.api=T;this.fade=new g.TZ(this,250);g.P(this,this.fade);this.Z(T,"presentingplayerstatechange",this.onStateChange);this.OH(T.getPlayerStateObject())},Z$=function(T,Q){g.Hp.call(this,"\u64ad\u653e\u8bbe\u5907",1,T,Q);
- this.U=T;this.IQ={};this.Z(T,"onMdxReceiversChange",this.Y);this.Z(T,"presentingplayerstatechange",this.Y);this.Y()},sPE=function(T){g.A4.call(this,T);
- this.BA={key:HhA(),name:"\u6b64\u8ba1\u7b97\u673a"};this.UU=null;this.subscriptions=[];this.uZ=this.SV=null;this.IQ=[this.BA];this.iW=this.BA;this.yU=new g.Cd(64);this.AR=0;this.I2=-1;this.kA=!1;this.GP=this.LV=this.FV=null;if(!g.q0(this.player.G())&&!g.uP(this.player.G())){T=this.player;var Q=g.aa(T);Q&&(Q=Q.K$())&&(Q=new Z$(T,Q),g.P(this,Q));Q=new Rk(T);g.P(this,Q);g.TQ(T,Q.element,4);this.FV=new UK;g.P(this,this.FV);g.TQ(T,this.FV.element,4);this.kA=!!kz()}},f4=function(T){T.LV&&(T.player.removeEventListener("presentingplayerstatechange",
- T.LV),T.LV=null)},S2v=function(T,Q,k){T.yU=k;
- T.player.publish("presentingplayerstatechange",new g.YX(k,Q))},Gi=function(T,Q){if(Q.key!==T.iW.key)if(Q.key===T.BA.key)L4();
- else if(Z99(T)&&CAv(T),T.iW=Q,!T.player.G().V("disable_mdx_connection_in_mdx_module_for_music_web")||!g.uP(T.player.G())){var k=T.player.getPlaylistId();var l=T.player.getVideoData(1);var v=l.videoId;if(!k&&!v||(T.player.getAppState()===2||T.player.getAppState()===1)&&T.player.G().V("should_clear_video_data_on_player_cued_unstarted"))l=null;else{var L=T.player.getPlaylist();if(L){var q=[];for(var Y=0;Y<L.length;Y++)q[Y]=g.wN(L,Y).videoId}else q=[v];L=T.player.getCurrentTime(1);T={videoIds:q,listId:k,
- videoId:v,playerParams:l.playerParams,clickTrackingParams:l.Bd,index:Math.max(T.player.getPlaylistIndex(),0),currentTime:L===0?void 0:L};(l=iep(l))&&(T.locationInfo=l);l=T}Ti("Connecting to: "+g.pL(Q));Q.key=="cast-selector-receiver"?(j9(l||null),Q=l||null,bR()?NG().setLaunchParams(Q):dZ("setLaunchParams called before ready.")):!l&&gu_()&&VF()==Q.key?mi("yt-remote-connection-change",!0):(L4(),j9(l||null),l=iR().b5(),(Q=U1(l,Q.key))&&qk(Q,1))}},Z99=function(T){var Q=T.player.G();
- return!Q.V("mdx_enable_privacy_disclosure_ui")||T.isLoggedIn()||T.kA||!T.FV?!1:g.Cn(Q)||g.XT(Q)},CAv=function(T){T.player.getPlayerStateObject().isPlaying()?T.player.pauseVideo():(T.LV=function(Q){!T.kA&&g.RY(Q,8)&&(T.player.pauseVideo(),f4(T))},T.player.addEventListener("presentingplayerstatechange",T.LV));
- T.FV&&T.FV.fA();ok()||(gP=!0)};
- g.Wi.prototype.JO=g.ly(49,function(){this.app.vG().JO()});
- g.j5.prototype.JO=g.ly(48,function(){this.GP=null});
- g.Wi.prototype.zU=g.ly(47,function(T){this.app.vG().zU(T)});
- g.j5.prototype.zU=g.ly(46,function(T){this.GP=T});
- kOp.prototype.ML=function(T){this.T.m7("/client_streamz/youtube/living_room/mdx/channel/opened",T)};
- lqW.prototype.ML=function(T){this.T.m7("/client_streamz/youtube/living_room/mdx/channel/closed",T)};
- o5A.prototype.ML=function(T){this.T.m7("/client_streamz/youtube/living_room/mdx/channel/message_received",T)};
- v5p.prototype.ML=function(){this.T.m7("/client_streamz/youtube/living_room/mdx/channel/success")};
- L6e.prototype.ML=function(T,Q){this.T.m7("/client_streamz/youtube/living_room/mdx/channel/error",T,Q)};
- qGA.prototype.ML=function(){this.T.m7("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")};
- g5d.prototype.ML=function(){this.T.m7("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")};
- g.h=vo.prototype;g.h.b0=function(){Lz(this);for(var T=[],Q=0;Q<this.T.length;Q++)T.push(this.S[this.T[Q]]);return T};
- g.h.zG=function(){Lz(this);return this.T.concat()};
- g.h.has=function(T){return o7(this.S,T)};
- g.h.equals=function(T,Q){if(this===T)return!0;if(this.size!=T.size)return!1;Q=Q||U2p;Lz(this);for(var k,l=0;k=this.T[l];l++)if(!Q(this.get(k),T.get(k)))return!1;return!0};
- g.h.isEmpty=function(){return this.size==0};
- g.h.clear=function(){this.S={};this.iR=this.size=this.T.length=0};
- g.h.remove=function(T){return this.delete(T)};
- g.h.delete=function(T){return o7(this.S,T)?(delete this.S[T],--this.size,this.iR++,this.T.length>2*this.size&&Lz(this),!0):!1};
- g.h.get=function(T,Q){return o7(this.S,T)?this.S[T]:Q};
- g.h.set=function(T,Q){o7(this.S,T)||(this.size+=1,this.T.push(T),this.iR++);this.S[T]=Q};
- g.h.forEach=function(T,Q){for(var k=this.zG(),l=0;l<k.length;l++){var v=k[l],L=this.get(v);T.call(Q,L,v,this)}};
- g.h.clone=function(){return new vo(this)};
- g.h.keys=function(){return g.hJ(this.Xu(!0)).T()};
- g.h.values=function(){return g.hJ(this.Xu(!1)).T()};
- g.h.entries=function(){var T=this;return YGE(this.keys(),function(Q){return[Q,T.get(Q)]})};
- g.h.Xu=function(T){Lz(this);var Q=0,k=this.iR,l=this,v=new g.Xy;v.next=function(){if(k!=l.iR)throw Error("The map has changed since the iterator was created");if(Q>=l.T.length)return g.R6;var L=l.T[Q++];return g.wR(T?L:l.S[L])};
- return v};
- var GOv={xVj:"atp",fd9:"ska",YUq:"que",wck:"mus",Ovq:"sus",gEK:"dsp",rHj:"seq",ipd:"mic",mNd:"dpa",NJj:"mlm",FxV:"dsdtr",As6:"ntb",jxe:"vsp",C89:"scn",ivV:"rpe",QDe:"dcn",hMO:"dcp",Dmk:"pas",ksO:"drq",G0q:"opf",sDj:"els",eMd:"isg",bvq:"svq",VOd:"mvp",xKV:"ads",gzH:"stcp",GW9:"sads",LxO:"dloc",dNB:"dcw",UK9:"asw",XTm:"apw"},m2p={Z76:"u",Ko6:"cl",vEB:"k",XgB:"i",zMm:"cr",eU6:"m",uJd:"g",wG:"up"},QKW={UB:"adPlaying",F$:"onAdStateChange"},jK1={bpH:"nowPlaying",nh6:"onStateChange",UB:"adPlaying",F$:"onAdStateChange",
- hZ:"nowPlayingShorts",Y1:"onShortsStateChange"},kP$={hZ:"nowPlayingShorts",Y1:"onShortsStateChange"};qb.prototype.equals=function(T){return T?this.id==T.id:!1};
- var JH$="",Ga=null;g.S(Q1A,g.KN);var I7,gqm=kL_("loadCastFramework")||kL_("loadCastApplicationFramework"),U5m=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.fW(s1,g.x);g.h=s1.prototype;g.h.Ns=function(T){this.Y=arguments;this.T=!1;this.D8?this.L=g.R_()+this.d8:this.D8=g.P4(this.N,this.d8)};
- g.h.stop=function(){this.D8&&(g.VC.clearTimeout(this.D8),this.D8=null);this.L=null;this.T=!1;this.Y=[]};
- g.h.pause=function(){++this.S};
- g.h.resume=function(){this.S&&(--this.S,!this.S&&this.T&&(this.T=!1,this.B.apply(null,this.Y)))};
- g.h.EK=function(){this.stop();s1.Ye.EK.call(this)};
- g.h.VI=function(){this.D8&&(g.VC.clearTimeout(this.D8),this.D8=null);this.L?(this.D8=g.P4(this.N,this.L-g.R_()),this.L=null):this.S?this.T=!0:(this.T=!1,this.B.apply(null,this.Y))};Sd.prototype.stringify=function(T){return g.VC.JSON.stringify(T,void 0)};
- Sd.prototype.parse=function(T){return g.VC.JSON.parse(T,void 0)};g.fW(ZY_,g.Jz);g.fW(fkA,g.Jz);var GLW=null;g.fW(IkE,g.Jz);g.fW(hYm,g.Jz);g.fW(s1$,g.Jz);Xm.prototype.debug=function(){};
- Xm.prototype.info=function(){};
- Xm.prototype.warning=function(){};var Ni9={},d5A={};g.h=we.prototype;g.h.setTimeout=function(T){this.f_=T};
- g.h.CD=function(T){T=T.target;var Q=this.p_;Q&&g.EJ(T)==3?Q.SF():this.sV(T)};
- g.h.sV=function(T){try{if(T==this.T)a:{var Q=g.EJ(this.T),k=this.T.S,l=this.T.getStatus();if(!(Q<3)&&(Q!=3||this.T&&(this.S.L||g.io(this.T)||g.Vu(this.T)))){this.e6||Q!=4||k==7||(k==8||l<=0?Cz(3):Cz(2));rgA(this);var v=this.T.getStatus();this.QR=v;var L=wyd(this);if(this.B=v==200){if(this.h3&&!this.Jj){b:{if(this.T){var q=g.Tc(this.T,"X-HTTP-Initial-Response");if(q&&!g.bB(q)){var Y=q;break b}}Y=null}if(T=Y)this.Jj=!0,HYW(this,T);else{this.B=!1;this.N=3;Bo(12);Nb(this);Ah(this);break a}}if(this.i9){T=
- !0;for(var U;!this.e6&&this.C<L.length;)if(U=Ag_(this,L),U==d5A){Q==4&&(this.N=4,Bo(14),T=!1);break}else if(U==Ni9){this.N=4;Bo(15);T=!1;break}else HYW(this,U);XyA(this)&&this.C!=0&&(this.S.T=this.S.T.slice(this.C),this.C=0);Q!=4||L.length!=0||this.S.L||(this.N=1,Bo(16),T=!1);this.B=this.B&&T;T?L.length>0&&!this.d5&&(this.d5=!0,this.L.MJ(this)):(Nb(this),Ah(this))}else HYW(this,L);Q==4&&Nb(this);this.B&&!this.e6&&(Q==4?cgd(this.L,this):(this.B=!1,de(this)))}else g.SBb(this.T),v==400&&L.indexOf("Unknown SID")>
- 0?(this.N=3,Bo(12)):(this.N=0,Bo(13)),Nb(this),Ah(this)}}}catch(R){}finally{}};
- g.h.cancel=function(){this.e6=!0;Nb(this)};
- g.h.wu=function(){this.z9=null;var T=Date.now();T-this.zg>=0?(this.sK!=2&&(Cz(3),Bo(17)),Nb(this),this.N=2,Ah(this)):bY$(this,this.zg-T)};
- g.h.getLastError=function(){return this.N};
- g.h.kO=function(){return this.T};OYJ.prototype.cancel=function(){this.L=WdT(this);if(this.S)this.S.cancel(),this.S=null;else if(this.T&&this.T.size!==0){for(var T=g.B(this.T.values()),Q=T.next();!Q.done;Q=T.next())Q.value.cancel();this.T.clear()}};g.h=Fdm.prototype;g.h.CE=8;g.h.i7=1;g.h.connect=function(T,Q,k,l){Bo(0);this.Ig=T;this.e6=Q||{};k&&l!==void 0&&(this.e6.OSID=k,this.e6.OAID=l);this.Jj=this.OG;this.Bd=KdE(this,null,this.Ig);Da(this)};
- g.h.disconnect=function(){ygA(this);if(this.i7==3){var T=this.u9++,Q=this.Bd.clone();g.Uz(Q,"SID",this.Y);g.Uz(Q,"RID",T);g.Uz(Q,"TYPE","terminate");nz(this,Q);T=new we(this,this.Y,T);T.sK=2;T.j=QL(Q.clone());Q=!1;if(g.VC.navigator&&g.VC.navigator.sendBeacon)try{Q=g.VC.navigator.sendBeacon(T.j.toString(),"")}catch(k){}!Q&&g.VC.Image&&((new Image).src=T.j,Q=!0);Q||(T.T=zYT(T.L,null),T.T.send(T.j));T.hj=Date.now();de(T)}kBd(this)};
- g.h.FG=function(){return this.i7==0};
- g.h.getState=function(){return this.i7};
- g.h.Jf=function(T){if(this.B)if(this.B=null,this.i7==1){if(!T){this.u9=Math.floor(Math.random()*1E5);T=this.u9++;var Q=new we(this,"",T),k=this.D;this.QR&&(k?(k=g.Gs(k),g.Is(k,this.QR)):k=this.QR);this.C!==null||this.zg||(Q.Bd=k,k=null);var l;if(this.Tg)a:{for(var v=l=0;v<this.L.length;v++){b:{var L=this.L[v];if("__data__"in L.map&&(L=L.map.__data__,typeof L==="string")){L=L.length;break b}L=void 0}if(L===void 0)break;l+=L;if(l>4096){l=v;break a}if(l===4096||v===this.L.length-1){l=v+1;break a}}l=
- 1E3}else l=1E3;l=Tm$(this,Q,l);v=this.Bd.clone();g.Uz(v,"RID",T);g.Uz(v,"CVER",22);this.i9&&g.Uz(v,"X-HTTP-Session-Id",this.i9);nz(this,v);k&&(this.zg?l="headers="+g.Nn(g.pH6(k))+"&"+l:this.C&&g.Gm(v,this.C,k));nqe(this.S,Q);this.OW&&g.Uz(v,"TYPE","init");this.Tg?(g.Uz(v,"$req",l),g.Uz(v,"SID","null"),Q.h3=!0,Bi$(Q,v,null)):Bi$(Q,v,l);this.i7=2}}else this.i7==3&&(T?QpA(this,T):this.L.length==0||pyW(this.S)||QpA(this))};
- g.h.lE=function(){this.j=null;jpT(this);if(this.DP&&!(this.f_||this.T==null||this.Z8<=0)){var T=4*this.Z8;this.xm=za((0,g.Mp)(this.AjH,this),T)}};
- g.h.AjH=function(){this.xm&&(this.xm=null,this.Jj=!1,this.f_=!0,Bo(10),re(this),jpT(this))};
- g.h.MJ=function(T){this.T==T&&this.DP&&!this.f_&&(Eqd(this),this.f_=!0,Bo(11))};
- g.h.JE=function(){this.z9!=null&&(this.z9=null,re(this),ak$(this),Bo(19))};
- g.h.Bwk=function(T){T?Bo(2):Bo(1)};
- g.h.isActive=function(){return!!this.N&&this.N.isActive(this)};
- g.h=on$.prototype;g.h.bE=function(){};
- g.h.jJ=function(){};
- g.h.Af=function(){};
- g.h.ZD=function(){};
- g.h.isActive=function(){return!0};
- g.h.Ze=function(){};g.fW(xU,g.fL);xU.prototype.open=function(){this.T.N=this.L;this.B&&(this.T.sK=!0);this.T.connect(this.N,this.S||void 0)};
- xU.prototype.close=function(){this.T.disconnect()};
- xU.prototype.send=function(T){var Q=this.T;if(typeof T==="string"){var k={};k.__data__=T;T=k}else this.Y&&(k={},k.__data__=g.pL(T),T=k);Q.L.push(new tGW(Q.Tw++,T));Q.i7==3&&Da(Q)};
- xU.prototype.EK=function(){this.T.N=null;delete this.L;this.T.disconnect();delete this.T;xU.Ye.EK.call(this)};
- g.fW(LpJ,ZY_);g.fW(qY9,fkA);g.fW(Kz,on$);Kz.prototype.bE=function(){this.T.dispatchEvent("m")};
- Kz.prototype.jJ=function(T){this.T.dispatchEvent(new LpJ(T))};
- Kz.prototype.Af=function(T){this.T.dispatchEvent(new qY9(T))};
- Kz.prototype.ZD=function(){this.T.dispatchEvent("n")};var Ho=new g.fL;g.S(YY$,g.Jz);g.h=O1.prototype;g.h.V$=null;g.h.D0=!1;g.h.Oc=null;g.h.S8=null;g.h.rq=null;g.h.Mi=null;g.h.sR=null;g.h.ac=null;g.h.s2=null;g.h.j1=null;g.h.y9=0;g.h.w1=null;g.h.HK=null;g.h.wQ=null;g.h.lL=-1;g.h.UZ=!0;g.h.Ch=!1;g.h.TL=0;g.h.D5=null;var mhA={},GBv={};g.h=O1.prototype;g.h.setTimeout=function(T){this.S=T};
- g.h.jc=function(T){T=T.target;var Q=this.D5;Q&&g.EJ(T)==3?Q.SF():this.Iv(T)};
- g.h.Iv=function(T){try{if(T==this.j1)a:{var Q=g.EJ(this.j1),k=this.j1.S,l=this.j1.getStatus();if(g.Y1&&!g.HX("420+")){if(Q<4)break a}else if(Q<3||Q==3&&!g.io(this.j1))break a;this.Ch||Q!=4||k==7||(k==8||l<=0?this.T.TR(3):this.T.TR(2));spA(this);var v=this.j1.getStatus();this.lL=v;var L=g.io(this.j1);if(this.D0=v==200){Q==4&&pz(this);if(this.i9){for(T=!0;!this.Ch&&this.y9<L.length;){var q=IAd(this,L);if(q==GBv){Q==4&&(this.wQ=4,th(15),T=!1);break}else if(q==mhA){this.wQ=4;th(16);T=!1;break}else Cnp(this,
- q)}Q==4&&L.length==0&&(this.wQ=1,th(17),T=!1);this.D0=this.D0&&T;T||(pz(this),SYA(this))}else Cnp(this,L);this.D0&&!this.Ch&&(Q==4?this.T.Qn(this):(this.D0=!1,fAW(this)))}else v==400&&L.indexOf("Unknown SID")>0?(this.wQ=3,th(13)):(this.wQ=0,th(14)),pz(this),SYA(this)}}catch(Y){}finally{}};
- g.h.cancel=function(){this.Ch=!0;pz(this)};
- g.h.AE=function(){this.Oc=null;var T=Date.now();T-this.S8>=0?(this.Mi!=2&&this.T.TR(3),pz(this),this.wQ=2,th(18),SYA(this)):hp9(this,this.S8-T)};
- g.h.getLastError=function(){return this.wQ};g.h=XeJ.prototype;g.h.EJ=null;g.h.Bc=null;g.h.lw=!1;g.h.h$=null;g.h.kF=null;g.h.F3=-1;g.h.zJ=null;g.h.Nq=null;g.h.connect=function(T){this.h$=T;T=$U(this.T,null,this.h$);th(3);Date.now();var Q=this.T.D;Q!=null?(this.zJ=Q[0],(this.Nq=Q[1])?(this.kF=1,weA(this)):(this.kF=2,dhm(this))):(jd(T,"MODE","init"),this.Bc=new O1(this),this.Bc.V$=this.EJ,ZMJ(this.Bc,T,!1,null,!0),this.kF=0)};
- g.h.qX=function(T){if(T)this.kF=2,dhm(this);else{th(4);var Q=this.T;Q.sx=Q.YV.F3;E1(Q,9)}T&&this.TR(2)};
- g.h.cq=function(T){return this.T.cq(T)};
- g.h.abort=function(){this.Bc&&(this.Bc.cancel(),this.Bc=null);this.F3=-1};
- g.h.FG=function(){return!1};
- g.h.KE=function(T,Q){this.F3=T.lL;if(this.kF==0)if(Q){try{var k=this.S.parse(Q)}catch(l){T=this.T;T.sx=this.F3;E1(T,2);return}this.zJ=k[0];this.Nq=k[1]}else T=this.T,T.sx=this.F3,E1(T,2);else this.kF==2&&(this.lw?(th(7),Date.now()):Q=="11111"?(th(6),this.lw=!0,Date.now(),this.F3=200,this.Bc.cancel(),th(12),Jh(this.T,this,!0)):(th(8),Date.now(),this.lw=!1))};
- g.h.Qn=function(){this.F3=this.Bc.lL;if(this.Bc.D0)this.kF==0?this.Nq?(this.kF=1,weA(this)):(this.kF=2,dhm(this)):this.kF==2&&(this.lw?(th(12),Jh(this.T,this,!0)):(th(11),Jh(this.T,this,!1)));else{this.kF==0?th(9):this.kF==2&&th(10);var T=this.T;this.Bc.getLastError();T.sx=this.F3;E1(T,2)}};
- g.h.JQ=function(){return this.T.JQ()};
- g.h.isActive=function(){return this.T.isActive()};
- g.h.TR=function(T){this.T.TR(T)};g.h=NmW.prototype;g.h.Fu=null;g.h.ZM=null;g.h.Zz=null;g.h.Rn=null;g.h.Ff=null;g.h.q4=null;g.h.GX=null;g.h.LW=null;g.h.AQ=0;g.h.Iu=0;g.h.x_=null;g.h.Mk=null;g.h.Yu=null;g.h.lR=null;g.h.YV=null;g.h.bM=null;g.h.DA=-1;g.h.P_=-1;g.h.sx=-1;g.h.fR=0;g.h.vt=0;g.h.C5=8;var BBW={OK:0,Rs9:2,QM6:4,Isd:5,J_m:6,STOP:7,Qz:8,Bee:9,XlK:10,R9_:11,R0O:12};g.fW(bM$,g.Jz);g.fW(rFW,g.Jz);g.h=NmW.prototype;
- g.h.connect=function(T,Q,k,l,v){th(0);this.Ff=Q;this.ZM=k||{};l&&v!==void 0&&(this.ZM.OSID=l,this.ZM.OAID=v);this.j?(Po((0,g.Mp)(this.oo,this,T),100),DhW(this)):this.oo(T)};
- g.h.disconnect=function(){aAA(this);if(this.T==3){var T=this.AQ++,Q=this.q4.clone();g.Uz(Q,"SID",this.Y);g.Uz(Q,"RID",T);g.Uz(Q,"TYPE","terminate");Fm(this,Q);T=new O1(this,this.Y,T);T.Mi=2;T.sR=QL(Q.clone());(new Image).src=T.sR.toString();T.rq=Date.now();fAW(T)}WpW(this)};
- g.h.oo=function(T){this.YV=new XeJ(this);this.YV.EJ=this.Fu;this.YV.S=this.N;this.YV.connect(T)};
- g.h.FG=function(){return this.T==0};
- g.h.getState=function(){return this.T};
- g.h.pE=function(T){this.Mk=null;Pn1(this,T)};
- g.h.nE=function(){this.Yu=null;this.Rn=new O1(this,this.Y,"rpc",this.C);this.Rn.V$=this.Fu;this.Rn.TL=0;var T=this.GX.clone();g.Uz(T,"RID","rpc");g.Uz(T,"SID",this.Y);g.Uz(T,"CI",this.bM?"0":"1");g.Uz(T,"AID",this.DA);Fm(this,T);g.Uz(T,"TYPE","xmlhttp");ZMJ(this.Rn,T,!0,this.LW,!1)};
- g.h.KE=function(T,Q){if(this.T!=0&&(this.Rn==T||this.Zz==T))if(this.sx=T.lL,this.Zz==T&&this.T==3)if(this.C5>7){try{var k=this.N.parse(Q)}catch(l){k=null}if(Array.isArray(k)&&k.length==3)if(T=k,T[0]==0)a:{if(!this.Yu){if(this.Rn)if(this.Rn.rq+3E3<this.Zz.rq)ed(this),this.Rn.cancel(),this.Rn=null;else break a;OMJ(this);th(19)}}else this.P_=T[1],0<this.P_-this.DA&&T[2]<37500&&this.bM&&this.vt==0&&!this.lR&&(this.lR=Po((0,g.Mp)(this.KD,this),6E3));else E1(this,11)}else Q!="y2f%"&&E1(this,11);else if(this.Rn==
- T&&ed(this),!g.bB(Q))for(T=this.N.parse(Q),Q=0;Q<T.length;Q++)k=T[Q],this.DA=k[0],k=k[1],this.T==2?k[0]=="c"?(this.Y=k[1],this.LW=k[2],k=k[3],k!=null?this.C5=k:this.C5=6,this.T=3,this.x_&&this.x_.W_(),this.GX=$U(this,this.JQ()?this.LW:null,this.Ff),HMW(this)):k[0]=="stop"&&E1(this,7):this.T==3&&(k[0]=="stop"?E1(this,7):k[0]!="noop"&&this.x_&&this.x_.tf(k),this.vt=0)};
- g.h.KD=function(){this.lR!=null&&(this.lR=null,this.Rn.cancel(),this.Rn=null,OMJ(this),th(20))};
- g.h.Qn=function(T){if(this.Rn==T){ed(this);this.Rn=null;var Q=2}else if(this.Zz==T)this.Zz=null,Q=1;else return;this.sx=T.lL;if(this.T!=0)if(T.D0)if(Q==1){Q=T.s2?T.s2.length:0;T=Date.now()-T.rq;var k=Ho;k.dispatchEvent(new bM$(k,Q,T,this.fR));cFm(this);this.x_&&this.x_.OV(this,this.L);this.L.length=0}else HMW(this);else{k=T.getLastError();var l;if(!(l=k==3||k==7||k==0&&this.sx>0)){if(l=Q==1)this.Zz||this.Mk||this.T==1||this.fR>=2?l=!1:(this.Mk=Po((0,g.Mp)(this.pE,this,T),tom(this,this.fR)),this.fR++,
- l=!0);l=!(l||Q==2&&OMJ(this))}if(l)switch(k){case 1:E1(this,5);break;case 4:E1(this,10);break;case 3:E1(this,6);break;case 7:E1(this,12);break;default:E1(this,2)}}};
- g.h.bb=function(T){if(!g.CW(arguments,this.T))throw Error("Unexpected channel state: "+this.T);};
- g.h.Roe=function(T){T?th(2):(th(1),peA(this,8))};
- g.h.cq=function(T){if(T)throw Error("Can't create secondary domain capable XhrIo object.");T=new g.Jd;T.C=!1;return T};
- g.h.isActive=function(){return!!this.x_&&this.x_.isActive(this)};
- g.h.TR=function(T){var Q=Ho;Q.dispatchEvent(new rFW(Q,T))};
- g.h.JQ=function(){return!1};
- g.h=$hd.prototype;g.h.W_=function(){};
- g.h.tf=function(){};
- g.h.OV=function(){};
- g.h.uE=function(){};
- g.h.Yi=function(){};
- g.h.v_=function(){return{}};
- g.h.isActive=function(){return!0};g.h=JFm.prototype;g.h.enqueue=function(T){this.S.push(T)};
- g.h.isEmpty=function(){return this.T.length===0&&this.S.length===0};
- g.h.clear=function(){this.T=[];this.S=[]};
- g.h.contains=function(T){return g.CW(this.T,T)||g.CW(this.S,T)};
- g.h.remove=function(T){var Q=this.T;var k=(0,g.zeW)(Q,T);k>=0?(g.Bm(Q,k),Q=!0):Q=!1;return Q||g.zv(this.S,T)};
- g.h.b0=function(){for(var T=[],Q=this.T.length-1;Q>=0;--Q)T.push(this.T[Q]);Q=this.S.length;for(var k=0;k<Q;++k)T.push(this.S[k]);return T};g.S(epm,g.Jz);g.S(Fpd,g.Jz);g.fW(yL,g.x);g.h=yL.prototype;g.h.oMB=function(){this.d8=Math.min(3E5,this.d8*2);this.L();this.S&&this.start()};
- g.h.start=function(){var T=this.d8+15E3*Math.random();g.Ez(this.T,T);this.S=Date.now()+T};
- g.h.stop=function(){this.T.stop();this.S=0};
- g.h.isActive=function(){return this.T.isActive()};
- g.h.reset=function(){this.T.stop();this.d8=5E3};g.fW(yFm,$hd);g.h=yFm.prototype;g.h.subscribe=function(T,Q,k){return this.B.subscribe(T,Q,k)};
- g.h.unsubscribe=function(T,Q,k){return this.B.unsubscribe(T,Q,k)};
- g.h.Y_=function(T){return this.B.Y_(T)};
- g.h.publish=function(T,Q){return this.B.publish.apply(this.B,arguments)};
- g.h.dispose=function(){this.C||(this.C=!0,g.od(this.B),this.disconnect(),g.od(this.S),this.S=null,this.i9=function(){return""},this.Bd=function(){return g.DT({})})};
- g.h.wd=function(){return this.C};
- g.h.connect=function(T,Q,k){var l=this,v,L,q,Y;return g.a(function(U){if(U.S==1)return g.Xg(U,2),l.N?g.c(U,l.Y,2):U.Ym(2);g.aI(U);if(l.C||l.T&&l.T.getState()==2)return U.return();l.hj="";l.S.stop();l.D=T||null;l.j=Q||0;v=l.sK+"/test";L=l.sK+"/bind";q=new NmW(k?k.firstTestResults:null,k?k.secondTestResults:null,l.d5);if(Y=l.T)Y.x_=null;q.x_=l;l.T=q;if(l.N)return l.Y=or$(l).then(function(){return T7v(l,v,L,Y,k)}),U.return(l.Y.then(function(){l.Y=g.DT()}));
- T7v(l,v,L,Y,k);return g.n5(U,0)})};
- g.h.disconnect=function(T){try{this.N&&(this.Y.cancel(),this.Y=g.DT())}finally{this.qO=T||0,this.S&&this.S.stop(),iMW(this),this.T&&(this.T.getState()==3&&Pn1(this.T),this.T.disconnect()),this.qO=0}};
- g.h.sendMessage=function(T,Q){var k=this,l;return g.a(function(v){switch(v.S){case 1:g.Xg(v,2);if(!k.N){v.Ym(2);break}return g.c(v,k.Y,2);case 2:g.aI(v);if(k.C)return v.return();l={_sc:T};Q&&g.Is(l,Q);if(k.S.isActive()||(k.T?k.T.getState():0)==2){k.L.push(l);v.Ym(6);break}if(!k.zM()){v.Ym(6);break}g.Xg(v,8);if(!k.N||l2J(k,T)){v.Ym(8);break}return g.c(v,or$(k),8);case 8:g.aI(v,0,0,1);k.zM()&&(l2J(k,T)||Vo9(k),iMW(k),uYW(k.T,l));g.n5(v,6,1);break;case 6:g.n5(v,0)}})};
- g.h.W_=function(){this.S.reset();this.D=null;this.j=0;if(this.L.length)if(this.N)L4m(this);else{var T=this.L;this.L=[];var Q=T.length;Vo9(this);vr9(this,T,Q);i9(this)}else i9(this)};
- g.h.uE=function(T){var Q=T==2&&this.T.sx==401;T==4||Q||this.S.start();this.publish("handlerError",T,Q);Q=Object.keys(BBW).find(function(k){return BBW[k]===T});
- this.p_.ML("BROWSER_CHANNEL",Q!=null?Q:"UNKNOWN")};
- g.h.Yi=function(T,Q){if(!this.S.isActive())this.publish("handlerClosed");else if(Q)for(var k=Q.length,l=0;l<k;++l){var v=Q[l].map;v&&this.L.push(v)}this.Jj.ML("BROWSER_CHANNEL");T&&this.DP.T.dD("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",T.length);Q&&this.Fk.T.dD("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",Q.length)};
- g.h.OV=function(T,Q){Q!=null&&T!=null&&this.f_.ML()};
- g.h.v_=function(){var T={v:2};this.hj&&(T.gsessionid=this.hj);this.j!=0&&(T.ui=""+this.j);this.qO!=0&&(T.ui=""+this.qO);this.D&&g.Is(T,this.D);return T};
- g.h.tf=function(T){T[0]=="S"?this.hj=T[1]:T[0]=="gracefulReconnect"?(this.S.start(),this.T.disconnect()):this.publish("handlerMessage",new EnE(T[0],T[1]));this.u9.ML("BROWSER_CHANNEL")};
- g.h.zM=function(){return!!this.T&&this.T.getState()==3};
- g.h.Ca=function(T){(this.z9.loungeIdToken=T)||this.S.stop();if(this.Ig&&this.T){var Q=this.T.Fu||{};T?Q["X-YouTube-LoungeId-Token"]=T:delete Q["X-YouTube-LoungeId-Token"];this.T.Fu=Q}};
- g.h.getDeviceId=function(){return this.z9.id};
- g.h.ZH=function(){return this.S.isActive()?this.S.S-Date.now():NaN};
- g.h.TT=function(){var T=this.S;g.yq(T.T);T.start()};
- g.h.wk_=function(){this.S.isActive();nn1(this.T)==0&&this.connect(this.D,this.j)};VL.prototype.sendRequest=function(T,Q,k,l,v,L,q){T={format:L?"RAW":"JSON",method:T,context:this,timeout:5E3,withCredentials:!!q,onSuccess:g.YE(this.Y,l,!L),onError:g.YE(this.L,v),onTimeout:g.YE(this.N,v)};k&&(T.postParams=k,T.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.zO(Q,T)};
- VL.prototype.Y=function(T,Q,k,l){Q?T(l):T({text:k.responseText})};
- VL.prototype.L=function(T,Q){T(Error("Request error: "+Q.status))};
- VL.prototype.N=function(T){T(Error("request timed out"))};g.S(MzT,g.fL);g.h=MzT.prototype;g.h.connect=function(T,Q,k){this.Qp.connect(T,Q,k)};
- g.h.disconnect=function(T){this.Qp.disconnect(T)};
- g.h.TT=function(){this.Qp.TT()};
- g.h.getDeviceId=function(){return this.Qp.getDeviceId()};
- g.h.ZH=function(){return this.Qp.ZH()};
- g.h.zM=function(){return this.Qp.zM()};
- g.h.Gy=function(){this.dispatchEvent("channelOpened");var T=this.Qp,Q=this.T;g.ri("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!T.T.bM,sessionId:T.T.Y,arrayId:T.T.DA});g.ri("yt-remote-session-screen-id",Q);T=R7();Q=Za();g.CW(T,Q)||T.push(Q);$2T(T);eIW()};
- g.h.onClosed=function(){this.dispatchEvent("channelClosed")};
- g.h.onMessage=function(T){this.dispatchEvent(new epm(T))};
- g.h.onError=function(T){this.dispatchEvent(new Fpd(T?1:0))};
- g.h.sendMessage=function(T,Q){this.Qp.sendMessage(T,Q)};
- g.h.Ca=function(T){this.Qp.Ca(T)};
- g.h.dispose=function(){this.Qp.dispose()};g.h=YSv.prototype;
- g.h.connect=function(T,Q){T=T===void 0?{}:T;Q=Q===void 0?0:Q;this.B!==2&&(this.L.stop(),this.j=T,this.C=Q,RA9(this),(T=g.$i("ID_TOKEN"))?this.Y["x-youtube-identity-token"]=T:delete this.Y["x-youtube-identity-token"],this.T&&(this.S.device=this.T.device,this.S.name=this.T.name,this.S.app=this.T.app,this.S.id=this.T.id,this.T.zHj&&(this.S.mdxVersion=""+this.T.zHj),this.T.theme&&(this.S.theme=this.T.theme),this.T.capabilities&&(this.S.capabilities=this.T.capabilities),this.T.VG&&(this.S.cst=this.T.VG),
- this.T.authuser&&(this.S.authuser=this.T.authuser),this.T.pageId&&(this.S.pageId=this.T.pageId)),this.C!==0?this.S.ui=""+this.C:delete this.S.ui,Object.assign(this.S,this.j),this.channel=new xU(this.pathPrefix,{qQ:"gsessionid",cj9:this.Y,omH:this.S}),this.channel.open(),this.B=2,UUv(this))};
- g.h.disconnect=function(T){this.D=T===void 0?0:T;this.L.stop();RA9(this);this.channel&&(this.D!==0?this.S.ui=""+this.D:delete this.S.ui,this.channel.close());this.D=0};
- g.h.ZH=function(){return this.L.isActive()?this.L.S-Date.now():NaN};
- g.h.TT=function(){var T=this.L;g.yq(T.T);T.start()};
- g.h.sendMessage=function(T,Q){this.channel&&(RA9(this),T=Object.assign({},{_sc:T},Q),this.channel.send(T))};
- g.h.Ca=function(T){T||this.L.stop();T?this.Y["X-YouTube-LoungeId-Token"]=T:delete this.Y["X-YouTube-LoungeId-Token"]};
- g.h.getDeviceId=function(){return this.T?this.T.id:""};
- g.h.publish=function(T){return this.N.publish.apply(this.N,[T].concat(g.ZH(g.HT.apply(1,arguments))))};
- g.h.subscribe=function(T,Q,k){return this.N.subscribe(T,Q,k)};
- g.h.unsubscribe=function(T,Q,k){return this.N.unsubscribe(T,Q,k)};
- g.h.Y_=function(T){return this.N.Y_(T)};
- g.h.dispose=function(){this.z9||(this.z9=!0,g.od(this.N),this.disconnect(),g.od(this.L),this.hj=function(){return""})};
- g.h.wd=function(){return this.z9};g.S(Zjd,g.fL);g.h=Zjd.prototype;g.h.connect=function(T,Q){this.T.connect(T,Q)};
- g.h.disconnect=function(T){this.T.disconnect(T)};
- g.h.TT=function(){this.T.TT()};
- g.h.getDeviceId=function(){return this.T.getDeviceId()};
- g.h.ZH=function(){return this.T.ZH()};
- g.h.zM=function(){return this.T.B===3};
- g.h.PE=function(){this.dispatchEvent("channelOpened")};
- g.h.onClosed=function(){this.dispatchEvent("channelClosed")};
- g.h.onMessage=function(T){this.dispatchEvent(new epm(T))};
- g.h.onError=function(){this.dispatchEvent(new Fpd(this.T.W1===401?1:0))};
- g.h.sendMessage=function(T,Q){this.T.sendMessage(T,Q)};
- g.h.Ca=function(T){this.T.Ca(T)};
- g.h.dispose=function(){this.T.dispose()};var CMW=Date.now(),QF=null,oe=Array(50),lR=-1,vF=!1;g.fW(LK,g.ox);LK.prototype.b5=function(){return this.screens};
- LK.prototype.contains=function(T){return!!Oh$(this.screens,T)};
- LK.prototype.get=function(T){return T?U1(this.screens,T):null};
- LK.prototype.info=function(T){jR(this.B,T)};g.S(wle,g.ox);g.h=wle.prototype;g.h.start=function(){!this.T&&isNaN(this.D8)&&this.IE()};
- g.h.stop=function(){this.T&&(this.T.abort(),this.T=null);isNaN(this.D8)||(g.GO(this.D8),this.D8=NaN)};
- g.h.EK=function(){this.stop();g.ox.prototype.EK.call(this)};
- g.h.IE=function(){this.D8=NaN;this.T=g.zO(TM(this.L,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.C},timeout:5E3,onSuccess:(0,g.Mp)(this.pD,this),onError:(0,g.Mp)(this.nD,this),onTimeout:(0,g.Mp)(this.ub,this)})};
- g.h.pD=function(T,Q){this.T=null;T=Q.screen||{};T.dialId=this.Y;T.name=this.B;Q=-1;this.N&&T.shortLivedLoungeToken&&T.shortLivedLoungeToken.value&&T.shortLivedLoungeToken.refreshIntervalMs&&(T.screenIdType="shortLived",T.loungeToken=T.shortLivedLoungeToken.value,Q=T.shortLivedLoungeToken.refreshIntervalMs);this.publish("pairingComplete",new ge(T),Q)};
- g.h.nD=function(T){this.T=null;T.status&&T.status==404?this.S>=zUd.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(T=zUd[this.S],this.D8=g.Zq((0,g.Mp)(this.IE,this),T),this.S++):this.publish("pairingFailed",Error("Server error "+T.status))};
- g.h.ub=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))};
- var zUd=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.fW(gZ,LK);g.h=gZ.prototype;g.h.start=function(){qG(this)&&this.publish("screenChange");!g.cy("yt-remote-lounge-token-expiration")&&dU$(this);g.GO(this.T);this.T=g.Zq((0,g.Mp)(this.start,this),1E4)};
- g.h.add=function(T,Q){qG(this);B7v(this,T);MG(this,!1);this.publish("screenChange");Q(T);T.token||dU$(this)};
- g.h.remove=function(T,Q){var k=qG(this);XlA(this,T)&&(MG(this,!1),k=!0);Q(T);k&&this.publish("screenChange")};
- g.h.AF=function(T,Q,k,l){var v=qG(this),L=this.get(T.id);L?(L.name!=Q&&(L.name=Q,MG(this,!1),v=!0),k(T)):l(Error("no such local screen."));v&&this.publish("screenChange")};
- g.h.EK=function(){g.GO(this.T);gZ.Ye.EK.call(this)};
- g.h.wX=function(T){qG(this);var Q=this.screens.length;T=T&&T.screens||[];for(var k=T.length,l=0;l<k;++l){var v=T[l],L=this.get(v.screenId);L&&(L.token=v.loungeToken,--Q)}MG(this,!Q);Q&&jR(this.B,"Missed "+Q+" lounge tokens.")};
- g.h.VJ=function(T){jR(this.B,"Requesting lounge tokens failed: "+T)};g.S(AxA,g.ox);g.h=AxA.prototype;g.h.start=function(){var T=parseInt(g.cy("yt-remote-fast-check-period")||"0",10);(this.Y=g.R_()-144E5<T?0:T)?Yo(this):(this.Y=g.R_()+3E5,g.ri("yt-remote-fast-check-period",this.Y),this.Q7())};
- g.h.isEmpty=function(){return g.Rs(this.T)};
- g.h.update=function(){N79("Updating availability on schedule.");var T=this.B(),Q=g.Ts(this.T,function(k,l){return k&&!!U1(T,l)},this);
- cxe(this,Q)};
- g.h.EK=function(){g.GO(this.L);this.L=NaN;this.S&&(this.S.abort(),this.S=null);g.ox.prototype.EK.call(this)};
- g.h.Q7=function(){g.GO(this.L);this.L=NaN;this.S&&this.S.abort();var T=DUT(this);if(TVd(T)){var Q=TM(this.N,"/pairing/get_screen_availability");this.S=this.N.sendRequest("POST",Q,{lounge_token:g.gz(T).join(",")},(0,g.Mp)(this.OAq,this,T),(0,g.Mp)(this.WrB,this))}else cxe(this,{}),Yo(this)};
- g.h.OAq=function(T,Q){this.S=null;var k=g.gz(DUT(this));if(g.eA(k,g.gz(T))){Q=Q.screens||[];k={};for(var l=Q.length,v=0;v<l;++v)k[T[Q[v].loungeToken]]=Q[v].status=="online";cxe(this,k);Yo(this)}else this.ww("Changing Screen set during request."),this.Q7()};
- g.h.WrB=function(T){this.ww("Screen availability failed: "+T);this.S=null;Yo(this)};
- g.h.ww=function(T){jR("OnlineScreenService",T)};g.fW(Ub,LK);g.h=Ub.prototype;g.h.start=function(){this.S.start();this.T.start();this.screens.length&&(this.publish("screenChange"),this.T.isEmpty()||this.publish("onlineScreenChange"))};
- g.h.add=function(T,Q,k){this.S.add(T,Q,k)};
- g.h.remove=function(T,Q,k){this.S.remove(T,Q,k);this.T.update()};
- g.h.AF=function(T,Q,k,l){this.S.contains(T)?this.S.AF(T,Q,k,l):(T="Updating name of unknown screen: "+T.name,jR(this.B,T),l(Error(T)))};
- g.h.b5=function(T){return T?this.screens:g.bW(this.screens,g.bl(this.L,function(Q){return!this.contains(Q)},this))};
- g.h.fE=function(){return g.bl(this.b5(!0),function(T){return!!this.T.T[T.id]},this)};
- g.h.DD=function(T,Q,k,l,v,L){var q=this;this.info("getDialScreenByPairingCode "+T+" / "+Q);var Y=new wle(this.Y,T,Q,k,l);Y.subscribe("pairingComplete",function(U,R){g.od(Y);v(Re(q,U),R)});
- Y.subscribe("pairingFailed",function(U){g.od(Y);L(U)});
- Y.start();return(0,g.Mp)(Y.stop,Y)};
- g.h.tE=function(T,Q,k,l){g.zO(TM(this.Y,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:T},timeout:5E3,onSuccess:(0,g.Mp)(function(v,L){v=new ge(L.screen||{});if(!v.name||K4T(this,v.name)){a:{L=v.name;for(var q=2,Y=Q(L,q);K4T(this,Y);){q++;if(q>20)break a;Y=Q(L,q)}L=Y}v.name=L}k(Re(this,v))},this),
- onError:(0,g.Mp)(function(v){l(Error("pairing request failed: "+v.status))},this),
- onTimeout:(0,g.Mp)(function(){l(Error("pairing request timed out."))},this)})};
- g.h.EK=function(){g.od(this.S);g.od(this.T);Ub.Ye.EK.call(this)};
- g.h.I1=function(){PMJ(this);this.publish("screenChange");this.T.update()};
- Ub.prototype.dispose=Ub.prototype.dispose;g.fW(Zu,g.ox);g.h=Zu.prototype;g.h.q1=function(T){this.wd()||(T&&(GM(this,""+T),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))};
- g.h.info=function(T){jR(this.i9,T)};
- g.h.Mx=function(){return null};
- g.h.b1=function(T){var Q=this.S;T?(Q.displayStatus=new chrome.cast.ReceiverDisplayStatus(T,[]),Q.displayStatus.showStop=!0):Q.displayStatus=null;chrome.cast.setReceiverDisplayStatus(Q,(0,g.Mp)(function(){this.info("Updated receiver status for "+Q.friendlyName+": "+T)},this),(0,g.Mp)(function(){GM(this,"Failed to update receiver status for: "+Q.friendlyName)},this))};
- g.h.EK=function(){this.b1("");Zu.Ye.EK.call(this)};g.S(mg,Zu);g.h=mg.prototype;g.h.Z9=function(T){if(this.L){if(this.L==T)return;GM(this,"Overriding cast session with new session object");ij_(this);this.hj=!1;this.D="unknown";this.L.removeUpdateListener(this.qO);this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.xm)}this.L=T;this.L.addUpdateListener(this.qO);this.L.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.xm);Jxv(this,"getMdxSessionStatus")};
- g.h.Zl=function(T){this.info("launchWithParams no-op for Cast: "+g.pL(T))};
- g.h.stop=function(){this.L?this.L.stop((0,g.Mp)(function(){this.q1()},this),(0,g.Mp)(function(){this.q1(Error("Failed to stop receiver app."))},this)):this.q1(Error("Stopping cast device without session."))};
- g.h.b1=function(){};
- g.h.EK=function(){this.info("disposeInternal");ij_(this);this.L&&(this.L.removeUpdateListener(this.qO),this.L.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.xm));this.L=null;Zu.prototype.EK.call(this)};
- g.h.UFB=function(T,Q){if(!this.wd())if(Q)if(Q=kU(Q),g.vm(Q))switch(T=""+Q.type,Q=Q.data||{},this.info("onYoutubeMessage_: "+T+" "+g.pL(Q)),T){case "mdxSessionStatus":plp(this,Q);break;case "loungeToken":eAm(this,Q);break;default:GM(this,"Unknown youtube message: "+T)}else GM(this,"Unable to parse message.");else GM(this,"No data in message.")};
- g.h.wU=function(T,Q,k,l){g.GO(this.j);this.j=0;nr_(this.Y,this.S.label,T,this.S.friendlyName,(0,g.Mp)(function(v){v?Q(v):l>=0?(GM(this,"Screen "+T+" appears to be offline. "+l+" retries left."),this.j=g.Zq((0,g.Mp)(this.wU,this,T,Q,k,l-1),300)):k(Error("Unable to fetch screen."))},this),k)};
- g.h.Mx=function(){return this.L};
- g.h.WE=function(T){this.wd()||T||(GM(this,"Cast session died."),this.q1())};g.S(Ie,Zu);g.h=Ie.prototype;g.h.Z9=function(T){this.L=T;this.L.addUpdateListener(this.e6)};
- g.h.Zl=function(T){this.Bd=T;this.z9()};
- g.h.stop=function(){v_1(this);this.L?this.L.stop((0,g.Mp)(this.q1,this,null),(0,g.Mp)(this.q1,this,"Failed to stop DIAL device.")):this.q1()};
- g.h.EK=function(){v_1(this);this.L&&this.L.removeUpdateListener(this.e6);this.L=null;Zu.prototype.EK.call(this)};
- g.h.Ow=function(T){this.wd()||T||(GM(this,"DIAL session died."),this.N(),this.N=function(){},this.q1())};g.S(SR,Zu);SR.prototype.stop=function(){this.q1()};
- SR.prototype.Z9=function(){};
- SR.prototype.Zl=function(){g.GO(this.L);this.L=NaN;var T=U1(this.Y.b5(),this.S.label);T?fK(this,T):this.q1(Error("No such screen"))};
- SR.prototype.EK=function(){g.GO(this.L);this.L=NaN;Zu.prototype.EK.call(this)};g.S(CK,g.ox);g.h=CK.prototype;
- g.h.init=function(T,Q){chrome.cast.timeout.requestSession=3E4;var k=new chrome.cast.SessionRequest(this.j,[chrome.cast.Capability.AUDIO_OUT]);g.hH("desktop_enable_cast_connect")&&(k.androidReceiverCompatible=!0);this.D||(k.dialRequest=new chrome.cast.DialRequest("YouTube"));var l=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;T=T||this.B?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var v=(0,g.Mp)(this.egV,this);k=new chrome.cast.ApiConfig(k,(0,g.Mp)(this.hK,
- this),v,l,T);k.customDialLaunchCallback=(0,g.Mp)(this.fVH,this);chrome.cast.initialize(k,(0,g.Mp)(function(){this.wd()||(chrome.cast.addReceiverActionListener(this.N),hAp(),this.S.subscribe("onlineScreenChange",(0,g.Mp)(this.HF,this)),this.L=g_d(this),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Mp)(function(L){this.ww("Failed to set initial custom receivers: "+g.pL(L))},this)),this.publish("yt-remote-cast2-availability-change",zM(this)),Q(!0))},this),(0,g.Mp)(function(L){this.ww("Failed to initialize API: "+
- g.pL(L));
- Q(!1)},this))};
- g.h.Klj=function(T,Q){BF("Setting connected screen ID: "+T+" -> "+Q);if(this.T){var k=this.T.T;if(!T||k&&k.id!=T)BF("Unsetting old screen status: "+this.T.S.friendlyName),XF(this,null)}if(T&&Q){if(!this.T){T=U1(this.S.b5(),T);if(!T){BF("setConnectedScreenStatus: Unknown screen.");return}if(T.idType=="shortLived"){BF("setConnectedScreenStatus: Screen with id type to be short lived.");return}k=LbA(this,T);k||(BF("setConnectedScreenStatus: Connected receiver not custom..."),k=new chrome.cast.Receiver(T.uuid?
- T.uuid:T.id,T.name),k.receiverType=chrome.cast.ReceiverType.CUSTOM,this.L.push(k),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Mp)(function(l){this.ww("Failed to set initial custom receivers: "+g.pL(l))},this)));
- BF("setConnectedScreenStatus: new active receiver: "+k.friendlyName);XF(this,new SR(this.S,k),!0)}this.T.b1(Q)}else BF("setConnectedScreenStatus: no screen.")};
- g.h.pkB=function(T){this.wd()?this.ww("Setting connection data on disposed cast v2"):this.T?this.T.Zl(T):this.ww("Setting connection data without a session")};
- g.h.fD=function(){this.wd()?this.ww("Stopping session on disposed cast v2"):this.T?(this.T.stop(),XF(this,null)):BF("Stopping non-existing session")};
- g.h.requestSession=function(){chrome.cast.requestSession((0,g.Mp)(this.hK,this),(0,g.Mp)(this.f8k,this))};
- g.h.EK=function(){this.S.unsubscribe("onlineScreenChange",(0,g.Mp)(this.HF,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.N);var T=GPe,Q=g.jA("yt.mdx.remote.debug.handlers_");g.zv(Q||[],T);g.od(this.T);g.ox.prototype.EK.call(this)};
- g.h.ww=function(T){jR("Controller",T)};
- g.h.k8=function(T,Q){this.T==T&&(Q||XF(this,null),this.publish("yt-remote-cast2-session-change",Q))};
- g.h.Nnj=function(T,Q){if(!this.wd())if(T)switch(T.friendlyName=chrome.cast.unescape(T.friendlyName),BF("onReceiverAction_ "+T.label+" / "+T.friendlyName+"-- "+Q),Q){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.S.label!=T.label)BF("onReceiverAction_: Stopping active receiver: "+this.T.S.friendlyName),this.T.stop();else{BF("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(T.receiverType){case chrome.cast.ReceiverType.CUSTOM:XF(this,
- new SR(this.S,T));break;case chrome.cast.ReceiverType.DIAL:XF(this,new Ie(this.S,T,this.Y,this.config_));break;case chrome.cast.ReceiverType.CAST:XF(this,new mg(this.S,T,this.config_));break;default:this.ww("Unknown receiver type: "+T.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.S.label==T.label?this.T.stop():this.ww("Stopping receiver w/o session: "+T.friendlyName)}else this.ww("onReceiverAction_ called without receiver.")};
- g.h.fVH=function(T){if(this.wd())return Promise.reject(Error("disposed"));var Q=T.receiver;Q.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.ww("Not DIAL receiver: "+Q.friendlyName),Q.receiverType=chrome.cast.ReceiverType.DIAL);var k=this.T?this.T.S:null;if(!k||k.label!=Q.label)return this.ww("Receiving DIAL launch request for non-clicked DIAL receiver: "+Q.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(k&&k.label==Q.label&&k.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return BF("Reselecting dial screen."),
- this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.ww('Changing CAST intent from "'+k.receiverType+'" to "dial" for '+Q.friendlyName);XF(this,new Ie(this.S,Q,this.Y,this.config_))}Q=this.T;Q.j=T;Q.j.appState==chrome.cast.DialAppState.RUNNING?(T=Q.j.extraData||{},k=T.screenId||null,hR(Q)&&T.loungeToken?T.loungeTokenRefreshIntervalMs?T=kA$(Q,{name:Q.S.friendlyName,screenId:T.screenId,loungeToken:T.loungeToken,dialId:Q.j.receiver.label,
- screenIdType:"shortLived"},T.loungeTokenRefreshIntervalMs):(g.FH(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(T)+".")),T=lZT(Q,k)):T=lZT(Q,k)):T=Q$E(Q);return T};
- g.h.hK=function(T){var Q=this;if(!this.wd()&&!this.B){BF("New cast session ID: "+T.sessionId);var k=T.receiver;if(k.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(k.receiverType==chrome.cast.ReceiverType.CAST)BF("Got resumed cast session before resumed mdx connection."),k.friendlyName=chrome.cast.unescape(k.friendlyName),XF(this,new mg(this.S,k,this.config_),!0);else{this.ww("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var l=this.T.S,v=U1(this.S.b5(),
- l.label);v&&Mb(v,k.label)&&l.receiverType!=chrome.cast.ReceiverType.CAST&&k.receiverType==chrome.cast.ReceiverType.CAST&&(BF("onSessionEstablished_: manual to cast session change "+k.friendlyName),g.od(this.T),this.T=new mg(this.S,k,this.config_),this.T.subscribe("sessionScreen",(0,g.Mp)(this.k8,this,this.T)),this.T.subscribe("sessionFailed",function(){return qqm(Q,Q.T)}),this.T.Zl(null));
- this.T.Z9(T)}}};
- g.h.vE=function(){return this.T?this.T.Mx():null};
- g.h.f8k=function(T){this.wd()||(this.ww("Failed to estabilish a session: "+g.pL(T)),T.code!=chrome.cast.ErrorCode.CANCEL&&XF(this,null),this.publish("yt-remote-cast2-session-failed"))};
- g.h.egV=function(T){BF("Receiver availability updated: "+T);if(!this.wd()){var Q=zM(this);this.C=T==chrome.cast.ReceiverAvailability.AVAILABLE;zM(this)!=Q&&this.publish("yt-remote-cast2-availability-change",zM(this))}};
- g.h.HF=function(){this.wd()||(this.L=g_d(this),BF("Updating custom receivers: "+g.pL(this.L)),chrome.cast.setCustomReceivers(this.L,function(){},(0,g.Mp)(function(){this.ww("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",zM(this)))};
- CK.prototype.setLaunchParams=CK.prototype.pkB;CK.prototype.setConnectedScreenStatus=CK.prototype.Klj;CK.prototype.stopSession=CK.prototype.fD;CK.prototype.getCastSession=CK.prototype.vE;CK.prototype.requestSession=CK.prototype.requestSession;CK.prototype.init=CK.prototype.init;CK.prototype.dispose=CK.prototype.dispose;var XxW=g.G5(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),hZ$=[],GA9=g.Vw(XxW);g.h=cF.prototype;
- g.h.reset=function(T){this.listId="";this.index=-1;this.videoId="";XdE(this);this.volume=-1;this.muted=!1;T&&(this.index=T.index,this.listId=T.listId,this.videoId=T.videoId,this.playerState=T.playerState,this.volume=T.volume,this.muted=T.muted,this.audioTrackId=T.audioTrackId,this.trackData=T.trackData,this.E_=T.hasPrevious,this.G0=T.hasNext,this.B=T.playerTime,this.N=T.playerTimeAt,this.S=T.seekableStart,this.C=T.seekableEnd,this.L=T.duration,this.j=T.loadedTime,this.T=T.liveIngestionTime,this.Y=
- !isNaN(this.T))};
- g.h.isPlaying=function(){return this.playerState==1};
- g.h.isBuffering=function(){return this.playerState==3};
- g.h.SR=function(T){this.L=isNaN(T)?0:T};
- g.h.getDuration=function(){return this.Y?this.L+Du(this):this.L};
- g.h.clone=function(){return new cF(dEE(this))};g.S(xo,g.ox);g.h=xo.prototype;g.h.getState=function(){return this.L};
- g.h.ZH=function(){return this.Y.getReconnectTimeout()};
- g.h.TT=function(){this.Y.reconnect()};
- g.h.play=function(){HF(this)?(this.T?this.T.play(null,g.DM,WF(this,"play")):pK(this,"play"),bZA(this,1,uR(PF(this))),this.publish("remotePlayerChange")):tR(this,this.play)};
- g.h.pause=function(){HF(this)?(this.T?this.T.pause(null,g.DM,WF(this,"pause")):pK(this,"pause"),bZA(this,2,uR(PF(this))),this.publish("remotePlayerChange")):tR(this,this.pause)};
- g.h.seekTo=function(T){if(HF(this)){if(this.T){var Q=PF(this),k=new chrome.cast.media.SeekRequest;k.currentTime=T;Q.isPlaying()||Q.isBuffering()?k.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:k.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(k,g.DM,WF(this,"seekTo",{newTime:T}))}else pK(this,"seekTo",{newTime:T});bZA(this,3,T);this.publish("remotePlayerChange")}else tR(this,g.YE(this.seekTo,T))};
- g.h.stop=function(){if(HF(this)){this.T?this.T.stop(null,g.DM,WF(this,"stopVideo")):pK(this,"stopVideo");var T=PF(this);T.index=-1;T.videoId="";XdE(T);Ob(this,T);this.publish("remotePlayerChange")}else tR(this,this.stop)};
- g.h.setVolume=function(T,Q){if(HF(this)){var k=PF(this);if(this.S){if(k.volume!=T){var l=Math.round(T)/100;this.S.setReceiverVolumeLevel(l,(0,g.Mp)(function(){ko("set receiver volume: "+l)},this),(0,g.Mp)(function(){this.ww("failed to set receiver volume.")},this))}k.muted!=Q&&this.S.setReceiverMuted(Q,(0,g.Mp)(function(){ko("set receiver muted: "+Q)},this),(0,g.Mp)(function(){this.ww("failed to set receiver muted.")},this))}else{var v={volume:T,
- muted:Q};k.volume!=-1&&(v.delta=T-k.volume);pK(this,"setVolume",v)}k.muted=Q;k.volume=T;Ob(this,k)}else tR(this,g.YE(this.setVolume,T,Q))};
- g.h.yk=function(T,Q){if(HF(this)){var k=PF(this);T={videoId:T};Q&&(k.trackData={trackName:Q.name,languageCode:Q.languageCode,sourceLanguageCode:Q.translationLanguage?Q.translationLanguage.languageCode:"",languageName:Q.languageName,kind:Q.kind},T.style=g.pL(Q.style),g.Is(T,k.trackData));pK(this,"setSubtitlesTrack",T);Ob(this,k)}else tR(this,g.YE(this.yk,T,Q))};
- g.h.setAudioTrack=function(T,Q){HF(this)?(Q=Q.getLanguageInfo().getId(),pK(this,"setAudioTrack",{videoId:T,audioTrackId:Q}),T=PF(this),T.audioTrackId=Q,Ob(this,T)):tR(this,g.YE(this.setAudioTrack,T,Q))};
- g.h.playVideo=function(T,Q,k,l,v,L,q){l=l===void 0?null:l;v=v===void 0?null:v;L=L===void 0?null:L;q=q===void 0?null:q;var Y=PF(this),U={videoId:T};k!==void 0&&(U.currentIndex=k);nK(Y,T,k||0);Q!==void 0&&(ae(Y,Q),U.currentTime=Q);l&&(U.listId=l);v&&(U.playerParams=v);L&&(U.clickTrackingParams=L);q&&(U.locationInfo=g.pL(q));pK(this,"setPlaylist",U);l||Ob(this,Y)};
- g.h.Bi=function(T,Q){if(HF(this)){if(T&&Q){var k=PF(this);nK(k,T,Q);Ob(this,k)}pK(this,"previous")}else tR(this,g.YE(this.Bi,T,Q))};
- g.h.nextVideo=function(T,Q){if(HF(this)){if(T&&Q){var k=PF(this);nK(k,T,Q);Ob(this,k)}pK(this,"next")}else tR(this,g.YE(this.nextVideo,T,Q))};
- g.h.Nd=function(){if(HF(this)){pK(this,"clearPlaylist");var T=PF(this);T.reset();Ob(this,T);this.publish("remotePlayerChange")}else tR(this,this.Nd)};
- g.h.lQ=function(){HF(this)?pK(this,"dismissAutoplay"):tR(this,this.lQ)};
- g.h.dispose=function(){if(this.L!=3){var T=this.L;this.L=3;this.publish("proxyStateChange",T,this.L)}g.ox.prototype.dispose.call(this)};
- g.h.EK=function(){Au9(this);this.Y=null;this.N.clear();KK(this,null);g.ox.prototype.EK.call(this)};
- g.h.PW=function(T){if((T!=this.L||T==2)&&this.L!=3&&T!=0){var Q=this.L;this.L=T;this.publish("proxyStateChange",Q,T);if(T==1)for(;!this.N.isEmpty();)Q=T=this.N,Q.T.length===0&&(Q.T=Q.S,Q.T.reverse(),Q.S=[]),T.T.pop().apply(this);else T==3&&this.dispose()}};
- g.h.U2O=function(T,Q){this.publish(T,Q)};
- g.h.Kek=function(T){if(!T)this.pO(null),KK(this,null);else if(this.S.receiver.volume){T=this.S.receiver.volume;var Q=PF(this),k=Math.round(100*T.level||0);if(Q.volume!=k||Q.muted!=T.muted)ko("Cast volume update: "+T.level+(T.muted?" muted":"")),Q.volume=k,Q.muted=!!T.muted,Ob(this,Q)}};
- g.h.pO=function(T){ko("Cast media: "+!!T);this.T&&this.T.removeUpdateListener(this.j);if(this.T=T)this.T.addUpdateListener(this.j),rup(this),this.publish("remotePlayerChange")};
- g.h.IVK=function(T){T?(rup(this),this.publish("remotePlayerChange")):this.pO(null)};
- g.h.RF=function(){pK(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
- g.h.P96=function(){var T=CvW();T&&KK(this,T)};
- g.h.ww=function(T){jR("CP",T)};g.S(eR,g.ox);g.h=eR.prototype;
- g.h.connect=function(T,Q){if(Q){var k=Q.listId,l=Q.videoId,v=Q.videoIds,L=Q.playerParams,q=Q.clickTrackingParams,Y=Q.index,U={videoId:l},R=Q.currentTime,Z=Q.locationInfo;Q=Q.loopMode;R!==void 0&&(U.currentTime=R<=5?0:R);L&&(U.playerParams=L);Z&&(U.locationInfo=Z);q&&(U.clickTrackingParams=q);k&&(U.listId=k);v&&v.length>0&&(U.videoIds=v.join(","));Y!==void 0&&(U.currentIndex=Y);this.e6&&(U.loopMode=Q||"LOOP_MODE_OFF");k&&(this.T.listId=k);this.T.videoId=l;this.T.index=Y||0;this.T.state=3;ae(this.T,
- R);this.N="UNSUPPORTED";k=this.e6?"setInitialState":"setPlaylist";$o("Connecting with "+k+" and params: "+g.pL(U));this.S.connect({method:k,params:g.pL(U)},T,F6d())}else $o("Connecting without params"),this.S.connect({},T,F6d());urJ(this)};
- g.h.Ca=function(T){this.S.Ca(T)};
- g.h.dispose=function(){this.wd()||(g.Tv("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),JR(this,3));g.ox.prototype.dispose.call(this)};
- g.h.EK=function(){n_J(this);xEA(this);KbA(this);g.GO(this.j);this.j=NaN;g.GO(this.D);this.D=NaN;this.Y=null;g.CY(this.z9);this.z9.length=0;this.S.dispose();g.ox.prototype.EK.call(this);this.N=this.C=this.L=this.T=this.S=null};
- g.h.Nj=function(T){if(!this.L||this.L.length===0)return!1;for(var Q=g.B(this.L),k=Q.next();!k.done;k=Q.next())if(!k.value.capabilities.has(T))return!1;return!0};
- g.h.gX=function(){var T=3;this.wd()||(T=0,isNaN(this.CP())?this.S.zM()&&isNaN(this.B)&&(T=1):T=2);return T};
- g.h.Cw=function(T){$o("Disconnecting with "+T);g.Tv("yt.mdx.remote.remoteClient_",null);n_J(this);this.publish("beforeDisconnect",T);T==1&&fz();this.S.disconnect(T);this.dispose()};
- g.h.a8=function(){var T=this.T;this.Y&&(T=this.T.clone(),nK(T,this.Y,T.index));return dEE(T)};
- g.h.Wl_=function(T){var Q=this,k=new cF(T);k.videoId&&k.videoId!=this.T.videoId&&(this.Y=k.videoId,g.GO(this.j),this.j=g.Zq(function(){if(Q.Y){var v=Q.Y;Q.Y=null;Q.T.videoId!=v&&FF(Q,"getNowPlaying")}},5E3));
- var l=[];this.T.listId==k.listId&&this.T.videoId==k.videoId&&this.T.index==k.index||l.push("remoteQueueChange");this.T.playerState==k.playerState&&this.T.volume==k.volume&&this.T.muted==k.muted&&uR(this.T)==uR(k)&&g.pL(this.T.trackData)==g.pL(k.trackData)||l.push("remotePlayerChange");this.T.reset(T);g.EA(l,function(v){this.publish(v)},this)};
- g.h.X6=function(){var T=this.S.getDeviceId(),Q=g.sA(this.L,function(k){return k.type=="REMOTE_CONTROL"&&k.id!=T});
- return Q?Q.id:""};
- g.h.CP=function(){return this.S.ZH()};
- g.h.Jq=function(){return this.N||"UNSUPPORTED"};
- g.h.ZW=function(){return this.C||""};
- g.h.De=function(){!isNaN(this.CP())&&this.S.TT()};
- g.h.Aue=function(T,Q){FF(this,T,Q);HZd(this)};
- g.h.zn=function(){var T=g.uC("SAPISID","")||g.uC("__Secure-1PAPISID")||"",Q=g.uC("__Secure-3PAPISID","")||"";if(!T&&!Q)return"";T=g.dJ(g.wJ(T),2);Q=g.dJ(g.wJ(Q),2);return g.dJ(g.wJ(","+T+","+Q),2)};
- eR.prototype.subscribe=eR.prototype.subscribe;eR.prototype.unsubscribeByKey=eR.prototype.Y_;eR.prototype.getProxyState=eR.prototype.gX;eR.prototype.disconnect=eR.prototype.Cw;eR.prototype.getPlayerContextData=eR.prototype.a8;eR.prototype.setPlayerContextData=eR.prototype.Wl_;eR.prototype.getOtherConnectedRemoteId=eR.prototype.X6;eR.prototype.getReconnectTimeout=eR.prototype.CP;eR.prototype.getAutoplayMode=eR.prototype.Jq;eR.prototype.getAutoplayVideoId=eR.prototype.ZW;eR.prototype.reconnect=eR.prototype.De;
- eR.prototype.sendMessage=eR.prototype.Aue;eR.prototype.getXsrfToken=eR.prototype.zn;eR.prototype.isCapabilitySupportedOnConnectedDevices=eR.prototype.Nj;g.S(VVd,LK);g.h=VVd.prototype;g.h.b5=function(T){return this.Zf.$_gs(T)};
- g.h.contains=function(T){return!!this.Zf.$_c(T)};
- g.h.get=function(T){return this.Zf.$_g(T)};
- g.h.start=function(){this.Zf.$_st()};
- g.h.add=function(T,Q,k){this.Zf.$_a(T,Q,k)};
- g.h.remove=function(T,Q,k){this.Zf.$_r(T,Q,k)};
- g.h.AF=function(T,Q,k,l){this.Zf.$_un(T,Q,k,l)};
- g.h.EK=function(){for(var T=this.T.length,Q=0;Q<T;++Q)this.Zf.$_ubk(this.T[Q]);this.T.length=0;this.Zf=null;LK.prototype.EK.call(this)};
- g.h.au=function(){this.publish("screenChange")};
- g.h.sgK=function(){this.publish("onlineScreenChange")};
- Ub.prototype.$_st=Ub.prototype.start;Ub.prototype.$_gspc=Ub.prototype.tE;Ub.prototype.$_gsppc=Ub.prototype.DD;Ub.prototype.$_c=Ub.prototype.contains;Ub.prototype.$_g=Ub.prototype.get;Ub.prototype.$_a=Ub.prototype.add;Ub.prototype.$_un=Ub.prototype.AF;Ub.prototype.$_r=Ub.prototype.remove;Ub.prototype.$_gs=Ub.prototype.b5;Ub.prototype.$_gos=Ub.prototype.fE;Ub.prototype.$_s=Ub.prototype.subscribe;Ub.prototype.$_ubk=Ub.prototype.Y_;var vY=null,gP=!1,Eb=null,yF=null,MTW=null,Qy=[];g.S(fhm,g.x);g.h=fhm.prototype;g.h.EK=function(){g.x.prototype.EK.call(this);this.S.stop();this.L.stop();this.j.stop();var T=this.SV;T.unsubscribe("proxyStateChange",this.E9,this);T.unsubscribe("remotePlayerChange",this.vQ,this);T.unsubscribe("remoteQueueChange",this.Hi,this);T.unsubscribe("previousNextChange",this.TN,this);T.unsubscribe("nowAutoplaying",this.Ml,this);T.unsubscribe("autoplayDismissed",this.At,this);this.SV=this.T=null};
- g.h.Pg=function(T){var Q=g.HT.apply(1,arguments);if(this.SV.L!=2)if(Mk(this)){if(PF(this.SV).playerState!=1081||T!=="control_seek")switch(T){case "control_toggle_play_pause":PF(this.SV).isPlaying()?this.SV.pause():this.SV.play();break;case "control_play":this.SV.play();break;case "control_pause":this.SV.pause();break;case "control_seek":this.C.SF(Q[0],Q[1]);break;case "control_subtitles_set_track":m8W(this,Q[0]);break;case "control_set_audio_track":this.setAudioTrack(Q[0])}}else switch(T){case "control_toggle_play_pause":case "control_play":case "control_pause":Q=
- this.U.getCurrentTime();Yz(this,Q===0?void 0:Q);break;case "control_seek":Yz(this,Q[0]);break;case "control_subtitles_set_track":m8W(this,Q[0]);break;case "control_set_audio_track":this.setAudioTrack(Q[0])}};
- g.h.jkB=function(T){this.j.Ns(T)};
- g.h.Oi9=function(T){this.Pg("control_subtitles_set_track",g.Rs(T)?null:T)};
- g.h.SW=function(){var T=this.U.getOption("captions","track");g.Rs(T)||m8W(this,T)};
- g.h.bC=function(T){this.T.bC(T,this.U.getVideoData().lengthSeconds)};
- g.h.YGm=function(){g.Rs(this.Y)||Ih9(this,this.Y);this.N=!1};
- g.h.E9=function(T,Q){this.L.stop();Q===2&&this.OZ()};
- g.h.vQ=function(){if(Mk(this)){this.S.stop();var T=PF(this.SV);switch(T.playerState){case 1080:case 1081:case 1084:case 1085:this.T.I2=1;break;case 1082:case 1083:this.T.I2=0;break;default:this.T.I2=-1}switch(T.playerState){case 1081:case 1:this.LA(new g.Cd(8));this.Wu();break;case 1085:case 3:this.LA(new g.Cd(9));break;case 1083:case 0:this.LA(new g.Cd(2));this.C.stop();this.bC(this.U.getVideoData().lengthSeconds);break;case 1084:this.LA(new g.Cd(4));break;case 2:this.LA(new g.Cd(4));this.bC(uR(T));
- break;case -1:this.LA(new g.Cd(64));break;case -1E3:this.LA(new g.Cd(128,{errorCode:"mdx.remoteerror",errorMessage:"\u6b64\u89c6\u9891\u65e0\u6cd5\u8fdc\u7a0b\u64ad\u653e\u3002",sN:2}))}T=PF(this.SV).trackData;var Q=this.Y;(T||Q?T&&Q&&T.trackName==Q.trackName&&T.languageCode==Q.languageCode&&T.languageName==Q.languageName&&T.kind==Q.kind:1)||(this.Y=T,Ih9(this,T));T=PF(this.SV);T.volume===-1||Math.round(this.U.getVolume())===T.volume&&this.U.isMuted()===T.muted||this.D.isActive()||this.zd()}else G$J(this)};
- g.h.TN=function(){this.U.publish("mdxpreviousnextchange")};
- g.h.Hi=function(){Mk(this)||G$J(this)};
- g.h.Ml=function(T){isNaN(T)||this.U.publish("mdxnowautoplaying",T)};
- g.h.At=function(){this.U.publish("mdxautoplaycanceled")};
- g.h.setAudioTrack=function(T){Mk(this)&&this.SV.setAudioTrack(this.U.getVideoData(1).videoId,T)};
- g.h.seekTo=function(T,Q){PF(this.SV).playerState===-1?Yz(this,T):Q&&this.SV.seekTo(T)};
- g.h.zd=function(){var T=this;if(Mk(this)){var Q=PF(this.SV);this.events.J6(this.z9);Q.muted?this.U.mute():this.U.unMute();this.U.setVolume(Q.volume);this.z9=this.events.Z(this.U,"onVolumeChange",function(k){RUT(T,k)})}};
- g.h.Wu=function(){this.S.stop();if(!this.SV.wd()){var T=PF(this.SV);T.isPlaying()&&this.LA(new g.Cd(8));this.bC(uR(T));this.S.start()}};
- g.h.OZ=function(){this.L.stop();this.S.stop();var T=this.SV.ZH();this.SV.L==2&&!isNaN(T)&&this.L.start()};
- g.h.LA=function(T){this.L.stop();var Q=this.B;if(!g.AB(Q,T)){var k=g.J(T,2);k!==g.J(this.B,2)&&this.U.Y6(k);this.B=T;S2v(this.T,Q,T)}};g.S(hUp,g.yg);g.h=hUp.prototype;g.h.getCurrentTime=function(){return this.T.getCurrentTime()};
- g.h.getDuration=function(){return this.T.getDuration()};
- g.h.xM=function(){return this.T.xM()};
- g.h.bS=function(){return this.T.bS()};
- g.h.WG=function(){return this.T.WG()};
- g.h.r_=function(){return this.T.r_()};
- g.h.getPlayerState=function(){return this.T.yU};
- g.h.isAtLiveHead=function(){return this.T.isAtLiveHead()};
- g.h.pauseVideo=function(){this.T.AC("control_pause")};
- g.h.playVideo=function(){var T=this;return g.a(function(Q){T.T.AC("control_play");return Q.return()})};
- g.h.seekTo=function(T,Q){this.T.AC("control_seek",T,!(Q==null?0:Q.aj))};
- g.h.lx=function(T){this.T.AC("control_set_audio_track",T);return!0};g.S(UK,g.p);UK.prototype.fA=function(){this.fade.show()};
- UK.prototype.sG=function(){this.fade.hide()};
- UK.prototype.T=function(){mi("mdx-privacy-popup-cancel");this.sG()};
- UK.prototype.S=function(){mi("mdx-privacy-popup-confirm");this.sG()};g.S(Rk,g.p);Rk.prototype.onStateChange=function(T){this.OH(T.state)};
- Rk.prototype.OH=function(T){if(this.api.getPresentingPlayerType()===3){var Q={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};T=g.J(T,128)?g.o0("\u5728$RECEIVER_NAME\u4e0a\u51fa\u73b0\u9519\u8bef",Q):T.isPlaying()||T.isPaused()?g.o0("\u6b63\u5728$RECEIVER_NAME\u4e0a\u64ad\u653e",Q):g.o0("\u5df2\u8fde\u63a5\u5230$RECEIVER_NAME",Q);this.updateValue("statustext",T);this.fade.show()}else this.fade.hide()};g.S(Z$,g.Hp);Z$.prototype.Y=function(){var T=this.U.getOption("remote","receivers");T&&T.length>1&&!this.U.getOption("remote","quickCast")?(this.IQ=g.yJ(T,this.T,this),this.VE(g.IQ(T,this.T)),T=this.U.getOption("remote","currentReceiver"),T=this.T(T),this.options[T]&&this.U$(T),this.enable(!0)):this.enable(!1)};
- Z$.prototype.T=function(T){return T.key};
- Z$.prototype.U4=function(T){return T==="cast-selector-receiver"?"\u6295\u653e\u2026":this.IQ[T].name};
- Z$.prototype.BT=function(T){g.Hp.prototype.BT.call(this,T);this.U.setOption("remote","currentReceiver",this.IQ[T]);this.YB.sG()};g.S(sPE,g.A4);g.h=sPE.prototype;
- g.h.create=function(){var T=this.player.G(),Q=g.Ln(T);T={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:T.V("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:T.V("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:T.V("enable_cast_short_lived_lounge_token")};lh$(Q,T);this.subscriptions.push(g.TA("yt-remote-before-disconnect",this.Z_k,this));this.subscriptions.push(g.TA("yt-remote-connection-change",this.s_m,this));this.subscriptions.push(g.TA("yt-remote-receiver-availability-change",this.oE,
- this));this.subscriptions.push(g.TA("yt-remote-auto-connect",this.wh6,this));this.subscriptions.push(g.TA("yt-remote-receiver-resumed",this.VVB,this));this.subscriptions.push(g.TA("mdx-privacy-popup-confirm",this.DF9,this));this.subscriptions.push(g.TA("mdx-privacy-popup-cancel",this.fCK,this));this.oE()};
- g.h.load=function(){this.player.cancelPlayback();g.A4.prototype.load.call(this);this.GP=new hUp(this.player.G(),this);this.player.zU(this.GP);this.UU=new fhm(this,this.player,this.SV);var T=(T=U8m())?T.currentTime:0;var Q=gu_()?new xo(ok(),void 0):null;T==0&&Q&&(T=uR(PF(Q)));T!==0&&this.bC(T);S2v(this,this.yU,this.yU);this.player.pU(6)};
- g.h.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.JO();this.iW=this.BA;g.vU(this.UU,this.SV);this.SV=this.GP=this.UU=null;g.A4.prototype.unload.call(this);this.player.pU(5);f4(this)};
- g.h.EK=function(){g.o$(this.subscriptions);g.A4.prototype.EK.call(this)};
- g.h.AC=function(T){var Q=g.HT.apply(1,arguments);this.loaded&&this.UU.Pg.apply(this.UU,[T].concat(g.ZH(Q)))};
- g.h.getAdState=function(){return this.I2};
- g.h.E_=function(){return this.SV?PF(this.SV).E_:!1};
- g.h.G0=function(){return this.SV?PF(this.SV).G0:!1};
- g.h.bC=function(T,Q){this.AR=T||0;this.player.publish("progresssync",T,Q);this.player.UM("onVideoProgress",T||0)};
- g.h.getCurrentTime=function(){return this.AR};
- g.h.getDuration=function(){return PF(this.SV).getDuration()||0};
- g.h.xM=function(){var T=PF(this.SV);return T.Y?T.T+Du(T):T.T};
- g.h.bS=function(){return PF(this.SV).j};
- g.h.WG=function(){return wd1(PF(this.SV))};
- g.h.r_=function(){var T=PF(this.SV);return T.S>0?T.S+Du(T):T.S};
- g.h.getProgressState=function(){var T=PF(this.SV),Q=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:T.playerState!=1081&&this.player.Yo(),clipEnd:Q.clipEnd,clipStart:Q.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.xM(),isAtLiveHead:this.isAtLiveHead(),loaded:this.bS(),seekableEnd:this.WG(),seekableStart:this.r_(),offset:0,viewerLivestreamJoinMediaTime:0}};
- g.h.isAtLiveHead=function(){return wd1(PF(this.SV))-this.getCurrentTime()<=1};
- g.h.nextVideo=function(){this.SV&&this.SV.nextVideo()};
- g.h.Bi=function(){this.SV&&this.SV.Bi()};
- g.h.Z_k=function(T){T===1&&(this.uZ=this.SV?PF(this.SV):null)};
- g.h.s_m=function(){var T=gu_()?new xo(ok(),void 0):null;if(T){var Q=this.iW;this.loaded&&this.unload();this.SV=T;this.uZ=null;Q.key!==this.BA.key&&(this.iW=Q,this.load())}else g.od(this.SV),this.SV=null,this.loaded&&(this.unload(),(T=this.uZ)&&T.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(T.videoId,uR(T)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)};
- g.h.oE=function(){var T=[this.BA],Q=T.concat,k=ouE();AR()&&g.cy("yt-remote-cast-available")&&k.push({key:"cast-selector-receiver",name:"Cast..."});this.IQ=Q.call(T,k);T=LAm()||this.BA;Gi(this,T);this.player.UM("onMdxReceiversChange")};
- g.h.wh6=function(){var T=LAm();Gi(this,T)};
- g.h.VVB=function(){this.iW=LAm()};
- g.h.DF9=function(){this.kA=!0;f4(this);gP=!1;vY&&qk(vY,1);vY=null};
- g.h.fCK=function(){this.kA=!1;f4(this);Gi(this,this.BA);this.iW=this.BA;gP=!1;vY=null;this.player.playVideo()};
- g.h.R2=function(T,Q){switch(T){case "casting":return this.loaded;case "receivers":return this.IQ;case "currentReceiver":return Q&&(Q.key==="cast-selector-receiver"?B1E():Gi(this,Q)),this.loaded?this.iW:this.BA;case "quickCast":return this.IQ.length===2&&this.IQ[1].key==="cast-selector-receiver"?(Q&&B1E(),!0):!1}};
- g.h.RF=function(){this.SV.RF()};
- g.h.cH=function(){return!1};
- g.h.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
- g.h.isLoggedIn=function(){var T,Q;return((T=g.$i("PLAYER_CONFIG"))==null?void 0:(Q=T.args)==null?void 0:Q.authuser)!==void 0?!0:!(!g.$i("SESSION_INDEX")&&!g.$i("LOGGED_IN"))};g.ND("remote",sPE);})(_yt_player);
|