(function(){var g,aa=aa||{},l=this;function n(a){return void 0!==a}function p(a,b,c){a=a.split(".");c=c||l;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c[d]?c=c[d]:c=c[d]={}}function r(a,b){for(var c=a.split("."),d=b||l,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function s(){}function ba(a){a.getInstance=function(){return a.X?a.X:a.X=new a}}
function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function t(a){return"array"==ca(a)}function da(a){var b=ca(a);return"array"==b||"object"==b&&"number"==typeof a.length}function u(a){return"string"==typeof a}function fa(a){return"number"==typeof a}function ga(a){return"function"==ca(a)}function ha(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ia(a){return a[ja]||(a[ja]=++ka)}var ja="closure_uid_"+(1E9*Math.random()>>>0),ka=0;
function la(a,b,c){return a.call.apply(a.bind,arguments)}function ma(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function v(a,b,c){v=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?la:ma;return v.apply(null,arguments)}
function na(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=c.slice();b.push.apply(b,arguments);return a.apply(this,b)}}var w=Date.now||function(){return+new Date};function x(a,b){function c(){}c.prototype=b.prototype;a.L=b.prototype;a.prototype=new c;a.base=function(a,c,f){return b.prototype[c].apply(a,Array.prototype.slice.call(arguments,2))}}
Function.prototype.bind=Function.prototype.bind||function(a,b){if(1<arguments.length){var c=Array.prototype.slice.call(arguments,1);c.unshift(this,a);return v.apply(null,c)}return v(this,a)};function oa(a){if(Error.captureStackTrace)Error.captureStackTrace(this,oa);else{var b=Error().stack;b&&(this.stack=b)}a&&(this.message=String(a))}x(oa,Error);oa.prototype.name="CustomError";var pa;var qa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ra(a){return decodeURIComponent(a.replace(/\+/g," "))}
function sa(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'},c;c=l.document.createElement("div");return a.replace(ta,function(a,e){var f=b[a];if(f)return f;if("#"==e.charAt(0)){var h=Number("0"+e.substr(1));isNaN(h)||(f=String.fromCharCode(h))}f||(c.innerHTML=a+" ",f=c.firstChild.nodeValue.slice(0,-1));return b[a]=f})}
function ua(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"&";case "lt":return"<";case "gt":return">";case "quot":return'"';default:if("#"==c.charAt(0)){var d=Number("0"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})}var ta=/&([^;\s<&]+);?/g;function y(a,b){return-1!=a.indexOf(b)}
function va(a,b){for(var c=0,d=qa(String(a)).split("."),e=qa(String(b)).split("."),f=Math.max(d.length,e.length),h=0;0==c&&h<f;h++){var k=d[h]||"",m=e[h]||"",q=RegExp("(\\d*)(\\D*)","g"),U=RegExp("(\\d*)(\\D*)","g");do{var ea=q.exec(k)||["","",""],Rc=U.exec(m)||["","",""];if(0==ea[0].length&&0==Rc[0].length)break;c=wa(0==ea[1].length?0:parseInt(ea[1],10),0==Rc[1].length?0:parseInt(Rc[1],10))||wa(0==ea[2].length,0==Rc[2].length)||wa(ea[2],Rc[2])}while(0==c)}return c}
function wa(a,b){return a<b?-1:a>b?1:0}function xa(a){for(var b=0,c=0;c<a.length;++c)b=31*b+a.charCodeAt(c),b%=4294967296;return b}function ya(){return"transform".replace(/\-([a-z])/g,function(a,b){return b.toUpperCase()})}function za(a){var b=u(void 0)?"undefined".replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08"):"\\s";return a.replace(new RegExp("(^"+(b?"|["+b+"]+":"")+")([a-z])","g"),function(a,b,e){return b+e.toUpperCase()})};function Aa(){};var z=Array.prototype,Ba=z.indexOf?function(a,b,c){return z.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(u(a))return u(b)&&1==b.length?a.indexOf(b,c):-1;for(;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},A=z.forEach?function(a,b,c){z.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)f in e&&b.call(c,e[f],f,a)},Ca=z.filter?function(a,b,c){return z.filter.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=[],f=0,h=u(a)?
a.split(""):a,k=0;k<d;k++)if(k in h){var m=h[k];b.call(c,m,k,a)&&(e[f++]=m)}return e},B=z.map?function(a,b,c){return z.map.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=Array(d),f=u(a)?a.split(""):a,h=0;h<d;h++)h in f&&(e[h]=b.call(c,f[h],h,a));return e},Da=z.some?function(a,b,c){return z.some.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return!0;return!1},Ea=z.every?function(a,b,c){return z.every.call(a,b,c)}:function(a,b,c){for(var d=
a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};function Fa(a,b,c){b=Ga(a,b,c);return 0>b?null:u(a)?a.charAt(b):a[b]}function Ga(a,b,c){for(var d=a.length,e=u(a)?a.split(""):a,f=0;f<d;f++)if(f in e&&b.call(c,e[f],f,a))return f;return-1}function Ha(a,b){return 0<=Ba(a,b)}function Ia(a){return 0==a.length}function Ja(){var a=Ka;if(!t(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function La(a,b){Ha(a,b)||a.push(b)}
function Ma(a,b){var c=Ba(a,b),d;(d=0<=c)&&z.splice.call(a,c,1);return d}function Na(a,b){var c=Ga(a,b,void 0);0<=c&&z.splice.call(a,c,1)}function Oa(a){return z.concat.apply(z,arguments)}function Pa(a){var b=a.length;if(0<b){for(var c=Array(b),d=0;d<b;d++)c[d]=a[d];return c}return[]}
function Qa(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c],e;if(t(d)||(e=da(d))&&Object.prototype.hasOwnProperty.call(d,"callee"))a.push.apply(a,d);else if(e)for(var f=a.length,h=d.length,k=0;k<h;k++)a[f+k]=d[k];else a.push(d)}}function Ra(a,b,c,d){return z.splice.apply(a,Sa(arguments,1))}function Sa(a,b,c){return 2>=arguments.length?z.slice.call(a,b):z.slice.call(a,b,c)}
function Ta(a,b,c){if(!da(a)||!da(b)||a.length!=b.length)return!1;var d=a.length;c=c||Ua;for(var e=0;e<d;e++)if(!c(a[e],b[e]))return!1;return!0}function Va(a,b){return a>b?1:a<b?-1:0}function Ua(a,b){return a===b};function Wa(a,b){for(var c in a)b.call(void 0,a[c],c,a)}function Xa(a,b,c){var d={},e;for(e in a)b.call(c,a[e],e,a)&&(d[e]=a[e]);return d}function Ya(a){var b=0,c;for(c in a)b++;return b}function Za(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b}function $a(a){var b=[],c=0,d;for(d in a)b[c++]=d;return b}function ab(a){var b=bb,c;for(c in b)if(a.call(void 0,b[c],c,b))return c}function cb(a){for(var b in a)return!1;return!0}function db(a){var b={},c;for(c in a)b[c]=a[c];return b}
function eb(a){var b=ca(a);if("object"==b||"array"==b){if(a.clone)return a.clone();var b="array"==b?[]:{},c;for(c in a)b[c]=eb(a[c]);return b}return a}function fb(a){var b={},c;for(c in a)b[a[c]]=c;return b}var gb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
function hb(a,b){for(var c,d,e=1;e<arguments.length;e++){d=arguments[e];for(c in d)a[c]=d[c];for(var f=0;f<gb.length;f++)c=gb[f],Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}}function ib(a){var b=arguments.length;if(1==b&&t(arguments[0]))return ib.apply(null,arguments[0]);for(var c={},d=0;d<b;d++)c[arguments[d]]=!0;return c};function jb(a,b,c){a&&(a.dataset?a.dataset[kb(b)]=c:a.setAttribute("data-"+b,c))}function C(a,b){return a?a.dataset?a.dataset[kb(b)]:a.getAttribute("data-"+b):null}var lb={};function kb(a){return lb[a]||(lb[a]=String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()}))};function D(){this.Z=this.Z;this.K=this.K}D.prototype.Z=!1;D.prototype.H=function(){return this.Z};D.prototype.dispose=function(){this.Z||(this.Z=!0,this.F())};function mb(a,b){a.K||(a.K=[]);a.K.push(n(void 0)?v(b,void 0):b)}D.prototype.F=function(){if(this.K)for(;this.K.length;)this.K.shift()()};function E(a){a&&"function"==typeof a.dispose&&a.dispose()}function nb(a){for(var b=0,c=arguments.length;b<c;++b){var d=arguments[b];da(d)?nb.apply(null,d):E(d)}};function F(){D.call(this);this.g=[];this.fa={}}x(F,D);g=F.prototype;g.Ic=1;g.Fb=0;g.subscribe=function(a,b,c){var d=this.fa[a];d||(d=this.fa[a]=[]);var e=this.Ic;this.g[e]=a;this.g[e+1]=b;this.g[e+2]=c;this.Ic=e+3;d.push(e);return e};g.unsubscribe=function(a,b,c){if(a=this.fa[a]){var d=this.g;if(a=Fa(a,function(a){return d[a+1]==b&&d[a+2]==c}))return this.ma(a)}return!1};
g.ma=function(a){if(0!=this.Fb)return this.j||(this.j=[]),this.j.push(a),!1;var b=this.g[a];if(b){var c=this.fa[b];c&&Ma(c,a);delete this.g[a];delete this.g[a+1];delete this.g[a+2]}return!!b};g.publish=function(a,b){var c=this.fa[a];if(c){this.Fb++;for(var d=Sa(arguments,1),e=0,f=c.length;e<f;e++){var h=c[e];this.g[h+1].apply(this.g[h+2],d)}this.Fb--;if(this.j&&0==this.Fb)for(;c=this.j.pop();)this.ma(c);return 0!=e}return!1};
g.clear=function(a){if(a){var b=this.fa[a];b&&(A(b,this.ma,this),delete this.fa[a])}else this.g.length=0,this.fa={}};g.Na=function(a){if(a){var b=this.fa[a];return b?b.length:0}a=0;for(b in this.fa)a+=this.Na(b);return a};g.F=function(){F.L.F.call(this);delete this.g;delete this.fa;delete this.j};var ob=window.yt&&window.yt.config_||{};p("yt.config_",ob,void 0);p("yt.tokens_",window.yt&&window.yt.tokens_||{},void 0);var pb=window.yt&&window.yt.msgs_||{};p("yt.msgs_",pb,void 0);function qb(a){rb(ob,arguments)}function G(a,b){return a in ob?ob[a]:b}function sb(){return G("XSRF_TOKEN")}function H(a,b){ga(a)&&(a=tb(a));return window.setTimeout(a,b)}function ub(a,b){ga(a)&&(a=tb(a));window.setInterval(a,b)}function I(a){window.clearTimeout(a)}
function tb(a){return a&&window.yterr?function(){try{return a.apply(this,arguments)}catch(b){throw vb(b),b;}}:a}function vb(a,b){var c=r("yt.www.errors.log");c?c(a,b):(c=G("ERRORS")||[],c.push([a,b]),qb("ERRORS",c))}
function wb(){var a={},b="FLASH_UPGRADE"in pb?pb.FLASH_UPGRADE:'You need to upgrade your Adobe Flash Player to watchthis video. <br> <a href="http://get.adobe.com/flashplayer/">Download it from Adobe.</a>';if(b)for(var c in a)b=b.replace(new RegExp("\\$"+c,"gi"),function(){return a[c]});return b}function rb(a,b){if(1<b.length){var c=b[0];a[c]=b[1]}else{var d=b[0];for(c in d)a[c]=d[c]}}var xb="Microsoft Internet Explorer"==navigator.appName;var yb=r("yt.pubsub.instance_")||new F;F.prototype.subscribe=F.prototype.subscribe;F.prototype.unsubscribeByKey=F.prototype.ma;F.prototype.publish=F.prototype.publish;F.prototype.clear=F.prototype.clear;p("yt.pubsub.instance_",yb,void 0);var zb=r("yt.pubsub.subscribedKeys_")||{};p("yt.pubsub.subscribedKeys_",zb,void 0);var Ab=r("yt.pubsub.topicToKeys_")||{};p("yt.pubsub.topicToKeys_",Ab,void 0);var Bb=r("yt.pubsub.isSynchronous_")||{};p("yt.pubsub.isSynchronous_",Bb,void 0);
var Cb=r("yt.pubsub.skipSubId_")||null;p("yt.pubsub.skipSubId_",Cb,void 0);function J(a,b,c){var d=Db();if(d){var e=d.subscribe(a,function(){if(!Cb||Cb!=e){var d=arguments,h=function(){zb[e]&&b.apply(c||window,d)};try{Bb[a]?h():H(h,0)}catch(k){vb(k)}}},c);zb[e]=!0;Ab[a]||(Ab[a]=[]);Ab[a].push(e);return e}return 0}function Eb(a){var b=Db();b&&("number"==typeof a?a=[a]:"string"==typeof a&&(a=[parseInt(a,10)]),A(a,function(a){b.unsubscribeByKey(a);delete zb[a]}))}
function K(a,b){var c=Db();return c?c.publish.apply(c,arguments):!1}function Fb(a,b){Bb[a]=!0;var c=Db();c&&c.publish.apply(c,arguments);Bb[a]=!1}function Gb(a){Ab[a]&&(a=Ab[a],A(a,function(a){zb[a]&&delete zb[a]}),a.length=0)}function Hb(a){var b=Db();if(b)if(b.clear(a),a)Gb(a);else for(var c in Ab)Gb(c)}function Db(){return r("yt.pubsub.instance_")};function Ib(a,b){if(window.spf){var c="";if(a){var d=a.indexOf("jsbin/"),e=a.lastIndexOf(".js"),f=d+6;-1<d&&-1<e&&e>f&&(c=a.substring(f,e),c=c.replace(Jb,""),c=c.replace(Kb,""),c=c.replace("debug-",""),c=c.replace("tracing-",""))}spf.script.load(a,c,b)}else Lb(a,b)}function Lb(a,b){var c=Mb(a),d=document.getElementById(c),e=d&&C(d,"loaded"),f=d&&!e;if(e)b&&b();else{if(b){var e=J(c,b),h=""+ia(b);Nb[h]=e}f||(d=Ob(a,c,function(){C(d,"loaded")||(jb(d,"loaded","true"),K(c),H(na(Hb,c),0))}))}}
function Ob(a,b,c){var d=document.createElement("script");d.id=b;d.onload=function(){c&&setTimeout(c,0)};d.onreadystatechange=function(){switch(d.readyState){case "loaded":case "complete":d.onload()}};d.src=a;a=document.getElementsByTagName("head")[0]||document.body;a.insertBefore(d,a.firstChild);return d}function Mb(a){var b=document.createElement("a");b.href=a;a=b.href.replace(/^[a-zA-Z]+:\/\//,"//");return"js-"+xa(a)}
var Jb=/\.vflset|-vfl[a-zA-Z0-9_+=-]+/,Kb=/-[a-zA-Z]{2,3}_[a-zA-Z]{2,3}(?=(\/|$))/,Nb={};var Pb=null;function Qb(){var a=G("BG_I",null),b=G("BG_IU",null),c=G("BG_P");b?Ib(b,function(){Pb=new botguard.bg(c)}):a&&(eval(a),Pb=new botguard.bg(c))}function Rb(){return null!=Pb}function Sb(){return Pb?Pb.invoke():null};function Tb(a){if(a.classList)return a.classList;a=a.className;return u(a)&&a.match(/\S+/g)||[]}function Ub(a,b){return a.classList?a.classList.contains(b):Ha(Tb(a),b)}function Vb(a,b){a.classList?a.classList.add(b):Ub(a,b)||(a.className+=0<a.className.length?" "+b:b)}function Wb(a,b){a.classList?a.classList.remove(b):Ub(a,b)&&(a.className=Ca(Tb(a),function(a){return a!=b}).join(" "))}function Xb(a,b,c){c?Vb(a,b):Wb(a,b)};function L(a,b){this.x=n(a)?a:0;this.y=n(b)?b:0}L.prototype.clone=function(){return new L(this.x,this.y)};L.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};L.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Yb(a,b){this.width=a;this.height=b}Yb.prototype.clone=function(){return new Yb(this.width,this.height)};Yb.prototype.isEmpty=function(){return!(this.width*this.height)};Yb.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Yb.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var M;t:{var Zb=l.navigator;if(Zb){var $b=Zb.userAgent;if($b){M=$b;break t}}M=""};var ac,bc=y(M,"Opera")||y(M,"OPR"),N=y(M,"Trident")||y(M,"MSIE"),cc=y(M,"Gecko")&&!y(M.toLowerCase(),"webkit")&&!(y(M,"Trident")||y(M,"MSIE")),dc=y(M.toLowerCase(),"webkit"),ec=l.navigator||null,fc=ec&&ec.platform||"";ac=y(fc,"Mac");var gc=y(fc,"Win"),hc=l.navigator||null,ic=!!hc&&y(hc.appVersion||"","X11");function jc(){var a=l.document;return a?a.documentMode:void 0}
var kc=function(){var a="",b;if(bc&&l.opera)return a=l.opera.version,ga(a)?a():a;cc?b=/rv\:([^\);]+)(\)|;)/:N?b=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:dc&&(b=/WebKit\/(\S+)/);b&&(a=(a=b.exec(M))?a[1]:"");return N&&(b=jc(),b>parseFloat(a))?String(b):a}(),lc={};function mc(a){return lc[a]||(lc[a]=0<=va(kc,a))}function nc(a){return N&&oc>=a}var pc=l.document,oc=pc&&N?jc()||("CSS1Compat"==pc.compatMode?parseInt(kc,10):5):void 0;!cc&&!N||N&&nc(9)||cc&&mc("1.9.1");N&&mc("9");function qc(a){return a?new rc(sc(a)):pa||(pa=new rc)}function tc(a){return u(a)?document.getElementById(a):a}function uc(a){var b=document;return u(a)?b.getElementById(a):a}function vc(a){var b=document;return b.querySelectorAll&&b.querySelector?b.querySelectorAll("."+a):wc(a,void 0)}
function wc(a,b){var c,d,e,f;c=document;c=b||c;if(c.querySelectorAll&&c.querySelector&&a)return c.querySelectorAll(""+(a?"."+a:""));if(a&&c.getElementsByClassName){var h=c.getElementsByClassName(a);return h}h=c.getElementsByTagName("*");if(a){f={};for(d=e=0;c=h[d];d++){var k=c.className;"function"==typeof k.split&&Ha(k.split(/\s+/),a)&&(f[e++]=c)}f.length=e;return f}return h}
function xc(a){var b=!dc&&yc(a)?a.documentElement:a.body||a.documentElement;a=a.parentWindow||a.defaultView;return N&&mc("10")&&a.pageYOffset!=b.scrollTop?new L(b.scrollLeft,b.scrollTop):new L(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}function yc(a){return"CSS1Compat"==a.compatMode}function zc(a){if(!a)return null;if(a.firstChild)return a.firstChild;for(;a&&!a.nextSibling;)a=a.parentNode;return a?a.nextSibling:null}
function Ac(a){if(!a)return null;if(!a.previousSibling)return a.parentNode;for(a=a.previousSibling;a&&a.lastChild;)a=a.lastChild;return a}function sc(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Bc(a){var b=Cc.Ne;return b?Dc(a,function(a){return!b||u(a.className)&&Ha(a.className.split(/\s+/),b)},!0,void 0):null}function Dc(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}
function rc(a){this.g=a||l.document||document}rc.prototype.createElement=function(a){return this.g.createElement(a)};rc.prototype.appendChild=function(a,b){a.appendChild(b)};rc.prototype.contains=function(a,b){if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||Boolean(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a};var Ec=dc?"webkit":cc?"moz":N?"ms":bc?"o":"",Fc=r("yt.dom.getNextId_");if(!Fc){Fc=function(){return++Gc};p("yt.dom.getNextId_",Fc,void 0);var Gc=0}function Hc(){var a=document,b;Da(["fullscreenElement","fullScreenElement"],function(c){c in a?b=a[c]:(c=Ec+c.charAt(0).toUpperCase()+c.substr(1),b=c in a?a[c]:void 0);return!!b});return b};function Ic(a){if(a=a||window.event){for(var b in a)b in Jc||(this[b]=a[b]);this.Ob=a;(b=a.target||a.srcElement)&&3==b.nodeType&&(b=b.parentNode);this.target=b;if(b=a.relatedTarget)try{b=b.nodeName?b:null}catch(c){b=null}else"mouseover"==this.type?b=a.fromElement:"mouseout"==this.type&&(b=a.toElement);this.relatedTarget=b;this.clientX=void 0!=a.clientX?a.clientX:a.pageX;this.clientY=void 0!=a.clientY?a.clientY:a.pageY;this.keyCode=a.keyCode?a.keyCode:a.which;this.charCode=a.charCode||("keypress"==
this.type?this.keyCode:0);this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.shiftKey;"MozMousePixelScroll"==this.type?(this.wheelDeltaX=a.axis==a.HORIZONTAL_AXIS?a.detail:0,this.wheelDeltaY=a.axis==a.HORIZONTAL_AXIS?0:a.detail):window.opera?(this.wheelDeltaX=0,this.wheelDeltaY=a.detail):0==a.wheelDelta%120?"WebkitTransform"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf("Mac")?(this.wheelDeltaX=a.wheelDeltaX/-30,this.wheelDeltaY=a.wheelDeltaY/-30):(this.wheelDeltaX=
a.wheelDeltaX/-1.2,this.wheelDeltaY=a.wheelDeltaY/-1.2):(this.wheelDeltaX=0,this.wheelDeltaY=a.wheelDelta/-1.6):(this.wheelDeltaX=a.wheelDeltaX/-3,this.wheelDeltaY=a.wheelDeltaY/-3)}}g=Ic.prototype;g.Ob=null;g.type="";g.target=null;g.relatedTarget=null;g.currentTarget=null;g.data=null;g.source=null;g.state=null;g.keyCode=0;g.charCode=0;g.altKey=!1;g.ctrlKey=!1;g.shiftKey=!1;g.clientX=0;g.clientY=0;g.wheelDeltaX=0;g.wheelDeltaY=0;
g.preventDefault=function(){this.Ob.returnValue=!1;this.Ob.preventDefault&&this.Ob.preventDefault()};var Jc={stopImmediatePropagation:1,stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var bb=r("yt.events.listeners_")||{};p("yt.events.listeners_",bb,void 0);var Kc=r("yt.events.counter_")||{count:0};p("yt.events.counter_",Kc,void 0);function Lc(a,b,c,d){return ab(function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}
function O(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return"";d=!!d;var e=Lc(a,b,c,d);if(e)return e;var e=++Kc.count+"",f=!("mouseenter"!=b&&"mouseleave"!=b||!a.addEventListener||"onmouseenter"in document),h;h=f?function(d){d=new Ic(d);if(!Dc(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new Ic(b);b.currentTarget=a;return c.call(a,b)};h=tb(h);bb[e]=[a,b,c,h,d];a.addEventListener?"mouseenter"==b&&f?a.addEventListener("mouseover",
h,d):"mouseleave"==b&&f?a.addEventListener("mouseout",h,d):"mousewheel"==b&&"MozBoxSizing"in document.documentElement.style?a.addEventListener("MozMousePixelScroll",h,d):a.addEventListener(b,h,d):a.attachEvent("on"+b,h);return e}function Mc(a){a&&("string"==typeof a&&(a=[a]),A(a,function(a){if(a in bb){var c=bb[a],d=c[0],e=c[1],f=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,f,c):d.detachEvent&&d.detachEvent("on"+e,f);delete bb[a]}}))};function Nc(a){this.g=a}var Oc=/\s*;\s*/;g=Nc.prototype;g.set=function(a,b,c,d,e,f){if(/[;=\s]/.test(a))throw Error('Invalid cookie name "'+a+'"');if(/[;\r\n]/.test(b))throw Error('Invalid cookie value "'+b+'"');n(c)||(c=-1);e=e?";domain="+e:"";d=d?";path="+d:"";f=f?";secure":"";c=0>c?"":0==c?";expires="+(new Date(1970,1,1)).toUTCString():";expires="+(new Date(w()+1E3*c)).toUTCString();this.g.cookie=a+"="+b+e+d+c+f};
g.get=function(a,b){for(var c=a+"=",d=(this.g.cookie||"").split(Oc),e=0,f;f=d[e];e++){if(0==f.lastIndexOf(c,0))return f.substr(c.length);if(f==a)return""}return b};g.remove=function(a,b,c){var d=n(this.get(a));this.set(a,"",0,b,c);return d};g.ta=function(){return Pc(this).keys};g.qa=function(){return Pc(this).values};g.isEmpty=function(){return!this.g.cookie};g.Na=function(){return this.g.cookie?(this.g.cookie||"").split(Oc).length:0};g.clear=function(){for(var a=Pc(this).keys,b=a.length-1;0<=b;b--)this.remove(a[b])};
function Pc(a){a=(a.g.cookie||"").split(Oc);for(var b=[],c=[],d,e,f=0;e=a[f];f++)d=e.indexOf("="),-1==d?(b.push(""),c.push(e)):(b.push(e.substring(0,d)),c.push(e.substring(d+1)));return{keys:b,values:c}}var Qc=new Nc(document);Qc.j=3950;function Sc(a,b,c){Qc.set(""+a,b,c,"/","youtube.com")}function Tc(a,b){return Qc.get(""+a,b)};function Uc(a,b){a=!!a;p("_lactCookie",a,window);if(null==r("_lact",window)){if(a&&b){var c=Tc("ACTIVITY","-1");p("_lact",parseInt(c,10),window)}else p("_lact",-1,window),Vc();O(document,"keypress",Vc);O(document,"mousedown",Vc);O(document,"mouseup",Vc)}}function Vc(){var a=r("_lact",window);null==a&&(Uc(),a=r("_lact",window));var b=w();p("_lact",b,window);r("_lactCookie",window)&&1E3<=b-a&&Sc("ACTIVITY",""+b)}function Wc(){var a=r("_lact",window);return null==a?-1:Math.max(w()-a,0)};var Xc=/^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/;function Yc(a){if(Zc){Zc=!1;var b=l.location;if(b){var c=b.href;if(c&&(c=$c(c))&&c!=b.hostname)throw Zc=!0,Error();}}return a.match(Xc)}var Zc=dc;function $c(a){return(a=Yc(a)[3]||null)?decodeURI(a):a}function ad(a){if(a[1]){var b=a[0],c=b.indexOf("#");0<=c&&(a.push(b.substr(c)),a[0]=b=b.substr(0,c));c=b.indexOf("?");0>c?a[1]="?":c==b.length-1&&(a[1]=void 0)}return a.join("")}
function bd(a,b,c){if(t(b))for(var d=0;d<b.length;d++)bd(a,String(b[d]),c);else null!=b&&c.push("&",a,""===b?"":"=",encodeURIComponent(String(b)))}function cd(a,b,c){Math.max(b.length-(c||0),0);for(c=c||0;c<b.length;c+=2)bd(b[c],b[c+1],a);return a}function dd(a,b){for(var c in b)bd(c,b[c],a);return a}function ed(a){a=dd([],a);a[0]="";return a.join("")}function fd(a,b){return ad(2==arguments.length?cd([a],arguments[1],0):cd([a],arguments,1))}function gd(a,b){return ad(dd([a],b))};function hd(a){"?"==a.charAt(0)&&(a=a.substr(1));a=a.split("&");for(var b={},c=0,d=a.length;c<d;c++){var e=a[c].split("=");if(1==e.length&&e[0]||2==e.length){var f=ra(e[0]||""),e=ra(e[1]||"");f in b?t(b[f])?Qa(b[f],e):b[f]=[b[f],e]:b[f]=e}}return b}var id=$c;function jd(a,b){var c=a.split("#",2);a=c[0];var c=1<c.length?"#"+c[1]:"",d=a.split("?",2);a=d[0];var d=hd(d[1]||""),e;for(e in b)d[e]=b[e];return gd(a,d)+c}
function kd(a){a=id(a);a=null===a?null:a.split(".").reverse();return(null===a?!1:"com"==a[0]&&a[1].match(/^youtube(?:-nocookie)?$/)?!0:!1)||(null===a?!1:"google"==a[1]?!0:"google"==a[2]?"au"==a[0]&&"com"==a[1]?!0:"uk"==a[0]&&"co"==a[1]?!0:!1:!1)};function ld(a,b){var c=$c(a);if(c==$c(window.location.href)||!c&&0==a.lastIndexOf("/",0)){var d=Yc(a),c=d[5],e=d[6],d=d[7],f="";c&&(f+=c);e&&(f+="?"+e);d&&(f+="#"+d);c=f;e=c.indexOf("#");if(c=0>e?c:c.substr(0,e))c="s_tempdata-"+xa(c),e=b?ed(b):"",Sc(c,e,5)}};function md(a,b,c){var d=G("EVENT_ID");d&&(b||(b={}),b.ei||(b.ei=d));b&&ld(a,b);if(c)return!1;(window.ytspf||{}).enabled?spf.navigate(a):window.location=gd(a,{})+"";return!0};var nd="StopIteration"in l?l.StopIteration:Error("StopIteration");function od(){}od.prototype.next=function(){throw nd;};od.prototype.Sa=function(){return this};function pd(a){if(a instanceof od)return a;if("function"==typeof a.Sa)return a.Sa(!1);if(da(a)){var b=0,c=new od;c.next=function(){for(;;){if(b>=a.length)throw nd;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");}
function qd(a,b,c){if(da(a))try{A(a,b,c)}catch(d){if(d!==nd)throw d;}else{a=pd(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==nd)throw e;}}}function rd(a){if(da(a))return Pa(a);a=pd(a);var b=[];qd(a,function(a){b.push(a)});return b};function sd(a,b){this.j={};this.g=[];this.Ba=this.k=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){a instanceof sd?(c=a.ta(),d=a.qa()):(c=$a(a),d=Za(a));for(var e=0;e<c.length;e++)this.set(c[e],d[e])}}g=sd.prototype;g.Na=function(){return this.k};g.qa=function(){td(this);for(var a=[],b=0;b<this.g.length;b++)a.push(this.j[this.g[b]]);return a};g.ta=function(){td(this);return this.g.concat()};
g.equals=function(a,b){if(this===a)return!0;if(this.k!=a.Na())return!1;var c=b||ud;td(this);for(var d,e=0;d=this.g[e];e++)if(!c(this.get(d),a.get(d)))return!1;return!0};function ud(a,b){return a===b}g.isEmpty=function(){return 0==this.k};g.clear=function(){this.j={};this.Ba=this.k=this.g.length=0};g.remove=function(a){return vd(this.j,a)?(delete this.j[a],this.k--,this.Ba++,this.g.length>2*this.k&&td(this),!0):!1};
function td(a){if(a.k!=a.g.length){for(var b=0,c=0;b<a.g.length;){var d=a.g[b];vd(a.j,d)&&(a.g[c++]=d);b++}a.g.length=c}if(a.k!=a.g.length){for(var e={},c=b=0;b<a.g.length;)d=a.g[b],vd(e,d)||(a.g[c++]=d,e[d]=1),b++;a.g.length=c}}g.get=function(a,b){return vd(this.j,a)?this.j[a]:b};g.set=function(a,b){vd(this.j,a)||(this.k++,this.g.push(a),this.Ba++);this.j[a]=b};g.forEach=function(a,b){for(var c=this.ta(),d=0;d<c.length;d++){var e=c[d],f=this.get(e);a.call(b,f,e,this)}};g.clone=function(){return new sd(this)};
g.Sa=function(a){td(this);var b=0,c=this.g,d=this.j,e=this.Ba,f=this,h=new od;h.next=function(){for(;;){if(e!=f.Ba)throw Error("The map has changed since the iterator was created");if(b>=c.length)throw nd;var h=c[b++];return a?h:d[h]}};return h};function vd(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function wd(a){if("function"==typeof a.qa)return a.qa();if(u(a))return a.split("");if(da(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return Za(a)}
function xd(a,b){if("function"==typeof a.forEach)a.forEach(b,void 0);else if(da(a)||u(a))A(a,b,void 0);else{var c;if("function"==typeof a.ta)c=a.ta();else if("function"!=typeof a.qa)if(da(a)||u(a)){c=[];for(var d=a.length,e=0;e<d;e++)c.push(e)}else c=$a(a);else c=void 0;for(var d=wd(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)}};function yd(){};function zd(a){l.setTimeout(function(){throw a;},0)}var Ad;
function Bd(){var a=l.MessageChannel;"undefined"===typeof a&&"undefined"!==typeof window&&window.postMessage&&window.addEventListener&&(a=function(){var a=document.createElement("iframe");a.style.display="none";a.src="";document.documentElement.appendChild(a);var b=a.contentWindow,a=b.document;a.open();a.write("");a.close();var c="callImmediate"+Math.random(),d="file:"==b.location.protocol?"*":b.location.protocol+"//"+b.location.host,a=v(function(a){if(("*"==d||a.origin==d)&&a.data==c)this.port1.onmessage()},
this);b.addEventListener("message",a,!1);this.port1={};this.port2={postMessage:function(){b.postMessage(c,d)}}});if("undefined"!==typeof a&&!y(M,"Trident")&&!y(M,"MSIE")){var b=new a,c={},d=c;b.port1.onmessage=function(){if(n(c.next)){c=c.next;var a=c.gd;c.gd=null;a()}};return function(a){d.next={gd:a};d=d.next;b.port2.postMessage(0)}}return"undefined"!==typeof document&&"onreadystatechange"in document.createElement("script")?function(a){var b=document.createElement("script");b.onreadystatechange=
function(){b.onreadystatechange=null;b.parentNode.removeChild(b);b=null;a();a=null};document.documentElement.appendChild(b)}:function(a){l.setTimeout(a,0)}};function Cd(a,b){Dd||Ed();Fd||(Dd(),Fd=!0);Gd.push(new Hd(a,b))}var Dd;function Ed(){if(l.Promise&&l.Promise.resolve){var a=l.Promise.resolve();Dd=function(){a.then(Id)}}else Dd=function(){var a=Id;!ga(l.setImmediate)||l.Window&&l.Window.prototype.setImmediate==l.setImmediate?(Ad||(Ad=Bd()),Ad(a)):l.setImmediate(a)}}var Fd=!1,Gd=[];function Id(){for(;Gd.length;){var a=Gd;Gd=[];for(var b=0;b<a.length;b++){var c=a[b];try{c.g.call(c.scope)}catch(d){zd(d)}}}Fd=!1}
function Hd(a,b){this.g=a;this.scope=b};function Jd(a,b){this.j=0;this.B=void 0;this.g=this.k=null;this.A=this.o=!1;try{var c=this;a.call(b,function(a){Kd(c,2,a)},function(a){Kd(c,3,a)})}catch(d){Kd(this,3,d)}}function Ld(a){return new Jd(function(b){b(a)})}Jd.prototype.then=function(a,b,c){return Md(this,ga(a)?a:null,ga(b)?b:null,c)};Jd.prototype.then=Jd.prototype.then;Jd.prototype.$goog_Thenable=!0;Jd.prototype.cancel=function(a){0==this.j&&Cd(function(){var b=new Nd(a);Od(this,b)},this)};
function Od(a,b){if(0==a.j)if(a.k){var c=a.k;if(c.g){for(var d=0,e=-1,f=0,h;h=c.g[f];f++)if(h=h.lb)if(d++,h==a&&(e=f),0<=e&&1<d)break;0<=e&&(0==c.j&&1==d?Od(c,b):(d=c.g.splice(e,1)[0],Pd(c,d,3,b)))}}else Kd(a,3,b)}function Qd(a,b){a.g&&a.g.length||2!=a.j&&3!=a.j||Rd(a);a.g||(a.g=[]);a.g.push(b)}
function Md(a,b,c,d){var e={lb:null,Oc:null,Pc:null};e.lb=new Jd(function(a,h){e.Oc=b?function(c){try{var e=b.call(d,c);a(e)}catch(q){h(q)}}:a;e.Pc=c?function(b){try{var e=c.call(d,b);!n(e)&&b instanceof Nd?h(b):a(e)}catch(q){h(q)}}:h});e.lb.k=a;Qd(a,e);return e.lb}Jd.prototype.K=function(a){this.j=0;Kd(this,2,a)};Jd.prototype.D=function(a){this.j=0;Kd(this,3,a)};
function Kd(a,b,c){if(0==a.j){if(a==c)b=3,c=new TypeError("Promise cannot resolve to itself");else{var d;if(c)try{d=!!c.$goog_Thenable}catch(e){d=!1}else d=!1;if(d){a.j=1;c.then(a.K,a.D,a);return}if(ha(c))try{var f=c.then;if(ga(f)){Sd(a,c,f);return}}catch(h){b=3,c=h}}a.B=c;a.j=b;Rd(a);3!=b||c instanceof Nd||Td(a,c)}}function Sd(a,b,c){function d(b){f||(f=!0,a.D(b))}function e(b){f||(f=!0,a.K(b))}a.j=1;var f=!1;try{c.call(b,e,d)}catch(h){d(h)}}function Rd(a){a.o||(a.o=!0,Cd(a.Z,a))}
Jd.prototype.Z=function(){for(;this.g&&this.g.length;){var a=this.g;this.g=[];for(var b=0;b<a.length;b++)Pd(this,a[b],this.j,this.B)}this.o=!1};function Pd(a,b,c,d){if(2==c)b.Oc(d);else{if(b.lb)for(;a&&a.A;a=a.k)a.A=!1;b.Pc(d)}}function Td(a,b){a.A=!0;Cd(function(){a.A&&Ud.call(null,b)})}var Ud=zd;function Nd(a){oa.call(this,a)}x(Nd,oa);Nd.prototype.name="cancel";function Vd(a){this.j=a;this.g=null;var b=this;a.then(function(a){b.g=a})}function Wd(a,b){var c=b||{},d=Xd().then(function(b){return b(a,{apiKey:c.Ze||c.apiKey,environment:c.$e||c.environment,helpCenterPath:c.af||c.helpCenterPath,locale:c.locale||c.locale,productData:c.bf||c.productData,receiverUri:c.cf||c.receiverUri,theme:c.theme||c.theme,window:c.window||c.window})});return new Vd(d)}var Yd=null;
function Xd(){if(Yd)return Yd;var a=r("help.service.Lazy.create");return a?Yd=Ld(a):Yd=(new Jd(function(a,c){var d=document.createElement("script");d.async=!0;d.src="https://www.gstatic.com/inproduct_help/service/lazy.min.js";d.onload=d.onreadystatechange=function(){d.readyState&&"loaded"!=d.readyState&&"complete"!=d.readyState||a(null)};d.onerror=c;(document.head||document.getElementsByTagName("head")[0]).appendChild(d)})).then(function(){var a=r("help.service.Lazy.create");if(!a)throw Error("Failed to load help.service.Lazy.create from https://www.gstatic.com/inproduct_help/service/lazy.min.js");
return a})}Vd.prototype.k=function(a){Zd(this,"startFeedback",arguments)};Vd.prototype.A=function(a){Zd(this,"startHelp",arguments)};function Zd(a,b,c){a.j.then(function(a){a[b].apply(a,c)})};var $d=!1;function ae(a){if(a=a.match(/[\d]+/g))a.length=3,a.join(".")}
if(navigator.plugins&&navigator.plugins.length){var be=navigator.plugins["Shockwave Flash"];be&&($d=!0,be.description&&ae(be.description));navigator.plugins["Shockwave Flash 2.0"]&&($d=!0)}else if(navigator.mimeTypes&&navigator.mimeTypes.length){var ce=navigator.mimeTypes["application/x-shockwave-flash"];($d=ce&&ce.enabledPlugin)&&ae(ce.enabledPlugin.description)}else try{var de=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"),$d=!0;ae(de.GetVariable("$version"))}catch(ee){try{de=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"),
$d=!0}catch(fe){try{de=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"),$d=!0,ae(de.GetVariable("$version"))}catch(ge){}}};var he,ie,je,ke,le,me,ne;ne=me=le=ke=je=ie=he=!1;var oe=M;oe&&(-1!=oe.indexOf("Firefox")?he=!0:-1!=oe.indexOf("Camino")?ie=!0:-1!=oe.indexOf("iPad")?ke=!0:-1!=oe.indexOf("iPhone")||-1!=oe.indexOf("iPod")?je=!0:-1!=oe.indexOf("Chrome")?me=!0:-1!=oe.indexOf("Android")?le=!0:-1!=oe.indexOf("Safari")&&(ne=!0));var pe=he,qe=ie,re=je,se=ke,te=le,ue=me,ve=ne;function we(a){return(a=a.exec(M))?a[1]:""}(function(){if(pe)return we(/Firefox\/([0-9.]+)/);if(N||bc)return kc;if(ue)return we(/Chrome\/([0-9.]+)/);if(ve)return we(/Version\/([0-9.]+)/);if(re||se){var a;if(a=/Version\/(\S+).*Mobile\/(\S+)/.exec(M))return a[1]+"."+a[2]}else{if(te)return(a=we(/Android\s+([0-9.]+)/))?a:we(/Version\/([0-9.]+)/);if(qe)return we(/Camino\/([0-9.]+)/)}return""})();function xe(){this.k=this.j=this.g=0;this.A="";var a=r("window.navigator.plugins"),b=r("window.navigator.mimeTypes"),a=a&&a["Shockwave Flash"],b=b&&b["application/x-shockwave-flash"],b=a&&b&&b.enabledPlugin&&a.description||"";if(a=b){var c=a.indexOf("Shockwave Flash");0<=c&&(a=a.substr(c+15));for(var c=a.split(" "),d="",a="",e=0,f=c.length;e<f;e++)if(d)if(a)break;else a=c[e];else d=c[e];d=d.split(".");c=parseInt(d[0],10)||0;d=parseInt(d[1],10)||0;e=0;if("r"==a.charAt(0)||"d"==a.charAt(0))e=parseInt(a.substr(1),
10)||0;a=[c,d,e]}else a=[0,0,0];this.A=b;b=a;this.g=b[0];this.j=b[1];this.k=b[2];if(0>=this.g){var h,k,m,q;if(xb)try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(U){h=null}else m=document.body,q=document.createElement("object"),q.setAttribute("type","application/x-shockwave-flash"),h=m.appendChild(q);if(h&&"GetVariable"in h)try{k=h.GetVariable("$version")}catch(ea){k=""}m&&q&&m.removeChild(q);(h=k||"")?(h=h.split(" ")[1].split(","),h=[parseInt(h[0],10)||0,parseInt(h[1],10)||0,parseInt(h[2],
10)||0]):h=[0,0,0];this.g=h[0];this.j=h[1];this.k=h[2]}}ba(xe);xe.prototype.getVersion=function(){return[this.g,this.j,this.k]};function ye(a,b,c,d){b="string"==typeof b?b.split("."):[b,c,d];b[0]=parseInt(b[0],10)||0;b[1]=parseInt(b[1],10)||0;b[2]=parseInt(b[2],10)||0;return a.g>b[0]||a.g==b[0]&&a.j>b[1]||a.g==b[0]&&a.j==b[1]&&a.k>=b[2]}function ze(a){return-1<a.A.indexOf("Gnash")&&-1==a.A.indexOf("AVM2")||9==a.g&&1==a.j||9==a.g&&0==a.j&&1==a.k?!1:9<=a.g}
function Ae(a){return gc?!ye(a,11,2):ac?!ye(a,11,3):!ze(a)};function Be(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d}Be.prototype.clone=function(){return new Be(this.top,this.right,this.bottom,this.left)};Be.prototype.contains=function(a){return this&&a?a instanceof Be?a.left>=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};
Be.prototype.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};Be.prototype.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};function Ce(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}Ce.prototype.clone=function(){return new Ce(this.left,this.top,this.width,this.height)};Ce.prototype.contains=function(a){return a instanceof Ce?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};
Ce.prototype.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};Ce.prototype.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function De(a,b){var c=sc(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||"":""}function Ee(a,b){return De(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}
function Fe(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}N&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}
function Ge(a){if(N&&!nc(8))return a.offsetParent;var b=sc(a),c=Ee(a,"position"),d="fixed"==c||"absolute"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(c=Ee(a,"position"),d=d&&"static"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||"fixed"==c||"absolute"==c||"relative"==c))return a;return null}
function He(a){var b,c=sc(a),d=Ee(a,"position"),e=cc&&c.getBoxObjectFor&&!a.getBoundingClientRect&&"absolute"==d&&(b=c.getBoxObjectFor(a))&&(0>b.screenX||0>b.screenY),f=new L(0,0),h;b=c?sc(c):document;(h=!N||nc(9))||(h=qc(b),h=yc(h.g));h=h?b.documentElement:b.body;if(a==h)return f;if(a.getBoundingClientRect)b=Fe(a),a=qc(c),a=xc(a.g),f.x=b.left+a.x,f.y=b.top+a.y;else if(c.getBoxObjectFor&&!e)b=c.getBoxObjectFor(a),a=c.getBoxObjectFor(h),f.x=b.screenX-a.screenX,f.y=b.screenY-a.screenY;else{b=a;do{f.x+=
b.offsetLeft;f.y+=b.offsetTop;b!=a&&(f.x+=b.clientLeft||0,f.y+=b.clientTop||0);if(dc&&"fixed"==Ee(b,"position")){f.x+=c.body.scrollLeft;f.y+=c.body.scrollTop;break}b=b.offsetParent}while(b&&b!=a);if(bc||dc&&"absolute"==d)f.y-=c.body.offsetTop;for(b=a;(b=Ge(b))&&b!=c.body&&b!=h;)f.x-=b.scrollLeft,bc&&"TR"==b.tagName||(f.y-=b.scrollTop)}return f}function Ie(a,b){"number"==typeof a&&(a=(b?Math.round(a):a)+"px");return a}
function Je(a){var b=Ke;if("none"!=Ee(a,"display"))return b(a);var c=a.style,d=c.display,e=c.visibility,f=c.position;c.visibility="hidden";c.position="absolute";c.display="inline";a=b(a);c.display=d;c.position=f;c.visibility=e;return a}function Ke(a){var b=a.offsetWidth,c=a.offsetHeight,d=dc&&!b&&!c;return n(b)&&!d||!a.getBoundingClientRect?new Yb(b,c):(a=Fe(a),new Yb(a.right-a.left,a.bottom-a.top))}
function Le(a,b){if(/^\d+px?$/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var e=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return e}function Me(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?Le(a,c):0}var Ne={thin:2,medium:4,thick:6};
function Oe(a,b){if("none"==(a.currentStyle?a.currentStyle[b+"Style"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+"Width"]:null;return c in Ne?Ne[c]:Le(a,c)}var Pe=/matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;ib("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));ib("action","cite","data","formaction","href","manifest","poster","src");ib("link","script","style");function Qe(a,b){(a=tc(a))&&a.style&&(a.style.display=b?"":"none",Xb(a,"hid",!b))}function Re(a){A(arguments,function(a){Qe(a,!0)})}function Se(a){A(arguments,function(a){Qe(a,!1)})};var Te={};function Ue(a,b){var c=G("FEEDBACK_LOCALE_LANGUAGE"),d=G("FEEDBACK_LOCALE_EXTRAS",{});a?hb(Te,a):hb(Te,d);try{var e,f=r("yt.player.getPlayerByElement");(e=f?f("player-api"):null)&&e.pauseVideo&&e.pauseVideo();var h=xe.getInstance();Te.flashVersion=h.getVersion().join(".");e&&(Te.playback_id=e.getVideoData().cpn)}catch(k){}b&&hb(Te,{trackingParam:b});return{helpCenterPath:"/youtube",locale:c,productData:Te}}
function Ve(){var a=G("SESSION_INDEX"),b=G("FEEDBACK_BUCKET_ID"),c={abuseLink:"https://support.google.com/youtube/bin/answer.py?answer=140536",customZIndex:"2000000005"};a&&(c.authuser=a+"");b&&(c.bucket=b);return c}function We(a,b){try{var c=(a||"59")+"",d=Ue(b),e=Ve();Wd(c,d).k(e);return!1}catch(f){return!0}}function Xe(a,b,c,d){var e;d=(d||"59")+"";c=Ue(c,void 0);a={context:b,anchor:void 0,enableSendFeedback:!0,defaultHelpArticleId:a};hb(a,Ve());try{Wd(d,c).A(a),e=!1}catch(f){e=!0}return e};function Ye(a){a=a||{};this.url=a.url||"";this.urlV8=a.url_v8||"";this.urlV9As2=a.url_v9as2||"";this.args=a.args||db(Ze);this.assets=a.assets||{};this.attrs=a.attrs||db($e);this.params=a.params||db(af);this.minVersion=a.min_version||"8.0.0";this.fallback=a.fallback||null;this.fallbackMessage=a.fallbackMessage||null;this.html5=!!a.html5;this.disable=a.disable||{};this.loaded=!!a.loaded;this.messages=a.messages||{}}var Ze={enablejsapi:1},$e={},af={allowscriptaccess:"always",allowfullscreen:"true",bgcolor:"#000000"};
function bf(a){a instanceof Ye||(a=new Ye(a));return a}Ye.prototype.clone=function(){var a=new Ye,b;for(b in this){var c=this[b];"object"==ca(c)?a[b]=db(c):a[b]=c}return a};function cf(){var a=Tc("PREF");if(a)for(var a=unescape(a).split("&"),b=0;b<a.length;b++){var c=a[b].split("="),d=c[0];(c=c[1])&&(df[d]=c.toString())}}ba(cf);var df=r("yt.prefs.UserPrefs.prefs_")||{};p("yt.prefs.UserPrefs.prefs_",df,void 0);function ef(a){if(/^f([1-9][0-9]*)$/.test(a))throw"ExpectedRegexMatch: "+a;}function ff(a){if(!/^\w+$/.test(a))throw"ExpectedRegexMismatch: "+a;}function gf(a){return void 0!==df[a]?df[a].toString():null}
cf.prototype.get=function(a,b){ff(a);ef(a);var c=gf(a);return null!=c?c:b?b:""};cf.prototype.set=function(a,b){ff(a);ef(a);if(null==b)throw"ExpectedNotNull";df[a]=b.toString()};cf.prototype.remove=function(a){ff(a);ef(a);delete df[a]};cf.prototype.clear=function(){df={}};function hf(a,b,c){if(b){a=u(a)?uc(a):a;c=bf(c);var d=db(c.attrs);d.tabindex=0;var e=db(c.params);e.flashvars=ed(c.args);if(xb){d.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";e.movie=b;b=document.createElement("object");for(var f in d)b.setAttribute(f,d[f]);for(f in e)d=document.createElement("param"),d.setAttribute("name",f),d.setAttribute("value",e[f]),b.appendChild(d)}else{d.type="application/x-shockwave-flash";d.src=b;b=document.createElement("embed");b.setAttribute("name",d.id);for(f in d)b.setAttribute(f,
d[f]);for(f in e)b.setAttribute(f,e[f])}e=document.createElement("div");e.appendChild(b);a.innerHTML=e.innerHTML}}
function jf(a,b,c){if(a&&a.attrs&&a.attrs.id){a=bf(a);var d=!!b,e=tc(a.attrs.id),f=e?e.parentNode:null;if(e&&f){if(window!=window.top){var h=null;if(document.referrer){var k=document.referrer.substring(0,128);kd(k)||(h=k)}else h="unknown";h&&(d=!0,a.args.framer=h)}h=kf();if(ye(h,a.minVersion)){var k=lf(a,h),m="";-1<navigator.userAgent.indexOf("Sony/COM2")||(m=e.getAttribute("src")||e.movie);(m!=k||d)&&hf(f,k,a);Ae(h)&&mf()}else nf(f,a,h);c&&c()}else H(function(){jf(a,b,c)},50)}}
function nf(a,b,c){0==c.g&&b.fallback?b.fallback():0==c.g&&b.fallbackMessage?b.fallbackMessage():a.innerHTML='<div id="flash-upgrade">'+wb()+"</div>"}function lf(a,b){return ze(b)&&a.url||(-1<navigator.userAgent.indexOf("Sony/COM2")&&!ye(b,9,1,58)?!1:!0)&&a.urlV9As2||a.urlV8||a.url}function kf(){var a=xe.getInstance();cf.getInstance().set("fv",a.getVersion().join("."));var b;b=[];for(var c in df)b.push(c+"="+escape(df[c]));b=b.join("&");Sc("PREF",b,63072E3);return a}
function mf(){var a=tc("flash10-promo-div"),b;cf.getInstance();b=gf("f"+(Math.floor(107/31)+1));b=!!(((null!=b&&/^[A-Fa-f0-9]+$/.test(b)?parseInt(b,16):null)||0)&16384);a&&!b&&Re(a)};function of(a){if(window.spf){var b=a.match(pf);spf.style.load(a,b?b[1]:"",void 0)}else qf(a)}function qf(a){var b=rf(a),c=document.getElementById(b),d=c&&C(c,"loaded");d||c&&!d||(c=sf(a,b,function(){C(c,"loaded")||(jb(c,"loaded","true"),K(b),H(na(Hb,b),0))}))}function sf(a,b,c){var d=document.createElement("link");d.id=b;d.rel="stylesheet";d.onload=function(){c&&setTimeout(c,0)};d.href=a;(document.getElementsByTagName("head")[0]||document.body).appendChild(d);return d}
function rf(a){var b=document.createElement("a");b.href=a;a=b.href.replace(/^[a-zA-Z]+:\/\//,"//");return"css-"+xa(a)}var pf=/cssbin\/(?:debug-)?([a-zA-Z0-9_-]+?)(?:-2x|-web|-rtl|-vfl|.css)/;var tf;var uf=M,uf=uf.toLowerCase();if(y(uf,"android")){var vf=uf.match(/android\D*(\d\.\d)[^\;|\)]*[\;\)]/);if(vf)tf=Number(vf[1]);else{var wf={cupcake:1.5,donut:1.6,eclair:2,froyo:2.2,gingerbread:2.3,honeycomb:3,"ice cream sandwich":4,jellybean:4.1},xf=uf.match("("+$a(wf).join("|")+")");tf=xf?wf[xf[0]]:0}}else tf=void 0;function yf(){if(2.2==tf)return!0;var a;a=r("yt.player.utils.videoElement_");a||(a=document.createElement("video"),p("yt.player.utils.videoElement_",a,void 0));try{return!(!a||!a.canPlayType||!a.canPlayType('video/mp4; codecs="avc1.42001E, mp4a.40.2"')&&!a.canPlayType('video/webm; codecs="vp8.0, vorbis"'))}catch(b){return!1}};function zf(a,b){var c;a instanceof zf?(this.Ra=n(b)?b:a.Ra,Af(this,a.Ga),this.Qa=a.Qa,Bf(this,a.wa),Cf(this,a.Oa),this.oa=a.oa,Df(this,a.g.clone()),this.Pa=a.Pa):a&&(c=Yc(String(a)))?(this.Ra=!!b,Af(this,c[1]||"",!0),this.Qa=Ef(c[2]||""),Bf(this,c[3]||"",!0),Cf(this,c[4]),this.oa=Ef(c[5]||"",!0),Df(this,c[6]||"",!0),this.Pa=Ef(c[7]||"")):(this.Ra=!!b,this.g=new Ff(null,0,this.Ra))}g=zf.prototype;g.Ga="";g.Qa="";g.wa="";g.Oa=null;g.oa="";g.Pa="";g.Ra=!1;
g.toString=function(){var a=[],b=this.Ga;b&&a.push(Gf(b,Hf,!0),":");if(b=this.wa){a.push("//");var c=this.Qa;c&&a.push(Gf(c,Hf,!0),"@");a.push(encodeURIComponent(String(b)).replace(/%25([0-9a-fA-F]{2})/g,"%$1"));b=this.Oa;null!=b&&a.push(":",String(b))}if(b=this.oa)this.wa&&"/"!=b.charAt(0)&&a.push("/"),a.push(Gf(b,"/"==b.charAt(0)?If:Jf,!0));(b=this.g.toString())&&a.push("?",b);(b=this.Pa)&&a.push("#",Gf(b,Kf));return a.join("")};
g.resolve=function(a){var b=this.clone(),c=!!a.Ga;c?Af(b,a.Ga):c=!!a.Qa;c?b.Qa=a.Qa:c=!!a.wa;c?Bf(b,a.wa):c=null!=a.Oa;var d=a.oa;if(c)Cf(b,a.Oa);else if(c=!!a.oa){if("/"!=d.charAt(0))if(this.wa&&!this.oa)d="/"+d;else{var e=b.oa.lastIndexOf("/");-1!=e&&(d=b.oa.substr(0,e+1)+d)}e=d;if(".."==e||"."==e)d="";else if(y(e,"./")||y(e,"/.")){for(var d=0==e.lastIndexOf("/",0),e=e.split("/"),f=[],h=0;h<e.length;){var k=e[h++];"."==k?d&&h==e.length&&f.push(""):".."==k?((1<f.length||1==f.length&&""!=f[0])&&f.pop(),
d&&h==e.length&&f.push("")):(f.push(k),d=!0)}d=f.join("/")}else d=e}c?b.oa=d:c=""!==a.g.toString();c?Df(b,Ef(a.g.toString())):c=!!a.Pa;c&&(b.Pa=a.Pa);return b};g.clone=function(){return new zf(this)};function Af(a,b,c){a.Ga=c?Ef(b,!0):b;a.Ga&&(a.Ga=a.Ga.replace(/:$/,""))}function Bf(a,b,c){a.wa=c?Ef(b,!0):b}function Cf(a,b){if(b){b=Number(b);if(isNaN(b)||0>b)throw Error("Bad port number "+b);a.Oa=b}else a.Oa=null}
function Df(a,b,c){b instanceof Ff?(a.g=b,Lf(a.g,a.Ra)):(c||(b=Gf(b,Mf)),a.g=new Ff(b,0,a.Ra))}function P(a,b,c){a.g.set(b,c)}function Nf(a,b,c){t(c)||(c=[String(c)]);Of(a.g,b,c)}function Pf(a){P(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^w()).toString(36));return a}function Qf(a){return a instanceof zf?a.clone():new zf(a,void 0)}function Rf(a,b,c,d){var e=new zf(null,void 0);a&&Af(e,a);b&&Bf(e,b);c&&Cf(e,c);d&&(e.oa=d);return e}
function Ef(a,b){return a?b?decodeURI(a):decodeURIComponent(a):""}function Gf(a,b,c){return u(a)?(a=encodeURI(a).replace(b,Sf),c&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Sf(a){a=a.charCodeAt(0);return"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Hf=/[#\/\?@]/g,Jf=/[\#\?:]/g,If=/[\#\?]/g,Mf=/[\#\?@]/g,Kf=/#/g;function Ff(a,b,c){this.g=a||null;this.j=!!c}
function Tf(a){if(!a.N&&(a.N=new sd,a.ca=0,a.g))for(var b=a.g.split("&"),c=0;c<b.length;c++){var d=b[c].indexOf("="),e=null,f=null;0<=d?(e=b[c].substring(0,d),f=b[c].substring(d+1)):e=b[c];e=ra(e);e=Uf(a,e);a.add(e,f?ra(f):"")}}g=Ff.prototype;g.N=null;g.ca=null;g.Na=function(){Tf(this);return this.ca};g.add=function(a,b){Tf(this);this.g=null;a=Uf(this,a);var c=this.N.get(a);c||this.N.set(a,c=[]);c.push(b);this.ca++;return this};
g.remove=function(a){Tf(this);a=Uf(this,a);return vd(this.N.j,a)?(this.g=null,this.ca-=this.N.get(a).length,this.N.remove(a)):!1};g.clear=function(){this.N=this.g=null;this.ca=0};g.isEmpty=function(){Tf(this);return 0==this.ca};function Vf(a,b){Tf(a);b=Uf(a,b);return vd(a.N.j,b)}g.ta=function(){Tf(this);for(var a=this.N.qa(),b=this.N.ta(),c=[],d=0;d<b.length;d++)for(var e=a[d],f=0;f<e.length;f++)c.push(b[d]);return c};
g.qa=function(a){Tf(this);var b=[];if(u(a))Vf(this,a)&&(b=Oa(b,this.N.get(Uf(this,a))));else{a=this.N.qa();for(var c=0;c<a.length;c++)b=Oa(b,a[c])}return b};g.set=function(a,b){Tf(this);this.g=null;a=Uf(this,a);Vf(this,a)&&(this.ca-=this.N.get(a).length);this.N.set(a,[b]);this.ca++;return this};g.get=function(a,b){var c=a?this.qa(a):[];return 0<c.length?String(c[0]):b};function Of(a,b,c){a.remove(b);0<c.length&&(a.g=null,a.N.set(Uf(a,b),Pa(c)),a.ca+=c.length)}
g.toString=function(){if(this.g)return this.g;if(!this.N)return"";for(var a=[],b=this.N.ta(),c=0;c<b.length;c++)for(var d=b[c],e=encodeURIComponent(String(d)),d=this.qa(d),f=0;f<d.length;f++){var h=e;""!==d[f]&&(h+="="+encodeURIComponent(String(d[f])));a.push(h)}return this.g=a.join("&")};g.clone=function(){var a=new Ff;a.g=this.g;this.N&&(a.N=this.N.clone(),a.ca=this.ca);return a};function Uf(a,b){var c=String(b);a.j&&(c=c.toLowerCase());return c}
function Lf(a,b){b&&!a.j&&(Tf(a),a.g=null,a.N.forEach(function(a,b){var e=b.toLowerCase();b!=e&&(this.remove(b),Of(this,e,a))},a));a.j=b};var Wf=/^https?:\/\/([A-Za-z0-9-]{1,63}\.)*(corp\.google\.com|borg\.google\.com|prod\.google\.com|video\.google\.com|youtube\.com|youtube\.googleapis\.com|youtube-nocookie\.com|youtubeeducation\.com)(:[0-9]+)?\/embed\//;var Xf="corp.google.com googleplex.com youtube.com youtube-nocookie.com youtubeeducation.com borg.google.com prod.google.com sandbox.google.com docs.google.com drive.google.com mail.google.com plus.google.com play.google.com googlevideo.com talkgadget.google.com survey.g.doubleclick.net youtube.googleapis.com vevo.com".split(" "),Yf="";
function Zf(a){return a&&a==Yf?!0:(new RegExp("^(https?:)?//([a-z0-9-]{1,63}\\.)*("+Xf.join("|").replace(/\./g,".")+")(:[0-9]+)?([/?#]|$)","i")).test(a)?(Yf=a,!0):!1};var $f={},ag=0,bg=r("yt.net.ping.workerUrl_")||null;p("yt.net.ping.workerUrl_",bg,void 0);function cg(a){var b=new Image,c=""+ag++;$f[c]=b;b.onload=b.onerror=function(){delete $f[c]};b.src=a;b=eval("null")};var dg,eg,fg;var gg=window.performance||window.mozPerformance||window.msPerformance||window.webkitPerformance||{},hg=v(gg.clearResourceTimings||gg.webkitClearResourceTimings||gg.mozClearResourceTimings||gg.msClearResourceTimings||gg.oClearResourceTimings||s,gg),ig=gg.mark?function(a){gg.mark(a)}:s;
function jg(){var a=kg(),b=lg().span,c=lg().info,d=r("yt.timing.reportbuilder_");if(d){if(d=d(a,b,c,void 0))mg(d),ng(),hg()}else{d={v:2,s:"youtube",action:G("TIMING_ACTION")};if(gg.now&&gg.timing){var e=gg.timing.navigationStart+gg.now(),e=Math.round(w()-e);c.yt_hrd=e}var e=G("TIMING_INFO")||{},f;for(f in e)c[f]=e[f];f=c.srt;delete c.srt;var h;f||0===f||(h=gg.timing||{},f=Math.max(0,h.responseStart-h.navigationStart),isNaN(f)&&c.pt&&(f=c.pt));if(f||0===f)c.srt=f;c.h5jse&&(f=window.location.protocol+
r("ytplayer.config.assets.js"),(f=gg.getEntriesByName?gg.getEntriesByName(f)[0]:null)?c.h5jse=Math.round(c.h5jse-f.responseEnd):delete c.h5jse);f=!1;a.aft||(a.pbr&&a.pbs>a.pbr?(a.aft=a.pbr,f=!0):a.pbs?(a.aft=a.pbs,f=!0):a.vr?(a.aft=a.vr,f=!0):a.aft=a.ol);a.gv&&f&&(b.vl=Math.round(a.aft-a.gv));f=a._start;if(!dg){h||(h=gg.timing||{});t:if(e=h,e.msFirstPaint)e=Math.max(0,e.msFirstPaint);else{var k=window.chrome;if(k&&(k=k.loadTimes,ga(k))){var k=k(),m=1E3*Math.min(k.requestTime||Infinity,k.startLoadTime||
Infinity),m=Infinity===m?0:e.navigationStart-m,e=Math.max(0,Math.round(1E3*k.firstPaintTime+m)||0);break t}e=0}0<e&&e>f&&(a.fpt=e);e=h.redirectEnd-h.redirectStart;0<e&&(b.rtime_=e);e=h.domainLookupEnd-h.domainLookupStart;0<e&&(b.dns_=e);e=h.connectEnd-h.connectStart;0<e&&(b.tcp_=e);e=h.connectEnd-h.secureConnectionStart;h.secureConnectionStart&&0<e&&(b.stcp_=e);e=h.responseStart-h.requestStart;0<e&&(b.req_=e);e=h.responseEnd-h.responseStart;0<e&&(b.rcv_=e);dg=!0}for(var q in c)"_"!=q.charAt(0)&&(d[q]=
c[q]);c={};q=[];for(var U in a)"_"!=U.charAt(0)&&(e=Math.max(Math.round(a[U]-f),0),c[U]=e,q.push(U+"."+e));d.rt=q.join(",");a={};U=[];for(var ea in b)"_"!=ea.charAt(0)&&(a[ea]=b[ea],U.push(ea+"."+b[ea]));d.it=U.join(",");(b=r("ytdebug.logTiming"))&&b(d,c,a);ng();hg();G("EXP_DEFER_CSI_PING")?(og(),eg=d,fg=H(og,0)):mg(d)}}
function mg(a){G("EXP_DEFER_CSI_PING")&&(I(fg),eg=null);var b="https:"==window.location.protocol?"https://gg.google.com/csi":"http://csi.gstatic.com/csi",c="",d;for(d in a)c+="&"+d+"="+a[d];(a=b+"?"+c.substring(1))&&cg(a)}function og(a){eg&&(a&&(eg.yt_fss=a),mg(eg))}function kg(){return lg().tick}function lg(){return r("ytcsi.data_")||ng()}function ng(){var a={tick:{},span:{},info:{}};p("ytcsi.data_",a,void 0);return a};function pg(){};function qg(){}x(qg,pg);qg.prototype.Na=function(){var a=0;qd(this.Sa(!0),function(){a++});return a};qg.prototype.clear=function(){var a=rd(this.Sa(!0)),b=this;A(a,function(a){b.remove(a)})};function rg(a){this.g=a}x(rg,qg);g=rg.prototype;g.isAvailable=function(){if(!this.g)return!1;try{return this.g.setItem("__sak","1"),this.g.removeItem("__sak"),!0}catch(a){return!1}};g.set=function(a,b){try{this.g.setItem(a,b)}catch(c){if(0==this.g.length)throw"Storage mechanism: Storage disabled";throw"Storage mechanism: Quota exceeded";}};g.get=function(a){a=this.g.getItem(a);if(!u(a)&&null!==a)throw"Storage mechanism: Invalid value was encountered";return a};g.remove=function(a){this.g.removeItem(a)};
g.Na=function(){return this.g.length};g.Sa=function(a){var b=0,c=this.g,d=new od;d.next=function(){if(b>=c.length)throw nd;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!u(d))throw"Storage mechanism: Invalid value was encountered";return d};return d};g.clear=function(){this.g.clear()};g.key=function(a){return this.g.key(a)};function sg(){var a=null;try{a=window.localStorage||null}catch(b){}this.g=a}x(sg,rg);function tg(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.g=a}x(tg,rg);function ug(a){a=String(a);if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);}function vg(a){return eval("("+a+")")}function Q(a){return wg(new xg(void 0),a)}function xg(a){this.g=a}
function wg(a,b){var c=[];yg(a,b,c);return c.join("")}
function yg(a,b,c){switch(typeof b){case "string":zg(b,c);break;case "number":c.push(isFinite(b)&&!isNaN(b)?b:"null");break;case "boolean":c.push(b);break;case "undefined":c.push("null");break;case "object":if(null==b){c.push("null");break}if(t(b)){var d=b.length;c.push("[");for(var e="",f=0;f<d;f++)c.push(e),e=b[f],yg(a,a.g?a.g.call(b,String(f),e):e,c),e=",";c.push("]");break}c.push("{");d="";for(f in b)Object.prototype.hasOwnProperty.call(b,f)&&(e=b[f],"function"!=typeof e&&(c.push(d),zg(f,c),c.push(":"),
yg(a,a.g?a.g.call(b,f,e):e,c),d=","));c.push("}");break;case "function":break;default:throw Error("Unknown type: "+typeof b);}}var Ag={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\x0B":"\\u000b"},Bg=/\uffff/.test("\uffff")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g;
function zg(a,b){b.push('"',a.replace(Bg,function(a){if(a in Ag)return Ag[a];var b=a.charCodeAt(0),e="\\u";16>b?e+="000":256>b?e+="00":4096>b&&(e+="0");return Ag[a]=e+b.toString(16)}),'"')};function Cg(a){this.g=a}Cg.prototype.set=function(a,b){n(b)?this.g.set(a,Q(b)):this.g.remove(a)};Cg.prototype.get=function(a){var b;try{b=this.g.get(a)}catch(c){return}if(null!==b)try{return ug(b)}catch(d){throw"Storage: Invalid value was encountered";}};Cg.prototype.remove=function(a){this.g.remove(a)};function Dg(a){this.g=a}x(Dg,Cg);function Eg(a){this.data=a}function Fg(a){return!n(a)||a instanceof Eg?a:new Eg(a)}Dg.prototype.set=function(a,b){Dg.L.set.call(this,a,Fg(b))};Dg.prototype.j=function(a){a=Dg.L.get.call(this,a);if(!n(a)||a instanceof Object)return a;throw"Storage: Invalid value was encountered";};Dg.prototype.get=function(a){if(a=this.j(a)){if(a=a.data,!n(a))throw"Storage: Invalid value was encountered";}else a=void 0;return a};function Gg(a){this.g=a}x(Gg,Dg);function Hg(a){var b=a.creation;a=a.expiration;return!!a&&a<w()||!!b&&b>w()}Gg.prototype.set=function(a,b,c){if(b=Fg(b)){if(c){if(c<w()){Gg.prototype.remove.call(this,a);return}b.expiration=c}b.creation=w()}Gg.L.set.call(this,a,b)};Gg.prototype.j=function(a,b){var c=Gg.L.j.call(this,a);if(c)if(!b&&Hg(c))Gg.prototype.remove.call(this,a);else return c};function Ig(a){this.g=a}x(Ig,Gg);function Jg(a,b){var c=[];qd(b,function(a){var b;try{b=Ig.prototype.j.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}n(b)?Hg(b)&&c.push(a):c.push(a)},a);return c}function Kg(a,b){var c=Jg(a,b);A(c,function(a){Ig.prototype.remove.call(this,a)},a)}function Lg(){var a=Mg;Kg(a,a.g.Sa(!0))};function R(a,b,c){var d=c&&0<c?c:0;c=d?w()+1E3*d:0;if((d=d?Mg:Ng)&&window.JSON){u(b)||(b=JSON.stringify(b,void 0));try{d.set(a,b,c)}catch(e){d.remove(a)}}}function S(a){if(!Ng&&!Mg||!window.JSON)return null;var b;try{b=Ng.get(a)}catch(c){}if(!u(b))try{b=Mg.get(a)}catch(d){}if(!u(b))return null;try{b=JSON.parse(b,void 0)}catch(e){}return b}function Og(a){Ng&&Ng.remove(a);Mg&&Mg.remove(a)}var Mg,Pg=new sg;Mg=Pg.isAvailable()?new Ig(Pg):null;var Ng,Qg=new tg;Ng=Qg.isAvailable()?new Ig(Qg):null;function Rg(){var a={volume:100,muted:!1},b=S("yt-player-volume")||{};a.volume=isNaN(b.volume)?100:Math.min(Math.max(b.volume,0),100);a.muted=void 0==b.muted?!1:b.muted;return a};function Sg(a,b){D.call(this);this.k=this.cb=a;this.M=b;this.B=!1;this.g={};this.Y=this.J=null;this.S=new F;mb(this,na(E,this.S));this.A={};this.o=this.pa=this.j=this.xa=this.G=null;this.W=!1;this.ra=this.D=null;this.da={};this.Pb=["onReady"];this.Ta=null;this.eb=0;Tg(this);this.Va("onVolumeChange",v(this.kd,this));this.Va("onError",v(this.jd,this));this.Va("onTabOrderChange",v(this.hd,this));this.Va("WATCH_LATER_VIDEO_ADDED",v(this.ld,this));this.Va("WATCH_LATER_VIDEO_REMOVED",v(this.md,this))}
x(Sg,D);g=Sg.prototype;g.bc=function(a,b){this.H()||(Ug(this,a),Vg(this,b),this.B&&Wg(this))};
function Ug(a,b){a.xa=b;a.G=b.clone();a.j=a.G.attrs.id||a.j;"video-player"==a.j&&(a.j=a.M,a.G.attrs.id=a.M);a.k.id==a.j&&(a.j=a.j+"-player",a.G.attrs.id=a.j);var c=a.G.args,d;if(!(d=a.G.args.eurl)){d=document.location.toString();var e=!!d&&-1!=d.search(Wf),f=-1!=d.indexOf("/embed/");e!=f&&vb(Error("isIframeEmbed("+d+") behavior is not consistent"));d=f?document.referrer&&document.referrer.substring(0,128)||"unknown":d}c.eurl=d;a.G.args.enablejsapi="1";a.G.args.playerapiid=a.M;a.pa||(a.pa=Xg(a,a.G.args.jsapicallback||
"onYouTubePlayerReady"));a.G.args.jsapicallback=null;if(c=a.G.attrs.width)a.k.style.width=Ie(Number(c)||c,!0);if(c=a.G.attrs.height)a.k.style.height=Ie(Number(c)||c,!0);a.k.style.overflow="hidden"}g.Od=function(){return this.xa};function Wg(a){a.G.loaded||(a.G.loaded=!0,"0"!=a.G.args.autoplay?a.g.loadVideoByPlayerVars(a.G.args):a.g.cueVideoByPlayerVars(a.G.args))}function Yg(a){if(!n(a.G.disable.flash)){var b=a.G.disable,c;c=ye(kf(),a.G.minVersion);b.flash=!c}return!a.G.disable.flash}
function Zg(a){var b=$g(a);b&&b.stopVideo&&b.stopVideo();if(Yg(a)){var c=a.G;b&&b.getUpdatedConfigurationData&&(b=bf(b.getUpdatedConfigurationData()),b.args.video_id==c.args.video_id&&(c=b));c.args.autoplay=1;c.args.html5_unavailable="1";Ug(a,c);Vg(a,"flash")}}
function Vg(a,b){if(!a.H()){if(!b){var c;if(!(c=!a.G.html5&&Yg(a))){if(!n(a.G.disable.html5)){if(c=yf())c=ah(a)||a.G.assets.js;a.G.disable.html5=!c;c||(a.G.args.html5_unavailable="1")}c=!!a.G.disable.html5}b=c?Yg(a)?"flash":"unsupported":"html5"}("flash"==b?a.se:"html5"==b?a.te:a.ue).call(a)}}function ah(a){var b=!0,c=$g(a);c&&a.G&&(a=a.G,b=C(c,"version")==a.assets.js);return b&&!!r("yt.player.Application.create")}
g.te=function(){if(!this.W){var a=ah(this);a&&"html5"==bh(this)?(this.o="html5",this.B||this.Za()):(ch(this),this.o="html5",a&&this.ra?(this.cb.appendChild(this.ra),this.Za()):(this.G.loaded=!0,this.D=v(function(){var a=this.cb,c=this.G.clone();r("yt.player.Application.create")(a,c);this.Za()},this),this.W=!0,a?this.D():(Ib(this.G.assets.js,this.D),of(this.G.assets.css))))}};
g.se=function(){var a=this.G.clone();a.attrs.width=a.attrs.width||"100%";a.attrs.height=a.attrs.height||"100%";if("flash"==bh(this))this.o="flash",this.B||jf(a,!1,v(this.Za,this));else{ch(this);this.o="flash";this.G.loaded=!0;var b=this.cb,b=u(b)?uc(b):b,a=bf(a);if(window!=window.top){var c=null;document.referrer&&(c=document.referrer.substring(0,128));a.args.framer=c}c=kf();ye(c,a.minVersion)?(c=lf(a,c),hf(b,c,a)):nf(b,a,c);this.Za()}};
function $g(a){var b=tc(a.j);!b&&a.k&&a.k.querySelector&&(b=a.k.querySelector("#"+a.j));return b}
g.Za=function(){var a=$g(this),b=!1;try{a&&a.getApiInterface&&a.getApiInterface()&&(b=!0)}catch(c){}if(b)if(this.W=!1,a.isNotServable&&a.isNotServable())Zg(this);else{Tg(this);this.B=!0;a=$g(this);a.addEventListener&&(this.J=dh(this,a,"addEventListener"));a.removeEventListener&&(this.Y=dh(this,a,"removeEventListener"));for(var b=a.getApiInterface(),b=b.concat(a.getInternalApiInterface()),d=0;d<b.length;d++){var e=b[d];this.g[e]||(this.g[e]=dh(this,a,e))}for(var f in this.A)this.J(f,this.A[f]);Wg(this);
this.pa&&this.pa(this.g);this.S.publish("onReady",this.g)}else this.eb=H(v(this.Za,this),50)};function dh(a,b,c){var d=b[c];return function(){try{return a.Ta=null,d.apply(b,arguments)}catch(e){"Bad NPObject as private data!"!=e.message&&(e.message+=" ("+c+")",a.Ta=e,vb(e,"WARNING"))}}}
function Tg(a){a.B=!1;if(a.Y)for(var b in a.A)a.Y(b,a.A[b]);a.J=null;a.Y=null;for(var c in a.g)a.g[c]=null;a.g.addEventListener=v(a.Va,a);a.g.removeEventListener=v(a.Rd,a);a.g.destroy=v(a.dispose,a);a.g.getLastError=v(a.Pd,a);a.g.getPlayerType=v(a.Qd,a);a.g.getCurrentVideoConfig=v(a.Od,a);a.g.loadNewVideoConfig=v(a.bc,a);a.g.isReady=v(a.Sd,a)}g.Sd=function(){return this.B};
g.Va=function(a,b){if(!this.H()){var c=Xg(this,b);if(c){if(!Ha(this.Pb,a)&&!this.A[a]){var d=eh(this,a);this.J&&this.J(a,d)}this.S.subscribe(a,c);"onReady"==a&&this.B&&H(na(c,this.g),0)}}};g.Rd=function(a,b){if(!this.H()){var c=Xg(this,b);c&&this.S.unsubscribe(a,c)}};function Xg(a,b){var c=b;if("string"==typeof b){if(a.da[b])return a.da[b];c=function(){var a=r(b);a&&a.apply(l,arguments)};a.da[b]=c}return c?c:null}
function eh(a,b){var c="ytPlayer"+b+a.M;a.A[b]=c;l[c]=function(c){H(function(){a.H()||a.S.publish(b,c)},0)};return c}g.hd=function(a){a=a?Ac:zc;for(var b=a(document.activeElement);b&&(1!=b.nodeType||(b.focus(),b!=document.activeElement));)b=a(b)};g.kd=function(a){var b={};b.volume=isNaN(a.volume)?Rg().volume:Math.min(Math.max(a.volume,0),100);b.muted=void 0==a.muted?Rg().muted:a.muted;R("yt-player-volume",b,2592E3)};g.jd=function(a){5==a&&Zg(this)};g.ld=function(a){K("WATCH_LATER_VIDEO_ADDED",a)};
g.md=function(a){K("WATCH_LATER_VIDEO_REMOVED",a)};
g.ue=function(){ch(this);this.o="unsupported";var a='Adobe Flash Player or an HTML5 supported browser is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/">Get the latest Flash Player</a> <br> <a href="/html5">Learn more about upgrading to an HTML5 browser</a>',b=navigator.userAgent.match(/Version\/(\d).*Safari/);b&&5<=parseInt(b[1],10)&&(a='Adobe Flash Player or QuickTime is required for video playback. <br> <a href="http://get.adobe.com/flashplayer/"> Get the latest Flash Player</a> <br> <a href="http://www.apple.com/quicktime/download/">Get the latest version of QuickTime</a>');b=
this.G.messages.player_fallback||a;a=tc("player-unavailable");if(tc("unavailable-submessage")&&a){tc("unavailable-submessage").innerHTML=b;var b=a||document,c=null;b.querySelectorAll&&b.querySelector?c=b.querySelector(".icon"):c=wc("icon",a)[0];if(c=b=c||null)c=b?b.dataset?kb("icon")in b.dataset:b.hasAttribute?!!b.hasAttribute("data-icon"):!!b.getAttribute("data-icon"):!1;c&&(b.src=C(b,"icon"));Wb(a,"hid");Vb(tc("player"),"off-screen-trigger")}};g.Qd=function(){return this.o||bh(this)};g.Pd=function(){return this.Ta};
function bh(a){return(a=$g(a))?"div"==a.tagName.toLowerCase()?"html5":"flash":null}function ch(a){kg().dcp=w();ig("dcp");a.cancel();Tg(a);a.o=null;a.G&&(a.G.loaded=!1);var b=$g(a);"html5"==bh(a)?a.ra=b:b&&b.destroy&&b.destroy();for(a=a.cb;b=a.firstChild;)a.removeChild(b)}g.cancel=function(){if(this.D){var a=this.D;this.G.assets.js&&a&&(a=""+ia(a),(a=Nb[a])&&Eb(a))}I(this.eb);this.W=!1};
g.F=function(){ch(this);this.da=null;for(var a in this.A)l[this.A[a]]=null;this.g=null;delete this.cb;delete this.k;this.G&&(this.xa=this.G=this.G.fallback=null);Sg.L.F.call(this)};var fh={},gh="player_uid_"+(1E9*Math.random()>>>0);function hh(a,b){a=u(a)?uc(a):a;b=bf(b);var c=gh+"_"+ia(a),d=fh[c];if(d)return d.bc(b),d.g;d=new Sg(a,c);fh[c]=d;K("player-added",d.g);mb(d,na(ih,d));H(function(){d.bc(b)},0);return d.g}function jh(){for(var a in fh){var b=fh[a];b&&b.cancel()}}function kh(a){if(a=tc(a))a=gh+"_"+ia(a),(a=fh[a])&&a.dispose()}function ih(a){fh[a.M]=null}function lh(a){a=tc(a);if(!a)return null;var b=gh+"_"+ia(a),c=fh[b];c||(c=new Sg(a,b),fh[b]=c);return c.g};var mh=r("yt.abuse.botguardInitialized")||Rb;p("yt.abuse.botguardInitialized",mh,void 0);var nh=r("yt.abuse.invokeBotguard")||Sb;p("yt.abuse.invokeBotguard",nh,void 0);var oh=r("yt.player.exports.navigate")||md;p("yt.player.exports.navigate",oh,void 0);var ph=r("yt.player.embed")||hh;p("yt.player.embed",ph,void 0);var qh=r("yt.player.destroy")||kh;p("yt.player.destroy",qh,void 0);var rh=r("yt.player.cancelAll")||jh;p("yt.player.cancelAll",rh,void 0);var sh=r("yt.player.getPlayerByElement")||lh;
p("yt.player.getPlayerByElement",sh,void 0);var th=r("yt.player.exports.feedbackStart")||We;p("yt.player.exports.feedbackStart",th,void 0);var uh=r("yt.player.exports.feedbackShowArticle")||Xe;p("yt.player.exports.feedbackShowArticle",uh,void 0);var vh=r("yt.util.activity.init")||Uc;p("yt.util.activity.init",vh,void 0);var wh=r("yt.util.activity.getTimeSinceActive")||Wc;p("yt.util.activity.getTimeSinceActive",wh,void 0);var xh=r("yt.util.activity.setTimestamp")||Vc;
p("yt.util.activity.setTimestamp",xh,void 0);function yh(a){var b=void 0;void 0===b&&(b=NaN);var c=r("yt.scheduler.instance.addJob");c?(isNaN(b)&&(b=0),c(a,0,b)):isNaN(b)?a():H(a,b||0)};function zh(a,b){this.version=a;this.args=b}function Ah(a){if(!a.Ba){var b={};a.call(b);a.Ba=b.version}return a.Ba}
function Bh(a,b){function c(){a.apply(this,b.args)}if(!b.args||!b.version)throw Error("yt.pubsub2.Data.deserialize(): serializedData is incomplete.");var d;try{d=Ah(a)}catch(e){}if(!d||b.version!=d)throw Error("yt.pubsub2.Data.deserialize(): serializedData version is incompatible.");c.prototype=a.prototype;try{return new c}catch(f){throw f.message="yt.pubsub2.Data.deserialize(): "+f.message,f;}}function Ch(a,b){this.j=a;this.g=b}Ch.prototype.toString=function(){return this.j};var Dh=r("yt.pubsub2.instance_")||new F;F.prototype.subscribe=F.prototype.subscribe;F.prototype.unsubscribeByKey=F.prototype.ma;F.prototype.publish=F.prototype.publish;F.prototype.clear=F.prototype.clear;p("yt.pubsub2.instance_",Dh,void 0);var Eh=r("yt.pubsub2.subscribedKeys_")||{};p("yt.pubsub2.subscribedKeys_",Eh,void 0);var Fh=r("yt.pubsub2.topicToKeys_")||{};p("yt.pubsub2.topicToKeys_",Fh,void 0);var Gh=r("yt.pubsub2.isAsync_")||{};p("yt.pubsub2.isAsync_",Gh,void 0);
p("yt.pubsub2.skipSubKey_",null,void 0);function Hh(a,b){var c=Ih();c&&c.publish.call(c,a.toString(),a,b)}
function Jh(a,b){var c=Ih();if(!c)return 0;var d=c.subscribe(a.toString(),function(c,f){if(!window.yt.pubsub2.skipSubKey_||window.yt.pubsub2.skipSubKey_!=d){var h=function(){if(Eh[d])try{if(f&&a instanceof Ch&&a!=c)try{f=Bh(a.g,f)}catch(h){throw h.message="yt.pubsub2 cross-binary conversion error for "+a.toString()+": "+h.message,h;}b.call(window,f)}catch(m){vb(m)}};Gh[a.toString()]?r("yt.scheduler.instance")?yh(h):H(h,0):h()}});Eh[d]=!0;Fh[a.toString()]||(Fh[a.toString()]=[]);Fh[a.toString()].push(d);
return d}function Kh(){var a=Lh,b=Ih();b&&(fa(a)&&(a=[a]),A(a,function(a){b.unsubscribeByKey(a);delete Eh[a]}))}function Ih(){return r("yt.pubsub2.instance_")};function Mh(a,b,c,d,e,f){zh.call(this,1,arguments);this.j=a;this.g=b;this.o=c||null;this.A=d||null;this.k=e||null;this.source=f||null}x(Mh,zh);function Nh(a,b,c,d,e,f,h){zh.call(this,1,arguments);this.j=a;this.Sb=b;this.g=c;this.o=d||null;this.A=e||null;this.k=f||null;this.source=h||null}x(Nh,zh);var Oh=new Ch("subscription-subscribe",Mh),Ph=new Ch("subscription-subscribe-external",Mh),Qh=new Ch("subscription-unsubscribe",Nh),Rh=new Ch("subscription-external-unsubscribe",Nh);function Sh(a,b,c){var d=document.location.protocol+"//"+document.domain+"/post_login";b&&(d=fd(d,"mode",b));b=fd("/signin?context=popup","next",d);c&&(b=fd(b,"feature",c));if(c=window.open(b,"loginPopup","width=375,height=440,resizable=yes,scrollbars=yes",!0))b=J("LOGGED_IN",function(b){Eb(G("LOGGED_IN_PUBSUB_KEY"));qb("LOGGED_IN",!0);a(b)}),qb("LOGGED_IN_PUBSUB_KEY",b),c.moveTo((screen.width-375)/2,(screen.height-440)/2)}p("yt.pubsub.publish",K,void 0);var Th=null;"undefined"!=typeof XMLHttpRequest?Th=function(){return new XMLHttpRequest}:"undefined"!=typeof ActiveXObject&&(Th=function(){return new ActiveXObject("Microsoft.XMLHTTP")});function Uh(a,b,c,d,e,f,h){function k(){4==(m&&"readyState"in m?m.readyState:0)&&b&&tb(b)(m)}var m=Th&&Th();if(!("open"in m))return null;"onloadend"in m?m.addEventListener("loadend",k,!1):m.onreadystatechange=k;c=(c||"GET").toUpperCase();d=d||"";m.open(c,a,!0);f&&(m.responseType=f);h&&(m.withCredentials=!0);f="POST"==c;if(e=Vh(a,e))for(var q in e)m.setRequestHeader(q,e[q]),"content-type"==q.toLowerCase()&&(f=!1);f&&m.setRequestHeader("Content-Type","application/x-www-form-urlencoded");m.send(d);return m}
function Vh(a,b){b=b||{};for(var c in Wh){var d=G(Wh[c]),e;if(e=d){e=a;var f=void 0;f=window.location.href;var h=Yc(e)[1]||null,k=id(e);h&&k?(e=Yc(e),f=Yc(f),e=e[3]==f[3]&&e[1]==f[1]&&e[4]==f[4]):e=k?id(f)==k&&(Number(Yc(f)[4]||null)||null)==(Number(Yc(e)[4]||null)||null):!0;e||(e=c,f=G("CORS_HEADER_WHITELIST")||{},e=(h=id(a))?(f=f[h])?Ha(f,e):!1:!0)}e&&(b[c]=d)}return b}
function Xh(a,b){var c=G("XSRF_FIELD_NAME"),d;b.headers&&(d=b.headers["Content-Type"]);return!b.Ye&&(!id(a)||id(a)==document.location.hostname)&&"POST"==b.method&&(!d||"application/x-www-form-urlencoded"==d)&&!(b.T&&b.T[c])}
function Yh(a,b){var c=b.format||"JSON";b.We&&(a=document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:"")+a);var d=G("XSRF_FIELD_NAME"),e=G("XSRF_TOKEN"),f=b.jc;f&&(f[d]&&delete f[d],a=jd(a,f));var h=b.Xe||"",f=b.T;Xh(a,b)&&(f||(f={}),f[d]=e);f&&u(h)&&(d=hd(h),hb(d,f),h=ed(d));var k=!1,m,q=Uh(a,function(a){if(!k){k=!0;m&&I(m);var d;t:switch(a&&"status"in a?a.status:-1){case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 304:d=
!0;break t;default:d=!1}var e=null;if(d||400<=a.status&&500>a.status)e=Zh(c,a);if(d)t:{switch(c){case "XML":d=0==parseInt(e&&e.return_code,10);break t;case "RAW":d=!0;break t}d=!!e}var e=e||{},f=b.context||l;d?b.aa&&b.aa.call(f,a,e):b.onError&&b.onError.call(f,a,e);b.kc&&b.kc.call(f,a,e)}},b.method,h,b.headers,b.responseType,b.withCredentials);b.vb&&0<b.timeout&&(m=H(function(){k||(k=!0,q.abort(),I(m),b.vb.call(b.context||l,q))},b.timeout));return q}
function Zh(a,b){var c=null;switch(a){case "JSON":var d=b.responseText,e=b.getResponseHeader("Content-Type")||"";d&&0<=e.indexOf("json")&&(c=vg(d));break;case "XML":if(d=(d=b.responseXML)?$h(d):null)c={},A(d.getElementsByTagName("*"),function(a){c[a.tagName]=ai(a)})}return c}function $h(a){return a?(a=("responseXML"in a?a.responseXML:a).getElementsByTagName("root"))&&0<a.length?a[0]:null:null}function ai(a){var b="";A(a.childNodes,function(a){b+=a.nodeValue});return b}
var Wh={"X-YouTube-Page-CL":"PAGE_CL","X-YouTube-Page-Timestamp":"PAGE_BUILD_TIMESTAMP","X-YouTube-Variants-Checksum":"VARIANTS_CHECKSUM"};function bi(){var a=G("PLAYER_CONFIG");return a&&a.args&&void 0!==a.args.authuser?!0:!(!G("SESSION_INDEX")&&!G("LOGGED_IN"))};var ci={},di="ontouchstart"in document;function ei(a,b,c){var d;switch(a){case "mouseover":case "mouseout":d=3;break;case "mouseenter":case "mouseleave":d=9}return Dc(c,function(a){return Ub(a,b)},!0,d)}
function fi(a){var b="mouseover"==a.type&&"mouseenter"in ci||"mouseout"==a.type&&"mouseleave"in ci,c=a.type in ci||b;if("HTML"!=a.target.tagName&&c){if(b){var b="mouseover"==a.type?"mouseenter":"mouseleave",c=ci[b],d;for(d in c.fa){var e=ei(b,d,a.target);e&&!Dc(a.relatedTarget,function(a){return a==e},!0)&&c.publish(d,e,b,a)}}if(b=ci[a.type])for(d in b.fa)(e=ei(a.type,d,a.target))&&b.publish(d,e,a.type,a)}}O(document,"blur",fi,!0);O(document,"change",fi,!0);O(document,"click",fi);
O(document,"focus",fi,!0);O(document,"mouseover",fi);O(document,"mouseout",fi);O(document,"mousedown",fi);O(document,"keydown",fi);O(document,"keyup",fi);O(document,"keypress",fi);O(document,"cut",fi);O(document,"paste",fi);di&&(O(document,"touchstart",fi),O(document,"touchend",fi),O(document,"touchcancel",fi));function gi(){this.j={};this.k=[]}function hi(a,b){return"yt-uix"+(a.lc?"-"+a.lc:"")+(b?"-"+b:"")}gi.prototype.init=s;gi.prototype.dispose=s;function ii(a,b,c){b=J(b,c,a);a.k.push(b)}function ji(a,b,c){var d=hi(a,void 0),e=v(c,a);b in ci||(ci[b]=new F);ci[b].subscribe(d,e);a.j[c]=e}function ki(a,b){jb(a,"tooltip-text",b)}gi.prototype.removeData=function(a,b){a&&(a.dataset?delete a.dataset[kb(b)]:a.removeAttribute("data-"+b))};function li(){gi.call(this);this.g={}}x(li,gi);ba(li);g=li.prototype;g.lc="tooltip";g.Kb=0;g.register=function(){ji(this,"mouseover",this.Wc);ji(this,"mouseout",this.Jb);ji(this,"click",this.Jb);ji(this,"touchstart",this.He);ji(this,"touchend",this.Zc);ji(this,"touchcancel",this.Zc)};g.dispose=function(){for(var a in this.g)this.Jb(this.g[a]);this.g={}};
g.Wc=function(a){if(!(this.Kb&&1E3>w()-this.Kb)){var b=parseInt(C(a,"tooltip-hide-timer"),10);b&&(this.removeData(a,"tooltip-hide-timer"),I(b));var b=v(function(){mi(this,a);this.removeData(a,"tooltip-show-timer")},this),c=parseInt(C(a,"tooltip-show-delay"),10)||0,b=H(b,c);jb(a,"tooltip-show-timer",b.toString());a.title&&(ki(a,ni(a)),a.title="");b=ia(a).toString();this.g[b]=a}};
g.Jb=function(a){var b=parseInt(C(a,"tooltip-show-timer"),10);b&&(I(b),this.removeData(a,"tooltip-show-timer"));b=v(function(){if(a){var b=tc(oi(this,a));b&&(pi(b),b&&b.parentNode&&b.parentNode.removeChild(b),this.removeData(a,"content-id"))}this.removeData(a,"tooltip-hide-timer")},this);b=H(b,50);jb(a,"tooltip-hide-timer",b.toString());if(b=C(a,"tooltip-text"))a.title=b;b=ia(a).toString();delete this.g[b]};g.He=function(a,b){this.Kb=0;var c=ei(b,hi(this),null[0].target);this.Wc(c)};
g.Zc=function(a,b){this.Kb=w();var c=ei(b,hi(this),null[0].target);this.Jb(c)};function qi(a,b){ki(a,b);var c=C(a,"content-id");if(c=tc(c))c.innerHTML=b}function ni(a){return C(a,"tooltip-text")||a.title}
function mi(a,b){if(b){var c=ni(b);if(c){var d=tc(oi(a,b));if(!d){d=document.createElement("div");d.id=oi(a,b);d.className=hi(a,"tip");var e=document.createElement("div");e.className=hi(a,"tip-body");var f=document.createElement("div");f.className=hi(a,"tip-arrow");var h=document.createElement("div");h.className=hi(a,"tip-content");var k=ri(a,b),m=oi(a,b,"content");h.id=m;jb(b,"content-id",m);e.appendChild(h);k&&d.appendChild(k);d.appendChild(e);d.appendChild(f);(Hc()||document.body).appendChild(d);
qi(b,c);(c=parseInt(C(b,"tooltip-max-width"),10))&&e.offsetWidth>c&&(e.style.width=c+"px",Vb(h,hi(a,"normal-wrap")));h=Ub(b,hi(a,"reverse"));si(a,b,d,e,k,h)||si(a,b,d,e,k,!h);var q=hi(a,"tip-visible");H(function(){Vb(d,q)},0)}}}}
function si(a,b,c,d,e,f){Xb(c,hi(a,"tip-reverse"),f);var h=0;f&&(h=1);a=Je(b);f=new L((a.width-10)/2,f?a.height:0);var k=He(b);f=new L(k.x+f.x,k.y+f.y);f=f.clone();var k=(h&4&&"rtl"==Ee(c,"direction")?h^2:h)&-5,h=Je(c),m=h.clone(),q;q=f.clone();m=m.clone();0!=k&&(k&2&&(q.x-=m.width+0),k&1&&(q.y-=m.height+0));f=new Ce(0,0,0,0);f.left=q.x;f.top=q.y;f.width=m.width;f.height=m.height;q=new L(f.left,f.top);m=cc&&(ac||ic)&&mc("1.9");q instanceof L?(k=q.x,q=q.y):(k=q,q=void 0);c.style.left=Ie(k,m);c.style.top=
Ie(q,m);m=new Yb(f.width,f.height);if(!(h==m||h&&m&&h.width==m.width&&h.height==m.height))if(h=m,f=sc(c),f=qc(f),k=yc(f.g),!N||mc("10")||k&&mc("8"))f=c.style,cc?f.MozBoxSizing="border-box":dc?f.WebkitBoxSizing="border-box":f.boxSizing="border-box",f.width=Math.max(h.width,0)+"px",f.height=Math.max(h.height,0)+"px";else if(f=c.style,k){if(N){k=Me(c,"paddingLeft");m=Me(c,"paddingRight");q=Me(c,"paddingTop");var U=Me(c,"paddingBottom"),k=new Be(q,m,U,k)}else k=De(c,"paddingLeft"),m=De(c,"paddingRight"),
q=De(c,"paddingTop"),U=De(c,"paddingBottom"),k=new Be(parseFloat(q),parseFloat(m),parseFloat(U),parseFloat(k));if(N&&!nc(9)){m=Oe(c,"borderLeft");q=Oe(c,"borderRight");var U=Oe(c,"borderTop"),ea=Oe(c,"borderBottom"),m=new Be(U,q,ea,m)}else m=De(c,"borderLeftWidth"),q=De(c,"borderRightWidth"),U=De(c,"borderTopWidth"),ea=De(c,"borderBottomWidth"),m=new Be(parseFloat(U),parseFloat(q),parseFloat(ea),parseFloat(m));f.pixelWidth=h.width-m.left-k.left-k.right-m.right;f.pixelHeight=h.height-m.top-k.top-k.bottom-
m.bottom}else f.pixelWidth=h.width,f.pixelHeight=h.height;h=window.document;h=yc(h)?h.documentElement:h.body;h=new Yb(h.clientWidth,h.clientHeight);if(1==c.nodeType){c.getBoundingClientRect?(f=Fe(c),f=new L(f.left,f.top)):(f=qc(c),f=xc(f.g),k=He(c),f=new L(k.x-f.x,k.y-f.y));if(cc&&!mc(12)){n:{k=ya();if(void 0===c.style[k]&&(k=(dc?"Webkit":cc?"Moz":N?"ms":bc?"O":null)+za(k),void 0!==c.style[k])){k=(dc?"-webkit":cc?"-moz":N?"-ms":bc?"-o":null)+"-transform";break n}k="transform"}c=(c=Ee(c,k)||Ee(c,"transform"))?
(c=c.match(Pe))?new L(parseFloat(c[1]),parseFloat(c[2])):new L(0,0):new L(0,0);c=new L(f.x+c.x,f.y+c.y)}else c=f;m=c}else f=ga(c.j),k=c,c.targetTouches&&c.targetTouches.length?k=c.targetTouches[0]:f&&c.g.targetTouches&&c.g.targetTouches.length&&(k=c.g.targetTouches[0]),m=new L(k.clientX,k.clientY);c=Je(d);q=Math.floor(c.width/2);f=!!(h.height<m.y+a.height);a=!!(m.y<a.height);k=!!(m.x<q);h=!!(h.width<m.x+q);m=(c.width+3)/-2- -5;b=C(b,"force-tooltip-direction");if("left"==b||k)m=-5;else if("right"==
b||h)m=20-c.width-3;b=Math.floor(m)+"px";d.style.left=b;e&&(e.style.left=b,e.style.height=c.height+"px",e.style.width=c.width+"px");return!(f||a)}function oi(a,b,c){a=hi(a);var d=b.__yt_uid_key;d||(d=Fc(),b.__yt_uid_key=d);b=a+d;c&&(b+="-"+c);return b}
function ri(a,b){var c=null;gc&&Ub(b,hi(a,"masked"))&&((c=tc("yt-uix-tooltip-shared-mask"))?(c.parentNode.removeChild(c),Re(c)):(c=document.createElement("iframe"),c.src='javascript:""',c.id="yt-uix-tooltip-shared-mask",c.className=hi(a,"tip-mask")));return c}function pi(a){var b=tc("yt-uix-tooltip-shared-mask"),c=b&&Dc(b,function(b){return b==a},!1,2);b&&c&&(b.parentNode.removeChild(b),Se(b),document.body.appendChild(b))};function ti(){gi.call(this)}x(ti,gi);ba(ti);ti.prototype.lc="subscription-button";
ti.prototype.register=function(){ji(this,"click",this.Tc);ii(this,"subscription-subscribe-loading",this.Vc);ii(this,"subscription-subscribe-loaded",this.Uc);ii(this,"subscription-unsubscirbe-loading",this.Vc);ii(this,"subscription-unsubscribe-loaded",this.Uc);ii(this,"subscription-subscribe-success",this.ye);ii(this,"subscription-unsubscribe-success",this.ze);ii(this,"subscription-enable-ypc",this.xe);ii(this,"subscription-disable-ypc",this.we)};
var Cc={Xc:"hover-enabled",Ae:"yt-uix-button-subscribe",Be:"yt-uix-button-subscribed",df:"ypc-enabled",Ne:"yt-uix-button-subscription-container",Oe:"yt-subscription-button-disabled-mask-container"},ui={ef:"channel-external-id",Ce:"subscriber-count-show-when-subscribed",De:"subscriber-count-tooltip",Ee:"subscriber-count-title",ff:"href",cd:"is-subscribed",gf:"parent-url",hf:"sessionlink",Fe:"style-type",ed:"subscription-id",jf:"target",Le:"ypc-enabled",fd:"ypc-offers-url"};g=ti.prototype;
g.Tc=function(a){var b=C(a,"href"),c=bi();if(b)a=C(a,"target")||"_self",window.open(b,a);else if(c){var b=C(a,"channel-external-id"),c=C(a,"sessionlink"),d;if(C(a,"ypc-enabled")){d=C(a,"ypc-item-type");var e=C(a,"ypc-item-id"),f=C(a,ui.fd);d={itemType:d,itemId:e,offersUrl:f,subscriptionElement:a}}else d=null;e=C(a,"parent-url");C(a,"is-subscribed")?(f=C(a,"subscription-id"),Hh(Qh,new Nh(b,f,d,a,c,e))):Hh(Oh,new Mh(b,d,a,c,e))}else vi(this,a)};g.Vc=function(a){this.bb(a,this.$c,!0)};
g.Uc=function(a){this.bb(a,this.$c,!1)};g.ye=function(a,b){this.bb(a,this.ad,!0,b)};g.ze=function(a){this.bb(a,this.ad,!1)};g.xe=function(a){this.bb(a,this.Je)};g.we=function(a){this.bb(a,this.Ie)};g.ad=function(a,b,c){b?(jb(a,ui.cd,"true"),c&&jb(a,ui.ed,c)):(this.removeData(a,ui.cd),this.removeData(a,ui.ed));wi(a)};g.$c=function(a,b){var c;c=Bc(a);Xb(c,Cc.Oe,b);a.setAttribute("aria-busy",b?"true":"false");a.disabled=b};
function wi(a){var b=C(a,ui.Fe),c=!!C(a,"is-subscribed"),b="-"+b,d=Cc.Be+b;Xb(a,Cc.Ae+b,!c);Xb(a,d,c);C(a,ui.De)&&!C(a,ui.Ce)&&(b=hi(li.getInstance()),Xb(a,b,!c),a.title=c?"":C(a,ui.Ee));c?H(function(){Vb(a,Cc.Xc)},1E3):Wb(a,Cc.Xc)}g.Je=function(a){var b=!!C(a,"ypc-item-type"),c=!!C(a,"ypc-item-id"),d=!!C(a,ui.fd);!C(a,"ypc-enabled")&&b&&c&&d&&(Vb(a,"ypc-enabled"),jb(a,ui.Le,"true"))};g.Ie=function(a){C(a,"ypc-enabled")&&(Wb(a,"ypc-enabled"),this.removeData(a,"ypc-enabled"))};
function xi(a,b){var c=vc(hi(a));return Ca(c,function(a){return b==C(a,"channel-external-id")},a)}g.Pe=function(a,b,c){var d=Sa(arguments,2);A(a,function(a){b.apply(this,Oa(a,d))},this)};g.bb=function(a,b,c){var d=xi(this,a),d=Oa([d],Sa(arguments,1));this.Pe.apply(this,d)};function vi(a,b){var c=v(function(a){a.discoverable_subscriptions&&qb("SUBSCRIBE_EMBED_DISCOVERABLE_SUBSCRIPTIONS",a.discoverable_subscriptions);this.Tc(b)},a);Sh(c,"subscribe","sub_button")};var yi=window.yt&&window.yt.uix&&window.yt.uix.widgets_||{};p("yt.uix.widgets_",yi,void 0);function zi(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=!1;this.Fc=!0}zi.prototype.dispose=function(){};zi.prototype.preventDefault=function(){this.defaultPrevented=!0;this.Fc=!1};function Ai(a){Ai[" "](a);return a}Ai[" "]=s;var Bi=!N||nc(9),Ci=N&&!mc("9");!dc||mc("528");cc&&mc("1.9b")||N&&mc("8")||bc&&mc("9.5")||dc&&mc("528");cc&&!mc("8")||N&&mc("9");function Di(a,b){zi.call(this,a?a.type:"");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.clientY=this.clientX=0;this.shiftKey=this.altKey=this.ctrlKey=!1;this.g=this.state=null;a&&this.init(a,b)}x(Di,zi);
Di.prototype.init=function(a,b){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;if(d){if(cc){var e;t:{try{Ai(d.nodeName);e=!0;break t}catch(f){}e=!1}e||(d=null)}}else"mouseover"==c?d=a.fromElement:"mouseout"==c&&(d=a.toElement);this.relatedTarget=d;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||("keypress"==c?a.keyCode:0);
this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.state=a.state;this.g=a;a.defaultPrevented&&this.preventDefault()};Di.prototype.preventDefault=function(){Di.L.preventDefault.call(this);var a=this.g;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,Ci)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Di.prototype.j=function(){return this.g};var Ei="closure_listenable_"+(1E6*Math.random()|0),Fi=0;function Gi(a,b,c,d,e){this.listener=a;this.proxy=null;this.src=b;this.type=c;this.Eb=!!d;this.Ib=e;this.key=++Fi;this.removed=this.Gb=!1}function Hi(a){a.removed=!0;a.listener=null;a.proxy=null;a.src=null;a.Ib=null};function Ii(a){this.src=a;this.g={};this.j=0}Ii.prototype.add=function(a,b,c,d,e){var f=a.toString();a=this.g[f];a||(a=this.g[f]=[],this.j++);var h=Ji(a,b,d,e);-1<h?(b=a[h],c||(b.Gb=!1)):(b=new Gi(b,this.src,f,!!d,e),b.Gb=c,a.push(b));return b};Ii.prototype.remove=function(a,b,c,d){a=a.toString();if(!(a in this.g))return!1;var e=this.g[a];b=Ji(e,b,c,d);return-1<b?(Hi(e[b]),z.splice.call(e,b,1),0==e.length&&(delete this.g[a],this.j--),!0):!1};
function Ki(a,b){var c=b.type;if(!(c in a.g))return!1;var d=Ma(a.g[c],b);d&&(Hi(b),0==a.g[c].length&&(delete a.g[c],a.j--));return d}Ii.prototype.removeAll=function(a){a=a&&a.toString();var b=0,c;for(c in this.g)if(!a||c==a){for(var d=this.g[c],e=0;e<d.length;e++)++b,Hi(d[e]);delete this.g[c];this.j--}return b};function Li(a,b,c,d,e){a=a.g[b.toString()];b=-1;a&&(b=Ji(a,c,d,e));return-1<b?a[b]:null}
function Ji(a,b,c,d){for(var e=0;e<a.length;++e){var f=a[e];if(!f.removed&&f.listener==b&&f.Eb==!!c&&f.Ib==d)return e}return-1};var Mi="closure_lm_"+(1E6*Math.random()|0),Ni={},Oi=0;function Pi(a,b,c,d,e){if(t(b)){for(var f=0;f<b.length;f++)Pi(a,b[f],c,d,e);return null}c=Qi(c);if(a&&a[Ei])a=a.listen(b,c,d,e);else{if(!b)throw Error("Invalid event type");var f=!!d,h=Ri(a);h||(a[Mi]=h=new Ii(a));c=h.add(b,c,!1,d,e);c.proxy||(d=Si(),c.proxy=d,d.src=a,d.listener=c,a.addEventListener?a.addEventListener(b.toString(),d,f):a.attachEvent(Ti(b.toString()),d),Oi++);a=c}return a}
function Si(){var a=Ui,b=Bi?function(c){return a.call(b.src,b.listener,c)}:function(c){c=a.call(b.src,b.listener,c);if(!c)return c};return b}function Vi(a,b,c,d,e){if(t(b))for(var f=0;f<b.length;f++)Vi(a,b[f],c,d,e);else c=Qi(c),a&&a[Ei]?a.$b(b,c,d,e):a&&(a=Ri(a))&&(b=Li(a,b,c,!!d,e))&&Wi(b)}
function Wi(a){if(fa(a)||!a||a.removed)return!1;var b=a.src;if(b&&b[Ei])return Ki(b.Ca,a);var c=a.type,d=a.proxy;b.removeEventListener?b.removeEventListener(c,d,a.Eb):b.detachEvent&&b.detachEvent(Ti(c),d);Oi--;(c=Ri(b))?(Ki(c,a),0==c.j&&(c.src=null,b[Mi]=null)):Hi(a);return!0}function Ti(a){return a in Ni?Ni[a]:Ni[a]="on"+a}function Xi(a,b,c,d){var e=1;if(a=Ri(a))if(b=a.g[b.toString()])for(b=b.concat(),a=0;a<b.length;a++){var f=b[a];f&&f.Eb==c&&!f.removed&&(e&=!1!==Yi(f,d))}return Boolean(e)}
function Yi(a,b){var c=a.listener,d=a.Ib||a.src;a.Gb&&Wi(a);return c.call(d,b)}
function Ui(a,b){if(a.removed)return!0;if(!Bi){var c=b||r("window.event"),d=new Di(c,this),e=!0;if(!(0>c.keyCode||void 0!=c.returnValue)){t:{var f=!1;if(0==c.keyCode)try{c.keyCode=-1;break t}catch(h){f=!0}if(f||void 0==c.returnValue)c.returnValue=!0}c=[];for(f=d.currentTarget;f;f=f.parentNode)c.push(f);for(var f=a.type,k=c.length-1;0<=k;k--)d.currentTarget=c[k],e&=Xi(c[k],f,!0,d);for(k=0;k<c.length;k++)d.currentTarget=c[k],e&=Xi(c[k],f,!1,d)}return e}return Yi(a,new Di(b,this))}
function Ri(a){a=a[Mi];return a instanceof Ii?a:null}var Zi="__closure_events_fn_"+(1E9*Math.random()>>>0);function Qi(a){if(ga(a))return a;a[Zi]||(a[Zi]=function(b){return a.handleEvent(b)});return a[Zi]};function $i(){D.call(this);this.Ca=new Ii(this);this.Pb=this;this.ra=null}x($i,D);$i.prototype[Ei]=!0;g=$i.prototype;g.addEventListener=function(a,b,c,d){Pi(this,a,b,c,d)};g.removeEventListener=function(a,b,c,d){Vi(this,a,b,c,d)};
function aj(a,b){var c,d=a.ra;if(d){c=[];for(var e=1;d;d=d.ra)c.push(d),++e}var d=a.Pb,e=b,f=e.type||e;if(u(e))e=new zi(e,d);else if(e instanceof zi)e.target=e.target||d;else{var h=e,e=new zi(f,d);hb(e,h)}var h=!0,k;if(c)for(var m=c.length-1;0<=m;m--)k=e.currentTarget=c[m],h=bj(k,f,!0,e)&&h;k=e.currentTarget=d;h=bj(k,f,!0,e)&&h;h=bj(k,f,!1,e)&&h;if(c)for(m=0;m<c.length;m++)k=e.currentTarget=c[m],h=bj(k,f,!1,e)&&h}g.F=function(){$i.L.F.call(this);this.removeAllListeners();this.ra=null};
g.listen=function(a,b,c,d){return this.Ca.add(String(a),b,!1,c,d)};g.$b=function(a,b,c,d){return this.Ca.remove(String(a),b,c,d)};g.removeAllListeners=function(a){return this.Ca?this.Ca.removeAll(a):0};function bj(a,b,c,d){b=a.Ca.g[String(b)];if(!b)return!0;b=b.concat();for(var e=!0,f=0;f<b.length;++f){var h=b[f];if(h&&!h.removed&&h.Eb==c){var k=h.listener,m=h.Ib||h.src;h.Gb&&Ki(a.Ca,h);e=!1!==k.call(m,d)&&e}}return e&&0!=d.Fc};function cj(a,b){$i.call(this);this.g=a||1;this.j=b||l;this.k=v(this.vd,this);this.A=w()}x(cj,$i);g=cj.prototype;g.enabled=!1;g.ga=null;function dj(a,b){a.g=b;a.ga&&a.enabled?(a.stop(),a.start()):a.ga&&a.stop()}g.vd=function(){if(this.enabled){var a=w()-this.A;0<a&&a<.8*this.g?this.ga=this.j.setTimeout(this.k,this.g-a):(this.ga&&(this.j.clearTimeout(this.ga),this.ga=null),aj(this,"tick"),this.enabled&&(this.ga=this.j.setTimeout(this.k,this.g),this.A=w()))}};
g.start=function(){this.enabled=!0;this.ga||(this.ga=this.j.setTimeout(this.k,this.g),this.A=w())};g.stop=function(){this.enabled=!1;this.ga&&(this.j.clearTimeout(this.ga),this.ga=null)};g.F=function(){cj.L.F.call(this);this.stop();delete this.j};function ej(a,b,c){if(ga(a))c&&(a=v(a,c));else if(a&&"function"==typeof a.handleEvent)a=v(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<b?-1:l.setTimeout(a,b||0)};var fj={auto:0,tiny:144,light:144,small:240,medium:360,large:480,hd720:720,hd1080:1080,hd1440:1440,highres:2160};function T(){D.call(this);this.A=new F;mb(this,na(E,this.A))}x(T,D);T.prototype.subscribe=function(a,b,c){return this.H()?0:this.A.subscribe(a,b,c)};T.prototype.unsubscribe=function(a,b,c){return this.H()?!1:this.A.unsubscribe(a,b,c)};T.prototype.ma=function(a){return this.H()?!1:this.A.ma(a)};T.prototype.publish=function(a,b){return this.H()?!1:this.A.publish.apply(this.A,arguments)};function gj(a,b,c){this.j=a||0;this.k=b||0;this.g=c}gj.prototype.equals=function(a){return this.j==a.j&&this.k==a.k&&this.g==a.g};function hj(a){new gj(fj.auto||0,fj[a]||0,!1)}hj("large");hj("auto");var ij;var jj=M,kj=jj.match(/\((iPad|iPhone|iPod)( Simulator)?;/);if(!kj||2>kj.length)ij=void 0;else{var lj=jj.match(/\((iPad|iPhone|iPod)( Simulator)?; (U; )?CPU (iPhone )?OS (\d_\d)[_ ]/);ij=lj&&6==lj.length?Number(lj[5].replace("_",".")):0}0<=ij&&0<=M.search("Safari")&&M.search("Version");function mj(a){return(0==a.search("cue")||0==a.search("load"))&&"loadModule"!=a}function nj(a,b,c){u(a)&&(a={mediaContentUrl:a,startSeconds:b,suggestedQuality:c});b=a;c=/\/([ve]|embed)\/([^#?]+)/.exec(a.mediaContentUrl);b.videoId=c&&c[2]?c[2]:null;return oj(a)}
function oj(a,b,c){if(ha(a)){b="endSeconds startSeconds mediaContentUrl suggestedQuality videoId two_stage_token".split(" ");c={};for(var d=0;d<b.length;d++){var e=b[d];a[e]&&(c[e]=a[e])}return c}return{videoId:a,startSeconds:b,suggestedQuality:c}}
function pj(a,b,c,d){if(ha(a)&&!t(a)){b="playlist list listType index startSeconds suggestedQuality".split(" ");c={};for(d=0;d<b.length;d++){var e=b[d];a[e]&&(c[e]=a[e])}return c}c={index:b,startSeconds:c,suggestedQuality:d};u(a)&&16==a.length?c.list="PL"+a:c.playlist=a;return c}
function qj(a){var b=a.video_id||a.videoId;if(u(b)){var c=S("yt-player-two-stage-token")||{},d=S("yt-player-two-stage-token")||{};n(void 0)?d[b]=void 0:delete d[b];R("yt-player-two-stage-token",d,300);(b=c[b])&&(a.two_stage_token=b)}};var rj=w(),sj=null,tj=Array(50),uj=-1,vj=!1;function wj(a){xj();sj.push(a);yj(sj)}function zj(a){var b=r("yt.mdx.remote.debug.handlers_");Ma(b||[],a)}function Aj(a,b){xj();var c=sj,d=Bj(a,String(b));Ia(c)?Cj(d):(yj(c),A(c,function(a){a(d)}))}function xj(){sj||(sj=r("yt.mdx.remote.debug.handlers_")||[],p("yt.mdx.remote.debug.handlers_",sj,void 0))}function Cj(a){var b=(uj+1)%50;uj=b;tj[b]=a;vj||(vj=49==b)}
function yj(a){var b=tj;if(b[0]){var c=uj,d=vj?c:-1;do{var d=(d+1)%50,e=b[d];A(a,function(a){a(e)})}while(d!=c);tj=Array(50);uj=-1;vj=!1}}function Bj(a,b){var c=(w()-rj)/1E3;c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")};function Dj(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||""}function Ej(a,b){return!!b&&(a.id==b||a.uuid==b)}function Fj(a,b){return a||b?!a!=!b?!1:a.id==b.id:!0}function Gj(a,b){return a||b?!a!=!b?!1:a.id==b.id&&a.token==b.token&&a.name==b.name&&a.uuid==b.uuid:!0}function Hj(a){return{name:a.name,screenId:a.id,loungeToken:a.token,dialId:a.uuid}}function Ij(a){return new Dj(a)}function Jj(a){return t(a)?B(a,Ij):[]}
function Kj(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"}function Lj(a){return t(a)?"["+B(a,Kj).join(",")+"]":"null"};var Mj=["boadgeojelhgndaghljhdicfkmllpafd","dliochdbjfkdbacpmhlcpmleaejidimm","hfaagokkkhdbgiakmmlclaapfelnkoah","fmfcbgogabcbclcofgocippekhfcmgfj","enhhojjnijigcajfphajepfemndkmdlo"];function Nj(a){var b=S("yt-remote-cast-last-extension");b?"none"==b?a(null):a(b):Oj(0,a)}function Oj(a,b){a==Mj.length?(R("yt-remote-cast-last-extension","none"),b(null)):Pj(Mj[a],function(c){c?(c=Mj[a],R("yt-remote-cast-last-extension",c),b(c)):Oj(a+1,b)})}
function Qj(a){return"chrome-extension://"+a+"/cast_sender.js"}function Pj(a,b){var c=new XMLHttpRequest;c.onreadystatechange=function(){4==c.readyState&&200==c.status&&b(!0)};c.onerror=function(){b(!1)};try{c.open("GET",Qj(a),!0),c.send()}catch(d){b(!1)}}
function Rj(a){window.__onGCastApiAvailable=a;Nj(function(b){if(b){Aj("bootstrap","Found cast extension: "+b);p("chrome.cast.extensionId",b,void 0);var c=document.createElement("script");c.src=Qj(b);c.onerror=function(){Sj();Og("yt-remote-cast-last-extension");a(!1,"Extension JS failed to load.")};(document.head||document.documentElement).appendChild(c)}else Aj("bootstrap","No cast extension found"),a(!1,"No cast extension found")})}
function Sj(){window.__onGCastApiAvailable&&delete window.__onGCastApiAvailable};function Tj(a){this.port=this.k="";this.g="/api/lounge";this.j=!0;a=a||document.location.href;var b=Number(Yc(a)[4]||null)||null||"";b&&(this.port=":"+b);this.k=$c(a)||"";a=M;0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>va(a,"10.0")&&(this.j=!1))}function Uj(a,b,c,d){var e=a.g;if(n(d)?d:a.j)e="https://"+a.k+a.port+a.g;return gd(e+b,c||{})}
Tj.prototype.sendRequest=function(a,b,c,d,e,f,h){a={format:f?"RAW":"JSON",method:a,context:this,timeout:5E3,withCredentials:!!h,aa:na(this.o,d,!f),onError:na(this.A,e),vb:na(this.B,e)};c&&(a.T=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return Yh(b,a)};Tj.prototype.o=function(a,b,c,d){b?a(d):a({text:c.responseText})};Tj.prototype.A=function(a,b){a(Error("Request error: "+b.status))};Tj.prototype.B=function(a){a(Error("request timed out"))};function Vj(a){a&&(this.id=a.id||"",this.name=a.name||"",this.activityId=a.activityId||"",this.status=a.status||"UNKNOWN")}Vj.prototype.id="";Vj.prototype.name="";Vj.prototype.activityId="";Vj.prototype.status="UNKNOWN";function Wj(a){return{id:a.id,name:a.name,activityId:a.activityId,status:a.status}}Vj.prototype.toString=function(){return"{id:"+this.id+",name:"+this.name+",activityId:"+this.activityId+",status:"+this.status+"}"};
function Xj(a){a=a||[];return"["+B(a,function(a){return a?a.toString():"null"}).join(",")+"]"};function Yj(){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)})}function Zj(a,b){return Fa(a,function(a){return a.key==b})}function ak(a){return B(a,function(a){return{key:a.id,name:a.name}})}function bk(a){return B(a,function(a){return Wj(a)})}function ck(a){return B(a,function(a){return new Vj(a)})}function dk(a,b){return a||b?a&&b?a.id==b.id&&a.name==b.name:!1:!0}
function ek(a,b){return Fa(a,function(a){return a.id==b})}function fk(a,b){return Fa(a,function(a){return Fj(a,b)})}function V(a,b){return Fa(a,function(a){return Ej(a,b)})};function gk(a){T.call(this);this.J=a;this.screens=[]}x(gk,T);g=gk.prototype;g.V=function(){return this.screens};g.contains=function(a){return!!fk(this.screens,a)};g.get=function(a){return a?V(this.screens,a):null};function hk(a,b){var c=a.get(b.uuid)||a.get(b.id);if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.screens.push(b);return!0}
function ik(a,b){var c=a.screens.length!=b.length;a.screens=Ca(a.screens,function(a){return!!fk(b,a)});for(var d=0,e=b.length;d<e;d++)c=hk(a,b[d])||c;return c}function jk(a,b){var c=a.screens.length;a.screens=Ca(a.screens,function(a){return!Fj(a,b)});return a.screens.length<c}g.info=function(a){Aj(this.J,a)};g.warn=function(a){Aj(this.J,a)};function kk(a){a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.avatar=a.userAvatarUri||"")}kk.prototype.id="";kk.prototype.name="";kk.prototype.app="";kk.prototype.type="REMOTE_CONTROL";kk.prototype.avatar="";kk.prototype.equals=function(a){return a?this.id==a.id:!1};var lk;function mk(){var a=nk(),b=ok();Ha(a,b);if(pk()){var c=a,d;d=0;for(var e=c.length,f;d<e;){var h=d+e>>1,k;k=Va(b,c[h]);0<k?d=h+1:(e=h,f=!k)}d=f?d:~d;0>d&&Ra(c,-(d+1),0,b)}a=qk(a);Ia(a)?Qc.remove("remote_sid","/","youtube.com"):Sc("remote_sid",a.join(","))}function nk(){var a=S("yt-remote-connected-devices")||[];a.sort(Va);return a}function qk(a){if(Ia(a))return[];var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return B(a,function(a,b){return 0==b?a:a.substring(c.length)})}
function rk(a){R("yt-remote-connected-devices",a,86400)}function ok(){if(sk)return sk;var a=S("yt-remote-device-id");a||(a=Yj(),R("yt-remote-device-id",a,31536E3));for(var b=nk(),c=1,d=a;Ha(b,d);)c++,d=a+"#"+c;return sk=d}function tk(){return S("yt-remote-session-browser-channel")}function pk(){return S("yt-remote-session-screen-id")}
function uk(a){5<a.length&&(a=a.slice(a.length-5));var b=B(vk(),function(a){return a.loungeToken}),c=B(a,function(a){return a.loungeToken});Ea(c,function(a){return!Ha(b,a)})&&wk();R("yt-remote-local-screens",a,31536E3)}function vk(){return S("yt-remote-local-screens")||[]}function xk(a){R("yt-remote-load-account-screens",a,31536E3)}function wk(){R("yt-remote-lounge-token-expiration",!0,86400)}function yk(){return!S("yt-remote-lounge-token-expiration")}
function zk(a){R("yt-remote-online-screens",a,60)}function Ak(){return S("yt-remote-online-screens")||[]}function Bk(a){R("yt-remote-online-dial-devices",a,30)}function Ck(){return S("yt-remote-online-dial-devices")||[]}function Dk(a,b){R("yt-remote-session-browser-channel",a);R("yt-remote-session-screen-id",b);var c=nk(),d=ok();Ha(c,d)||c.push(d);rk(c);mk()}function Ek(a){a||(Og("yt-remote-session-screen-id"),Og("yt-remote-session-video-id"));mk();a=nk();Ma(a,ok());rk(a)}
function Fk(){if(!lk){var a;a=new sg;(a=a.isAvailable()?a:null)&&(lk=new Cg(a))}return lk?!!lk.get("yt-remote-use-staging-server"):!1}var sk="";function Gk(a){gk.call(this,"AccountScreenService");this.g=a;this.j=NaN;this.screens=Hk();this.info("Initializing with "+Lj(this.screens))}x(Gk,gk);g=Gk.prototype;g.start=function(){this.Nc()};g.add=function(a,b,c){if(this.contains(a))this.Da(a,a.name,b,c);else{var d=Ik(this,a.id);this.g.sendRequest("POST",d,{screen_name:a.name},v(this.he,this,a,b,c),v(this.Db,this,"add",c),!0,!0)}};
g.remove=function(a,b,c){if(this.contains(a)){var d=Ik(this,a.id);this.g.sendRequest("DELETE",d,null,v(this.ie,this,a,b,c),v(this.Db,this,"remove",c),!0,!0)}else a="Trying to remove non-account screen: "+a.name,this.warn(a),c(Error(a))};g.Da=function(a,b,c,d){if(this.contains(a)){var e=Ik(this,a.id);this.g.sendRequest("PUT",e,{screen_name:b},v(this.je,this,a,b,c,d),v(this.Db,this,"update",d),!0,!0)}else a="Trying to update non-account screen: "+a.name,this.warn(a),d(Error(a))};
g.F=function(){I(this.j);Gk.L.F.call(this)};function Jk(a,b){return a.length!=b.length?!1:Ta(a,b,function(a,b){return a||b?!a!=!b?!1:a.id==b.id&&a.name==b.name:!0})}function Hk(){var a=Jj(vk()),b=Jj(Ak());return Ca(b,function(b){return!V(a,b.id)})}function Ik(a,b){var c=Uj(a.g,"/screens");return b?c+"/"+b:c}g.Nc=function(){if(!this.H()){I(this.j);var a=Ik(this);this.g.sendRequest("GET",a,null,v(this.Jd,this),v(this.Db,this,"load",s),!1,!0)}};
g.Jd=function(a){if(!this.H())if(a=Jj(Za(a)),Jk(this.screens,a))for(var b=0,c=this.screens.length;b<c;++b){var d=this.screens[b],e=V(a,d.id);e&&e.token&&(d.token=e.token)}else this.info("Updated account screens: "+Lj(a)),this.screens=a,this.publish("screenChange"),a=this.V().length?12E4:6E4,this.j=H(v(this.Nc,this),a)};g.he=function(a,b){this.H()||(hk(this,a),this.publish("screenChange"),b(a))};g.ie=function(a,b){this.H()||(jk(this,a),this.publish("screenChange"),b(a))};
g.je=function(a,b,c){this.H()||(a=this.get(a.id),a.name=b,c(a),this.publish("screenChange"))};g.Db=function(a,b,c){this.H()||(a="Failed to "+a+" account screen: "+c,this.warn(a),b(Error(a)))};function Kk(a,b,c,d){T.call(this);this.J=a;this.D=b;this.o=c;this.B=d;this.k=0;this.g=null;this.j=NaN}x(Kk,T);var Lk=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g=Kk.prototype;g.start=function(){!this.g&&isNaN(this.j)&&this.uc()};g.stop=function(){this.g&&(this.g.abort(),this.g=null);isNaN(this.j)||(I(this.j),this.j=NaN)};g.F=function(){this.stop();Kk.L.F.call(this)};
g.uc=function(){this.j=NaN;this.g=Yh(Uj(this.J,"/pairing/get_screen"),{method:"POST",T:{pairing_code:this.D},timeout:5E3,aa:v(this.zd,this),onError:v(this.yd,this),vb:v(this.Bd,this)})};g.zd=function(a,b){this.g=null;var c=b.screen||{};c.dialId=this.o;c.name=this.B;this.publish("pairingComplete",new Dj(c))};
g.yd=function(a){this.g=null;a.status&&404==a.status?this.k>=Lk.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=Lk[this.k],this.j=H(v(this.uc,this),a),this.k++):this.publish("pairingFailed",Error("Server error "+a.status))};g.Bd=function(){this.g=null;this.publish("pairingFailed",Error("Server not responding"))};function Mk(a){gk.call(this,"LocalScreenService");this.j=a;this.g=NaN;Nk(this);this.info("Initializing with "+Lj(this.screens))}x(Mk,gk);g=Mk.prototype;g.start=function(){Nk(this)&&this.publish("screenChange");yk()&&Ok(this);I(this.g);this.g=H(v(this.start,this),1E4)};g.add=function(a,b){Nk(this);hk(this,a);Pk(this,!1);this.publish("screenChange");b(a);a.token||Ok(this)};g.remove=function(a,b){var c=Nk(this);jk(this,a)&&(Pk(this,!1),c=!0);b(a);c&&this.publish("screenChange")};
g.Da=function(a,b,c,d){var e=Nk(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,Pk(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.publish("screenChange")};g.F=function(){I(this.g);Mk.L.F.call(this)};function Ok(a){if(a.screens.length){var b=B(a.screens,function(a){return a.id}),c=Uj(a.j,"/pairing/get_lounge_token_batch");a.j.sendRequest("POST",c,{screen_ids:b.join(",")},v(a.pe,a),v(a.oe,a))}}
g.pe=function(a){Nk(this);var b=this.screens.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}Pk(this,!b);b&&this.warn("Missed "+b+" lounge tokens.")};g.oe=function(a){this.warn("Requesting lounge tokens failed: "+a)};function Nk(a){var b=Jj(vk()),b=Ca(b,function(a){return!a.uuid});return ik(a,b)}function Pk(a,b){uk(B(a.screens,Hj));b&&wk()};function Qk(a,b){T.call(this);this.B=b;this.g=Rk(this);this.D=a;this.k=this.o=NaN;this.j=null;this.J=v(this.od,this);Sk("Initialized with "+Q(this.g))}x(Qk,T);g=Qk.prototype;g.start=function(){var a=parseInt(S("yt-remote-fast-check-period")||"0",10);(this.o=w()-144E5<a?0:a)?Tk(this,!1):(this.o=w()+3E5,R("yt-remote-fast-check-period",this.o),this.gc());O(window,"storage",this.J)};g.isEmpty=function(){return cb(this.g)};
g.update=function(){Sk("Updating availability on schedule.");var a=this.B(),b=Xa(this.g,function(b,d){return b&&!!V(a,d)},this);Uk(this,b)};function Vk(a,b,c){var d=Uj(a.D,"/pairing/get_screen_availability");a.D.sendRequest("POST",d,{lounge_token:b.token},v(function(a){a=a.screens||[];for(var d=0,h=a.length;d<h;++d)if(a[d].loungeToken==b.token){c("online"==a[d].status);return}c(!1)},a),v(function(){c(!1)},a))}
g.F=function(){I(this.k);this.k=NaN;this.j&&(this.j.abort(),this.j=null);var a=Lc(window,"storage",this.J,!1);a&&Mc(a);Qk.L.F.call(this)};function Uk(a,b){var c;t:if(Ya(b)!=Ya(a.g))c=!1;else{c=$a(b);for(var d=0,e=c.length;d<e;++d)if(!a.g[c[d]]){c=!1;break t}c=!0}c||(Sk("Updated online screens: "+Q(a.g)),a.g=b,a.publish("screenChange"));Wk(a)}function Tk(a,b){isNaN(a.k)||I(a.k);var c=v(a.gc,a),d;d=0;b&&(d=2E3+8E3*Math.random());d=0<a.o&&a.o<w()?2E4+d:1E4+d;a.k=H(c,d)}
g.gc=function(){I(this.k);this.k=NaN;this.j&&this.j.abort();var a=Xk(this);if(Ya(a)){var b=Uj(this.D,"/pairing/get_screen_availability"),c={lounge_token:$a(a).join(",")};this.j=this.D.sendRequest("POST",b,c,v(this.ne,this,a),v(this.le,this))}else Uk(this,{}),Tk(this,!1)};
g.ne=function(a,b){this.j=null;var c=$a(Xk(this));if(Ta(c,$a(a))){for(var c=b.screens||[],d={},e=0,f=c.length;e<f;++e)d[a[c[e].loungeToken]]="online"==c[e].status;Uk(this,d);Tk(this,!1)}else this.O("Changing Screen set during request."),this.gc()};g.le=function(a){this.O("Screen availability failed: "+a);this.j=null;Tk(this,!1)};g.od=function(a){"yt-remote-online-screen-ids"==a.key&&(this.g=Rk(this),Tk(this,!0))};function Sk(a){Aj("OnlineScreenService",a)}
g.O=function(a){Aj("OnlineScreenService",a)};function Xk(a){var b={};A(a.B(),function(a){a.token?b[a.token]=a.id:this.O("Requesting availability of screen w/o lounge token.")});return b}function Rk(a){var b=S("yt-remote-online-screen-ids")||"",b=b?b.split(","):[],c={};a=a.B();for(var d=0,e=a.length;d<e;++d){var f=a[d].id;c[f]=Ha(b,f)}return c}
function Wk(a){var b=$a(Xa(a.g,function(a){return a}));b.sort(Va);b.length?R("yt-remote-online-screen-ids",b.join(","),60):Og("yt-remote-online-screen-ids");a=Ca(a.B(),function(a){return!!this.g[a.id]},a);zk(B(a,Hj))};function W(a,b){gk.call(this,"ScreenService");this.o=a;this.k=this.g=this.j=null;this.B=[];this.D={};Yk(this,b)}x(W,gk);g=W.prototype;g.start=function(a){a?(this.g||(this.g=new Gk(this.o),this.g.subscribe("screenChange",v(this.kb,this))),this.g.start()):this.g&&(E(this.g),this.g=null,Zk(this));this.j.start();this.k.start();this.screens.length&&(this.publish("screenChange"),this.k.isEmpty()||this.publish("onlineScreenChange"))};
g.add=function(a,b,c){this.g?this.g.add(a,v(function(a){this.kb();this.j.add(a,s,s);b(a)},this),c):this.j.add(a,b,c)};g.remove=function(a,b,c){this.g&&this.g.contains(a)?(this.g.remove(a,v(function(a){this.kb();b(a)},this),c),this.j.remove(a,s,s)):this.j.remove(a,b,c);this.k.update()};g.Da=function(a,b,c,d){this.g&&this.g.contains(a)?(this.g.Da(a,b,c,d),this.j.Da(a,b,s,s)):this.j.contains(a)?this.j.Da(a,b,c,d):(a="Updating name of unknown screen: "+a.name,this.warn(a),d(Error(a)))};
g.V=function(a){return a?this.screens:Oa(this.screens,Ca(this.B,function(a){return!this.contains(a)},this))};g.zc=function(){return Ca(this.V(!0),function(a){return!!this.k.g[a.id]},this)};
function $k(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);c||(c=a.D[b]);var h=a.V();if(h=(c?V(h,c):null)||V(h,b)){h.uuid=b;var k=al(a,h);Vk(a.k,k,function(a){e(a?k:null)})}else c?bl(a,c,v(function(a){var f=al(this,new Dj({name:d,screenId:c,loungeToken:a,dialId:b||""}));Vk(this.k,f,function(a){e(a?f:null)})},a),f):e(null)}
function cl(a,b,c,d,e,f){a.info("getDialScreenByPairingCode "+b+" / "+c);var h=new Kk(a.o,b,c,d);h.subscribe("pairingComplete",v(function(a){E(h);e(al(this,a))},a));h.subscribe("pairingFailed",function(a){E(h);f(a)});h.start();return v(h.stop,h)}function dl(a,b){for(var c=0,d=a.screens.length;c<d;++c)if(a.screens[c].name==b)return a.screens[c];return null}g.Rc=function(a,b){for(var c=2,d=b(a,c);dl(this,d);){c++;if(20<c)return a;d=b(a,c)}return d};
g.Ue=function(a,b,c,d){Yh(Uj(this.o,"/pairing/get_screen"),{method:"POST",T:{pairing_code:a},timeout:5E3,aa:v(function(a,d){var h=new Dj(d.screen||{});if(!h.name||dl(this,h.name))h.name=this.Rc(h.name,b);c(al(this,h))},this),onError:v(function(a){d(Error("pairing request failed: "+a.status))},this),vb:v(function(){d(Error("pairing request timed out."))},this)})};g.F=function(){E(this.g);E(this.j);E(this.k);W.L.F.call(this)};
function bl(a,b,c,d){a.info("requestLoungeToken_ for "+b);var e={T:{screen_ids:b},method:"POST",context:a,aa:function(a,e){var k=e&&e.screens||[];k[0]&&k[0].screenId==b?c(k[0].loungeToken):d(Error("Missing lounge token in token response"))},onError:function(){d(Error("Request screen lounge token failed"))}};Yh(Uj(a.o,"/pairing/get_lounge_token_batch"),e)}
function Zk(a){a.g?a.screens=Oa(a.g.V(),Ca(a.j.V(),function(a){return!this.g.contains(a)},a)):a.screens=a.j.V();for(var b=fb(a.D),c=0,d=a.screens.length;c<d;++c){var e=a.screens[c];e.uuid=b[e.id]||""}a.info("Updated manual screens: "+Lj(a.screens))}g.kb=function(){Zk(this);this.publish("screenChange");this.k.update()};
function Yk(a,b){el(a);a.j=new Mk(a.o);a.j.subscribe("screenChange",v(a.kb,a));b&&(a.g=new Gk(a.o),a.g.subscribe("screenChange",v(a.kb,a)));Zk(a);a.B=Jj(S("yt-remote-automatic-screen-cache")||[]);el(a);a.info("Initializing automatic screens: "+Lj(a.B));a.k=new Qk(a.o,v(a.V,a,!0));a.k.subscribe("screenChange",v(function(){this.publish("onlineScreenChange")},a))}
function al(a,b){var c=a.get(b.id);c?(c.uuid=b.uuid,b=c):((c=V(a.B,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.B.push(b),R("yt-remote-automatic-screen-cache",B(a.B,Hj)));el(a);a.D[b.uuid]=b.id;R("yt-remote-device-id-map",a.D,31536E3);return b}function el(a){a.D=S("yt-remote-device-id-map")||{}}W.prototype.dispose=W.prototype.dispose;function fl(a,b,c){T.call(this);this.da=c;this.S=a;this.j=b;this.k=null}x(fl,T);function gl(a,b){a.k=b;a.publish("sessionScreen",a.k)}g=fl.prototype;g.ba=function(a){this.H()||(a&&this.warn(""+a),this.k=null,this.publish("sessionScreen",null))};g.info=function(a){Aj(this.da,a)};g.warn=function(a){Aj(this.da,a)};g.Kc=function(){return null};
g.Ub=function(a){var b=this.j;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,v(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),v(function(){this.warn("Failed to update receiver status for: "+b.friendlyName)},this))};g.F=function(){this.Ub("");fl.L.F.call(this)};function hl(a,b){fl.call(this,a,b,"CastSession");this.g=null;this.B=0;this.o=null;this.J=v(this.Ld,this);this.D=v(this.Kd,this);this.B=H(v(function(){il(this,null)},this),12E4)}x(hl,fl);g=hl.prototype;
g.Zb=function(a){if(this.g){if(this.g==a)return;this.warn("Overriding cast sesison with new session object");this.g.removeUpdateListener(this.J);this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D)}this.g=a;this.g.addUpdateListener(this.J);this.g.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.D);this.o&&jl(this);kl(this,"getMdxSessionStatus")};g.Xa=function(a){this.info("launchWithParams: "+Q(a));this.o=a;this.g&&jl(this)};
g.stop=function(){this.g?this.g.stop(v(function(){this.ba()},this),v(function(){this.ba(Error("Failed to stop receiver app."))},this)):this.ba(Error("Stopping cast device witout session."))};g.Ub=s;g.F=function(){this.info("disposeInternal");I(this.B);this.B=0;this.g&&(this.g.removeUpdateListener(this.J),this.g.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.D));this.g=null;hl.L.F.call(this)};
function jl(a){var b=a.o.videoId||a.o.videoIds[a.o.index];b&&kl(a,"flingVideo",{videoId:b,currentTime:a.o.currentTime||0});a.o=null}function kl(a,b,c){a.info("sendYoutubeMessage_: "+b+" "+Q(c));var d={};d.type=b;c&&(d.data=c);a.g?a.g.sendMessage("urn:x-cast:com.google.youtube.mdx",d,s,v(function(){this.warn("Failed to send message: "+b+".")},a)):a.warn("Sending yt message without session: "+Q(d))}
g.Kd=function(a,b){if(!this.H())if(b){var c=vg(b);if(c){var d=""+c.type,c=c.data||{};this.info("onYoutubeMessage_: "+d+" "+Q(c));switch(d){case "mdxSessionStatus":il(this,c.screenId);break;default:this.warn("Unknown youtube message: "+d)}}else this.warn("Unable to parse message.")}else this.warn("No data in message.")};
function il(a,b){I(a.B);b?(a.info("onConnectedScreenId_: Received screenId: "+b),a.k&&a.k.id==b||$k(a.S,a.j.label,b,a.j.friendlyName,v(function(a){a?gl(this,a):this.ba(Error("Unable to fetch screen."))},a),v(a.ba,a))):a.ba(Error("Waiting for session status timed out."))}g.Kc=function(){return this.g};g.Ld=function(a){this.H()||a||(this.warn("Cast session died."),this.ba())};function ll(a,b){fl.call(this,a,b,"DialSession");this.B=this.M=null;this.W="";this.o=null;this.J=s;this.D=NaN;this.Y=v(this.Id,this);this.g=s}x(ll,fl);g=ll.prototype;g.Zb=function(a){this.B=a;this.B.addUpdateListener(this.Y)};g.Xa=function(a){this.o=a;this.J()};g.stop=function(){this.g();this.g=s;I(this.D);this.B?this.B.stop(v(this.ba,this,null),v(this.ba,this,"Failed to stop DIAL device.")):this.ba()};
g.F=function(){this.g();this.g=s;I(this.D);this.B&&this.B.removeUpdateListener(this.Y);this.B=null;ll.L.F.call(this)};function ml(a){a.g=cl(a.S,a.W,a.j.label,a.j.friendlyName,v(function(a){this.g=s;gl(this,a)},a),v(function(a){this.g=s;this.ba(a)},a))}g.Id=function(a){this.H()||a||(this.warn("DIAL session died."),this.g(),this.g=s,this.ba())};
function nl(a){var b={};b.pairingCode=a.W;if(a.o){var c=a.o.index||0,d=a.o.currentTime||0;b.v=a.o.videoId||a.o.videoIds[c];b.t=d}Fk()&&(b.env_useStageMdx=1);return ed(b)}g.Wb=function(a){this.W=Yj();if(this.o){var b=new chrome.cast.DialLaunchResponse(!0,nl(this));a(b);ml(this)}else this.J=v(function(){I(this.D);this.J=s;this.D=NaN;var b=new chrome.cast.DialLaunchResponse(!0,nl(this));a(b);ml(this)},this),this.D=H(v(function(){this.J()},this),100)};
g.sd=function(a,b){$k(this.S,this.M.receiver.label,a,this.j.friendlyName,v(function(a){a&&a.token?(gl(this,a),b(new chrome.cast.DialLaunchResponse(!1))):this.Wb(b)},this),v(function(a){this.warn("Failed to get DIAL screen: "+a);this.Wb(b)},this))};function ol(a,b){fl.call(this,a,b,"ManualSession");this.g=H(v(this.Xa,this,null),150)}x(ol,fl);ol.prototype.stop=function(){this.ba()};ol.prototype.Zb=s;ol.prototype.Xa=function(){I(this.g);this.g=NaN;var a=V(this.S.V(),this.j.label);a?gl(this,a):this.ba(Error("No such screen"))};ol.prototype.F=function(){I(this.g);this.g=NaN;ol.L.F.call(this)};function X(a){T.call(this);this.j=a;this.g=null;this.B=!1;this.k=[];this.o=v(this.qd,this)}x(X,T);g=X.prototype;
g.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest("233637DE");c.dialRequest=new chrome.cast.DialRequest("YouTube");var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED,e=a?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION,c=new chrome.cast.ApiConfig(c,v(this.Dc,this),v(this.Xd,this),d,e);c.customDialLaunchCallback=v(this.Wd,this);chrome.cast.initialize(c,v(function(){this.H()||(chrome.cast.addReceiverActionListener(this.o),
wj(pl),this.j.subscribe("onlineScreenChange",v(this.oc,this)),this.k=ql(this),chrome.cast.setCustomReceivers(this.k,s,v(function(a){this.O("Failed to set initial custom receivers: "+Q(a))},this)),this.publish("yt-remote-cast2-availability-change",rl(this)),b(!0))},this),function(a){this.O("Failed to initialize API: "+Q(a));b(!1)})};
g.Se=function(a,b){sl("Setting connected screen ID: "+a+" -> "+b);if(this.g){var c=this.g.k;if(!a||c&&c.id!=a)sl("Unsetting old screen status: "+this.g.j.friendlyName),E(this.g),this.g=null}if(a&&b){if(!this.g){c=V(this.j.V(),a);if(!c){sl("setConnectedScreenStatus: Unknown screen.");return}var d=tl(this,c);d||(sl("setConnectedScreenStatus: Connected receiver not custom..."),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.k.push(d),chrome.cast.setCustomReceivers(this.k,
s,v(function(a){this.O("Failed to set initial custom receivers: "+Q(a))},this)));sl("setConnectedScreenStatus: new active receiver: "+d.friendlyName);ul(this,new ol(this.j,d),!0)}this.g.Ub(b)}else sl("setConnectedScreenStatus: no screen.")};function tl(a,b){return b?Fa(a.k,function(a){return Ej(b,a.label)},a):null}g.Te=function(a){this.H()?this.O("Setting connection data on disposed cast v2"):this.g?this.g.Xa(a):this.O("Setting connection data without a session")};
g.stopSession=function(){this.H()?this.O("Stopping session on disposed cast v2"):this.g?(this.g.stop(),E(this.g),this.g=null):sl("Stopping non-existing session")};g.requestSession=function(){chrome.cast.requestSession(v(this.Dc,this),v(this.Me,this))};g.F=function(){this.j.unsubscribe("onlineScreenChange",v(this.oc,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.o);zj(pl);E(this.g);X.L.F.call(this)};function sl(a){Aj("Controller",a)}
g.O=function(a){Aj("Controller",a)};function pl(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)}function rl(a){return a.B||!!a.k.length||!!a.g}function ul(a,b,c){E(a.g);(a.g=b)?(c?a.publish("yt-remote-cast2-receiver-resumed",b.j):a.publish("yt-remote-cast2-receiver-selected",b.j),b.subscribe("sessionScreen",v(a.sc,a,b)),b.k?a.publish("yt-remote-cast2-session-change",b.k):c&&a.g.Xa(null)):a.publish("yt-remote-cast2-session-change",null)}
g.sc=function(a,b){this.g==a&&(b||ul(this,null),this.publish("yt-remote-cast2-session-change",b))};
g.qd=function(a,b){if(!this.H())if(a)switch(sl("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.g)if(this.g.j.label!=a.label)sl("onReceiverAction_: Stopping active receiver: "+this.g.j.friendlyName),this.g.stop();else{sl("onReceiverAction_: Casting to active receiver.");this.g.k&&this.publish("yt-remote-cast2-session-change",this.g.k);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:ul(this,new ol(this.j,a));break;case chrome.cast.ReceiverType.DIAL:ul(this,
new ll(this.j,a));break;case chrome.cast.ReceiverType.CAST:ul(this,new hl(this.j,a));break;default:this.O("Unknown receiver type: "+a.receiverType);return}break;case chrome.cast.ReceiverAction.STOP:this.g&&this.g.j.label==a.label?this.g.stop():this.O("Stopping receiver w/o session: "+a.friendlyName)}else this.O("onReceiverAction_ called without receiver.")};
g.Wd=function(a){if(this.H())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.O("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.g?this.g.j:null;if(!c||c.label!=b.label)return this.O("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.g.k)return sl("Reselecting dial screen."),
this.publish("yt-remote-cast2-session-change",this.g.k),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.O('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);ul(this,new ll(this.j,b))}b=this.g;b.M=a;return b.M.appState==chrome.cast.DialAppState.RUNNING?new Promise(v(b.sd,b,(b.M.extraData||{}).screenId||null)):new Promise(v(b.Wb,b))};
g.Dc=function(a){if(!this.H()){sl("New cast session ID: "+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.g)if(b.receiverType==chrome.cast.ReceiverType.CAST)sl("Got resumed cast session before resumed mdx connection."),ul(this,new hl(this.j,b),!0);else{this.O("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.g.j,d=V(this.j.V(),c.label);d&&Ej(d,b.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&b.receiverType==
chrome.cast.ReceiverType.CAST&&(sl("onSessionEstablished_: manual to cast session change "+b.friendlyName),E(this.g),this.g=new hl(this.j,b),this.g.subscribe("sessionScreen",v(this.sc,this,this.g)),this.g.Xa(null));this.g.Zb(a)}}};g.Ve=function(){return this.g?this.g.Kc():null};g.Me=function(a){this.H()||(this.O("Failed to estabilish a session: "+Q(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&ul(this,null))};
g.Xd=function(a){sl("Receiver availability updated: "+a);if(!this.H()){var b=rl(this);this.B=a==chrome.cast.ReceiverAvailability.AVAILABLE;rl(this)!=b&&this.publish("yt-remote-cast2-availability-change",rl(this))}};
function ql(a){var b=a.j.zc(),c=a.g&&a.g.j;a=B(b,function(a){c&&Ej(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,f=tl(this,a);f?(f.label=b,f.friendlyName=a.name):(f=new chrome.cast.Receiver(b,a.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a);c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a}
g.oc=function(){if(!this.H()){var a=rl(this);this.k=ql(this);sl("Updating custom receivers: "+Q(this.k));chrome.cast.setCustomReceivers(this.k,s,v(function(){this.O("Failed to set custom receivers.")},this));var b=rl(this);b!=a&&this.publish("yt-remote-cast2-availability-change",b)}};X.prototype.setLaunchParams=X.prototype.Te;X.prototype.setConnectedScreenStatus=X.prototype.Se;X.prototype.stopSession=X.prototype.stopSession;X.prototype.getCastSession=X.prototype.Ve;X.prototype.requestSession=X.prototype.requestSession;
X.prototype.init=X.prototype.init;X.prototype.dispose=X.prototype.dispose;function vl(a,b){ue?xl(a)&&(yl(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?zl(b):Rj(function(a,d){a?zl(b):(Al("Failed to load cast API: "+d),Bl(!1),yl(!1),Og("yt-remote-cast-available"),Og("yt-remote-cast-receiver"),Cl(),b(!1))})):wl("Cannot initialize because not running Chrome")}function Cl(){wl("dispose");Sj();var a=Dl();a&&a.dispose();El=null;p("yt.mdx.remote.cloudview.instance_",null,void 0);Fl(!1);Eb(Gl);Gl.length=0}function Hl(){return!!S("yt-remote-cast-installed")}
function Il(){var a=S("yt-remote-cast-receiver");return a?a.friendlyName:null}function Jl(){wl("clearCurrentReciever");Og("yt-remote-cast-receiver")}function Kl(){Hl()?Dl()?Ll()?(wl("Requesting cast selector."),El.requestSession()):(wl("Wait for cast API to be ready to request the session."),Gl.push(J("yt-remote-cast2-api-ready",Kl))):Al("requestCastSelector: Cast is not initialized."):Al("requestCastSelector: Cast API is not installed!")}
function Ml(a){Ll()?Dl().setLaunchParams(a):Al("setLaunchParams called before ready.")}function Nl(a,b){Ll()?Dl().setConnectedScreenStatus(a,b):Al("setConnectedScreenStatus called before ready.")}var El=null;function Ol(a){El.init(!0,a)}
function xl(a){var b=!1;if(!El){var c=r("yt.mdx.remote.cloudview.instance_");c||(c=new X(a),c.subscribe("yt-remote-cast2-availability-change",function(a){R("yt-remote-cast-available",a);K("yt-remote-cast2-availability-change",a)}),c.subscribe("yt-remote-cast2-receiver-selected",function(a){wl("onReceiverSelected: "+a.friendlyName);R("yt-remote-cast-receiver",a);K("yt-remote-cast2-receiver-selected",a)}),c.subscribe("yt-remote-cast2-receiver-resumed",function(a){wl("onReceiverResumed: "+a.friendlyName);
R("yt-remote-cast-receiver",a)}),c.subscribe("yt-remote-cast2-session-change",function(a){wl("onSessionChange: "+Kj(a));a||Og("yt-remote-cast-receiver");K("yt-remote-cast2-session-change",a)}),p("yt.mdx.remote.cloudview.instance_",c,void 0),b=!0);El=c}wl("cloudview.createSingleton_: "+b);return b}function Dl(){El||(El=r("yt.mdx.remote.cloudview.instance_"));return El}
function zl(a){Bl(!0);yl(!1);Ol(function(b){b?(Fl(!0),K("yt-remote-cast2-api-ready")):(Al("Failed to initialize cast API."),Bl(!1),Og("yt-remote-cast-available"),Og("yt-remote-cast-receiver"),Cl());a(b)})}function wl(a){Aj("cloudview",a)}function Al(a){Aj("cloudview",a)}function Bl(a){wl("setCastInstalled_ "+a);R("yt-remote-cast-installed",a)}function Ll(){return!!r("yt.mdx.remote.cloudview.apiReady_")}function Fl(a){wl("setApiReady_ "+a);p("yt.mdx.remote.cloudview.apiReady_",a,void 0)}
function yl(a){p("yt.mdx.remote.cloudview.initializing_",a,void 0)}var Gl=[];function Pl(){if(!("cast"in window))return!1;var a=window.cast||{};return"ActivityStatus"in a&&"Api"in a&&"LaunchRequest"in a&&"Receiver"in a}function Ql(a){Aj("CAST",a)}function Rl(a){var b=Sl();b&&b.logMessage&&b.logMessage(a)}function Tl(a){if(a.source==window&&a.data&&"CastApi"==a.data.source&&"Hello"==a.data.event)for(;Ul.length;)Ul.shift()()}
function Vl(){if(!r("yt.mdx.remote.castv2_")&&!Wl&&(Ia(Ka)&&Qa(Ka,Ck()),Pl())){var a=Sl();a?(a.removeReceiverListener("YouTube",Xl),a.addReceiverListener("YouTube",Xl),Ql("API initialized in the other binary")):(a=new cast.Api,Yl(a),a.addReceiverListener("YouTube",Xl),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){H(function(){window.location.reload(!0)},1E3)}),wj(Rl),Ql("API initialized"));Wl=!0}}
function Zl(){var a=Sl();a&&(Ql("API disposed"),zj(Rl),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(s),a.removeReceiverListener("YouTube",Xl),Yl(null));Wl=!1;Ul=null;(a=Lc(window,"message",Tl,!1))&&Mc(a)}function $l(a){var b=Ga(Ka,function(b){return b.id==a.id});0<=b&&(Ka[b]=Wj(a))}
function Xl(a){a.length&&Ql("Updating receivers: "+Q(a));am(a);K("yt-remote-cast-device-list-update");A(bm(),function(a){cm(a.id)});A(a,function(a){if(a.isTabProjected){var c=dm(a.id);Ql("Detected device: "+c.id+" is tab projected. Firing DEVICE_TAB_PROJECTED event.");H(function(){K("yt-remote-cast-device-tab-projected",c.id)},1E3)}})}
function em(a,b){Ql("Updating "+a+" activity status: "+Q(b));var c=dm(a);c?(b.activityId&&(c.activityId=b.activityId),c.status="running"==b.status?"RUNNING":"stopped"==b.status?"STOPPED":"error"==b.status?"ERROR":"UNKNOWN","RUNNING"!=c.status&&(c.activityId=""),$l(c),K("yt-remote-cast-device-status-update",c)):Ql("Device not found")}function bm(){Vl();return ck(Ka)}
function am(a){a=B(a,function(a){var c=a.id,d;d=a.name;d=y(d,"&")?"document"in l?sa(d):ua(d):d;c={id:c,name:d};if(a=dm(a.id))c.activityId=a.activityId,c.status=a.status;return c});Ja();Qa(Ka,a)}function dm(a){var b=bm();return Fa(b,function(b){return b.id==a})||null}function cm(a){var b=dm(a),c=Sl();c&&b&&b.activityId&&c.getActivityStatus(b.activityId,function(b){"error"==b.status&&(b.status="stopped");em(a,b)})}
function fm(a){Vl();var b=dm(a),c=Sl();c&&b&&b.activityId?(Ql("Stopping cast activity"),c.stopActivity(b.activityId,na(em,a))):Ql("Dropping cast activity stop")}function Sl(){return r("yt.mdx.remote.castapi.api_")}function Yl(a){p("yt.mdx.remote.castapi.api_",a,void 0)}var Wl=!1,Ul=null,Ka=r("yt.mdx.remote.castapi.devices_")||[];p("yt.mdx.remote.castapi.devices_",Ka,void 0);function gm(a,b){this.action=a;this.params=b||null};function hm(){this.g=w()}new hm;hm.prototype.set=function(a){this.g=a};hm.prototype.get=function(){return this.g};function im(a,b){this.j=new xg(a);this.g=b?vg:ug}im.prototype.stringify=function(a){return wg(this.j,a)};im.prototype.parse=function(a){return this.g(a)};function jm(a,b,c){D.call(this);this.A=a;this.k=b;this.j=c;this.g=v(this.ud,this)}x(jm,D);g=jm.prototype;g.Nb=!1;g.Wa=null;g.stop=function(){this.Wa&&(l.clearTimeout(this.Wa),this.Wa=null,this.Nb=!1)};g.F=function(){jm.L.F.call(this);this.stop()};g.ud=function(){this.Wa=null;this.Nb&&(this.Nb=!1,km(this))};function km(a){a.Wa=ej(a.g,a.k);a.A.call(a.j)};function lm(a){D.call(this);this.j=a;this.g={}}x(lm,D);var mm=[];g=lm.prototype;g.listen=function(a,b,c,d){t(b)||(b&&(mm[0]=b.toString()),b=mm);for(var e=0;e<b.length;e++){var f=Pi(a,b[e],c||this.handleEvent,d||!1,this.j||this);if(!f)break;this.g[f.key]=f}return this};
g.$b=function(a,b,c,d,e){if(t(b))for(var f=0;f<b.length;f++)this.$b(a,b[f],c,d,e);else c=c||this.handleEvent,e=e||this.j||this,c=Qi(c),d=!!d,b=a&&a[Ei]?Li(a.Ca,String(b),c,d,e):a?(a=Ri(a))?Li(a,b,c,d,e):null:null,b&&(Wi(b),delete this.g[b.key]);return this};g.removeAll=function(){Wa(this.g,Wi);this.g={}};g.F=function(){lm.L.F.call(this);this.removeAll()};g.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented");};function nm(){}nm.prototype.g=null;function om(a){var b;(b=a.g)||(b={},pm(a)&&(b[0]=!0,b[1]=!0),b=a.g=b);return b};var qm;function rm(){}x(rm,nm);function sm(a){return(a=pm(a))?new ActiveXObject(a):new XMLHttpRequest}function pm(a){if(!a.j&&"undefined"==typeof XMLHttpRequest&&"undefined"!=typeof ActiveXObject){for(var b=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],c=0;c<b.length;c++){var d=b[c];try{return new ActiveXObject(d),a.j=d}catch(e){}}throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");}return a.j}qm=new rm;function tm(a,b,c,d,e){this.g=a;this.k=c;this.D=d;this.K=e||1;this.o=45E3;this.A=new lm(this);this.j=new cj;dj(this.j,250)}g=tm.prototype;g.Ha=null;g.ka=!1;g.ab=null;g.fc=null;g.jb=null;g.$a=null;g.ya=null;g.Ea=null;g.Ia=null;g.R=null;g.ob=0;g.na=null;g.Hb=null;g.Ka=null;g.fb=-1;g.yc=!0;g.La=!1;g.Vb=0;g.zb=null;var um={},vm={};g=tm.prototype;g.setTimeout=function(a){this.o=a};function wm(a,b,c){a.$a=1;a.ya=Pf(b.clone());a.Ia=c;a.B=!0;xm(a,null)}
function ym(a,b,c,d,e){a.$a=1;a.ya=Pf(b.clone());a.Ia=null;a.B=c;e&&(a.yc=!1);xm(a,d)}function xm(a,b){a.jb=w();zm(a);a.Ea=a.ya.clone();Nf(a.Ea,"t",a.K);a.ob=0;a.R=a.g.cc(a.g.ib()?b:null);0<a.Vb&&(a.zb=new jm(v(a.Ac,a,a.R),a.Vb));a.A.listen(a.R,"readystatechange",a.Td);var c=a.Ha?db(a.Ha):{};a.Ia?(a.Hb="POST",c["Content-Type"]="application/x-www-form-urlencoded",a.R.send(a.Ea,a.Hb,a.Ia,c)):(a.Hb="GET",a.yc&&!dc&&(c.Connection="close"),a.R.send(a.Ea,a.Hb,null,c));a.g.ja(1)}
g.Td=function(a){a=a.target;var b=this.zb;b&&3==Am(a)?b.Wa?b.Nb=!0:km(b):this.Ac(a)};
g.Ac=function(a){try{if(a==this.R)t:{var b=Am(this.R),c=this.R.A,d=this.R.getStatus();if(N&&!nc(10)||dc&&!mc("420+")){if(4>b)break t}else if(3>b||3==b&&!bc&&!Bm(this.R))break t;this.La||4!=b||7==c||(8==c||0>=d?this.g.ja(3):this.g.ja(2));Cm(this);var e=this.R.getStatus();this.fb=e;var f=Bm(this.R);(this.ka=200==e)?(4==b&&Dm(this),this.B?(Em(this,b,f),bc&&this.ka&&3==b&&(this.A.listen(this.j,"tick",this.wd),this.j.start())):Fm(this,f),this.ka&&!this.La&&(4==b?this.g.Ab(this):(this.ka=!1,zm(this)))):
(this.Ka=400==e&&0<f.indexOf("Unknown SID")?3:0,Y(),Dm(this),Gm(this))}}catch(h){this.R&&Bm(this.R)}finally{}};function Em(a,b,c){for(var d=!0;!a.La&&a.ob<c.length;){var e=Hm(a,c);if(e==vm){4==b&&(a.Ka=4,Y(),d=!1);break}else if(e==um){a.Ka=4;Y();d=!1;break}else Fm(a,e)}4==b&&0==c.length&&(a.Ka=1,Y(),d=!1);a.ka=a.ka&&d;d||(Dm(a),Gm(a))}g.wd=function(){var a=Am(this.R),b=Bm(this.R);this.ob<b.length&&(Cm(this),Em(this,a,b),this.ka&&4!=a&&zm(this))};
function Hm(a,b){var c=a.ob,d=b.indexOf("\n",c);if(-1==d)return vm;c=Number(b.substring(c,d));if(isNaN(c))return um;d+=1;if(d+c>b.length)return vm;var e=b.substr(d,c);a.ob=d+c;return e}
function Im(a,b){a.jb=w();zm(a);var c=b?window.location.hostname:"";a.Ea=a.ya.clone();P(a.Ea,"DOMAIN",c);P(a.Ea,"t",a.K);try{a.na=new ActiveXObject("htmlfile")}catch(d){Dm(a);a.Ka=7;Y();Gm(a);return}var e="<html><body>";b&&(e+='<script>document.domain="'+c+'"\x3c/script>');e+="</body></html>";a.na.open();a.na.write(e);a.na.close();a.na.parentWindow.m=v(a.Vd,a);a.na.parentWindow.d=v(a.Cc,a,!0);a.na.parentWindow.rpcClose=v(a.Cc,a,!1);c=a.na.createElement("div");a.na.parentWindow.document.body.appendChild(c);
c.innerHTML='<iframe src="'+a.Ea+'"></iframe>';a.g.ja(1)}g.Vd=function(a){Jm(v(this.Re,this,a),0)};g.Re=function(a){this.La||(Cm(this),Fm(this,a),zm(this))};g.Cc=function(a){Jm(v(this.Qe,this,a),0)};g.Qe=function(a){this.La||(Dm(this),this.ka=a,this.g.Ab(this),this.g.ja(4))};g.cancel=function(){this.La=!0;Dm(this)};function zm(a){a.fc=w()+a.o;Km(a,a.o)}function Km(a,b){if(null!=a.ab)throw Error("WatchDog timer not null");a.ab=Jm(v(a.Ke,a),b)}function Cm(a){a.ab&&(l.clearTimeout(a.ab),a.ab=null)}
g.Ke=function(){this.ab=null;var a=w();0<=a-this.fc?(2!=this.$a&&this.g.ja(3),Dm(this),this.Ka=2,Y(),Gm(this)):Km(this,this.fc-a)};function Gm(a){a.g.Hc()||a.La||a.g.Ab(a)}function Dm(a){Cm(a);E(a.zb);a.zb=null;a.j.stop();a.A.removeAll();if(a.R){var b=a.R;a.R=null;Lm(b);b.dispose()}a.na&&(a.na=null)}function Fm(a,b){try{a.g.Jc(a,b),a.g.ja(4)}catch(c){}};function Mm(a,b,c,d,e){if(0==d)c(!1);else{var f=e||0;d--;Nm(a,b,function(e){e?c(!0):l.setTimeout(function(){Mm(a,b,c,d,f)},f)})}}function Nm(a,b,c){var d=new Image;d.onload=function(){try{Om(d),c(!0)}catch(a){}};d.onerror=function(){try{Om(d),c(!1)}catch(a){}};d.onabort=function(){try{Om(d),c(!1)}catch(a){}};d.ontimeout=function(){try{Om(d),c(!1)}catch(a){}};l.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);d.src=a}
function Om(a){a.onload=null;a.onerror=null;a.onabort=null;a.ontimeout=null};function Pm(a){this.g=a;this.j=new im(null,!0)}g=Pm.prototype;g.Tb=null;g.ea=null;g.Cb=!1;g.tc=null;g.Bb=null;g.Yb=null;g.ec=null;g.ha=null;g.va=-1;g.mb=null;g.nb=null;g.connect=function(a){this.ec=a;a=Qm(this.g,null,this.ec);Y();this.tc=w();var b=this.g.D;null!=b?(this.mb=b[0],(this.nb=b[1])?(this.ha=1,Rm(this)):(this.ha=2,Sm(this))):(Nf(a,"MODE","init"),this.ea=new tm(this,0,void 0,void 0,void 0),this.ea.Ha=this.Tb,ym(this.ea,a,!1,null,!0),this.ha=0)};
function Rm(a){var b=Qm(a.g,a.nb,"/mail/images/cleardot.gif");Pf(b);Mm(b.toString(),5E3,v(a.Yd,a),3,2E3);a.ja(1)}g.Yd=function(a){if(a)this.ha=2,Sm(this);else{Y();var b=this.g;b.ia=b.Aa.va;Tm(b,9)}a&&this.ja(2)};
function Sm(a){var b=a.g.Z;if(null!=b)Y(),b?(Y(),Um(a.g,a,!1)):(Y(),Um(a.g,a,!0));else if(a.ea=new tm(a,0,void 0,void 0,void 0),a.ea.Ha=a.Tb,b=a.g,b=Qm(b,b.ib()?a.mb:null,a.ec),Y(),!N||nc(10))Nf(b,"TYPE","xmlhttp"),ym(a.ea,b,!1,a.mb,!1);else{Nf(b,"TYPE","html");var c=a.ea;a=Boolean(a.mb);c.$a=3;c.ya=Pf(b.clone());Im(c,a)}}g.cc=function(a){return this.g.cc(a)};g.Hc=function(){return!1};
g.Jc=function(a,b){this.va=a.fb;if(0==this.ha)if(b){try{var c=this.j.parse(b)}catch(d){c=this.g;c.ia=this.va;Tm(c,2);return}this.mb=c[0];this.nb=c[1]}else c=this.g,c.ia=this.va,Tm(c,2);else if(2==this.ha)if(this.Cb)Y(),this.Yb=w();else if("11111"==b){if(Y(),this.Cb=!0,this.Bb=w(),c=this.Bb-this.tc,!N||nc(10)||500>c)this.va=200,this.ea.cancel(),Y(),Um(this.g,this,!0)}else Y(),this.Bb=this.Yb=w(),this.Cb=!1};
g.Ab=function(){this.va=this.ea.fb;if(this.ea.ka)0==this.ha?this.nb?(this.ha=1,Rm(this)):(this.ha=2,Sm(this)):2==this.ha&&(a=!1,(a=!N||nc(10)?this.Cb:200>this.Yb-this.Bb?!1:!0)?(Y(),Um(this.g,this,!0)):(Y(),Um(this.g,this,!1)));else{0==this.ha?Y():2==this.ha&&Y();var a=this.g;a.ia=this.va;Tm(a,2)}};g.ib=function(){return this.g.ib()};g.isActive=function(){return this.g.isActive()};g.ja=function(a){this.g.ja(a)};function Vm(a){$i.call(this);this.headers=new sd;this.Y=a||null;this.j=!1;this.W=this.g=null;this.xa=this.J="";this.A=0;this.o="";this.k=this.pa=this.D=this.da=!1;this.B=0;this.M=null;this.Ta="";this.S=this.eb=!1}x(Vm,$i);var Wm=/^https?$/i,Xm=["POST","PUT"];g=Vm.prototype;
g.send=function(a,b,c,d){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.J+"; newUri="+a);b=b?b.toUpperCase():"GET";this.J=a;this.o="";this.A=0;this.xa=b;this.da=!1;this.j=!0;this.g=this.Y?sm(this.Y):sm(qm);this.W=this.Y?om(this.Y):om(qm);this.g.onreadystatechange=v(this.mc,this);try{yd(Ym(this,"Opening Xhr")),this.pa=!0,this.g.open(b,String(a),!0),this.pa=!1}catch(e){yd(Ym(this,"Error opening Xhr: "+e.message));Zm(this,e);return}a=c||"";var f=this.headers.clone();
d&&xd(d,function(a,b){f.set(b,a)});d=Fa(f.ta(),$m);c=l.FormData&&a instanceof l.FormData;!Ha(Xm,b)||d||c||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");f.forEach(function(a,b){this.g.setRequestHeader(b,a)},this);this.Ta&&(this.g.responseType=this.Ta);"withCredentials"in this.g&&(this.g.withCredentials=this.eb);try{an(this),0<this.B&&(this.S=bn(this.g),yd(Ym(this,"Will abort after "+this.B+"ms if incomplete, xhr2 "+this.S)),this.S?(this.g.timeout=this.B,this.g.ontimeout=v(this.nc,
this)):this.M=ej(this.nc,this.B,this)),yd(Ym(this,"Sending request")),this.D=!0,this.g.send(a),this.D=!1}catch(h){yd(Ym(this,"Send error: "+h.message)),Zm(this,h)}};function bn(a){return N&&mc(9)&&fa(a.timeout)&&n(a.ontimeout)}function $m(a){return"content-type"==a.toLowerCase()}g.nc=function(){"undefined"!=typeof aa&&this.g&&(this.o="Timed out after "+this.B+"ms, aborting",this.A=8,Ym(this,this.o),aj(this,"timeout"),Lm(this,8))};
function Zm(a,b){a.j=!1;a.g&&(a.k=!0,a.g.abort(),a.k=!1);a.o=b;a.A=5;cn(a);dn(a)}function cn(a){a.da||(a.da=!0,aj(a,"complete"),aj(a,"error"))}function Lm(a,b){a.g&&a.j&&(Ym(a,"Aborting"),a.j=!1,a.k=!0,a.g.abort(),a.k=!1,a.A=b||7,aj(a,"complete"),aj(a,"abort"),dn(a))}g.F=function(){this.g&&(this.j&&(this.j=!1,this.k=!0,this.g.abort(),this.k=!1),dn(this,!0));Vm.L.F.call(this)};g.mc=function(){this.H()||(this.pa||this.D||this.k?en(this):this.qe())};g.qe=function(){en(this)};
function en(a){if(a.j&&"undefined"!=typeof aa)if(a.W[1]&&4==Am(a)&&2==a.getStatus())Ym(a,"Local request error detected and ignored");else if(a.D&&4==Am(a))ej(a.mc,0,a);else if(aj(a,"readystatechange"),4==Am(a)){Ym(a,"Request complete");a.j=!1;try{var b=a.getStatus(),c;t:switch(b){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:c=!0;break t;default:c=!1}var d;if(!(d=c)){var e;if(e=0===b){var f=Yc(String(a.J))[1]||null;if(!f&&self.location)var h=self.location.protocol,f=h.substr(0,h.length-
1);e=!Wm.test(f?f.toLowerCase():"")}d=e}if(d)aj(a,"complete"),aj(a,"success");else{a.A=6;var k;try{k=2<Am(a)?a.g.statusText:""}catch(m){k=""}a.o=k+" ["+a.getStatus()+"]";cn(a)}}finally{dn(a)}}}function dn(a,b){if(a.g){an(a);var c=a.g,d=a.W[0]?s:null;a.g=null;a.W=null;b||aj(a,"ready");try{c.onreadystatechange=d}catch(e){}}}function an(a){a.g&&a.S&&(a.g.ontimeout=null);fa(a.M)&&(l.clearTimeout(a.M),a.M=null)}g.isActive=function(){return!!this.g};function Am(a){return a.g?a.g.readyState:0}
g.getStatus=function(){try{return 2<Am(this)?this.g.status:-1}catch(a){return-1}};function Bm(a){try{return a.g?a.g.responseText:""}catch(b){return""}}function Ym(a,b){return b+" ["+a.xa+" "+a.J+" "+a.getStatus()+"]"};function fn(a,b,c){this.K=a||null;this.g=1;this.j=[];this.A=[];this.o=new im(null,!0);this.D=b||null;this.Z=null!=c?c:null}function gn(a,b){this.g=a;this.map=b;this.context=null}g=fn.prototype;g.rb=null;g.$=null;g.P=null;g.Qb=null;g.ub=null;g.qc=null;g.yb=null;g.hb=0;g.Nd=0;g.U=null;g.Fa=null;g.ua=null;g.Ma=null;g.Aa=null;g.xb=null;g.Ua=-1;g.xc=-1;g.ia=-1;g.gb=0;g.Ya=0;g.Ja=8;var hn=new $i;function jn(a){zi.call(this,"statevent",a)}x(jn,zi);
function kn(a,b){zi.call(this,"timingevent",a);this.size=b}x(kn,zi);function ln(a){zi.call(this,"serverreachability",a)}x(ln,zi);g=fn.prototype;g.connect=function(a,b,c,d,e){Y();this.Qb=b;this.rb=c||{};d&&n(e)&&(this.rb.OSID=d,this.rb.OAID=e);this.Aa=new Pm(this);this.Aa.Tb=null;this.Aa.j=this.o;this.Aa.connect(a)};
g.disconnect=function(){mn(this);if(3==this.g){var a=this.hb++,b=this.ub.clone();P(b,"SID",this.k);P(b,"RID",a);P(b,"TYPE","terminate");nn(this,b);a=new tm(this,0,this.k,a,void 0);a.$a=2;a.ya=Pf(b.clone());(new Image).src=a.ya;a.jb=w();zm(a)}on(this)};function mn(a){if(a.Aa){var b=a.Aa;b.ea&&(b.ea.cancel(),b.ea=null);b.va=-1;a.Aa=null}a.P&&(a.P.cancel(),a.P=null);a.ua&&(l.clearTimeout(a.ua),a.ua=null);pn(a);a.$&&(a.$.cancel(),a.$=null);a.Fa&&(l.clearTimeout(a.Fa),a.Fa=null)}
function qn(a,b){if(0==a.g)throw Error("Invalid operation: sending map when state is closed");a.j.push(new gn(a.Nd++,b));2!=a.g&&3!=a.g||rn(a)}g.Hc=function(){return 0==this.g};g.getState=function(){return this.g};function sn(a){var b=0;a.P&&b++;a.$&&b++;return b}function rn(a){a.$||a.Fa||(a.Fa=Jm(v(a.Bc,a),0),a.gb=0)}g.Bc=function(a){this.Fa=null;tn(this,a)};
function tn(a,b){if(1==a.g){if(!b){a.hb=Math.floor(1E5*Math.random());var c=a.hb++,d=new tm(a,0,"",c,void 0);d.Ha=null;var e=un(a),f=a.ub.clone();P(f,"RID",c);a.K&&P(f,"CVER",a.K);nn(a,f);wm(d,f,e);a.$=d;a.g=2}}else 3==a.g&&(b?vn(a,b):0!=a.j.length&&(a.$||vn(a)))}
function vn(a,b){var c,d;b?6<a.Ja?(a.j=a.A.concat(a.j),a.A.length=0,c=a.hb-1,d=un(a)):(c=b.D,d=b.Ia):(c=a.hb++,d=un(a));var e=a.ub.clone();P(e,"SID",a.k);P(e,"RID",c);P(e,"AID",a.Ua);nn(a,e);c=new tm(a,0,a.k,c,a.gb+1);c.Ha=null;c.setTimeout(Math.round(1E4)+Math.round(1E4*Math.random()));a.$=c;wm(c,e,d)}function nn(a,b){if(a.U){var c=a.U.Yc(a);c&&Wa(c,function(a,c){P(b,c,a)})}}
function un(a){var b=Math.min(a.j.length,1E3),c=["count="+b],d;6<a.Ja&&0<b?(d=a.j[0].g,c.push("ofs="+d)):d=0;for(var e=0;e<b;e++){var f=a.j[e].g,h=a.j[e].map,f=6>=a.Ja?e:f-d;try{xd(h,function(a,b){c.push("req"+f+"_"+b+"="+encodeURIComponent(a))})}catch(k){c.push("req"+f+"_type="+encodeURIComponent("_badmap"))}}a.A=a.A.concat(a.j.splice(0,b));return c.join("&")}function wn(a){a.P||a.ua||(a.B=1,a.ua=Jm(v(a.Sc,a),0),a.Ya=0)}
function xn(a){if(a.P||a.ua||3<=a.Ya)return!1;a.B++;a.ua=Jm(v(a.Sc,a),yn(a,a.Ya));a.Ya++;return!0}g.Sc=function(){this.ua=null;this.P=new tm(this,0,this.k,"rpc",this.B);this.P.Ha=null;this.P.Vb=0;var a=this.qc.clone();P(a,"RID","rpc");P(a,"SID",this.k);P(a,"CI",this.xb?"0":"1");P(a,"AID",this.Ua);nn(this,a);if(!N||nc(10))P(a,"TYPE","xmlhttp"),ym(this.P,a,!0,this.yb,!1);else{P(a,"TYPE","html");var b=this.P,c=Boolean(this.yb);b.$a=3;b.ya=Pf(a.clone());Im(b,c)}};
function Um(a,b,c){a.xb=c;a.ia=b.va;a.ve(1,0);a.ub=Qm(a,null,a.Qb);rn(a)}
g.Jc=function(a,b){if(0!=this.g&&(this.P==a||this.$==a))if(this.ia=a.fb,this.$==a&&3==this.g)if(7<this.Ja){var c;try{c=this.o.parse(b)}catch(d){c=null}if(t(c)&&3==c.length)if(0==c[0])t:{if(!this.ua){if(this.P)if(this.P.jb+3E3<this.$.jb)pn(this),this.P.cancel(),this.P=null;else break t;xn(this);Y()}}else this.xc=c[1],0<this.xc-this.Ua&&37500>c[2]&&this.xb&&0==this.Ya&&!this.Ma&&(this.Ma=Jm(v(this.xd,this),6E3));else Tm(this,11)}else"y2f%"!=b&&Tm(this,11);else if(this.P==a&&pn(this),!/^[\s\xa0]*$/.test(b)){c=
this.o.parse(b);t(c);for(var e=0;e<c.length;e++){var f=c[e];this.Ua=f[0];f=f[1];2==this.g?"c"==f[0]?(this.k=f[1],this.yb=f[2],f=f[3],null!=f?this.Ja=f:this.Ja=6,this.g=3,this.U&&this.U.wc(this),this.qc=Qm(this,this.ib()?this.yb:null,this.Qb),wn(this)):"stop"==f[0]&&Tm(this,7):3==this.g&&("stop"==f[0]?Tm(this,7):"noop"!=f[0]&&this.U&&this.U.vc(this,f),this.Ya=0)}}};g.xd=function(){null!=this.Ma&&(this.Ma=null,this.P.cancel(),this.P=null,xn(this),Y())};
function pn(a){null!=a.Ma&&(l.clearTimeout(a.Ma),a.Ma=null)}
g.Ab=function(a){var b;if(this.P==a)pn(this),this.P=null,b=2;else if(this.$==a)this.$=null,b=1;else return;this.ia=a.fb;if(0!=this.g)if(a.ka)1==b?(w(),aj(hn,new kn(hn,a.Ia?a.Ia.length:0)),rn(this),this.A.length=0):wn(this);else{var c=a.Ka,d;if(!(d=3==c||7==c||0==c&&0<this.ia)){if(d=1==b)this.$||this.Fa||1==this.g||2<=this.gb?d=!1:(this.Fa=Jm(v(this.Bc,this,a),yn(this,this.gb)),this.gb++,d=!0);d=!(d||2==b&&xn(this))}if(d)switch(c){case 1:Tm(this,5);break;case 4:Tm(this,10);break;case 3:Tm(this,6);
break;case 7:Tm(this,12);break;default:Tm(this,2)}}};function yn(a,b){var c=5E3+Math.floor(1E4*Math.random());a.isActive()||(c*=2);return c*b}g.ve=function(a){if(!Ha(arguments,this.g))throw Error("Unexpected channel state: "+this.g);};function Tm(a,b){if(2==b||9==b){var c=null;a.U&&(c=null);var d=v(a.Ge,a);c||(c=new zf("//www.google.com/images/cleardot.gif"),Pf(c));Nm(c.toString(),1E4,d)}else Y();zn(a,b)}g.Ge=function(a){a?Y():(Y(),zn(this,8))};
function zn(a,b){a.g=0;a.U&&a.U.Gc(a,b);on(a);mn(a)}function on(a){a.g=0;a.ia=-1;if(a.U)if(0==a.A.length&&0==a.j.length)a.U.Xb(a);else{var b=Pa(a.A),c=Pa(a.j);a.A.length=0;a.j.length=0;a.U.Xb(a,b,c)}}function Qm(a,b,c){var d=Qf(c);if(""!=d.wa)b&&Bf(d,b+"."+d.wa),Cf(d,d.Oa);else var e=window.location,d=Rf(e.protocol,b?b+"."+e.hostname:e.hostname,e.port,c);a.rb&&Wa(a.rb,function(a,b){P(d,b,a)});P(d,"VER",a.Ja);nn(a,d);return d}
g.cc=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new Vm;a.eb=!1;return a};g.isActive=function(){return!!this.U&&this.U.isActive(this)};function Jm(a,b){if(!ga(a))throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},b)}g.ja=function(){aj(hn,new ln(hn))};function Y(){aj(hn,new jn(hn))}g.ib=function(){return!(!N||nc(10))};function An(){}g=An.prototype;g.wc=function(){};g.vc=function(){};g.Gc=function(){};g.Xb=function(){};
g.Yc=function(){return{}};g.isActive=function(){return!0};function Bn(a,b){cj.call(this);if(ga(a))b&&(a=v(a,b));else if(a&&ga(a.handleEvent))a=v(a.handleEvent,a);else throw Error("Invalid listener argument");this.D=a;Pi(this,"tick",v(this.B,this));this.stop();dj(this,5E3+2E4*Math.random())}x(Bn,cj);Bn.prototype.o=0;Bn.prototype.B=function(){if(500<this.g){var a=this.g;24E4>2*a&&(a*=2);dj(this,a)}this.D()};Bn.prototype.start=function(){Bn.L.start.call(this);this.o=w()+this.g};Bn.prototype.stop=function(){this.o=0;Bn.L.stop.call(this)};function Cn(a,b){this.M=a;this.A=b;this.k=new F;this.j=new Bn(this.nd,this);this.g=null;this.J=!1;this.B=null;this.Z="";this.D=this.o=0;this.K=[]}x(Cn,An);g=Cn.prototype;g.subscribe=function(a,b,c){return this.k.subscribe(a,b,c)};g.unsubscribe=function(a,b,c){return this.k.unsubscribe(a,b,c)};g.ma=function(a){return this.k.ma(a)};g.publish=function(a,b){return this.k.publish.apply(this.k,arguments)};g.dispose=function(){this.J||(this.J=!0,this.k.clear(),this.disconnect(),E(this.k))};g.H=function(){return this.J};
function Dn(a){return{firstTestResults:[""],secondTestResults:!a.g.xb,sessionId:a.g.k,arrayId:a.g.Ua}}
g.connect=function(a,b,c){if(!this.g||2!=this.g.getState()){this.Z="";this.j.stop();this.B=a||null;this.o=b||0;a=this.M+"/test";b=this.M+"/bind";var d=new fn("1",c?c.firstTestResults:null,c?c.secondTestResults:null),e=this.g;e&&(e.U=null);d.U=this;this.g=d;e?(3!=e.getState()&&0==sn(e)||e.getState(),this.g.connect(a,b,this.A,e.k,e.Ua)):c?this.g.connect(a,b,this.A,c.sessionId,c.arrayId):this.g.connect(a,b,this.A)}};
g.disconnect=function(a){this.D=a||0;this.j.stop();this.g&&(3==this.g.getState()&&tn(this.g),this.g.disconnect());this.D=0};g.sendMessage=function(a,b){var c={_sc:a};b&&hb(c,b);this.j.enabled||2==(this.g?this.g.getState():0)?this.K.push(c):this.g&&3==this.g.getState()&&qn(this.g,c)};g.wc=function(){var a=this.j;a.stop();dj(a,5E3+2E4*Math.random());this.B=null;this.o=0;if(this.K.length){a=this.K;this.K=[];for(var b=0,c=a.length;b<c;++b)qn(this.g,a[b])}this.publish("handlerOpened")};
g.Gc=function(a,b){var c=2==b&&401==this.g.ia;if(4!=b&&!c){if(6==b||410==this.g.ia)c=this.j,c.stop(),dj(c,500);this.j.start()}this.publish("handlerError",b)};g.Xb=function(a,b,c){if(!this.j.enabled)this.publish("handlerClosed");else if(c)for(a=0,b=c.length;a<b;++a)this.K.push(c[a].map)};g.Yc=function(){var a={v:2};this.Z&&(a.gsessionid=this.Z);0!=this.o&&(a.ui=""+this.o);0!=this.D&&(a.ui=""+this.D);this.B&&hb(a,this.B);return a};
g.vc=function(a,b){if("S"==b[0])this.Z=b[1];else if("gracefulReconnect"==b[0]){var c=this.j;c.stop();dj(c,500);this.j.start();this.g.disconnect()}else this.publish("handlerMessage",new gm(b[0],b[1]))};function En(a,b){(a.A.loungeIdToken=b)||a.j.stop()}g.getDeviceId=function(){return this.A.id};g.nd=function(){this.j.stop();0!=sn(this.g)?this.j.start():this.connect(this.B,this.o)};function Fn(a){Gn(this,a)}function Hn(a,b){if(a.j)throw Error(b+" is not allowed in V3.");}function In(a){a.K=-1;a.B=!1;a.A=null;a.g=-1;a.k=null;a.o=0;a.D=w()}function Gn(a,b){a.videoIds=[];a.j="";a.index=-1;a.videoId="";In(a);b&&(a.videoIds=b.videoIds,a.index=b.index,a.j=b.listId,a.videoId=b.videoId,a.g=b.playerState,a.k=b.errorReason,a.K=b.volume,a.B=b.muted,a.A=b.trackData,a.o=b.playerTime,a.D=b.playerTimeAt)}function Jn(a){return a.j?a.videoId:a.videoIds[a.index]}
function Kn(a){switch(a.g){case 1:return(w()-a.D)/1E3+a.o;case -1E3:return 0}return a.o}Fn.prototype.setVideoId=function(a){Hn(this,"setVideoId");var b=this.index;this.index=Ba(this.videoIds,a);b!=this.index&&In(this);return-1!=b};function Ln(a,b,c){Hn(a,"setPlaylist");c=c||Jn(a);Ta(a.videoIds,b)&&c==Jn(a)||(a.videoIds=Pa(b),a.setVideoId(c))}Fn.prototype.add=function(a){Hn(this,"add");return a&&!Ha(this.videoIds,a)?(this.videoIds.push(a),!0):!1};
Fn.prototype.remove=function(a){Hn(this,"remove");var b=Jn(this);return Ma(this.videoIds,a)?(this.index=Ba(this.videoIds,b),!0):!1};function Mn(a){var b={};b.videoIds=Pa(a.videoIds);b.index=a.index;b.listId=a.j;b.videoId=a.videoId;b.playerState=a.g;b.errorReason=a.k;b.volume=a.K;b.muted=a.B;b.trackData=eb(a.A);b.playerTime=a.o;b.playerTimeAt=a.D;return b}Fn.prototype.clone=function(){return new Fn(Mn(this))};function Z(a,b,c){T.call(this);this.ra=a;this.M=[];this.M.push(O(window,"beforeunload",v(this.Cd,this)));this.j=[];this.C=new Fn;3==c["mdx-version"]&&(this.C.j="RQ"+b.token);this.S=b.id;this.g=Nn(this,c);this.g.subscribe("handlerOpened",this.Hd,this);this.g.subscribe("handlerClosed",this.Dd,this);this.g.subscribe("handlerError",this.Ed,this);this.C.j?this.g.subscribe("handlerMessage",this.Fd,this):this.g.subscribe("handlerMessage",this.Gd,this);En(this.g,b.token);this.subscribe("remoteQueueChange",
function(){var a=this.C.videoId;pk()&&R("yt-remote-session-video-id",a)},this)}x(Z,T);g=Z.prototype;g.pb=NaN;g.dc=!1;g.wb=NaN;g.ic=NaN;g.tb=NaN;
g.connect=function(a,b){if(b){if(this.C.j){var c=b.listId,d=b.videoId,e=b.index,f=b.currentTime||0;5>=f&&(f=0);h={videoId:d,currentTime:f};c&&(h.listId=c);n(e)&&(h.currentIndex=e);c&&(this.C.j=c);this.C.videoId=d;this.C.index=e||0}else{var d=b.videoIds[b.index],f=b.currentTime||0;5>=f&&(f=0);var h={videoIds:d,videoId:d,currentTime:f};this.C.videoIds=[d];this.C.index=0}this.C.state=3;c=this.C;c.o=f;c.D=w();this.I("Connecting with setPlaylist and params: "+Q(h));this.g.connect({method:"setPlaylist",
params:Q(h)},a,tk())}else this.I("Connecting without params"),this.g.connect({},a,tk());On(this)};g.dispose=function(){this.H()||(this.publish("beforeDispose"),Pn(this,3));Z.L.dispose.call(this)};g.F=function(){Qn(this);Rn(this);Sn(this);I(this.tb);this.tb=NaN;this.o=null;Mc(this.M);this.M.length=0;this.g.dispose();Z.L.F.call(this);this.j=this.C=this.g=null};g.I=function(a){Aj("conn",a)};g.Cd=function(){this.B(2)};function Nn(a,b){return new Cn(Uj(a.ra,"/bc",void 0,!1),b)}
function Pn(a,b){a.publish("proxyStateChange",b)}function On(a){a.pb=H(v(function(){this.I("Connecting timeout");this.B(1)},a),2E4)}function Qn(a){I(a.pb);a.pb=NaN}function Sn(a){I(a.wb);a.wb=NaN}function Tn(a){Rn(a);a.ic=H(v(function(){this.k("getNowPlaying")},a),2E4)}function Rn(a){I(a.ic);a.ic=NaN}function Un(a){var b=a.g;return!!b.g&&3==b.g.getState()&&isNaN(a.pb)}
g.Hd=function(){this.I("Channel opened");this.dc&&(this.dc=!1,Sn(this),this.wb=H(v(function(){this.I("Timing out waiting for a screen.");this.B(1)},this),15E3));Dk(Dn(this.g),this.S)};g.Dd=function(){this.I("Channel closed");isNaN(this.pb)?Ek(!0):Ek();this.dispose()};g.Ed=function(a){Ek();isNaN(this.D())?(this.I("Channel error: "+a+" without reconnection"),this.dispose()):(this.dc=!0,this.I("Channel error: "+a+" with reconnection in "+this.D()+" ms"),Pn(this,2))};
function Vn(a,b){b&&(Qn(a),Sn(a));b==Un(a)?b&&(Pn(a,1),a.k("getSubtitlesTrack")):b?(a.J()&&Gn(a.C),Pn(a,1),a.k("getNowPlaying")):a.B(1)}function Wn(a,b){var c=b.params.videoId;delete b.params.videoId;c==a.C.videoId&&(cb(b.params)?a.C.A=null:a.C.A=b.params,a.publish("remotePlayerChange"))}function Xn(a,b){var c=b.params.videoId||b.params.video_id,d=parseInt(b.params.currentIndex,10);a.C.j=b.params.listId;var e=a.C,f=e.videoId;e.videoId=c;e.index=d;c!=f&&In(e);a.publish("remoteQueueChange")}
function Yn(a,b){b.params=b.params||{};Xn(a,b);Zn(a,b)}function Zn(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10),d=a.C;d.o=isNaN(c)?0:c;d.D=w();c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.C.g&&(c=-1E3);a.C.g=c;d=null;-1E3==c&&(d=a.C.k||"unknown",n(b.params.currentError)&&(d=ug(b.params.currentError).reason||d));a.C.k=d;1==a.C.g?Tn(a):Rn(a);a.publish("remotePlayerChange")}
function $n(a,b){var c="true"==b.params.muted;a.C.K=parseInt(b.params.volume,10);a.C.B=c;a.publish("remotePlayerChange")}
g.Fd=function(a){a.params?this.I("Received: action="+a.action+", params="+Q(a.params)):this.I("Received: action="+a.action+" {}");switch(a.action){case "loungeStatus":a=ug(a.params.devices);this.j=B(a,function(a){return new kk(a)});a=!!Fa(this.j,function(a){return"LOUNGE_SCREEN"==a.type});Vn(this,a);break;case "loungeScreenConnected":Vn(this,!0);break;case "loungeScreenDisconnected":Na(this.j,function(a){return"LOUNGE_SCREEN"==a.type});Vn(this,!1);break;case "remoteConnected":var b=new kk(ug(a.params.device));
Fa(this.j,function(a){return a.equals(b)})||La(this.j,b);break;case "remoteDisconnected":b=new kk(ug(a.params.device));Na(this.j,function(a){return a.equals(b)});break;case "gracefulDisconnect":break;case "playlistModified":Xn(this,a);break;case "nowPlaying":Yn(this,a);break;case "onStateChange":Zn(this,a);break;case "onVolumeChanged":$n(this,a);break;case "onSubtitlesTrackChanged":Wn(this,a);break;default:this.I("Unrecognized action: "+a.action)}};
g.Gd=function(a){a.params?this.I("Received: action="+a.action+", params="+Q(a.params)):this.I("Received: action="+a.action);ao(this,a);bo(this,a);if(Un(this)){var b=this.C.clone(),c=!1,d,e,f,h,k,m,q;a.params&&(d=a.params.videoId||a.params.video_id,e=a.params.videoIds||a.params.video_ids,f=a.params.state,h=a.params.currentTime||a.params.current_time,k=a.params.volume,m=a.params.muted,n(a.params.currentError)&&(q=ug(a.params.currentError)));if("onSubtitlesTrackChanged"==a.action)d==Jn(this.C)&&(delete a.params.videoId,
cb(a.params)?this.C.A=null:this.C.A=a.params,this.publish("remotePlayerChange"));else if(Jn(this.C)||"onStateChange"!=a.action)"playlistModified"!=a.action&&"nowPlayingPlaylist"!=a.action||e?(d||"nowPlaying"!=a.action&&"nowPlayingPlaylist"!=a.action?d||(d=Jn(this.C)):this.C.setVideoId(""),e&&(e=e.split(","),Ln(this.C,e,d))):Ln(this.C,[]),this.C.add(d)&&this.k("getPlaylist"),d&&this.C.setVideoId(d),b.index==this.C.index&&Ta(b.videoIds,this.C.videoIds)||this.publish("remoteQueueChange"),n(f)&&(b=parseInt(f,
10),b=isNaN(b)?-1:b,-1==b&&-1E3==this.C.g&&(b=-1E3),0==b&&"0"==h&&(b=-1),c=c||b!=this.C.g,this.C.g=b,d=null,-1E3==b&&(d=this.C.k||"unknown",q&&(d=q.reason||d)),c=c||this.C.k!=d,this.C.k=d,1==this.C.g?Tn(this):Rn(this)),"onError"!=a.action||-1!=this.C.g&&-1E3!=this.C.g||(a=ug(a.params.errors)||[],1==a.length&&"PLAYER_ERROR"==a[0].error&&a[0].videoId==Jn(this.C)&&(this.C.g=-1E3,this.C.k=a[0].reason||"unknown",c=!0)),h&&(b=parseInt(h,10),c=this.C,c.o=isNaN(b)?0:b,c.D=w(),c=!0),n(k)&&(b=parseInt(k,10),
isNaN(b)||(c=c||this.C.K!=b,this.C.K=b),n(m)&&(m="true"==m,c=c||this.C.B!=m,this.C.B=m)),c&&this.publish("remotePlayerChange")}};
function ao(a,b){switch(b.action){case "loungeStatus":var c=ug(b.params.devices);a.j=B(c,function(a){return new kk(a)});break;case "loungeScreenDisconnected":Na(a.j,function(a){return"LOUNGE_SCREEN"==a.type});break;case "remoteConnected":var d=new kk(ug(b.params.device));Fa(a.j,function(a){return a.equals(d)})||La(a.j,d);break;case "remoteDisconnected":d=new kk(ug(b.params.device)),Na(a.j,function(a){return a.equals(d)})}}
function bo(a,b){var c=!1;if("loungeStatus"==b.action)c=!!Fa(a.j,function(a){return"LOUNGE_SCREEN"==a.type});else if("loungeScreenConnected"==b.action)c=!0;else if("loungeScreenDisconnected"==b.action)c=!1;else return;if(!isNaN(a.wb))if(c)Sn(a);else return;c==Un(a)?c&&Pn(a,1):c?(Qn(a),a.J()&&Gn(a.C),Pn(a,1),a.k("getNowPlaying")):a.B(1)}g.pd=function(){if(this.o){var a=this.o;this.o=null;this.C.videoId!=a&&this.k("getNowPlaying")}};Z.prototype.subscribe=Z.prototype.subscribe;
Z.prototype.unsubscribeByKey=Z.prototype.ma;Z.prototype.da=function(){var a=3;this.H()||(a=0,isNaN(this.D())?Un(this)&&(a=1):a=2);return a};Z.prototype.getProxyState=Z.prototype.da;Z.prototype.B=function(a){this.I("Disconnecting with "+a);Qn(this);this.publish("beforeDisconnect",a);1==a&&Ek();this.g.disconnect(a);this.dispose()};Z.prototype.disconnect=Z.prototype.B;Z.prototype.Y=function(){var a=this.C;if(this.o){var b=a=this.C.clone(),c=this.o,d=a.index,e=b.videoId;b.videoId=c;b.index=d;c!=e&&In(b)}return Mn(a)};
Z.prototype.getPlayerContextData=Z.prototype.Y;Z.prototype.pa=function(a){var b=new Fn(a);b.videoId&&b.videoId!=this.C.videoId&&(this.o=b.videoId,I(this.tb),this.tb=H(v(this.pd,this),5E3));var c=[];this.C.j==b.j&&this.C.videoId==b.videoId&&this.C.index==b.index&&Ta(this.C.videoIds,b.videoIds)||c.push("remoteQueueChange");this.C.g==b.g&&this.C.K==b.K&&this.C.B==b.B&&Kn(this.C)==Kn(b)&&Q(this.C.A)==Q(b.A)||c.push("remotePlayerChange");Gn(this.C,a);A(c,function(a){this.publish(a)},this)};
Z.prototype.setPlayerContextData=Z.prototype.pa;Z.prototype.W=function(){return this.g.A.loungeIdToken};Z.prototype.getLoungeToken=Z.prototype.W;Z.prototype.J=function(){var a=this.g.getDeviceId(),b=Fa(this.j,function(b){return"REMOTE_CONTROL"==b.type&&b.id!=a});return b?b.id:""};Z.prototype.getOtherConnectedRemoteId=Z.prototype.J;Z.prototype.D=function(){var a=this.g;return a.j.enabled?a.j.o-w():NaN};Z.prototype.getReconnectTimeout=Z.prototype.D;
Z.prototype.xa=function(){if(!isNaN(this.D())){var a=this.g.j;a.enabled&&(a.stop(),a.start(),a.B())}};Z.prototype.reconnect=Z.prototype.xa;Z.prototype.k=function(a,b){b?this.I("Sending: action="+a+", params="+Q(b)):this.I("Sending: action="+a);this.g.sendMessage(a,b)};Z.prototype.sendMessage=Z.prototype.k;function co(a){T.call(this);this.k=a;this.la=eo();this.I("Initializing local screens: "+Lj(this.la));this.za=fo();this.I("Initializing account screens: "+Lj(this.za));this.Rb=null;this.g=[];this.j=[];go(this,bm()||[]);this.I("Initializing DIAL devices: "+Xj(this.j));a=Jj(Ak());ho(this,a);this.I("Initializing online screens: "+Lj(this.g));this.o=w()+3E5;io(this)}x(co,T);var jo=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g=co.prototype;g.qb=NaN;g.Lb="";g.I=function(a){Aj("RM",a)};
g.O=function(a){Aj("RM",a)};function fo(){var a=eo(),b=Jj(Ak());return Ca(b,function(b){return!fk(a,b)})}function eo(){var a=Jj(vk());return Ca(a,function(a){return!a.uuid})}function io(a){J("yt-remote-cast-device-list-update",function(){var a=bm();go(this,a||[])},a);J("yt-remote-cast-device-status-update",a.re,a);a.Mb();var b=w()>a.o?2E4:1E4;ub(v(a.Mb,a),b)}g.publish=function(a,b){if(this.H())return!1;this.I("Firing "+a);return this.A.publish.apply(this.A,arguments)};
g.Mb=function(){var a=bm()||[];Ia(a)||go(this,a);a=ko(this);Ia(a)||(Da(a,function(a){return!fk(this.za,a)},this)&&yk()?lo(this):mo(this,a))};function no(a){ho(a,a.g,!0);go(a,bm()||[]);a.publish("managedScreenChange",ko(a))}function oo(a,b){var c=ko(a);return Ca(b,function(a){return a.uuid?(a=ek(this.j,a.uuid),!!a&&"RUNNING"==a.status):!!fk(c,a)},a)}
function go(a,b){var c=!1;A(b,function(a){var b=V(this.la,a.id);b&&b.name!=a.name&&(this.I("Renaming screen id "+b.id+" from "+b.name+" to "+a.name),b.name=a.name,c=!0)},a);c&&(a.I("Renaming due to DIAL."),po(a));Bk(bk(b));var d=!Ta(a.j,b,dk);d&&a.I("Updating DIAL devices: "+Xj(a.j)+" to "+Xj(b));a.j=b;ho(a,a.g);d&&a.publish("onlineReceiverChange")}
g.re=function(a){var b=ek(this.j,a.id);b&&(this.I("Updating DIAL device: "+b.id+"("+b.name+") from status: "+b.status+" to status: "+a.status+" and from activityId: "+b.activityId+" to activityId: "+a.activityId),b.activityId=a.activityId,b.status=a.status,Bk(bk(this.j)));ho(this,this.g)};function ho(a,b,c){var d=oo(a,b),e=!Ta(a.g,d,Gj);if(e||c)Ia(b)||zk(B(d,Hj));e&&(a.I("Updating online screens: "+Lj(a.g)+" -> "+Lj(d)),a.g=d,a.publish("onlineReceiverChange"))}
function mo(a,b){var c=[],d={};A(b,function(a){a.token&&(d[a.token]=a,c.push(a.token))});var e={method:"POST",T:{lounge_token:c.join(",")},context:a,aa:function(a,b){var c=[];A(b.screens||[],function(a){"online"==a.status&&c.push(d[a.loungeToken])});var e=this.Rb?qo(this,this.Rb):null;e&&!fk(c,e)&&c.push(e);ho(this,c,!0)}};Yh(Uj(a.k,"/pairing/get_screen_availability"),e)}
function lo(a){var b=ko(a),c=B(b,function(a){return a.id});Ia(c)||(a.I("Updating lounge tokens for: "+Q(c)),Yh(Uj(a.k,"/pairing/get_lounge_token_batch"),{T:{screen_ids:c.join(",")},method:"POST",context:a,aa:function(a,c){ro(this,c.screens||[]);this.la=Ca(this.la,function(a){return!!a.token});po(this);mo(this,b)}}))}function ro(a,b){A(Oa(a.la,a.za),function(a){var d=Fa(b,function(b){return a.id==b.screenId});d&&(a.token=d.loungeToken)})}
function po(a){var b=eo();Ta(a.la,b,Gj)||(a.I("Saving local screens: "+Lj(b)+" to "+Lj(a.la)),uk(B(a.la,Hj)),no(a))}function so(a,b,c){var d=Ga(b,function(a){return Fj(c,a)}),e=0>d;0>d?b.push(c):b[d]=c;fk(a.g,c)||a.g.push(c);return e}g.Rc=function(a,b){for(var c=ko(this),c=B(c,function(a){return a.name}),d=a,e=2;Ha(c,d);)d=b.call(l,e),e++;return d};
g.Lc=function(a,b,c){var d=!1;b>=jo.length&&(this.I("Pairing DIAL device "+a+" with "+c+" timed out."),d=!0);var e=ek(this.j,a);if(!e)this.I("Pairing DIAL device "+a+" with "+c+" failed: no device for "+a),d=!0;else if("ERROR"==e.status||"STOPPED"==e.status)this.I("Pairing DIAL device "+a+" with "+c+" failed: launch error on "+a),d=!0;d?(to(this),this.publish("screenPair",null)):Yh(Uj(this.k,"/pairing/get_screen"),{method:"POST",T:{pairing_code:c},context:this,aa:function(a,b){if(c==this.Lb){to(this);
var d=new Dj(b.screen);d.name=e.name;d.uuid=e.id;this.I("Pairing "+c+" succeeded.");var m=so(this,this.la,d);this.I("Paired with "+(m?"a new":"an old")+" local screen:"+Kj(d));po(this);this.publish("screenPair",d)}},onError:function(){c==this.Lb&&(this.I("Polling pairing code: "+c),I(this.qb),this.qb=H(v(this.Lc,this,a,b+1,c),jo[b]))}})};
function uo(a,b,c){var d=$,e="";to(d);if(ek(d.j,a)){if(!e){var f=e=Yj();Vl();var h=dm(a),k=Sl();if(k&&h){var m=new cast.Receiver(h.id,h.name),m=new cast.LaunchRequest("YouTube",m);m.parameters="pairingCode="+f;m.description=new cast.LaunchDescription;m.description.text=document.title;b&&(m.parameters+="&v="+b,c&&(m.parameters+="&t="+Math.round(c)),m.description.url="http://i.ytimg.com/vi/"+b+"/default.jpg");"UNKNOWN"!=h.status&&(h.status="UNKNOWN",$l(h),K("yt-remote-cast-device-status-update",h));
Ql("Sending a cast launch request with params: "+m.parameters);k.launch(m,na(em,a))}else Ql("No cast API or no cast device. Dropping cast launch.")}d.Lb=e;d.qb=H(v(d.Lc,d,a,0,e),jo[0])}else d.I("No DIAL device with id: "+a)}function to(a){I(a.qb);a.qb=NaN;a.Lb=""}function qo(a,b){var c=V(ko(a),b);a.I("Found screen: "+Kj(c)+" with key: "+b);return c}function vo(a){var b=$,c=V(b.g,a);b.I("Found online screen: "+Kj(c)+" with key: "+a);return c}
function wo(a){var b=$,c=ek(b.j,a);if(!c){var d=V(b.la,a);d&&(c=ek(b.j,d.uuid))}b.I("Found DIAL: "+(c?c.toString():"null")+" with key: "+a);return c}function ko(a){return Oa(a.za,Ca(a.la,function(a){return!fk(this.za,a)},a))}
g.ke=function(){var a=Uj(this.k,"/screens");Yh(a,{method:"GET",context:this,withCredentials:!0,aa:function(a,c){this.za=B(Za(c),function(a){return new Dj(a)});this.I("Load account screens successfully.");this.Mb();no(this);this.publish("accountScreenLoad")},onError:function(){this.O("Load account screens failed.");xo(this)}})};function xo(a){Ia(a.za)&&Ia(fo())||(a.I("Clear cached account screens."),a.za=[],a.Mb(),no(a))};function yo(a){gk.call(this,"ScreenServiceProxy");this.X=a;this.g=[];this.g.push(this.X.$_s("screenChange",v(this.$d,this)));this.g.push(this.X.$_s("onlineScreenChange",v(this.Zd,this)))}x(yo,gk);g=yo.prototype;g.V=function(a){return this.X.$_gs(a)};g.contains=function(a){return!!this.X.$_c(a)};g.get=function(a){return this.X.$_g(a)};g.start=function(a){this.X.$_st(a)};g.add=function(a,b,c){this.X.$_a(a,b,c)};g.remove=function(a,b,c){this.X.$_r(a,b,c)};g.Da=function(a,b,c,d){this.X.$_un(a,b,c,d)};
g.F=function(){for(var a=0,b=this.g.length;a<b;++a)this.X.$_ubk(this.g[a]);this.g.length=0;this.X=null;yo.L.F.call(this)};g.$d=function(){this.publish("screenChange")};g.Zd=function(){this.publish("onlineScreenChange")};W.prototype.$_st=W.prototype.start;W.prototype.$_gspc=W.prototype.Ue;W.prototype.$_c=W.prototype.contains;W.prototype.$_g=W.prototype.get;W.prototype.$_a=W.prototype.add;W.prototype.$_un=W.prototype.Da;W.prototype.$_r=W.prototype.remove;W.prototype.$_gs=W.prototype.V;
W.prototype.$_gos=W.prototype.zc;W.prototype.$_s=W.prototype.subscribe;W.prototype.$_ubk=W.prototype.ma;function zo(a){var b=!!G("MDX_ENABLE_CASTV2"),c=!!G("MDX_ENABLE_QUEUE");b?p("yt.mdx.remote.castv2_",!0,void 0):Vl();Mg&&Lg();mk();Ao||(Ao=new Tj,Fk()&&(Ao.g="/api/loungedev"));$||b||($=new co(Ao),$.subscribe("screenPair",Bo),$.subscribe("managedScreenChange",Co),$.subscribe("onlineReceiverChange",function(){K("yt-remote-receiver-availability-change")}));Do||(Do=r("yt.mdx.remote.deferredProxies_")||[],p("yt.mdx.remote.deferredProxies_",Do,void 0));Eo(c);c=Fo();if(b&&!c){var d=new W(Ao,Go(a));p("yt.mdx.remote.screenService_",
d,void 0);c=Fo();vl(d,function(a){a?Ho()&&Nl(Ho(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){K("yt-remote-receiver-availability-change")})})}if(a&&!r("yt.mdx.remote.initialized_")){p("yt.mdx.remote.initialized_",!0,void 0);Io("Initializing: "+Q(a));Jo.push(J("yt-remote-cast2-availability-change",function(){K("yt-remote-receiver-availability-change")}));Jo.push(J("yt-remote-cast2-receiver-selected",function(){Ko(null);K("yt-remote-auto-connect","cast-selector-receiver")}));Jo.push(J("yt-remote-cast2-session-change",
Lo));Jo.push(J("yt-remote-connection-change",function(a){a?Nl(Ho(),"YouTube TV"):Mo()||(Nl(null,null),Jl())}));var e=No();a.isAuto&&(e.id+="#dial");e.name=a.device;e.app=a.app;Io(" -- with channel params: "+Q(e));Oo(e);b&&c.start(Go(a));Ho()||Po();$&&(a.loadAccountScreens||Ho()?$.ke():xo($))}}function Qo(){Eb(Jo);Jo.length=0;E(Ro);Ro=null;Do&&(A(Do,function(a){a(null)}),Do.length=0,Do=null,p("yt.mdx.remote.deferredProxies_",null,void 0));$&&(E($),$=null);Ao=null;Zl()}
function So(){if(To()&&Hl()){var a=[];if(S("yt-remote-cast-available")||r("yt.mdx.remote.cloudview.castButtonShown_")||Uo())a.push({key:"cast-selector-receiver",name:Vo()}),p("yt.mdx.remote.cloudview.castButtonShown_",!0,void 0);return a}if(r("yt.mdx.remote.cloudview.initializing_"))return[];var b=[],b=Wo()?Fo().X.$_gos():Jj(Ak());(a=Xo())&&Uo()&&(fk(b,a)||b.push(a));Wo()||(a=ck(Ck()),a=Ca(a,function(a){return!V(b,a.id)}),b=Oa(b,a));return ak(b)}
function Yo(){if(To()&&Hl()){var a=Il();return a?{key:"cast-selector-receiver",name:a}:null}var a=So(),b=Zo(),c=Xo();c||(c=Mo());return Fa(a,function(a){return c&&Ej(c,a.key)||b&&(a=wo(a.key))&&a.id==b?!0:!1})}function Vo(){if(To()&&Hl())return Il();var a=Xo();return a?a.name:null}function Xo(){var a=Ho();if(!a)return null;if(!$){var b=Fo().V();return V(b,a)}return qo($,a)}
function Lo(a){Io("remote.onCastSessionChange_: "+Kj(a));if(a){var b=Xo();b&&b.id==a.id?Nl(b.id,"YouTube TV"):(b&&$o(),ap(a,1))}else $o()}function bp(a,b){Io("Connecting to: "+Q(a));if("cast-selector-receiver"==a.key)Ko(b||null),Ml(b||null);else{$o();Ko(b||null);var c=null;$?c=vo(a.key):(c=Fo().V(),c=V(c,a.key));if(c)ap(c,1);else{if($&&(c=wo(a.key))){cp(c);return}H(function(){dp(null)},0)}}}
function $o(){$&&to($);t:{var a=Uo();if(a&&(a=a.getOtherConnectedRemoteId())){Io("Do not stop DIAL due to "+a);ep("");break t}(a=Zo())?(Io("Stopping DIAL: "+a),fm(a),ep("")):(a=Xo())&&a.uuid&&(Io("Stopping DIAL: "+a.uuid),fm(a.uuid))}Ll()?Dl().stopSession():Al("stopSession called before API ready.");(a=Uo())?a.disconnect(1):(Fb("yt-remote-before-disconnect",1),Fb("yt-remote-connection-change",!1));dp(null)}function Io(a){Aj("remote",a)}function To(){return!!r("yt.mdx.remote.castv2_")}
function Wo(){return r("yt.mdx.remote.screenService_")}function Fo(){if(!Ro){var a=Wo();a&&(Ro=new yo(a))}return Ro}function Go(a){var b=!!S("yt-remote-load-account-screens");if(a){var c=!!a.isSignedIn;c?(b|=!!a.loadAccountScreens,xk(b)):xk(!1);return c&&b}return b}function Ho(){return r("yt.mdx.remote.currentScreenId_")}function fp(a){p("yt.mdx.remote.currentScreenId_",a,void 0);if($){var b=$;b.o=w()+3E5;if((b.Rb=a)&&(a=qo(b,a))&&!fk(b.g,a)){var c=Pa(b.g);c.push(a);ho(b,c,!0)}}}
function Zo(){return r("yt.mdx.remote.currentDialId_")}function ep(a){p("yt.mdx.remote.currentDialId_",a,void 0)}function gp(){return r("yt.mdx.remote.connectData_")}function Ko(a){p("yt.mdx.remote.connectData_",a,void 0)}function Uo(){return r("yt.mdx.remote.connection_")}
function dp(a){var b=Uo();Ko(null);a?Aa(!Uo()):(fp(""),ep(""));p("yt.mdx.remote.connection_",a,void 0);Do&&(A(Do,function(b){b(a)}),Do.length=0);b&&!a?Fb("yt-remote-connection-change",!1):!b&&a&&K("yt-remote-connection-change",!0)}function Mo(){var a=pk();if(!a)return null;if(Wo()){var b=Fo().V();return V(b,a)}return $?qo($,a):null}
function ap(a,b){Aa(!Ho());fp(a.id);var c=new Z(Ao,a,No());c.connect(b,gp());c.subscribe("beforeDisconnect",function(a){Fb("yt-remote-before-disconnect",a)});c.subscribe("beforeDispose",function(){Uo()&&(Uo(),dp(null))});dp(c)}function cp(a){Zo();Io("Connecting to: "+(a?a.toString():"null"));ep(a.id);var b=gp();b?uo(a.id,b.videoIds[b.index],b.currentTime):uo(a.id)}
function Po(){var a=Mo();a?(Io("Resume connection to: "+Kj(a)),ap(a,0)):(Ek(),Jl(),Io("Skipping connecting because no session screen found."))}function Bo(a){Io("Paired with: "+Kj(a));a?ap(a,1):dp(null)}function Co(){var a=Ho();a&&!Xo()&&(Io("Dropping current screen with id: "+a),$o());Mo()||Ek()}var Ao=null,Do=null,Ro=null,$=null;
function Eo(a){var b=No();if(cb(b)){var b=ok(),c=S("yt-remote-session-name")||"",d=S("yt-remote-session-app")||"",b={device:"REMOTE_CONTROL",id:b,name:c,app:d};a&&(b["mdx-version"]=3);p("yt.mdx.remote.channelParams_",b,void 0)}}function No(){return r("yt.mdx.remote.channelParams_")||{}}function Oo(a){a?(R("yt-remote-session-app",a.app),R("yt-remote-session-name",a.name)):(Og("yt-remote-session-app"),Og("yt-remote-session-name"));p("yt.mdx.remote.channelParams_",a,void 0)}var Jo=[];var hp=null,ip=[];function jp(){kp();if(Yo()){var a=hp;"html5"!=a.getPlayerType()&&a.loadNewVideoConfig(a.getCurrentVideoConfig(),"html5")}}function lp(a){"cast-selector-receiver"==a?Kl():mp(a)}
function mp(a){var b=So();if(a=Zj(b,a)){var c=hp,d=c.getVideoData().video_id,e=c.getVideoData().list,f=c.getCurrentTime();bp(a,{videoIds:[d],listId:e,videoId:d,index:0,currentTime:f});"html5"!=c.getPlayerType()?c.loadNewVideoConfig(c.getCurrentVideoConfig(),"html5"):c.updateRemoteReceivers&&c.updateRemoteReceivers(b,a)}}function kp(){var a=hp;a&&a.updateRemoteReceivers&&a.updateRemoteReceivers(So(),Yo())};var np=null,op=[];function pp(a){return{externalChannelId:a.externalChannelId,bd:a.offersUrl,source:a.source,Sb:a.subscriptionId}}function qp(a){rp(pp(a))}function rp(a){bi()?(Hh(Oh,new Mh(a.externalChannelId,a.bd?{itemType:"U",itemId:a.externalChannelId,offersUrl:a.bd}:null)),(a="/gen_204?"+ed({event:"subscribe",source:a.source}))&&cg(a)):sp(a)}function sp(a){Sh(function(b){b.subscription_ajax&&rp(a)},null,"sub_button")}
function tp(a){a=pp(a);Hh(Qh,new Nh(a.externalChannelId,a.Sb,null));(a="/gen_204?"+ed({event:"unsubscribe",source:a.source}))&&cg(a)}function up(a,b){np&&np.channelSubscribed(a,b)}function vp(a){np&&np.channelUnsubscribed(a)};function wp(a){D.call(this);this.j=a;this.j.subscribe("command",this.Ec,this);this.k={};this.A=!1}x(wp,D);g=wp.prototype;g.start=function(){this.A||this.H()||(this.A=!0,xp(this.j,"RECEIVING"))};
g.Ec=function(a,b){if(this.A&&!this.H()){var c=b||{};switch(a){case "addEventListener":if(u(c.event)&&(c=c.event,!(c in this.k))){var d=v(this.rd,this,c);this.k[c]=d;this.addEventListener(c,d)}break;case "removeEventListener":u(c.event)&&yp(this,c.event);break;default:this.g.isReady()&&this.g[a]&&(c=zp(a,b||{}),c=this.g[a].apply(this.g,c),(c=Ap(a,c))&&this.A&&!this.H()&&xp(this.j,a,c))}}};g.rd=function(a,b){this.A&&!this.H()&&xp(this.j,a,this.hc(a,b))};g.hc=function(a,b){if(null!=b)return{value:b}};
function yp(a,b){b in a.k&&(a.removeEventListener(b,a.k[b]),delete a.k[b])}g.F=function(){this.j.unsubscribe("command",this.Ec,this);this.j=null;for(var a in this.k)yp(this,a);wp.L.F.call(this)};function Bp(a,b){wp.call(this,b);this.g=a;this.start()}x(Bp,wp);Bp.prototype.addEventListener=function(a,b){this.g.addEventListener(a,b)};Bp.prototype.removeEventListener=function(a,b){this.g.removeEventListener(a,b)};
function zp(a,b){switch(a){case "loadVideoById":return b=oj(b),qj(b),[b];case "cueVideoById":return b=oj(b),qj(b),[b];case "loadVideoByPlayerVars":return qj(b),[b];case "cueVideoByPlayerVars":return qj(b),[b];case "loadPlaylist":return b=pj(b),qj(b),[b];case "cuePlaylist":return b=pj(b),qj(b),[b];case "seekTo":return[b.seconds,b.allowSeekAhead];case "playVideoAt":return[b.index];case "setVolume":return[b.volume];case "setPlaybackQuality":return[b.suggestedQuality];case "setPlaybackRate":return[b.suggestedRate];
case "setLoop":return[b.loopPlaylists];case "setShuffle":return[b.shufflePlaylist];case "getOptions":return[b.module];case "getOption":return[b.module,b.option];case "setOption":return[b.module,b.option,b.value]}return[]}
function Ap(a,b){switch(a){case "isMuted":return{muted:b};case "getVolume":return{volume:b};case "getPlaybackRate":return{playbackRate:b};case "getAvailablePlaybackRates":return{availablePlaybackRates:b};case "getVideoLoadedFraction":return{videoLoadedFraction:b};case "getPlayerState":return{playerState:b};case "getCurrentTime":return{currentTime:b};case "getPlaybackQuality":return{playbackQuality:b};case "getAvailableQualityLevels":return{availableQualityLevels:b};case "getDuration":return{duration:b};
case "getVideoUrl":return{videoUrl:b};case "getVideoEmbedCode":return{videoEmbedCode:b};case "getPlaylist":return{playlist:b};case "getPlaylistIndex":return{playlistIndex:b};case "getOptions":return{options:b};case "getOption":return{option:b}}}
Bp.prototype.hc=function(a,b){switch(a){case "onReady":return;case "onStateChange":return{playerState:b};case "onPlaybackQualityChange":return{playbackQuality:b};case "onPlaybackRateChange":return{playbackRate:b};case "onError":return{errorCode:b}}return Bp.L.hc.call(this,a,b)};Bp.prototype.F=function(){Bp.L.F.call(this);delete this.g};function Cp(a,b){this.source=null;this.A=a||null;this.origin="*";this.D=window.document.location.protocol+"//"+window.document.location.hostname;this.B=b;this.k=this.g=this.j=this.o=null;O(window,"message",v(this.K,this))}
Cp.prototype.K=function(a){var b=this.B||G("POST_MESSAGE_ORIGIN")||this.D;if("*"==b||a.origin==b)if(!this.A||a.source==this.A)if(this.source=a.source,this.origin="null"==a.origin?this.origin:a.origin,a=a.data,u(a)){try{a=ug(a)}catch(c){return}this.o=a.id;switch(a.event){case "listening":this.g&&(this.g(),this.g=null);break;case "command":this.j&&(this.k&&!Ha(this.k,a.func)||this.j(a.func,a.args))}}};Cp.prototype.sendMessage=function(a){this.source&&(a.id=this.o,a=Q(a),this.source.postMessage(a,this.origin))};function Dp(){var a=this.j=new Cp,b=v(this.Ud,this);a.j=b;a.k=null;this.k=[];this.B=!1;this.A=(a=G("POST_MESSAGE_ORIGIN"))&&Zf(a)?a:null;this.o={}}g=Dp.prototype;g.Ud=function(a,b){if(this.A&&this.A!=this.j.origin)this.dispose();else if("addEventListener"==a&&b){var c=b[0];this.o[c]||"onReady"==c||(this.addEventListener(c,Ep(this,c)),this.o[c]=!0)}else this.Mc(a,b)};g.Mc=function(){};function Ep(a,b){return v(function(a){this.sendMessage(b,a)},a)}g.addEventListener=function(){};
g.Md=function(){this.B=!0;this.sendMessage("initialDelivery",this.ac());this.sendMessage("onReady");A(this.k,this.Qc,this);this.k=[]};g.ac=function(){return null};function Fp(a,b){a.sendMessage("infoDelivery",b)}g.Qc=function(a){this.B?this.j.sendMessage(a):this.k.push(a)};g.sendMessage=function(a,b){this.Qc({event:a,info:void 0==b?null:b})};g.dispose=function(){this.j=null};function Gp(a){Dp.call(this);this.g=a;this.g.addEventListener("onReady",v(this.ae,this));this.g.addEventListener("onVideoProgress",v(this.fe,this));this.g.addEventListener("onVolumeChange",v(this.ge,this));this.g.addEventListener("onApiChange",v(this.be,this));this.g.addEventListener("onPlaybackQualityChange",v(this.ce,this));this.g.addEventListener("onPlaybackRateChange",v(this.de,this));this.g.addEventListener("onStateChange",v(this.ee,this))}x(Gp,Dp);g=Gp.prototype;
g.Mc=function(a,b){if(this.g[a]){b=b||[];if(0<b.length&&mj(a)){var c;c=b;if(ha(c[0])&&!t(c[0]))c=c[0];else{var d={};switch(a){case "loadVideoById":case "cueVideoById":d=oj.apply(window,c);break;case "loadVideoByUrl":case "cueVideoByUrl":d=nj.apply(window,c);break;case "loadPlaylist":case "cuePlaylist":d=pj.apply(window,c)}c=d}qj(c);b.length=1;b[0]=c}this.g[a].apply(this.g,b);mj(a)&&Fp(this,this.ac())}};g.ae=function(){var a=v(this.Md,this);this.j.g=a};
g.addEventListener=function(a,b){this.g.addEventListener(a,b)};g.ac=function(){var a=this.g.getApiInterface();Ma(a,"getVideoData");for(var b={apiInterface:a},c=0,d=a.length;c<d;c++){var e=a[c],f=e;if(0==f.search("get")||0==f.search("is")){var f=e,h=0;0==f.search("get")?h=3:0==f.search("is")&&(h=2);f=f.charAt(h).toLowerCase()+f.substr(h+1);try{var k=this.g[e]();b[f]=k}catch(m){}}}b.videoData=this.g.getVideoData();return b};
g.ee=function(a){a={playerState:a,currentTime:this.g.getCurrentTime(),duration:this.g.getDuration(),videoData:this.g.getVideoData(),videoStartBytes:0,videoBytesTotal:this.g.getVideoBytesTotal(),videoLoadedFraction:this.g.getVideoLoadedFraction(),playbackQuality:this.g.getPlaybackQuality(),availableQualityLevels:this.g.getAvailableQualityLevels(),videoUrl:this.g.getVideoUrl(),playlist:this.g.getPlaylist(),playlistIndex:this.g.getPlaylistIndex()};this.g.getProgressState&&(a.progressState=this.g.getProgressState());
this.g.getStoryboardFormat&&(a.storyboardFormat=this.g.getStoryboardFormat());Fp(this,a)};g.ce=function(a){Fp(this,{playbackQuality:a})};g.de=function(a){Fp(this,{playbackRate:a})};g.be=function(){for(var a=this.g.getOptions(),b={namespaces:a},c=0,d=a.length;c<d;c++){var e=a[c],f=this.g.getOptions(e);b[e]={options:f};for(var h=0,k=f.length;h<k;h++){var m=f[h],q=this.g.getOption(e,m);b[e][m]=q}}this.sendMessage("apiInfoDelivery",b)};g.ge=function(){Fp(this,{muted:this.g.isMuted(),volume:this.g.getVolume()})};
g.fe=function(a){a={currentTime:a,videoBytesLoaded:this.g.getVideoBytesLoaded(),videoLoadedFraction:this.g.getVideoLoadedFraction()};this.g.getProgressState&&(a.progressState=this.g.getProgressState());Fp(this,a)};function Hp(a,b,c){T.call(this);this.g=a;this.j=b;this.k=c}x(Hp,T);function xp(a,b,c){if(!a.H()){var d=a.g;d.H()||a.j!=d.g||(a={id:a.k,command:b},c&&(a.data=c),d.g.postMessage(Q(a),d.k))}}Hp.prototype.F=function(){this.j=this.g=null;Hp.L.F.call(this)};function Ip(a,b,c){D.call(this);this.g=a;this.k=c;this.A=O(window,"message",v(this.o,this));this.j=new Hp(this,a,b);mb(this,na(E,this.j))}x(Ip,D);Ip.prototype.o=function(a){if(!this.H()&&a.origin==this.k&&a.source==this.g&&(a=a.data,u(a))){try{a=ug(a)}catch(b){return}if(a.command){var c=this.j;c.H()||c.publish("command",a.command,a.data)}}};Ip.prototype.F=function(){Mc(this.A);this.g=null;Ip.L.F.call(this)};var Jp={};function Kp(a){return a?24==a.length&&"UC"==a.slice(0,2)?a.substr(2):22==a.length?a:null:null};var Lp=[];
function Mp(a,b){if(!b){var c=G("CONVERSION_CONFIG_DICT");if(!c)return;b=c.uid||null;if(!b)return}if("subscribe"==a||"unsubscribe"==a){if(u(b)){var d=Kp(b);d&&(d={label:"followon_"+a,foc_id:d,r:Math.round(1E4*Math.random())},(d=gd("//googleads.g.doubleclick.net/pagead/viewthroughconversion/962985656/",d))&&d&&cg(d))}}else t:{c=G("CONVERSION_CONFIG_DICT");if(u(b)){var e=Kp(b);if(!c||c.uid!=e)if(c=Jp[e],!c||c.uid!=e)break t}if(a&&c&&c.baseUrl&&c.uid){var f=c.rmktEnabled,e=c.focEnabled&&(!c.isAd||"view"!=
a);if(f||e){var h={};if(f){f={utuid:c.uid,type:a,client_name:"html5"};"cvisit"==a&&(f.type="cview");c.vid&&(f.utvid=c.vid);c.eventLabel&&(f.el=c.eventLabel);c.playerStyle&&(f.ps=c.playerStyle);c.feature&&(f.feature=c.feature);c.ppe&&(f.ppe=c.ppe);c.subscribed&&(f.subscribed=c.subscribed);c.engaged&&(f.engaged=c.engaged);var k=[];for(d in f)k.push(encodeURIComponent(d)+"="+encodeURIComponent(f[d]));d=k.join(";");h.data=d}e&&(h.label="followon_"+a,h.foc_id=c.uid,h.r=Math.round(1E4*Math.random()));if("unsubscribe"==
a||"dislike"==a)h.r=Math.round(1E4*Math.random());d=gd(c.baseUrl,h)}else d=null}else d=null;d&&d&&cg(d)}};function Np(a){zh.call(this,1,arguments)}x(Np,zh);function Op(a,b,c){zh.call(this,1,arguments);this.k=a;this.j=b;this.g=c}x(Op,zh);function Pp(a,b,c,d){zh.call(this,1,arguments);this.k=a;this.g=b;this.A=c||null;this.j=d||null}x(Pp,zh);function Qp(a,b){zh.call(this,1,arguments);this.j=a;this.g=b||null}x(Qp,zh);function Rp(a){zh.call(this,1,arguments)}x(Rp,zh);
var Sp=new Ch("ypc-delayedloader-load",Np),Tp=new Ch("ypc-guide-sync-success",Op),Up=new Ch("ypc-purchase-success",Pp),Vp=new Ch("ypc-subscription-cancel",Rp),Wp=new Ch("ypc-subscription-cancel-success",Qp),Xp=new Ch("ypc-init-subscription",Rp);var Yp=!1,Zp=[],Lh=[];function $p(a){a.g?Yp?Hh(Ph,a):Hh(Sp,new Np(function(){Hh(Xp,new Rp(a.g))})):aq(a.j,a.o,a.A,a.k,a.source)}function bq(a){a.g?Yp?Hh(Rh,a):Hh(Sp,new Np(function(){Hh(Vp,new Rp(a.g))})):cq(a.j,a.Sb,a.o,a.A,a.k,a.source)}
function dq(a){if(a.length){var b=Ra(a,0,40);K("subscription-batch-subscribe-loading",b);eq("subscription-subscribe-loading",b);var c={};c.session_token=sb();c.a=b.join(",");var d=function(){K("subscription-batch-subscribe-loaded",b);eq("subscription-subscribe-loaded",b)};Yh("/subscription_ajax?action_create_subscription_to_all=1",{method:"POST",T:c,aa:function(c,f){d();var h=f.response,k=h.id;if(t(k)&&k.length==b.length){var m={},q=h.channel_info_map;A(k,function(a,c){var d=b[c],e=q[d];m[d]=a;K("subscription-subscribe-success",
d,a,null,e)});K("subscription-batch-subscribe-success",m);(h=h.guide_notification_html_content)&&K("guide-add-subscription",h);a.length&&dq(a)}},onError:function(){d();K("subscription-batch-subscribe-failure",b);eq("subscription-subscribe-failure",b)}})}}
function fq(a){if(a.length){var b=Ra(a,0,40);K("subscription-batch-unsubscribe-loading",b);eq("subscription-unsubscirbe-loading",b);var c={};c.session_token=sb();c.c=b.join(",");var d=function(){K("subscription-batch-unsubscribe-loaded",b);eq("subscription-unsubscribe-loaded",b)};Yh("/subscription_ajax?action_remove_subscriptions=1",{method:"POST",T:c,aa:function(){d();K("subscription-batch-unsubscribe-success",b);eq("subscription-unsubscribe-success",b);a.length&&fq(a)},onError:function(){d();K("subscription-batch-unsubscribe-failure",
b);eq("subscription-unsubscribe-failure",b)}})}}function gq(a,b,c){hq(a,b,null,null,c)}function iq(a,b,c){hq(a,null,null,b,c)}function jq(a,b,c){kq(a,b,null,c)}function lq(a,b,c){kq(a,null,b,c)}function mq(a,b,c,d,e){hq(a,b,c,d,e)}function nq(a){var b=a.k.subscriptionElement||null,c=a.g.subscriptionId,d=a.g.channelInfo;c&&K("subscription-subscribe-success",a.j,c,b,d)}function oq(a){var b=a.g;Wa(a.k,function(a,d){K("subscription-subscribe-success",d,a,null,b[d])});K("guide-add-subscription",a.j)}
function pq(a){K("subscription-unsubscribe-success",a.j.itemId,a.j.subscriptionElement||null);a.g&&(K("subscription-batch-unsubscribe-success",a.g),eq("subscription-unsubscribe-success",a.g),eq("subscription-enable-ypc",a.g))}
function aq(a,b,c,d,e){K("subscription-subscribe-loading",a);var f={};f.c=a;d&&(f.eurl=d);e&&(f.source=e);d={};d.session_token=sb();(e=G("PLAYBACK_ID"))&&(d.plid=e);c&&qq("/subscription_ajax?action_create_subscription_to_channel=1",f,c);Yh("/subscription_ajax?action_create_subscription_to_channel=1",{method:"POST",jc:f,T:d,aa:function(c,d){var e=d.response;K("subscription-subscribe-success",a,e.id,b,e.channel_info);e.show_feed_privacy_dialog&&K("SHOW-FEED-PRIVACY-SUBSCRIBE-DIALOG",a);(e=e.guide_notification_html_content)&&
K("guide-add-subscription",e)},onError:function(){K("subscription-subscribe-failure",a)},kc:function(){K("subscription-subscribe-loaded",a)}})}
function cq(a,b,c,d,e,f){K("subscription-unsubscirbe-loading",a);var h={};e&&(h.eurl=e);f&&(h.source=f);e={};e.session_token=sb();e.c=a;e.s=b;(b=G("PLAYBACK_ID"))&&(e.plid=b);d&&qq("/subscription_ajax?action_remove_subscriptions=1",{},d);Yh("/subscription_ajax?action_remove_subscriptions=1",{method:"POST",jc:h,T:e,aa:function(){K("subscription-unsubscribe-success",a,c)},onError:function(){K("subscription-unsubscribe-failure",a)},kc:function(){K("subscription-unsubscribe-loaded",a)}})}
function hq(a,b,c,d,e){if(null!==b||null!==c||null!==d){var f={};f.session_token=sb();a&&(f.channel_id=a);null===b||(f.email_on_upload=b);null===c||(f.receive_no_updates=c);null===d||(f.uploads_only=d);Yh("/subscription_ajax?action_update_subscription_preferences=1",{method:"POST",T:f,onError:function(){e&&e()}})}}
function kq(a,b,c,d){if(a.length&&(null!==b||null!==c)){var e=Ra(a,0,40);K("subscription-batch-prefs-loading",e);var f={};f.session_token=sb();f.s=e.join(",");null!==b&&(f.email_on_upload=b,f.receive_no_updates=!b);null===c||(f.uploads_only=c);var h=function(){K("subscription-batch-prefs-loaded",e)};Yh("/subscription_ajax?action_update_subscription_preferences_batch=1",{method:"POST",T:f,aa:function(){h();K("subscription-batch-prefs-success",e);a.length&&kq(a,b,c,d)},onError:function(){h();d&&d();
K("subscription-batch-prefs-failure",e)}})}}function eq(a,b){A(b,function(b){K(a,b)})}function qq(a,b,c){a=jd(a,b);c=hd(c);ld(a,c)};var rq=null,sq=null,tq=null,uq=!1;var vq={},wq=0;p("yt.setAjaxToken",function(){},void 0);p("yt.setConfig",qb,void 0);p("yt.setMsg",function(a){rb(pb,arguments)},void 0);
p("yt.www.errors.log",function(a,b){if(a&&window&&window.yterr&&!(5<=wq)){var c=a.stacktrace,d=a.columnNumber;var e=a,f=r("window.location.href");if(u(e))a={message:e,name:"Unknown error",lineNumber:"Not available",fileName:f,stack:"Not available"};else{var h,k,m=!1;try{h=e.lineNumber||e.line||"Not available"}catch(q){h="Not available",m=!0}try{k=e.fileName||e.filename||e.sourceURL||l.$googDebugFname||f}catch(U){k="Not available",m=!0}a=!m&&e.lineNumber&&e.fileName&&e.stack&&e.message&&e.name?e:{message:e.message||
"Not available",name:e.name||"UnknownError",lineNumber:h,fileName:k,stack:e.stack||"Not available"}}c=c||a.stack;e=a.lineNumber.toString();isNaN(e)||isNaN(d)||(e=e+":"+d);vq[a.message]||(d={jc:{a:"logerror",t:"jserror",type:a.name,msg:a.message.substr(0,1E3),line:e,level:b||"ERROR"},T:{url:window.location.href,file:a.fileName},method:"POST"},c&&(d.T.stack=c),Yh("/gen_204",d),vq[a.message]=!0,wq++)}},void 0);
p("yt.embed.openLoginDialog",function(){Sh(function(a){if(rq.onLoginDialogSuccess)rq.onLoginDialogSuccess(a)})},void 0);
p("writeEmbed",function(){var a=new Ye(G("PLAYER_CONFIG")),b=document.referrer,c=G("POST_MESSAGE_ORIGIN"),d=!1;u(b)&&u(c)&&-1<b.indexOf(c)&&Zf(c)&&Zf(b)&&(d=!0);window!=window.top&&b&&b!=document.URL&&(a.args.loaderUrl=b);G("LIGHTWEIGHT_AUTOPLAY")&&(a.args.autoplay="1");a.args.autoplay&&qj(a.args);rq=hh("player",a);b=G("POST_MESSAGE_ID","player");G("ENABLE_JS_API")?tq=new Gp(rq):G("ENABLE_POST_API")&&u(b)&&u(c)&&(sq=new Ip(window.parent,b,c),tq=new Bp(rq,sq.j));uq=d&&!G("ENABLE_CAST_API");uq||(c=
rq,zo({device:"Desktop",app:"youtube-desktop",isSignedIn:G("LOGGED_IN"),loadAccountScreens:a.args.has_mdx_screens}),hp=c,hp.addEventListener("onReady",jp),hp.addEventListener("onRemoteReceiverSelected",lp),ip.push(J("yt-remote-receiver-availability-change",kp)),ip.push(J("yt-remote-auto-connect",mp)));G("BG_P")&&(G("BG_I")||G("BG_IU"))&&Qb();np=rq;np.addEventListener("SUBSCRIBE",qp);np.addEventListener("UNSUBSCRIBE",tp);op.push(J("subscription-subscribe-success",up));op.push(J("subscription-unsubscribe-success",
vp))},void 0);p("yt.www.watch.ads.restrictioncookie.spr",function(a){(a=a+"mac_204?action_fcts=1")&&cg(a);return!0},void 0);
O(window,"load",function(){kg().ol=w();ig("ol");if(G("TIMING_WAIT")){var a=G("TIMING_ACTION"),b=kg();if(a&&b._start)if(a=G("TIMING_WAIT",[]),a.length){for(var c=!0,d=0,e=a.length;d<e;++d)if(!(a[d]in b)){c=!1;break}c&&jg()}else(b.ol||b.aft)&&jg()}else b=G("TIMING_ACTION"),a=!!G("TIMING_WFF"),c=kg(),b&&c._start&&(a&&c.vr||!a&&(c.ol||c.aft))&&jg();Yp=!0;Lh.push(Jh(Oh,$p),Jh(Qh,bq));Yp||(Lh.push(Jh(Ph,$p),Jh(Rh,bq)),Zp.push(J("subscription-batch-subscribe",dq)),Zp.push(J("subscription-batch-unsubscribe",
fq)),Zp.push(J("subscription-pref-email",gq)),Zp.push(J("subscription-pref-uploads",iq)),Zp.push(J("subscription-prefs",mq)),Zp.push(J("subscription-batch-pref-email",jq)),Zp.push(J("subscription-batch-pref-uploads",lq)),Lh.push(Jh(Up,nq),Jh(Wp,pq),Jh(Tp,oq)),Lp.push(J("subscription-subscribe-success",na(Mp,"subscribe")),J("subscription-unsubscribe-success",na(Mp,"unsubscribe")),J("player-subscribe",na(Mp,"subscribe")),J("player-unsubscribe",na(Mp,"unsubscribe"))))});
O(window,"unload",function(){var a=rq;a&&a.sendAbandonmentPing&&a.sendAbandonmentPing();G("PL_ATT")&&(Pb=null);Eb(Zp);Zp.length=0;Kh();Lh.length=0;Yp=!1;Eb(Lp);Lp.length=0;np&&(np.removeEventListener("SUBSCRIBE",rp),np.removeEventListener("UNSUBSCRIBE",tp));np=null;Eb(op);uq||(Eb(ip),ip.length=0,hp&&(hp.removeEventListener("onRemoteReceiverSelected",lp),hp.removeEventListener("onReady",jp),hp=null),Qo());nb(tq,sq);rq.destroy()});var xq=ti.getInstance(),yq=hi(xq);
yq in yi||(xq.register(),ii(xq,"yt-uix-init-"+yq,xq.init),ii(xq,"yt-uix-dispose-"+yq,xq.dispose),yi[yq]=xq);})();
