(function(g){var window=this;var Kxa=function(a,b){return g.Sb(a,b)},I6=function(a){g.sm(a,"zx",g.xb()); return a},J6=function(a,b,c){g.xa(c)||(c=[String(c)]); g.vm(a.g,b,c)},Lxa=function(a,b){var c=[]; g.ek(b,function(a){try{var b=g.PC.prototype.o.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.t(b)?g.OC(b)&&c.push(a):c.push(a)},a); return c},Mxa=function(a,b){var c=Lxa(a,b); (0,g.C)(c,function(a){g.PC.prototype.remove.call(this,a)},a)},Nxa=function(){var a=g.iG; Mxa(a,a.g.Yd(!0))},Oxa=function(a,b,c,d){var e=new g.jm(null,void 0); a&&g.km(e,a);b&&g.lm(e,b);c&&g.mm(e,c);d&&g.nm(e,d);return e},Pxa=function(a){g.wF[a]&&(a=g.wF[a],(0,g.C)(a,function(a){g.uF[a]&&delete g.uF[a]}),a.length=0)},Qxa=function(a){var b=g.tF(); if(b)if(b.clear(a),a)Pxa(a);else for(var c in g.wF)Pxa(c)},K6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.A=!1;this.capabilities=new window.Set;this.experiments=new window.Set;this.theme="u";new g.dm;this.g=this.o="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Rxa(this,a.capabilities||""),Sxa(this,a.experiments||""),this.o=a.remoteControllerUrl||"", this.g=a.localChannelEncryptionKey||"")},Rxa=function(a,b){a.capabilities.clear(); (0,g.Gd)(b.split(","),g.Da(Kxa,Txa)).forEach(function(b){a.capabilities.add(b)})},Sxa=function(a,b){a.experiments.clear(); b.split(",").forEach(function(b){a.experiments.add(b)})},L6=function(a){a=a||{}; this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},M6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Uxa=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},Vxa=function(a){return new L6(a)},Wxa=function(a){return g.xa(a)?(0,g.J)(a,Vxa):[]},N6=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},O6=function(a){return g.xa(a)?"["+(0,g.J)(a,N6).join(",")+"]":"null"},P6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0; return("x"==a?b:b&3|8).toString(16)})},Xxa=function(a){return(0,g.J)(a,function(a){return{key:a.id, name:a.name}})},Q6=function(a,b){return g.Ia(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})},R6=function(a,b){return g.Ia(a,function(a){return M6(a,b)})},S6=function(){var a=g.lG("yt-remote-connected-devices")||[]; g.eb(a);return a},Yxa=function(a){if(g.Na(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.J)(a,function(a,b){return 0==b?a:a.substring(c.length)})},Zxa=function(a){g.kG("yt-remote-connected-devices",a,86400)},U6=function(){if(T6)return T6; var a=g.lG("yt-remote-device-id");a||(a=P6(),g.kG("yt-remote-device-id",a,31536E3));for(var b=S6(),c=1,d=a;g.D(b,d);)c++,d=a+"#"+c;return T6=d},V6=function(){var a=S6(),b=U6(); g.D(a,b);g.qG()&&g.gb(a,b);a=Yxa(a);if(g.Na(a))try{g.oG.remove("remote_sid","/","youtube.com")}catch(c){}else try{g.pG("remote_sid",a.join(","),-1)}catch(c){}},$xa=function(){return g.lG("yt-remote-session-browser-channel")},aya=function(){return g.lG("yt-remote-local-screens")||[]},bya=function(){g.kG("yt-remote-lounge-token-expiration",!0,86400)},cya=function(a){5=lya.length)Z6(); else{var b=lya[a],c="chrome-extension://"+b+mya;0<=$6.indexOf(b)?kya(c,function(d){d?(window.chrome.cast=window.chrome.cast||{},window.chrome.cast.extensionId=b,a7(c,Z6)):b7(a+1)}):a7(c,function(){b7(a+1)})}},a7=function(a,b,c){var d=window.document.createElement("script"); d.onerror=b;c&&(d.onload=c);d.src=a;(window.document.head||window.document.documentElement).appendChild(d)},c7=function(a){return 0<=window.navigator.userAgent.indexOf(a)},Z6=function(){var a=jya(); a&&a(!1,"No cast extension found")},oya=function(){if(nya){var a=2,b=jya(),c=function(){a--; 0==a&&b&&b(!0)}; window.__onGCastApiAvailable=c;a7("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",Z6,c)}},pya=function(){if(c7("CriOS")){var a=window.__gCrWeb&&window.__gCrWeb.message&&window.__gCrWeb.message.invokeOnHost; if(a){oya();a({command:"cast.sender.init"});return}}if(!window.chrome||c7("Edge"))Z6();else if(oya(),c7("Android")&&c7("Chrome/")&&window.navigator.presentation){a="";var b=iya();55<=b?a="55":50<=b&&(a="50");a7("//www.gstatic.com/eureka/clank"+a+mya,Z6)}else b7(0)},d7=function(a,b,c){g.M.call(this); this.D=null!=c?(0,g.z)(a,c):a;this.uc=b;this.C=(0,g.z)(this.NH,this);this.g=!1;this.o=0;this.A=this.Ba=null;this.B=[]},e7=function(){},f7=function(a,b,c,d){this.g=a; this.A=b;this.G=c;this.F=d||1;this.C=45E3;this.B=new g.zm(this);this.o=new g.ng;this.o.setInterval(250)},rya=function(a,b,c){a.qj=1; a.nh=I6(b.clone());a.Ki=c;a.D=!0;qya(a,null)},g7=function(a,b,c,d,e){a.qj=1; a.nh=I6(b.clone());a.Ki=null;a.D=c;e&&(a.qC=!1);qya(a,d)},qya=function(a,b){a.Vj=(0,g.H)(); h7(a);a.Hh=a.nh.clone();J6(a.Hh,"t",a.F);a.Tl=0;a.Oc=a.g.Rq(a.g.Nl()?b:null);0b.length)return i7;var e=b.substr(d,c);a.Tl=d+c;return e},wya=function(a,b){a.Vj=(0,g.H)(); h7(a);var c=b?window.location.hostname:"";a.Hh=a.nh.clone();g.sm(a.Hh,"DOMAIN",c);g.sm(a.Hh,"t",a.F);try{a.xf=new window.ActiveXObject("htmlfile")}catch(n){l7(a);a.oh=7;j7(22);m7(a);return}var d="";if(b){for(var e="",f=0;f"==k)e+="\\x3e";else{var l=k;if(l in n7)k=n7[l];else if(l in vya)k=n7[l]=vya[l];else{var m=l.charCodeAt(0);if(31m)k=l;else{if(256>m){if(k="\\x",16>m||256m&&(k+="0");k+= m.toString(16).toUpperCase()}k=n7[l]=k}e+=k}}d+='