From bcf3e521d8a4a58304ff1747260a7a01aad3b67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Thu, 28 May 2015 00:31:29 +0200 Subject: [PATCH] Execute networking and parsing code on a background thread Fixes #147 --- CHANGELOG.md | 4 + .../testIsAsynchronous.json | 1 + .../testIsConcurrent.json | 1 + .../testStartingOnBackgroundThread.json | 82 +++++++++++++++++++ .../testStartingOnMainThread.json | 1 + .../testWrongInitializer.json | 1 + .../XCDYouTubeVideoOperationTestCase.m | 36 +++++++- XCDYouTubeKit/XCDYouTubeVideoOperation.h | 4 +- XCDYouTubeKit/XCDYouTubeVideoOperation.m | 31 +++---- 9 files changed, 136 insertions(+), 25 deletions(-) create mode 100644 XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsAsynchronous.json create mode 100644 XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsConcurrent.json create mode 100644 XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testStartingOnBackgroundThread.json create mode 100644 XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testStartingOnMainThread.json create mode 100644 XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testWrongInitializer.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b4d3359..28cd3046 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#### Version 2.2.0 + +* Networking and parsing code is executed on a background thread for better performance. The `XCDYouTubeVideoOperation` class has changed from an asynchronous to a synchronous operation and must not be started on the main thread. (#147) + #### Version 2.1.3 * Adaptation to YouTube API change. (#144) diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsAsynchronous.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsAsynchronous.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsAsynchronous.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsConcurrent.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsConcurrent.json new file mode 100644 index 00000000..0637a088 --- /dev/null +++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testIsConcurrent.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testStartingOnBackgroundThread.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testStartingOnBackgroundThread.json new file mode 100644 index 00000000..9ede62d7 --- /dev/null +++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeVideoOperationTestCase/testStartingOnBackgroundThread.json @@ -0,0 +1,82 @@ +[ + { + "body" : "(function(){var f,aa=aa||{},m=this;function n(a){return void 0!==a}function q(a,b,c){a=a.split(\".\");c=c||m;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 u(a,b){for(var c=a.split(\".\"),d=b||m,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function v(){}function ba(a){a.getInstance=function(){return a.Ib?a.Ib:a.Ib=new a}}\nfunction 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\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function da(a){return null===a}function ea(a){return\"array\"==ca(a)}function fa(a){var b=ca(a);return\"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function x(a){return\"string\"==typeof a}function ga(a){return\"number\"==typeof a}function ha(a){return\"function\"==ca(a)}function ia(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}function ja(a){return a[ka]||(a[ka]=++la)}\nvar ka=\"closure_uid_\"+(1E9*Math.random()>>>0),la=0;function ma(a,b,c){return a.call.apply(a.bind,arguments)}function na(a,b,c){if(!a)throw Error();if(2\")&&(a=a.replace(Ca,\">\"));-1!=a.indexOf('\"')&&(a=a.replace(Da,\""\"));-1!=a.indexOf(\"'\")&&(a=a.replace(Ea,\"'\"));-1!=a.indexOf(\"\\x00\")&&(a=a.replace(Ga,\"�\"));return a}var Aa=\/&\/g,Ba=\/<\/g,Ca=\/>\/g,Da=\/\"\/g,Ea=\/'\/g,Ga=\/\\x00\/g,za=\/[\\x00&<>\"']\/;function Ha(a){return-1!=a.indexOf(\"&\")?\"document\"in m?Ia(a):Ja(a):a}\nfunction Ia(a){var b={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\""\":'\"'},c;c=m.document.createElement(\"div\");return a.replace(La,function(a,e){var g=b[a];if(g)return g;if(\"#\"==e.charAt(0)){var h=Number(\"0\"+e.substr(1));isNaN(h)||(g=String.fromCharCode(h))}g||(c.innerHTML=a+\" \",g=c.firstChild.nodeValue.slice(0,-1));return b[a]=g})}\nfunction Ja(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 La=\/&([^;\\s<&]+);?\/g;function Ma(a,b){a.length>b&&(a=a.substring(0,b-3)+\"...\");return a}var Na={\"\\x00\":\"\\\\0\",\"\\b\":\"\\\\b\",\"\\f\":\"\\\\f\",\"\\n\":\"\\\\n\",\"\\r\":\"\\\\r\",\"\\t\":\"\\\\t\",\"\\x0B\":\"\\\\x0B\",'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\"},Oa={\"'\":\"\\\\'\"};\nfunction Pa(a,b){return-1!=a.toLowerCase().indexOf(b.toLowerCase())}function Qa(){var a;a=\"\";var b=qa(\"Skip Ad \\u00bb\");a=a+b;b=new RegExp(Ra(\"\\u00bb\"),\"\");return a.replace(b,\"\")}function Ra(a){return String(a).replace(\/([-()\\[\\]{}+?*.$\\^|,:#b?1:0}\nfunction Xa(a){for(var b=0,c=0;cc?Math.max(0,a.length+c):c;if(x(a))return x(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(x(a))return x(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;\nreturn-1},D=hb.forEach?function(a,b,c){hb.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=x(a)?a.split(\"\"):a,g=0;gb?null:x(a)?a.charAt(b):a[b]}function ob(a,b,c){for(var d=a.length,e=x(a)?a.split(\"\"):a,g=0;gc?null:x(a)?a.charAt(c):a[c]}function qb(a,b,c){for(var d=x(a)?a.split(\"\"):a,e=a.length-1;0<=e;e--)if(e in d&&b.call(c,d[e],e,a))return e;return-1}function G(a,b){return 0<=ib(a,b)}function rb(a){return 0==a.length}\nfunction sb(a){if(!ea(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function tb(a,b){G(a,b)||a.push(b)}function ub(a,b){var c=ib(a,b),d;(d=0<=c)&&vb(a,c);return d}function vb(a,b){hb.splice.call(a,b,1)}function wb(a,b){var c=ob(a,b,void 0);0<=c&&vb(a,c)}function xb(a){return hb.concat.apply(hb,arguments)}function yb(a){var b=a.length;if(0=arguments.length?hb.slice.call(a,b):hb.slice.call(a,b,c)}\nfunction Cb(a,b,c){b=b||a;c=c||function(){return ia(h)?\"o\"+ja(h):(typeof h).charAt(0)+h};for(var d={},e=0,g=0;g>1,k;k=c(b,a[h]);0b?1:ac&&Ab(a,-(c+1),0,b)}function Lb(a){for(var b=[],c=0;c]*>|&[^;]+;\/g;function mc(a,b){return b?a.replace(kc,\"\"):a}\nvar nc=RegExp(\"[\\u0591-\\u06ef\\u06fa-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),oc=RegExp(\"[A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]\"),pc=RegExp(\"^[^A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]*[\\u0591-\\u06ef\\u06fa-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),qc=\/^http:\\\/\\\/.*\/,rc=\/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)\/i,sc=\n\/\\s+\/,tc=\/[\\d\\u06f0-\\u06f9]\/;function uc(){this.j=\"\";this.o=vc}uc.prototype.Ze=!0;uc.prototype.be=function(){return this.j};uc.prototype.toString=function(){return\"Const{\"+this.j+\"}\"};function wc(a){return a instanceof uc&&a.constructor===uc&&a.o===vc?a.j:\"type_error:Const\"}var vc={};function xc(a){var b=new uc;b.j=a;return b};function yc(){this.j=\"\";this.o=zc}yc.prototype.Ze=!0;var zc={};yc.prototype.be=function(){return this.j};function Ac(a){var b=new yc;b.j=a;return b}var Bc=Ac(\"\"),Cc=\/^[-,.\"'%_!# a-zA-Z0-9]+$\/;function Dc(){this.j=\"\";this.o=Ec}Dc.prototype.Ze=!0;Dc.prototype.be=function(){return this.j};Dc.prototype.Sl=!0;Dc.prototype.Bf=function(){return 1};function Fc(a){return a instanceof Dc&&a.constructor===Dc&&a.o===Ec?a.j:\"type_error:SafeUrl\"}var Gc=\/^(?:(?:https?|mailto|ftp):|[^&:\/?#]*(?:[\/?#]|$))\/i;function Hc(a){if(a instanceof Dc)return a;a=a.Ze?a.be():String(a);a=Gc.test(a)?Ic(a):\"about:invalid#zClosurez\";var b=new Dc;b.j=a;return b}\nfunction Ic(a){try{var b=encodeURI(a)}catch(c){return\"about:invalid#zClosurez\"}return b.replace(Jc,function(a){return Kc[a]})}var Jc=\/[()']|%5B|%5D|%25\/g,Kc={\"'\":\"%27\",\"(\":\"%28\",\")\":\"%29\",\"%5B\":\"[\",\"%5D\":\"]\",\"%25\":\"%\"},Ec={};function Lc(){this.j=Mc}Lc.prototype.Ze=!0;Lc.prototype.be=function(){return\"\"};Lc.prototype.Sl=!0;Lc.prototype.Bf=function(){return 1};var Mc={};function Nc(){this.j=\"\";this.A=Oc;this.o=null}Nc.prototype.Sl=!0;Nc.prototype.Bf=function(){return this.o};Nc.prototype.Ze=!0;Nc.prototype.be=function(){return this.j};function Pc(a){return a instanceof Nc&&a.constructor===Nc&&a.A===Oc?a.j:\"type_error:SafeHtml\"}var Qc=\/^[a-zA-Z0-9-]+$\/,Rc={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},Sc={EMBED:!0,IFRAME:!0,LINK:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,TEMPLATE:!0};\nfunction Tc(a){function b(a){if(ea(a))D(a,b);else{var g;a instanceof Nc?g=a:(g=null,a.Sl&&(g=a.Bf()),a=ya(a.Ze?a.be():String(a)),g=Uc(a,g));d+=Pc(g);g=g.Bf();0==c?c=g:0!=g&&c!=g&&(c=null)}}var c=0,d=\"\";D(arguments,b);return Uc(d,c)}var Oc={};function Uc(a,b){var c=new Nc;c.j=a;c.o=b;return c}Uc(\"\",0);Uc(\"\",0);function Vc(a,b,c){return Math.min(Math.max(a,b),c)};function Wc(a,b){this.x=n(a)?a:0;this.y=n(b)?b:0}f=Wc.prototype;f.clone=function(){return new Wc(this.x,this.y)};function Xc(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1}function Yc(a,b){return new Wc(a.x-b.x,a.y-b.y)}f.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};f.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};f.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};\nf.scale=function(a,b){var c=ga(b)?b:a;this.x*=a;this.y*=c;return this};function H(a,b){this.width=a;this.height=b}function Zc(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1}f=H.prototype;f.clone=function(){return new H(this.width,this.height)};f.isEmpty=function(){return!(this.width*this.height)};f.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};\nf.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ga(b)?b:a;this.width*=a;this.height*=c;return this};var $c;a:{var ad=m.navigator;if(ad){var bd=ad.userAgent;if(bd){$c=bd;break a}}$c=\"\"}function cd(a){return-1!=$c.indexOf(a)};function dd(){return cd(\"Opera\")||cd(\"OPR\")}function ed(){return cd(\"Edge\")||cd(\"Trident\")||cd(\"MSIE\")}function fd(){return(cd(\"Chrome\")||cd(\"CriOS\"))&&!dd()&&!ed()};function gd(){return cd(\"Edge\")};function hd(){return cd(\"iPhone\")&&!cd(\"iPod\")&&!cd(\"iPad\")};var id=dd(),jd=ed(),kd=cd(\"Gecko\")&&!(Pa($c,\"WebKit\")&&!gd())&&!(cd(\"Trident\")||cd(\"MSIE\"))&&!gd(),ld=Pa($c,\"WebKit\")&&!gd(),md=ld&&cd(\"Mobile\"),nd=cd(\"Macintosh\"),od=cd(\"Windows\"),pd=cd(\"Linux\")||cd(\"CrOS\"),qd=cd(\"Android\"),rd=hd(),sd=cd(\"iPad\");function ud(){var a=$c;if(kd)return\/rv\\:([^\\);]+)(\\)|;)\/.exec(a);if(jd&&gd())return\/Edge\\\/([\\d\\.]+)\/.exec(a);if(jd)return\/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)\/.exec(a);if(ld)return\/WebKit\\\/(\\S+)\/.exec(a)}\nfunction vd(){var a=m.document;return a?a.documentMode:void 0}var wd=function(){if(id&&m.opera){var a=m.opera.version;return ha(a)?a():a}var a=\"\",b=ud();b&&(a=b?b[1]:\"\");return jd&&!gd()&&(b=vd(),b>parseFloat(a))?String(b):a}(),xd={};function yd(a){return xd[a]||(xd[a]=0<=Va(wd,a))}function zd(a){return jd&&(gd()||Ad>=a)}var Bd=m.document,Cd=vd(),Ad=!Bd||!jd||!Cd&&gd()?void 0:Cd||(\"CSS1Compat\"==Bd.compatMode?parseInt(wd,10):5);var Dd=!jd||zd(9),Ed=!kd&&!jd||jd&&zd(9)||kd&&yd(\"1.9.1\"),Fd=jd&&!yd(\"9\"),Gd=jd||id||ld;function Hd(a){return a?new Id(Jd(a)):sa||(sa=new Id)}function Kd(a){return x(a)?document.getElementById(a):a}function Ld(a,b){var c=b||document;return c.querySelectorAll&&c.querySelector?c.querySelectorAll(\".\"+a):Md(\"*\",a,b)}function Nd(a,b){var c=b||document,d=null;c.getElementsByClassName?d=c.getElementsByClassName(a)[0]:c.querySelectorAll&&c.querySelector?d=c.querySelector(\".\"+a):d=Md(\"*\",a,b)[0];return d||null}\nfunction Md(a,b,c){var d=document;c=c||d;a=a&&\"*\"!=a?a.toUpperCase():\"\";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?\".\"+b:\"\"));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,g=0,h;h=c[g];g++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||\"*\");if(b){d={};for(g=e=0;h=c[g];g++)a=h.className,\"function\"==typeof a.split&&G(a.split(\/\\s+\/),b)&&(d[e++]=h);d.length=e;return d}return c}\nfunction Od(a,b){Nb(b,function(b,d){\"style\"==d?a.style.cssText=b:\"class\"==d?a.className=b:\"for\"==d?a.htmlFor=b:d in Pd?a.setAttribute(Pd[d],b):ta(d,\"aria-\")||ta(d,\"data-\")?a.setAttribute(d,b):a[d]=b})}var Pd={cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",colspan:\"colSpan\",frameborder:\"frameBorder\",height:\"height\",maxlength:\"maxLength\",role:\"role\",rowspan:\"rowSpan\",type:\"type\",usemap:\"useMap\",valign:\"vAlign\",width:\"width\"};\nfunction Qd(a){a=a.document;a=\"CSS1Compat\"==a.compatMode?a.documentElement:a.body;return new H(a.clientWidth,a.clientHeight)}function Rd(a){var b=Sd(a);a=a.parentWindow||a.defaultView;return jd&&yd(\"10\")&&a.pageYOffset!=b.scrollTop?new Wc(b.scrollLeft,b.scrollTop):new Wc(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}function Sd(a){return a.j?a.j:ld||\"CSS1Compat\"!=a.compatMode?a.body||a.documentElement:a.documentElement}function Td(a){return a?a.parentWindow||a.defaultView:window}\nfunction I(a,b,c){return Ud(document,arguments)}function Ud(a,b){var c=b[0],d=b[1];if(!Dd&&d&&(d.name||d.type)){c=[\"<\",c];d.name&&c.push(' name=\"',ya(d.name),'\"');if(d.type){c.push(' type=\"',ya(d.type),'\"');var e={};gc(e,d);delete e.type;d=e}c.push(\">\");c=c.join(\"\")}c=a.createElement(c);d&&(x(d)?c.className=d:ea(d)?c.className=d.join(\" \"):Od(c,d));2a}\nfunction se(a){if(Fd&&\"innerText\"in a)a=a.innerText.replace(\/(\\r\\n|\\r|\\n)\/g,\"\\n\");else{var b=[];te(a,b,!0);a=b.join(\"\")}a=a.replace(\/ \\xAD \/g,\" \").replace(\/\\xAD\/g,\"\");a=a.replace(\/\\u200B\/g,\"\");Fd||(a=a.replace(\/ +\/g,\" \"));\" \"!=a&&(a=a.replace(\/^\\s*\/,\"\"));return a}\nfunction te(a,b,c){if(!(a.nodeName in ne))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(\/(\\r\\n|\\r|\\n)\/g,\"\")):b.push(a.nodeValue);else if(a.nodeName in oe)b.push(oe[a.nodeName]);else for(a=a.firstChild;a;)te(a,b,c),a=a.nextSibling}function Wd(a){if(a&&\"number\"==typeof a.length){if(ia(a))return\"function\"==typeof a.item||\"string\"==typeof a.item;if(ha(a))return\"function\"==typeof a.item}return!1}\nfunction ue(a,b){return b?ve(a,function(a){return!b||x(a.className)&&G(a.className.split(\/\\s+\/),b)},!0,void 0):null}function ve(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 Id(a){this.j=a||m.document||document}f=Id.prototype;f.R=function(a){return x(a)?this.j.getElementById(a):a};f.Dw=function(a,b,c){return Ud(this.j,arguments)};f.createElement=function(a){return this.j.createElement(a)};\nfunction we(a){return\"CSS1Compat\"==a.j.compatMode}function xe(a){a=a.j;return a.parentWindow||a.defaultView}function ye(a){return Rd(a.j)}f.appendChild=Zd;f.append=$d;f.contains=ie;var ze=\"StopIteration\"in m?m.StopIteration:{message:\"StopIteration\",stack:\"\"};function Ae(){}Ae.prototype.next=function(){throw ze;};Ae.prototype.Zb=function(){return this};function Be(a){if(a instanceof Ae)return a;if(\"function\"==typeof a.Zb)return a.Zb(!1);if(fa(a)){var b=0,c=new Ae;c.next=function(){for(;;){if(b>=a.length)throw ze;if(b in a)return a[b++];b++}};return c}throw Error(\"Not implemented\");}\nfunction Ce(a,b,c){if(fa(a))try{D(a,b,c)}catch(d){if(d!==ze)throw d;}else{a=Be(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==ze)throw e;}}}function De(a){if(fa(a))return yb(a);a=Be(a);var b=[];Ce(a,function(a){b.push(a)});return b};function Ee(a,b){this.o={};this.j=[];this.se=this.qa=0;var c=arguments.length;if(12*this.qa&&Fe(this),!0):!1};function Fe(a){if(a.qa!=a.j.length){for(var b=0,c=0;b=d.j.length)throw ze;var e=d.j[b++];return a?e:d.o[e]};return e};function He(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Je(a){return\"function\"==typeof a.Ya?a.Ya():fa(a)||x(a)?a.length:Sb(a)}function Ke(a){if(\"function\"==typeof a.Na)return a.Na();if(x(a))return a.split(\"\");if(fa(a)){for(var b=[],c=a.length,d=0;dc?a[1]=\"?\":c==b.length-1&&(a[1]=void 0)}return a.join(\"\")}function We(a,b,c){if(ea(b))for(var d=0;dd)return null;var e=a.indexOf(\"&\",d);if(0>e||e>c)e=c;d+=b.length+1;return xa(a.substr(d,e-d))}var gf=\/[?&]($|#)\/;\nfunction hf(a,b,c){for(var d=a.search(ef),e=0,g,h=[];0<=(g=df(a,e,b,d));)h.push(a.substring(e,g)),e=Math.min(a.indexOf(\"&\",g)+1||d,d);h.push(a.substr(e));a=[h.join(\"\").replace(gf,\"$1\"),\"&\",b];null!=c&&a.push(\"=\",wa(c));return Ve(a)};function J(a,b){this.o=this.G=this.B=\"\";this.C=null;this.H=this.A=\"\";this.D=!1;var c;a instanceof J?(this.D=n(b)?b:a.D,jf(this,a.B),this.G=a.G,kf(this,a.o),lf(this,a.C),mf(this,a.A),nf(this,a.j.clone()),this.H=a.Cf()):a&&(c=Qe(String(a)))?(this.D=!!b,jf(this,c[1]||\"\",!0),this.G=of(c[2]||\"\"),kf(this,c[3]||\"\",!0),lf(this,c[4]),mf(this,c[5]||\"\",!0),nf(this,c[6]||\"\",!0),this.H=of(c[7]||\"\")):(this.D=!!b,this.j=new pf(null,0,this.D))}f=J.prototype;\nf.toString=function(){var a=[],b=this.B;b&&a.push(qf(b,rf,!0),\":\");if(b=this.o){a.push(\"\/\/\");var c=this.G;c&&a.push(qf(c,rf,!0),\"@\");a.push(wa(b).replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\"));b=this.C;null!=b&&a.push(\":\",String(b))}if(b=this.A)this.o&&\"\/\"!=b.charAt(0)&&a.push(\"\/\"),a.push(qf(b,\"\/\"==b.charAt(0)?sf:tf,!0));(b=this.j.toString())&&a.push(\"?\",b);(b=this.Cf())&&a.push(\"#\",qf(b,uf));return a.join(\"\")};\nf.resolve=function(a){var b=this.clone(),c=!!a.B;c?jf(b,a.B):c=!!a.G;c?b.G=a.G:c=!!a.o;c?kf(b,a.o):c=null!=a.C;var d=a.A;if(c)lf(b,a.C);else if(c=!!a.A){if(\"\/\"!=d.charAt(0))if(this.o&&!this.A)d=\"\/\"+d;else{var e=b.A.lastIndexOf(\"\/\");-1!=e&&(d=b.A.substr(0,e+1)+d)}e=d;if(\"..\"==e||\".\"==e)d=\"\";else if(-1!=e.indexOf(\".\/\")||-1!=e.indexOf(\"\/.\")){for(var d=ta(e,\"\/\"),e=e.split(\"\/\"),g=[],h=0;hb)throw Error(\"Bad port number \"+b);a.C=b}else a.C=null;return a}function mf(a,b,c){a.A=c?of(b,!0):b}\nfunction nf(a,b,c){b instanceof pf?(a.j=b,wf(a.j,a.D)):(c||(b=qf(b,xf)),a.j=new pf(b,0,a.D));return a}function yf(a){return a.j}f.No=function(){return this.j.toString()};function K(a,b,c){a.j.set(b,c);return a}function zf(a,b,c){ea(c)||(c=[String(c)]);Af(a.j,b,c)}f.Cf=function(){return this.H};function Bf(a){K(a,\"zx\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^z()).toString(36));return a}\nfunction Cf(a){return a instanceof J?a.clone():new J(a,void 0)}function Df(a,b,c,d){var e=new J(null,void 0);a&&jf(e,a);b&&kf(e,b);c&&lf(e,c);d&&mf(e,d);return e}function of(a,b){return a?b?decodeURI(a.replace(\/%25\/g,\"%2525\")):decodeURIComponent(a):\"\"}function qf(a,b,c){return x(a)?(a=encodeURI(a).replace(b,Ef),c&&(a=a.replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\")),a):null}function Ef(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}\nvar rf=\/[#\\\/\\?@]\/g,tf=\/[\\#\\?:]\/g,sf=\/[\\#\\?]\/g,xf=\/[\\#\\?@]\/g,uf=\/#\/g;function pf(a,b,c){this.qa=this.j=null;this.o=a||null;this.A=!!c}function Ff(a){a.j||(a.j=new Ee,a.qa=0,a.o&&Ue(a.o,function(b,c){a.add(xa(b),c)}))}f=pf.prototype;f.Ya=function(){Ff(this);return this.qa};f.add=function(a,b){Ff(this);this.o=null;a=Gf(this,a);var c=this.j.get(a);c||this.j.set(a,c=[]);c.push(b);this.qa++;return this};\nf.remove=function(a){Ff(this);a=Gf(this,a);return Ge(this.j,a)?(this.o=null,this.qa-=this.j.get(a).length,this.j.remove(a)):!1};f.clear=function(){this.j=this.o=null;this.qa=0};f.isEmpty=function(){Ff(this);return 0==this.qa};function Hf(a,b){Ff(a);b=Gf(a,b);return Ge(a.j,b)}f.xf=function(a){var b=this.Na();return G(b,a)};f.Qa=function(){Ff(this);for(var a=this.j.Na(),b=this.j.Qa(),c=[],d=0;dMath.random()&&cg(a,\"WARNING\"));return b||c}function kg(a){return!!a&&-1!=a.search(Nf)}\nfunction lg(a){return!!a&&-1!=a.search(Sf)}function mg(a){a=new J(a);jf(a,document.location.protocol);kf(a,document.location.hostname);document.location.port&&lf(a,document.location.port);return a.toString()}function ng(a){a=new J(a);jf(a,document.location.protocol);return a.toString()};var og={},pg=0,qg=u(\"yt.net.ping.workerUrl_\")||null;q(\"yt.net.ping.workerUrl_\",qg,void 0);function rg(a,b,c){a&&(c?a&&(a=I(\"iframe\",{src:'javascript:\"data:text\/html,<\/body>\"',style:\"display:none\"}),Jd(a).body.appendChild(a)):sg(a,b))}function sg(a,b){var c=new Image,d=\"\"+pg++;og[d]=c;c.onload=c.onerror=function(){b&&og[d]&&b();delete og[d]};c.src=a;c=eval(\"null\")};function tg(a){if(a.classList)return a.classList;a=a.className;return x(a)&&a.match(\/\\S+\/g)||[]}function ug(a,b){return a.classList?a.classList.contains(b):G(tg(a),b)}function O(a,b){a.classList?a.classList.add(b):ug(a,b)||(a.className+=0=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};\nf.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};f.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};f.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};\nf.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function Jg(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}f=Jg.prototype;f.clone=function(){return new Jg(this.left,this.top,this.width,this.height)};function Kg(a){return new Ig(a.top,a.left+a.width,a.top+a.height,a.left)}function Lg(a){return new Jg(a.left,a.top,a.right-a.left,a.bottom-a.top)}function Mg(a,b){return a==b?!0:a&&b?a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height:!1}\nfunction Ng(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),g=Math.min(a.top+a.height,b.top+b.height);if(e<=g)return a.left=c,a.top=e,a.width=d-c,a.height=g-e,!0}return!1}f.contains=function(a){return a instanceof Jg?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};\nfunction Og(a){return new H(a.width,a.height)}function Pg(a){return new Wc(a.left,a.top)}f.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.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};\nf.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};f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Qg(a){Qg[\" \"](a);return a}Qg[\" \"]=v;function Rg(a,b){try{return Qg(a[b]),!0}catch(c){}return!1};function Sg(){return ld?\"Webkit\":kd?\"Moz\":jd?\"ms\":id?\"O\":null};function Tg(a,b,c){if(x(b))(b=Ug(a,b))&&(a.style[b]=c);else for(var d in b){c=a;var e=b[d],g=Ug(c,d);g&&(c.style[g]=e)}}var Vg={};function Ug(a,b){var c=Vg[b];if(!c){var d=ab(b),c=d;void 0===a.style[d]&&(d=Sg()+bb(d),void 0!==a.style[d]&&(c=d));Vg[b]=c}return c}function Wg(a,b){var c=a.style[ab(b)];return\"undefined\"!==typeof c?c:a.style[Ug(a,b)]||\"\"}\nfunction Xg(a,b){var c=Jd(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||\"\":\"\"}function Yg(a,b){return Xg(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}function Zg(a,b,c){var d;b instanceof Wc?(d=b.x,b=b.y):(d=b,b=c);a.style.left=$g(d,!1);a.style.top=$g(b,!1)}function ah(a){return new Wc(a.offsetLeft,a.offsetTop)}\nfunction bh(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}jd&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}\nfunction ch(a){if(jd&&!zd(8))return a.offsetParent;var b=Jd(a),c=Yg(a,\"position\"),d=\"fixed\"==c||\"absolute\"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(11==a.nodeType&&a.host&&(a=a.host),c=Yg(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}\nfunction dh(a){for(var b=new Ig(0,Infinity,Infinity,0),c=Hd(a),d=c.j.body,e=c.j.documentElement,g=Sd(c.j);a=ch(a);)if(!(jd&&0==a.clientWidth||ld&&0==a.clientHeight&&a==d)&&a!=d&&a!=e&&\"visible\"!=Yg(a,\"overflow\")){var h=eh(a),k=new Wc(a.clientLeft,a.clientTop);h.x+=k.x;h.y+=k.y;b.top=Math.max(b.top,h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x)}d=g.scrollLeft;g=g.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,g);\nc=Qd(xe(c)||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,g+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null}function eh(a){var b=Jd(a),c=new Wc(0,0),d;d=b?Jd(b):document;d=!jd||zd(9)||we(Hd(d))?d.documentElement:d.body;if(a==d)return c;a=bh(a);b=ye(Hd(b));c.x=a.left+b.x;c.y=a.top+b.y;return c}\nfunction fh(a,b){var c=new Wc(0,0),d=Td(Jd(a)),e=a;do{var g=d==b?eh(e):gh(e);c.x+=g.x;c.y+=g.y}while(d&&d!=b&&d!=d.parent&&(e=d.frameElement)&&(d=d.parent));return c}function gh(a){a=bh(a);return new Wc(a.left,a.top)}function hh(a){if(1==a.nodeType)return gh(a);var b=ha(a.F),c=a;a.targetTouches&&a.targetTouches.length?c=a.targetTouches[0]:b&&a.j.targetTouches&&a.j.targetTouches.length&&(c=a.j.targetTouches[0]);return new Wc(c.clientX,c.clientY)}\nfunction ih(a,b,c){if(b instanceof H)c=b.height,b=b.width;else if(void 0==c)throw Error(\"missing height argument\");jh(a,b);a.style.height=$g(c,!0)}function $g(a,b){\"number\"==typeof a&&(a=(b?Math.round(a):a)+\"px\");return a}function jh(a,b){a.style.width=$g(b,!0)}function kh(a){return lh(a)}\nfunction lh(a){var b=mh;if(\"none\"!=Yg(a,\"display\"))return b(a);var c=a.style,d=c.display,e=c.visibility,g=c.position;c.visibility=\"hidden\";c.position=\"absolute\";c.display=\"inline\";a=b(a);c.display=d;c.position=g;c.visibility=e;return a}function mh(a){var b=a.offsetWidth,c=a.offsetHeight,d=ld&&!b&&!c;return n(b)&&!d||!a.getBoundingClientRect?new H(b,c):(a=bh(a),new H(a.right-a.left,a.bottom-a.top))}function nh(a){var b=eh(a);a=lh(a);return new Jg(b.x,b.y,a.width,a.height)}\nfunction oh(a,b){var c=a.style;\"opacity\"in c?c.opacity=b:\"MozOpacity\"in c?c.MozOpacity=b:\"filter\"in c&&(c.filter=\"\"===b?\"\":\"alpha(opacity=\"+100*b+\")\")}function ph(a,b){a.style.display=b?\"\":\"none\"}function qh(a){return\"rtl\"==Yg(a,\"direction\")}function rh(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}\nfunction sh(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?rh(a,c):0}var th={thin:2,medium:4,thick:6};function uh(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 th?th[c]:rh(a,c)}\nfunction vh(a){if(jd&&!zd(9)){var b=uh(a,\"borderLeft\"),c=uh(a,\"borderRight\"),d=uh(a,\"borderTop\");a=uh(a,\"borderBottom\");return new Ig(d,c,a,b)}b=Xg(a,\"borderLeftWidth\");c=Xg(a,\"borderRightWidth\");d=Xg(a,\"borderTopWidth\");a=Xg(a,\"borderBottomWidth\");return new Ig(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var wh=\/[^\\d]+$\/,xh={cm:1,\"in\":1,mm:1,pc:1,pt:1},yh={em:1,ex:1};\nfunction zh(a){var b=Yg(a,\"fontSize\"),c;c=(c=b.match(wh))&&c[0]||null;if(b&&\"px\"==c)return parseInt(b,10);if(jd){if(c in xh)return rh(a,b);if(a.parentNode&&1==a.parentNode.nodeType&&c in yh)return a=a.parentNode,c=Yg(a,\"fontSize\"),rh(a,b==c?\"1em\":b)}c=I(\"SPAN\",{style:\"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;\"});a.appendChild(c);b=c.offsetHeight;be(c);return b}jd&&yd(12);var Ah=ld?\"webkit\":kd?\"moz\":jd?\"ms\":id?\"o\":\"\";function Bh(a){var b=a.__yt_uid_key;b||(b=Ch(),a.__yt_uid_key=b);return b}var Ch=u(\"yt.dom.getNextId_\");if(!Ch){Ch=function(){return++Dh};q(\"yt.dom.getNextId_\",Ch,void 0);var Dh=0}function Eh(a,b){var c=Md(a,null,b);return c.length?c[0]:null}function Fh(a,b){if(a in b)return b[a];var c=Ah+a.charAt(0).toUpperCase()+a.substr(1);if(c in b)return b[c]}function Gh(a,b){var c;mb(a,function(a){c=Fh(a,b);return!!c});return c};function Hh(a){if(a=a||window.event){this.event=a;for(var b in a)b in Ih||(this[b]=a[b]);this.scale=a.scale;this.rotation=a.rotation;(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:\na.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,\nthis.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);this.j=a.pageX;this.o=a.pageY}}function Jh(a){if(document.body&&document.documentElement){var b=document.body.scrollTop+document.documentElement.scrollTop;a.j=a.clientX+(document.body.scrollLeft+document.documentElement.scrollLeft);a.o=a.clientY+b}}\nfunction Kh(a){n(a.j)||Jh(a);return a.j}function Lh(a){n(a.o)||Jh(a);return a.o}f=Hh.prototype;f.type=\"\";f.target=null;f.relatedTarget=null;f.currentTarget=null;f.data=null;f.source=null;f.state=null;f.keyCode=0;f.charCode=0;f.altKey=!1;f.ctrlKey=!1;f.shiftKey=!1;f.clientX=0;f.clientY=0;f.wheelDeltaX=0;f.wheelDeltaY=0;f.rotation=0;f.scale=1;f.touches=null;f.changedTouches=null;f.preventDefault=function(){this.event&&(this.event.returnValue=!1,this.event.preventDefault&&this.event.preventDefault())};\nf.ih=function(){return this.event?!1===this.event.returnValue:!1};f.stopPropagation=function(){this.event&&(this.event.cancelBubble=!0,this.event.stopPropagation&&this.event.stopPropagation())};f.stopImmediatePropagation=function(){this.event&&(this.event.cancelBubble=!0,this.event.stopImmediatePropagation&&this.event.stopImmediatePropagation())};var Ih={stopImmediatePropagation:1,stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var Mh=u(\"yt.events.listeners_\")||{};q(\"yt.events.listeners_\",Mh,void 0);var Nh=u(\"yt.events.counter_\")||{count:0};q(\"yt.events.counter_\",Nh,void 0);function Oh(a,b,c,d){return Yb(Mh,function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}\nfunction Ph(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return\"\";d=!!d;var e=Oh(a,b,c,d);if(e)return e;var e=++Nh.count+\"\",g=!(\"mouseenter\"!=b&&\"mouseleave\"!=b||!a.addEventListener||\"onmouseenter\"in document),h;h=g?function(d){d=new Hh(d);if(!ve(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new Hh(b);b.currentTarget=a;return c.call(a,b)};h=$f(h);Mh[e]=[a,b,c,h,d];a.addEventListener?\"mouseenter\"==b&&g?a.addEventListener(\"mouseover\",\nh,d):\"mouseleave\"==b&&g?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 Qh(a,b){var c;c=Ph(a,\"playing\",function(){Rh(c);b.apply(a,arguments)},void 0)}function Sh(a,b,c,d){return Th(a,b,c,function(a){return ug(a,d)})}\nfunction Th(a,b,c,d){var e=a||document;return Ph(e,b,function(a){var b=ve(a.target,function(a){return a===e||d(a)},!0);b&&b!==e&&!b.disabled&&(a.currentTarget=b,c.call(b,a))})}function Rh(a){a&&(\"string\"==typeof a&&(a=[a]),D(a,function(a){if(a in Mh){var c=Mh[a],d=c[0],e=c[1],g=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,g,c):d.detachEvent&&d.detachEvent(\"on\"+e,g);delete Mh[a]}}))}function Uh(a){for(var b in Mh)Mh[b][0]==a&&Rh(b)}\nfunction Vh(a){a=a||window.event;a=a.target||a.srcElement;3==a.nodeType&&(a=a.parentNode);return a}function Wh(a){a=a||window.event;var b=a.pageX,c=a.pageY;document.body&&document.documentElement&&(b||(b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),c||(c=a.clientY+document.body.scrollTop+document.documentElement.scrollTop));return new Wc(b,c)}function Xh(a){a=a||window.event;a.returnValue=!1;a.preventDefault&&a.preventDefault()}\nfunction Yh(a){a=a||window.event;return!1===a.returnValue||a.ih&&a.ih()}function Zh(a,b){if(document.createEvent){var c=document.createEvent(\"HTMLEvents\");c.initEvent(b,!0,!0);a.dispatchEvent(c)}else c=document.createEventObject(),a.fireEvent(\"on\"+b,c)};function $h(){return!!Gh([\"fullscreenEnabled\",\"fullScreenEnabled\"],document)}function ai(){return Gh([\"fullscreenElement\",\"fullScreenElement\"],document)};function bi(a){a=a||{};this.url=a.url||\"\";this.urlV9As2=a.url_v9as2||\"\";this.args=a.args||dc(ci);this.assets=a.assets||{};this.attrs=a.attrs||dc(di);this.params=a.params||dc(ei);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 ci={enablejsapi:1},di={},ei={allowscriptaccess:\"always\",allowfullscreen:\"true\",bgcolor:\"#000000\"};\nbi.prototype.clone=function(){var a=new bi,b;for(b in this){var c=this[b];\"object\"==ca(c)?a[b]=dc(c):a[b]=c}return a};var fi=document.currentScript&&-1!=document.currentScript.src.indexOf(\"?loadGamesSDK\")?\"\/cast_game_sender.js\":\"\/cast_sender.js\",gi=\"boadgeojelhgndaghljhdicfkmllpafd dliochdbjfkdbacpmhlcpmleaejidimm hfaagokkkhdbgiakmmlclaapfelnkoah fmfcbgogabcbclcofgocippekhfcmgfj enhhojjnijigcajfphajepfemndkmdlo eojlgccfgnjlphjnlopmadngcgmmdgpk\".split(\" \"),hi=[\"fjhoaacokmgbjemoflkofnenfaiekifl\",\"ekpaaapppgpmolpcldedioblbkmijaca\",\"lhkfccafpkdlaodkicmokbmfapjadkij\",\"ibiljbkambkbohapfhoonkcpcikdglop\"],ii=window.navigator.presentation?\ngi.concat(hi):gi;function ji(a){window.chrome?ki(0,a):a(null)}function ki(a,b){a==ii.length?b(null):li(ii[a],function(c){c?b(ii[a]):ki(a+1,b)})}function li(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\",\"chrome-extension:\/\/\"+a+fi,!0),c.send()}catch(d){b(!1)}}\nfunction mi(){ji(function(a){if(a){window.chrome=window.chrome||{};window.chrome.cast=window.chrome.cast||{};window.chrome.cast.extensionId=a;var b=document.createElement(\"script\");b.src=\"chrome-extension:\/\/\"+a+fi;(document.head||document.documentElement).appendChild(b)}else(a=window.__onGCastApiAvailable)&&\"function\"==typeof a&&a(!1,\"No cast extension found\")})};var ni=cd(\"Firefox\"),oi=hd()||cd(\"iPod\"),pi=cd(\"iPad\"),qi=cd(\"Android\")&&!(fd()||cd(\"Firefox\")||dd()||cd(\"Silk\")),ri=fd(),si=cd(\"Safari\")&&!(fd()||cd(\"Coast\")||dd()||ed()||cd(\"Silk\")||cd(\"Android\"))&&!(hd()||cd(\"iPad\")||cd(\"iPod\"));var ti=z(),ui=null,vi=Array(50),wi=-1,xi=!1;function yi(a){zi();ui.push(a);Ai(ui)}function Bi(a){var b=u(\"yt.mdx.remote.debug.handlers_\");ub(b||[],a)}function Ci(a,b){zi();var c=ui,d=Di(a,String(b));rb(c)?Ei(d):(Ai(c),D(c,function(a){a(d)}))}function zi(){ui||(ui=u(\"yt.mdx.remote.debug.handlers_\")||[],q(\"yt.mdx.remote.debug.handlers_\",ui,void 0))}function Ei(a){var b=(wi+1)%50;wi=b;vi[b]=a;xi||(xi=49==b)}\nfunction Ai(a){var b=vi;if(b[0]){var c=wi,d=xi?c:-1;do{var d=(d+1)%50,e=b[d];D(a,function(a){a(e)})}while(d!=c);vi=Array(50);wi=-1;xi=!1}}function Di(a,b){var c=(z()-ti)\/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 Fi(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 Gi(a,b){return!!b&&(a.id==b||a.uuid==b)}function Hi(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 Ii(a){return{name:a.name,screenId:a.id,loungeToken:a.token,dialId:a.uuid}}function Ji(a){return new Fi(a)}function Ki(a){return ea(a)?E(a,Ji):[]}\nfunction Li(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 Mi(a){return ea(a)?\"[\"+E(a,Li).join(\",\")+\"]\":\"null\"};function Ni(a,b,c){a&&(a.dataset?a.dataset[Oi(b)]=c:a.setAttribute(\"data-\"+b,c))}function Pi(a,b){return a?a.dataset?a.dataset[Oi(b)]:a.getAttribute(\"data-\"+b):null}var Qi={};function Oi(a){return Qi[a]||(Qi[a]=String(a).replace(\/\\-([a-z])\/g,function(a,c){return c.toUpperCase()}))};function P(){this.Ua=this.Ua;this.Ja=this.Ja}P.prototype.Ua=!1;P.prototype.isDisposed=function(){return this.Ua};P.prototype.dispose=function(){this.Ua||(this.Ua=!0,this.P())};function R(a,b){Ri(a,oa(Si,b))}function Ri(a,b){a.Ua?b.call(void 0):(a.Ja||(a.Ja=[]),a.Ja.push(n(void 0)?y(b,void 0):b))}P.prototype.P=function(){if(this.Ja)for(;this.Ja.length;)this.Ja.shift()()};function Ti(a){return a&&\"function\"==typeof a.isDisposed?a.isDisposed():!1}\nfunction Si(a){a&&\"function\"==typeof a.dispose&&a.dispose()}function Ui(a){for(var b=0,c=arguments.length;b=c.length)throw ze;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!x(d))throw\"Storage mechanism: Invalid value was encountered\";return d};return d};f.clear=function(){this.j.clear()};f.key=function(a){return this.j.key(a)};function ij(){var a=null;try{a=window.localStorage||null}catch(b){}this.j=a}A(ij,hj);function jj(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.j=a}A(jj,hj);function kj(a){this.j=a}kj.prototype.set=function(a,b){n(b)?this.j.set(a,Cg(b)):this.j.remove(a)};kj.prototype.get=function(a){var b;try{b=this.j.get(a)}catch(c){return}if(null!==b)try{return Ag(b)}catch(d){throw\"Storage: Invalid value was encountered\";}};kj.prototype.remove=function(a){this.j.remove(a)};function lj(a){this.j=a}A(lj,kj);function mj(a){this.data=a}function nj(a){return!n(a)||a instanceof mj?a:new mj(a)}lj.prototype.set=function(a,b){lj.M.set.call(this,a,nj(b))};lj.prototype.o=function(a){a=lj.M.get.call(this,a);if(!n(a)||a instanceof Object)return a;throw\"Storage: Invalid value was encountered\";};lj.prototype.get=function(a){if(a=this.o(a)){if(a=a.data,!n(a))throw\"Storage: Invalid value was encountered\";}else a=void 0;return a};function oj(a){this.j=a}A(oj,lj);function pj(a){var b=a.creation;a=a.expiration;return!!a&&az()}oj.prototype.set=function(a,b,c){if(b=nj(b)){if(c){if(ca.status)e=Vj(c,a,b.aw);if(d)a:{switch(c){case \"XML\":d=0==parseInt(e&&e.return_code,10);break a;case \"RAW\":d=!0;break a}d=!!e}var e=e||{},g=b.context||m;d?b.Za&&b.Za.call(g,a,e):b.onError&&b.onError.call(g,a,e);b.Nb&&b.Nb.call(g,a,e)}},b.method,h,b.headers,b.responseType,b.withCredentials);b.ad&&0Va(a,\"10.0\")&&(this.o=!1))}function dk(a,b,c,d){var e=a.j;if(n(d)?d:a.o)e=\"https:\/\/\"+a.A+a.port+a.j;return cf(e+b,c||{})}\nfunction ek(a,b,c,d,e){a={format:\"JSON\",method:\"POST\",context:a,timeout:5E3,withCredentials:!1,Za:oa(a.C,d,!0),onError:oa(a.B,e),ad:oa(a.D,e)};c&&(a.Cb=c,a.headers={\"Content-Type\":\"application\/x-www-form-urlencoded\"});return Uj(b,a)}ck.prototype.C=function(a,b,c,d){b?a(d):a({text:c.responseText})};ck.prototype.B=function(a,b){a(Error(\"Request error: \"+b.status))};ck.prototype.D=function(a){a(Error(\"request timed out\"))};function fk(a){a&&(this.id=a.id||\"\",this.name=a.name||\"\",this.j=a.activityId||\"\",this.status=a.status||\"UNKNOWN\")}fk.prototype.id=\"\";fk.prototype.name=\"\";fk.prototype.j=\"\";fk.prototype.status=\"UNKNOWN\";fk.prototype.toString=function(){return\"{id:\"+this.id+\",name:\"+this.name+\",activityId:\"+this.j+\",status:\"+this.status+\"}\"};function gk(){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 hk(a){return E(a,function(a){return{key:a.id,name:a.name}})}function ik(a){return E(a,function(a){return new fk(a)})}function jk(a,b){return F(a,function(a){return a.id==b})}function kk(a,b){return F(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})}function lk(a,b){return F(a,function(a){return Gi(a,b)})};function S(){P.call(this);this.T=new Vi;R(this,this.T)}A(S,P);S.prototype.subscribe=function(a,b,c){return this.isDisposed()?0:this.T.subscribe(a,b,c)};S.prototype.unsubscribe=function(a,b,c){return this.isDisposed()?!1:this.T.unsubscribe(a,b,c)};S.prototype.Ob=function(a){return this.isDisposed()?!1:this.T.Ob(a)};S.prototype.L=function(a,b){return this.isDisposed()?!1:this.T.L.apply(this.T,arguments)};function mk(a){S.call(this);this.D=a;this.screens=[]}A(mk,S);f=mk.prototype;f.ac=function(){return this.screens};f.contains=function(a){return!!kk(this.screens,a)};f.get=function(a){return a?lk(this.screens,a):null};function nk(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}\nfunction ok(a,b){var c=a.screens.length!=b.length;a.screens=kb(a.screens,function(a){return!!kk(b,a)});for(var d=0,e=b.length;d=rk.length?this.L(\"pairingFailed\",Error(\"DIAL polling timed out\")):(a=rk[this.A],this.o=L(y(this.us,this),a),this.A++):this.L(\"pairingFailed\",Error(\"Server error \"+a.status))};f.JD=function(){this.j=null;this.L(\"pairingFailed\",Error(\"Server not responding\"))};function sk(a,b){this.o=a;this.j=b+\"::\"}A(sk,gj);sk.prototype.set=function(a,b){this.o.set(this.j+a,b)};sk.prototype.get=function(a){return this.o.get(this.j+a)};sk.prototype.remove=function(a){this.o.remove(this.j+a)};sk.prototype.Zb=function(a){var b=this.o.Zb(!0),c=this,d=new Ae;d.next=function(){for(var d=b.next();d.substr(0,c.j.length)!=c.j;)d=b.next();return a?d.substr(c.j.length):c.o.get(d)};return d};function tk(a){var b=new ij;return b.isAvailable()?a?new sk(b,a):b:null};function uk(a){this.j=new Ee;if(a){a=Ke(a);for(var b=a.length,c=0;cc)return!1;!(b instanceof uk)&&5c?\"\":0==c?\";expires=\"+(new Date(1970,1,1)).toUTCString():\";expires=\"+(new Date(z()+1E3*c)).toUTCString();this.j.cookie=a+\"=\"+b+e+d+c+g};\nf.get=function(a,b){for(var c=a+\"=\",d=(this.j.cookie||\"\").split(zk),e=0,g;g=d[e];e++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return\"\"}return b};f.remove=function(a,b,c){var d=n(this.get(a));this.set(a,\"\",0,b,c);return d};f.Qa=function(){return Ak(this).keys};f.Na=function(){return Ak(this).values};f.isEmpty=function(){return!this.j.cookie};f.Ya=function(){return this.j.cookie?(this.j.cookie||\"\").split(zk).length:0};\nf.xf=function(a){for(var b=Ak(this).values,c=0;c \"+b);if(this.j){var c=this.j.A;if(!a||c&&c.id!=a)Al(\"Unsetting old screen status: \"+this.j.o.friendlyName),Si(this.j),this.j=null}if(a&&b){if(!this.j){c=lk(this.o.ac(),a);if(!c){Al(\"setConnectedScreenStatus: Unknown screen.\");return}var d=Bl(this,c);d||(Al(\"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.A.push(d),chrome.cast.setCustomReceivers(this.A,\nv,y(function(a){this.$a(\"Failed to set initial custom receivers: \"+Cg(a))},this)));Al(\"setConnectedScreenStatus: new active receiver: \"+d.friendlyName);Cl(this,new vl(this.o,d),!0)}this.j.Mm(b)}else Al(\"setConnectedScreenStatus: no screen.\")};function Bl(a,b){return b?F(a.A,function(a){return Gi(b,a.label)},a):null}f.XC=function(a){this.isDisposed()?this.$a(\"Setting connection data on disposed cast v2\"):this.j?this.j.Tf(a):this.$a(\"Setting connection data without a session\")};\nf.stopSession=function(){this.isDisposed()?this.$a(\"Stopping session on disposed cast v2\"):this.j?(this.j.stop(),Si(this.j),this.j=null):Al(\"Stopping non-existing session\")};f.requestSession=function(){chrome.cast.requestSession(y(this.Jq,this),y(this.xB,this))};f.P=function(){this.o.unsubscribe(\"onlineScreenChange\",y(this.ys,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.B);Bi(xl);Si(this.j);wl.M.P.call(this)};function Al(a){Ci(\"Controller\",a)}\nf.$a=function(a){Ci(\"Controller\",a)};function xl(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)}function zl(a){return a.C||!!a.A.length||!!a.j}function Cl(a,b,c){Si(a.j);(a.j=b)?(c?a.L(\"yt-remote-cast2-receiver-resumed\",b.o):a.L(\"yt-remote-cast2-receiver-selected\",b.o),b.subscribe(\"sessionScreen\",y(a.Kq,a,b)),b.A?a.L(\"yt-remote-cast2-session-change\",b.A):c&&a.j.Tf(null)):a.L(\"yt-remote-cast2-session-change\",null)}\nf.Kq=function(a,b){this.j==a&&(b||Cl(this,null),this.L(\"yt-remote-cast2-session-change\",b))};\nf.mB=function(a,b){if(!this.isDisposed())if(a)switch(Al(\"onReceiverAction_ \"+a.label+\" \/ \"+a.friendlyName+\"-- \"+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.o.label!=a.label)Al(\"onReceiverAction_: Stopping active receiver: \"+this.j.o.friendlyName),this.j.stop();else{Al(\"onReceiverAction_: Casting to active receiver.\");this.j.A&&this.L(\"yt-remote-cast2-session-change\",this.j.A);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:Cl(this,new vl(this.o,a));break;case chrome.cast.ReceiverType.DIAL:Cl(this,\nnew sl(this.o,a));break;case chrome.cast.ReceiverType.CAST:Cl(this,new ol(this.o,a));break;default:this.$a(\"Unknown receiver type: \"+a.receiverType);return}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.o.label==a.label?this.j.stop():this.$a(\"Stopping receiver w\/o session: \"+a.friendlyName)}else this.$a(\"onReceiverAction_ called without receiver.\")};\nf.pA=function(a){if(this.isDisposed())return Promise.reject(Error(\"disposed\"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.$a(\"Not DIAL receiver: \"+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.o:null;if(!c||c.label!=b.label)return this.$a(\"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.j.A)return Al(\"Reselecting dial screen.\"),\nthis.L(\"yt-remote-cast2-session-change\",this.j.A),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.$a('Changing CAST intent from \"'+c.receiverType+'\" to \"dial\" for '+b.friendlyName);Cl(this,new sl(this.o,b))}b=this.j;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise(y(b.Ny,b,(b.G.extraData||{}).screenId||null)):new Promise(y(b.Tl,b))};\nf.Jq=function(a){if(!this.isDisposed()){Al(\"New cast session ID: \"+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(b.receiverType==chrome.cast.ReceiverType.CAST)Al(\"Got resumed cast session before resumed mdx connection.\"),Cl(this,new ol(this.o,b),!0);else{this.$a(\"Got non-cast session without previous mdx receiver event, or mdx resume.\");return}var c=this.j.o,d=lk(this.o.ac(),c.label);d&&Gi(d,b.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&\nb.receiverType==chrome.cast.ReceiverType.CAST&&(Al(\"onSessionEstablished_: manual to cast session change \"+b.friendlyName),Si(this.j),this.j=new ol(this.o,b),this.j.subscribe(\"sessionScreen\",y(this.Kq,this,this.j)),this.j.Tf(null));this.j.Lm(a)}}};f.ND=function(){return this.j?this.j.zs():null};f.xB=function(a){this.isDisposed()||(this.$a(\"Failed to estabilish a session: \"+Cg(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&Cl(this,null))};\nf.pB=function(a){Al(\"Receiver availability updated: \"+a);if(!this.isDisposed()){var b=zl(this);this.C=a==chrome.cast.ReceiverAvailability.AVAILABLE;zl(this)!=b&&this.L(\"yt-remote-cast2-availability-change\",zl(this))}};\nfunction yl(a){var b=a.o.ws(),c=a.j&&a.j.o;a=E(b,function(a){c&&Gi(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,g=Bl(this,a);g?(g.label=b,g.friendlyName=a.name):(g=new chrome.cast.Receiver(b,a.name),g.receiverType=chrome.cast.ReceiverType.CUSTOM);return g},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}\nf.ys=function(){if(!this.isDisposed()){var a=zl(this);this.A=yl(this);Al(\"Updating custom receivers: \"+Cg(this.A));chrome.cast.setCustomReceivers(this.A,v,y(function(){this.$a(\"Failed to set custom receivers.\")},this));var b=zl(this);b!=a&&this.L(\"yt-remote-cast2-availability-change\",b)}};wl.prototype.setLaunchParams=wl.prototype.XC;wl.prototype.setConnectedScreenStatus=wl.prototype.WC;wl.prototype.stopSession=wl.prototype.stopSession;wl.prototype.getCastSession=wl.prototype.ND;\nwl.prototype.requestSession=wl.prototype.requestSession;wl.prototype.init=wl.prototype.init;wl.prototype.dispose=wl.prototype.dispose;function Dl(a,b,c){El()?Gl(b)&&(Hl(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Il(a,c):(window.__onGCastApiAvailable=function(b,e){b?Il(a,c):(Jl(\"Failed to load cast API: \"+e),Kl(!1),Hl(!1),yj(\"yt-remote-cast-available\"),yj(\"yt-remote-cast-receiver\"),Ll(),c(!1))},mi())):Fl(\"Cannot initialize because not running Chrome\")}function Ll(){Fl(\"dispose\");var a=Ml();a&&a.dispose();Nl=null;q(\"yt.mdx.remote.cloudview.instance_\",null,void 0);Ol(!1);cj(Pl);Pl.length=0}\nfunction Ql(){return!!xj(\"yt-remote-cast-installed\")}function Rl(){var a=xj(\"yt-remote-cast-receiver\");return a?Ha(a.friendlyName):null}function Sl(){return Ql()?Ml()?Nl.getCastSession():(Jl(\"getCastSelector: Cast is not initialized.\"),null):(Jl(\"getCastSelector: Cast API is not installed!\"),null)}\nfunction Tl(){Ql()?Ml()?Ul()?(Fl(\"Requesting cast selector.\"),Nl.requestSession()):(Fl(\"Wait for cast API to be ready to request the session.\"),Pl.push(aj(\"yt-remote-cast2-api-ready\",Tl))):Jl(\"requestCastSelector: Cast is not initialized.\"):Jl(\"requestCastSelector: Cast API is not installed!\")}function Vl(a){Ul()?Ml().setLaunchParams(a):Jl(\"setLaunchParams called before ready.\")}\nfunction Wl(){var a=Xl();Ul()?Ml().setConnectedScreenStatus(a,\"YouTube TV\"):Jl(\"setConnectedScreenStatus called before ready.\")}var Nl=null;function El(){var a;a=0<=$c.search(\/\\ (CrMo|Chrome|CriOS)\\\/\/);return ri||a}function Yl(a,b){Nl.init(a,b)}\nfunction Gl(a){var b=!1;if(!Nl){var c=u(\"yt.mdx.remote.cloudview.instance_\");c||(c=new wl(a),c.subscribe(\"yt-remote-cast2-availability-change\",function(a){vj(\"yt-remote-cast-available\",a);dj(\"yt-remote-cast2-availability-change\",a)}),c.subscribe(\"yt-remote-cast2-receiver-selected\",function(a){Fl(\"onReceiverSelected: \"+a.friendlyName);vj(\"yt-remote-cast-receiver\",a);dj(\"yt-remote-cast2-receiver-selected\",a)}),c.subscribe(\"yt-remote-cast2-receiver-resumed\",function(a){Fl(\"onReceiverResumed: \"+a.friendlyName);\nvj(\"yt-remote-cast-receiver\",a)}),c.subscribe(\"yt-remote-cast2-session-change\",function(a){Fl(\"onSessionChange: \"+Li(a));a||yj(\"yt-remote-cast-receiver\");dj(\"yt-remote-cast2-session-change\",a)}),q(\"yt.mdx.remote.cloudview.instance_\",c,void 0),b=!0);Nl=c}Fl(\"cloudview.createSingleton_: \"+b);return b}function Ml(){Nl||(Nl=u(\"yt.mdx.remote.cloudview.instance_\"));return Nl}\nfunction Il(a,b){Kl(!0);Hl(!1);Yl(a,function(a){a?(Ol(!0),dj(\"yt-remote-cast2-api-ready\")):(Jl(\"Failed to initialize cast API.\"),Kl(!1),yj(\"yt-remote-cast-available\"),yj(\"yt-remote-cast-receiver\"),Ll());b(a)})}function Fl(a){Ci(\"cloudview\",a)}function Jl(a){Ci(\"cloudview\",a)}function Kl(a){Fl(\"setCastInstalled_ \"+a);vj(\"yt-remote-cast-installed\",a)}function Ul(){return!!u(\"yt.mdx.remote.cloudview.apiReady_\")}function Ol(a){Fl(\"setApiReady_ \"+a);q(\"yt.mdx.remote.cloudview.apiReady_\",a,void 0)}\nfunction Hl(a){q(\"yt.mdx.remote.cloudview.initializing_\",a,void 0)}var Pl=[];function Zl(a,b){this.action=a;this.params=b||null};function $l(){if(!(\"cast\"in window))return!1;var a=window.cast||{};return\"ActivityStatus\"in a&&\"Api\"in a&&\"LaunchRequest\"in a&&\"Receiver\"in a}function am(a){Ci(\"CAST\",a)}function bm(a){var b=cm();b&&b.logMessage&&b.logMessage(a)}function dm(a){if(a.event.source==window&&a.event.data&&\"CastApi\"==a.event.data.source&&\"Hello\"==a.event.data.event)for(;em.length;)em.shift()()}\nfunction fm(){if(!u(\"yt.mdx.remote.castv2_\")&&!gm&&(rb(hm)&&zb(hm,Qk()),$l())){var a=cm();a?(a.removeReceiverListener(\"YouTube\",im),a.addReceiverListener(\"YouTube\",im),am(\"API initialized in the other binary\")):(a=new cast.Api,jm(a),a.addReceiverListener(\"YouTube\",im),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){L(function(){window.location.reload(!0)},1E3)}),yi(bm),am(\"API initialized\"));gm=!0}}\nfunction km(){var a=cm();a&&(am(\"API disposed\"),Bi(bm),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(v),a.removeReceiverListener(\"YouTube\",im),jm(null));gm=!1;em=null;(a=Oh(window,\"message\",dm,!1))&&Rh(a)}function lm(a){var b=ob(hm,function(b){return b.id==a.id});0<=b&&(hm[b]={id:a.id,name:a.name,activityId:a.j,status:a.status})}\nfunction im(a){a.length&&am(\"Updating receivers: \"+Cg(a));mm(a);dj(\"yt-remote-cast-device-list-update\");D(nm(),function(a){om(a.id)});D(a,function(a){if(a.isTabProjected){var c=pm(a.id);am(\"Detected device: \"+c.id+\" is tab projected. Firing DEVICE_TAB_PROJECTED event.\");L(function(){dj(\"yt-remote-cast-device-tab-projected\",c.id)},1E3)}})}\nfunction qm(a,b){am(\"Updating \"+a+\" activity status: \"+Cg(b));var c=pm(a);c?(b.activityId&&(c.j=b.activityId),c.status=\"running\"==b.status?\"RUNNING\":\"stopped\"==b.status?\"STOPPED\":\"error\"==b.status?\"ERROR\":\"UNKNOWN\",\"RUNNING\"!=c.status&&(c.j=\"\"),lm(c),dj(\"yt-remote-cast-device-status-update\",c)):am(\"Device not found\")}function nm(){fm();return ik(hm)}function mm(a){a=E(a,function(a){var c={id:a.id,name:Ha(a.name)};if(a=pm(a.id))c.activityId=a.j,c.status=a.status;return c});sb(hm);zb(hm,a)}\nfunction pm(a){var b=nm();return F(b,function(b){return b.id==a})||null}function om(a){var b=pm(a),c=cm();c&&b&&b.j&&c.getActivityStatus(b.j,function(b){\"error\"==b.status&&(b.status=\"stopped\");qm(a,b)})}function rm(a){fm();var b=pm(a),c=cm();c&&b&&b.j?(am(\"Stopping cast activity\"),c.stopActivity(b.j,oa(qm,a))):am(\"Dropping cast activity stop\")}function cm(){return u(\"yt.mdx.remote.castapi.api_\")}function jm(a){q(\"yt.mdx.remote.castapi.api_\",a,void 0)}\nvar gm=!1,em=null,hm=u(\"yt.mdx.remote.castapi.devices_\")||[];q(\"yt.mdx.remote.castapi.devices_\",hm,void 0);function sm(){};function tm(){this.j=z()}new tm;tm.prototype.set=function(a){this.j=a};tm.prototype.reset=function(){this.set(z())};tm.prototype.get=function(){return this.j};function um(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.o=!1;this.sr=!0}um.prototype.stopPropagation=function(){this.o=!0};um.prototype.preventDefault=function(){this.defaultPrevented=!0;this.sr=!1};function vm(a){a.stopPropagation()};var wm=!jd||zd(9),xm=jd&&!yd(\"9\");!ld||yd(\"528\");kd&&yd(\"1.9b\")||jd&&yd(\"8\")||id&&yd(\"9.5\")||ld&&yd(\"528\");kd&&!yd(\"8\")||jd&&yd(\"9\");var ym=\"ontouchstart\"in m||!!(m.document&&document.documentElement&&\"ontouchstart\"in document.documentElement)||!(!m.navigator||!m.navigator.msMaxTouchPoints);function zm(a,b){um.call(this,a?a.type:\"\");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.j=this.state=null;a&&this.init(a,b)}A(zm,um);\nzm.prototype.init=function(a,b){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;d?kd&&(Rg(d,\"nodeName\")||(d=null)):\"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.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(\"keypress\"==c?a.keyCode:\n0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.j=a;a.defaultPrevented&&this.preventDefault()};zm.prototype.stopPropagation=function(){zm.M.stopPropagation.call(this);this.j.stopPropagation?this.j.stopPropagation():this.j.cancelBubble=!0};\nzm.prototype.preventDefault=function(){zm.M.preventDefault.call(this);var a=this.j;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,xm)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};zm.prototype.F=function(){return this.j};var Am=\"closure_listenable_\"+(1E6*Math.random()|0);function Bm(a){return!(!a||!a[Am])}var Cm=0;function Dm(a,b,c,d,e){this.listener=a;this.j=null;this.src=b;this.type=c;this.uf=!!d;this.Vc=e;this.key=++Cm;this.ag=this.ii=!1}function Em(a){a.ag=!0;a.listener=null;a.j=null;a.src=null;a.Vc=null};function Fm(a){this.src=a;this.j={};this.o=0}Fm.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.j[g];a||(a=this.j[g]=[],this.o++);var h=Gm(a,b,d,e);-1c.keyCode||void 0!=c.returnValue)){a:{var g=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(h){g=!0}if(g||void 0==c.returnValue)c.returnValue=!0}c=[];for(g=d.currentTarget;g;g=g.parentNode)c.push(g);for(var g=a.type,k=c.length-1;!d.o&&0<=k;k--){d.currentTarget=c[k];var l=Wm(c[k],g,!0,d),e=e&&l}for(k=0;!d.o&&k>>0);function Nm(a){if(ha(a))return a;a[Ym]||(a[Ym]=function(b){return a.handleEvent(b)});return a[Ym]};function T(){P.call(this);this.yd=new Fm(this);this.Ba=this;this.aa=null}A(T,P);T.prototype[Am]=!0;f=T.prototype;f.Ej=function(a){this.aa=a};f.addEventListener=function(a,b,c,d){Mm(this,a,b,c,d)};f.removeEventListener=function(a,b,c,d){Um(this,a,b,c,d)};\nf.Z=function(a){var b,c=this.aa;if(c){b=[];for(var d=1;c;c=c.aa)b.push(c),++d}c=this.Ba;d=a.type||a;if(x(a))a=new um(a,c);else if(a instanceof um)a.target=a.target||c;else{var e=a;a=new um(d,c);gc(a,e)}var e=!0,g;if(b)for(var h=b.length-1;!a.o&&0<=h;h--)g=a.currentTarget=b[h],e=Zm(g,d,!0,a)&&e;a.o||(g=a.currentTarget=c,e=Zm(g,d,!0,a)&&e,a.o||(e=Zm(g,d,!1,a)&&e));if(b)for(h=0;!a.o&&h=a.j.length)throw Error(\"Out of bounds exception\");return a.j.lengthb)break a}else if(3>b||3==b&&!id&&!no(this.wb))break a;this.Oe||4!=b||7==c||(8==c||0>=d?this.j.Fc(3):this.j.Fc(2));oo(this);var e=this.wb.getStatus();this.Yg=e;var g=no(this.wb);(this.Ic=200==e)?(4==b&&po(this),this.C?(qo(this,b,g),id&&this.Ic&&3==b&&(this.B.O(this.o,\"tick\",this.CC),this.o.start())):ro(this,g),this.Ic&&!this.Oe&&(4==b?this.j.mj(this):(this.Ic=!1,lo(this)))):\n(this.We=400==e&&0b.length)return ho;var e=b.substr(d,c);a.Ih=d+c;return e}\nfunction vo(a,b){a.vh=z();lo(a);var c=b?window.location.hostname:\"\";a.ne=a.Sd.clone();K(a.ne,\"DOMAIN\",c);K(a.ne,\"t\",a.D);try{a.Kc=new ActiveXObject(\"htmlfile\")}catch(d){po(a);a.We=7;so();to(a);return}var e=\"\";if(b){for(var g=\"\",h=0;h\"==k)g=g+\"\\\\x3e\";else{if(k in Oa)k=Oa[k];else if(k in Na)k=Oa[k]=Na[k];else{var l=k,p=k.charCodeAt(0);if(31p)l=k;else{if(256>p){if(l=\"\\\\x\",16>p||256p&&(l+=\n\"0\");l+=p.toString(16).toUpperCase()}k=Oa[k]=l}g+=k}}e+='