Skip to content

Instantly share code, notes, and snippets.

Created June 16, 2014 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/eb40ce481d63efeef19c to your computer and use it in GitHub Desktop.
Save anonymous/eb40ce481d63efeef19c to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
(function () {
var f, aa = aa || {},
m = this;
function n(a) {
return void 0 !== a
}
function ca(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 p(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 da() {}
function ea(a) {
a.getInstance = function () {
return a.bm ? a.bm : a.bm = new a
}
}
function fa(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 ga(a) {
return null != a
}
function ha(a) {
return "array" == fa(a)
}
function ia(a) {
var b = fa(a);
return "array" == b || "object" == b && "number" == typeof a.length
}
function r(a) {
return "string" == typeof a
}
function ja(a) {
return "number" == typeof a
}
function ka(a) {
return "function" == fa(a)
}
function la(a) {
var b = typeof a;
return "object" == b && null != a || "function" == b
}
function ma(a) {
return a[na] || (a[na] = ++oa)
}
var na = "closure_uid_" + (1E9 * Math.random() >>> 0),
oa = 0;
function pa(a, b, c) {
return a.call.apply(a.bind, arguments)
}
function qa(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 t(a, b, c) {
t = Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? pa : qa;
return t.apply(null, arguments)
}
function ra(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)
}
}
function sa(a, b) {
for (var c in b) a[c] = b[c]
}
var v = Date.now || function () {
return +new Date
};
function w(a, b) {
function c() {}
c.prototype = b.prototype;
a.G = b.prototype;
a.prototype = new c;
a.prototype.constructor = a;
a.UE = function (a, c, g) {
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 t.apply(null, c)
}
return t(this, a)
};
function ta(a) {
if (Error.captureStackTrace) Error.captureStackTrace(this, ta);
else {
var b = Error().stack;
b && (this.stack = b)
}
a && (this.message = String(a))
}
w(ta, Error);
ta.prototype.name = "CustomError";
var ua;
function va(a, b) {
var c = a.length - b.length;
return 0 <= c && a.indexOf(b, c) == c
}
function wa(a, b) {
for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1); e.length && 1 < c.length;) d += c.shift() + e.shift();
return d + c.join("%s")
}
function xa(a) {
return /^[\s\xa0]*$/.test(a)
}
function x(a) {
return xa(ya(a))
}
function za(a) {
return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
}
function Aa(a) {
return encodeURIComponent(String(a))
}
function Ba(a) {
return decodeURIComponent(a.replace(/\+/g, " "))
}
function Ca(a) {
if (!Da.test(a)) return a; - 1 != a.indexOf("&") && (a = a.replace(Ea, "&amp;")); - 1 != a.indexOf("<") && (a = a.replace(Fa, "&lt;")); - 1 != a.indexOf(">") && (a = a.replace(Ga, "&gt;")); - 1 != a.indexOf('"') && (a = a.replace(Ha, "&quot;")); - 1 != a.indexOf("'") && (a = a.replace(Ia, "&#39;")); - 1 != a.indexOf("\x00") && (a = a.replace(Ja, "&#0;"));
return a
}
var Ea = /&/g,
Fa = /</g,
Ga = />/g,
Ha = /"/g,
Ia = /'/g,
Ja = /\x00/g,
Da = /[\x00&<>"']/;
function Ka(a) {
return La(a, "&") ? "document" in m ? Ma(a) : Na(a) : a
}
function Ma(a) {
var b = {
"&amp;": "&",
"&lt;": "<",
"&gt;": ">",
"&quot;": '"'
},
c;
c = m.document.createElement("div");
return a.replace(Oa, 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
})
}
function Na(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 Oa = /&([^;\s<&]+);?/g;
function La(a, b) {
return -1 != a.indexOf(b)
}
function Pa(a, b) {
return La(a.toLowerCase(), b.toLowerCase())
}
function Qa(a) {
return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08")
}
function Ra(a, b) {
return Array(b + 1).join(a)
}
function Sa(a) {
a = n(void 0) ? a.toFixed(void 0) : String(a);
var b = a.indexOf("."); - 1 == b && (b = a.length);
return Ra("0", Math.max(0, 2 - b)) + a
}
function ya(a) {
return null == a ? "" : String(a)
}
function Ta(a, b) {
for (var c = 0, d = za(String(a)).split("."), e = za(String(b)).split("."), g = Math.max(d.length, e.length), h = 0; 0 == c && h < g; h++) {
var k = d[h] || "",
l = e[h] || "",
q = RegExp("(\\d*)(\\D*)", "g"),
s = RegExp("(\\d*)(\\D*)", "g");
do {
var u = q.exec(k) || ["", "", ""],
z = s.exec(l) || ["", "", ""];
if (0 == u[0].length && 0 == z[0].length) break;
c = Ua(0 == u[1].length ? 0 : parseInt(u[1], 10), 0 == z[1].length ? 0 : parseInt(z[1], 10)) || Ua(0 == u[2].length, 0 == z[2].length) || Ua(u[2], z[2])
} while (0 == c)
}
return c
}
function Ua(a, b) {
return a < b ? -1 : a > b ? 1 : 0
}
function Va(a) {
for (var b = 0, c = 0; c < a.length; ++c) b = 31 * b + a.charCodeAt(c), b %= 4294967296;
return b
}
var Wa = 2147483648 * Math.random() | 0;
function Xa() {
return "goog_" + Wa++
}
function Ya(a) {
var b = Number(a);
return 0 == b && xa(a) ? NaN : b
}
function Za(a) {
return String(a).replace(/\-([a-z])/g, function (a, c) {
return c.toUpperCase()
})
}
function $a(a) {
var b = r(void 0) ? Qa(void 0) : "\\s";
return a.replace(new RegExp("(^" + (b ? "|[" + b + "]+" : "") + ")([a-z])", "g"), function (a, b, e) {
return b + e.toUpperCase()
})
};
function ab() {};
function bb(a) {
return a[a.length - 1]
}
var cb = Array.prototype,
db = cb.indexOf ? function (a, b, c) {
return cb.indexOf.call(a, b, c)
} : function (a, b, c) {
c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c;
if (r(a)) return r(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
},
eb = cb.lastIndexOf ? function (a, b, c) {
return cb.lastIndexOf.call(a, b, null == c ? a.length - 1 : c)
} : function (a, b, c) {
c = null == c ? a.length - 1 : c;
0 > c && (c = Math.max(0, a.length + c));
if (r(a)) return r(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1;
for (; 0 <= c; c--)
if (c in a && a[c] === b) return c;
return -1
},
y = cb.forEach ? function (a, b, c) {
cb.forEach.call(a, b, c)
} : function (a, b, c) {
for (var d = a.length, e = r(a) ? a.split("") : a, g = 0; g < d; g++) g in e && b.call(c, e[g], g, a)
},
fb = cb.filter ? function (a, b, c) {
return cb.filter.call(a, b, c)
} : function (a, b, c) {
for (var d = a.length, e = [], g = 0, h = r(a) ? a.split("") : a, k = 0; k < d; k++)
if (k in h) {
var l = h[k];
b.call(c, l, k, a) && (e[g++] = l)
}
return e
},
A = cb.map ? function (a, b, c) {
return cb.map.call(a, b, c)
} : function (a, b, c) {
for (var d = a.length, e = Array(d), g = r(a) ? a.split("") : a, h = 0; h < d; h++) h in g && (e[h] = b.call(c,
g[h], h, a));
return e
},
gb = cb.some ? function (a, b, c) {
return cb.some.call(a, b, c)
} : function (a, b, c) {
for (var d = a.length, e = r(a) ? a.split("") : a, g = 0; g < d; g++)
if (g in e && b.call(c, e[g], g, a)) return !0;
return !1
},
hb = cb.every ? function (a, b, c) {
return cb.every.call(a, b, c)
} : function (a, b, c) {
for (var d = a.length, e = r(a) ? a.split("") : a, g = 0; g < d; g++)
if (g in e && !b.call(c, e[g], g, a)) return !1;
return !0
};
function B(a, b, c) {
b = ib(a, b, c);
return 0 > b ? null : r(a) ? a.charAt(b) : a[b]
}
function ib(a, b, c) {
for (var d = a.length, e = r(a) ? a.split("") : a, g = 0; g < d; g++)
if (g in e && b.call(c, e[g], g, a)) return g;
return -1
}
function jb(a, b) {
var c = lb(a, b, void 0);
return 0 > c ? null : r(a) ? a.charAt(c) : a[c]
}
function lb(a, b, c) {
for (var d = r(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 C(a, b) {
return 0 <= db(a, b)
}
function D(a) {
return 0 == a.length
}
function mb(a) {
if (!ha(a))
for (var b = a.length - 1; 0 <= b; b--) delete a[b];
a.length = 0
}
function nb(a, b) {
C(a, b) || a.push(b)
}
function ob(a, b) {
var c = db(a, b),
d;
(d = 0 <= c) && pb(a, c);
return d
}
function pb(a, b) {
cb.splice.call(a, b, 1)
}
function qb(a, b) {
var c = ib(a, b, void 0);
0 <= c && pb(a, c)
}
function rb(a) {
return cb.concat.apply(cb, arguments)
}
function sb(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 tb(a, b) {
for (var c = 1; c < arguments.length; c++) {
var d = arguments[c],
e;
if (ha(d) || (e = ia(d)) && Object.prototype.hasOwnProperty.call(d, "callee")) a.push.apply(a, d);
else if (e)
for (var g = a.length, h = d.length, k = 0; k < h; k++) a[g + k] = d[k];
else a.push(d)
}
}
function ub(a, b, c, d) {
cb.splice.apply(a, vb(arguments, 1))
}
function vb(a, b, c) {
return 2 >= arguments.length ? cb.slice.call(a, b) : cb.slice.call(a, b, c)
}
function wb(a) {
for (var b = {}, c = 0, d = 0; d < a.length;) {
var e = a[d++],
g = la(e) ? "o" + ma(e) : (typeof e).charAt(0) + e;
Object.prototype.hasOwnProperty.call(b, g) || (b[g] = !0, a[c++] = e)
}
a.length = c
}
function xb(a, b, c) {
c = c || yb;
for (var d = 0, e = a.length, g; d < e;) {
var h = d + e >> 1,
k;
k = c(b, a[h]);
0 < k ? d = h + 1 : (e = h, g = !k)
}
return g ? d : ~d
}
function zb(a, b) {
a.sort(b || yb)
}
function Ab(a, b) {
var c = yb;
zb(a, function (a, e) {
return c(a[b], e[b])
})
}
function Bb(a, b, c) {
if (!ia(a) || !ia(b) || a.length != b.length) return !1;
var d = a.length;
c = c || Cb;
for (var e = 0; e < d; e++)
if (!c(a[e], b[e])) return !1;
return !0
}
function yb(a, b) {
return a > b ? 1 : a < b ? -1 : 0
}
function Cb(a, b) {
return a === b
}
function Db(a, b, c) {
c = xb(a, b, c);
0 > c && ub(a, -(c + 1), 0, b)
}
function Eb(a) {
for (var b = [], c = 0; c < arguments.length; c++) {
var d = arguments[c];
ha(d) ? b.push.apply(b, Eb.apply(null, d)) : b.push(d)
}
return b
};
function Fb(a, b, c) {
return Math.min(Math.max(a, b), c)
}
function Gb(a, b, c) {
return a + c * (b - a)
};
function E(a, b) {
this.x = n(a) ? a : 0;
this.y = n(b) ? b : 0
}
f = E.prototype;
f.clone = function () {
return new E(this.x, this.y)
};
function Hb(a, b) {
var c = a.x - b.x,
d = a.y - b.y;
return Math.sqrt(c * c + d * d)
}
function Ib(a, b) {
return new E(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
};
f.scale = function (a, b) {
var c = ja(b) ? b : a;
this.x *= a;
this.y *= c;
return this
};
function G(a, b) {
this.width = a;
this.height = b
}
function Jb(a, b) {
return a == b ? !0 : a && b ? a.width == b.width && a.height == b.height : !1
}
f = G.prototype;
f.clone = function () {
return new G(this.width, this.height)
};
function Kb(a) {
return a.width / a.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
};
f.round = function () {
this.width = Math.round(this.width);
this.height = Math.round(this.height);
return this
};
f.scale = function (a, b) {
var c = ja(b) ? b : a;
this.width *= a;
this.height *= c;
return this
};
function Lb(a, b, c) {
for (var d in a) b.call(c, a[d], d, a)
}
function Mb(a, b, c) {
for (var d in a)
if (b.call(c, a[d], d, a)) return !0;
return !1
}
function Nb(a, b) {
for (var c in a)
if (!b.call(void 0, a[c], c, a)) return !1;
return !0
}
function Ob(a) {
var b = 0,
c;
for (c in a) b++;
return b
}
function Pb(a) {
for (var b in a) return a[b]
}
function Qb(a) {
var b = [],
c = 0,
d;
for (d in a) b[c++] = a[d];
return b
}
function Rb(a) {
var b = [],
c = 0,
d;
for (d in a) b[c++] = d;
return b
}
function Sb(a, b) {
for (var c in a)
if (a[c] == b) return !0;
return !1
}
function Tb(a, b, c) {
for (var d in a)
if (b.call(c, a[d], d, a)) return d
}
function Ub(a) {
var b = Vb;
return (a = Tb(b, a, void 0)) && b[a]
}
function Wb(a) {
for (var b in a) return !1;
return !0
}
function Xb(a) {
for (var b in a) delete a[b]
}
function Yb(a, b) {
return b in a ? a[b] : void 0
}
function Zb(a) {
var b = {},
c;
for (c in a) b[c] = a[c];
return b
}
function $b(a) {
var b = fa(a);
if ("object" == b || "array" == b) {
if (a.clone) return a.clone();
var b = "array" == b ? [] : {},
c;
for (c in a) b[c] = $b(a[c]);
return b
}
return a
}
var ac = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");
function bc(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 g = 0; g < ac.length; g++) c = ac[g], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c])
}
}
function cc(a) {
var b = arguments.length;
if (1 == b && ha(arguments[0])) return cc.apply(null, arguments[0]);
for (var c = {}, d = 0; d < b; d++) c[arguments[d]] = !0;
return c
};
var dc;
t: {
var ec = m.navigator;
if (ec) {
var fc = ec.userAgent;
if (fc) {
dc = fc;
break t
}
}
dc = ""
}
function gc(a) {
return La(dc, a)
};
var hc, ic, jc, kc, lc;
function mc() {
return m.navigator || null
}
var nc = gc("Opera") || gc("OPR"),
oc = gc("Trident") || gc("MSIE"),
pc = gc("Gecko") && !Pa(dc, "WebKit") && !(gc("Trident") || gc("MSIE")),
qc = Pa(dc, "WebKit"),
rc = qc && gc("Mobile"),
sc = mc(),
tc = sc && sc.platform || "";
hc = La(tc, "Mac");
ic = La(tc, "Win");
jc = !!mc() && La(mc().appVersion || "", "X11");
var uc = dc;
kc = !!uc && La(uc, "Android");
lc = !!uc && La(uc, "iPhone");
var vc = !!uc && La(uc, "iPad");
function wc() {
var a = m.document;
return a ? a.documentMode : void 0
}
var xc = function () {
var a = "",
b;
if (nc && m.opera) return a = m.opera.version, ka(a) ? a() : a;
pc ? b = /rv\:([^\);]+)(\)|;)/ : oc ? b = /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/ : qc && (b = /WebKit\/(\S+)/);
b && (a = (a = b.exec(dc)) ? a[1] : "");
return oc && (b = wc(), b > parseFloat(a)) ? String(b) : a
}(),
yc = {};
function zc(a) {
return yc[a] || (yc[a] = 0 <= Ta(xc, a))
}
function Ac(a) {
return oc && Bc >= a
}
var Cc = m.document,
Bc = Cc && oc ? wc() || ("CSS1Compat" == Cc.compatMode ? parseInt(xc, 10) : 5) : void 0;
var Dc = !oc || Ac(9),
Ec = !pc && !oc || oc && Ac(9) || pc && zc("1.9.1"),
Fc = oc && !zc("9"),
Gc = oc || nc || qc;
function Hc(a) {
a = a.className;
return r(a) && a.match(/\S+/g) || []
}
function Ic(a, b) {
for (var c = Hc(a), d = vb(arguments, 1), e = c, g = 0; g < d.length; g++) C(e, d[g]) || e.push(d[g]);
c = c.join(" ");
a.className = c
}
function Jc(a, b) {
var c = Hc(a),
d = vb(arguments, 1),
c = Kc(c, d).join(" ");
a.className = c
}
function Kc(a, b) {
return fb(a, function (a) {
return !C(b, a)
})
}
function Lc(a, b, c) {
c ? Ic(a, b) : Jc(a, b)
};
function Mc(a) {
return a ? new Nc(Oc(a)) : ua || (ua = new Nc)
}
function Pc(a) {
return r(a) ? document.getElementById(a) : a
}
function Qc(a, b) {
var c = b || document;
return c.querySelectorAll && c.querySelector ? c.querySelectorAll("." + a) : Rc("*", a, b)
}
function H(a, b) {
var c = b || document,
d = null;
c.querySelectorAll && c.querySelector ? d = c.querySelector("." + a) : d = Rc("*", a, b)[0];
return d || null
}
function Rc(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 && C(a.split(/\s+/), b) && (d[e++] = h);
d.length = e;
return d
}
return c
}
function Sc(a, b) {
Lb(b, function (b, d) {
"style" == d ? a.style.cssText = b : "class" == d ? a.className = b : "for" == d ? a.htmlFor = b : d in Tc ? a.setAttribute(Tc[d], b) : 0 == d.lastIndexOf("aria-", 0) || 0 == d.lastIndexOf("data-", 0) ? a.setAttribute(d, b) : a[d] = b
})
}
var Tc = {
cellpadding: "cellPadding",
cellspacing: "cellSpacing",
colspan: "colSpan",
frameborder: "frameBorder",
height: "height",
maxlength: "maxLength",
role: "role",
rowspan: "rowSpan",
type: "type",
usemap: "useMap",
valign: "vAlign",
width: "width"
};
function Uc(a) {
a = a.document;
a = Vc(a) ? a.documentElement : a.body;
return new G(a.clientWidth, a.clientHeight)
}
function Wc(a) {
var b = Xc(a);
a = a.parentWindow || a.defaultView;
return oc && zc("10") && a.pageYOffset != b.scrollTop ? new E(b.scrollLeft, b.scrollTop) : new E(a.pageXOffset || b.scrollLeft, a.pageYOffset || b.scrollTop)
}
function Xc(a) {
return !qc && Vc(a) ? a.documentElement : a.body || a.documentElement
}
function Yc(a) {
return a ? a.parentWindow || a.defaultView : window
}
function I(a, b, c) {
return Zc(document, arguments)
}
function Zc(a, b) {
var c = b[0],
d = b[1];
if (!Dc && d && (d.name || d.type)) {
c = ["<", c];
d.name && c.push(' name="', Ca(d.name), '"');
if (d.type) {
c.push(' type="', Ca(d.type), '"');
var e = {};
bc(e, d);
delete e.type;
d = e
}
c.push(">");
c = c.join("")
}
c = a.createElement(c);
d && (r(d) ? c.className = d : ha(d) ? c.className = d.join(" ") : Sc(c, d));
2 < b.length && $c(a, c, b, 2);
return c
}
function $c(a, b, c, d) {
function e(c) {
c && b.appendChild(r(c) ? a.createTextNode(c) : c)
}
for (; d < c.length; d++) {
var g = c[d];
!ia(g) || la(g) && 0 < g.nodeType ? e(g) : y(ad(g) ? sb(g) : g, e)
}
}
function bd(a) {
return document.createElement(a)
}
function cd(a) {
return document.createTextNode(String(a))
}
function Vc(a) {
return "CSS1Compat" == a.compatMode
}
function dd(a, b) {
a.appendChild(b)
}
function ed(a, b) {
$c(Oc(a), a, arguments, 1)
}
function fd(a) {
for (var b; b = a.firstChild;) a.removeChild(b)
}
function gd(a, b, c) {
a.insertBefore(b, a.childNodes[c] || null)
}
function hd(a) {
a && a.parentNode && a.parentNode.removeChild(a)
}
function id(a, b) {
var c = b.parentNode;
c && c.replaceChild(a, b)
}
function jd(a) {
return Ec && void 0 != a.children ? a.children : fb(a.childNodes, function (a) {
return 1 == a.nodeType
})
}
function kd(a) {
return void 0 != a.firstElementChild ? a.firstElementChild : ld(a.firstChild)
}
function ld(a) {
for (; a && 1 != a.nodeType;) a = a.nextSibling;
return a
}
function md(a) {
var b;
if (Gc && !(oc && zc("9") && !zc("10") && m.SVGElement && a instanceof m.SVGElement) && (b = a.parentElement)) return b;
b = a.parentNode;
return la(b) && 1 == b.nodeType ? b : null
}
function nd(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
}
function Oc(a) {
return 9 == a.nodeType ? a : a.ownerDocument || a.document
}
function od(a) {
return a.contentWindow || Yc(a.contentDocument || a.contentWindow.document)
}
function pd(a, b) {
if ("textContent" in a) a.textContent = b;
else if (3 == a.nodeType) a.data = b;
else if (a.firstChild && 3 == a.firstChild.nodeType) {
for (; a.lastChild != a.firstChild;) a.removeChild(a.lastChild);
a.firstChild.data = b
} else {
fd(a);
var c = Oc(a);
a.appendChild(c.createTextNode(String(b)))
}
}
function qd(a, b) {
var c = [];
return rd(a, b, c, !0) ? c[0] : void 0
}
function rd(a, b, c, d) {
if (null != a)
for (a = a.firstChild; a;) {
if (b(a) && (c.push(a), d) || rd(a, b, c, d)) return !0;
a = a.nextSibling
}
return !1
}
var sd = {
SCRIPT: 1,
STYLE: 1,
HEAD: 1,
IFRAME: 1,
OBJECT: 1
},
td = {
IMG: " ",
BR: "\n"
};
function ud(a, b, c) {
if (!(a.nodeName in sd))
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 td) b.push(td[a.nodeName]);
else
for (a = a.firstChild; a;) ud(a, b, c), a = a.nextSibling
}
function ad(a) {
if (a && "number" == typeof a.length) {
if (la(a)) return "function" == typeof a.item || "string" == typeof a.item;
if (ka(a)) return "function" == typeof a.item
}
return !1
}
function vd(a, b, c) {
if (!b && !c) return null;
var d = b ? b.toUpperCase() : null;
return wd(a, function (a) {
return (!d || a.nodeName == d) && (!c || r(a.className) && C(a.className.split(/\s+/), c))
}, !0)
}
function xd(a, b) {
return vd(a, null, b)
}
function wd(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 Nc(a) {
this.b = a || m.document || document
}
f = Nc.prototype;
f.K = function (a) {
return r(a) ? this.b.getElementById(a) : a
};
f.GB = function (a, b, c) {
return Zc(this.b, arguments)
};
f.createElement = function (a) {
return this.b.createElement(a)
};
function yd(a) {
return Vc(a.b)
}
function zd(a) {
a = a.b;
return a.parentWindow || a.defaultView
}
function Ad(a) {
return Wc(a.b)
}
f.appendChild = dd;
f.append = ed;
f.contains = nd;
var Bd = window.yt && window.yt.config_ || {};
ca("yt.config_", Bd, void 0);
ca("yt.tokens_", window.yt && window.yt.tokens_ || {}, void 0);
var Cd = window.yt && window.yt.msgs_ || {};
ca("yt.msgs_", Cd, void 0);
function Dd(a) {
Ed(Bd, arguments)
}
function Fd(a) {
return a in Bd ? Bd[a] : void 0
}
function J(a, b) {
ka(a) && (a = Gd(a));
return window.setTimeout(a, b)
}
function Hd(a, b) {
ka(a) && (a = Gd(a));
return window.setInterval(a, b)
}
function K(a) {
window.clearTimeout(a)
}
function Id(a) {
window.clearInterval(a)
}
function Gd(a) {
return a && window.yterr ? function () {
try {
return a.apply(this, arguments)
} catch (b) {
throw Jd(b), b;
}
} : a
}
function Jd(a) {
if (window && window.yterr) {
var b = p("yt.www.errors.log");
b ? b(a, void 0) : (b = Fd("ERRORS") || [], b.push([a, void 0]), Dd("ERRORS", b))
}
}
function Kd(a) {
Ed(Cd, arguments)
}
function Ld(a, b, c) {
var d = b || {};
if (a = a in Cd ? Cd[a] : c)
for (var e in d) a = a.replace(new RegExp("\\$" + e, "gi"), function () {
return d[e]
});
return a
}
function Ed(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 Md = {},
Nd = 0,
Od = ["://secure-...imrworldwide.com/", "www.google.com/pagead/sul", "www.youtube.com/gen_204\\?a=sul"],
Pd = p("yt.net.ping.workerUrl_") || null;
ca("yt.net.ping.workerUrl_", Pd, void 0);
function Qd(a, b, c) {
a && (c ? a && (a = I("iframe", {
src: 'javascript:"data:text/html,<body><img src=\\"' + a + '\\"></body>"',
style: "display:none"
}), Oc(a).body.appendChild(a)) : Rd(a, b))
}
function Sd(a) {
return x(a) ? !1 : null != B(Od, function (b) {
return null != a.match(b)
})
}
function Rd(a, b) {
var c = new Image,
d = "" + Nd++;
Md[d] = c;
c.onload = c.onerror = function () {
b && Md[d] && b();
delete Md[d]
};
c.src = a;
c = eval("null")
};
function Td(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 Ud(a) {
return eval("(" + a + ")")
}
function Vd(a) {
return Wd(new Xd(void 0), a)
}
function Xd(a) {
this.b = a
}
function Wd(a, b) {
var c = [];
Yd(a, b, c);
return c.join("")
}
function Yd(a, b, c) {
switch (typeof b) {
case "string":
Zd(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 (ha(b)) {
var d = b.length;
c.push("[");
for (var e = "", g = 0; g < d; g++) c.push(e), e = b[g], Yd(a, a.b ? a.b.call(b, String(g), e) : e, c), e = ",";
c.push("]");
break
}
c.push("{");
d = "";
for (g in b) Object.prototype.hasOwnProperty.call(b, g) && (e = b[g], "function" != typeof e && (c.push(d), Zd(g, c),
c.push(":"), Yd(a, a.b ? a.b.call(b, g, e) : e, c), d = ","));
c.push("}");
break;
case "function":
break;
default:
throw Error("Unknown type: " + typeof b);
}
}
var $d = {
'"': '\\"',
"\\": "\\\\",
"/": "\\/",
"\b": "\\b",
"\f": "\\f",
"\n": "\\n",
"\r": "\\r",
"\t": "\\t",
"\x0B": "\\u000b"
},
ae = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g;
function Zd(a, b) {
b.push('"', a.replace(ae, function (a) {
if (a in $d) return $d[a];
var b = a.charCodeAt(0),
e = "\\u";
16 > b ? e += "000" : 256 > b ? e += "00" : 4096 > b && (e += "0");
return $d[a] = e + b.toString(16)
}), '"')
};
function be(a, b, c, d) {
this.top = a;
this.right = b;
this.bottom = c;
this.left = d
}
f = be.prototype;
f.clone = function () {
return new be(this.top, this.right, this.bottom, this.left)
};
f.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
};
f.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
};
f.scale = function (a, b) {
var c = ja(b) ? b : a;
this.left *= a;
this.right *= a;
this.top *= c;
this.bottom *= c;
return this
};
function ce(a, b, c, d) {
this.left = a;
this.top = b;
this.width = c;
this.height = d
}
f = ce.prototype;
f.clone = function () {
return new ce(this.left, this.top, this.width, this.height)
};
function de(a) {
return new ce(a.left, a.top, a.right - a.left, a.bottom - a.top)
}
function ee(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
}
f.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
};
function fe(a) {
return new G(a.width, a.height)
}
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
};
f.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 = ja(b) ? b : a;
this.left *= a;
this.width *= a;
this.top *= c;
this.height *= c;
return this
};
function ge(a) {
ge[" "](a);
return a
}
ge[" "] = da;
function he() {
return qc ? "Webkit" : pc ? "Moz" : oc ? "ms" : nc ? "O" : null
}
function ie() {
return qc ? "-webkit" : pc ? "-moz" : oc ? "-ms" : nc ? "-o" : null
};
function je(a, b, c) {
r(b) ? ke(a, c, b) : Lb(b, ra(ke, a))
}
function ke(a, b, c) {
(c = le(a, c)) && (a.style[c] = b)
}
function le(a, b) {
var c = Za(b);
if (void 0 === a.style[c]) {
var d = he() + $a(c);
if (void 0 !== a.style[d]) return d
}
return c
}
function me(a, b) {
var c = Oc(a);
return c.defaultView && c.defaultView.getComputedStyle && (c = c.defaultView.getComputedStyle(a, null)) ? c[b] || c.getPropertyValue(b) || "" : ""
}
function ne(a, b) {
return me(a, b) || (a.currentStyle ? a.currentStyle[b] : null) || a.style && a.style[b]
}
function oe(a, b, c) {
var d, e = pc && (hc || jc) && zc("1.9");
b instanceof E ? (d = b.x, b = b.y) : (d = b, b = c);
a.style.left = pe(d, e);
a.style.top = pe(b, e)
}
function qe(a) {
return new E(a.offsetLeft, a.offsetTop)
}
function re(a) {
var b;
try {
b = a.getBoundingClientRect()
} catch (c) {
return {
left: 0,
top: 0,
right: 0,
bottom: 0
}
}
oc && 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 se(a) {
if (oc && !Ac(8)) return a.offsetParent;
var b = Oc(a),
c = ne(a, "position"),
d = "fixed" == c || "absolute" == c;
for (a = a.parentNode; a && a != b; a = a.parentNode)
if (c = ne(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 te(a) {
for (var b = new be(0, Infinity, Infinity, 0), c = Mc(a), d = c.b.body, e = c.b.documentElement, g = Xc(c.b); a = se(a);)
if (!(oc && 0 == a.clientWidth || qc && 0 == a.clientHeight && a == d) && a != d && a != e && "visible" != ne(a, "overflow")) {
var h = ue(a),
k;
k = a;
if (pc && !zc("1.9")) {
var l = parseFloat(me(k, "borderLeftWidth"));
if (ve(k)) var q = k.offsetWidth - k.clientWidth - l - parseFloat(me(k, "borderRightWidth")),
l = l + q;
k = new E(l, parseFloat(me(k, "borderTopWidth")))
} else k = new E(k.clientLeft, k.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);
c = Uc(zd(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 ue(a) {
var b, c = Oc(a),
d = ne(a, "position"),
e = pc && c.getBoxObjectFor && !a.getBoundingClientRect && "absolute" == d && (b = c.getBoxObjectFor(a)) && (0 > b.screenX || 0 > b.screenY),
g = new E(0, 0),
h;
b = c ? Oc(c) : document;
h = !oc || Ac(9) || yd(Mc(b)) ? b.documentElement : b.body;
if (a == h) return g;
if (a.getBoundingClientRect) b = re(a), a = Ad(Mc(c)), g.x = b.left + a.x, g.y = b.top + a.y;
else if (c.getBoxObjectFor && !e) b = c.getBoxObjectFor(a), a = c.getBoxObjectFor(h), g.x = b.screenX - a.screenX, g.y = b.screenY - a.screenY;
else {
b = a;
do {
g.x += b.offsetLeft;
g.y +=
b.offsetTop;
b != a && (g.x += b.clientLeft || 0, g.y += b.clientTop || 0);
if (qc && "fixed" == ne(b, "position")) {
g.x += c.body.scrollLeft;
g.y += c.body.scrollTop;
break
}
b = b.offsetParent
} while (b && b != a);
if (nc || qc && "absolute" == d) g.y -= c.body.offsetTop;
for (b = a;
(b = se(b)) && b != c.body && b != h;) g.x -= b.scrollLeft, nc && "TR" == b.tagName || (g.y -= b.scrollTop)
}
return g
}
function we(a) {
var b;
if (a.getBoundingClientRect) b = re(a), b = new E(b.left, b.top);
else {
b = Ad(Mc(a));
var c = ue(a);
b = new E(c.x - b.x, c.y - b.y)
} if (pc && !zc(12)) {
i: {
c = Za("transform");
if (void 0 === a.style[c] && (c = he() + $a(c), void 0 !== a.style[c])) {
c = ie() + "-transform";
break i
}
c = "transform"
}
a = (a = ne(a, c) || ne(a, "transform")) ? (a = a.match(xe)) ? new E(parseFloat(a[1]), parseFloat(a[2])) : new E(0, 0) : new E(0, 0);
a = new E(b.x + a.x, b.y + a.y)
} else a = b;
return a
}
function ye(a) {
if (1 == a.nodeType) return we(a);
var b = ka(a.dC),
c = a;
a.targetTouches ? c = a.targetTouches[0] : b && a.b.targetTouches && (c = a.b.targetTouches[0]);
return new E(c.clientX, c.clientY)
}
function ze(a, b, c) {
if (b instanceof G) c = b.height, b = b.width;
else if (void 0 == c) throw Error("missing height argument");
Ae(a, b);
a.style.height = pe(c, !0)
}
function pe(a, b) {
"number" == typeof a && (a = (b ? Math.round(a) : a) + "px");
return a
}
function Ae(a, b) {
a.style.width = pe(b, !0)
}
function Be(a) {
return Ce(a)
}
function Ce(a) {
var b = De;
if ("none" != ne(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 De(a) {
var b = a.offsetWidth,
c = a.offsetHeight,
d = qc && !b && !c;
return n(b) && !d || !a.getBoundingClientRect ? new G(b, c) : (a = re(a), new G(a.right - a.left, a.bottom - a.top))
}
function Ee(a) {
var b = ue(a);
a = Ce(a);
return new ce(b.x, b.y, a.width, a.height)
}
function Fe(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 Ge(a, b) {
a.style.display = b ? "" : "none"
}
function ve(a) {
return "rtl" == ne(a, "direction")
}
function He(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 Ie(a, b) {
var c = a.currentStyle ? a.currentStyle[b] : null;
return c ? He(a, c) : 0
}
var Je = {
thin: 2,
medium: 4,
thick: 6
};
function Ke(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 Je ? Je[c] : He(a, c)
}
function Le(a) {
if (oc && !Ac(9)) {
var b = Ke(a, "borderLeft"),
c = Ke(a, "borderRight"),
d = Ke(a, "borderTop");
a = Ke(a, "borderBottom");
return new be(d, c, a, b)
}
b = me(a, "borderLeftWidth");
c = me(a, "borderRightWidth");
d = me(a, "borderTopWidth");
a = me(a, "borderBottomWidth");
return new be(parseFloat(d), parseFloat(c), parseFloat(a), parseFloat(b))
}
var Me = /[^\d]+$/,
Ne = {
cm: 1,
"in": 1,
mm: 1,
pc: 1,
pt: 1
},
Oe = {
em: 1,
ex: 1
};
function Pe(a) {
var b = ne(a, "fontSize"),
c;
c = (c = b.match(Me)) && c[0] || null;
if (b && "px" == c) return parseInt(b, 10);
if (oc) {
if (c in Ne) return He(a, b);
if (a.parentNode && 1 == a.parentNode.nodeType && c in Oe) return a = a.parentNode, c = ne(a, "fontSize"), He(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;
hd(c);
return b
}
var xe = /matrix\([0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, [0-9\.\-]+, ([0-9\.\-]+)p?x?, ([0-9\.\-]+)p?x?\)/;
var Qe = "StopIteration" in m ? m.StopIteration : Error("StopIteration");
function Re() {}
Re.prototype.next = function () {
throw Qe;
};
Re.prototype.$b = function () {
return this
};
function Se(a) {
if (a instanceof Re) return a;
if ("function" == typeof a.$b) return a.$b(!1);
if (ia(a)) {
var b = 0,
c = new Re;
c.next = function () {
for (;;) {
if (b >= a.length) throw Qe;
if (b in a) return a[b++];
b++
}
};
return c
}
throw Error("Not implemented");
}
function Te(a, b, c) {
if (ia(a)) try {
y(a, b, c)
} catch (d) {
if (d !== Qe) throw d;
} else {
a = Se(a);
try {
for (;;) b.call(c, a.next(), void 0, a)
} catch (e) {
if (e !== Qe) throw e;
}
}
}
function Ue(a) {
if (ia(a)) return sb(a);
a = Se(a);
var b = [];
Te(a, function (a) {
b.push(a)
});
return b
};
function Ve(a, b) {
this.g = {};
this.b = [];
this.j = this.da = 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 Ve ? (c = a.Xa(), d = a.Ta()) : (c = Rb(a), d = Qb(a));
for (var e = 0; e < c.length; e++) this.set(c[e], d[e])
}
}
f = Ve.prototype;
f.Oa = function () {
return this.da
};
f.Ta = function () {
We(this);
for (var a = [], b = 0; b < this.b.length; b++) a.push(this.g[this.b[b]]);
return a
};
f.Xa = function () {
We(this);
return this.b.concat()
};
f.$f = function (a) {
for (var b = 0; b < this.b.length; b++) {
var c = this.b[b];
if (Xe(this.g, c) && this.g[c] == a) return !0
}
return !1
};
f.equals = function (a, b) {
if (this === a) return !0;
if (this.da != a.Oa()) return !1;
var c = b || Ye;
We(this);
for (var d, e = 0; d = this.b[e]; e++)
if (!c(this.get(d), a.get(d))) return !1;
return !0
};
function Ye(a, b) {
return a === b
}
f.isEmpty = function () {
return 0 == this.da
};
f.clear = function () {
this.g = {};
this.j = this.da = this.b.length = 0
};
f.remove = function (a) {
return Xe(this.g, a) ? (delete this.g[a], this.da--, this.j++, this.b.length > 2 * this.da && We(this), !0) : !1
};
function We(a) {
if (a.da != a.b.length) {
for (var b = 0, c = 0; b < a.b.length;) {
var d = a.b[b];
Xe(a.g, d) && (a.b[c++] = d);
b++
}
a.b.length = c
}
if (a.da != a.b.length) {
for (var e = {}, c = b = 0; b < a.b.length;) d = a.b[b], Xe(e, d) || (a.b[c++] = d, e[d] = 1), b++;
a.b.length = c
}
}
f.get = function (a, b) {
return Xe(this.g, a) ? this.g[a] : b
};
f.set = function (a, b) {
Xe(this.g, a) || (this.da++, this.b.push(a), this.j++);
this.g[a] = b
};
f.forEach = function (a, b) {
for (var c = this.Xa(), d = 0; d < c.length; d++) {
var e = c[d],
g = this.get(e);
a.call(b, g, e, this)
}
};
f.clone = function () {
return new Ve(this)
};
f.$b = function (a) {
We(this);
var b = 0,
c = this.b,
d = this.g,
e = this.j,
g = this,
h = new Re;
h.next = function () {
for (;;) {
if (e != g.j) throw Error("The map has changed since the iterator was created");
if (b >= c.length) throw Qe;
var h = c[b++];
return a ? h : d[h]
}
};
return h
};
function Xe(a, b) {
return Object.prototype.hasOwnProperty.call(a, b)
};
function Ze(a) {
return "function" == typeof a.Oa ? a.Oa() : ia(a) || r(a) ? a.length : Ob(a)
}
function $e(a) {
if ("function" == typeof a.Ta) return a.Ta();
if (r(a)) return a.split("");
if (ia(a)) {
for (var b = [], c = a.length, d = 0; d < c; d++) b.push(a[d]);
return b
}
return Qb(a)
}
function af(a) {
if ("function" == typeof a.Xa) return a.Xa();
if ("function" != typeof a.Ta) {
if (ia(a) || r(a)) {
var b = [];
a = a.length;
for (var c = 0; c < a; c++) b.push(c);
return b
}
return Rb(a)
}
}
function bf(a, b) {
if ("function" == typeof a.forEach) a.forEach(b, void 0);
else if (ia(a) || r(a)) y(a, b, void 0);
else
for (var c = af(a), d = $e(a), e = d.length, g = 0; g < e; g++) b.call(void 0, d[g], c && c[g], a)
}
function cf(a, b, c) {
if ("function" == typeof a.every) return a.every(b, c);
if (ia(a) || r(a)) return hb(a, b, c);
for (var d = af(a), e = $e(a), g = e.length, h = 0; h < g; h++)
if (!b.call(c, e[h], d && d[h], a)) return !1;
return !0
};
function df(a, b, c, d, e, g, h) {
var k = "";
a && (k += a + ":");
c && (k += "//", b && (k += b + "@"), k += c, d && (k += ":" + d));
e && (k += e);
g && (k += "?" + g);
h && (k += "#" + h);
return k
}
var ef = RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$");
function ff(a) {
if (gf) {
gf = !1;
var b = m.location;
if (b) {
var c = b.href;
if (c && (c = hf(c)) && c != b.hostname) throw gf = !0, Error();
}
}
return a.match(ef)
}
var gf = qc;
function hf(a) {
return (a = ff(a)[3] || null) && decodeURIComponent(a)
}
function jf(a) {
return (a = ff(a)[5] || null) && decodeURIComponent(a)
}
function kf(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 lf(a, b, c) {
if (ha(b))
for (var d = 0; d < b.length; d++) lf(a, String(b[d]), c);
else null != b && c.push("&", a, "" === b ? "" : "=", Aa(b))
}
function mf(a, b, c) {
Math.max(b.length - (c || 0), 0);
for (c = c || 0; c < b.length; c += 2) lf(b[c], b[c + 1], a);
return a
}
function nf(a, b) {
for (var c in b) lf(c, b[c], a);
return a
}
function of(a) {
a = nf([], a);
a[0] = "";
return a.join("")
}
function pf(a, b) {
return kf(2 == arguments.length ? mf([a], arguments[1], 0) : mf([a], arguments, 1))
}
function qf(a, b) {
return kf(nf([a], b))
}
function rf(a, b, c, d) {
for (var e = c.length; 0 <= (b = a.indexOf(c, b)) && b < d;) {
var g = a.charCodeAt(b - 1);
if (38 == g || 63 == g)
if (g = a.charCodeAt(b + e), !g || 61 == g || 38 == g || 35 == g) return b;
b += e + 1
}
return -1
}
var sf = /#|$/,
tf = /[?&]($|#)/;
function uf(a, b, c) {
for (var d = a.search(sf), e = 0, g, h = []; 0 <= (g = rf(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(tf, "$1"), "&", b];
null != c && a.push("=", Aa(c));
return kf(a)
};
function M(a, b) {
var c;
a instanceof M ? (this.jf = n(b) ? b : a.jf, vf(this, a.Mb), this.hf = a.hf, wf(this, a.Gb), xf(this, a.gf), yf(this, a.Qb), zf(this, a.b.clone()), Af(this, a.Ag())) : a && (c = ff(String(a))) ? (this.jf = !!b, vf(this, c[1] || "", !0), this.hf = Bf(c[2] || ""), wf(this, c[3] || "", !0), xf(this, c[4]), yf(this, c[5] || "", !0), zf(this, c[6] || "", !0), Af(this, c[7] || "", !0)) : (this.jf = !!b, this.b = new Cf(null, 0, this.jf))
}
f = M.prototype;
f.Mb = "";
f.hf = "";
f.Gb = "";
f.gf = null;
f.Qb = "";
f.rn = "";
f.jf = !1;
f.toString = function () {
var a = [],
b = this.Mb;
b && a.push(Df(b, Ef), ":");
if (b = this.Gb) {
a.push("//");
var c = this.hf;
c && a.push(Df(c, Ef), "@");
a.push(Aa(b));
b = this.gf;
null != b && a.push(":", String(b))
}
if (b = this.Qb) this.Gb && "/" != b.charAt(0) && a.push("/"), a.push(Df(b, "/" == b.charAt(0) ? Ff : Gf));
(b = this.b.toString()) && a.push("?", b);
(b = this.Ag()) && a.push("#", Df(b, Hf));
return a.join("")
};
f.resolve = function (a) {
var b = this.clone(),
c = !!a.Mb;
c ? vf(b, a.Mb) : c = !!a.hf;
c ? b.hf = a.hf : c = !!a.Gb;
c ? wf(b, a.Gb) : c = null != a.gf;
var d = a.Qb;
if (c) xf(b, a.gf);
else if (c = !!a.Qb) {
if ("/" != d.charAt(0))
if (this.Gb && !this.Qb) d = "/" + d;
else {
var e = b.Qb.lastIndexOf("/"); - 1 != e && (d = b.Qb.substr(0, e + 1) + d)
}
e = d;
if (".." == e || "." == e) d = "";
else if (La(e, "./") || La(e, "/.")) {
for (var d = 0 == e.lastIndexOf("/", 0), e = e.split("/"), g = [], h = 0; h < e.length;) {
var k = e[h++];
"." == k ? d && h == e.length && g.push("") : ".." == k ? ((1 < g.length || 1 == g.length && "" != g[0]) &&
g.pop(), d && h == e.length && g.push("")) : (g.push(k), d = !0)
}
d = g.join("/")
} else d = e
}
c ? yf(b, d) : c = "" !== a.b.toString();
c ? zf(b, Bf(a.b.toString())) : c = !!a.rn;
c && Af(b, a.Ag());
return b
};
f.clone = function () {
return new M(this)
};
function vf(a, b, c) {
a.Mb = c ? Bf(b) : b;
a.Mb && (a.Mb = a.Mb.replace(/:$/, ""));
return a
}
function If(a) {
return a.Gb
}
function wf(a, b, c) {
a.Gb = c ? Bf(b) : b;
return a
}
function xf(a, b) {
if (b) {
b = Number(b);
if (isNaN(b) || 0 > b) throw Error("Bad port number " + b);
a.gf = b
} else a.gf = null;
return a
}
function Jf(a) {
return a.Qb
}
function yf(a, b, c) {
a.Qb = c ? Bf(b) : b
}
function zf(a, b, c) {
b instanceof Cf ? (a.b = b, Kf(a.b, a.jf)) : (c || (b = Df(b, Lf)), a.b = new Cf(b, 0, a.jf));
return a
}
function Mf(a) {
return a.b
}
function N(a, b, c) {
a.b.set(b, c);
return a
}
function Nf(a, b, c) {
ha(c) || (c = [String(c)]);
Of(a.b, b, c)
}
function Pf(a, b) {
return a.b.get(b)
}
f.Ag = function () {
return this.rn
};
function Af(a, b, c) {
a.rn = c ? Bf(b) : b;
return a
}
function Qf(a) {
N(a, "zx", Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ v()).toString(36));
return a
}
function Rf(a) {
return a instanceof M ? a.clone() : new M(a, void 0)
}
function Sf(a, b, c, d) {
var e = new M(null, void 0);
a && vf(e, a);
b && wf(e, b);
c && xf(e, c);
d && yf(e, d);
return e
}
function Bf(a) {
return a ? decodeURIComponent(a) : ""
}
function Df(a, b) {
return r(a) ? encodeURI(a).replace(b, Uf) : null
}
function Uf(a) {
a = a.charCodeAt(0);
return "%" + (a >> 4 & 15).toString(16) + (a & 15).toString(16)
}
var Ef = /[#\/\?@]/g,
Gf = /[\#\?:]/g,
Ff = /[\#\?]/g,
Lf = /[\#\?@]/g,
Hf = /#/g;
function Cf(a, b, c) {
this.b = a || null;
this.g = !!c
}
function Vf(a) {
if (!a.bb && (a.bb = new Ve, a.da = 0, a.b))
for (var b = a.b.split("&"), c = 0; c < b.length; c++) {
var d = b[c].indexOf("="),
e = null,
g = null;
0 <= d ? (e = b[c].substring(0, d), g = b[c].substring(d + 1)) : e = b[c];
e = Ba(e);
e = Wf(a, e);
a.add(e, g ? Ba(g) : "")
}
}
f = Cf.prototype;
f.bb = null;
f.da = null;
f.Oa = function () {
Vf(this);
return this.da
};
f.add = function (a, b) {
Vf(this);
this.b = null;
a = Wf(this, a);
var c = this.bb.get(a);
c || this.bb.set(a, c = []);
c.push(b);
this.da++;
return this
};
f.remove = function (a) {
Vf(this);
a = Wf(this, a);
return Xe(this.bb.g, a) ? (this.b = null, this.da -= this.bb.get(a).length, this.bb.remove(a)) : !1
};
f.clear = function () {
this.bb = this.b = null;
this.da = 0
};
f.isEmpty = function () {
Vf(this);
return 0 == this.da
};
function Xf(a, b) {
Vf(a);
b = Wf(a, b);
return Xe(a.bb.g, b)
}
f.$f = function (a) {
var b = this.Ta();
return C(b, a)
};
f.Xa = function () {
Vf(this);
for (var a = this.bb.Ta(), b = this.bb.Xa(), c = [], d = 0; d < b.length; d++)
for (var e = a[d], g = 0; g < e.length; g++) c.push(b[d]);
return c
};
f.Ta = function (a) {
Vf(this);
var b = [];
if (r(a)) Xf(this, a) && (b = rb(b, this.bb.get(Wf(this, a))));
else {
a = this.bb.Ta();
for (var c = 0; c < a.length; c++) b = rb(b, a[c])
}
return b
};
f.set = function (a, b) {
Vf(this);
this.b = null;
a = Wf(this, a);
Xf(this, a) && (this.da -= this.bb.get(a).length);
this.bb.set(a, [b]);
this.da++;
return this
};
f.get = function (a, b) {
var c = a ? this.Ta(a) : [];
return 0 < c.length ? String(c[0]) : b
};
function Of(a, b, c) {
a.remove(b);
0 < c.length && (a.b = null, a.bb.set(Wf(a, b), sb(c)), a.da += c.length)
}
f.toString = function () {
if (this.b) return this.b;
if (!this.bb) return "";
for (var a = [], b = this.bb.Xa(), c = 0; c < b.length; c++)
for (var d = b[c], e = Aa(d), d = this.Ta(d), g = 0; g < d.length; g++) {
var h = e;
"" !== d[g] && (h += "=" + Aa(d[g]));
a.push(h)
}
return this.b = a.join("&")
};
f.clone = function () {
var a = new Cf;
a.b = this.b;
this.bb && (a.bb = this.bb.clone(), a.da = this.da);
return a
};
function Wf(a, b) {
var c = String(b);
a.g && (c = c.toLowerCase());
return c
}
function Kf(a, b) {
b && !a.g && (Vf(a), a.b = null, a.bb.forEach(function (a, b) {
var e = b.toLowerCase();
b != e && (this.remove(b), Of(this, e, a))
}, a));
a.g = b
};
function Yf(a) {
if (a.classList) return a.classList;
a = a.className;
return r(a) && a.match(/\S+/g) || []
}
function Zf(a, b) {
return a.classList ? a.classList.contains(b) : C(Yf(a), b)
}
function O(a, b) {
a.classList ? a.classList.add(b) : Zf(a, b) || (a.className += 0 < a.className.length ? " " + b : b)
}
function $f(a, b) {
if (a.classList) y(b, function (b) {
O(a, b)
});
else {
var c = {};
y(Yf(a), function (a) {
c[a] = !0
});
y(b, function (a) {
c[a] = !0
});
a.className = "";
for (var d in c) a.className += 0 < a.className.length ? " " + d : d
}
}
function P(a, b) {
a.classList ? a.classList.remove(b) : Zf(a, b) && (a.className = fb(Yf(a), function (a) {
return a != b
}).join(" "))
}
function ag(a, b) {
a.classList ? y(b, function (b) {
P(a, b)
}) : a.className = fb(Yf(a), function (a) {
return !C(b, a)
}).join(" ")
}
function Q(a, b, c) {
c ? O(a, b) : P(a, b)
}
function bg(a, b) {
var c = !Zf(a, b);
Q(a, b, c);
return c
};
function cg(a, b, c) {
a && (a.dataset ? a.dataset[dg(b)] = c : a.setAttribute("data-" + b, c))
}
function eg(a, b) {
return a ? a.dataset ? a.dataset[dg(b)] : a.getAttribute("data-" + b) : null
}
function fg(a, b) {
a && (a.dataset ? delete a.dataset[dg(b)] : a.removeAttribute("data-" + b))
}
var gg = {};
function dg(a) {
return gg[a] || (gg[a] = String(a).replace(/\-([a-z])/g, function (a, c) {
return c.toUpperCase()
}))
};
function hg(a) {
var b = a.__yt_uid_key;
b || (b = ig(), a.__yt_uid_key = b);
return b
}
var ig = p("yt.dom.getNextId_");
if (!ig) {
ig = function () {
return ++jg
};
ca("yt.dom.getNextId_", ig, void 0);
var jg = 0
}
function kg(a, b) {
var c = Rc(a, null, b);
return c.length ? c[0] : null
}
function lg(a, b) {
if (a in b) return b[a];
var c = a.charAt(0).toUpperCase() + a.substr(1);
if ("moz" + c in b) return b["moz" + c];
if ("ms" + c in b) return b["ms" + c];
if ("o" + c in b) return b["o" + c];
if ("webkit" + c in b) return b["webkit" + c]
}
function mg(a, b) {
var c;
gb(a, function (a) {
c = lg(a, b);
return !!c
});
return c
}
function ng(a) {
Q(document.body, "hide-players", !0);
a && Q(a, "preserve-players", !0)
}
function og() {
Q(document.body, "hide-players", !1);
var a = Qc("preserve-players");
y(a, function (a) {
P(a, "preserve-players")
})
};
function pg(a) {
if (a = a || window.event) {
for (var b in a) b in qg || (this[b] = a[b]);
this.scale = a.scale;
this.rotation = a.rotation;
this.od = a;
(b = a.target || a.srcElement) && 3 == b.nodeType && (b = b.parentNode);
this.target = b;
if (b = a.relatedTarget) try {
b = b.nodeName && b
} 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);
this.b = a.pageX;
this.g = a.pageY
}
}
function rg(a) {
if (document.body && document.documentElement) {
var b = document.body.scrollTop + document.documentElement.scrollTop;
a.b = a.clientX + (document.body.scrollLeft + document.documentElement.scrollLeft);
a.g = a.clientY + b
}
}
function sg(a) {
n(a.b) || rg(a);
return a.b
}
function tg(a) {
n(a.g) || rg(a);
return a.g
}
f = pg.prototype;
f.od = null;
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.od.returnValue = !1;
this.od.preventDefault && this.od.preventDefault()
};
f.stopPropagation = function () {
this.od.cancelBubble = !0;
this.od.stopPropagation && this.od.stopPropagation()
};
f.stopImmediatePropagation = function () {
this.od.cancelBubble = !0;
this.od.stopImmediatePropagation && this.od.stopImmediatePropagation()
};
var qg = {
stopImmediatePropagation: 1,
stopPropagation: 1,
preventMouseEvent: 1,
preventManipulation: 1,
preventDefault: 1,
layerX: 1,
layerY: 1,
scale: 1,
rotation: 1
};
var ug = p("yt.events.listeners_") || {};
ca("yt.events.listeners_", ug, void 0);
var vg = p("yt.events.counter_") || {
count: 0
};
ca("yt.events.counter_", vg, void 0);
function wg(a, b, c, d) {
return Tb(ug, function (e) {
return e[0] == a && e[1] == b && e[2] == c && e[4] == !!d
})
}
function R(a, b, c, d) {
if (!a || !a.addEventListener && !a.attachEvent) return "";
d = !!d;
var e = wg(a, b, c, d);
if (e) return e;
var e = ++vg.count + "",
g = !("mouseenter" != b && "mouseleave" != b || !a.addEventListener || "onmouseenter" in document),
h;
h = g ? function (d) {
d = new pg(d);
if (!wd(d.relatedTarget, function (b) {
return b == a
}, !0)) return d.currentTarget = a, d.type = b, c.call(a, d)
} : function (b) {
b = new pg(b);
b.currentTarget = a;
return c.call(a, b)
};
h = Gd(h);
ug[e] = [a, b, c, h, d];
a.addEventListener ? "mouseenter" == b && g ? a.addEventListener("mouseover",
h, 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 xg(a, b) {
var c;
c = R(a, "playing", function () {
yg(c);
b.apply(a, arguments)
}, void 0)
}
function zg(a, b, c, d) {
return Ag(a, b, c, function (a) {
return Zf(a, d)
})
}
function Ag(a, b, c, d) {
var e = a || document;
return R(e, b, function (a) {
var b = wd(a.target, function (a) {
return a === e || d(a)
}, !0);
b && b !== e && !b.disabled && (a.currentTarget = b, c.call(b, a))
})
}
function yg(a) {
a && ("string" == typeof a && (a = [a]), y(a, function (a) {
if (a in ug) {
var c = ug[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 ug[a]
}
}))
}
function Bg(a) {
for (var b in ug) ug[b][0] == a && yg(b)
}
function Cg(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 Dg() {
return !!mg(["fullscreenEnabled", "fullScreenEnabled"], document)
}
function Eg() {
return mg(["fullscreenElement", "fullScreenElement"], document)
};
function Fg(a) {
a = a || {};
this.url = a.url || "";
this.urlV8 = a.url_v8 || "";
this.urlV9As2 = a.url_v9as2 || "";
this.args = a.args || Zb(Gg);
this.assets = a.assets || {};
this.attrs = a.attrs || Zb(Hg);
this.params = a.params || Zb(Ig);
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
}
var Gg = {
enablejsapi: 1
},
Hg = {},
Ig = {
allowscriptaccess: "always",
allowfullscreen: "true",
bgcolor: "#000000"
};
Fg.prototype.clone = function () {
var a = new Fg,
b;
for (b in this) {
var c = this[b];
"object" == fa(c) ? a[b] = Zb(c) : a[b] = c
}
return a
};
var Jg, Kg, Lg, Mg, Ng, Og, Pg;
Pg = Og = Ng = Mg = Lg = Kg = Jg = !1;
var Qg = dc;
Qg && (-1 != Qg.indexOf("Firefox") ? Jg = !0 : -1 != Qg.indexOf("Camino") ? Kg = !0 : -1 != Qg.indexOf("iPhone") || -1 != Qg.indexOf("iPod") ? Lg = !0 : -1 != Qg.indexOf("iPad") ? Mg = !0 : -1 != Qg.indexOf("Chrome") ? Og = !0 : -1 != Qg.indexOf("Android") ? Ng = !0 : -1 != Qg.indexOf("Safari") && (Pg = !0));
var Rg = Jg,
Sg = Kg,
Tg = Lg,
Ug = Mg,
Vg = Ng,
Wg = Og,
Xg = Pg;
var Yg = v(),
Zg = null,
$g = Array(50),
ah = -1,
bh = !1;
function ch() {
var a = dh;
eh();
Zg.push(a);
fh(Zg)
}
function gh(a, b) {
eh();
var c = Zg,
d = hh(a, String(b));
D(c) ? ih(d) : (fh(c), y(c, function (a) {
a(d)
}))
}
function eh() {
Zg || (Zg = p("yt.mdx.remote.debug.handlers_") || [], ca("yt.mdx.remote.debug.handlers_", Zg, void 0))
}
function ih(a) {
var b = (ah + 1) % 50;
ah = b;
$g[b] = a;
bh || (bh = 49 == b)
}
function fh(a) {
var b = $g;
if (b[0]) {
var c = ah,
d = bh ? c : -1;
do {
var d = (d + 1) % 50,
e = b[d];
y(a, function (a) {
a(e)
})
} while (d != c);
$g = Array(50);
ah = -1;
bh = !1
}
}
function hh(a, b) {
var c = (v() - Yg) / 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 jh() {}
jh.prototype.Vc = !1;
jh.prototype.ea = function () {
return this.Vc
};
jh.prototype.dispose = function () {
this.Vc || (this.Vc = !0, this.J())
};
function S(a, b) {
kh(a, ra(lh, b))
}
function kh(a, b) {
a.ub || (a.ub = []);
a.ub.push(n(void 0) ? t(b, void 0) : b)
}
jh.prototype.J = function () {
if (this.ub)
for (; this.ub.length;) this.ub.shift()()
};
function mh(a) {
return a && "function" == typeof a.ea ? a.ea() : !1
}
function lh(a) {
a && "function" == typeof a.dispose && a.dispose()
}
function nh(a) {
for (var b = 0, c = arguments.length; b < c; ++b) {
var d = arguments[b];
ia(d) ? nh.apply(null, d) : lh(d)
}
};
function oh() {
this.b = [];
this.fc = {}
}
w(oh, jh);
f = oh.prototype;
f.$r = 1;
f.tj = 0;
f.subscribe = function (a, b, c) {
var d = this.fc[a];
d || (d = this.fc[a] = []);
var e = this.$r;
this.b[e] = a;
this.b[e + 1] = b;
this.b[e + 2] = c;
this.$r = e + 3;
d.push(e);
return e
};
f.ia = function (a, b, c) {
if (a = this.fc[a]) {
var d = this.b;
if (a = B(a, function (a) {
return d[a + 1] == b && d[a + 2] == c
})) return this.Lb(a)
}
return !1
};
f.Lb = function (a) {
if (0 != this.tj) return this.g || (this.g = []), this.g.push(a), !1;
var b = this.b[a];
if (b) {
var c = this.fc[b];
c && ob(c, a);
delete this.b[a];
delete this.b[a + 1];
delete this.b[a + 2]
}
return !!b
};
f.I = function (a, b) {
var c = this.fc[a];
if (c) {
this.tj++;
for (var d = vb(arguments, 1), e = 0, g = c.length; e < g; e++) {
var h = c[e];
this.b[h + 1].apply(this.b[h + 2], d)
}
this.tj--;
if (this.g && 0 == this.tj)
for (; c = this.g.pop();) this.Lb(c);
return 0 != e
}
return !1
};
f.clear = function (a) {
if (a) {
var b = this.fc[a];
b && (y(b, this.Lb, this), delete this.fc[a])
} else this.b.length = 0, this.fc = {}
};
f.Oa = function (a) {
if (a) {
var b = this.fc[a];
return b ? b.length : 0
}
a = 0;
for (b in this.fc) a += this.Oa(b);
return a
};
f.J = function () {
oh.G.J.call(this);
delete this.b;
delete this.fc;
delete this.g
};
var ph = p("yt.pubsub.instance_") || new oh;
oh.prototype.subscribe = oh.prototype.subscribe;
oh.prototype.unsubscribeByKey = oh.prototype.Lb;
oh.prototype.publish = oh.prototype.I;
oh.prototype.clear = oh.prototype.clear;
ca("yt.pubsub.instance_", ph, void 0);
var qh = p("yt.pubsub.subscribedKeys_") || {};
ca("yt.pubsub.subscribedKeys_", qh, void 0);
var rh = p("yt.pubsub.topicToKeys_") || {};
ca("yt.pubsub.topicToKeys_", rh, void 0);
var sh = p("yt.pubsub.isSynchronous_") || {};
ca("yt.pubsub.isSynchronous_", sh, void 0);
var th = p("yt.pubsub.skipSubId_") || null;
ca("yt.pubsub.skipSubId_", th, void 0);
function uh(a, b, c) {
var d = vh();
if (d) {
var e = d.subscribe(a, function () {
if (!th || th != e) {
var d = arguments,
h = function () {
qh[e] && b.apply(c || window, d)
};
try {
sh[a] ? h() : J(h, 0)
} catch (k) {
Jd(k)
}
}
}, c);
qh[e] = !0;
rh[a] || (rh[a] = []);
rh[a].push(e);
return e
}
return 0
}
function wh(a) {
var b = vh();
b && ("number" == typeof a ? a = [a] : "string" == typeof a && (a = [parseInt(a, 10)]), y(a, function (a) {
b.unsubscribeByKey(a);
delete qh[a]
}))
}
function xh(a, b) {
var c = vh();
return c ? c.publish.apply(c, arguments) : !1
}
function yh(a, b) {
sh[a] = !0;
var c = vh();
c && c.publish.apply(c, arguments);
sh[a] = !1
}
function zh(a) {
rh[a] && (a = rh[a], y(a, function (a) {
qh[a] && delete qh[a]
}), a.length = 0)
}
function Ah(a) {
var b = vh();
if (b)
if (b.clear(a), a) zh(a);
else
for (var c in rh) zh(c)
}
function vh() {
return p("yt.pubsub.instance_")
};
function Bh() {};
function Ch() {}
w(Ch, Bh);
Ch.prototype.Oa = function () {
var a = 0;
Te(this.$b(!0), function () {
a++
});
return a
};
Ch.prototype.clear = function () {
var a = Ue(this.$b(!0)),
b = this;
y(a, function (a) {
b.remove(a)
})
};
function Dh(a) {
this.b = a
}
w(Dh, Ch);
f = Dh.prototype;
f.isAvailable = function () {
if (!this.b) return !1;
try {
return this.b.setItem("__sak", "1"), this.b.removeItem("__sak"), !0
} catch (a) {
return !1
}
};
f.set = function (a, b) {
try {
this.b.setItem(a, b)
} catch (c) {
if (0 == this.b.length) throw "Storage mechanism: Storage disabled";
throw "Storage mechanism: Quota exceeded";
}
};
f.get = function (a) {
a = this.b.getItem(a);
if (!r(a) && null !== a) throw "Storage mechanism: Invalid value was encountered";
return a
};
f.remove = function (a) {
this.b.removeItem(a)
};
f.Oa = function () {
return this.b.length
};
f.$b = function (a) {
var b = 0,
c = this.b,
d = new Re;
d.next = function () {
if (b >= c.length) throw Qe;
var d;
d = c.key(b++);
if (a) return d;
d = c.getItem(d);
if (!r(d)) throw "Storage mechanism: Invalid value was encountered";
return d
};
return d
};
f.clear = function () {
this.b.clear()
};
f.key = function (a) {
return this.b.key(a)
};
function Eh() {
var a = null;
try {
a = window.localStorage || null
} catch (b) {}
this.b = a
}
w(Eh, Dh);
function Fh() {
var a = null;
try {
a = window.sessionStorage || null
} catch (b) {}
this.b = a
}
w(Fh, Dh);
function Gh(a) {
this.b = a
}
Gh.prototype.set = function (a, b) {
n(b) ? this.b.set(a, Vd(b)) : this.b.remove(a)
};
Gh.prototype.get = function (a) {
var b;
try {
b = this.b.get(a)
} catch (c) {
return
}
if (null !== b) try {
return Td(b)
} catch (d) {
throw "Storage: Invalid value was encountered";
}
};
Gh.prototype.remove = function (a) {
this.b.remove(a)
};
function Hh(a) {
this.b = a
}
w(Hh, Gh);
function Ih(a) {
this.data = a
}
function Jh(a) {
return !n(a) || a instanceof Ih ? a : new Ih(a)
}
Hh.prototype.set = function (a, b) {
Hh.G.set.call(this, a, Jh(b))
};
Hh.prototype.g = function (a) {
a = Hh.G.get.call(this, a);
if (!n(a) || a instanceof Object) return a;
throw "Storage: Invalid value was encountered";
};
Hh.prototype.get = function (a) {
if (a = this.g(a)) {
if (a = a.data, !n(a)) throw "Storage: Invalid value was encountered";
} else a = void 0;
return a
};
function Kh(a) {
this.b = a
}
w(Kh, Hh);
function Lh(a) {
var b = a.creation;
a = a.expiration;
return !!a && a < v() || !!b && b > v()
}
Kh.prototype.set = function (a, b, c) {
if (b = Jh(b)) {
if (c) {
if (c < v()) {
Kh.prototype.remove.call(this, a);
return
}
b.expiration = c
}
b.creation = v()
}
Kh.G.set.call(this, a, b)
};
Kh.prototype.g = function (a, b) {
var c = Kh.G.g.call(this, a);
if (c)
if (!b && Lh(c)) Kh.prototype.remove.call(this, a);
else return c
};
function Mh(a) {
this.b = a
}
w(Mh, Kh);
function Nh(a, b) {
var c = [];
Te(b, function (a) {
var b;
try {
b = Mh.prototype.g.call(this, a, !0)
} catch (g) {
if ("Storage: Invalid value was encountered" == g) return;
throw g;
}
n(b) ? Lh(b) && c.push(a) : c.push(a)
}, a);
return c
}
function Oh(a, b) {
var c = Nh(a, b);
y(c, function (a) {
Mh.prototype.remove.call(this, a)
}, a)
}
Mh.prototype.j = function () {
Oh(this, this.b.$b(!0))
};
function Ph(a, b, c) {
var d = c && 0 < c ? c : 0;
c = d ? v() + 1E3 * d : 0;
if ((d = d ? Qh : Rh) && window.JSON) {
r(b) || (b = JSON.stringify(b, void 0));
try {
d.set(a, b, c)
} catch (e) {
d.remove(a)
}
}
}
function Sh(a) {
if (!Rh && !Qh || !window.JSON) return null;
var b;
try {
b = Rh.get(a)
} catch (c) {}
if (!r(b)) try {
b = Qh.get(a)
} catch (d) {}
if (!r(b)) return null;
try {
b = JSON.parse(b, void 0)
} catch (e) {}
return b
}
function Th(a) {
Rh && Rh.remove(a);
Qh && Qh.remove(a)
}
var Qh, Uh = new Eh;
Qh = Uh.isAvailable() ? new Mh(Uh) : null;
var Rh, Vh = new Fh;
Rh = Vh.isAvailable() ? new Mh(Vh) : null;
function Wh(a, b) {
for (var c = a.split(b), d = {}, e = 0, g = c.length; e < g; e++) {
var h = c[e].split("=");
if (1 == h.length && h[0] || 2 == h.length) {
var k = Ba(h[0] || ""),
h = Ba(h[1] || "");
k in d ? ha(d[k]) ? tb(d[k], h) : d[k] = [d[k], h] : d[k] = h
}
}
return d
}
function Xh(a, b) {
var c = [];
Lb(a, function (a, b) {
var g = Aa(b),
h;
ha(a) ? h = a : h = [a];
y(h, function (a) {
"" == a ? c.push(g) : c.push(g + "=" + Aa(a))
})
});
return c.join(b)
}
function Yh(a) {
"?" == a.charAt(0) && (a = a.substr(1));
return Wh(a, "&")
}
function Zh(a) {
return -1 != a.indexOf("?") ? (a = (a || "").split("#")[0], a = a.split("?", 2), Yh(1 < a.length ? a[1] : a[0])) : {}
}
var $h = hf;
function ai(a) {
a = ff(a);
return df(a[1], a[2], a[3], a[4])
}
function bi(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 = Yh(d[1] || ""),
e;
for (e in b) d[e] = b[e];
return qf(a, d) + c
};
var ci = null;
"undefined" != typeof XMLHttpRequest ? ci = function () {
return new XMLHttpRequest
} : "undefined" != typeof ActiveXObject && (ci = function () {
return new ActiveXObject("Microsoft.XMLHTTP")
});
function di(a) {
switch (a && "status" in a ? a.status : -1) {
case 0:
case 200:
case 201:
case 202:
case 203:
case 204:
case 205:
case 206:
case 304:
return !0;
default:
return !1
}
};
function ei(a, b, c, d, e, g, h) {
function k() {
4 == (l && "readyState" in l ? l.readyState : 0) && b && Gd(b)(l)
}
var l = ci && ci();
if (!("open" in l)) return null;
"onloadend" in l ? l.addEventListener("loadend", k, !1) : l.onreadystatechange = k;
c = (c || "GET").toUpperCase();
d = d || "";
l.open(c, a, !0);
g && (l.responseType = g);
h && (l.withCredentials = !0);
g = "POST" == c;
if (e = fi(a, e))
for (var q in e) l.setRequestHeader(q, e[q]), "content-type" == q.toLowerCase() && (g = !1);
g && l.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
l.send(d);
return l
}
function fi(a, b) {
b = b || {};
var c;
if (c = Fd("PAGE_CL") && Fd("PAGE_BUILD_TIMESTAMP")) {
var d;
d || (d = window.location.href);
c = ff(a)[1] || null;
var e = $h(a);
c && e ? (c = d, d = ff(a), c = ff(c), d = d[3] == c[3] && d[1] == c[1] && d[4] == c[4]) : d = e ? $h(d) == e && (Number(ff(d)[4] || null) || null) == (Number(ff(a)[4] || null) || null) : !0;
c = d || gi(a)
}
c && (b["X-YouTube-Page-CL"] = Fd("PAGE_CL"), b["X-YouTube-Page-Timestamp"] = Fd("PAGE_BUILD_TIMESTAMP"));
return b
}
function gi(a) {
var b = ["X-YouTube-Page-CL", "X-YouTube-Page-Timestamp"],
c = Fd("CORS_HEADER_WHITELIST") || {};
a = $h(a);
if (!a) return !0;
var d = c[a];
return d ? hb(b, function (a) {
return C(d, a)
}) : !1
}
function hi(a, b) {
var c = Fd("XSRF_FIELD_NAME"),
d;
b.headers && (d = b.headers["Content-Type"]);
return !b.$E && (!$h(a) || $h(a) == document.location.hostname) && "POST" == b.method && (!d || "application/x-www-form-urlencoded" == d) && !(b.hd && b.hd[c])
}
function ii(a, b) {
var c = b.format || "JSON";
b.ZE && (a = document.location.protocol + "//" + document.location.hostname + (document.location.port ? ":" + document.location.port : "") + a);
var d = Fd("XSRF_FIELD_NAME"),
e = Fd("XSRF_TOKEN"),
g = b.Fh;
g && (g[d] && delete g[d], a = bi(a, g));
var h = b.gx || "",
g = b.hd;
hi(a, b) && (g || (g = {}), g[d] = e);
g && r(h) && (d = Yh(h), bc(d, g), h = of(d));
var k = !1,
l, q = ei(a, function (a) {
if (!k) {
k = !0;
l && K(l);
var d = di(a),
e = null;
if (d || 400 <= a.status && 500 > a.status) e = ji(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 || {},
g = b.context || m;
d ? b.onSuccess && b.onSuccess.call(g, a, e) : b.onError && b.onError.call(g, a, e);
b.zb && b.zb.call(g, a, e)
}
}, b.method, h, b.headers, b.responseType, b.withCredentials);
b.ih && 0 < b.timeout && (l = J(function () {
k || (k = !0, q.abort(), K(l), b.ih.call(b.context || m, q))
}, b.timeout))
}
function ji(a, b) {
var c = null;
switch (a) {
case "JSON":
var d = b.responseText,
e = b.getResponseHeader("Content-Type") || "";
d && 0 <= e.indexOf("json") && (c = Ud(d));
break;
case "XML":
if (d = (d = b.responseXML) ? ki(d) : null) c = {}, y(d.getElementsByTagName("*"), function (a) {
c[a.tagName] = li(a)
})
}
return c
}
function ki(a) {
return a ? (a = ("responseXML" in a ? a.responseXML : a).getElementsByTagName("root")) && 0 < a.length ? a[0] : null : null
}
function li(a) {
var b = "";
y(a.childNodes, function (a) {
b += a.nodeValue
});
return b
}
var mi = {
html5_ajax: "action_get_html5_token",
watch_actions_ajax: "action_get_watch_actions_token",
addto_ajax: "action_get_wl_token",
playlist_video_ajax: "action_get_html5_wl_token"
},
ni = {
html5_ajax: "html5_ajax_token",
watch_actions_ajax: "watch_actions_ajax_token",
addto_ajax: "addto_ajax_token",
playlist_video_ajax: "playlist_video_ajax_token"
};
function oi(a, b, c, d) {
if (Fd("XSRF_TOKEN")) c && window.setTimeout(c, 0);
else {
var e = ai(document.location.href) + "/token_ajax",
g = {};
a && (g.authuser = a);
b && (g.pageid = b);
g[mi.watch_actions_ajax] = 1;
ii(e, {
format: "RAW",
method: "GET",
Fh: g,
zb: function (a) {
var b = Yh(a.responseText);
b[ni.watch_actions_ajax] ? c && c() : d && d(a, b)
}
})
}
};
function pi() {
this.port = this.g = "";
this.b = !0;
var a = document.location.href,
b = Number(ff(a)[4] || null) || null || "";
b && (this.port = ":" + b);
this.g = hf(a) || "";
a = dc;
0 <= a.search("MSIE") && (a = a.match(/MSIE ([\d.]+)/)[1], 0 > Ta(a, "10.0") && (this.b = !1))
}
function qi(a, b, c, d) {
var e = "/api/lounge";
if (n(d) ? d : a.b) e = "https://" + a.g + a.port + "/api/lounge";
return qf(e + b, c || {})
};
function ri(a) {
a = a || {};
this.name = a.name || "";
this.id = a.screenId || "";
this.token = a.loungeToken || "";
this.uuid = a.dialId || ""
}
function si(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 ti(a) {
return {
name: a.name,
screenId: a.id,
loungeToken: a.token,
dialId: a.uuid
}
}
function ui(a) {
return new ri(a)
}
function vi(a) {
return ha(a) ? A(a, ui) : []
}
function wi(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 xi(a) {
return ha(a) ? "[" + A(a, wi).join(",") + "]" : "null"
};
function yi(a) {
a && (this.id = a.id || "", this.name = a.name || "", this.activityId = a.activityId || "", this.status = a.status || "UNKNOWN")
}
yi.prototype.id = "";
yi.prototype.name = "";
yi.prototype.activityId = "";
yi.prototype.status = "UNKNOWN";
function zi(a) {
return {
id: a.id,
name: a.name,
activityId: a.activityId,
status: a.status
}
}
yi.prototype.toString = function () {
return "{id:" + this.id + ",name:" + this.name + ",activityId:" + this.activityId + ",status:" + this.status + "}"
};
function Ai(a) {
a = a || [];
return "[" + A(a, function (a) {
return a ? a.toString() : "null"
}).join(",") + "]"
};
function Bi() {
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 Ci(a) {
return A(a, function (a) {
return {
key: a.id,
name: a.name
}
})
}
function Di(a) {
return A(a, function (a) {
return zi(a)
})
}
function Ei(a) {
return A(a, function (a) {
return new yi(a)
})
}
function Fi(a, b) {
return a || b ? a && b ? a.id == b.id && a.name == b.name : !1 : !0
}
function Gi(a, b) {
return B(a, function (a) {
return a.id == b
})
}
function Hi(a, b) {
return B(a, function (a) {
return a || b ? !a != !b ? !1 : a.id == b.id : !0
})
}
function Ii(a, b) {
return B(a, function (a) {
return a.id == b || a.uuid == b
})
}
function Ji(a, b) {
return a || b ? a && b ? a.trackName == b.trackName && a.languageCode == b.languageCode && a.languageName == b.languageName && a.format == b.format && a.kind == b.kind : !1 : !0
};
function Ki() {
this.N = new oh;
S(this, this.N)
}
w(Ki, jh);
Ki.prototype.subscribe = function (a, b, c) {
return this.ea() ? 0 : this.N.subscribe(a, b, c)
};
Ki.prototype.ia = function (a, b, c) {
return this.ea() ? !1 : this.N.ia(a, b, c)
};
Ki.prototype.Lb = function (a) {
return this.ea() ? !1 : this.N.Lb(a)
};
Ki.prototype.I = function (a, b) {
return this.ea() ? !1 : this.N.I.apply(this.N, arguments)
};
function Li(a) {
this.b = a
}
var Mi = /\s*;\s*/;
f = Li.prototype;
f.set = function (a, b, c, d, e, g) {
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 : "";
g = g ? ";secure" : "";
c = 0 > c ? "" : 0 == c ? ";expires=" + (new Date(1970, 1, 1)).toUTCString() : ";expires=" + (new Date(v() + 1E3 * c)).toUTCString();
this.b.cookie = a + "=" + b + e + d + c + g
};
f.get = function (a, b) {
for (var c = a + "=", d = (this.b.cookie || "").split(Mi), 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.Xa = function () {
return Ni(this).keys
};
f.Ta = function () {
return Ni(this).cs
};
f.isEmpty = function () {
return !this.b.cookie
};
f.Oa = function () {
return this.b.cookie ? (this.b.cookie || "").split(Mi).length : 0
};
f.$f = function (a) {
for (var b = Ni(this).cs, c = 0; c < b.length; c++)
if (b[c] == a) return !0;
return !1
};
f.clear = function () {
for (var a = Ni(this).keys, b = a.length - 1; 0 <= b; b--) this.remove(a[b])
};
function Ni(a) {
a = (a.b.cookie || "").split(Mi);
for (var b = [], c = [], d, e, g = 0; e = a[g]; g++) 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,
cs: c
}
}
var Oi = new Li(document);
Oi.g = 3950;
function Pi(a, b) {
Oi.set("" + a, b, void 0, "/", "youtube.com")
};
function Qi() {
var a = Ri(),
b = Si();
C(a, b);
Ti() && Db(a, b);
a = Ui(a);
D(a) ? Oi.remove("remote_sid", "/", "youtube.com") : Pi("remote_sid", a.join(","))
}
function Ri() {
var a = Sh("yt-remote-connected-devices") || [];
zb(a);
return a
}
function Ui(a) {
if (D(a)) return [];
var b = a[0].indexOf("#"),
c = -1 == b ? a[0] : a[0].substring(0, b);
return A(a, function (a, b) {
return 0 == b ? a : a.substring(c.length)
})
}
function Vi(a) {
Ph("yt-remote-connected-devices", a, 86400)
}
function Si() {
if (Wi) return Wi;
var a = Sh("yt-remote-device-id");
a || (a = Bi(), Ph("yt-remote-device-id", a, 31536E3));
for (var b = Ri(), c = 1, d = a; C(b, d);) c++, d = a + "#" + c;
return Wi = d
}
function Xi() {
return Sh("yt-remote-session-browser-channel")
}
function Ti() {
return Sh("yt-remote-session-screen-id")
}
function Yi(a) {
5 < a.length && (a = a.slice(a.length - 5));
var b = A(Zi(), function (a) {
return a.loungeToken
}),
c = A(a, function (a) {
return a.loungeToken
});
hb(c, function (a) {
return !C(b, a)
}) && Ph("yt-remote-lounge-token-expiration", !0, 86400);
Ph("yt-remote-local-screens", a, 31536E3)
}
function Zi() {
return Sh("yt-remote-local-screens") || []
}
function $i() {
return Sh("yt-remote-online-screens") || []
}
function aj(a) {
Ph("yt-remote-online-dial-devices", a, 30)
}
function bj() {
return Sh("yt-remote-online-dial-devices") || []
}
function cj(a) {
a || Th("yt-remote-session-screen-id");
Qi();
a = Ri();
ob(a, Si());
Vi(a)
}
var Wi = "";
function dj() {
return !!Sh("yt-remote-cast-installed")
}
function ej() {
dj() ? fj() ? gj() ? (gh("cloudview", "Requesting cast selector."), hj.requestSession()) : (gh("cloudview", "Wait for cast API to be ready to request the session."), ij.push(uh("yt-remote-cast2-api-ready", ej))) : jj("requestCastSelector: Cast is not initialized.") : jj("requestCastSelector: Cast API is not installed!")
}
function kj(a) {
gj() ? fj().setLaunchParams(a) : jj("setLaunchParams called before ready.")
}
var hj = null;
function fj() {
hj || (hj = p("yt.mdx.remote.cloudview.instance_"));
return hj
}
function jj(a) {
gh("cloudview", a)
}
function gj() {
return !!p("yt.mdx.remote.cloudview.apiReady_")
}
var ij = [];
function lj(a) {
a && (this.id = a.id || a.name, this.name = a.name, this.app = a.app, this.type = a.type || "REMOTE_CONTROL", this.b = a.user || "")
}
lj.prototype.id = "";
lj.prototype.name = "";
lj.prototype.app = "";
lj.prototype.type = "REMOTE_CONTROL";
lj.prototype.b = "";
lj.prototype.equals = function (a) {
return a ? this.id == a.id : !1
};
function mj(a, b) {
this.action = a;
this.params = b || null
};
function nj() {
if (!("cast" in window)) return !1;
var a = window.cast || {};
return "ActivityStatus" in a && "Api" in a && "LaunchRequest" in a && "Receiver" in a
}
function oj(a) {
gh("CAST", a)
}
function dh(a) {
var b = pj();
b && b.logMessage && b.logMessage(a)
}
function qj(a) {
if (a.source == window && a.data && "CastApi" == a.data.source && "Hello" == a.data.event)
for (; rj.length;) rj.shift()()
}
function sj() {
if (!p("yt.mdx.remote.castv2_") && !tj && (D(uj) && tb(uj, bj()), nj())) {
var a = pj();
a ? (a.removeReceiverListener("YouTube", vj), a.addReceiverListener("YouTube", vj), oj("API initialized in the other binary")) : (a = new cast.Api, wj(a), a.addReceiverListener("YouTube", vj), a.setReloadTabRequestHandler && a.setReloadTabRequestHandler(function () {
J(function () {
window.location.reload(!0)
}, 1E3)
}), ch(), oj("API initialized"));
tj = !0
}
}
function xj() {
var a = pj();
if (a) {
oj("API disposed");
var b = p("yt.mdx.remote.debug.handlers_");
ob(b || [], dh);
a.setReloadTabRequestHandler && a.setReloadTabRequestHandler(da);
a.removeReceiverListener("YouTube", vj);
wj(null)
}
tj = !1;
rj = null;
(a = wg(window, "message", qj, !1)) && yg(a)
}
function yj(a) {
var b = ib(uj, function (b) {
return b.id == a.id
});
0 <= b && (uj[b] = zi(a))
}
function vj(a) {
a.length && oj("Updating receivers: " + Vd(a));
zj(a);
xh("yt-remote-cast-device-list-update");
y(Aj(), function (a) {
Bj(a.id)
});
y(a, function (a) {
if (a.isTabProjected) {
var c = Cj(a.id);
oj("Detected device: " + c.id + " is tab projected. Firing DEVICE_TAB_PROJECTED event.");
J(function () {
xh("yt-remote-cast-device-tab-projected", c.id)
}, 1E3)
}
})
}
function Dj(a, b) {
oj("Updating " + a + " activity status: " + Vd(b));
var c = Cj(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 = ""), yj(c), xh("yt-remote-cast-device-status-update", c)) : oj("Device not found")
}
function Aj() {
sj();
return Ei(uj)
}
function zj(a) {
a = A(a, function (a) {
var c = {
id: a.id,
name: Ka(a.name)
};
if (a = Cj(a.id)) c.activityId = a.activityId, c.status = a.status;
return c
});
mb(uj);
tb(uj, a)
}
function Cj(a) {
var b = Aj();
return B(b, function (b) {
return b.id == a
}) || null
}
function Bj(a) {
var b = Cj(a),
c = pj();
c && b && b.activityId && c.getActivityStatus(b.activityId, function (b) {
"error" == b.status && (b.status = "stopped");
Dj(a, b)
})
}
function Ej(a) {
sj();
var b = Cj(a),
c = pj();
c && b && b.activityId ? (oj("Stopping cast activity"), c.stopActivity(b.activityId, ra(Dj, a))) : oj("Dropping cast activity stop")
}
function pj() {
return p("yt.mdx.remote.castapi.api_")
}
function wj(a) {
ca("yt.mdx.remote.castapi.api_", a, void 0)
}
var tj = !1,
rj = null,
uj = p("yt.mdx.remote.castapi.devices_") || [];
ca("yt.mdx.remote.castapi.devices_", uj, void 0);
function Fj(a) {
this.b = new Ve;
if (a) {
a = $e(a);
for (var b = a.length, c = 0; c < b; c++) this.add(a[c])
}
}
function Gj(a) {
var b = typeof a;
return "object" == b && a || "function" == b ? "o" + ma(a) : b.substr(0, 1) + a
}
f = Fj.prototype;
f.Oa = function () {
return this.b.Oa()
};
f.add = function (a) {
this.b.set(Gj(a), a)
};
f.removeAll = function (a) {
a = $e(a);
for (var b = a.length, c = 0; c < b; c++) this.remove(a[c])
};
f.remove = function (a) {
return this.b.remove(Gj(a))
};
f.clear = function () {
this.b.clear()
};
f.isEmpty = function () {
return this.b.isEmpty()
};
f.contains = function (a) {
a = Gj(a);
return Xe(this.b.g, a)
};
f.Ta = function () {
return this.b.Ta()
};
f.clone = function () {
return new Fj(this)
};
f.equals = function (a) {
return this.Oa() == Ze(a) && Hj(this, a)
};
function Hj(a, b) {
var c = Ze(b);
if (a.Oa() > c) return !1;
!(b instanceof Fj) && 5 < c && (b = new Fj(b));
return cf(a, function (a) {
var c = b;
return "function" == typeof c.contains ? c.contains(a) : "function" == typeof c.$f ? c.$f(a) : ia(c) || r(c) ? C(c, a) : Sb(c, a)
})
}
f.$b = function () {
return this.b.$b(!1)
};
function Ij() {
this.b = v()
}
new Ij;
Ij.prototype.set = function (a) {
this.b = a
};
Ij.prototype.reset = function () {
this.set(v())
};
Ij.prototype.get = function () {
return this.b
};
function T(a, b) {
this.type = a;
this.currentTarget = this.target = b;
this.defaultPrevented = this.g = !1;
this.yr = !0
}
T.prototype.J = function () {};
T.prototype.dispose = function () {};
T.prototype.stopPropagation = function () {
this.g = !0
};
T.prototype.preventDefault = function () {
this.defaultPrevented = !0;
this.yr = !1
};
function Jj(a) {
a.stopPropagation()
};
var Kj = !oc || Ac(9),
Lj = oc && !zc("9");
!qc || zc("528");
pc && zc("1.9b") || oc && zc("8") || nc && zc("9.5") || qc && zc("528");
pc && !zc("8") || oc && zc("9");
var Mj = "ontouchstart" in m || !!(m.document && document.documentElement && "ontouchstart" in document.documentElement) || !(!m.navigator || !m.navigator.msMaxTouchPoints);
function Nj(a, b) {
T.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.b = this.state = null;
a && this.init(a, b)
}
w(Nj, T);
f = Nj.prototype;
f.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 (pc) {
var e;
t: {
try {
ge(d.nodeName);
e = !0;
break t
} catch (g) {}
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.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 : 0);
this.ctrlKey = a.ctrlKey;
this.altKey = a.altKey;
this.shiftKey = a.shiftKey;
this.metaKey = a.metaKey;
this.state = a.state;
this.b = a;
a.defaultPrevented && this.preventDefault()
};
f.stopPropagation = function () {
Nj.G.stopPropagation.call(this);
this.b.stopPropagation ? this.b.stopPropagation() : this.b.cancelBubble = !0
};
f.preventDefault = function () {
Nj.G.preventDefault.call(this);
var a = this.b;
if (a.preventDefault) a.preventDefault();
else if (a.returnValue = !1, Lj) try {
if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode) a.keyCode = -1
} catch (b) {}
};
f.dC = function () {
return this.b
};
f.J = function () {};
var Oj = "closure_listenable_" + (1E6 * Math.random() | 0);
function Pj(a) {
return !(!a || !a[Oj])
}
var Qj = 0;
function Rj(a, b, c, d, e) {
this.listener = a;
this.proxy = null;
this.src = b;
this.type = c;
this.Kf = !!d;
this.Qa = e;
this.key = ++Qj;
this.removed = this.sj = !1
}
function Sj(a) {
a.removed = !0;
a.listener = null;
a.proxy = null;
a.src = null;
a.Qa = null
};
function Tj(a) {
this.src = a;
this.b = {};
this.g = 0
}
Tj.prototype.add = function (a, b, c, d, e) {
var g = a.toString();
a = this.b[g];
a || (a = this.b[g] = [], this.g++);
var h = Uj(a, b, d, e); - 1 < h ? (b = a[h], c || (b.sj = !1)) : (b = new Rj(b, this.src, g, !!d, e), b.sj = c, a.push(b));
return b
};
Tj.prototype.remove = function (a, b, c, d) {
a = a.toString();
if (!(a in this.b)) return !1;
var e = this.b[a];
b = Uj(e, b, c, d);
return -1 < b ? (Sj(e[b]), pb(e, b), 0 == e.length && (delete this.b[a], this.g--), !0) : !1
};
function Vj(a, b) {
var c = b.type;
if (!(c in a.b)) return !1;
var d = ob(a.b[c], b);
d && (Sj(b), 0 == a.b[c].length && (delete a.b[c], a.g--));
return d
}
Tj.prototype.removeAll = function (a) {
a = a && a.toString();
var b = 0,
c;
for (c in this.b)
if (!a || c == a) {
for (var d = this.b[c], e = 0; e < d.length; e++)++b, Sj(d[e]);
delete this.b[c];
this.g--
}
return b
};
function Wj(a, b, c, d, e) {
a = a.b[b.toString()];
b = -1;
a && (b = Uj(a, c, d, e));
return -1 < b ? a[b] : null
}
function Uj(a, b, c, d) {
for (var e = 0; e < a.length; ++e) {
var g = a[e];
if (!g.removed && g.listener == b && g.Kf == !!c && g.Qa == d) return e
}
return -1
};
var Xj = "closure_lm_" + (1E6 * Math.random() | 0),
Yj = {},
Zj = 0;
function ak(a, b, c, d, e) {
if (ha(b)) {
for (var g = 0; g < b.length; g++) ak(a, b[g], c, d, e);
return null
}
c = bk(c);
return Pj(a) ? a.listen(b, c, d, e) : ck(a, b, c, !1, d, e)
}
function ck(a, b, c, d, e, g) {
if (!b) throw Error("Invalid event type");
var h = !!e,
k = dk(a);
k || (a[Xj] = k = new Tj(a));
c = k.add(b, c, d, e, g);
if (c.proxy) return c;
d = ek();
c.proxy = d;
d.src = a;
d.listener = c;
a.addEventListener ? a.addEventListener(b.toString(), d, h) : a.attachEvent(fk(b.toString()), d);
Zj++;
return c
}
function ek() {
var a = gk,
b = Kj ? 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 hk(a, b, c, d, e) {
if (ha(b)) {
for (var g = 0; g < b.length; g++) hk(a, b[g], c, d, e);
return null
}
c = bk(c);
return Pj(a) ? a.Od.add(String(b), c, !0, d, e) : ck(a, b, c, !0, d, e)
}
function ik(a, b, c, d, e) {
if (ha(b))
for (var g = 0; g < b.length; g++) ik(a, b[g], c, d, e);
else c = bk(c), Pj(a) ? a.Ja(b, c, d, e) : a && (a = dk(a)) && (b = Wj(a, b, c, !!d, e)) && jk(b)
}
function jk(a) {
if (ja(a) || !a || a.removed) return !1;
var b = a.src;
if (Pj(b)) return Vj(b.Od, a);
var c = a.type,
d = a.proxy;
b.removeEventListener ? b.removeEventListener(c, d, a.Kf) : b.detachEvent && b.detachEvent(fk(c), d);
Zj--;
(c = dk(b)) ? (Vj(c, a), 0 == c.g && (c.src = null, b[Xj] = null)) : Sj(a);
return !0
}
function fk(a) {
return a in Yj ? Yj[a] : Yj[a] = "on" + a
}
function kk(a, b, c, d) {
var e = 1;
if (a = dk(a))
if (b = a.b[b.toString()])
for (b = b.concat(), a = 0; a < b.length; a++) {
var g = b[a];
g && g.Kf == c && !g.removed && (e &= !1 !== lk(g, d))
}
return Boolean(e)
}
function lk(a, b) {
var c = a.listener,
d = a.Qa || a.src;
a.sj && jk(a);
return c.call(d, b)
}
function gk(a, b) {
if (a.removed) return !0;
if (!Kj) {
var c = b || p("window.event"),
d = new Nj(c, this),
e = !0;
if (!(0 > c.keyCode || void 0 != c.returnValue)) {
t: {
var g = !1;
if (0 == c.keyCode) try {
c.keyCode = -1;
break t
} 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.g && 0 <= k; k--) d.currentTarget = c[k], e &= kk(c[k], g, !0, d);
for (k = 0; !d.g && k < c.length; k++) d.currentTarget = c[k], e &= kk(c[k], g, !1, d)
}
return e
}
return lk(a, new Nj(b, this))
}
function dk(a) {
a = a[Xj];
return a instanceof Tj ? a : null
}
var mk = "__closure_events_fn_" + (1E9 * Math.random() >>> 0);
function bk(a) {
return ka(a) ? a : a[mk] || (a[mk] = function (b) {
return a.handleEvent(b)
})
};
function U() {
this.Od = new Tj(this);
this.ca = this
}
w(U, jh);
U.prototype[Oj] = !0;
f = U.prototype;
f.Hj = null;
f.ci = function (a) {
this.Hj = a
};
f.addEventListener = function (a, b, c, d) {
ak(this, a, b, c, d)
};
f.removeEventListener = function (a, b, c, d) {
ik(this, a, b, c, d)
};
f.S = function (a) {
var b, c = this.Hj;
if (c) {
b = [];
for (var d = 1; c; c = c.Hj) b.push(c), ++d
}
c = this.ca;
d = a.type || a;
if (r(a)) a = new T(a, c);
else if (a instanceof T) a.target = a.target || c;
else {
var e = a;
a = new T(d, c);
bc(a, e)
}
var e = !0,
g;
if (b)
for (var h = b.length - 1; !a.g && 0 <= h; h--) g = a.currentTarget = b[h], e = nk(g, d, !0, a) && e;
a.g || (g = a.currentTarget = c, e = nk(g, d, !0, a) && e, a.g || (e = nk(g, d, !1, a) && e));
if (b)
for (h = 0; !a.g && h < b.length; h++) g = a.currentTarget = b[h], e = nk(g, d, !1, a) && e;
return e
};
f.J = function () {
U.G.J.call(this);
this.removeAllListeners();
this.Hj = null
};
f.listen = function (a, b, c, d) {
return this.Od.add(String(a), b, !1, c, d)
};
f.Ja = function (a, b, c, d) {
return this.Od.remove(String(a), b, c, d)
};
f.removeAllListeners = function (a) {
return this.Od ? this.Od.removeAll(a) : 0
};
function nk(a, b, c, d) {
b = a.Od.b[String(b)];
if (!b) return !0;
b = b.concat();
for (var e = !0, g = 0; g < b.length; ++g) {
var h = b[g];
if (h && !h.removed && h.Kf == c) {
var k = h.listener,
l = h.Qa || h.src;
h.sj && Vj(a.Od, h);
e = !1 !== k.call(l, d) && e
}
}
return e && !1 != d.yr
};
function ok(a, b) {
this.g = new Xd(a);
this.b = b ? Ud : Td
}
ok.prototype.stringify = function (a) {
return Wd(this.g, a)
};
ok.prototype.parse = function (a) {
return this.b(a)
};
function pk(a) {
this.g = 0;
this.j = a || 100;
this.b = []
}
f = pk.prototype;
f.add = function (a) {
var b = this.b[this.g];
this.b[this.g] = a;
this.g = (this.g + 1) % this.j;
return b
};
f.get = function (a) {
a = qk(this, a);
return this.b[a]
};
f.set = function (a, b) {
a = qk(this, a);
this.b[a] = b
};
f.Oa = function () {
return this.b.length
};
f.isEmpty = function () {
return 0 == this.b.length
};
f.clear = function () {
this.g = this.b.length = 0
};
f.Ta = function () {
for (var a = this.Oa(), b = this.Oa(), c = [], a = this.Oa() - a; a < b; a++) c.push(this.get(a));
return c
};
f.Xa = function () {
for (var a = [], b = this.Oa(), c = 0; c < b; c++) a[c] = c;
return a
};
f.$f = function (a) {
for (var b = this.Oa(), c = 0; c < b; c++)
if (this.get(c) == a) return !0;
return !1
};
function qk(a, b) {
if (b >= a.b.length) throw Error("Out of bounds exception");
return a.b.length < a.j ? b : (a.g + Number(b)) % a.j
};
function rk(a, b) {
U.call(this);
this.b = a || 1;
this.g = b || m;
this.j = t(this.by, this);
this.k = v()
}
w(rk, U);
f = rk.prototype;
f.gd = !1;
f.vc = null;
function sk(a, b) {
a.b = b;
a.vc && a.gd ? (a.stop(), a.start()) : a.vc && a.stop()
}
f.by = function () {
if (this.gd) {
var a = v() - this.k;
0 < a && a < .8 * this.b ? this.vc = this.g.setTimeout(this.j, this.b - a) : (this.vc && (this.g.clearTimeout(this.vc), this.vc = null), this.S("tick"), this.gd && (this.vc = this.g.setTimeout(this.j, this.b), this.k = v()))
}
};
f.start = function () {
this.gd = !0;
this.vc || (this.vc = this.g.setTimeout(this.j, this.b), this.k = v())
};
f.stop = function () {
this.gd = !1;
this.vc && (this.g.clearTimeout(this.vc), this.vc = null)
};
f.J = function () {
rk.G.J.call(this);
this.stop();
delete this.g
};
function tk(a, b, c) {
if (ka(a)) c && (a = t(a, c));
else if (a && "function" == typeof a.handleEvent) a = t(a.handleEvent, a);
else throw Error("Invalid listener argument");
return 2147483647 < b ? -1 : m.setTimeout(a, b || 0)
}
function uk(a) {
m.clearTimeout(a)
};
function vk(a, b, c) {
this.k = a;
this.j = b;
this.g = c;
this.b = t(this.fy, this)
}
w(vk, jh);
f = vk.prototype;
f.cg = !1;
f.Kh = 0;
f.Ye = null;
function wk(a) {
a.Ye || a.Kh ? a.cg = !0 : xk(a)
}
f.stop = function () {
this.Ye && (uk(this.Ye), this.Ye = null, this.cg = !1)
};
f.pause = function () {
this.Kh++
};
f.resume = function () {
this.Kh--;
this.Kh || !this.cg || this.Ye || (this.cg = !1, xk(this))
};
f.J = function () {
vk.G.J.call(this);
this.stop()
};
f.fy = function () {
this.Ye = null;
this.cg && !this.Kh && (this.cg = !1, xk(this))
};
function xk(a) {
a.Ye = tk(a.b, a.j);
a.k.call(a.g)
};
function yk(a) {
this.j = a;
this.g = {}
}
w(yk, jh);
var zk = [];
f = yk.prototype;
f.listen = function (a, b, c, d) {
return Ak(this, a, b, c, d)
};
function Bk(a, b, c, d, e) {
Ak(a, b, c, d, !1, e)
}
function Ak(a, b, c, d, e, g) {
ha(c) || (c && (zk[0] = c.toString()), c = zk);
for (var h = 0; h < c.length; h++) {
var k = ak(b, c[h], d || a.handleEvent, e || !1, g || a.j || a);
if (!k) break;
a.g[k.key] = k
}
return a
}
function Ck(a, b, c, d) {
Dk(a, b, c, d, void 0)
}
function Ek(a, b, c, d, e) {
Dk(a, b, c, d, !1, e)
}
function Dk(a, b, c, d, e, g) {
if (ha(c))
for (var h = 0; h < c.length; h++) Dk(a, b, c[h], d, e, g);
else(b = hk(b, c, d || a.handleEvent, e, g || a.j || a)) && (a.g[b.key] = b)
}
f.Ja = function (a, b, c, d, e) {
if (ha(b))
for (var g = 0; g < b.length; g++) this.Ja(a, b[g], c, d, e);
else c = c || this.handleEvent, e = e || this.j || this, c = bk(c), d = !!d, b = Pj(a) ? Wj(a.Od, String(b), c, d, e) : a ? (a = dk(a)) ? Wj(a, b, c, d, e) : null : null, b && (jk(b), delete this.g[b.key]);
return this
};
f.removeAll = function () {
Lb(this.g, jk);
this.g = {}
};
f.J = function () {
yk.G.J.call(this);
this.removeAll()
};
f.handleEvent = function () {
throw Error("EventHandler.handleEvent not implemented");
};
function Fk(a) {
switch (a) {
case 0:
return "No Error";
case 1:
return "Access denied to content document";
case 2:
return "File not found";
case 3:
return "Firefox silently errored";
case 4:
return "Application custom error";
case 5:
return "An exception occurred";
case 6:
return "Http response at 400 or 500 level";
case 7:
return "Request was aborted";
case 8:
return "Request timed out";
case 9:
return "The resource is not available offline";
default:
return "Unrecognized error code"
}
};
function Gk() {}
Gk.prototype.b = null;
function Hk(a) {
var b;
(b = a.b) || (b = {}, Ik(a) && (b[0] = !0, b[1] = !0), b = a.b = b);
return b
};
var Jk;
function Kk() {}
w(Kk, Gk);
function Lk(a) {
return (a = Ik(a)) ? new ActiveXObject(a) : new XMLHttpRequest
}
function Ik(a) {
if (!a.g && "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.g = d
} catch (e) {}
}
throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed");
}
return a.g
}
Jk = new Kk;
function Mk(a, b, c, d, e) {
this.b = a;
this.j = c;
this.B = d;
this.A = e || 1;
this.rb = 45E3;
this.k = new yk(this);
this.g = new rk;
sk(this.g, 250)
}
f = Mk.prototype;
f.Oe = null;
f.Qc = !1;
f.Wf = null;
f.tn = null;
f.ph = null;
f.Qf = null;
f.pe = null;
f.re = null;
f.Ne = null;
f.ob = null;
f.yh = 0;
f.Rc = null;
f.wj = null;
f.Ve = null;
f.Pg = -1;
f.pr = !0;
f.$e = !1;
f.Hm = 0;
f.cj = null;
var Nk = {},
Ok = {};
f = Mk.prototype;
f.setTimeout = function (a) {
this.rb = a
};
function Pk(a, b, c) {
a.Qf = 1;
a.pe = Qf(b.clone());
a.Ne = c;
a.o = !0;
Qk(a, null)
}
function Rk(a, b, c, d, e) {
a.Qf = 1;
a.pe = Qf(b.clone());
a.Ne = null;
a.o = c;
e && (a.pr = !1);
Qk(a, d)
}
function Qk(a, b) {
a.ph = v();
Sk(a);
a.re = a.pe.clone();
Nf(a.re, "t", a.A);
a.yh = 0;
a.ob = a.b.bn(a.b.nh() ? b : null);
0 < a.Hm && (a.cj = new vk(t(a.Hr, a, a.ob), a.Hm));
a.k.listen(a.ob, "readystatechange", a.lB);
var c = a.Oe ? Zb(a.Oe) : {};
a.Ne ? (a.wj = "POST", c["Content-Type"] = "application/x-www-form-urlencoded", a.ob.send(a.re, a.wj, a.Ne, c)) : (a.wj = "GET", a.pr && !qc && (c.Connection = "close"), a.ob.send(a.re, a.wj, null, c));
a.b.Oc(1)
}
f.lB = function (a) {
a = a.target;
var b = this.cj;
b && 3 == Tk(a) ? wk(b) : this.Hr(a)
};
f.Hr = function (a) {
try {
if (a == this.ob) t: {
var b = Tk(this.ob),
c = this.ob.g,
d = Uk(this.ob);
if (oc && !Ac(10) || qc && !zc("420+")) {
if (4 > b) break t
} else if (3 > b || 3 == b && !nc && !Vk(this.ob)) break t;
this.$e || 4 != b || 7 == c || (8 == c || 0 >= d ? this.b.Oc(3) : this.b.Oc(2));
Wk(this);
var e = Uk(this.ob);
this.Pg = e;
var g = Vk(this.ob);
(this.Qc = 200 == e) ? (4 == b && Xk(this), this.o ? (Yk(this, b, g), nc && this.Qc && 3 == b && (this.k.listen(this.g, "tick", this.bz), this.g.start())) : Zk(this, g), this.Qc && !this.$e && (4 == b ? this.b.bj(this) : (this.Qc = !1, Sk(this)))) : (this.Ve =
400 == e && 0 < g.indexOf("Unknown SID") ? 3 : 0, $k(), Xk(this), al(this))
}
} catch (h) {
this.ob && Vk(this.ob)
} finally {}
};
function Yk(a, b, c) {
for (var d = !0; !a.$e && a.yh < c.length;) {
var e = bl(a, c);
if (e == Ok) {
4 == b && (a.Ve = 4, $k(), d = !1);
break
} else if (e == Nk) {
a.Ve = 4;
$k();
d = !1;
break
} else Zk(a, e)
}
4 == b && 0 == c.length && (a.Ve = 1, $k(), d = !1);
a.Qc = a.Qc && d;
d || (Xk(a), al(a))
}
f.bz = function () {
var a = Tk(this.ob),
b = Vk(this.ob);
this.yh < b.length && (Wk(this), Yk(this, a, b), this.Qc && 4 != a && Sk(this))
};
function bl(a, b) {
var c = a.yh,
d = b.indexOf("\n", c);
if (-1 == d) return Ok;
c = Number(b.substring(c, d));
if (isNaN(c)) return Nk;
d += 1;
if (d + c > b.length) return Ok;
var e = b.substr(d, c);
a.yh = d + c;
return e
}
function cl(a, b) {
a.ph = v();
Sk(a);
var c = b ? window.location.hostname : "";
a.re = a.pe.clone();
N(a.re, "DOMAIN", c);
N(a.re, "t", a.A);
try {
a.Rc = new ActiveXObject("htmlfile")
} catch (d) {
Xk(a);
a.Ve = 7;
$k();
al(a);
return
}
var e = "<html><body>";
b && (e += '<script>document.domain="' + c + '"\x3c/script>');
e += "</body></html>";
a.Rc.open();
a.Rc.write(e);
a.Rc.close();
a.Rc.parentWindow.m = t(a.BB, a);
a.Rc.parentWindow.d = t(a.Tr, a, !0);
a.Rc.parentWindow.rpcClose = t(a.Tr, a, !1);
c = a.Rc.createElement("div");
a.Rc.parentWindow.document.body.appendChild(c);
c.innerHTML = '<iframe src="' + a.re + '"></iframe>';
a.b.Oc(1)
}
f.BB = function (a) {
dl(t(this.GE, this, a), 0)
};
f.GE = function (a) {
this.$e || (Wk(this), Zk(this, a), Sk(this))
};
f.Tr = function (a) {
dl(t(this.FE, this, a), 0)
};
f.FE = function (a) {
this.$e || (Xk(this), this.Qc = a, this.b.bj(this), this.b.Oc(4))
};
f.cancel = function () {
this.$e = !0;
Xk(this)
};
function Sk(a) {
a.tn = v() + a.rb;
el(a, a.rb)
}
function el(a, b) {
if (null != a.Wf) throw Error("WatchDog timer not null");
a.Wf = dl(t(a.dE, a), b)
}
function Wk(a) {
a.Wf && (m.clearTimeout(a.Wf), a.Wf = null)
}
f.dE = function () {
this.Wf = null;
var a = v();
0 <= a - this.tn ? (2 != this.Qf && this.b.Oc(3), Xk(this), this.Ve = 2, $k(), al(this)) : el(this, this.tn - a)
};
function al(a) {
a.b.Zr() || a.$e || a.b.bj(a)
}
function Xk(a) {
Wk(a);
lh(a.cj);
a.cj = null;
a.g.stop();
a.k.removeAll();
if (a.ob) {
var b = a.ob;
a.ob = null;
fl(b);
b.dispose()
}
a.Rc && (a.Rc = null)
}
function Zk(a, b) {
try {
a.b.as(a, b), a.b.Oc(4)
} catch (c) {}
};
function gl(a, b, c, d, e) {
if (0 == d) c(!1);
else {
var g = e || 0;
d--;
hl(a, b, function (e) {
e ? c(!0) : m.setTimeout(function () {
gl(a, b, c, d, g)
}, g)
})
}
}
function hl(a, b, c) {
var d = new Image;
d.onload = function () {
try {
il(d), c(!0)
} catch (a) {}
};
d.onerror = function () {
try {
il(d), c(!1)
} catch (a) {}
};
d.onabort = function () {
try {
il(d), c(!1)
} catch (a) {}
};
d.ontimeout = function () {
try {
il(d), c(!1)
} catch (a) {}
};
m.setTimeout(function () {
if (d.ontimeout) d.ontimeout()
}, b);
d.src = a
}
function il(a) {
a.onload = null;
a.onerror = null;
a.onabort = null;
a.ontimeout = null
};
function jl(a) {
this.b = a;
this.g = new ok(null, !0)
}
f = jl.prototype;
f.xm = null;
f.dc = null;
f.rj = !1;
f.lr = null;
f.qj = null;
f.Um = null;
f.mn = null;
f.wc = null;
f.Rd = -1;
f.rh = null;
f.wh = null;
f.connect = function (a) {
this.mn = a;
a = kl(this.b, null, this.mn);
$k();
this.lr = v();
var b = this.b.C;
null != b ? (this.rh = b[0], (this.wh = b[1]) ? (this.wc = 1, ll(this)) : (this.wc = 2, ml(this))) : (Nf(a, "MODE", "init"), this.dc = new Mk(this, 0, void 0, void 0, void 0), this.dc.Oe = this.xm, Rk(this.dc, a, !1, null, !0), this.wc = 0)
};
function ll(a) {
var b = kl(a.b, a.wh, "/mail/images/cleardot.gif");
Qf(b);
gl(b.toString(), 5E3, t(a.PB, a), 3, 2E3);
a.Oc(1)
}
f.PB = function (a) {
if (a) this.wc = 2, ml(this);
else {
$k();
var b = this.b;
b.Jc = b.qe.Rd;
nl(b, 9)
}
a && this.Oc(2)
};
function ml(a) {
var b = a.b.D;
if (null != b) $k(), b ? ($k(), ol(a.b, a, !1)) : ($k(), ol(a.b, a, !0));
else if (a.dc = new Mk(a, 0, void 0, void 0, void 0), a.dc.Oe = a.xm, b = a.b, b = kl(b, b.nh() ? a.rh : null, a.mn), $k(), !oc || Ac(10)) Nf(b, "TYPE", "xmlhttp"), Rk(a.dc, b, !1, a.rh, !1);
else {
Nf(b, "TYPE", "html");
var c = a.dc;
a = Boolean(a.rh);
c.Qf = 3;
c.pe = Qf(b.clone());
cl(c, a)
}
}
f.bn = function (a) {
return this.b.bn(a)
};
f.Zr = function () {
return !1
};
f.as = function (a, b) {
this.Rd = a.Pg;
if (0 == this.wc)
if (b) {
try {
var c = this.g.parse(b)
} catch (d) {
c = this.b;
c.Jc = this.Rd;
nl(c, 2);
return
}
this.rh = c[0];
this.wh = c[1]
} else c = this.b, c.Jc = this.Rd, nl(c, 2);
else if (2 == this.wc)
if (this.rj) $k(), this.Um = v();
else if ("11111" == b) {
if ($k(), this.rj = !0, this.qj = v(), c = this.qj - this.lr, !oc || Ac(10) || 500 > c) this.Rd = 200, this.dc.cancel(), $k(), ol(this.b, this, !0)
} else $k(), this.qj = this.Um = v(), this.rj = !1
};
f.bj = function () {
this.Rd = this.dc.Pg;
if (this.dc.Qc) 0 == this.wc ? this.wh ? (this.wc = 1, ll(this)) : (this.wc = 2, ml(this)) : 2 == this.wc && (a = !1, (a = !oc || Ac(10) ? this.rj : 200 > this.Um - this.qj ? !1 : !0) ? ($k(), ol(this.b, this, !0)) : ($k(), ol(this.b, this, !1)));
else {
0 == this.wc ? $k() : 2 == this.wc && $k();
var a = this.b;
a.Jc = this.Rd;
nl(a, 2)
}
};
f.nh = function () {
return this.b.nh()
};
f.Oc = function (a) {
this.b.Oc(a)
};
function pl(a) {
U.call(this);
this.headers = new Ve;
this.F = a || null;
this.j = !1;
this.D = this.b = null;
this.L = "";
this.g = 0;
this.A = "";
this.k = this.N = this.B = this.H = !1;
this.o = 0;
this.C = null;
this.P = "";
this.M = this.O = !1
}
w(pl, U);
var ql = /^https?$/i,
rl = ["POST", "PUT"];
function sl(a, b) {
a.o = Math.max(0, b)
}
f = pl.prototype;
f.send = function (a, b, c, d) {
if (this.b) throw Error("[goog.net.XhrIo] Object is active with another request=" + this.L + "; newUri=" + a);
b = b ? b.toUpperCase() : "GET";
this.L = a;
this.A = "";
this.g = 0;
this.H = !1;
this.j = !0;
this.b = this.F ? Lk(this.F) : Lk(Jk);
this.D = this.F ? Hk(this.F) : Hk(Jk);
this.b.onreadystatechange = t(this.Mo, this);
try {
this.N = !0, this.b.open(b, String(a), !0), this.N = !1
} catch (e) {
tl(this, e);
return
}
a = c || "";
var g = this.headers.clone();
d && bf(d, function (a, b) {
g.set(b, a)
});
d = B(g.Xa(), ul);
c = m.FormData && a instanceof m.FormData;
!C(rl, b) || d || c || g.set("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
g.forEach(function (a, b) {
this.b.setRequestHeader(b, a)
}, this);
this.P && (this.b.responseType = this.P);
"withCredentials" in this.b && (this.b.withCredentials = this.O);
try {
vl(this), 0 < this.o && ((this.M = wl(this.b)) ? (this.b.timeout = this.o, this.b.ontimeout = t(this.rb, this)) : this.C = tk(this.rb, this.o, this)), this.B = !0, this.b.send(a), this.B = !1
} catch (h) {
tl(this, h)
}
};
function wl(a) {
return oc && zc(9) && ja(a.timeout) && n(a.ontimeout)
}
function ul(a) {
return "content-type" == a.toLowerCase()
}
f.rb = function () {
"undefined" != typeof aa && this.b && (this.A = "Timed out after " + this.o + "ms, aborting", this.g = 8, this.S("timeout"), fl(this, 8))
};
function tl(a, b) {
a.j = !1;
a.b && (a.k = !0, a.b.abort(), a.k = !1);
a.A = b;
a.g = 5;
xl(a);
yl(a)
}
function xl(a) {
a.H || (a.H = !0, a.S("complete"), a.S("error"))
}
function fl(a, b) {
a.b && a.j && (a.j = !1, a.k = !0, a.b.abort(), a.k = !1, a.g = b || 7, a.S("complete"), a.S("abort"), yl(a))
}
f.J = function () {
this.b && (this.j && (this.j = !1, this.k = !0, this.b.abort(), this.k = !1), yl(this, !0));
pl.G.J.call(this)
};
f.Mo = function () {
this.ea() || (this.N || this.B || this.k ? zl(this) : this.DC())
};
f.DC = function () {
zl(this)
};
function zl(a) {
if (a.j && "undefined" != typeof aa && (!a.D[1] || 4 != Tk(a) || 2 != Uk(a)))
if (a.B && 4 == Tk(a)) tk(a.Mo, 0, a);
else if (a.S("readystatechange"), 4 == Tk(a)) {
a.j = !1;
try {
var b = Uk(a),
c, d;
t: switch (b) {
case 200:
case 201:
case 202:
case 204:
case 206:
case 304:
case 1223:
d = !0;
break t;
default:
d = !1
}
if (!(c = d)) {
var e;
if (e = 0 === b) {
var g = ff(String(a.L))[1] || null;
if (!g && self.location) var h = self.location.protocol,
g = h.substr(0, h.length - 1);
e = !ql.test(g ? g.toLowerCase() : "")
}
c = e
}
if (c) a.S("complete"), a.S("success");
else {
a.g = 6;
var k;
try {
k = 2 < Tk(a) ? a.b.statusText : ""
} catch (l) {
k = ""
}
a.A = k + " [" + Uk(a) + "]";
xl(a)
}
} finally {
yl(a)
}
}
}
function yl(a, b) {
if (a.b) {
vl(a);
var c = a.b,
d = a.D[0] ? da : null;
a.b = null;
a.D = null;
b || a.S("ready");
try {
c.onreadystatechange = d
} catch (e) {}
}
}
function vl(a) {
a.b && a.M && (a.b.ontimeout = null);
ja(a.C) && (uk(a.C), a.C = null)
}
function Tk(a) {
return a.b ? a.b.readyState : 0
}
function Uk(a) {
try {
return 2 < Tk(a) ? a.b.status : -1
} catch (b) {
return -1
}
}
function Vk(a) {
try {
return a.b ? a.b.responseText : ""
} catch (b) {
return ""
}
};
function Al(a, b, c) {
this.B = a || null;
this.b = 1;
this.g = [];
this.k = [];
this.o = new ok(null, !0);
this.C = b || null;
this.D = null != c ? c : null
}
function Bl(a, b) {
this.b = a;
this.map = b;
this.context = null
}
f = Al.prototype;
f.Gh = null;
f.Kb = null;
f.fb = null;
f.om = null;
f.Ui = null;
f.fr = null;
f.nj = null;
f.Xg = 0;
f.eB = 0;
f.Eb = null;
f.te = null;
f.Qd = null;
f.df = null;
f.qe = null;
f.Qi = null;
f.Cf = -1;
f.ur = -1;
f.Jc = -1;
f.Vg = 0;
f.Tf = 0;
f.Re = 8;
var Cl = new U;
function Dl(a) {
T.call(this, "statevent", a)
}
w(Dl, T);
function El(a, b) {
T.call(this, "timingevent", a);
this.size = b
}
w(El, T);
function Fl(a) {
T.call(this, "serverreachability", a)
}
w(Fl, T);
f = Al.prototype;
f.connect = function (a, b, c, d, e) {
$k();
this.om = b;
this.Gh = c || {};
d && n(e) && (this.Gh.OSID = d, this.Gh.OAID = e);
this.qe = new jl(this);
this.qe.xm = null;
this.qe.g = this.o;
this.qe.connect(a)
};
f.disconnect = function () {
Gl(this);
if (3 == this.b) {
var a = this.Xg++,
b = this.Ui.clone();
N(b, "SID", this.j);
N(b, "RID", a);
N(b, "TYPE", "terminate");
Hl(this, b);
a = new Mk(this, 0, this.j, a, void 0);
a.Qf = 2;
a.pe = Qf(b.clone());
(new Image).src = a.pe;
a.ph = v();
Sk(a)
}
Il(this)
};
function Gl(a) {
if (a.qe) {
var b = a.qe;
b.dc && (b.dc.cancel(), b.dc = null);
b.Rd = -1;
a.qe = null
}
a.fb && (a.fb.cancel(), a.fb = null);
a.Qd && (m.clearTimeout(a.Qd), a.Qd = null);
Jl(a);
a.Kb && (a.Kb.cancel(), a.Kb = null);
a.te && (m.clearTimeout(a.te), a.te = null)
}
function Kl(a, b) {
if (0 == a.b) throw Error("Invalid operation: sending map when state is closed");
a.g.push(new Bl(a.eB++, b));
2 != a.b && 3 != a.b || Ll(a)
}
f.Zr = function () {
return 0 == this.b
};
function Ll(a) {
a.Kb || a.te || (a.te = dl(t(a.Rr, a), 0), a.Vg = 0)
}
f.Rr = function (a) {
this.te = null;
Ml(this, a)
};
function Ml(a, b) {
if (1 == a.b) {
if (!b) {
a.Xg = Math.floor(1E5 * Math.random());
var c = a.Xg++,
d = new Mk(a, 0, "", c, void 0);
d.Oe = null;
var e = Nl(a),
g = a.Ui.clone();
N(g, "RID", c);
a.B && N(g, "CVER", a.B);
Hl(a, g);
Pk(d, g, e);
a.Kb = d;
a.b = 2
}
} else 3 == a.b && (b ? Ol(a, b) : 0 != a.g.length && (a.Kb || Ol(a)))
}
function Ol(a, b) {
var c, d;
b ? 6 < a.Re ? (a.g = a.k.concat(a.g), a.k.length = 0, c = a.Xg - 1, d = Nl(a)) : (c = b.B, d = b.Ne) : (c = a.Xg++, d = Nl(a));
var e = a.Ui.clone();
N(e, "SID", a.j);
N(e, "RID", c);
N(e, "AID", a.Cf);
Hl(a, e);
c = new Mk(a, 0, a.j, c, a.Vg + 1);
c.Oe = null;
c.setTimeout(Math.round(1E4) + Math.round(1E4 * Math.random()));
a.Kb = c;
Pk(c, e, d)
}
function Hl(a, b) {
if (a.Eb) {
var c = a.Eb.jt(a);
c && Lb(c, function (a, c) {
N(b, c, a)
})
}
}
function Nl(a) {
var b = Math.min(a.g.length, 1E3),
c = ["count=" + b],
d;
6 < a.Re && 0 < b ? (d = a.g[0].b, c.push("ofs=" + d)) : d = 0;
for (var e = 0; e < b; e++) {
var g = a.g[e].b,
h = a.g[e].map,
g = 6 >= a.Re ? e : g - d;
try {
bf(h, function (a, b) {
c.push("req" + g + "_" + b + "=" + encodeURIComponent(a))
})
} catch (k) {
c.push("req" + g + "_type=" + encodeURIComponent("_badmap"))
}
}
a.k = a.k.concat(a.g.splice(0, b));
return c.join("&")
}
function Pl(a) {
a.fb || a.Qd || (a.A = 1, a.Qd = dl(t(a.Ks, a), 0), a.Tf = 0)
}
function Ql(a) {
if (a.fb || a.Qd || 3 <= a.Tf) return !1;
a.A++;
a.Qd = dl(t(a.Ks, a), Rl(a, a.Tf));
a.Tf++;
return !0
}
f.Ks = function () {
this.Qd = null;
this.fb = new Mk(this, 0, this.j, "rpc", this.A);
this.fb.Oe = null;
this.fb.Hm = 0;
var a = this.fr.clone();
N(a, "RID", "rpc");
N(a, "SID", this.j);
N(a, "CI", this.Qi ? "0" : "1");
N(a, "AID", this.Cf);
Hl(this, a);
if (!oc || Ac(10)) N(a, "TYPE", "xmlhttp"), Rk(this.fb, a, !0, this.nj, !1);
else {
N(a, "TYPE", "html");
var b = this.fb,
c = Boolean(this.nj);
b.Qf = 3;
b.pe = Qf(a.clone());
cl(b, c)
}
};
function ol(a, b, c) {
a.Qi = c;
a.Jc = b.Rd;
a.HD(1, 0);
a.Ui = kl(a, null, a.om);
Ll(a)
}
f.as = function (a, b) {
if (0 != this.b && (this.fb == a || this.Kb == a))
if (this.Jc = a.Pg, this.Kb == a && 3 == this.b)
if (7 < this.Re) {
var c;
try {
c = this.o.parse(b)
} catch (d) {
c = null
}
if (ha(c) && 3 == c.length)
if (0 == c[0]) t: {
if (!this.Qd) {
if (this.fb)
if (this.fb.ph + 3E3 < this.Kb.ph) Jl(this), this.fb.cancel(), this.fb = null;
else break t;
Ql(this);
$k()
}
} else this.ur = c[1], 0 < this.ur - this.Cf && 37500 > c[2] && this.Qi && 0 == this.Tf && !this.df && (this.df = dl(t(this.lA, this), 6E3));
else nl(this, 11)
} else "y2f%" != b && nl(this, 11);
else if (this.fb == a && Jl(this), !xa(b)) {
c =
this.o.parse(b);
ha(c);
for (var e = 0; e < c.length; e++) {
var g = c[e];
this.Cf = g[0];
g = g[1];
2 == this.b ? "c" == g[0] ? (this.j = g[1], this.nj = g[2], g = g[3], null != g ? this.Re = g : this.Re = 6, this.b = 3, this.Eb && this.Eb.tr(this), this.fr = kl(this, this.nh() ? this.nj : null, this.om), Pl(this)) : "stop" == g[0] && nl(this, 7) : 3 == this.b && ("stop" == g[0] ? nl(this, 7) : "noop" != g[0] && this.Eb && this.Eb.sr(this, g), this.Tf = 0)
}
}
};
f.lA = function () {
null != this.df && (this.df = null, this.fb.cancel(), this.fb = null, Ql(this), $k())
};
function Jl(a) {
null != a.df && (m.clearTimeout(a.df), a.df = null)
}
f.bj = function (a) {
var b;
if (this.fb == a) Jl(this), this.fb = null, b = 2;
else if (this.Kb == a) this.Kb = null, b = 1;
else return;
this.Jc = a.Pg;
if (0 != this.b)
if (a.Qc) 1 == b ? (v(), Cl.S(new El(Cl, a.Ne ? a.Ne.length : 0)), Ll(this), this.k.length = 0) : Pl(this);
else {
var c = a.Ve,
d;
if (!(d = 3 == c || 7 == c || 0 == c && 0 < this.Jc)) {
if (d = 1 == b) this.Kb || this.te || 1 == this.b || 2 <= this.Vg ? d = !1 : (this.te = dl(t(this.Rr, this, a), Rl(this, this.Vg)), this.Vg++, d = !0);
d = !(d || 2 == b && Ql(this))
}
if (d) switch (c) {
case 1:
nl(this, 5);
break;
case 4:
nl(this, 10);
break;
case 3:
nl(this,
6);
break;
case 7:
nl(this, 12);
break;
default:
nl(this, 2)
}
}
};
function Rl(a, b) {
var c = 5E3 + Math.floor(1E4 * Math.random());
a.Eb || (c *= 2);
return c * b
}
f.HD = function (a) {
if (!C(arguments, this.b)) throw Error("Unexpected channel state: " + this.b);
};
function nl(a, b) {
if (2 == b || 9 == b) {
var c = null;
a.Eb && (c = null);
var d = t(a.QD, a);
c || (c = new M("//www.google.com/images/cleardot.gif"), Qf(c));
hl(c.toString(), 1E4, d)
} else $k();
Sl(a, b)
}
f.QD = function (a) {
a ? $k() : ($k(), Sl(this, 8))
};
function Sl(a, b) {
a.b = 0;
a.Eb && a.Eb.Yr(a, b);
Il(a);
Gl(a)
}
function Il(a) {
a.b = 0;
a.Jc = -1;
if (a.Eb)
if (0 == a.k.length && 0 == a.g.length) a.Eb.Gm(a);
else {
var b = sb(a.k),
c = sb(a.g);
a.k.length = 0;
a.g.length = 0;
a.Eb.Gm(a, b, c)
}
}
function kl(a, b, c) {
var d = Rf(c);
if ("" != d.Gb) b && wf(d, b + "." + d.Gb), xf(d, d.gf);
else var e = window.location,
d = Sf(e.protocol, b ? b + "." + e.hostname : e.hostname, e.port, c);
a.Gh && Lb(a.Gh, function (a, b) {
N(d, b, a)
});
N(d, "VER", a.Re);
Hl(a, d);
return d
}
f.bn = function (a) {
if (a) throw Error("Can't create secondary domain capable XhrIo object.");
a = new pl;
a.O = !1;
return a
};
function dl(a, b) {
if (!ka(a)) throw Error("Fn must not be null and must be a function");
return m.setTimeout(function () {
a()
}, b)
}
f.Oc = function () {
Cl.S(new Fl(Cl))
};
function $k() {
Cl.S(new Dl(Cl))
}
f.nh = function () {
return !(!oc || Ac(10))
};
function Tl() {}
f = Tl.prototype;
f.tr = function () {};
f.sr = function () {};
f.Yr = function () {};
f.Gm = function () {};
f.jt = function () {
return {}
};
function Ul(a, b) {
rk.call(this);
if (ka(a)) b && (a = t(a, b));
else if (a && ka(a.handleEvent)) a = t(a.handleEvent, a);
else throw Error("Invalid listener argument");
this.B = a;
ak(this, "tick", t(this.A, this));
this.stop();
sk(this, 5E3 + 2E4 * Math.random())
}
w(Ul, rk);
Ul.prototype.o = 0;
Ul.prototype.A = function () {
if (500 < this.b) {
var a = this.b;
24E4 > 2 * a && (a *= 2);
sk(this, a)
}
this.B()
};
Ul.prototype.start = function () {
Ul.G.start.call(this);
this.o = v() + this.b
};
Ul.prototype.stop = function () {
this.o = 0;
Ul.G.stop.call(this)
};
function Vl(a, b) {
this.H = a;
this.k = b;
this.j = new oh;
this.g = new Ul(this.Qu, this);
this.b = null;
this.F = !1;
this.A = null;
this.D = "";
this.C = this.o = 0;
this.B = []
}
w(Vl, Tl);
f = Vl.prototype;
f.subscribe = function (a, b, c) {
return this.j.subscribe(a, b, c)
};
f.ia = function (a, b, c) {
return this.j.ia(a, b, c)
};
f.Lb = function (a) {
return this.j.Lb(a)
};
f.I = function (a, b) {
return this.j.I.apply(this.j, arguments)
};
f.dispose = function () {
this.F || (this.F = !0, this.j.clear(), this.disconnect(), lh(this.j))
};
f.ea = function () {
return this.F
};
f.connect = function (a, b, c) {
if (!this.b || 2 != this.b.b) {
this.D = "";
this.g.stop();
this.A = a || null;
this.o = b || 0;
a = this.H + "/test";
b = this.H + "/bind";
var d = new Al("1", c ? c.firstTestResults : null, c ? c.secondTestResults : null),
e = this.b;
e && (e.Eb = null);
d.Eb = this;
this.b = d;
e ? this.b.connect(a, b, this.k, e.j, e.Cf) : c ? this.b.connect(a, b, this.k, c.sessionId, c.arrayId) : this.b.connect(a, b, this.k)
}
};
f.disconnect = function (a) {
this.C = a || 0;
this.g.stop();
this.b && (3 == this.b.b && Ml(this.b), this.b.disconnect());
this.C = 0
};
f.sendMessage = function (a, b) {
var c = {
_sc: a
};
b && bc(c, b);
this.g.gd || 2 == (this.b ? this.b.b : 0) ? this.B.push(c) : this.b && 3 == this.b.b && Kl(this.b, c)
};
f.tr = function () {
var a = this.g;
a.stop();
sk(a, 5E3 + 2E4 * Math.random());
this.A = null;
this.o = 0;
if (this.B.length) {
a = this.B;
this.B = [];
for (var b = 0, c = a.length; b < c; ++b) Kl(this.b, a[b])
}
this.I("handlerOpened")
};
f.Yr = function (a, b) {
var c = 2 == b && 401 == this.b.Jc;
if (4 != b && !c) {
if (6 == b || 410 == this.b.Jc) c = this.g, c.stop(), sk(c, 500);
this.g.start()
}
this.I("handlerError", b)
};
f.Gm = function (a, b, c) {
if (!this.g.gd) this.I("handlerClosed");
else if (c)
for (a = 0, b = c.length; a < b; ++a) this.B.push(c[a].map)
};
f.jt = function () {
var a = {
v: 2
};
this.D && (a.gsessionid = this.D);
0 != this.o && (a.ui = "" + this.o);
0 != this.C && (a.ui = "" + this.C);
this.A && bc(a, this.A);
return a
};
f.sr = function (a, b) {
if ("S" == b[0]) this.D = b[1];
else if ("gracefulReconnect" == b[0]) {
var c = this.g;
c.stop();
sk(c, 500);
this.g.start();
this.b.disconnect()
} else this.I("handlerMessage", new mj(b[0], b[1]))
};
f.getDeviceId = function () {
return this.k.id
};
f.Qu = function () {
this.g.stop();
var a = this.b,
b = 0;
a.fb && b++;
a.Kb && b++;
0 != b ? this.g.start() : this.connect(this.A, this.o)
};
function Wl() {
this.b = [];
this.g = []
}
function Xl(a) {
D(a.b) && (a.b = a.g, a.b.reverse(), a.g = [])
}
function Yl(a, b) {
a.g.push(b)
}
function Zl(a) {
Xl(a);
return a.b.pop()
}
f = Wl.prototype;
f.Oa = function () {
return this.b.length + this.g.length
};
f.isEmpty = function () {
return D(this.b) && D(this.g)
};
f.clear = function () {
this.b = [];
this.g = []
};
f.contains = function (a) {
return C(this.b, a) || C(this.g, a)
};
f.remove = function (a) {
var b = eb(this.b, a);
if (0 > b) return ob(this.g, a);
pb(this.b, b);
return !0
};
f.Ta = function () {
for (var a = [], b = this.b.length - 1; 0 <= b; --b) a.push(this.b[b]);
for (var c = this.g.length, b = 0; b < c; ++b) a.push(this.g[b]);
return a
};
function $l(a) {
this.reset(a)
}
function am(a, b) {
if (a.j) throw Error(b + " is not allowed in V3.");
}
function bm(a) {
a.volume = -1;
a.muted = !1;
a.g = null;
a.b = -1;
a.k = null;
a.o = 0;
a.A = v()
}
$l.prototype.reset = function (a) {
this.$a = [];
this.j = "";
this.index = -1;
this.videoId = "";
bm(this);
a && (this.$a = a.videoIds, this.index = a.index, this.j = a.listId, this.videoId = a.videoId, this.b = a.playerState, this.k = a.errorReason, this.volume = a.volume, this.muted = a.muted, this.g = a.trackData, this.o = a.playerTime, this.A = a.playerTimeAt)
};
function cm(a) {
return a.j ? a.videoId : a.$a[a.index]
}
function dm(a, b) {
a.o = b;
a.A = v()
}
function em(a) {
switch (a.b) {
case 1:
return (v() - a.A) / 1E3 + a.o;
case -1E3:
return 0
}
return a.o
}
function fm(a, b) {
am(a, "setVideoId");
var c = a.index;
a.index = db(a.$a, b);
c != a.index && bm(a)
}
function gm(a, b, c) {
var d = a.videoId;
a.videoId = b;
a.index = c;
b != d && bm(a)
}
function hm(a, b, c) {
am(a, "setPlaylist");
c = c || cm(a);
Bb(a.$a, b) && c == cm(a) || (a.$a = sb(b), fm(a, c))
}
$l.prototype.add = function (a) {
am(this, "add");
return a && !C(this.$a, a) ? (this.$a.push(a), !0) : !1
};
$l.prototype.remove = function (a) {
am(this, "remove");
var b = cm(this);
return ob(this.$a, a) ? (this.index = db(this.$a, b), !0) : !1
};
function im(a) {
var b = {};
b.videoIds = sb(a.$a);
b.index = a.index;
b.listId = a.j;
b.videoId = a.videoId;
b.playerState = a.b;
b.errorReason = a.k;
b.volume = a.volume;
b.muted = a.muted;
b.trackData = $b(a.g);
b.playerTime = a.o;
b.playerTimeAt = a.A;
return b
}
$l.prototype.clone = function () {
return new $l(im(this))
};
function jm(a) {
Ki.call(this);
this.b = 0;
this.g = a;
this.o = [];
this.k = new Wl;
this.j = NaN;
var b = 0;
a ? (b = a.getProxyState(), 3 != b && (a.subscribe("proxyStateChange", this.aq, this), km(this))) : b = 3;
0 != b && J(t(function () {
this.aq(b)
}, this), 0)
}
w(jm, Ki);
function lm(a) {
return new $l(a.g.getPlayerContextData())
}
f = jm.prototype;
f.play = function () {
1 == this.b ? (mm(this, "play"), nm(this, 1, em(lm(this))), om(this)) : pm(this, this.play)
};
f.pause = function () {
1 == this.b ? (mm(this, "pause"), nm(this, 2, em(lm(this))), om(this)) : pm(this, this.pause)
};
f.Ur = function (a) {
1 == this.b ? (mm(this, "seekTo", {
newTime: a
}), nm(this, 3, a), om(this)) : pm(this, ra(this.Ur, a))
};
f.stop = function () {
if (1 == this.b) {
mm(this, "stopVideo");
var a = lm(this);
a.index = -1;
a.videoId = "";
bm(a);
qm(this, a);
om(this)
} else pm(this, this.stop)
};
f.setVolume = function (a, b) {
if (1 == this.b) {
var c = {
volume: a,
muted: b
},
d = lm(this); - 1 != d.volume && (c.delta = a - d.volume);
mm(this, "setVolume", c);
d.muted = b;
d.volume = a;
qm(this, d);
om(this)
} else pm(this, ra(this.setVolume, a, b))
};
f.Om = function (a, b) {
if (1 == this.b) {
var c = lm(this);
if (b) {
c.g = {
trackName: b.name,
languageCode: b.languageCode,
sourceLanguageCode: b.translationLanguage ? b.translationLanguage.languageCode : "",
languageName: b.languageName,
format: b.format,
kind: b.kind
};
var d = {
videoId: a,
style: Vd(b.style)
};
bc(d, c.g);
mm(this, "setSubtitlesTrack", d)
} else d = {
videoId: a
}, mm(this, "setSubtitlesTrack", d);
qm(this, c)
} else pm(this, ra(this.Om, a, b))
};
function rm(a, b, c, d, e) {
var g = lm(a);
d = d || 0;
e = {
videoId: b,
currentIndex: d,
listId: e || g.j
};
gm(g, b, d);
n(c) && (dm(g, c), e.currentTime = c);
mm(a, "setPlaylist", e);
qm(a, g)
}
f.ni = function (a, b) {
if (1 == this.b) {
var c = lm(this);
if (a != cm(c)) {
var d;
am(c, "insert");
a && !C(c.$a, a) ? (-1 < c.index && c.index >= c.$a.length - 1 ? c.$a.push(a) : c.$a.splice(c.index + 1, 0, a), d = !0) : d = !1;
d && (d = {
videoId: a
}, mm(this, "insertVideo", d));
fm(c, a);
d = {
videoId: a
};
n(b) && (dm(c, b), d.currentTime = b);
mm(this, "setVideo", d);
qm(this, c)
}
} else pm(this, ra(this.ni, a, b))
};
f.Kk = function (a, b, c) {
if (1 == this.b) {
var d = lm(this),
e = a == cm(d),
d = Bb(b, d.$a);
e ? d || (mm(this, "updatePlaylist", {
videoIds: b.join(",")
}), a = lm(this), hm(a, b), qm(this, a)) : d ? this.ni(a, c) : (mm(this, "setPlaylist", {
videoIds: b.join(","),
videoId: a,
currentTime: c
}), e = lm(this), dm(e, c), hm(e, b, a), qm(this, e))
} else pm(this, ra(this.Kk, a, b, c))
};
f.dispose = function () {
if (3 != this.b) {
var a = this.b;
this.b = 3;
this.I("proxyStateChange", a, this.b)
}
jm.G.dispose.call(this)
};
f.J = function () {
K(this.j);
this.j = NaN;
sm(this);
this.g = null;
this.k.clear();
jm.G.J.call(this)
};
function km(a) {
y(["remotePlayerChange", "remoteQueueChange"], function (a) {
this.o.push(this.g.subscribe(a, ra(this.gC, a), this))
}, a)
}
function sm(a) {
y(a.o, function (a) {
this.g.unsubscribeByKey(a)
}, a);
a.o.length = 0
}
function pm(a, b) {
50 > a.k.Oa() && Yl(a.k, b)
}
function nm(a, b, c) {
var d = lm(a);
dm(d, c); - 1E3 != d.b && (d.b = b);
qm(a, d)
}
function mm(a, b, c) {
a.g.sendMessage(b, c)
}
function qm(a, b) {
sm(a);
a.g.setPlayerContextData(im(b));
km(a)
}
f.aq = function (a) {
if ((a != this.b || 2 == a) && 3 != this.b && 0 != a) {
var b = this.b;
this.b = a;
this.I("proxyStateChange", b, a);
if (1 == a)
for (; !this.k.isEmpty();) Zl(this.k).apply(this);
else 3 == a && this.dispose()
}
};
function om(a) {
K(a.j);
a.j = J(t(function () {
this.I("remotePlayerChange");
this.j = NaN
}, a), 2E3)
}
f.gC = function (a) {
("remotePlayerChange" != a || isNaN(this.j)) && this.I(a)
};
function tm(a, b, c) {
Ki.call(this);
this.P = a;
this.D = [];
this.D.push(R(window, "beforeunload", t(this.ix, this)));
this.j = [];
this.b = new $l;
3 == c["mdx-version"] && (this.b.j = "RQ" + b.token);
this.F = b.id;
this.g = new Vl(qi(this.P, "/bc", void 0, !1), c);
this.g.subscribe("handlerOpened", this.nx, this);
this.g.subscribe("handlerClosed", this.jx, this);
this.g.subscribe("handlerError", this.kx, this);
this.b.j ? this.g.subscribe("handlerMessage", this.lx, this) : this.g.subscribe("handlerMessage", this.mx, this);
a = this.g;
b = b.token;
(a.k.loungeIdToken =
b) || a.g.stop()
}
w(tm, Ki);
f = tm.prototype;
f.vh = NaN;
f.Fn = NaN;
f.Ni = NaN;
f.connect = function (a, b) {
if (b) {
if (this.b.j) {
var c = b.listId,
d = b.videoId,
e = b.index,
g = b.currentTime || 0;
5 >= g && (g = 0);
h = {
videoId: d,
currentTime: g
};
c && (h.listId = c);
n(e) && (h.currentIndex = e);
c && (this.b.j = c);
this.b.videoId = d;
this.b.index = e || 0
} else {
var d = b.videoIds[b.index],
g = b.currentTime || 0;
5 >= g && (g = 0);
var h = {
videoIds: d,
videoId: d,
currentTime: g
};
this.b.$a = [d];
this.b.index = 0
}
this.b.state = 3;
dm(this.b, g);
this.log_("Connecting with setPlaylist and params: " + Vd(h));
this.g.connect({
method: "setPlaylist",
params: Vd(h)
},
a, Xi())
} else this.log_("Connecting without params"), this.g.connect({}, a, Xi());
um(this)
};
f.dispose = function () {
this.ea() || vm(this, 3);
tm.G.dispose.call(this)
};
f.J = function () {
wm(this);
xm(this);
K(this.Ni);
this.Ni = NaN;
this.k = null;
yg(this.D);
this.D.length = 0;
this.g.dispose();
tm.G.J.call(this);
this.j = this.b = this.g = null
};
f.log_ = function (a) {
gh("conn", a)
};
f.ix = function () {
this.A(2)
};
function vm(a, b) {
a.I("proxyStateChange", b)
}
function um(a) {
a.vh = J(t(function () {
this.log_("Connecting timeout");
this.A(1)
}, a), 1E4)
}
function wm(a) {
K(a.vh);
a.vh = NaN
}
function ym(a) {
xm(a);
a.Fn = J(t(function () {
this.o("getNowPlaying")
}, a), 2E4)
}
function xm(a) {
K(a.Fn);
a.Fn = NaN
}
function zm(a) {
var b = a.g;
return !!b.b && 3 == b.b.b && isNaN(a.vh)
}
f.nx = function () {
this.log_("Channel opened");
var a = this.g,
b = this.F;
Ph("yt-remote-session-browser-channel", {
firstTestResults: [""],
secondTestResults: !a.b.Qi,
sessionId: a.b.j,
arrayId: a.b.Cf
});
Ph("yt-remote-session-screen-id", b);
a = Ri();
b = Si();
C(a, b) || a.push(b);
Vi(a);
Qi()
};
f.jx = function () {
this.log_("Channel closed");
isNaN(this.vh) ? cj(!0) : cj();
this.dispose()
};
f.kx = function (a) {
cj();
isNaN(this.B()) ? (this.log_("Channel error: " + a + " without reconnection"), this.dispose()) : (this.log_("Channel error: " + a + " with reconnection in " + this.B() + " ms"), vm(this, 2))
};
function Am(a, b) {
b == zm(a) ? b && vm(a, 1) : b ? (wm(a), a.C() && a.b.reset(), vm(a, 1), a.o("getNowPlaying")) : a.A(1)
}
function Bm(a, b) {
var c = b.params.videoId;
delete b.params.videoId;
c == a.b.videoId && (Wb(b.params) ? a.b.g = null : a.b.g = b.params, a.I("remotePlayerChange"))
}
function Cm(a, b) {
var c = b.params.videoId || b.params.video_id,
d = parseInt(b.params.currentIndex, 10);
a.b.j = b.params.listId;
gm(a.b, c, d);
a.I("remoteQueueChange")
}
function Dm(a, b) {
Cm(a, b);
Em(a, b)
}
function Em(a, b) {
var c = parseInt(b.params.currentTime || b.params.current_time, 10);
dm(a.b, isNaN(c) ? 0 : c);
c = parseInt(b.params.state, 10);
c = isNaN(c) ? -1 : c; - 1 == c && -1E3 == a.b.b && (c = -1E3);
a.b.b = c;
var d = null; - 1E3 == c && (d = a.b.k || "unknown", n(b.params.currentError) && (d = Td(b.params.currentError).reason || d));
a.b.k = d;
1 == a.b.b ? ym(a) : xm(a);
a.I("remotePlayerChange")
}
function Fm(a, b) {
var c = "true" == b.params.muted;
a.b.volume = parseInt(b.params.volume, 10);
a.b.muted = c;
a.I("remotePlayerChange")
}
f.lx = function (a) {
a.params ? this.log_("Received: action=" + a.action + ", params=" + Vd(a.params)) : this.log_("Received: action=" + a.action);
switch (a.action) {
case "loungeStatus":
a = Td(a.params.devices);
this.j = A(a, function (a) {
return new lj(a)
});
a = !!B(this.j, function (a) {
return "LOUNGE_SCREEN" == a.type
});
Am(this, a);
break;
case "loungeScreenConnected":
Am(this, !0);
break;
case "loungeScreenDisconnected":
qb(this.j, function (a) {
return "LOUNGE_SCREEN" == a.type
});
Am(this, !1);
break;
case "remoteConnected":
var b = new lj(Td(a.params.device));
B(this.j, function (a) {
return a.equals(b)
}) || nb(this.j, b);
break;
case "remoteDisconnected":
b = new lj(Td(a.params.device));
qb(this.j, function (a) {
return a.equals(b)
});
break;
case "gracefulDisconnect":
break;
case "playlistModified":
Cm(this, a);
break;
case "nowPlaying":
Dm(this, a);
break;
case "onStateChange":
Em(this, a);
break;
case "onVolumeChanged":
Fm(this, a);
break;
case "onSubtitlesTrackChanged":
Bm(this, a);
break;
default:
this.log_("Unrecognized action: " + a.action)
}
};
f.mx = function (a) {
a.params ? this.log_("Received: action=" + a.action + ", params=" + Vd(a.params)) : this.log_("Received: action=" + a.action);
Gm(this, a);
Hm(this, a);
if (zm(this)) {
var b = this.b.clone(),
c = !1,
d, e, g, h, k, l, q;
a.params && (d = a.params.videoId || a.params.video_id, e = a.params.videoIds || a.params.video_ids, g = a.params.state, h = a.params.currentTime || a.params.current_time, k = a.params.volume, l = a.params.muted, n(a.params.currentError) && (q = Td(a.params.currentError)));
if ("onSubtitlesTrackChanged" == a.action) d == cm(this.b) &&
(delete a.params.videoId, Wb(a.params) ? this.b.g = null : this.b.g = a.params, this.I("remotePlayerChange"));
else if (cm(this.b) || "onStateChange" != a.action) "playlistModified" != a.action && "nowPlayingPlaylist" != a.action || e ? (d || "nowPlaying" != a.action && "nowPlayingPlaylist" != a.action ? d || (d = cm(this.b)) : fm(this.b, ""), e && (e = e.split(","), hm(this.b, e, d))) : hm(this.b, []), this.b.add(d) && this.o("getPlaylist"), d && fm(this.b, d), b.index == this.b.index && Bb(b.$a, this.b.$a) || this.I("remoteQueueChange"), n(g) && (b = parseInt(g, 10), b =
isNaN(b) ? -1 : b, -1 == b && -1E3 == this.b.b && (b = -1E3), 0 == b && "0" == h && (b = -1), c = c || b != this.b.b, this.b.b = b, d = null, -1E3 == b && (d = this.b.k || "unknown", q && (d = q.reason || d)), c = c || this.b.k != d, this.b.k = d, 1 == this.b.b ? ym(this) : xm(this)), "onError" != a.action || -1 != this.b.b && -1E3 != this.b.b || (a = Td(a.params.errors) || [], 1 == a.length && "PLAYER_ERROR" == a[0].error && a[0].videoId == cm(this.b) && (this.b.b = -1E3, this.b.k = a[0].reason || "unknown", c = !0)), h && (b = parseInt(h, 10), dm(this.b, isNaN(b) ? 0 : b), c = !0), n(k) && (b = parseInt(k, 10), isNaN(b) || (c = c ||
this.b.volume != b, this.b.volume = b), n(l) && (l = "true" == l, c = c || this.b.muted != l, this.b.muted = l)), c && this.I("remotePlayerChange")
}
};
function Gm(a, b) {
switch (b.action) {
case "loungeStatus":
var c = Td(b.params.devices);
a.j = A(c, function (a) {
return new lj(a)
});
break;
case "loungeScreenDisconnected":
qb(a.j, function (a) {
return "LOUNGE_SCREEN" == a.type
});
break;
case "remoteConnected":
var d = new lj(Td(b.params.device));
B(a.j, function (a) {
return a.equals(d)
}) || nb(a.j, d);
break;
case "remoteDisconnected":
d = new lj(Td(b.params.device)), qb(a.j, function (a) {
return a.equals(d)
})
}
}
function Hm(a, b) {
var c = !1;
if ("loungeStatus" == b.action) c = !!B(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;
c == zm(a) ? c && vm(a, 1) : c ? (wm(a), a.C() && a.b.reset(), vm(a, 1), a.o("getNowPlaying")) : a.A(1)
}
f.Vx = function () {
if (this.k) {
var a = this.k;
this.k = null;
this.b.videoId != a && this.o("getNowPlaying")
}
};
tm.prototype.subscribe = tm.prototype.subscribe;
tm.prototype.unsubscribeByKey = tm.prototype.Lb;
tm.prototype.M = function () {
var a = 3;
this.ea() || (a = 0, isNaN(this.B()) ? zm(this) && (a = 1) : a = 2);
return a
};
tm.prototype.getProxyState = tm.prototype.M;
tm.prototype.A = function (a) {
this.log_("Disconnecting with " + a);
1 == a && cj();
this.g.disconnect(a);
this.dispose()
};
tm.prototype.disconnect = tm.prototype.A;
tm.prototype.L = function () {
var a = this.b;
this.k && (a = this.b.clone(), gm(a, this.k, a.index));
return im(a)
};
tm.prototype.getPlayerContextData = tm.prototype.L;
tm.prototype.O = function (a) {
var b = new $l(a);
b.videoId && b.videoId != this.b.videoId && (this.k = b.videoId, K(this.Ni), this.Ni = J(t(this.Vx, this), 5E3));
var c = [];
this.b.j == b.j && this.b.videoId == b.videoId && this.b.index == b.index && Bb(this.b.$a, b.$a) || c.push("remoteQueueChange");
this.b.b == b.b && this.b.volume == b.volume && this.b.muted == b.muted && em(this.b) == em(b) && Vd(this.b.g) == Vd(b.g) || c.push("remotePlayerChange");
this.b.reset(a);
y(c, function (a) {
this.I(a)
}, this)
};
tm.prototype.setPlayerContextData = tm.prototype.O;
tm.prototype.H = function () {
return this.g.k.loungeIdToken
};
tm.prototype.getLoungeToken = tm.prototype.H;
tm.prototype.C = function () {
var a = this.g.getDeviceId(),
b = B(this.j, function (b) {
return "REMOTE_CONTROL" == b.type && b.id != a
});
return b ? b.id : ""
};
tm.prototype.getOtherConnectedRemoteId = tm.prototype.C;
tm.prototype.B = function () {
var a = this.g;
return a.g.gd ? a.g.o - v() : NaN
};
tm.prototype.getReconnectTimeout = tm.prototype.B;
tm.prototype.T = function () {
if (!isNaN(this.B())) {
var a = this.g.g;
a.gd && (a.stop(), a.start(), a.A())
}
};
tm.prototype.reconnect = tm.prototype.T;
tm.prototype.o = function (a, b) {
b ? this.log_("Sending: action=" + a + ", params=" + Vd(b)) : this.log_("Sending: action=" + a);
this.g.sendMessage(a, b)
};
tm.prototype.sendMessage = tm.prototype.o;
function Im(a) {
Ki.call(this);
this.k = a;
this.Mc = vi(Zi());
this.log_("Initializing local screens: " + xi(this.Mc));
this.j = Jm();
this.log_("Initializing account screens: " + xi(this.j));
this.Zl = null;
this.b = [];
this.g = [];
Km(this, Aj() || []);
this.log_("Initializing DIAL devices: " + Ai(this.g));
a = vi($i());
Lm(this, a);
this.log_("Initializing online screens: " + xi(this.b));
this.o = v() + 3E5;
Mm(this)
}
w(Im, Ki);
var Nm = [2E3, 2E3, 1E3, 1E3, 1E3, 2E3, 2E3, 5E3, 5E3, 1E4];
f = Im.prototype;
f.Eh = NaN;
f.Gj = "";
f.log_ = function (a) {
gh("RM", a)
};
function Jm() {
var a = vi(Zi()),
b = vi($i());
return fb(b, function (b) {
return !Hi(a, b)
})
}
function Mm(a) {
uh("yt-remote-cast-device-list-update", function () {
var a = Aj();
Km(this, a || [])
}, a);
uh("yt-remote-cast-device-status-update", a.WC, a);
a.Is();
var b = v() > a.o ? 2E4 : 1E4;
Hd(t(a.Is, a), b)
}
f.I = function (a, b) {
if (this.ea()) return !1;
this.log_("Firing " + a);
return this.N.I.apply(this.N, arguments)
};
f.Is = function () {
var a = Aj() || [];
D(a) || Km(this, a);
a = Om(this);
D(a) || (gb(a, function (a) {
return !Hi(this.j, a)
}, this) && !Sh("yt-remote-lounge-token-expiration") ? Pm(this) : Qm(this, a))
};
function Rm(a, b) {
var c = Om(a);
return fb(b, function (a) {
return a.uuid ? (a = Gi(this.g, a.uuid), !!a && "RUNNING" == a.status) : !!Hi(c, a)
}, a)
}
function Km(a, b) {
var c = !1;
y(b, function (a) {
var b = Ii(this.Mc, a.id);
b && b.name != a.name && (this.log_("Renaming screen id " + b.id + " from " + b.name + " to " + a.name), b.name = a.name, c = !0)
}, a);
c && (a.log_("Renaming due to DIAL."), Sm(a));
aj(Di(b));
var d = !Bb(a.g, b, Fi);
d && a.log_("Updating DIAL devices: " + Ai(a.g) + " to " + Ai(b));
a.g = b;
Lm(a, a.b);
d && a.I("onlineReceiverChange")
}
f.WC = function (a) {
var b = Gi(this.g, a.id);
b && (this.log_("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, aj(Di(this.g)));
Lm(this, this.b)
};
function Lm(a, b, c) {
var d = Rm(a, b),
e = !Bb(a.b, d, si);
!e && !c || D(b) || (b = A(d, ti), Ph("yt-remote-online-screens", b, 60));
e && (a.log_("Updating online screens: " + xi(a.b) + " -> " + xi(d)), a.b = d, a.I("onlineReceiverChange"))
}
function Qm(a, b) {
var c = [],
d = {};
y(b, function (a) {
a.token && (d[a.token] = a, c.push(a.token))
});
var e = {
method: "POST",
hd: {
lounge_token: c.join(",")
},
context: a,
onSuccess: function (a, b) {
var c = [];
y(b.screens || [], function (a) {
"online" == a.status && c.push(d[a.loungeToken])
});
var e = this.Zl ? Tm(this, this.Zl) : null;
e && !Hi(c, e) && c.push(e);
Lm(this, c, !0)
}
};
ii(qi(a.k, "/pairing/get_screen_availability"), e)
}
function Pm(a) {
var b = Om(a),
c = A(b, function (a) {
return a.id
});
D(c) || (a.log_("Updating lounge tokens for: " + Vd(c)), ii(qi(a.k, "/pairing/get_lounge_token_batch"), {
hd: {
screen_ids: c.join(",")
},
method: "POST",
context: a,
onSuccess: function (a, c) {
Um(this, c.screens || []);
this.Mc = fb(this.Mc, function (a) {
return !!a.token
});
Sm(this);
Qm(this, b)
}
}))
}
function Um(a, b) {
y(rb(a.Mc, a.j), function (a) {
var d = B(b, function (b) {
return a.id == b.screenId
});
d && (a.token = d.loungeToken)
})
}
function Sm(a) {
var b = vi(Zi());
Bb(a.Mc, b, si) || (a.log_("Saving local screens: " + xi(b) + " to " + xi(a.Mc)), Yi(A(a.Mc, ti)), Lm(a, a.b, !0), Km(a, Aj() || []), a.I("managedScreenChange", Om(a)))
}
function Vm(a, b, c) {
var d = ib(b, function (a) {
return c || a ? !c != !a ? !1 : c.id == a.id : !0
}),
e = 0 > d;
0 > d ? b.push(c) : b[d] = c;
Hi(a.b, c) || a.b.push(c);
return e
}
f.es = function (a, b, c) {
var d = !1;
b >= Nm.length && (this.log_("Pairing DIAL device " + a + " with " + c + " timed out."), d = !0);
var e = Gi(this.g, a);
if (!e) this.log_("Pairing DIAL device " + a + " with " + c + " failed: no device for " + a), d = !0;
else if ("ERROR" == e.status || "STOPPED" == e.status) this.log_("Pairing DIAL device " + a + " with " + c + " failed: launch error on " + a), d = !0;
d ? (Wm(this), this.I("screenPair", null)) : ii(qi(this.k, "/pairing/get_screen"), {
method: "POST",
hd: {
pairing_code: c
},
context: this,
onSuccess: function (a, b) {
if (c == this.Gj) {
Wm(this);
var d = new ri(b.screen);
d.name = e.name;
d.uuid = e.id;
this.log_("Pairing " + c + " succeeded.");
var l = Vm(this, this.Mc, d);
this.log_("Paired with " + (l ? "a new" : "an old") + " local screen:" + wi(d));
Sm(this);
this.I("screenPair", d)
}
},
onError: function () {
c == this.Gj && (this.log_("Polling pairing code: " + c), K(this.Eh), this.Eh = J(t(this.es, this, a, b + 1, c), Nm[b]))
}
})
};
function Xm(a, b, c) {
var d = Ym,
e = "";
Wm(d);
if (Gi(d.g, a)) {
if (!e) {
var g = e = Bi();
sj();
var h = Cj(a),
k = pj();
if (k && h) {
var l = new cast.Receiver(h.id, h.name),
l = new cast.LaunchRequest("YouTube", l);
l.parameters = "pairingCode=" + g;
l.description = new cast.LaunchDescription;
l.description.text = document.title;
b && (l.parameters += "&v=" + b, c && (l.parameters += "&t=" + Math.round(c)), l.description.url = "http://i.ytimg.com/vi/" + b + "/default.jpg");
"UNKNOWN" != h.status && (h.status = "UNKNOWN", yj(h), xh("yt-remote-cast-device-status-update", h));
oj("Sending a cast launch request with params: " + l.parameters);
k.launch(l, ra(Dj, a))
} else oj("No cast API or no cast device. Dropping cast launch.")
}
d.Gj = e;
d.Eh = J(t(d.es, d, a, 0, e), Nm[0])
} else d.log_("No DIAL device with id: " + a)
}
function Wm(a) {
K(a.Eh);
a.Eh = NaN;
a.Gj = ""
}
function Tm(a, b) {
var c = Ii(Om(a), b);
a.log_("Found screen: " + wi(c) + " with key: " + b);
return c
}
function Zm(a) {
var b = Ym,
c = Ii(b.b, a);
b.log_("Found online screen: " + wi(c) + " with key: " + a);
return c
}
function $m(a) {
var b = Ym,
c = Gi(b.g, a);
if (!c) {
var d = Ii(b.Mc, a);
d && (c = Gi(b.g, d.uuid))
}
b.log_("Found DIAL: " + (c ? c.toString() : "null") + " with key: " + a);
return c
}
function Om(a) {
return rb(a.j, fb(a.Mc, function (a) {
return !Hi(this.j, a)
}, a))
};
function an(a) {
a ? ca("yt.mdx.remote.castv2_", !0, void 0) : sj();
Qh && Qh.j();
Qi();
bn || (bn = new pi);
Ym || a || (Ym = new Im(bn), Ym.subscribe("screenPair", cn), Ym.subscribe("managedScreenChange", dn), Ym.subscribe("onlineReceiverChange", function () {
xh("yt-remote-receiver-availability-change")
}));
en || (en = p("yt.mdx.remote.deferredProxies_") || [], ca("yt.mdx.remote.deferredProxies_", en, void 0));
Wb(fn) && (fn = p("yt.mdx.remote.channelParams_") || {})
}
function gn() {
wh(hn);
hn.length = 0;
en && (y(en, function (a) {
a(null)
}), en.length = 0, en = null, ca("yt.mdx.remote.deferredProxies_", null, void 0));
Ym && (lh(Ym), Ym = null);
bn = null;
fn = {};
xj()
}
function jn() {
if (p("yt.mdx.remote.castv2_") && dj()) {
var a = [];
(Sh("yt-remote-cast-available") || kn()) && a.push({
key: "cast-selector-receiver",
name: ln()
});
return a
}
var b = [];
mn() ? b = mn().getOnlineScreens(!0) : b = vi($i());
(a = nn()) && kn() && (Hi(b, a) || b.push(a));
mn() || (a = Ei(bj()), a = fb(a, function (a) {
return !Ii(b, a.id)
}), b = rb(b, a));
return Ci(b)
}
function on() {
var a = jn(),
b = pn(),
c = nn();
c || (c = qn());
return B(a, function (a) {
var e;
if (e = c) e = a.key, e = c.id == e || c.uuid == e;
return e || b && (a = $m(a.key)) && a.id == b ? !0 : !1
})
}
function ln() {
if (p("yt.mdx.remote.castv2_")) return Sh("yt-remote-cast-receivername");
var a = nn();
return a ? a.name : null
}
function nn() {
var a = rn();
if (!a) return null;
if (!Ym) {
var b = mn().getScreens();
return Ii(b, a)
}
return Tm(Ym, a)
}
function sn(a, b) {
tn("Connecting to: " + Vd(a));
if ("cast-selector-receiver" == a.key) un(b || null), kj(b || null);
else {
vn();
un(b || null);
var c = null;
Ym ? c = Zm(a.key) : (c = mn().getOnlineScreens(), c = Ii(c, a.key));
if (c) wn(c);
else {
if (Ym && (c = $m(a.key))) {
xn(c);
return
}
J(function () {
yn(null)
}, 0)
}
}
}
function vn() {
Ym && Wm(Ym);
t: {
var a = kn();
if (a && (a = a.getOtherConnectedRemoteId())) {
tn("Do not stop DIAL due to " + a);
zn("");
break t
}(a = pn()) ? (tn("Stopping DIAL: " + a), Ej(a), zn("")) : (a = nn()) && a.uuid && (tn("Stopping DIAL: " + a.uuid), Ej(a.uuid))
}
gj() ? fj().stopSession() : jj("stopSession called before API ready.");
(a = kn()) && a.disconnect(1);
yn(null)
}
function An() {
var a = Bn(),
a = a ? a.currentTime : 0,
b = Cn();
0 == a && b && (a = em(lm(b)));
return a
}
function Cn() {
var a = kn();
return a ? new jm(a) : null
}
function tn(a) {
gh("remote", a)
}
function mn() {
return p("yt.mdx.remote.screenService_")
}
function rn() {
return p("yt.mdx.remote.currentScreenId_")
}
function Dn(a) {
ca("yt.mdx.remote.currentScreenId_", a, void 0);
if (Ym) {
var b = Ym;
b.o = v() + 3E5;
if ((b.Zl = a) && (a = Tm(b, a)) && !Hi(b.b, a)) {
var c = sb(b.b);
c.push(a);
Lm(b, c, !0)
}
}
}
function pn() {
return p("yt.mdx.remote.currentDialId_")
}
function zn(a) {
ca("yt.mdx.remote.currentDialId_", a, void 0)
}
function Bn() {
return p("yt.mdx.remote.connectData_")
}
function un(a) {
ca("yt.mdx.remote.connectData_", a, void 0)
}
function kn() {
return p("yt.mdx.remote.connection_")
}
function yn(a) {
var b = kn();
un(null);
a ? ab(!kn()) : (Dn(""), zn(""));
ca("yt.mdx.remote.connection_", a, void 0);
y(en, function (b) {
b(a)
});
en.length = 0;
b && !a ? xh("yt-remote-connection-change", !1) : !b && a && xh("yt-remote-connection-change", !0)
}
function qn() {
var a = Ti();
if (!a) return null;
if (mn()) {
var b = mn().getScreens();
return Ii(b, a)
}
return Ym ? Tm(Ym, a) : null
}
function wn(a) {
ab(!rn());
Dn(a.id);
var b = p("yt.mdx.remote.channelParams_");
a = new tm(bn, a, b);
a.connect(1, Bn());
kh(a, function () {
kn() && (kn(), yn(null))
});
yn(a)
}
function xn(a) {
pn();
tn("Connecting to: " + (a ? a.toString() : "null"));
zn(a.id);
var b = Bn();
b ? Xm(a.id, b.videoIds[b.index], b.currentTime) : Xm(a.id)
}
function cn(a) {
tn("Paired with: " + wi(a));
a ? wn(a) : yn(null)
}
function dn() {
var a = rn();
a && !nn() && (tn("Dropping current screen with id: " + a), vn());
qn() || cj()
}
var bn = null,
en = null,
Ym = null,
fn = {},
hn = [];
function En(a) {
a = a.split("");
a = Fn(a, 25);
a = a.reverse();
a = a.slice(1);
a = Fn(a, 49);
a = Fn(a, 52);
return a.join("")
}
function Fn(a, b) {
var c = a[0];
a[0] = a[b % a.length];
a[b] = c;
return a
};
function Gn() {};
var Hn = {
160: "h",
133: "h",
134: "h",
135: "h",
136: "h",
137: "h",
264: "h",
138: "h",
140: "a",
161: "H",
142: "H",
143: "H",
144: "H",
222: "H",
223: "H",
145: "H",
224: "H",
225: "H",
146: "H",
226: "H",
147: "H",
149: "A",
261: "M",
278: "9",
242: "9",
243: "9",
244: "9",
247: "9",
248: "9",
271: "9",
272: "9",
171: "v",
194: "*",
195: "*",
220: "*",
221: "*",
196: "*",
197: "*",
198: "V",
279: "(",
280: "(",
273: "(",
274: "(",
275: "(",
276: "(",
277: "("
};
function In(a, b, c, d, e, g, h) {
this.id = "" + a;
this.j = 0 <= b.indexOf("/mp4") ? 1 : 0 <= b.indexOf("/webm") ? 2 : 0 <= b.indexOf("/x-flv") ? 3 : 0 <= b.indexOf("/vtt") ? 4 : 0;
this.xd = b;
this.ra = h || 0;
this.b = c || null;
this.Wa = d || null;
this.o = e || null;
this.k = g || null;
this.g = Hn[this.id.split(":")[0]] || ""
}
function Jn(a) {
return 2 == a.j
}
function Kn(a) {
return 0 <= a.indexOf("opus") || 0 <= a.indexOf("vorbis") || 0 <= a.indexOf("mp4a")
}
function Ln(a) {
return 0 <= a.indexOf("vp9") || 0 <= a.indexOf("vp8") || 0 <= a.indexOf("avc1")
};
function Mn(a, b, c) {
this.name = a;
this.b = "original" == c
}
Mn.prototype.toString = function () {
return this.name
};
var Vb = {
pE: "auto",
TJ: "tiny",
pI: "light",
SMALL: "small",
xE: "medium",
LARGE: "large",
QH: "hd720",
OH: "hd1080",
PH: "hd1440",
ZH: "highres",
UNKNOWN: "unknown"
},
Nn = {
auto: 0,
tiny: 144,
light: 144,
small: 240,
medium: 360,
large: 480,
hd720: 720,
hd1080: 1080,
hd1440: 1440,
highres: 2160
};
function On(a, b, c, d) {
this.width = a;
this.height = b;
if (!d) t: {
for (d = 2; d < Pn.length; d++) {
var e = Qn[Pn[d]];
if (a > e[0] && b >= e[1] || a >= e[0] && b > e[1]) {
d = Pn[d - 1];
break t
}
}
d = "tiny"
}
this.b = d;
this.g = c || 0
}
var Pn = "auto highres hd1440 hd1080 hd720 large medium small tiny".split(" "),
Qn = {
auto: [0, 0],
tiny: [256, 144],
light: [426, 240],
small: [426, 240],
medium: [640, 360],
large: [854, 480],
hd720: [1280, 720],
hd1080: [1920, 1080],
hd1440: [2560, 1440],
highres: [3840, 2160]
};
function Rn(a, b) {
this.start = a;
this.end = b;
this.length = b - a + 1
}
function Sn(a) {
a = a.split("-");
return 2 == a.length && (a = new Rn(parseInt(a[0], 10), parseInt(a[1], 10)), !isNaN(a.start) && !isNaN(a.end) && !isNaN(a.length) && 0 < a.length) ? a : null
}
function Tn(a, b) {
return new Rn(a, a + b - 1)
}
Rn.prototype.toString = function () {
return this.start + "-" + (null == this.end ? "" : this.end)
};
var Un = RegExp("^https?://([-\\w.]+\\.youtube(education)?\\.com/|[a-z0-9\\-]{1,63}\\.([a-z]{3}|i)\\.corp\\.google\\.com/|yt-devenv-shared\\.corp\\.google\\.com/|(docs|drive)\\.google\\.com/(a/[^/]+/|)|play\\.google\\.com/)"),
Vn = RegExp("^https?://([A-Za-z0-9-]{1,63}\\.)*(corp\\.google\\.com|prod\\.google\\.com|video\\.google\\.com|youtube\\.com|youtube\\.googleapis\\.com|youtube-nocookie\\.com|youtubeeducation\\.com)(:[0-9]+)?([\\/\\?\\#]|$)"),
Wn = RegExp("^https?://([A-Za-z0-9-]{1,63}\\.)*(corp\\.google\\.com|prod\\.google\\.com|video\\.google\\.com|youtube\\.com|youtube\\.googleapis\\.com|youtube-nocookie\\.com|youtubeeducation\\.com)(:[0-9]+)?/embed/"),
Xn = RegExp("^https?://([A-Za-z0-9-]{1,63}\\.)*(corp\\.google\\.com|gdata\\.youtube\\.com|prod\\.google\\.com)(:[0-9]+)?([\\/\\?\\#]|$)"),
Yn = RegExp("^https?://(www\\.google\\.com/(aclk|pagead/conversion)|googleadservices\\.com/(aclk|pagead/conversion)|googleads\\.g\\.doubleclick\\.net/(aclk|pagead/conversion))"),
Zn = RegExp("^https?://([A-Za-z0-9-]{1,63}\\.)*(ba\\.l\\.google\\.com|c\\.googlesyndication\\.com|corp\\.google\\.com|docs\\.google\\.com|drive\\.google\\.com|googleplex\\.com|googlevideo\\.com|play\\.google\\.com|prod\\.google\\.com|sandbox\\.google\\.com|plus\\.google\\.com|ed\\.video\\.google\\.com|vp\\.video\\.l\\.google\\.com|youtube\\.com|youtubeeducation\\.com)(:[0-9]+)?([\\/\\?\\#]|$)"),
$n = RegExp("^https?://(www\\.gstatic\\.com/doubleclick/studio/innovation/ytplayer|([A-Za-z0-9-]{1,63}\\.)*(imasdk\\.googleapis\\.com|2mdn\\.net|corp\\.google\\.com|googlesyndication\\.com|prod\\.google\\.com|static\\.doubleclick\\.net|static\\.googleadsserving\\.cn|studioapi\\.doubleclick\\.net|youtube\\.com|youtube\\.googleapis\\.com|youtube-nocookie\\.com|youtubeeducation\\.com|ytimg\\.com)(:[0-9]+)?([\\/\\?\\#]|$))"),
ao = RegExp("^https?://((www\\.|encrypted\\.)?google(\\.com|\\.co)?\\.[a-z]{2,3}/(search|webhp)\\?|(101epmpngvqtgfsf73utp3aomcvh4be6|mb33edaaot4tnevadfqhve4857kpq1rs|ot5106nq9r49sc62k7h52rtfngv5j94j)-a-hangout-opensocial\\.googleusercontent\\.com/|24e12c4a-a-95274a9c-s-sites.googlegroups.com/a/google.com/flash-api-test-harness/apiharness.swf|([A-Za-z0-9-]{1,63}\\.)*(corp\\.google\\.com|docs\\.google\\.com|drive\\.google\\.com|googleplex\\.com|play\\.google\\.com|prod\\.google\\.com|sandbox\\.google\\.com|plus\\.google\\.com|mail\\.google\\.com|talkgadget\\.google\\.com|survey\\.g\\.doubleclick\\.net|youtube\\.com|youtube-nocookie\\.com|youtubeeducation\\.com|vevo\\.com)(:[0-9]+)?([\\/\\?\\#]|$))");
var bo = "corp.google.com googleplex.com youtube.com youtube-nocookie.com youtubeeducation.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 101epmpngvqtgfsf73utp3aomcvh4be6-a-hangout-opensocial.googleusercontent.com mb33edaaot4tnevadfqhve4857kpq1rs-a-hangout-opensocial.googleusercontent.com ot5106nq9r49sc62k7h52rtfngv5j94j-a-hangout-opensocial.googleusercontent.com survey.g.doubleclick.net".split(" "),
co = "2mdn.net corp.google.com imasdk.googleapis.com static.doubleclick.net studioapi.doubleclick.net googleads.g.doubleclick.net gstatic.com/doubleclick/studio/innovation/ytplayer".split(" "),
eo = "";
function fo(a) {
return a && a == eo ? !0 : go(a, bo) ? (eo = a, !0) : !1
}
function ho(a) {
var b = !!a && -1 != a.search(Zn),
c = fo(a);
b != c && Jd(Error(a + " behavior is not consistent"));
return c
}
function io() {
var a = document.location.toString(),
b = !!a && -1 != a.search(Wn),
c = -1 != a.indexOf("/embed/");
b != c && Jd(Error(a + " behavior is not consistent"));
return c
}
function jo(a) {
var b = !!a && -1 != a.search($n),
c = go(a, co);
c && !b && Jd(Error(a + " behavior is not consistent"));
return c
}
function go(a, b) {
return (new RegExp("^(https?:)?//([a-z0-9-]{1,63}\\.)*(" + b.join("|").replace(/\./g, ".") + ")(:[0-9]+)?([/?#]|$)", "i")).test(a)
}
function ko(a) {
a = new M(a);
vf(a, document.location.protocol);
wf(a, document.location.hostname);
document.location.port && xf(a, document.location.port);
return a.toString()
}
function lo(a) {
a = new M(a);
vf(a, document.location.protocol);
return a.toString()
};
function mo(a, b) {
var c = ff(a),
d = c[6];
if (d && (d = d.match(new RegExp("(^|&)" + b + "=([^&]*)&?")))) return decodeURIComponent(d[2]);
if (c = c[5])
for (c = c.split("/"), c[c.length - 1] || c.pop(), d = c.length - 2; 0 < d; d -= 2)
if (c[d] == b) return decodeURIComponent(c[d + 1])
}
function no(a, b) {
var c = ff(a),
d = c[6];
d && (d = d.replace(new RegExp("(^|&)" + b + "=[^&]*&?"), "$1"), "&" == d.charAt(d.length - 1) && (d = d.substring(0, d.length - 1)));
var e = c[5];
if (e) {
e = e.split("/");
e[e.length - 1] || e.pop();
for (var g = e.length - 2; 0 < g; g -= 2)
if (e[g] == b) {
e.splice(g, 2);
break
}
e = e.join("/")
}
return df(c[1], c[2], c[3], c[4], e, d, c[7])
}
function oo(a, b, c) {
a = ff(a);
var d = !1,
e = a[6];
if (e) {
var g = new RegExp("((^|&)" + b + "=)[^&]*");
0 <= e.search(g) && (e = e.replace(g, "$1" + c), d = !0)
}
if (g = a[5]) {
g = g.split("/");
g[g.length - 1] || g.pop();
for (var h = g.length - 2; 0 < h; h -= 2)
if (g[h] == b) {
g[h + 1] = c;
d = !0;
break
}
g = g.join("/")
}
d || (e = e ? e + "&" + b + "=" + c : b + "=" + c);
return df(a[1], a[2], a[3], a[4], g, e, a[7])
}
function po(a, b) {
var c = a,
d;
for (d in b) null != b[d] && (c = oo(c, d, b[d]));
return c
};
function qo(a, b, c, d, e) {
this.duration = c;
this.endTime = b + c;
this.b = a;
this.sourceURL = d;
this.startTime = b;
this.Z = e || null
};
function ro() {
this.aa = []
}
f = ro.prototype;
f.zm = function (a) {
return (a = so(this, a)) ? a.duration : 0
};
f.Gs = function () {
return this.aa[0].b
};
f.kc = function () {
return this.aa[this.aa.length - 1].b
};
f.Fe = function () {
return this.aa[this.aa.length - 1].endTime
};
f.ej = function () {
return this.aa[0].startTime
};
f.yj = function () {
return 0
};
f.Nn = function (a) {
return (a = to(this, a)) ? a.b : -1
};
f.vs = function (a) {
return so(this, a).sourceURL
};
f.Ri = function (a) {
return (a = so(this, a)) ? a.startTime : 0
};
f.un = function () {
return 0 < this.aa.length
};
function so(a, b) {
var c = xb(a.aa, new qo(b, 0, 0, ""), function (a, b) {
return a.b - b.b
});
return 0 <= c ? a.aa[c] : null
}
function to(a, b) {
var c = xb(a.aa, {
startTime: b
}, function (a, b) {
return a.startTime - b.startTime
});
return 0 <= c ? a.aa[c] : a.aa[Math.max(0, -c - 2)]
}
f.append = function (a) {
if (0 != a.length)
if (a = sb(a), 0 == this.aa.length) this.aa = a;
else {
var b = a[0].b - this.kc();
1 < b && mb(this.aa);
for (b = 0 < b ? 0 : -b + 1; b < a.length; b++) this.aa.push(a[b])
}
};
function uo(a, b) {
var c = ib(a.aa, function (a) {
return a.b >= b
}, a);
0 < c && a.aa.splice(0, c)
};
function vo(a) {
this.b = a;
this.g = 0;
this.j = -1
}
var wo = 0;
function xo(a, b) {
this.index = null;
this.info = b;
this.b = null;
this.o = this.j = !1;
this.A = new vo(a)
}
xo.prototype.Kl = function () {
return !1
};
xo.prototype.mc = function () {
return !1
};
xo.prototype.Cr = function (a) {
return [a]
};
xo.prototype.Ei = function (a) {
return [a]
};
function yo(a, b, c, d, e, g, h, k, l) {
this.b = b;
this.Z = c;
this.type = a;
this.k = 0 <= d ? d : -1;
this.startTime = e || 0;
this.duration = g || 0;
this.j = h || 0;
this.g = 0 <= k ? k : this.Z ? this.Z.length : NaN;
this.C = !!l;
this.Z ? (this.A = this.j + this.g == this.Z.length, this.o = this.startTime + this.duration * this.j / this.Z.length, this.D = this.duration * this.g / this.Z.length) : (this.A = 0 != this.g, this.o = this.startTime, this.D = this.duration);
this.B = this.o + this.D
}
function zo(a) {
return 1 == a.type || 2 == a.type
}
function Ao(a, b) {
return a.b == b.b && a.Z.start + a.j + a.g == b.Z.start + b.j
}
function Bo(a) {
ab(1 == a.length || hb(a, function (a) {
return !!a.Z
}));
for (var b = 1; b < a.length; b++);
b = a[a.length - 1];
return new Rn(a[0].Z.start + a[0].j, b.Z.start + b.j + b.g - 1)
}
function Co(a, b) {
var c;
c = a.b;
var d = a;
c.Eg(d);
if (c.mc()) {
4 == d.type && (d = c.Ei(d), d = d[d.length - 1]);
var e = 0,
g = d.Z.start + d.j + d.g;
3 == d.type && (e = d.k, g == d.Z.end + 1 && (e += 1));
c = Do(c, e, g, b)
} else e = Tn(d.Z.end + 1, b), e.end + 1 > c.g && (e = new Rn(e.start, c.g - 1)), c = [new yo(4, d.b, e)], c = new Eo(c);
return c
}
function Fo(a) {
var b = "i=" + a.b.info.id;
a.Z && (b = b + ",r=" + (a.Z.start + a.j) + "-" + (a.Z.start + a.j + a.g - 1));
return b = b + ",t=" + a.o.toFixed(1) + "," + (a.o + a.D).toFixed(1)
};
function Eo(a, b) {
this.g = a[0].b.A;
this.j = b || "";
this.b = a;
this.Z = this.b[0].Z && 0 < this.b[0].g ? Bo(this.b) : null
}
function Go(a) {
var b;
if (a.j) {
b = a.g.b;
var c = a.j;
if (c) {
b = b.split("?");
var c = c.split("?"),
d = [];
b[1] && d.push(b[1]);
c[1] && d.push(c[1]);
d = d.join("&");
b = b[0];
c[0] && (b = b + "/" + c[0]);
b = d ? b + "?" + d : b
}
} else b = a.g.b;
return a.Z ? oo(b, "range", a.Z.toString()) : b
}
function Ho(a) {
if (a.Z) return a.Z.length;
a = a.b[0];
return Math.round(a.D * a.b.info.ra)
};
function Io(a, b, c, d, e) {
xo.call(this, a, b);
this.index = e || new ro;
this.k = d || null;
this.B = c;
this.g = !0
}
w(Io, xo);
f = Io.prototype;
f.Rl = function () {
return !1
};
f.Gr = function () {
var a = new yo(1, this, this.k);
return [new Eo([a], this.B)]
};
function Jo(a, b) {
a.Eg(b);
return Ko(a, b.A ? b.k + 1 : b.k, !1)
}
f.qi = function (a, b) {
var c = this.index.Nn(a);
b && (c = Math.min(this.index.kc(), c + 1));
return Ko(this, c, !0)
};
f.Cp = function (a) {
this.b = new Uint8Array(Lo(a).buffer)
};
f.Kl = function () {
return !1
};
f.mc = function () {
return null !== this.b && this.index.un()
};
f.Eg = function (a) {
return this.index.kc() > a.k && this.index.Gs() <= a.k + 1
};
f.update = function (a, b, c) {
this.index.append(a);
uo(this.index, c);
this.g = b
};
function Ko(a, b, c) {
var d = a.index.vs(b),
e = a.index.Ri(b),
g = a.index.zm(b);
c ? g = c = 0 : c = 0 < a.info.ra ? a.info.ra * g : 1E3;
a = new yo(3, a, null, b, e, g, 0, c, b == a.index.kc() && !a.g && 0 < c);
return new Eo([a], d)
};
function Mo(a, b) {
return 4294967296 * a.getUint32(b) + a.getUint32(b + 4)
}
function No(a, b) {
if (8 > a.byteLength - b) return !1;
var c = a.getUint32(b);
if (1 == c) {
if (16 > a.byteLength - b) return !1;
c = Mo(a, b + 8)
}
if (0 >= c) return !1;
for (var d = 4; 8 > d; d++) {
var e = a.getInt8(b + d);
if (97 > e || 122 < e) return !1
}
return a.byteLength - b >= c
}
function Oo(a, b, c, d, e) {
this.data = a;
this.b = b;
this.size = c;
this.type = d;
this.g = e
};
function Po(a, b, c, d) {
this.info = a;
this.buffer = b;
this.Z = c;
this.b = d
}
function Lo(a) {
return a.Z ? new DataView(a.buffer, a.Z.start, a.Z.length) : new DataView(a.buffer)
}
function Qo(a) {
if (a.info.g != a.Z.length) return !1;
if (1 == a.info.b.info.j) {
if (8 > a.info.g || 4 == a.info.type) return !0;
var b = Lo(a),
c = b.getUint32(0, !1),
b = b.getUint32(4, !1);
if (2 == a.info.type) return c == a.info.g && 1936286840 == b;
if (3 == a.info.type && 0 == a.info.j) return 1836019558 == b || 1936286840 == b
}
return !0
}
function Ro(a) {
var b;
if (1 == a.info.b.info.j) {
var c = NaN;
b = NaN;
var d = 0;
for (a = new DataView(a.buffer); No(a, d);) {
var e;
e = a;
var g = d,
h = e.getUint32(g),
k = e.getUint32(g + 4),
l = 8;
1 == h && (h = Mo(e, g + 8), l = 16);
1836019558 == k || 1953653094 == k || (l = 0);
e = new Oo(e, g, h, k, l);
1936286840 == e.type ? b = e.data.getUint32(e.b + 16) : 1952867444 == e.type && (c = e, c = c.data.getUint8(c.b + 8) ? Mo(c.data, c.b + 12) : c.data.getUint32(c.b + 12));
g = e.type;
d = 1836019558 == g || 1953653094 == g ? d + e.g : d + e.size
}
b = c / b
} else b = NaN;
return b
};
function So() {
this.da = 0;
this.b = new Float64Array(128);
this.g = new Float64Array(128);
this.k = 1;
this.j = !1
}
f = So.prototype;
f.yj = function (a) {
return this.b[a]
};
f.Ri = function (a) {
return this.g[a] / this.k
};
f.zm = function (a) {
return a + 1 < this.da || this.j ? (this.g[a + 1] - this.g[a]) / this.k : -1
};
f.Gs = function () {
return 0
};
f.kc = function () {
return this.da - 1
};
f.Fe = function () {
return this.j ? this.g[this.da] / this.k : NaN
};
f.ej = function () {
return 0
};
f.vs = function () {
return ""
};
f.Nn = function (a) {
a = xb(this.g.subarray(0, this.da), a * this.k);
return 0 <= a ? a : Math.max(0, -a - 2)
};
f.un = function () {
return 0 <= this.kc()
};
function To(a) {
if (a.b.length < a.da + 1) {
var b = 2 * a.b.length,
b = b + 2,
c = a.b;
a.b = new Float64Array(b + 1);
var d = a.g;
a.g = new Float64Array(b + 1);
for (b = 0; b < a.da + 1; b++) a.b[b] = c[b], a.g[b] = d[b]
}
}
function Uo(a, b) {
this.g = a;
this.b = 0;
this.j = b || 0
}
function Vo(a) {
for (var b = Wo(a, !1); 236 == b;) Xo(a), b = Wo(a, !1);
return b
}
function Yo(a) {
var b = Wo(a, !0),
c = a.g.byteOffset + a.b,
d = Math.min(b, a.g.buffer.byteLength - c),
c = new DataView(a.g.buffer, c, d),
c = new Uo(c, a.j + a.b);
a.b += b;
return c
}
function Zo(a) {
for (var b = Wo(a, !0), c = $o(a), d = 1; d < b; d++) c = (c << 8) + $o(a);
return c
}
function Xo(a) {
var b = Wo(a, !0);
a.b += b
}
function Wo(a, b) {
var c = $o(a);
if (1 == c) {
for (var d = c = 0; 7 > d; d++) c = 256 * c + $o(a);
return c
}
for (var e = 128, d = 0; 6 > d && e > c; d++) c = 256 * c + $o(a), e *= 128;
return b ? c - e : c
}
function $o(a) {
return a.g.getUint8(a.b++)
};
function ap(a, b, c, d, e) {
xo.call(this, a, b);
this.C = c;
this.B = d;
this.k = null;
this.index = new So;
this.g = e
}
w(ap, xo);
f = ap.prototype;
f.mc = function () {
return !(!this.b || !this.index.un())
};
f.Gr = function (a) {
var b = new yo(1, this, this.C),
c = new yo(2, this, this.B),
d = [],
e = [b];
Ao(b, c) ? e.push(c) : (d.push(new Eo([c])), a = 0);
isNaN(this.g) ? a = 0 : a > this.g && (a = this.g);
b = e[e.length - 1];
c = b.Z.end - e[0].Z.start + 1;
a > c && (a = Tn(b.Z.end + 1, a - c), e.push(new yo(4, this, a)));
d.push(new Eo(e));
return d
};
f.Cp = function (a) {
if (1 == a.info.type) {
if (this.b) return;
this.b = new Uint8Array(a.buffer, a.Z.start, a.Z.length)
} else if (2 == a.info.type) {
if (this.k || 0 <= this.index.kc()) return;
if (1 == this.info.j) {
var b = this.index,
c = Lo(a),
d = a.info.Z.start;
a = 0;
var e = c.getUint32(0, !1),
g = c.getUint8(a + 8);
a += 12;
var h = c.getUint32(a + 4, !1);
b.k = h;
a += 8;
0 == g ? (g = c.getUint32(a, !1), h = c.getUint32(a + 4, !1), a += 8) : (g = (c.getUint32(a, !1) << 32) + c.getUint32(a + 4, !1), h = (c.getUint32(a + 8, !1) << 32) + c.getUint32(a + 12, !1), a += 16);
b.b[0] = h + (e + d);
b.g[0] = g;
b.j = !0;
d = c.getUint16(a + 2, !1);
a += 4;
for (e = 0; e < d; e++) {
var k = c.getUint32(a, !1),
h = c.getUint32(a + 4, !1);
a += 12;
g = b;
g.da++;
To(g);
g.b[g.da] = g.b[g.da - 1] + k;
g.g[g.da] = g.g[g.da - 1] + h
}
} else this.k = Lo(a)
}
if (Jn(this.info) && this.b && this.k) {
c = new DataView(this.b.buffer, this.b.byteOffset, this.b.byteLength);
b = this.index;
g = this.k;
c = new Uo(c);
if (440786851 == Vo(c) && (Xo(c), 408125543 == Vo(c))) {
d = c;
e = d.b;
a = Wo(d, !0);
d.b = e;
for (var c = Yo(c), d = c.j + c.b, l = Vo(c); 357149030 != l;) Xo(c), l = Vo(c);
c = Yo(c);
h = 1E6;
k = 1E9;
for (e = 0; !(c.b >= c.g.byteLength);)
if (l =
Vo(c), 2807729 == l) h = Zo(c);
else if (2807730 == l) k = Zo(c);
else if (17545 == l) {
var e = c,
l = Wo(e, !0),
q = 0;
4 == l ? q = e.g.getFloat32(e.b) : 8 == l && (q = e.g.getFloat64(e.b));
e.b += l;
e = q
} else Xo(c);
b.k = k / h;
c = new Uo(g);
if (475249515 == Vo(c)) {
for (c = Yo(c); !(c.b >= c.g.byteLength);)
if (l = Vo(c), 187 == l) {
g = Yo(c);
h = d;
if (179 != Vo(g)) k = null;
else if (k = Zo(g), 183 != Vo(g)) k = null;
else {
g = Yo(g);
for (l = h; !(g.b >= g.g.byteLength);) 241 == Vo(g) ? l = Zo(g) + h : Xo(g);
k = [l, k]
}
g = b;
h = k[0];
k = k[1];
To(g);
g.b[g.da] = h;
g.g[g.da] = k;
g.da++
} else Xo(c);
c = a + d;
a = e;
To(b);
b.j = !0;
b.g[b.da] = a;
b.b[b.da] = c
}
}
this.k = null
}
};
function Do(a, b, c, d) {
for (var e = []; b <= a.index.kc(); b++) {
var g;
g = a.index;
var h = b;
g = Tn(g.yj(h), h + 1 < g.da || g.j ? g.b[h + 1] - g.b[h] : -1);
var h = a.index.Ri(b),
k = a.index.zm(b),
l = Math.max(0, c - g.start),
q = Math.min(g.end + 1, c + d) - (g.start + l);
e.push(new yo(3, a, g, b, h, k, l, q, b == a.index.kc() && l + q == g.length));
if (g.start + l + q >= c + d) break
}
return new Eo(e)
}
f.Cr = function (a) {
for (var b = this.Ei(a.info), c = [], d = a.b, e = 0; e < b.length; e++) {
var g = Tn(b[e].Z.start + b[e].j - a.info.Z.start + a.Z.start, b[e].g);
c.push(new Po(b[e], a.buffer, g, d));
d = !1
}
return c
};
f.Ei = function (a) {
for (var b = 0; b < this.index.kc() && a.Z.start >= this.index.yj(b + 1);) b++;
return Do(this, b, a.Z.start, a.Z.length).b
};
f.Eg = function (a) {
return this.mc() ? !0 : isNaN(this.g) ? !1 : a.Z.end + 1 < this.g
};
f.qi = function (a, b) {
var c = this.index.Nn(a);
b && (c = Math.min(this.index.kc(), c + 1));
return Do(this, c, this.index.yj(c), 0)
};
f.Kl = function () {
var a;
if (a = this.mc() && !isNaN(this.g)) a = this.index, a = (a.j ? a.b[a.da] : -1) != this.g;
return a
};
f.Rl = function () {
return !0
};
function bp(a) {
this.A = this.duration = 0;
this.g = !1;
this.B = v();
this.o = Infinity;
this.b = {};
this.D = a || "";
this.j = this.k = !1
}
function cp(a) {
return Mb(a.b, function (a) {
return !!a.info.k
}, a)
}
var dp = /PT(([0-9]*)H)?(([0-9]*)M)?(([0-9.]*)S)?/;
function ep(a) {
var b = new bp;
y(a, function (a) {
var d = a.type,
e = a.itag,
g = null;
Ln(d) && (g = a.size.split("x"), g = new On(parseInt(g[0], 10), parseInt(g[1], 10)));
var h = null,
k = null;
if (Kn(d)) {
var h = new Gn,
l = a.lang,
q = a.acont;
l && q && (k = a.name, e = e + ":" + l + ":" + q, k = new Mn(k, 0, q))
}
d = new In(e, d, h, g, k, null, parseInt(a.bitrate, 10) / 8);
g = Sn(a.init);
h = Sn(a.index);
l = fp(a.url, d, a.s);
a = parseInt(a.clen, 10);
l && (b.b[e] = new ap(l, d, g, h, a))
});
return b
}
function gp(a) {
if (!a) return 0;
var b = dp.exec(a);
return b ? 3600 * parseFloat(b[2] || 0) + 60 * parseFloat(b[4] || 0) + parseFloat(b[6] || 0) : parseFloat(a)
}
function hp(a, b) {
for (var c = a; c; c = c.parentNode)
if (c.attributes) {
var d = c.attributes[b];
if (d) return d.value
}
return ""
}
function ip(a, b) {
for (var c = a; c; c = c.parentNode) {
var d = c.getElementsByTagName(b);
if (0 < d.length) return d[0]
}
return null
}
function fp(a, b, c) {
if (!ho(a)) return "";
var d = {
alr: "yes",
ratebypass: "yes"
};
mo(a, "mime") || (d.mime = encodeURIComponent(b.xd.split(";")[0]));
c && (d.signature = En(c));
return po(a, d)
}
function jp(a) {
var b = hp(a, "id");
"captions" == b && (b = hp(a, "lang"));
var c = hp(a, "mimeType"),
d = hp(a, "codecs"),
c = d ? c + '; codecs="' + d + '"' : c,
d = parseInt(hp(a, "bandwidth"), 10) / 8,
e = null;
Ln(c) && (e = new On(parseInt(hp(a, "width"), 10), parseInt(hp(a, "height"), 10)));
var g = null,
h = null;
if (Kn(c)) {
g = new Gn;
var h = hp(a, "lang") || "",
k = ip(a, "Role");
if (k) {
var k = hp(k, "value") || "",
l = "invalid";
"main" == k ? l = "original" : "dub" == k ? l = "dubbed" : "descriptive" == k ? l = "descriptive" : "commentary" == k && (l = "commentary");
h = "invalid" != l && h ? new Mn(b,
0, l) : null
} else h = null
}
k = null;
if (a = ip(a, "ContentProtection"))
if ((k = a.attributes.schemeIdUri) && "http://youtube.com/drm/2012/10/10" == k.textContent)
for (k = {}, a = a.firstChild; null != a; a = a.nextSibling) "yt:SystemURL" == a.nodeName && (k[a.attributes.type.textContent] = a.textContent.trim());
else k = null;
return new In(b, c, g, e, h, k, d)
}
function kp(a, b, c, d) {
a.k = !0;
a = {
format: "RAW",
method: "GET",
zb: t(a.C, a, c, d || null)
};
ii(b, a)
}
bp.prototype.C = function (a, b, c) {
if (200 <= c.status && 400 > c.status) {
b = c.responseText;
c = (new DOMParser).parseFromString(b, "text/xml").getElementsByTagName("MPD")[0];
b = c.getElementsByTagName("Representation");
if (0 < c.getElementsByTagName("SegmentList").length)
for (this.o = 1E3 * gp(hp(c, "minimumUpdatePeriod")) || Infinity, this.g = Infinity > this.o, this.j = !0, this.A = parseInt(hp(c, "yt:earliestMediaSequence"), 10), c = 0; c < b.length; c++) {
var d = jp(b[c]);
if (!this.b[d.id]) {
var e = fp(ip(b[c], "BaseURL").textContent, d),
g = ip(b[c],
"Initialization"),
h = hp(g, "sourceURL"),
g = Sn(hp(g, "range"));
this.b[d.id] = new Io(e, d, h, null === g ? void 0 : g)
}
var k = ip(b[c], "SegmentList"),
l = ip(k, "SegmentTimeline"),
e = l.getElementsByTagName("S"),
h = k.getElementsByTagName("SegmentURL"),
g = (g = hp(k, "start")) ? gp(g) : 0,
q = parseInt(hp(l, "startNumber"), 10) || 0,
k = parseInt(hp(k, "yt:earliestMediaSequence"), 10);
q < k && (q = k);
for (var l = parseInt(hp(l, "timescale"), 10) || 1, k = [], s = 0; s < h.length; s++) {
var u;
u = q + s;
var z = g,
F = l,
L = h[s],
F = parseFloat(e[s].getAttribute("d")) / F,
ba = L.getAttribute("media"),
kb = null,
L = L.getAttribute("mediaRange");
null != L && (0 <= parseInt(L.split("-")[1], 10) ? kb = Sn(L) : ba = ba + "?range=" + L);
u = new qo(u, z, F, ba, kb);
k.push(u);
g += u.duration
}
this.b[d.id].update(k, this.g, this.A)
} else i: for (this.duration = gp(hp(c, "mediaPresentationDuration")), c = 0; c < b.length; c++) {
g = b[c];
d = jp(g);
h = ip(g, "BaseURL");
e = fp(h.textContent, d);
q = ip(g, "SegmentBase");
g = Sn(q.attributes.indexRange.value);
q = Sn(q.getElementsByTagName("Initialization")[0].attributes.range.value);
h = parseInt(h.getAttribute("yt:contentLength"),
10);
d = new ap(e, d, q, g, h);
if (!d) break i;
this.b[d.info.id] = d
}
this.B = v();
a && a(this)
} else b && b(c);
this.k = !1
};
function lp(a, b) {
Lb(a.b, function (a) {
a = a.A;
a.b = po(a.b, b)
})
};
function mp(a, b) {
this.id = a;
this.name = b
}
mp.prototype.toString = function () {
return this.name
};
function np(a, b, c) {
this.g = a || 0;
this.b = b || 0;
this.j = c
}
np.prototype.equals = function (a) {
return this.g == a.g && this.b == a.b && this.j == a.j
};
function op(a, b, c) {
return new np(Nn[a] || 0, Nn[b] || 0, c)
}
var pp = op("auto", "large", !1),
qp = op("auto", "auto", !1);
function rp(a) {
var b = Nn.auto;
return a.g == b && a.b == b
}
function sp(a) {
return a.j && !!a.g && a.g == a.b
}
function tp(a, b) {
if (b.j && rp(b)) return qp;
if (b.j || rp(a)) return b;
if (a.j || rp(b)) return a;
var c = a.g && b.g ? Math.max(a.g, b.g) : a.g || b.g,
d = a.b && b.b ? Math.min(a.b, b.b) : a.b || b.b,
c = Math.min(c, d);
return c == a.g && d == a.b ? a : new np(c, d, !1)
}
function up(a) {
var b = a.b || a.g;
return Ub(function (a) {
return Nn[a] == b
}) || "auto"
}
np.prototype.k = function (a) {
if (!a.Wa) return !1;
a = Nn[a.Wa.b];
return this.g <= a && (!this.b || this.b >= a)
};
function vp(a, b) {
this.g = a;
this.b = b || null
}
function wp(a, b) {
var c = b || qp,
c = fb(a.g, t(c.k, c)),
c = A(c, function (a) {
return a.Wa.b
});
wb(c);
return c
}
function xp(a) {
if (!a.b) return [];
var b = [];
y(a.b, function (a) {
a.o && b.push(new mp(a.id, a.o.name))
});
wb(b);
return b
};
function yp(a, b, c, d, e, g, h, k, l) {
this.k = {};
this.B = a;
this.D = b;
this.g = c;
this.b = d;
this.j = e;
this.C = g;
this.o = h;
this.A = k;
this.F = l
}
function zp(a, b) {
var c = a.C,
c = c.replace("$N", a.o),
c = c.replace("$L", a.F.toString()),
c = c.replace("$M", b.toString());
a.A && (c = qf(c, {
sigh: a.A
}));
return c
}
function Ap(a, b) {
var c = Math.floor(b / (a.b * a.j)),
d = a.b * a.j,
e = b % d,
g = e % a.b,
e = Math.floor(e / a.b),
h = a.j,
k = a.g - d * c;
k < d && (h = Math.ceil(k / a.b));
return {
url: zp(a, c),
ky: g,
$i: a.b,
row: e,
rows: h,
Cq: a.B * a.b,
Bq: a.D * h
}
};
function Bp(a) {
var b = [];
a = a.split("|");
for (var c = a[0], d, e, g, h, k, l, q, s, u = 1; u < a.length; u++) d = a[u].split("#"), e = u - 1, g = parseInt(d[0], 10), h = parseInt(d[1], 10), 180 <= h || (k = parseInt(d[2], 10), l = parseInt(d[3], 10), q = parseInt(d[4], 10), s = d[6], d = d[7], b.push(new yp(g, h, k, l, q, c, s, d, e)));
this.b = b;
this.g = {};
1 < this.b.length && -1 != this.b[0].o.indexOf("default") && this.b.splice(0, 1)
}
function Cp(a, b) {
var c = a.b[0].g - 1;
return Fb(Math.round(c * b), 0, c)
}
function Dp(a, b) {
var c = a.g[b];
if (c) return c;
for (var c = a.b.length, d = 0; d < c; d++)
if (a.b[d].B >= b) return a.g[b] = d;
a.g[b] = c - 1;
return c - 1
};
var Ep = {
0: "MONO",
1: "LEFT_RIGHT",
2: "RIGHT_LEFT",
3: "TOP_BOTTOM",
4: "BOTTOM_TOP"
};
var Fp = {
uI: 1,
vI: 2,
wI: 3
};
var Gp;
var Hp = dc,
Hp = Hp.toLowerCase();
if (La(Hp, "android")) {
var Ip = Hp.match(/android\D*(\d\.\d)[^\;|\)]*[\;\)]/);
if (Ip) Gp = Number(Ip[1]);
else {
var Jp = {
cupcake: 1.5,
donut: 1.6,
eclair: 2,
froyo: 2.2,
gingerbread: 2.3,
honeycomb: 3,
"ice cream sandwich": 4,
jellybean: 4.1
},
Kp = Hp.match("(" + Rb(Jp).join("|") + ")");
Gp = Kp ? Jp[Kp[0]] : 0
}
} else Gp = void 0;
var Lp, Mp;
function Np() {
var a = p("yt.player.utils.videoElement_");
a || (a = document.createElement("video"), ca("yt.player.utils.videoElement_", a, void 0));
return a
}
function Op() {
if (2.2 == Gp) return !0;
var a = Np();
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 Pp() {
var a = I("div", {
"class": "html5-player-css-loaded"
});
document.body.appendChild(a);
var b = "none" == me(a, "display");
hd(a);
return b
};
function Qp() {
var a;
if (void 0 == Lp && (Lp = !1, window.crypto && window.crypto.getRandomValues)) try {
a = new Uint8Array(1), window.crypto.getRandomValues(a), Lp = !0
} catch (b) {}
if (Lp) {
a = Array(16);
var c = new Uint8Array(16);
window.crypto.getRandomValues(c);
for (var d = 0; d < a.length; d++) a[d] = c[d]
} else
for (a = Array(16), c = 0; 16 > c; c++) {
for (var d = v(), e = 0; e < d % 23; e++) a[c] = Math.random();
a[c] = Math.floor(256 * Math.random())
}
return a
}
function Rp() {
for (var a = Qp(), b = [], c = 0; c < a.length; c++) b.push("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_".charAt(a[c] & 63));
return b.join("")
}
function Sp() {
return A(Qp(), function (a) {
return (a & 15).toString(16)
}).join("")
};
function Tp(a, b, c) {
b = {
cpn: b
};
c && (b.ibw = "1369843");
return {
url: qf(a, b),
type: "application/x-mpegURL",
quality: "auto",
itag: "93"
}
};
function Up(a, b) {
return void 0 == b ? a : "1" == b ? !0 : !1
}
function Vp(a, b, c) {
for (var d in c)
if (c[d] == b) return c[d];
return a
}
function Wp(a, b) {
return void 0 == b ? a : Number(b)
}
function Xp(a, b) {
return void 0 == b ? a : b.toString()
}
function Yp(a, b) {
var c = Xp(a, b);
c && (c = ko(c));
return c
}
var Zp = /^([0-9\.]+)\:([0-9\.]+)$/;
function $p(a) {
if (a && (a = a.match(Zp))) {
var b = parseFloat(a[2]);
if (0 < b) return parseFloat(a[1]) / b
}
return NaN
}
function aq(a, b) {
var c = Nn.auto,
d = Nn[b];
return d >= Nn.medium ? new np(d, c, !1) : d >= c ? new np(c, d, !1) : a
};
var bq, cq = window.performance || window.mozPerformance || window.msPerformance || window.webkitPerformance || {},
dq = t(cq.clearResourceTimings || cq.webkitClearResourceTimings || cq.mozClearResourceTimings || cq.msClearResourceTimings || cq.oClearResourceTimings || da, cq),
eq = cq.mark ? function (a) {
cq.mark(a)
} : da;
function fq(a, b, c) {
gq(c).tick[a] = b || v();
b || eq(a)
}
function hq(a, b) {
var c = gq(b).tick;
return a in c
}
function iq(a) {
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];
Qd(b + "?" + c.substring(1))
}
function jq(a) {
return gq(a).info
}
function gq(a) {
return p("ytcsi." + (a || "") + "data_") || kq(a)
}
function kq(a) {
var b = {
tick: {},
span: {},
info: {}
};
ca("ytcsi." + (a || "") + "data_", b, void 0);
return b
};
var lq, mq;
var nq = dc,
oq = nq.match(/\((iPad|iPhone|iPod)( Simulator)?;/);
if (!oq || 2 > oq.length) lq = void 0;
else {
var pq = nq.match(/\((iPad|iPhone|iPod)( Simulator)?; (U; )?CPU (iPhone )?OS (\d_\d)[_ ]/);
lq = pq && 6 == pq.length ? Number(pq[5].replace("_", ".")) : 0
}(mq = 0 <= lq) && 0 <= dc.search("Safari") && dc.search("Version");
var qq = {
qI: 0,
AH: 1,
fI: 2
};
function rq(a, b, c) {
c = c || {};
oi(c.Va, c.cb, t(sq, m, a, b, c), c.onError)
}
function sq(a, b, c) {
var d = {};
0 === b ? d.action_like_video = 1 : 1 === b ? d.action_dislike_video = 1 : d.action_indifferent_video = 1;
d.video_id = a;
d.plid = c.Bb;
c.Na && (d.list = c.Na);
c.Va && (d.authuser = c.Va);
c.cb && (d.pageid = c.cb);
a = {
screen: of({
h: screen.height,
w: screen.width,
d: screen.colorDepth
}),
session_token: Fd("XSRF_TOKEN")
};
c.oD && (a.station_id = c.oD);
ii("/watch_actions_ajax", {
format: "XML",
method: "POST",
Fh: d,
hd: a,
onSuccess: c.onSuccess,
onError: c.onError,
zb: c.zb
})
};
var tq = [.25, .5, 1, 1.5, 2];
function uq(a) {
this.b = (a || "").split(",");
var b = {};
y(this.b, function (a) {
b[a] = !0
});
this.Ia = !!b["925900"];
this.F = !!b["913424"];
this.B = !!b["932250"];
this.Aa = !!b["945000"];
this.ua = !!b["945004"];
this.P = !!b["945005"];
this.M = !!b["945013"];
this.ka = !!b["945025"];
this.oa = !!b["945030"];
this.ja = !!b["945031"];
this.$ = !!b["945035"];
this.H = !!b["945042"];
this.T = !!b["945045"];
this.Da = !!b["945047"];
this.N = !!b["945056"];
this.ub = !!b["927845"];
this.U = !!b["936926"];
this.D = !!b["913430"];
this.k = !!b["926301"];
this.C = !!b["926304"];
this.g = !!(b["931959"] || b["931960"] || b["931961"] || b["931962"] || b["931963"] || b["931973"] || b["931974"] || b["931979"]);
this.W = !(!b["931974"] && !b["931960"]);
this.Vc = !!b["931972"];
this.j = !!b["907252"];
this.va = !!b["927877"];
this.ca = !!b["943602"];
this.O = !!b["934026"];
this.L = !!b["907253"];
this.qa = !!b["939937"];
this.Ba = !!b["936927"];
this.Ca = !!b["927884"];
this.Ma = !!b["934028"];
this.A = !!b["924218"];
this.o = !!b["924220"]
};
function vq(a, b) {
this.b = a;
this.g = b
}
vq.prototype.clone = function () {
return new vq(this.b, this.g)
};
function wq(a) {
this.b = [];
if (a) t: {
var b, c;
if (a instanceof wq) {
if (b = a.Xa(), c = a.Ta(), 0 >= a.Oa()) {
a = this.b;
for (var d = 0; d < b.length; d++) a.push(new vq(b[d], c[d]));
break t
}
} else b = Rb(a), c = Qb(a);
for (d = 0; d < b.length; d++) xq(this, b[d], c[d])
}
}
function xq(a, b, c) {
var d = a.b;
d.push(new vq(b, c));
b = d.length - 1;
a = a.b;
for (c = a[b]; 0 < b;)
if (d = b - 1 >> 1, a[d].b > c.b) a[b] = a[d], b = d;
else break;
a[b] = c
}
f = wq.prototype;
f.remove = function () {
var a = this.b,
b = a.length,
c = a[0];
if (!(0 >= b)) {
if (1 == b) mb(a);
else {
a[0] = a.pop();
for (var a = 0, b = this.b, d = b.length, e = b[a]; a < d >> 1;) {
var g = 2 * a + 1,
h = 2 * a + 2,
g = h < d && b[h].b < b[g].b ? h : g;
if (b[g].b > e.b) break;
b[a] = b[g];
a = g
}
b[a] = e
}
return c.g
}
};
f.Ta = function () {
for (var a = this.b, b = [], c = a.length, d = 0; d < c; d++) b.push(a[d].g);
return b
};
f.Xa = function () {
for (var a = this.b, b = [], c = a.length, d = 0; d < c; d++) b.push(a[d].b);
return b
};
f.$f = function (a) {
return gb(this.b, function (b) {
return b.g == a
})
};
f.clone = function () {
return new wq(this)
};
f.Oa = function () {
return this.b.length
};
f.isEmpty = function () {
return D(this.b)
};
f.clear = function () {
mb(this.b)
};
function yq() {
wq.call(this)
}
w(yq, wq);
function zq(a, b) {
Ki.call(this);
this.b = a;
this.j = new yq;
this.o = {};
this.k = b || ""
}
w(zq, Ki);
zq.prototype.g = !1;
function Aq(a, b, c) {
var d;
for (c = Dp(a.b, c); 0 <= c;) {
d = a.b.b[c];
if (d = d.k[Math.floor(b / (d.b * d.j))] ? Ap(d, b) : null) return d;
c--
}
return Ap(a.b.b[0], b)
}
function Bq(a) {
if (!a.g)
if (a.j.isEmpty()) a.g = !1;
else {
a.g = !0;
var b = a.j.remove(),
c = new Image;
a.k && (c.crossOrigin = a.k);
c.src = zp(a.b.b[b.Sp], b.Tp);
c.onload = t(a.A, a, b.Sp, b.Tp)
}
}
zq.prototype.A = function (a, b) {
this.g = !1;
var c = this.b.b[a];
c.k[b] = !0;
Bq(this);
var d, e = c.b * c.j;
d = b * e;
c = Math.min(d + e - 1, c.g - 1);
d = [d, c];
this.I("l", d[0], d[1])
};
function Cq(a, b, c) {
this.g = a;
this.b = b;
this.j = c
}
var Dq = {
playready: ["com.youtube.playready", "com.microsoft.playready"],
widevine: ["com.widevine.alpha"],
clearkey: ["org.w3.clearkey", "webkit-org.w3.clearkey"]
},
Eq = ["widevine", "playready"];
function Fq() {
var a = window.MediaKeys || window.MSMediaKeys;
return a && a.isTypeSupported ? a : null
}
function Gq(a, b, c) {
var d, e = Fq();
if (e) d = function (a, b) {
return e.isTypeSupported(b, a)
};
else if (a.addKey || a.webkitAddKey) d = function (b, c) {
return a.canPlayType(b, c)
};
else return null;
for (var g = 0; g < Eq.length; g++) {
var h = Eq[g];
if (c[h])
for (var k = Dq[h], l = 0; l < k.length; l++) {
var q = k[l];
if (d(b, q) || 0 == b.indexOf("audio/mp4") && "widevine" == h && a.canPlayType(b) && a.canPlayType('video/mp4; codecs="avc1"', q)) return new Cq(h, q, c[h])
}
}
return null
};
function Hq(a, b) {
this.b = a;
this.j = b;
this.k = 0;
Object.defineProperty(this, "timestampOffset", {
get: this.iA,
set: this.jA
});
Object.defineProperty(this, "buffered", {
get: this.hA
})
}
f = Hq.prototype;
f.append = function (a) {
this.b.webkitSourceAppend(this.j, a)
};
f.abort = function () {
this.b.webkitSourceAbort(this.j)
};
f.hA = function () {
return this.b.webkitSourceState == this.b.SOURCE_CLOSED ? new Iq : this.b.webkitSourceBuffered(this.j)
};
f.iA = function () {
return this.k
};
f.jA = function (a) {
this.k = a;
this.b.webkitSourceTimestampOffset(this.j, a)
};
function Iq() {
this.length = 0
};
function Jq(a) {
this.activeSourceBuffers = this.sourceBuffers = [];
this.b = a;
this.g = NaN;
this.j = 0;
Object.defineProperty(this, "duration", {
get: this.Kz,
set: this.Nz
});
Object.defineProperty(this, "readyState", {
get: this.Lz
});
this.b.addEventListener("webkitsourceclose", t(this.Mz, this), !0)
}
f = Jq.prototype;
f.addEventListener = function (a, b, c) {
this.b.addEventListener(a, b, c)
};
f.Xz = function () {
return this.b.webkitMediaSourceURL
};
f.addSourceBuffer = function (a) {
var b = (this.j++).toString();
this.b.webkitSourceAddId(b, a);
a = new Hq(this.b, b);
this.sourceBuffers.push(a);
return a
};
f.Lz = function () {
switch (this.b.webkitSourceState) {
case this.b.SOURCE_CLOSED:
return "closed";
case this.b.SOURCE_OPEN:
return "open";
case this.b.SOURCE_ENDED:
return "ended"
}
return ""
};
f.endOfStream = function (a) {
var b = this.b.EOS_NO_ERROR;
"network" == a ? b = this.b.EOS_NETWORK_ERR : "decode" == a && (b = this.b.EOS_DECODE_ERR);
this.b.webkitSourceEndOfStream(b)
};
f.Mz = function () {
mb(this.sourceBuffers)
};
f.Kz = function () {
return this.g
};
f.Nz = function (a) {
this.g = a;
this.b.webkitSourceSetDuration && this.b.webkitSourceSetDuration(a)
};
function Kq(a) {
this.k = [];
this.F = a || null
}
function Lq(a, b, c, d) {
for (var e = 0; e < c.length; e++) a.listen(b, c[e], d)
}
Kq.prototype.listen = function (a, b, c) {
c = t(c, this.F || this);
a.addEventListener(b, c, !1);
this.k.push(a, b, c)
};
Kq.prototype.removeAll = function () {
if (this.k)
for (; this.k.length;) {
var a = this.k.shift(),
b = this.k.shift(),
c = this.k.shift();
a.removeEventListener && a.removeEventListener(b, c)
}
};
Kq.prototype.ea = function () {
return null === this.k
};
Kq.prototype.dispose = function () {
this.removeAll();
this.k = null
};
function Mq(a, b, c, d) {
Kq.call(this);
this.j = this.b = null;
this.A = b;
this.g = window.MediaSource ? new window.MediaSource : window.WebKitMediaSource ? new window.WebKitMediaSource : HTMLMediaElement.prototype.webkitSourceAddId ? new Jq(a) : null;
this.o = "";
this.B = null;
Lq(this, this.g, ["sourceopen", "webkitsourceopen"], ra(this.D, d, c));
Lq(this, this.g, ["sourceclose", "webkitsourceclose"], this.C)
}
w(Mq, Kq);
function Nq(a, b) {
a.B = b
}
function Oq(a) {
if (!a.o) {
var b;
b = a.g;
b = b.Xz ? b.b.webkitMediaSourceURL : window.URL.createObjectURL(b);
a.o = b
}
return a.o
}
Mq.prototype.uf = function (a) {
Pq(this) ? this.g.duration = a : this.A = a
};
function Pq(a) {
return "open" == a.g.readyState
}
function Qq(a) {
return "closed" == a.g.readyState
}
function Rq(a) {
return a.b.updating || a.j.updating
}
function Sq(a) {
return a.b ? !!a.b.appendBuffer : !(!window.MediaSource || !window.MediaSource.isTypeSupported)
}
Mq.prototype.D = function (a, b) {
isNaN(this.A) || (this.g.duration = this.A, this.A = NaN, this.b = this.g.addSourceBuffer(a), this.j = this.g.addSourceBuffer(b), this.B && (this.B(this), this.B = null))
};
Mq.prototype.C = function () {
this.dispose()
};
Mq.prototype.dispose = function () {
var a = this.o;
if (a) try {
window.URL.revokeObjectURL(a)
} catch (b) {}
this.o = "";
Mq.G.dispose.call(this)
};
function Tq(a) {
if (window.MediaSource && window.MediaSource.isTypeSupported) return window.MediaSource.isTypeSupported(a);
if ('video/webm; codecs="vp9"' == a) return !1;
'audio/mp4; codecs="mp4a.40.2"' == a && (a = 'video/mp4; codecs="avc1.4d401f"');
return !!Np().canPlayType(a)
};
var Uq = Tg || Ug;
function Vq() {
return Wq("(ps3; leanback shell)")
}
function Wq(a) {
var b = dc;
return b ? 0 <= b.toLowerCase().indexOf(a.toLowerCase()) : !1
};
function Xq(a, b, c, d) {
this.b = c;
this.j = a;
this.o = d || "";
this.k = b;
this.g = {}
}
function Yq(a) {
if (a.b) a = a.j;
else if (a.k) {
var b = Pf(new M(a.j), "id"),
b = "http://www.youtube.com/api/manifest/t2b/source/youtube/id/" + encodeURIComponent(b),
b = b + ("/itag/" + a.o),
b = b + "/mfmt/amf";
a = Af(new M(qf(a.j, a.g)), b).toString()
} else a = qf(a.j, a.g);
return a
};
function Zq(a, b) {
this.b = new Xq(a, b.id in $q && Vq(), !1, b.id);
this.Of = b
}
var ar = "9h8(H*".split(""),
br = "h98(H*".split(""),
cr = ["M", "a", "v", "A", "V"];
Zq.prototype.getInfo = function () {
return this.Of
};
Zq.prototype.Kn = function () {
return this.Of.Wa.b
};
var dr = {
'video/mp4; codecs="avc1.42001E, mp4a.40.2"': "maybe"
},
er = {
"application/x-mpegURL": "maybe"
},
fr = {
"application/x-mpegURL": "maybe"
};
function gr(a, b) {
if (!Op()) return [];
var c = hr(a, b);
a = !c.length && b ? hr(a, !1) : c;
for (var d = {}, c = Np(), e = 0; e < a.length; e++) {
var g = a[e];
if (ir(c, g.getInfo().xd) && !(g.Of.id in jr || Vq() && "5" == g.Of.id)) {
var h = g.Kn();
if (!d[h] || Jn(d[h].getInfo())) d[h] = g
}
}
var k = [];
y(Pn, function (a) {
(g = d[a]) && k.push(g)
});
return k
}
function ir(a, b) {
var c;
if (!(c = a.canPlayType(b))) {
var d;
Ug ? d = fr[b] : 2.2 == Gp ? d = dr[b] : Wq("android") && Wq("chrome") && (d = er[b]);
c = d || ""
}
return c
}
function kr() {
return Wq("android") && Wq("chrome") && !zc(29) ? !1 : !!(window.MediaSource || window.WebKitMediaSource || window.HTMLMediaElement && HTMLMediaElement.prototype.webkitSourceAddId)
}
var $q = {
5: !0,
34: !0,
35: !0
},
jr = {
52: !0,
53: !0,
54: !0,
55: !0,
60: !0,
79: !0,
87: !0
};
function lr(a) {
var b = [];
y(a, function (a) {
a.url && b.push(mr(a.url, a.type, "medium", "0"))
});
return b
}
function mr(a, b, c, d, e) {
var g = new Gn,
h = Qn[c];
h || (c = "small", h = Qn.small);
c = new On(h[0], h[1], e ? -1 : 0, c);
b = unescape(b.replace(/&quot;/g, '"'));
return new Zq(a, new In(d, b, g, c))
}
function hr(a, b) {
for (var c = [], d = 0; d < a.length; d++) {
var e = a[d],
g;
if (g = pc && 0 != e.Of.Wa.g) g = 1 == e.getInfo().j;
g || 0 != e.Of.Wa.g == b && c.push(e)
}
return c
}
function nr(a, b) {
for (var c = [], d = 0; d < a.length; d++) {
var e = a[d];
if (e.sig || e.s) {
var g = e.sig || En(e.s);
e.url = bi(e.url, {
signature: g
})
}
e.url && c.push(mr(e.url, e.type, e.quality, e.itag, e.stereo3d))
}
return gr(c, !!b)
}
function or(a) {
a = lr(a);
return gr(a, !1)
}
function pr(a, b) {
if (!b.b) return a[0];
for (var c = 0; c < a.length; c++) {
var d = a[c].getInfo();
if (Nn[d.Wa.b] <= b.b) return a[c]
}
return a[a.length - 1]
}
function qr(a) {
function b(a) {
return !!c[a]
}
var c = {},
d, e;
for (e in a.b) {
var g = a.b[e];
if (Tq(g.info.xd)) {
if (g.info.k) {
d || (d = Np());
if (!Gq(d, g.info.xd, g.info.k)) continue;
if (261 == g.info.id && (Vq() || !d.canPlayType('audio/mp4; codecs="aac51"', "com.widevine.alpha"))) continue
}
c[g.info.g] = c[g.info.g] || [];
c[g.info.g].push(g.info)
}
}
a = ar;
!Wq("cros armv7") && !Wq("windows nt 5.1") || (a = br);
d = B(a, b);
a = B(cr, b);
if (!d || !a) return null;
d = c[d];
a = c[a];
zb(d, function (a, b) {
return b.Wa.width - a.Wa.width || b.ra - a.ra
});
zb(a, function (a,
b) {
return b.ra - a.ra
});
return new vp(d, a)
};
function rr(a) {
Ki.call(this);
this.Ia = new G(0, 0);
this.ka = !1;
this.D = [];
this.k = {};
this.Ba = {};
this.o = {};
sr(this, a)
}
w(rr, Ki);
rr.A = /\/img\/watermark\/youtube_(hd_)?watermark(-vfl\S{6})?.png$/;
rr.b = 1;
rr.j = -21;
rr.o = 18E3;
rr.k = "author cc_asr cc_load_policy iv_load_policy iv_new_window keywords requires_purchase rvs sentiment subscribed title ttsurl ypc_buy_url ypc_full_video_length ypc_item_thumbnail ypc_item_title ypc_item_url ypc_offer_button_text ypc_offer_description ypc_offer_headline ypc_offer_id ypc_preview ypc_price_string ypc_video_rental_bar_text".split(" ");
rr.g = ["www.youtube.com", "manifest.googlevideo.com"];
f = rr.prototype;
f.fa = !1;
f.Pm = "";
f.oq = !0;
f.Ab = !1;
f.Tm = "";
f.Sm = "";
f.El = !1;
f.lq = rr.b;
f.Mh = null;
f.zo = null;
f.th = "";
f.Sn = 0;
f.ig = 0;
f.Hk = !1;
f.xo = 3;
f.gr = !1;
f.Af = "";
f.Ea = "";
f.nf = 0;
f.rk = !1;
f.Wh = !1;
f.Dk = !1;
f.pf = 0;
f.Qe = !1;
f.qp = !1;
f.Lh = 0;
f.lg = !1;
f.ho = !0;
f.kk = !1;
f.Km = !1;
f.Jm = !1;
f.qb = !1;
f.Lm = !1;
f.Yl = !1;
f.xe = !1;
f.Yo = !1;
f.Mm = !1;
f.mv = 0;
f.Pa = 0;
f.Wj = 0;
f.Ds = !1;
f.Bm = "";
f.fk = !1;
f.am = qp;
f.Jo = 0;
f.uk = !1;
f.Ya = 0;
f.Vj = null;
f.gm = 2;
f.rf = qp;
f.Qr = !1;
f.Jf = !1;
f.Ae = null;
f.title = "";
f.Be = "";
f.En = null;
f.Es = !1;
f.jo = !1;
f.tg = 0;
f.ai = Infinity;
function tr(a, b) {
var c = b || {};
c.iv_invideo_url && (a.Tm = ko(c.iv_invideo_url));
c.iv_cta_url && (a.Sm = ko(c.iv_cta_url));
c.cta_conversion_urls && (a.mb = c.cta_conversion_urls);
a.th = Xp(a.th, c.author);
a.Hk = Up(a.Hk, c.cc_asr);
var d = c.ttsurl || a.Af;
d && fo(d) ? a.Af = d : a.Af = Yp(a.Af, c.ttsurl);
a.Ea = Xp(a.Ea, c.cpn);
a.L = Xp(a.L, c.subscribed);
a.gm = Vp(a.gm, c.sentiment, qq);
a.title = Xp(a.title, c.title);
a.ua = Xp(a.ua, c.ypc_preview);
a.Ds = Up(a.Ds, c.paygated);
a.Es = Up(a.Es, c.requires_purchase);
c.keywords && (a.Ba = ur(c.keywords));
c.rvs &&
(a.W = vr(c.rvs));
c.poster && (a.Bm = c.poster);
y(rr.k, function (a) {
a in c && (this.k[a] = c[a])
}, a)
}
function sr(a, b) {
var c = b || {};
a.Ab = "1" != c.hlsdvr || Xg || Ug && 5 > lq ? !1 : !0;
a.El = "1" == c.infringe || "1" == c.muted;
a.dr = c.authkey;
a.Va = c.authuser;
a.Ea || (a.Ea = c.cpn || Rp());
a.$j = v();
a.gg = c.t;
a.rk = Up(a.rk, c.cenchd);
a.Wh = Up(a.Wh, c.enable_cardio);
a.Dk = Up(a.Dk, c.enable_cardio_before_playback);
a.pf = Wp(a.pf, c.end || c.endSeconds);
a.ho = "1" != c.no_get_video_log;
a.kk = "1" == c.tmi;
a.Km = Up(a.Km, c.noiba);
a.Jm = "1" == c.livemonitor;
a.qb = "1" == c.live_playback;
a.Lm = Up(a.Lm, c.mdx);
a.Yl = Up(a.Yl, c.on3g);
a.Mm = Up(a.Mm, c.utpsa);
a.Or = c.iurlmaxres_webp ||
c.iurlmaxres;
a.B = Xp(a.B, c.oauth_token);
a.C = Xp(a.C, c.vvt);
a.hg = c.osig;
a.tb = c.ptchn;
a.Tb = c.oid;
a.M = c.ptk;
a.gc = c.pltype;
a.Bb = c.plid;
a.A = c.eventid;
a.Ma = c.osid;
a.Na = Xp(a.Na, c.list);
a.sd = c.pyv_view_beacon_url;
a.dk = c.pyv_quartile25_beacon_url;
a.bk = c.pyv_quartile50_beacon_url;
a.zl = c.pyv_quartile75_beacon_url;
a.jg = c.pyv_quartile100_beacon_url;
a.ak = c.purchase_id;
a.Ua = c.sdetail;
a.Xj = c.sourceid;
!a.Aa && c.session_data && (a.Aa = Wh(c.session_data, "&").feature);
a.kb = 1 == Wp(a.kb ? 1 : 0, c.is_fling);
a.hb = Xp(a.hb, c.ctrl);
a.ib =
Xp(a.ib, c.ytr);
a.Pr = c.iurlsd_webp || c.iurlsd;
a.jo = "1" == c.skip_kansas_logging;
a.am = aq(a.am, c.vq);
a.rf = aq(a.rf, c.suggestedQuality);
a.Zj = c.approx_threed_layout || 0;
a.Qr = "1" == c.threed_converted;
a.Aj = c.iurl_webp || c.iurl;
a.Ya = Wp(a.Ya, c.start || c.startSeconds);
a.videoId = c.docid || c.video_id || c.videoId;
wr(a, c.watermark);
a.rd = Xp(a.rd, c.ypc_gid);
a.of = Xp(a.of, c.ypc_license_session_token);
if (c.ad3_module || c.ad_module) "1" == c.allow_html5_ads ? (a.fa = !0, "1" == c.ad_preroll && a.D.push("ad")) : "1" != c.supported_without_ads &&
(a.qp = !0);
c.adaptive_fmts && (a.Pm = c.adaptive_fmts);
c.allow_embed && (a.oq = "1" == c.allow_embed);
c.autoplay && (a.lg = "1" == c.autoplay);
c.iv_load_policy && (a.va = xr(c.iv_load_policy, a.va));
c.cc_load_policy && (a.xo = xr(c.cc_load_policy, 2));
"0" == c.dash && (a.gr = !0);
if (c.dashmpd) {
a.O = qf(c.dashmpd, {
cpn: a.Ea
});
var d = /\/s\/([0-9A-F.]+)/,
e = d.exec(a.O);
e && (e = En(e[1]), a.O = a.O.replace(d, "/signature/" + e))
}
c.delay && (a.nf = Ya(c.delay));
c.idpj && (a.Lh = Ya(c.idpj));
c.url_encoded_fmt_stream_map && (a.Be = c.url_encoded_fmt_stream_map);
c.hlsvp && (a.T = c.hlsvp);
c.length_seconds && (a.Pa = Ya(c.length_seconds));
c.ldpj && (a.Wj = Ya(c.ldpj));
c.loudness && (a.xc = c.loudness, a.lq = yr(a));
c.partnerid && (a.Ud = Ya(c.partnerid));
c.probe_url && (a.zc = lo(qf(c.probe_url, {
cpn: a.Ea
})));
c.pyv_billable_url && -1 != c.pyv_billable_url.search(Yn) && (a.H = c.pyv_billable_url);
c.pyv_conv_url && -1 != c.pyv_conv_url.search(Yn) && (a.ja = c.pyv_conv_url);
c.url_encoded_third_party_media && (a.Ae = vr(c.url_encoded_third_party_media));
c.threed_module && !c.threed_converted && (a.oa = c.threed_module,
a.ck = 6);
if ("1" == c.track_embed || c.tk) a.fk = !0;
c.two_stage_token && (a.Mh = c.two_stage_token);
c.watch_ajax_token && (a.zo = c.watch_ajax_token);
c.fresca_preroll && a.D.push("fresca");
c.ypc_module && a.D.push("ypc");
c.ypc_clickwrap_module && a.D.push("ypc_clickwrap");
c.spacecast_address && (a.D.push("spacecast"), a.Da = c.spacecast_address);
void 0 != c.start && (a.tg = c.start);
void 0 != c.end && (a.ai = c.end);
void 0 != c.atc && (a.$ = c.atc);
a.td = Xp(a.td, c.ucid);
y("baseUrl uid oeid ieid ppe engaged subscribed".split(" "), function (a) {
this.o[a] =
c[a]
}, a);
a.o.focEnabled = "1" == c.focEnabled;
a.o.rmktEnabled = "1" == c.rmktEnabled;
a.Sn = zr(c.rmktPingThreshold, c.length_seconds);
a.k = c;
tr(a, c);
Ar(a)
}
function Ar(a) {
(a.qb || a.Jm) && "1" == a.k.as3fb || !kr() || a.gr || (a.Pm ? a.j = ep(Br(a, a.Pm)) : a.O && (a.Qe = !0, a.ka = !0))
}
f.Oz = function (a) {
if (!this.ea()) {
if (this.j = a) this.Pa = this.j.duration || this.Pa;
this.$l()
}
};
f.$l = function () {
this.ea() || (this.Qe = !1, this.I("dataloaded", this.k))
};
function Cr(a) {
if (!a.ea()) {
a.g = null;
a.P = null;
a.F = null;
if (a.U) {
var b = Br(a, a.U);
a.F = nr(b, !1);
a.g = new vp(A(a.F, function (a) {
return a.getInfo()
}))
}!a.g && a.j && (a.g = qr(a.j));
if (!a.g) {
if (a.Ae && a.Yo) a.F = or(a.Ae);
else {
b = Br(a, a.Be);
if (a.T) {
var c = Tp(a.T, a.Ea, !a.Yl);
b.push(c)
}
a.F = nr(b, !!a.oa || a.Jf)
}
a.F.length && (a.g = new vp(A(a.F, function (a) {
return a.getInfo()
})))
}
a.Jo = Math.min(.8 * a.Pa, 180)
}
}
function Dr(a) {
return a.b && a.b.k || null
}
function Er(a, b) {
return r(a.Ba[b]) ? a.Ba[b] : null
}
function Fr(a) {
!a.En && a.k.storyboard_spec && (a.En = new Bp(a.k.storyboard_spec));
return a.En
}
function Gr(a) {
var b = Fr(a);
!a.Vj && b && (a.Vj = new zq(b), S(a, a.Vj));
return a.Vj
}
function Hr(a) {
return !a.ea() && !(!a.videoId && !a.Ae)
}
function Ir(a) {
return Hr(a) && !a.Qe && !a.ka && (!!(a.j || a.Be || a.Ae || a.U || a.T) || C(a.D, "fresca") || C(a.D, "ypc"))
}
function Jr(a, b) {
var c = {
format: "RAW",
method: "GET",
context: a,
onSuccess: a.TD,
onError: a.SD
};
a.Qe = !0;
ii(b, c);
fq("vir")
}
function yr(a) {
return a.xc ? (a = Math.min(rr.j - a.xc, 0), Math.pow(10, a / 20)) : rr.b
}
f.TD = function (a) {
this.ea() || (this.Qe = !1, a = Yh(a.responseText), "fail" == a.status ? this.I("onStatusFail", a) : (fq("virc"), sr(this, a), this.$l()))
};
f.SD = function () {
this.ea() || (this.Qe = !1, this.I("onStatusFail", {
errorcode: 100,
reason: ""
}))
};
function xr(a, b) {
var c = parseInt(a, 10);
return Sb(Fp, c) ? c : b
}
function vr(a) {
a = a.split(",");
return a = a.map(function (a) {
return Yh(a)
})
}
function Br(a, b) {
var c = vr(b);
y(c, function (a) {
a.url && (a.url = qf(a.url, {
cpn: this.Ea
}))
}, a);
return c
}
function ur(a) {
var b = {};
y(a.split(","), function (a) {
var d = a.split("=");
2 == d.length ? b[d[0]] = d[1] : b[a] = !0
});
return b
}
function wr(a, b) {
if (b) {
var c = b.split(",");
2 <= c.length && (a.qa = c[1], -1 != a.qa.search(rr.A) && (a.qa = ""))
}
}
function Kr(a, b) {
return !!a.k[b]
}
function zr(a, b) {
var c = Ya(b),
d = Ya(a);
return isNaN(d) || isNaN(c) ? 0 : Math.min(d, c)
}
function Lr(a) {
return a.qb && !a.Ab
}
function Mr(a) {
return a.qb && a.Ab
};
function Nr(a, b) {
this.type = a || "";
this.id = b || ""
}
function Or(a) {
return new Nr(a.substr(0, 2), a.substr(2))
}
Nr.prototype.toString = function () {
return this.type + this.id
};
function Pr(a) {
Ki.call(this);
this.views = 0;
this.b = [];
this.g = [];
this.Ha = Math.max(0, a.index || 0);
this.Lf = !!a.loop;
this.ym = a.startSeconds || 0;
this.Nq = "1" == a.mob;
this.title = a.playlist_title || "";
this.description = a.playlist_description || "";
a.video_id && (this.b[this.Ha] = a);
a.api && ("string" == typeof a.api && 16 == a.api.length ? a.list = "PL" + a.api : a.playlist = a.api);
if (a.list) switch (a.listType) {
case "user_uploads":
Qr(this, a.list);
break;
case "user_favorites":
Rr(this, a.list);
break;
case "search":
Sr(this, a.list);
break;
default:
a.playlist_length &&
(this.Zb = a.playlist_length), this.j = Or(a.list), 0 == a.fetch && a.videoList ? Tr(this, a.videoList) : Ur(this)
} else if (a.playlist) {
var b = a.playlist.toString().split(",");
0 < this.Ha && (this.b = []);
y(b, function (a) {
a && this.b.push({
video_id: a
})
}, this);
this.Zb = this.b.length;
b = A(this.b, function (a) {
return a.video_id
});
Vr(this, "/list_ajax?style=json&action_get_templist=1", {
video_ids: b.join(",")
});
this.je = !0
} else a.videoList && Tr(this, a.videoList);
Wr(this, !!a.shuffle)
}
w(Pr, Ki);
f = Pr.prototype;
f.Lf = !1;
f.ym = 0;
f.qr = !1;
f.Ha = 0;
f.title = "";
f.Zb = 0;
f.Nq = !1;
f.je = !1;
f.zh = !1;
f.Pe = null;
function Xr(a) {
return a.Lf || a.Ha + 1 < a.Zb
}
function Yr(a) {
if (++a.Ha >= a.Zb)
if (a.Lf) a.Ha = 0;
else return null;
Zr(a, a.Ha);
return $r(a, a.Ha)
}
function as(a) {
if (0 > --a.Ha)
if (a.Lf) a.Ha = a.Zb - 1;
else return null;
Zr(a, a.Ha);
return $r(a, a.Ha)
}
function $r(a, b) {
var c = void 0 != b ? b : a.Ha,
c = a.b && c in a.b ? a.b[a.g[c]] : null,
d = null;
c && (d = new rr(c), d.Ya = a.ym || d.tg || 0, a.j && (d.Na = a.j.toString()));
return d
}
function Wr(a, b) {
a.qr = b;
var c = a.g && null != a.g[a.Ha] ? a.g[a.Ha] : a.Ha;
a.g = [];
for (var d = 0; d < a.b.length; d++) a.g.push(d);
a.Ha = c;
if (a.qr) {
c = a.g[a.Ha];
for (d = 1; d < a.g.length; d++) {
var e = Math.floor(Math.random() * (d + 1)),
g = a.g[d];
a.g[d] = a.g[e];
a.g[e] = g
}
for (d = 0; d < a.g.length; d++) a.g[d] == c && (a.Ha = d)
}
a.I("shuffle")
}
function Zr(a, b) {
a.Ha = Fb(b, 0, a.Zb - 1);
a.ym = 0
}
function Qr(a, b) {
a.zh || (a.j = new Nr("UU", "PLAYER_" + b), Vr(a, "/list_ajax?style=json&action_get_user_uploads_by_user=1", {
username: b
}))
}
function Rr(a, b) {
a.zh || (a.j = new Nr("FL", "PLAYER_" + b), Vr(a, "/list_ajax?style=json&action_get_favorited_by_user=1", {
username: b
}))
}
function Sr(a, b) {
if (!a.zh) {
a.j = new Nr("SR", b);
var c = {
search_query: b
};
a.Nq && (c.mob = "1");
Vr(a, "/search_ajax?style=json&embeddable=1", c)
}
}
function Ur(a) {
if (!a.zh) {
var b = {
list: a.j
},
c = $r(a);
c && c.videoId && (b.v = c.videoId);
Vr(a, "/list_ajax?style=json&action_get_list=1", b)
}
}
function Vr(a, b, c) {
ii(qf(b, c), {
format: "JSON",
onSuccess: function (a, b) {
bs(this, b)
},
context: a
})
}
function bs(a, b) {
if (b.video && b.video.length) {
a.title = b.title;
a.description = b.description;
a.views = b.views;
var c = $r(a);
a.b = [];
y(b.video, function (a) {
a && (a.video_id = a.encrypted_id, this.b.push(a))
}, a);
a.Zb = a.b.length;
cs(a, c);
Wr(a, !1);
a.zh = !1;
a.je = !0;
a.Pe && a.Pe()
}
}
function Tr(a, b) {
0 < a.Ha && (a.b = []);
y(b, function (a) {
this.b.push(a)
}, a);
a.Zb = a.b.length;
a.je = !0
}
function cs(a, b) {
if (b) {
var c = b.videoId;
if (!a.b[a.Ha] || a.b[a.Ha].video_id != c)
for (var d = 0; d < a.b.length; d++)
if (a.b[d].video_id == c) {
a.Ha = d;
break
}
}
}
f.J = function () {
this.Pe = null;
nh(this.b);
Pr.G.J.call(this)
};
function ds() {
var a = {
volume: 100,
muted: !1
},
b = Sh("yt-player-volume") || {};
a.volume = isNaN(b.volume) ? 100 : Fb(b.volume, 0, 100);
a.muted = void 0 == b.muted ? !1 : b.muted;
return a
};
function es(a, b, c) {
r(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 fs(a)
}
function fs(a, b, c) {
if (la(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 gs(a, b) {
this.app = a;
this.g = null;
this.k = {};
this.o = {};
this.B = {};
this.A = {};
this.j = null;
this.b = b;
V(this, "cueVideoById", this.jw);
V(this, "loadVideoById", this.Cl);
V(this, "cueVideoByUrl", this.kw);
V(this, "loadVideoByUrl", this.Gw);
V(this, "playVideo", this.Lg);
V(this, "pauseVideo", this.pauseVideo);
V(this, "stopVideo", this.yk);
V(this, "clearVideo", this.hw);
V(this, "getVideoBytesLoaded", this.xw);
V(this, "getVideoBytesTotal", this.yw);
V(this, "getVideoLoadedFraction", this.Il);
V(this, "getVideoStartBytes", this.Aw);
V(this, "cuePlaylist", this.iw);
V(this, "loadPlaylist", this.Fw);
V(this, "nextVideo", this.Hw);
V(this, "previousVideo", this.Iw);
V(this, "playVideoAt", this.zp);
V(this, "setShuffle", this.Ow);
V(this, "setLoop", this.Lw);
V(this, "getPlaylist", this.lc);
V(this, "getPlaylistIndex", this.Hl);
V(this, "getPlaylistId", this.yp);
V(this, "loadModule", this.Ew);
V(this, "unloadModule", this.xp);
V(this, "setOption", this.wp);
V(this, "getOption", this.ji);
V(this, "getOptions", this.tw);
V(this, "mute", this.Po);
V(this, "unMute", this.Qo);
V(this,
"isMuted", this.Oo);
V(this, "setVolume", this.setVolume);
V(this, "getVolume", this.No);
V(this, "seekTo", this.Mg);
V(this, "getPlayerState", this.getPlayerState);
V(this, "getPlaybackRate", this.vw);
V(this, "setPlaybackRate", this.Nw);
V(this, "getAvailablePlaybackRates", this.ow);
V(this, "getPlaybackQuality", this.uw);
V(this, "setPlaybackQuality", this.rp);
V(this, "getAvailableQualityLevels", this.qw);
V(this, "getCurrentTime", this.getCurrentTime);
V(this, "getDuration", this.yg);
V(this, "addEventListener", this.addEventListener);
V(this, "removeEventListener", this.removeEventListener);
V(this, "getVideoUrl", this.Bw);
V(this, "getDebugText", this.rw);
V(this, "getVideoEmbedCode", this.zw);
V(this, "getVideoData", this.getVideoData);
V(this, "addCueRange", this.gw);
V(this, "removeCueRange", this.Jw);
V(this, "setSize", this.Pw);
V(this, "getApiInterface", this.mw);
V(this, "destroy", this.destroy);
V(this, "showVideoInfo", this.Qw);
V(this, "hideVideoInfo", this.Cw);
hs(this, "getInternalApiInterface", this.sw);
hs(this, "getAdState", this.lw);
hs(this, "isNotServable",
this.Dw);
hs(this, "getUpdatedConfigurationData", this.ww);
hs(this, "updateRemoteReceivers", this.Rw);
hs(this, "sendAbandonmentPing", this.Kw);
hs(this, "setMinimized", this.Mw);
hs(this, "channelSubscribed", da);
hs(this, "channelUnsubscribed", da)
}
w(gs, jh);
function V(a, b, c) {
a.k[b] = t(c, a)
}
function hs(a, b, c) {
a.o[b] = t(c, a)
}
f = gs.prototype;
f.mw = function () {
return Rb(this.k)
};
f.sw = function () {
return Rb(this.o)
};
f.K = function () {
return this.g
};
f.addEventListener = function (a, b) {
var c = b;
r(b) && (c = function () {
p(b).apply(window, arguments)
}, this.B[b] = c);
this.app.subscribe(a, c)
};
f.Ru = function (a, b) {
var c = r(b) ? a + b : a + ma(b);
if (!this.A[c]) {
r(b) && (b = function () {
p(b).apply(window, arguments)
});
var d = t(function (a) {
b({
target: this.j,
data: a
})
}, this);
this.A[c] = d;
this.addEventListener(a, d)
}
};
f.removeEventListener = function (a, b) {
var c = b;
if (r(b) && b in this.B) {
var c = this.B[b],
d = this.B;
b in d && delete d[b]
}
this.app.ia(a, c)
};
f.Su = function (a, b) {
var c = r(b) ? a + b : a + ma(b);
this.A[c] && this.removeEventListener(a, this.A[c])
};
f.getPlayerState = function () {
return this.app.oa
};
f.Mg = function (a, b) {
is(this.app, !0, this.b);
js(this.app, a, b, void 0, this.b)
};
f.getCurrentTime = function () {
return this.app.getCurrentTime(this.b)
};
f.yg = function () {
return ks(this.app)
};
f.No = function () {
return this.app.C.volume
};
f.setVolume = function (a) {
this.app.setVolume(a)
};
f.Oo = function () {
return this.app.C.muted
};
f.Po = function () {
ls(this.app)
};
f.Qo = function () {
ms(this.app)
};
f.Lg = function () {
is(this.app, !0, this.b);
ns(this.app, this.b)
};
f.pauseVideo = function () {
os(this.app, this.b)
};
f.yk = function () {
var a = this.app;
ps(a, "play_pause") || qs(a, this.b)
};
f.hw = function () {};
f.vw = function () {
return this.app.qa
};
f.Nw = function (a) {
rs(this.app, a)
};
f.ow = function () {
return this.app.b.ug ? tq : [1]
};
f.uw = function () {
return ss(this.app, this.b)
};
f.rp = function (a) {
ts(this.app, a, this.b)
};
f.qw = function () {
var a = us(this.app, this.b);
return a ? vs(a) : []
};
f.xw = function () {
return this.Il()
};
f.yw = function () {
return 1
};
f.Il = function () {
return ws(this.app.$)
};
f.Aw = function () {
return 0
};
f.Pw = function () {
this.app.g.oh()
};
f.Mw = function (a) {
this.app.b.hr = a
};
f.Ew = function (a) {
this.app.B.isAvailable(a) && (a = xs(this.app.B, a)) && a.load()
};
f.xp = function (a) {
this.app.B.isAvailable(a) && (a = xs(this.app.B, a)) && a.unload()
};
f.Cl = function (a, b, c) {
a = ys(this.app, fs(a, b, c), this.b);
is(this.app, a, this.b)
};
f.jw = function (a, b, c) {
zs(this.app, fs(a, b, c), this.b)
};
f.Gw = function (a, b, c) {
a = es(a, b, c);
b = ys(this.app, a, this.b);
is(this.app, b, this.b);
b = this.app;
(a = Mf(new M(a.mediaContentUrl))) && As(b.b, a)
};
f.kw = function (a, b, c) {
b = es(a, b, c);
zs(this.app, b, this.b);
a = this.app;
(b = Mf(new M(b.mediaContentUrl))) && As(a.b, b)
};
f.Bw = function () {
return Bs(this.app)
};
f.rw = function () {
return Cs(this.app)
};
f.zw = function () {
return ""
};
f.gw = function (a, b, c) {
var d = this.app;
a = new Ds(1E3 * b, 1E3 * c, {
id: a
});
a.eb.subscribe("onEnter", d.AC, d);
a.eb.subscribe("onExit", d.BC, d);
d.j.A.ri(a);
return !0
};
f.Jw = function (a) {
t: {
for (var b = this.app, c = b.j.A.j || [], d = 0; d < c.length; d++) {
var e = c[d];
if (e.getId() == a) {
e.eb.clear();
b.j.A.Bg(e);
a = !0;
break t
}
}
a = !1
}
return a
};
f.Fw = function (a, b, c, d) {
var e = this.app;
e.P = !1;
Es(e, a, b, c, d)
};
f.iw = function (a, b, c, d) {
var e = this.app;
e.P = !0;
Es(e, a, b, c, d)
};
f.Hw = function () {
Fs(this.app)
};
f.Iw = function () {
Gs(this.app)
};
f.zp = function (a) {
var b = this.app;
b.o && (b.o.je ? Hs(b, $r(b.o, a)) : b.P = !1, Zr(b.o, a))
};
f.Ow = function (a) {
var b = this.app;
b.o && Wr(b.o, a)
};
f.Lw = function (a) {
var b = this.app;
b.o && (b.o.Lf = a)
};
f.lc = function () {
var a = this.app.o;
if (!a) return null;
for (var b = [], c = 0; c < a.Zb; c++) b[c] = $r(a, c).videoId;
return b
};
f.Hl = function () {
var a;
a = this.app;
a = a.o ? a.o.Ha : null;
return null == a ? -1 : a
};
f.yp = function () {
return Is(this.app)
};
f.wp = function (a, b, c) {
return Js(this.app.B, a, b, c)
};
f.ji = function (a, b, c) {
return Js(this.app.B, a, b, c)
};
f.tw = function (a) {
return Ks(this.app.B, a)
};
f.getVideoData = function () {
var a = us(this.app, this.b),
a = a ? a.getVideoData() : {},
a = {
video_id: a.videoId,
author: a.th,
title: a.title
},
b = this.yp();
b && (a.list = b);
return a
};
f.Qw = function () {
Ls(this.app.g)
};
f.Cw = function () {
this.app.g.rm()
};
f.lw = function () {
var a = this.app;
return a.H ? a.H.Ns() : -1
};
f.Dw = function () {
var a = this.app.getPlayerState();
return !(!a || !W(a, 128) || 5 != a.b.errorCode && 202 != a.b.errorCode)
};
f.ww = function () {
var a = this.app,
b = a.O.clone(),
c = b.args,
a = Ms(a),
d = Zb(a.k);
!a.qb && 0 < a.Ya && (d.start = a.Ya);
sa(c, d);
return b
};
f.Rw = function (a, b) {
var c = this.app;
c.D && Ns(c.D, a, b);
Os(c.b) && 6 != c.F && (c.b.Kg = !D(a), c.b.Kg ? 1 != c.F && 3 != c.F && Ps(c) : Qs(c.D))
};
f.destroy = function () {
this.app.dispose()
};
f.Kw = function () {
var a = us(this.app);
if (a) {
var b = a.getPlayerState();
W(b, 2) || W(b, 64) || W(b, 128) || (Rs(a), Ss(a))
}
};
f.J = function () {
if (this.g) {
for (var a in this.k) this.g[a] = null;
for (a in this.o) this.g[a] = null
}
this.B = this.A = this.g = null;
gs.G.J.call(this)
};
function Ts(a, b) {
gs.call(this, a, b);
V(this, "cueVideoByPlayerVars", this.uD);
V(this, "loadVideoByPlayerVars", this.cq);
V(this, "preloadVideoByPlayerVars", this.zD);
V(this, "seekBy", this.Rs);
V(this, "enableLicenseIntercept", this.vD);
V(this, "updatePlaylist", this.ED);
V(this, "resumeLicenseSession", this.AD);
V(this, "updateLastActiveTime", this.DD);
V(this, "updateVideoData", this.FD);
V(this, "getStoryboardFormat", this.xD);
V(this, "getProgressState", this.Jg);
V(this, "hideUserInterface", this.yD);
V(this, "showUserInterface",
this.CD);
V(this, "getHousebrandProperties", this.wD);
V(this, "setPlaybackQualityRange", this.BD)
}
w(Ts, gs);
f = Ts.prototype;
f.uD = function (a) {
zs(this.app, a, this.b)
};
f.getPlayerState = function (a) {
var b = this.app;
return 2 == a ? b.Ba : b.oa
};
f.cq = function (a) {
ys(this.app, a, this.b)
};
f.zD = function () {};
f.Lg = function () {
ns(this.app, this.b)
};
f.Mg = function (a, b) {
js(this.app, a, b, void 0, this.b)
};
f.Rs = function (a, b, c) {
var d = this.app,
e = this.b;
js(d, d.getCurrentTime() + a, b, c, e)
};
f.vD = function () {
var a = this.app;
a.Ia || (a.Ia = !0, a.ua = {})
};
f.ED = function () {
var a = this.app;
Us(a);
a.Za("onPlaylistUpdate")
};
f.AD = function (a, b) {
var c = this.app,
d = c.ua[a];
d && (Vs(d, b), d.start(), delete c.ua[a])
};
f.DD = function () {
this.app.b.B = v()
};
f.FD = function (a) {
var b = us(this.app, this.b || 1);
b && (b = b.b, tr(b, a), b.I("dataupdated"))
};
f.xD = function () {
return this.app.getVideoData().k.storyboard_spec
};
f.yD = function () {
this.app.g.Fj(!1)
};
f.CD = function () {
this.app.g.Fj(!0)
};
f.wD = function () {
var a = this.app.R();
return {
Ac: a.Ac,
Ib: a.Ib(),
hc: a.hc,
SE: a.g.fexp
}
};
f.getVideoData = function () {
var a = Ts.G.getVideoData.call(this),
b = us(this.app, this.b),
b = b ? b.getVideoData() : {};
a.cpn = b.Ea;
a.isLive = b.qb;
return a
};
f.getCurrentTime = function (a) {
return a ? this.app.getCurrentTime(a) : Ts.G.getCurrentTime.call(this)
};
f.yg = function (a) {
return a ? ks(this.app, a) : Ts.G.yg.call(this)
};
f.Jg = function () {
var a = this.app.getVideoData(),
b = !a.qb || a.Ab,
c = a.ai,
d = a.tg,
e = this.getCurrentTime(),
g = this.yg(),
h;
h = (h = us(this.app, void 0)) ? Ws(h.g) : 0;
return {
LE: b,
ai: c,
tg: d,
current: e,
ME: -1,
duration: g,
loaded: h,
np: a.j && !isNaN(Pb(a.j.b).index.Fe()) ? Pb(a.j.b).index.Fe() : a.Pa,
pp: a.j && !isNaN(Pb(a.j.b).index.ej()) ? Pb(a.j.b).index.ej() : 0
}
};
f.Il = function (a) {
var b = this.app;
return (b.A && 2 == b.A.getPlayerType()) == (2 == a) ? ws(b.$) : 0
};
f.BD = function (a, b) {
ts(this.app, a, this.b, b)
};
function Xs(a, b) {
Ts.call(this, a, b)
}
w(Xs, Ts);
f = Xs.prototype;
f.getPlayerType = function () {
return this.b
};
f.Cl = function (a, b, c) {
ys(this.app, fs(a, b, c), this.b)
};
f.Lg = function () {
ns(this.app, this.b)
};
f.Mg = function (a, b) {
js(this.app, a, b, void 0, this.b)
};
function Ys(a, b) {
a.app.g.g.appendChild(b)
}
function Zs(a) {
return a.app.g.element
}
f.R = function () {
return this.app.R()
};
f.lc = function () {
return this.app.o
};
f.getVideoData = function () {
var a = us(this.app, this.b);
return a && a.getVideoData()
};
f.isFullscreen = function () {
return this.app.R().xb
};
function $s(a, b) {
this.ag = a;
this.lf = b + "::"
}
w($s, Ch);
f = $s.prototype;
f.ag = null;
f.lf = "";
f.set = function (a, b) {
this.ag.set(this.lf + a, b)
};
f.get = function (a) {
return this.ag.get(this.lf + a)
};
f.remove = function (a) {
this.ag.remove(this.lf + a)
};
f.$b = function (a) {
var b = this.ag.$b(!0),
c = this,
d = new Re;
d.next = function () {
for (var d = b.next(); d.substr(0, c.lf.length) != c.lf;) d = b.next();
return a ? d.substr(c.lf.length) : c.ag.get(d)
};
return d
};
function at(a, b) {
this.start = a;
this.end = b;
this.b = ma(this)
}
function bt(a, b) {
return a.start != b.start ? a.start - b.start : a.end != b.end ? a.end - b.end : a.b != b.b ? a.b - b.b : 0
}
at.prototype.contains = function (a, b) {
return a >= this.start && (a < this.end || a == this.end && this.start == this.end) && (null == b || a < b && b <= this.end)
};
at.prototype.toString = function () {
return "Interval[" + this.start + ", " + this.end + "]"
};
function ct() {
this.b = []
}
function dt(a, b) {
for (var c = [], d = 0; d < a.b.length; ++d) {
var e = a.b[d];
e.contains(b) && c.push(e);
if (e.start > b) break
}
return c
}
function et(a, b, c) {
for (var d = [], e = 0; e < a.b.length; ++e) {
var g = a.b[e];
if (null != c && g.start > c) break;
g.start > b && d.push(g)
}
return d
}
function ft(a, b) {
for (var c = [], d = 0; d < a.b.length; ++d) {
var e = a.b[d];
e.contains(b) && c.push(e.end);
if (e.start > b) {
c.push(e.start);
break
}
}
c.sort(yb);
return c[0]
};
function gt(a) {
var b = "";
if (a)
for (var c = 0; c < a.length; c++) b += a.start(c).toFixed(3) + "-" + a.end(c).toFixed(3) + ",";
return b
}
function ht(a, b) {
if (!a) return -1;
for (var c = 0; c < a.length; c++)
if (a.start(c) <= b && a.end(c) >= b) return c;
return -1
}
function it(a, b) {
var c = ht(a, b);
return 0 <= c ? a.end(c) : NaN
}
function jt(a) {
return a && a.length ? a.end(a.length - 1) : NaN
}
function kt(a, b) {
var c = it(a, b);
return 0 <= c ? c - b : 0
};
function lt() {}
var mt = mq && 4 > lq ? .1 : 0,
nt = new lt;
f = lt.prototype;
f.Gd = null;
f.fm = !1;
function ot(a, b) {
var c = "";
b && (a.Gd = b, c = Yq(b));
a.src && "" == c || (c && a.src != c && (a.src = c), b && b.b || a.load())
}
function pt(a, b) {
0 < a.readyState && (a.currentTime = Math.max(mt, b))
}
f.getCurrentTime = function () {
return this.currentTime || 0
};
function Ws(a) {
return 0 < jt(a.buffered) && a.duration ? it(a.buffered, a.currentTime) : 0
}
function ws(a) {
var b = a.duration || 0;
return Infinity == b ? 1 : b ? Ws(a) / b : 0
}
function qt(a) {
return a.paused || a.ended
}
function rt(a) {
a.ended && pt(a, 0);
!a.hasAttribute("src") && a.Gd && (a.src = Yq(a.Gd), a.Gd.b || a.load());
a.play();
mq && 7 <= lq && xg(a, t(function () {
J(t(this.bs, this, this.currentTime, 0), 500)
}, a))
}
f.bs = function (a, b) {
this.paused || this.currentTime > a || 10 < b || (this.play(), J(t(this.bs, this, this.currentTime, b + 1), 500))
};
f.pauseVideo = function () {
this.pause()
};
function st(a) {
a.currentSrc && (Uq && pt(a, 0), fd(a), a.removeAttribute("src"), a.load(), a.Gd && a.Gd.b && (a.Gd = null))
}
function tt(a) {
st(a);
a.Gd = null
}
f.setVolume = function (a, b) {
this.volume = a / 100;
this.muted = b
};
function ut(a, b) {
a.defaultPlaybackRate = b;
a.playbackRate = b
}
f.sC = function () {
this.hasAttribute("controls") && this.setAttribute("controls", "true")
};
f.tC = function () {
this.fm && !this.muted && (this.muted = !0)
};
lt.prototype.getDebugInfo = function () {
return {
vct: this.currentTime.toFixed(3),
vd: this.duration.toFixed(3),
vpl: gt(this.played),
vbu: gt(this.buffered),
vpa: this.paused,
vsk: this.seeking,
vpr: this.playbackRate,
vrs: this.readyState,
vns: this.networkState,
vec: this.error ? this.error.errorCode : null
}
};
function vt(a, b) {
for (var c = 0; c < b.length; c++) a.appendChild(b[c])
};
function wt(a, b) {
a = a || 64;
a & 128 && !b || a & 2 && a & 16 || (this.g = a, this.b = b || null)
}
wt.prototype.g = 64;
wt.prototype.b = null;
function xt(a, b, c) {
if (W(a, 128)) return a;
var d = a.g,
e = a.b,
g = b.target;
switch (b.type) {
case "ended":
if (0 >= g.networkState || !g.src) break;
d = zt();
e = null;
break;
case "pause":
W(a, 32) || W(a, 2) || (d = 4, W(a, 1) && W(a, 8) && (d |= 1), e = null);
break;
case "playing":
d = 8;
e = null;
break;
case "abort":
if (64 == d) break;
case "error":
t: if ((b = g.error) && b.code) {
switch (b.code) {
case b.MEDIA_ERR_NETWORK:
b = 201;
break;
case b.MEDIA_ERR_DECODE:
b = 202;
break;
case b.MEDIA_ERR_SRC_NOT_SUPPORTED:
b = 203;
break;
default:
b = null;
break t
}
b = {
errorCode: b
}
} else b =
null;
b && (e = b, d |= 128);
break;
case "canplay":
d &= -2;
break;
case "progress":
W(a, 8) && At(c, g) && (d |= 1);
break;
case "seeked":
d &= -18;
break;
case "seeking":
d |= 16;
0 >= kt(g.buffered, g.currentTime) && (d |= 1);
d &= -3;
break;
case "waiting":
W(a, 2) || (d |= 1);
break;
case "timeupdate":
W(a, 16) || (d = At(c, g) ? d | 1 : d & -2);
1 < g.readyState && 0 < g.currentTime && (d &= -65);
break;
default:
return a
}
return Bt(a, d, e)
}
function At(a, b) {
if (!a) return !1;
var c = kt(b.buffered, b.currentTime);
return Ct(a, b.currentTime, v(), c)
}
function Bt(a, b, c) {
return b == a.g && c == a.b || b & 128 && !c || b & 2 && b & 16 ? a : new wt(b, c)
}
function Dt(a, b) {
return Bt(a, a.g | b)
}
function W(a, b) {
return !!(a.g & b)
}
function Et(a) {
return W(a, 128) ? -1 : W(a, 2) ? 0 : W(a, 1) && !W(a, 32) ? 3 : W(a, 64) ? -1 : W(a, 8) ? 1 : W(a, 4) ? 2 : -1
}
function zt() {
var a;
return a = 14
};
function Ds(a, b, c) {
at.call(this, a, b);
a = c || {};
this.ta = a.id || "";
void 0 != a.priority && (this.Hh = a.priority);
this.namespace = a.namespace || "";
this.eb = new oh;
this.g = a.tooltip;
a.style && (this.style = a.style);
a.visible && (this.de = a.visible)
}
w(Ds, at);
f = Ds.prototype;
f.ta = "";
f.Hh = 7;
f.active = !0;
f.de = !1;
f.style = "ytp-ad-progress";
f.eb = null;
f.namespace = "";
f.getId = function () {
return this.ta
};
function Ft(a) {
switch (a.style) {
case "ytp-chapter-marker":
return 8;
case "ytp-ad-progress":
return 6
}
}
function Gt(a, b) {
return a.start == b.start ? a.Hh == b.Hh ? 0 : a.Hh < b.Hh ? -1 : 1 : a.start < b.start ? -1 : 1
};
function Ht(a, b, c) {
Ki.call(this);
this.C = a;
this.B = b;
this.D = c;
this.o = new rk(250);
ak(this.o, "tick", this.nc, !1, this);
S(this, this.o);
this.j = [];
this.b = [];
this.g = new ct
}
w(Ht, Ki);
f = Ht.prototype;
f.xi = !1;
f.zg = !1;
f.lm = !1;
f.km = !1;
f.Tg = null;
f.ri = function (a) {
this.nc();
y(arguments, function (a) {
this.j.push(a);
var c = this.g.b;
!c.length || 0 < bt(a, c[c.length - 1]) ? c.push(a) : Db(c, a, bt);
this.I("onAdd", a)
}, this);
this.nc()
};
f.Bg = function (a) {
y(arguments, function (a) {
a = this.j.indexOf(a);
0 <= a && It(this, a)
}, this);
this.nc()
};
function It(a, b) {
var c = a.j.splice(b, 1)[0],
d = a.g.b,
e = xb(d, c, bt);
0 <= e && pb(d, e);
b = a.b.indexOf(c);
0 <= b && a.b.splice(b, 1);
a.I("onRemove", c)
}
f.Wg = function () {
this.k = Jt(this);
this.zg = !0;
this.nc()
};
f.reset = function () {
this.zg = this.xi = !1;
Kt(this);
for (var a = this.j.length - 1; 0 <= a; a--) It(this, a);
this.nc();
this.A = null
};
function Lt(a, b) {
var c = [];
if (!b.length) return c;
b.sort(Gt);
for (var d = 0; d < b.length; d++) {
var e = b[d];
e.active && -1 == a.b.indexOf(e) && (a.b.push(e), c.push(["onEnter", e]))
}
return c
}
function Mt(a, b) {
var c = [];
if (!b.length) return c;
b.sort(Gt);
for (var d = 0; d < b.length; d++) {
var e = b[d],
g = a.b.indexOf(e);
0 > g || (a.b.splice(g, 1), c.push(["onExit", e]))
}
return c
}
f.nc = function () {
this.km = !0;
if (!this.lm)
for (var a = 3; this.km && a;) {
this.km = !1;
this.lm = !0;
if (this.zg && !this.xi) {
Kt(this);
for (var b = Jt(this), c = [], d = [], e = 0; e < this.b.length; e++) {
var g = this.b[e];
g.active && !g.contains(b) && d.push(g)
}
c = c.concat(Mt(this, d));
d = dt(this.g, b);
e = this.B();
!W(e, 48) && b > this.k && (d = d.concat(et(this.g, this.k, b)));
c = c.concat(Lt(this, d));
this.k = b;
!this.xi && this.A && (c.unshift(["onLockBlockExit", this.A]), this.A = null, W(e, 2) && (this.k = 2147483647));
this.D() && (b = ft(this.g, this.k), null != b && (this.Tg =
tk(t(this.nc, this), b - this.k)));
Nt(this, c)
}
this.lm = !1;
a--
}
};
function Nt(a, b) {
for (var c = 0; c < b.length; c++) {
var d = b[c],
e = d[1];
"onLockBlockExit" == d[0] || "onLockBlockEnter" == d[0] ? a.I.apply(a, d) : e.eb.I.apply(e.eb, d)
}
}
function Kt(a) {
null != a.Tg && (uk(a.Tg), a.Tg = null)
}
function Jt(a) {
return W(a.B(), 2) ? 2147483647 : 1E3 * a.C()
}
f.J = function () {
ik(this.o, "tick", this.nc, !1, this);
Kt(this);
this.A = this.g = this.b = this.j = null;
Ht.G.J.call(this)
};
function Ot(a) {
Ki.call(this);
this.b = a;
if (this.qn) {
a = "yt-html5-player-modules::" + this.qn;
var b = new Eh;
if (a = b.isAvailable() ? a ? new $s(b, a) : b : null) this.U = new Gh(a)
}
}
w(Ot, Ki);
f = Ot.prototype;
f.wa = "";
f.jc = "";
f.Ec = !1;
f.loaded = !1;
f.gk = !1;
f.oc = null;
f.Hf = function (a) {
var b = sb(arguments),
c = t(this.Ic, this),
d = t(this.ld, this);
y(b, function (a) {
a.namespace = this.wa;
a.eb.subscribe("onEnter", c);
a.eb.subscribe("onExit", d)
}, this);
this.I("command_add_cuerange", b, this.b.getPlayerType())
};
f.sB = function (a) {
var b = sb(arguments);
this.I("command_remove_cuerange", b, this.b.getPlayerType())
};
function Pt(a) {
a.I("command_remove_cuerange_all", a.wa, a.b.getPlayerType())
}
function Qt(a) {
a.I("command_preroll_ready", a.wa, a.b.getPlayerType())
}
function Rt(a, b) {
O(b, a.wa);
a.b.app.g.M.K().appendChild(b)
}
function St(a, b) {
a.I("command_show_dialog", b)
}
f.pg = function () {
St(this)
};
f.create = function () {
this.Ec || (this.Ka(this.b), O(Zs(this.b), this.wa + "-created"), this.Ec = !0)
};
f.destroy = function () {
this.unload();
P(Zs(this.b), this.wa + "-created");
this.Ec = !1
};
f.load = function () {
O(Zs(this.b), this.wa + "-loaded");
this.I("loaded", this.wa)
};
f.unload = function () {
P(Zs(this.b), this.wa + "-loaded");
this.I("unloaded", this.wa)
};
f.Ic = function () {};
f.ld = function () {};
f.se = function () {};
function Tt(a, b, c) {
a.I("command_navigate_to_url", b, c)
}
f.log = function (a) {
this.I("command_log", this.jc, a)
};
function Ut(a, b, c) {
var d = {},
e;
for (e in b) d[a.wa + "_" + e] = b[e];
b = {};
for (var g in c) b[a.wa + "_" + g] = c[g];
a.I("command_log_timing", d, b)
}
f.Zg = function () {
return null
};
function Vt(a, b) {
if (!a.U) return null;
var c;
try {
c = a.U.get(b)
} catch (d) {
a.U && a.U.remove(b)
}
return c
}
function Wt(a, b, c) {
if (a.U) try {
a.U.set(b, c)
} catch (d) {}
}
function Xt(a, b) {
a.I("command_disable_controls", b, a.wa)
}
function Yt(a, b) {
a.I("command_enable_controls", b, a.wa)
}
function Zt(a) {
a.I("command_stop_redirect_controls")
}
function $t(a) {
a.I("command_play", !1, a.b.getPlayerType())
}
f.pauseVideo = function () {
this.I("command_pause", !1, this.b.getPlayerType())
};
function au(a, b) {
a.I("command_redirected_show_is_playing", b)
}
function bu(a) {
return a.b.app.g.A
}
function cu(a, b) {
a.I("module_menu_item_add", b)
}
function du(a, b) {
a.I("module_menu_item_remove", b)
}
function eu(a) {
a.I("module_menu_show", void 0)
}
f.vt = function () {};
f.Xr = function () {
return []
};
f.Ka = function () {
return !1
};
f.Wl = function (a, b) {
this.oc && this.oc.se && this.oc.se.apply(this.oc, arguments)
};
f.Fi = function () {};
var fu = {
mG: "YTP_ERROR_ALREADY_PINNED_ON_A_DEVICE",
rG: "ERROR_AUTHENTICATION_EXPIRED",
sG: "ERROR_AUTHENTICATION_MALFORMED",
tG: "ERROR_AUTHENTICATION_MISSING",
wG: "ERROR_BAD_REQUEST",
CG: "YTP_ERROR_CANNOT_ACTIVATE_RENTAL",
KG: "ERROR_CGI_PARAMS_MALFORMED",
LG: "ERROR_CGI_PARAMS_MISSING",
zH: "YTP_DEVICE_FALLBACK",
HH: "YTP_ERROR_LICENSE",
KH: "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK_FLASH",
NH: "YTP_ERROR_GEO_FAILURE",
aI: "YTP_ERROR_GENERIC",
bI: "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK",
kI: "YTP_ERROR_INVALID_DRM_MESSAGE",
oI: "LEARN_MORE",
SI: "YTP_ERROR_NOT_SIGNED_IN",
gJ: "YTP_ERROR_PURCHASE_NOT_FOUND",
hJ: "YTP_ERROR_PURCHASE_REFUNDED",
kJ: "YTP_ERROR_RENTAL_EXPIRED",
EG: "YTP_ERROR_CAST_SESSION_DEVICE_MISMATCHED",
FG: "YTP_ERROR_CAST_SESSION_VIDEO_MISMATCHED",
HG: "YTP_ERROR_CAST_TOKEN_FAILED",
GG: "YTP_ERROR_CAST_TOKEN_EXPIRED",
IG: "YTP_ERROR_CAST_TOKEN_MALFORMED",
vJ: "YTP_ERROR_SERVER_ERROR",
KJ: "YTP_ERROR_STOPPED_BY_ANOTHER_PLAYBACK",
MJ: "YTP_ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",
NJ: "YTP_ERROR_STREAMING_NOT_ALLOWED",
OJ: "YTP_ERROR_STREAMING_UNAVAILABLE",
nJ: "YTP_ERROR_RETRYABLE_ERROR",
WJ: "YTP_ERROR_TOO_MANY_STREAMS_PER_USER",
VJ: "YTP_ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",
aK: "YTP_ERROR_UNSUPPORTED_DEVICE",
cK: "YTP_ERROR_UNUSUAL_ACTIVITY",
lK: "YTP_ERROR_VIDEO_FORBIDDEN",
nK: "YTP_ERROR_VIDEO_NOT_FOUND"
},
gu = {
300: "YTP_ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",
301: "YTP_ERROR_ALREADY_PINNED_ON_A_DEVICE",
303: "YTP_ERROR_STOPPED_BY_ANOTHER_PLAYBACK",
304: "YTP_ERROR_TOO_MANY_STREAMS_PER_USER",
305: "YTP_ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",
400: "YTP_ERROR_VIDEO_NOT_FOUND",
401: "YTP_ERROR_GEO_FAILURE",
402: "YTP_ERROR_STREAMING_NOT_ALLOWED",
403: "YTP_ERROR_UNSUPPORTED_DEVICE",
405: "YTP_ERROR_VIDEO_FORBIDDEN",
500: "YTP_ERROR_PURCHASE_NOT_FOUND",
501: "YTP_ERROR_RENTAL_EXPIRED",
502: "YTP_ERROR_PURCHASE_REFUNDED",
5E3: "ERROR_BAD_REQUEST",
5001: "ERROR_CGI_PARAMS_MISSING",
5002: "ERROR_CGI_PARAMS_MALFORMED",
5100: "ERROR_AUTHENTICATION_MISSING",
5101: "ERROR_AUTHENTICATION_MALFORMED",
5102: "ERROR_AUTHENTICATION_EXPIRED",
5200: "YTP_ERROR_CAST_TOKEN_MALFORMED",
5201: "YTP_ERROR_CAST_TOKEN_EXPIRED",
5202: "YTP_ERROR_CAST_TOKEN_FAILED",
5203: "YTP_ERROR_CAST_SESSION_VIDEO_MISMATCHED",
5204: "YTP_ERROR_CAST_SESSION_DEVICE_MISMATCHED",
6E3: "YTP_ERROR_INVALID_DRM_MESSAGE",
7E3: "YTP_ERROR_SERVER_ERROR",
8E3: "YTP_ERROR_RETRYABLE_ERROR"
};
function hu(a) {
return (a = gu[a.toString()]) ? a : "YTP_ERROR_LICENSE"
};
var iu = {
created: 1,
ready: 2,
testing: 4,
"testing-starting": 3,
live: 6,
"live-starting": 5,
complete: 8,
"complete-starting": 7
};
function ju(a) {
m.setTimeout(function () {
throw a;
}, 0)
}
var ku;
function lu() {
if (m.Promise && m.Promise.resolve) {
var a = m.Promise.resolve();
return function (b) {
a.then(function () {
try {
b()
} catch (a) {
ju(a)
}
})
}
}
var b = m.MessageChannel;
"undefined" === typeof b && "undefined" !== typeof window && window.postMessage && window.addEventListener && (b = 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 = b.location.protocol +
"//" + b.location.host,
a = t(function (a) {
if (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 b) {
var c = new b,
d = {},
e = d;
c.port1.onmessage = function () {
d = d.next;
var a = d.tt;
d.tt = null;
a()
};
return function (a) {
e.next = {
tt: a
};
e = e.next;
c.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) {
m.setTimeout(a, 0)
}
};
function mu(a, b) {
if (!nu) {
var c = ou;
ka(m.setImmediate) ? m.setImmediate(c) : (ku || (ku = lu()), ku(c));
nu = !0
}
pu.push(new qu(a, b))
}
var nu = !1,
pu = [];
function ou() {
for (; pu.length;) {
var a = pu;
pu = [];
for (var b = 0; b < a.length; b++) {
var c = a[b];
try {
c.b.call(c.scope)
} catch (d) {
ju(d)
}
}
}
nu = !1
}
function qu(a, b) {
this.b = a;
this.scope = b
};
function ru(a) {
a.prototype.then = a.prototype.then;
a.prototype.$goog_Thenable = !0
}
function su(a) {
if (!a) return !1;
try {
return !!a.$goog_Thenable
} catch (b) {
return !1
}
};
function tu(a, b) {
this.g = 0;
this.A = void 0;
this.b = this.j = null;
this.k = this.o = !1;
try {
var c = this;
a.call(b, function (a) {
uu(c, 2, a)
}, function (a) {
uu(c, 3, a)
})
} catch (d) {
uu(this, 3, d)
}
}
tu.prototype.then = function (a, b, c) {
return vu(this, ka(a) ? a : null, ka(b) ? b : null, c)
};
ru(tu);
tu.prototype.cancel = function (a) {
0 == this.g && mu(function () {
var b = new wu(a);
xu(this, b)
}, this)
};
function xu(a, b) {
if (0 == a.g)
if (a.j) {
var c = a.j;
if (c.b) {
for (var d = 0, e = -1, g = 0, h; h = c.b[g]; g++)
if (h = h.fj)
if (d++, h == a && (e = g), 0 <= e && 1 < d) break;
0 <= e && (0 == c.g && 1 == d ? xu(c, b) : (d = c.b.splice(e, 1)[0], yu(c, d, 3, b)))
}
} else uu(a, 3, b)
}
function zu(a, b) {
a.b && a.b.length || 2 != a.g && 3 != a.g || Au(a);
a.b || (a.b = []);
a.b.push(b)
}
function vu(a, b, c, d) {
var e = {
fj: null,
os: null,
rs: null
};
e.fj = new tu(function (a, h) {
e.os = b ? function (c) {
try {
var e = b.call(d, c);
a(e)
} catch (q) {
h(q)
}
} : a;
e.rs = c ? function (b) {
try {
var e = c.call(d, b);
!n(e) && b instanceof wu ? h(b) : a(e)
} catch (q) {
h(q)
}
} : h
});
e.fj.j = a;
zu(a, e);
return e.fj
}
tu.prototype.B = function (a) {
this.g = 0;
uu(this, 2, a)
};
tu.prototype.C = function (a) {
this.g = 0;
uu(this, 3, a)
};
function uu(a, b, c) {
if (0 == a.g) {
if (a == c) b = 3, c = new TypeError("Promise cannot resolve to itself");
else {
if (su(c)) {
a.g = 1;
c.then(a.B, a.C, a);
return
}
if (la(c)) try {
var d = c.then;
if (ka(d)) {
Bu(a, c, d);
return
}
} catch (e) {
b = 3, c = e
}
}
a.A = c;
a.g = b;
Au(a);
3 != b || c instanceof wu || Cu(a, c)
}
}
function Bu(a, b, c) {
function d(b) {
g || (g = !0, a.C(b))
}
function e(b) {
g || (g = !0, a.B(b))
}
a.g = 1;
var g = !1;
try {
c.call(b, e, d)
} catch (h) {
d(h)
}
}
function Au(a) {
a.o || (a.o = !0, mu(a.D, a))
}
tu.prototype.D = function () {
for (; this.b && this.b.length;) {
var a = this.b;
this.b = [];
for (var b = 0; b < a.length; b++) yu(this, a[b], this.g, this.A)
}
this.o = !1
};
function yu(a, b, c, d) {
if (2 == c) b.os(d);
else {
for (; a && a.k; a = a.j) a.k = !1;
b.rs(d)
}
}
function Cu(a, b) {
a.k = !0;
mu(function () {
a.k && Du.call(null, b)
})
}
var Du = ju;
function wu(a) {
ta.call(this, a)
}
w(wu, ta);
wu.prototype.name = "cancel";
/*
Portions of this code are from MochiKit, received by
The Closure Authors under the MIT license. All other code is Copyright
2005-2009 The Closure Authors. All Rights Reserved.
*/
function Eu(a, b) {
this.o = [];
this.H = a;
this.F = b || null;
this.k = this.b = !1;
this.j = void 0;
this.D = this.N = this.B = !1;
this.A = 0;
this.g = null;
this.C = 0
}
f = Eu.prototype;
f.cancel = function (a) {
if (this.b) this.j instanceof Eu && this.j.cancel();
else {
if (this.g) {
var b = this.g;
delete this.g;
a ? b.cancel(a) : (b.C--, 0 >= b.C && b.cancel())
}
this.H ? this.H.call(this.F, this) : this.D = !0;
this.b || this.$g(new Fu)
}
};
f.Xo = function (a, b) {
this.B = !1;
Gu(this, a, b)
};
function Gu(a, b, c) {
a.b = !0;
a.j = c;
a.k = !b;
Hu(a)
}
function Iu(a) {
if (a.b) {
if (!a.D) throw new Ju;
a.D = !1
}
}
f.Ss = function (a) {
Iu(this);
Gu(this, !0, a)
};
f.$g = function (a) {
Iu(this);
Gu(this, !1, a)
};
function Ku(a, b, c) {
Lu(a, b, null, c)
}
function Lu(a, b, c, d) {
a.o.push([b, c, d]);
a.b && Hu(a)
}
f.then = function (a, b, c) {
var d, e, g = new tu(function (a, b) {
d = a;
e = b
});
Lu(this, d, function (a) {
a instanceof Fu ? g.cancel() : e(a)
});
return g.then(a, b, c)
};
ru(Eu);
function Mu(a) {
return gb(a.o, function (a) {
return ka(a[1])
})
}
function Hu(a) {
if (a.A && a.b && Mu(a)) {
var b = a.A,
c = Nu[b];
c && (m.clearTimeout(c.ta), delete Nu[b]);
a.A = 0
}
a.g && (a.g.C--, delete a.g);
for (var b = a.j, d = c = !1; a.o.length && !a.B;) {
var e = a.o.shift(),
g = e[0],
h = e[1],
e = e[2];
if (g = a.k ? h : g) try {
var k = g.call(e || a.F, b);
n(k) && (a.k = a.k && (k == b || k instanceof Error), a.j = b = k);
su(b) && (d = !0, a.B = !0)
} catch (l) {
b = l, a.k = !0, Mu(a) || (c = !0)
}
}
a.j = b;
d && (k = t(a.Xo, a, !0), d = t(a.Xo, a, !1), b instanceof Eu ? (Lu(b, k, d), b.N = !0) : b.then(k, d));
c && (b = new Ou(b), Nu[b.ta] = b, a.A = b.ta)
}
function Ju() {
ta.call(this)
}
w(Ju, ta);
Ju.prototype.message = "Deferred has already fired";
Ju.prototype.name = "AlreadyCalledError";
function Fu() {
ta.call(this)
}
w(Fu, ta);
Fu.prototype.message = "Deferred was canceled";
Fu.prototype.name = "CanceledError";
function Ou(a) {
this.ta = m.setTimeout(t(this.g, this), 0);
this.b = a
}
Ou.prototype.g = function () {
delete Nu[this.ta];
throw this.b;
};
var Nu = {};
function Pu(a, b) {
var c = b || {},
d = c.document || document,
e = bd("SCRIPT"),
g = {
Ts: e,
rb: void 0
},
h = new Eu(Qu, g),
k = null,
l = null != c.timeout ? c.timeout : 5E3;
0 < l && (k = window.setTimeout(function () {
Ru(e, !0);
h.$g(new Su(1, "Timeout reached for loading script " + a))
}, l), g.rb = k);
e.onload = e.onreadystatechange = function () {
e.readyState && "loaded" != e.readyState && "complete" != e.readyState || (Ru(e, c.qA || !1, k), h.Ss(null))
};
e.onerror = function () {
Ru(e, !0, k);
h.$g(new Su(0, "Error while loading script " + a))
};
Sc(e, {
type: "text/javascript",
charset: "UTF-8",
src: a
});
Tu(d).appendChild(e);
return h
}
function Tu(a) {
var b = a.getElementsByTagName("HEAD");
return !b || D(b) ? a.documentElement : b[0]
}
function Qu() {
if (this && this.Ts) {
var a = this.Ts;
a && "SCRIPT" == a.tagName && Ru(a, !0, this.rb)
}
}
function Ru(a, b, c) {
null != c && m.clearTimeout(c);
a.onload = da;
a.onerror = da;
a.onreadystatechange = da;
b && window.setTimeout(function () {
hd(a)
}, 0)
}
function Su(a, b) {
var c = "Jsloader error (code #" + a + ")";
b && (c += ": " + b);
ta.call(this, c);
this.code = a
}
w(Su, ta);
function Uu(a, b) {
this.g = new M(a);
this.b = b ? b : "callback";
this.rb = 5E3
}
var Vu = 0;
Uu.prototype.send = function (a, b, c, d) {
a = a || null;
d = d || "_" + (Vu++).toString(36) + v().toString(36);
m._callbacks_ || (m._callbacks_ = {});
var e = this.g.clone();
if (a)
for (var g in a) a.hasOwnProperty && !a.hasOwnProperty(g) || Nf(e, g, a[g]);
b && (m._callbacks_[d] = Wu(d, b), Nf(e, this.b, "_callbacks_." + d));
b = Pu(e.toString(), {
timeout: this.rb,
qA: !0
});
Lu(b, null, Xu(d, a, c), void 0);
return {
ta: d,
xr: b
}
};
Uu.prototype.cancel = function (a) {
a && (a.xr && a.xr.cancel(), a.ta && Yu(a.ta, !1))
};
function Xu(a, b, c) {
return function () {
Yu(a, !1);
c && c(b)
}
}
function Wu(a, b) {
return function (c) {
Yu(a, !0);
b.apply(void 0, arguments)
}
}
function Yu(a, b) {
m._callbacks_[a] && (b ? delete m._callbacks_[a] : m._callbacks_[a] = da)
};
function Zu(a) {
this.b = a;
a = null;
a = $u(this.b);
a = "(" + a.join("|") + ")";
a = wa("__%s__", a);
this.j = new RegExp(a, "g");
this.g = {}
}
var av = /__([a-z]+(?:_[a-z]+)*)__/g;
function $u(a) {
var b = [],
c = {};
a.replace(av, function (a, e) {
e in c || (c[e] = !0, b.push(e))
});
return b
}
function bv(a, b) {
var c = t(function (a, c) {
return Ca(b[c] || this.g[c] || "")
}, a);
return a.b.replace(a.j, c)
};
function cv(a, b) {
Ki.call(this);
this.j = bv(new Zu(b), {
video_id: a
});
this.b = new rk(15E3 + Math.floor(3E4 * Math.random()));
ak(this.b, "tick", t(this.g, this));
this.g();
this.b.start()
}
w(cv, Ki);
cv.prototype.J = function () {
this.b.dispose();
cv.G.J.call(this)
};
cv.prototype.g = function () {
(new Uu(this.j)).send(null, t(this.o, this), t(this.k, this))
};
cv.prototype.o = function (a) {
this.I("payload", a);
sk(this.b, 15E3 + Math.floor(3E4 * Math.random()))
};
cv.prototype.k = function () {
this.I("error");
var a = this.b.b;
192E4 > a && sk(this.b, 2 * a)
};
function dv(a) {
this.b = {};
this.j = {};
this.k = {};
this.g = ev(this, a)
}
w(dv, jh);
function ev(a, b, c) {
var d = 0,
e = bd(b[d++]);
if (r(b[d]) || ha(b[d]) || null === b[d]) {
var g = b[d++];
ha(g) && (g = g.join(" "));
if (g = fv(a, e, "className", g)) gv(a, e, "className", g), hv(a, g, e)
}
for (; d < b.length; d++) {
var h = b[d];
if (ha(h)) ev(a, h, e);
else if (la(h)) {
var g = a,
k = e,
l = void 0;
for (l in h) h[l] && gv(g, k, l, fv(g, k, l, h[l]))
} else r(h) && (g = fv(a, e, "child", h), null != g && e.appendChild(cd(g)))
}
c && c.appendChild(e);
return e
}
f = dv.prototype;
f.K = function () {
return this.g
};
function hv(a, b, c) {
var d = b.split(" ");
if (1 < d.length)
for (b = 0; b < d.length; b++) hv(a, d[b], c);
else a.b[b] = c
}
f.X = function (a, b) {
n(b) ? gd(a, this.g, b) : a.appendChild(this.g)
};
f.fd = function () {
hd(this.g)
};
function fv(a, b, c, d) {
return r(d) && "{{" == d.substr(0, 2) ? (a.j[d] = [b, c], null) : d
}
f.update = function (a) {
for (var b in a) iv(this, b, a[b])
};
function iv(a, b, c) {
if (c != a.k[b]) {
var d = a.j["{{" + b + "}}"];
d && (a.k[b] = c, gv(a, d[0], d[1], c))
}
}
function jv(a) {
return ha(a) && r(a[0])
}
function gv(a, b, c, d) {
if ("child" == c) {
fd(b);
if (!ha(d) || jv(d)) d = [d];
c = [];
for (var e = 0; e < d.length; e++) {
var g = d[e];
if (ja(g) || r(g) || la(g))!g.nodeType || 1 != g.nodeType && 3 != g.nodeType ? jv(g) ? c.push(ev(a, g)) : g.K ? c.push(g.K()) : c.push(cd(g.toString())) : c.push(g)
}
for (a = 0; a < c.length; a++) b.appendChild(c[a])
} else "className" == c ? b.className = d : null === d ? b.removeAttribute(c) : b.setAttribute(c, d.toString())
}
f.J = function () {
this.b = {};
this.j = {};
this.k = {};
this.fd();
delete this.g;
dv.G.J.call(this)
};
function kv(a) {
var b = Math.abs(Math.floor(a)),
c = Math.floor(b / 86400),
d = Math.floor(b % 86400 / 3600),
e = Math.floor(b % 3600 / 60),
b = Math.floor(b % 60),
g = "";
0 < c && (g += c + ":", 10 > d && (g += "0"));
if (0 < c || 0 < d) g += d + ":", 10 > e && (g += "0");
g += e + ":";
10 > b && (g += "0");
g += b;
return 0 <= a ? g : "-" + g
}
function lv(a) {
return Math.round(1E3 * a) / 10
};
var mv = {
LJ: "html5-stop-propagation",
NG: "html5-chromeless",
rI: "html5-live-dvr-disabled",
sI: "html5-live-dvr-engaged",
tI: "html5-live-playback",
EI: "html5-mobile",
GI: "modest-branding",
QI: "html5-native-controls",
QJ: "html5-tablet",
PJ: "html5-tablet-body",
zI: "html5-main-video",
gK: "html5-video-container",
hK: "html5-video-content",
iK: "html5-video-controls",
jK: "ytp-fallback",
kK: "ytp-fallback-content",
mK: "html5-video-loader",
tK: "html5-watermark",
yG: "html5-branded-watermark",
TG: "html5-context-menu",
gz: "html5-context-menu-copy-debug-info",
hz: "html5-context-menu-copy-embed-html",
iz: "html5-context-menu-copy-video-url",
jz: "html5-context-menu-copy-video-url-at-current-time",
kz: "html5-context-menu-link",
lz: "html5-context-menu-report-playback-issue",
mz: "html5-context-menu-show-video-info",
UG: "html5-show-video-info-template",
FI: "html5-modal-panel",
cI: "ideal-aspect",
BI: "autominimize-controls",
CI: "autominimize-controls-aspect",
RH: "autohide-controls",
SH: "autohide-controls-fullscreenonly",
DI: "autominimize-progress-bar",
LH: "hide-controls-when-cued",
eK: "ytp-user-idle",
TH: "hide-info-bar",
UH: "html5-hide-share",
VH: "html5-hide-volume",
uG: "ytp-autohide-fade",
pK: "video-thumbnail",
aJ: "ytp-dialog",
oG: "html5-async-progress",
pG: "html5-async-success",
nG: "html5-async-error",
JG: "html5-center-overlay",
qJ: "ytp-scalable-icon-shrink",
pJ: "ytp-scalable-icon-grow",
$H: "house-brand",
uJ: "sentiment-like",
tJ: "sentiment-dislike"
};
function nv() {
this.j = new dv(["div", "html5-fresca-module", ["div", "html5-fresca-band-slate", ["hgroup", "html5-fresca-message", ["h2", "html5-fresca-heading", "{{heading}}"],
["h3", "html5-fresca-subheading", "{{subheading}}"],
["h4", "html5-fresca-long-test", "{{long_text}}"]
],
["span", "html5-fresca-countdown", "{{countdown}}"]
]]);
S(this, this.j);
this.g = this.j.b["html5-fresca-module"];
O(this.g, "html5-stop-propagation");
this.k = 0;
this.b = null
}
w(nv, jh);
nv.prototype.K = function () {
return this.g
};
nv.prototype.update = function (a) {
this.A && this.b.state == a.state && this.b.startTime == a.startTime && this.b.g == a.g && this.b.b.join() == a.b.join() || (this.b = a, this.g.style.backgroundImage = this.b.g || "none", a = this.b.getMessage(), this.j.update({
heading: a[0] || "",
subheading: a[1] || "",
long_text: a[2] || ""
}), this.o())
};
function ov(a) {
var b = Math.floor((new Date).valueOf() / 1E3);
return b > a ? Ld("YTP_FRESCA_STARTING_SOON_MESSAGE") : kv(a - b)
}
nv.prototype.o = function () {
var a;
a = this.b;
a.startTime ? (a = a.state, a = 6 == a || 8 == a || 7 == a ? !1 : !0) : a = !1;
Q(this.g, "html5-fresca-show-countdown", a);
a && (this.j.update({
countdown: ov(this.b.startTime)
}), K(this.k), this.k = J(t(this.o, this), 1E3))
};
nv.prototype.J = function () {
K(this.k);
this.g = null;
nv.G.J.call(this)
};
function pv(a) {
this.b = [];
this.j = !1;
a && qv(this, a)
}
pv.prototype.state = -1;
function rv(a) {
return {
imageUrl: a.g,
messageText: a.getMessage(),
startTime: a.startTime,
state: a.state
}
}
function qv(a, b) {
var c = b.feed;
if (c) {
var d = c.yt$lifeCycleState;
d && (a.state = iu[d.$t] || -1);
(d = c.yt$when) && d.start && (d = new Date(d.start), a.startTime = Math.floor(d.valueOf() / 1E3));
if (d = c.yt$slate) d.imgUrl && (a.g = "url(" + d.imgUrl + ")"), (d = d.content) && d.length && (d = d.splice(0, 3), a.b = A(d, function (a) {
return a.$t
}));
if (c = c.entry) a.j = 0 <= ib(c, function (a) {
a = a.yt$status;
return !!a && "inactive" != a.$t
})
}
}
pv.prototype.getMessage = function () {
return this.b.length ? this.b : sv(this)
};
function sv(a) {
switch (a.state) {
case 6:
return a.j ? [] : [Ld("YTP_FRESCA_STAND_BY_MESSAGE"), Ld("YTP_FRESCA_TECHNICAL_DIFFICULTIES_MESSAGE")];
case 8:
return [Ld("YTP_FRESCA_EVENT_OVER_MESSAGE")];
case 7:
return [Ld("YTP_FRESCA_EVENT_OVER_MESSAGE"), Ld("YTP_FRESCA_COMPLETE_MESSAGE")];
default:
return [Ld("YTP_FRESCA_STAND_BY_MESSAGE")]
}
};
function tv(a) {
Ot.call(this, a);
Kd({
YTP_FRESCA_STARTING_SOON_MESSAGE: "Beginnt in K\u00fcrze\u2026",
YTP_FRESCA_EVENT_OVER_MESSAGE: "Diese Liveveranstaltung ist zu Ende.",
YTP_FRESCA_COMPLETE_MESSAGE: "Vielen Dank f\u00fcr deine Aufmerksamkeit.",
YTP_FRESCA_STAND_BY_MESSAGE: "Bitte warten",
YTP_FRESCA_TECHNICAL_DIFFICULTIES_MESSAGE: "Wir haben technische Schwierigkeiten."
})
}
w(tv, Ot);
f = tv.prototype;
f.wa = "fresca";
f.jc = "fresca";
f.Vi = !1;
f.Yg = !1;
f.Ka = function () {
return Kr(this.b.getVideoData(), "fresca_module")
};
f.create = function (a) {
tv.G.create.call(this);
ir(Np(), "application/x-mpegURL") || kr() ? (this.Vi = this.Yg = !1, Xt(this, ["play_pause", "seek"]), this.j = new nv, Ys(this.b, this.j.K()), this.k = a || new cv(this.b.getVideoData().videoId, this.b.R().Vo + (this.b.R(), "feeds/api/users/live/broadcasts/__video_id__/states?v=2&alt=json-in-script")), this.k.subscribe("payload", this.dA, this), this.k.subscribe("error", this.cA, this), this.subscribe("onStateChange", this.er, this)) : uv(this.b.app.j, 5, "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK",
void 0)
};
f.destroy = function () {
this.ia("onStateChange", this.er, this);
nh(this.k, this.j);
tv.G.destroy.call(this)
};
f.load = function () {
tv.G.load.call(this);
this.loaded = !0
};
f.unload = function () {
this.loaded = !1;
tv.G.unload.call(this)
};
f.er = function (a) {
this.g && (this.Vi = W(a.state, 2), (vv(a, 16) || this.Vi) && wv(this, this.g))
};
f.cA = function () {
this.Yg || (xv(this, new pv), wv(this, this.g))
};
f.dA = function (a) {
xv(this, new pv(a));
a = this.b.getVideoData();
6 != this.g.state || a.T || a.O ? wv(this, this.g) : this.b.Cl(a.videoId)
};
function wv(a, b) {
var c = 6 > b.state;
!c && a.b.app.j.ua && (b.g || b.b.length) && (c = !0);
a.Vi && !a.b.R().Kc && (c = !0);
b.j || (c = !0);
if (!a.Yg) switch (b.state) {
case 6:
a.Yg = !0;
Yt(a, ["play_pause", "seek"]);
Qt(a);
break;
case 8:
case 7:
c = a.Yg = !0
}
c && a.j.update(b);
c && !a.loaded ? a.load() : !c && a.loaded && a.unload()
}
function yv(a) {
return Kr(a.getVideoData(), "fresca_module") ? new tv(a) : null
}
function xv(a, b) {
a.g != b && (a.g = b, a.b.R().Ib() && a.I("publish_external_event", "onFrescaStateChange", rv(a.g)))
};
function zv(a) {
this.Qn = a || window;
this.eg = []
}
f = zv.prototype;
f.Qn = null;
f.eg = null;
f.listen = function (a, b, c, d) {
c = t(c, d || this.Qn);
a = R(a, b, c);
this.eg.push(a);
return a
};
function Av(a, b, c, d, e, g) {
d = t(d, g || a.Qn);
b = zg(b, c, d, e);
a.eg.push(b)
}
f.Ja = function (a) {
yg(a);
ob(this.eg, a)
};
f.removeAll = function () {
yg(this.eg);
this.eg = []
};
function Bv(a, b, c) {
this.b = a;
this.k = b || 0;
this.g = c;
this.j = t(this.ey, this)
}
w(Bv, jh);
f = Bv.prototype;
f.ta = 0;
f.J = function () {
Bv.G.J.call(this);
this.stop();
delete this.b;
delete this.g
};
f.start = function (a) {
this.stop();
this.ta = tk(this.j, n(a) ? a : this.k)
};
f.stop = function () {
0 != this.ta && uk(this.ta);
this.ta = 0
};
f.ey = function () {
this.ta = 0;
this.b && this.b.call(this.g)
};
var Cv = {},
Dv = null;
function Ev(a) {
a = ma(a);
delete Cv[a];
Wb(Cv) && Dv && Dv.stop()
}
function Fv() {
Dv || (Dv = new Bv(function () {
Gv()
}, 20));
var a = Dv;
0 != a.ta || a.start()
}
function Gv() {
var a = v();
Lb(Cv, function (b) {
Hv(b, a)
});
Wb(Cv) || Fv()
};
function Iv() {
U.call(this);
this.b = 0;
this.endTime = this.startTime = null
}
w(Iv, U);
f = Iv.prototype;
f.Nc = function () {
this.Nb("begin")
};
f.Kd = function () {
this.Nb("end")
};
f.zb = function () {
this.Nb("finish")
};
f.onStop = function () {
this.Nb("stop")
};
f.Nb = function (a) {
this.S(a)
};
function Jv(a, b, c, d) {
Iv.call(this);
if (!ha(a) || !ha(b)) throw Error("Start and end parameters must be arrays");
if (a.length != b.length) throw Error("Start and end points must be the same length");
this.k = a;
this.A = b;
this.duration = c;
this.o = d;
this.g = []
}
w(Jv, Iv);
f = Jv.prototype;
f.nd = 0;
f.play = function (a) {
if (a || 0 == this.b) this.nd = 0, this.g = this.k;
else if (1 == this.b) return !1;
Ev(this);
this.startTime = a = v(); - 1 == this.b && (this.startTime -= this.duration * this.nd);
this.endTime = this.startTime + this.duration;
this.nd || this.Nc();
this.Nb("play"); - 1 == this.b && this.Nb("resume");
this.b = 1;
var b = ma(this);
b in Cv || (Cv[b] = this);
Fv();
Hv(this, a);
return !0
};
f.stop = function (a) {
Ev(this);
this.b = 0;
a && (this.nd = 1);
Kv(this, this.nd);
this.onStop();
this.Kd()
};
f.pause = function () {
1 == this.b && (Ev(this), this.b = -1, this.Nb("pause"))
};
f.J = function () {
0 == this.b || this.stop(!1);
this.Nb("destroy");
Jv.G.J.call(this)
};
f.destroy = function () {
this.dispose()
};
function Hv(a, b) {
a.nd = (b - a.startTime) / (a.endTime - a.startTime);
1 <= a.nd && (a.nd = 1);
Kv(a, a.nd);
1 == a.nd ? (a.b = 0, Ev(a), a.zb(), a.Kd()) : 1 == a.b && a.fn()
}
function Kv(a, b) {
ka(a.o) && (b = a.o(b));
a.g = Array(a.k.length);
for (var c = 0; c < a.k.length; c++) a.g[c] = (a.A[c] - a.k[c]) * b + a.k[c]
}
f.fn = function () {
this.Nb("animate")
};
f.Nb = function (a) {
this.S(new Lv(a, this))
};
function Lv(a, b) {
T.call(this, a);
this.x = b.g[0];
this.y = b.g[1];
this.duration = b.duration;
this.state = b.b
}
w(Lv, T);
function Mv() {
Iv.call(this);
this.g = []
}
w(Mv, Iv);
Mv.prototype.add = function (a) {
C(this.g, a) || (this.g.push(a), ak(a, "finish", this.k, !1, this))
};
Mv.prototype.remove = function (a) {
ob(this.g, a) && ik(a, "finish", this.k, !1, this)
};
Mv.prototype.J = function () {
y(this.g, function (a) {
a.dispose()
});
this.g.length = 0;
Mv.G.J.call(this)
};
function Nv() {
Mv.call(this);
this.j = 0
}
w(Nv, Mv);
Nv.prototype.play = function (a) {
if (0 == this.g.length) return !1;
if (a || 0 == this.b) this.j = 0, this.Nc();
else if (1 == this.b) return !1;
this.Nb("play"); - 1 == this.b && this.Nb("resume");
var b = -1 == this.b && !a;
this.startTime = v();
this.endTime = null;
this.b = 1;
y(this.g, function (c) {
b && -1 != c.b || c.play(a)
});
return !0
};
Nv.prototype.pause = function () {
1 == this.b && (y(this.g, function (a) {
1 == a.b && a.pause()
}), this.b = -1, this.Nb("pause"))
};
Nv.prototype.stop = function (a) {
y(this.g, function (b) {
0 == b.b || b.stop(a)
});
this.b = 0;
this.endTime = v();
this.onStop();
this.Kd()
};
Nv.prototype.k = function () {
this.j++;
this.j == this.g.length && (this.endTime = v(), this.b = 0, this.zb(), this.Kd())
};
var Ov = /#(.)(.)(.)/;
function Pv(a) {
if (!Qv.test(a)) throw Error("'" + a + "' is not a valid hex color");
4 == a.length && (a = a.replace(Ov, "#$1$1$2$2$3$3"));
a = a.toLowerCase();
return [parseInt(a.substr(1, 2), 16), parseInt(a.substr(3, 2), 16), parseInt(a.substr(5, 2), 16)]
}
var Qv = /^#(?:[0-9a-f]{3}){1,2}$/i;
function Rv(a, b, c, d, e) {
Jv.call(this, b, c, d, e);
this.element = a
}
w(Rv, Jv);
Rv.prototype.j = da;
Rv.prototype.fn = function () {
this.j();
Rv.G.fn.call(this)
};
Rv.prototype.Kd = function () {
this.j();
Rv.G.Kd.call(this)
};
Rv.prototype.Nc = function () {
this.j();
Rv.G.Nc.call(this)
};
function Sv(a, b, c, d, e) {
if (2 != b.length || 2 != c.length) throw Error("Start and end points must be 2D");
Rv.apply(this, arguments)
}
w(Sv, Rv);
Sv.prototype.j = function () {
this.element.style.left = Math.round(this.g[0]) + "px";
this.element.style.top = Math.round(this.g[1]) + "px"
};
function Tv(a, b, c, d) {
Sv.call(this, a, [a.offsetLeft, a.offsetTop], b, c, d)
}
w(Tv, Sv);
Tv.prototype.Nc = function () {
this.k = [this.element.offsetLeft, this.element.offsetTop];
Tv.G.Nc.call(this)
};
function Uv(a, b, c, d, e) {
if (2 != b.length || 2 != c.length) throw Error("Start and end points must be 2D");
Rv.apply(this, arguments)
}
w(Uv, Rv);
Uv.prototype.j = function () {
this.element.style.width = Math.round(this.g[0]) + "px";
this.element.style.height = Math.round(this.g[1]) + "px"
};
function Vv(a, b, c, d, e) {
Rv.call(this, a, [b], [c], d, e)
}
w(Vv, Rv);
Vv.prototype.j = function () {
this.element.style.width = Math.round(this.g[0]) + "px"
};
function Wv(a, b, c, d, e) {
ja(b) && (b = [b]);
ja(c) && (c = [c]);
Rv.call(this, a, b, c, d, e);
if (1 != b.length || 1 != c.length) throw Error("Start and end points must be 1D");
}
w(Wv, Rv);
Wv.prototype.j = function () {
Fe(this.element, this.g[0])
};
Wv.prototype.show = function () {
this.element.style.display = ""
};
Wv.prototype.hide = function () {
this.element.style.display = "none"
};
function Xv(a, b, c) {
Wv.call(this, a, 1, 0, b, c)
}
w(Xv, Wv);
Xv.prototype.Nc = function () {
this.show();
Xv.G.Nc.call(this)
};
Xv.prototype.Kd = function () {
this.hide();
Xv.G.Kd.call(this)
};
function Yv(a, b, c) {
Wv.call(this, a, 0, 1, b, c)
}
w(Yv, Wv);
Yv.prototype.Nc = function () {
this.show();
Yv.G.Nc.call(this)
};
function Zv(a) {
return Math.pow(a, 3)
}
function $v(a) {
return 3 * a * a - 2 * a * a * a
};
function aw(a) {
return ha(a) && a.length ? a[0] : a
}
function bw(a) {
var b = /.+/;
return r(a) && null != b && null != a && a.match(b) ? a : ""
}
function cw(a, b) {
if (null == a) return b;
var c = parseInt(a, 0);
if (isNaN(c)) return b;
c = c.toString(16);
return "#" + "000000".substring(0, 6 - c.length) + c
}
function dw(a) {
return r(a) ? a : ""
}
function ew(a, b, c) {
for (var d in b)
if (b[d] == a) return a;
return c
}
function fw(a, b) {
return "true" == a || "false" == a ? "true" == a : b
}
function gw(a, b) {
return r(a) ? parseFloat(a) : b
}
function hw(a, b, c, d, e, g) {
a = 10 == b ? parseFloat(a) : parseInt(a, b);
if (null != a && !isNaN(a)) {
if (e) return Fb(a, c, d);
if (a >= c && a <= d) return a
}
return g
}
function iw(a) {
if (null == a) return 0;
if ("never" == a) return -1;
a = a.split(":");
if (3 < a.length) return 0;
var b = 0,
c = 1;
y(a, function (a) {
a = parseFloat(a);
0 > a && (c = -c);
b = 60 * b + Math.abs(a)
});
return c * b
}
function jw(a, b) {
if (null == a) return null;
if (ia(a)) {
var c = [];
y(a, function (a) {
(a = b(a)) && c.push(a)
});
return c
}
var d = b(a);
return d ? [d] : []
}
function kw(a) {
function b(a) {
return null != a && !isNaN(a)
}
return (a = a ? new be(parseFloat(a.top), parseFloat(a.right), parseFloat(a.bottom), parseFloat(a.left)) : null) && b(a.top) && b(a.right) && b(a.bottom) && b(a.left) ? a : null
}
function lw(a) {
function b(a) {
return fb(a.split(/ +/), function (a) {
return "" != a
})
}
return null == a ? [] : b(a)
};
function mw(a) {
this.value = a
};
function nw(a, b, c, d) {
this.value = a;
this.target = b;
this.b = c;
this.g = d
}
var ow = {
YG: "current",
RI: "new"
};
function pw(a) {
return a.value ? a.value : null
};
function qw(a, b, c, d) {
this.type = a;
this.trigger = b;
this.url = c;
this.duration = d
}
var rw = {
CLOSE: "close",
WI: "openUrl",
PAUSE: "pause",
BE: "subscribe"
},
sw = {
CLICK: "click",
CLOSE: "close",
vE: "hidden",
oJ: "rollOut",
zE: "rollOver",
AE: "shown"
};
function tw(a) {
if (!a) return null;
var b = ew(a.type, rw),
c = ew(a.trigger, sw),
d;
if (d = aw(a.url)) {
var e = dw(d.value);
if (e && null != Zh(e)) {
var g = ew(d.target, ow, "current");
d = null == g ? null : new nw(e, g, dw(d.link_class), fw(d.show_link_icon, !0))
} else d = null
} else d = null;
aw(a.subscribeData);
(a = aw(a.duration)) ? (a = iw(a.value), a = new mw(a)) : a = null;
return b ? new qw(b, c, d, a) : null
};
function uw(a, b, c, d, e, g, h, k, l, q, s, u, z, F) {
this.A = a;
this.o = b;
this.B = c;
this.C = d;
this.j = e;
this.H = g;
this.k = h;
this.textAlign = k;
this.N = l;
this.D = q;
this.F = s;
this.b = u;
this.g = z;
this.L = F
}
function vw(a) {
if (!a) return null;
var b = cw(a.fgColor, "#1A1A1A"),
c = cw(a.bgColor, "#FFF"),
d = cw(a.borderColor, "#000"),
e = hw(a.borderWidth, 10, 0, 5, !1, 0),
g = hw(a.bgAlpha, 10, 0, 1, !1, .8);
hw(a.borderAlpha, 10, 0, 1, !1, .2);
hw(a.gloss, 16, 0, 255, !1, 0);
var h = cw(a.highlightFontColor, "#F2F2F2"),
k = hw(a.highlightWidth, 10, 0, 5, !1, 3),
l = dw(a.textAlign),
q = hw(a.textSize, 10, 3.3, 30.1, !0, 3.6107),
s = dw(a.fontWeight),
u = kw(a.padding),
z = lw(a.effects),
F = hw(a.cornerRadius, 10, 0, 10, !0, 0);
var L = aw(a.gradient);
if (L) {
a = hw(L.x1, 10, 0, 100, !0, 0);
var ba = hw(L.y1, 10, 0, 100, !0, 0),
kb = hw(L.x2, 10, 0, 100, !0, 100),
Tf = hw(L.y2, 10, 0, 100, !0, 100),
Qw = cw(L.color1, "#FFF"),
eU = cw(L.color2, "#000"),
fU = hw(L.opacity1, 10, 0, 100, !0, 100),
L = hw(L.opacity2, 10, 0, 100, !0, 0);
a = new ww(a, ba, kb, Tf, Qw, eU, fU, L)
} else a = null;
return new uw(b, c, d, e, g, h, k, l, q, s, u, z, F, a)
}
function ww(a, b, c, d, e, g, h, k) {
this.o = a;
this.B = b;
this.A = c;
this.C = d;
this.b = e;
this.g = g;
this.j = h;
this.k = k
};
function xw(a, b) {
this.b = a;
this.videoId = b
};
var yw = {
zK: "xx",
AK: "xy",
EK: "yx",
FK: "yy"
};
var zw = cc("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));
var Aw = /<[^>]*>|&[^;]+;/g;
function Bw(a, b) {
return b ? a.replace(Aw, "") : a
}
var Cw = RegExp("[\u0591-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc]"),
Dw = RegExp("[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]"),
Ew = RegExp("^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc]"),
Fw = /^http:\/\/.*/,
Gw = RegExp("^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)", "i"),
Hw = /\s+/,
Iw = /\d/;
function Jw() {
this.b = Kw
}
Jw.prototype.Uj = !0;
Jw.prototype.Tj = function () {
return ""
};
Jw.prototype.toString = function () {
return "Const{}"
};
function Lw(a) {
return a instanceof Jw && a.constructor === Jw && a.b === Kw ? "" : "type_error:Const"
}
var Kw = {};
function Mw() {
this.b = "";
this.g = Nw
}
Mw.prototype.Uj = !0;
var Nw = {};
Mw.prototype.Tj = function () {
return this.b
};
function Ow(a) {
var b = new Mw;
b.b = a;
return b
}
var Pw = Ow(""),
Rw = /^[-.%_!# a-zA-Z0-9]+$/;
function Sw() {
this.b = Tw
}
Sw.prototype.Uj = !0;
Sw.prototype.Tj = function () {
return ""
};
Sw.prototype.gt = !0;
Sw.prototype.xh = function () {
return 1
};
var Tw = {};
function Uw() {
this.b = "";
this.j = Vw;
this.g = null
}
Uw.prototype.gt = !0;
Uw.prototype.xh = function () {
return this.g
};
Uw.prototype.Uj = !0;
Uw.prototype.Tj = function () {
return this.b
};
function Ww(a) {
return a instanceof Uw && a.constructor === Uw && a.j === Vw ? a.b : "type_error:SafeHtml"
}
var Xw = /^[a-zA-Z0-9-]+$/,
Yw = cc("action", "cite", "data", "formaction", "href", "manifest", "poster", "src"),
Zw = cc("link", "script", "style");
function $w(a) {
function b(a) {
if (ha(a)) y(a, b);
else {
if (!(a instanceof Uw)) {
var g = null;
a.gt && (g = a.xh());
a = ax(Ca(a.Uj ? a.Tj() : String(a)), g)
}
d += Ww(a);
a = a.xh();
0 == c ? c = a : 0 != a && c != a && (c = null)
}
}
var c = 0,
d = "";
y(arguments, b);
return ax(d, c)
}
var Vw = {};
function ax(a, b) {
var c = new Uw;
c.b = a;
c.g = b;
return c
}
ax("", 0);
function bx(a, b) {
ha(b) || (b = [b]);
var c = A(b, function (a) {
return r(a) ? a : a.Ep + " " + a.duration + "s " + a.timing + " " + a.Dp + "s"
});
cx(a, c.join(","))
}
var dx = function (a) {
var b = !1,
c;
return function () {
b || (c = a(), b = !0);
return c
}
}(function () {
if (oc) return zc("10.0");
var a = document.createElement("div"),
b = ie(),
c = {
transition: "opacity 1s linear"
};
b && (c[b + "-transition"] = "opacity 1s linear");
c = {
style: c
};
if (!Xw.test("div")) throw Error("Invalid tag name <div>.");
if ("div" in Zw) throw Error("Tag name <div> is not allowed for SafeHtml.");
var d = null,
b = "<div";
if (c)
for (var e in c) {
if (!Xw.test(e)) throw Error('Invalid attribute name "' + e + '".');
var g = c[e];
if (null != g) {
if (g instanceof Jw) g = Lw(g);
else if ("style" == e.toLowerCase()) {
if (!la(g)) throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, ' + typeof g + " given: " + g);
if (!(g instanceof Mw)) {
var h = "",
k = void 0;
for (k in g) {
if (!/^[-_a-zA-Z0-9]+$/.test(k)) throw Error("Name allows only [-_a-zA-Z0-9], got: " + k);
var l = g[k];
null != l && (l instanceof Jw ? l = Lw(l) : Rw.test(l) || (l = "zClosurez"), h += k + ":" + l + ";")
}
g = h ? Ow(h) : Pw
}
h = void 0;
h = g instanceof Mw && g.constructor === Mw && g.g === Nw ? g.b : "type_error:SafeStyle";
g = h
} else {
if (/^on/i.test(e)) throw Error('Attribute "' +
e + '" requires goog.string.Const value, "' + g + '" given.');
if (g instanceof Sw) g = g instanceof Sw && g.constructor === Sw && g.b === Tw ? "" : "type_error:SafeUrl";
else if (e.toLowerCase() in Yw) throw Error('Attribute "' + e + '" requires goog.string.Const or goog.html.SafeUrl value, "' + g + '" given.');
}
b += " " + e + '="' + Ca(String(g)) + '"'
}
}
e = void 0;
n(e) ? ha(e) || (e = [e]) : e = [];
!0 === zw.div ? b += ">" : (d = $w(e), b += ">" + Ww(d) + "</div>", d = d.xh());
(c = c && c.dir) && (/^(ltr|rtl|auto)$/i.test(c) ? d = 0 : d = null);
b = ax(b, d);
a.innerHTML = Ww(b);
a = a.firstChild;
b = a.style[Za("transition")];
return "" != ("undefined" !== typeof b ? b : a.style[le(a, "transition")] || "")
});
function cx(a, b) {
je(a, "transition", b)
};
function ex(a, b) {
(a = Pc(a)) && a.style && (Ge(a, b), Q(a, "hid", !b))
}
function fx(a) {
return (a = Pc(a)) ? !("none" == a.style.display || Zf(a, "hid")) : !1
}
function gx(a) {
y(arguments, function (a) {
ex(a, !0)
})
}
function hx(a) {
y(arguments, function (a) {
ex(a, !1)
})
}
var ix = {};
function jx(a) {
if (a in ix) return ix[a];
var b;
if ((b = document.body.style) && a in b) b = a;
else {
var c = he();
c ? (c = c.toLowerCase(), c += $a(a), b = !n(b) || c in b ? c : null) : b = null
}
return ix[a] = b
}
function kx(a, b, c) {
(a = Pc(a)) && a.style && (b = jx(b)) && (a.style[b] = c)
};
function lx(a, b, c) {
var d = a.C,
e = a.D,
g = a.b ? a.b : "xy",
h = mx(c, a.o, g);
a = nx(c, a.j, g);
var g = 640 * b.width * h / 100,
k = 360 * b.height * a / 100;
return new ce(0 == d ? 640 * b.left * h / 100 : 0 < d ? d : c.width + d - g, 0 == e ? 360 * b.top * a / 100 : 0 < e ? e : c.height + e - k, g, k)
}
function mx(a, b, c) {
var d = (c = "xx" == c || "xy" == c) ? 640 : 360;
return (d + ((c ? a.width : a.height) - d) * b) / d
}
function nx(a, b, c) {
var d = (c = "xy" == c || "yy" == c) ? 360 : 640;
return (d + ((c ? a.height : a.width) - d) * b) / d
};
function ox(a, b, c, d, e, g, h, k, l, q, s) {
this.x = a;
this.y = b;
this.A = c;
this.k = d;
this.g = e;
this.B = g;
this.C = h;
this.D = k;
this.o = l;
this.j = q;
this.b = s
}
function px(a, b) {
if (!a) return null;
var c = gw(a.x, 0),
d = gw(a.y, 0),
e = gw(a.w, 0),
g = gw(a.h, 0),
h = iw(a.t),
k = gw(a.scaleSlope, 1);
return b(c, d, e, g, h, gw(a.d, 0), gw(a.px, 0), gw(a.py, 0), gw(a.scaleSlopeX, k), gw(a.scaleSlopeY, k), ew(a.scaleDimension, yw, "xy"))
}
function qx(a, b, c) {
c = c ? qx(c, b) : null;
a = lx(a, new ce(a.x, a.y, a.A, a.k), b);
c ? (a.top += c.top, a.left += c.left) : (a.top += b.top, a.left += b.left);
c = a.clone();
b && !b.contains(a) && (a.width < b.width ? c.left = Fb(a.left, b.left, b.left + b.width - a.width) : (c.left = b.left, c.width = b.width), a.height < b.height ? c.top = Fb(a.top, b.top, b.top + b.height - a.height) : (c.top = b.top, c.height = b.height));
return c
}
function rx(a) {
return a ? px(a, function (a, c, d, e, g, h, k, l, q, s, u) {
return new ox(a, c, d, e, g, h, k, l, q, s, u)
}) : null
};
function sx(a, b, c, d, e, g, h, k, l, q, s, u, z) {
ox.call(this, a, b, c, d, e, k, l, q, s, u, z);
this.F = g;
this.H = h
}
w(sx, ox);
function tx(a) {
if (!a) return null;
var b = gw(a.sx, 0),
c = gw(a.sy, 0);
return px(a, function (a, e, g, h, k, l, q, s, u, z, F) {
return new sx(a, e, g, h, k, b, c, l, q, s, u, z, F)
})
};
function ux(a, b, c, d) {
this.type = a;
this.g = b;
this.b = c;
this.j = d
}
var vx = {
oE: "anchored",
iJ: "rect",
wJ: "shapeless"
};
function wx(a) {
if (!a) return null;
var b = ew(a.type, vx, "rect"),
c = jw(a.rectRegion, rx),
d = jw(a.anchoredRegion, tx);
a = jw(a.shapelessRegion, rx);
return new ux(b, c, d, a)
}
function xx(a) {
return a.g && a.g.length ? a.g[0] : a.b && a.b.length ? a.b[0] : a.j && a.j.length ? a.j[0] : null
};
function yx(a, b) {
this.g = a;
this.b = b
};
function zx(a, b) {
this.state = a;
this.b = b
}
var Ax = {
CLOSED: "closed",
XI: "playerControlShow",
zE: "rollOver",
AE: "shown"
};
function Bx(a) {
if (!a) return null;
var b = ew(a.state, Ax);
a = bw(a.ref);
return b ? new zx(b, a) : null
};
function Cx(a, b, c, d) {
this.b = a || [];
this.j = b || [];
this.k = c;
this.g = d;
this.value = !1
}
function Dx(a) {
if (!a) return null;
var b = jw(a.condition, Bx),
c = jw(a.notCondition, Bx),
d = fw(a.show_delay, !1);
a = fw(a.hide_delay, !1);
return b || c ? new Cx(b, c, d, a) : null
}
function Ex(a, b, c) {
y(a.b, ra(b, !1), c);
y(a.j, ra(b, !0), c)
};
function Fx(a, b, c, d, e, g, h, k, l, q, s, u, z, F, L) {
this.id = a;
this.type = b;
this.style = c;
this.B = d;
this.g = e;
this.o = g || [];
this.F = h || [];
this.b = k;
this.H = l;
this.k = q;
this.C = s;
this.A = u;
this.j = z;
this.data = F;
this.D = L
}
var Gx = {
oE: "anchored",
qt: "branding",
MG: "channel",
WG: "cta",
YH: "highlightText",
nI: "label",
ZI: "playlist",
$I: "popup",
EJ: "speech",
BE: "subscribe",
UJ: "title",
VIDEO: "video",
sK: "vote",
vK: "website"
},
Hx = {
qt: "branding",
DG: "card",
XH: "highlight",
IMAGE: "image",
MARKER: "marker",
PAUSE: "pause",
dJ: "promotion",
Zm: "survey",
TEXT: "text",
wK: "widget"
},
Ix = {
oK: "video_relative",
YI: "player_relative"
};
function Jx(a) {
if (!a) return null;
var b = bw(a.id);
bw(a.author);
var c = ew(a.type, Hx),
d = ew(a.style, Gx),
e = dw(aw(a.TEXT)),
g = dw(a.data),
g = 0 != g.length ? Td(g) : {},
h;
var k = aw(a.segment);
k ? (bw(k.timeRelative), h = bw(k.spaceRelative), h = (k = jw(k.movingRegion, wx)) ? new yx(h, k) : null) : h = null;
var k = jw(a.action, tw),
l = jw(a.trigger, Dx),
q = vw(aw(a.appearance));
q || (q = vw({}));
var s = ew(a.coordinate_system, Ix, "video_relative"),
u;
u = (u = aw(a.image_source)) ? new xw(dw(u.standard_url), dw(u.video_id)) : null;
var z = fw(a.closeable, !0),
F = fw(a.logable, !0),
L = dw(a.html_blob);
a = dw(a.log_data);
return b && c ? new Fx(b, c, d, e, h, k, l, q, s, u, z, F, L, g, a) : null
}
function Kx(a) {
return (a = Lx(a, function (a) {
return "openUrl" == a.type && null != a.url
})) ? a.url : null
}
function Mx(a) {
return Nx(a, function (a) {
return null != a.url && a.url.g
})
}
function Ox(a) {
return Nx(a, function (a) {
return "click" == a.trigger
})
}
function Nx(a, b) {
return gb(a.o, b, void 0)
}
function Px(a, b, c) {
y(a.o, b, c)
}
function Lx(a, b) {
return B(a.o, b, void 0)
}
function Qx(a, b, c) {
y(a.F, b, c)
}
function Rx(a, b) {
A(a.F, b, void 0)
}
function Sx(a) {
return (a = Tx(a)) ? xx(a) : null
}
function Tx(a) {
a.g ? (a = a.g, a = a.b.length ? a.b[0] : null) : a = null;
return a
}
function Ux(a, b) {
var c = Sx(a);
return c && b ? nx(b, c.j, c.b ? c.b : "xy") : 1
};
function Vx(a) {
if (!a) return !1;
var b = Wx(a);
return ("com" == b[0] && "youtube" == b[1] || "be" == b[0] && "youtu" == b[1]) && -1 == a.indexOf("/redirect?")
}
function Wx(a) {
a = a.replace(/https?:\/\//g, "");
a = a.split("/", 1);
return !a || 1 > a.length || !a[0] ? [] : a[0].toLowerCase().split(".").reverse()
}
function Xx(a, b) {
if ("new" == a.target) return -1;
var c = pw(a);
if (!c) return -1;
var c = c.replace(/https?:\/\//g, ""),
d;
(d = !Vx(c)) || (d = jf(c) || "", d = d.split("/"), d = "/" + (1 < d.length ? d[1] : ""), d = "/watch" != d);
if (d) return -1;
d = Zh(c);
if (!d || d.v != b || d.list || d.p) return -1;
c = c.split("#", 2);
if (!c || 2 > c.length) return -1;
(c = Yh(c[1])) && c.t ? (d = c.t, c = 0, -1 != d.indexOf("h") && (d = d.split("h"), c = 3600 * d[0], d = d[1]), -1 != d.indexOf("m") && (d = d.split("m"), c = 60 * d[0] + c, d = d[1]), -1 != d.indexOf("s") ? (d = d.split("s"), c = 1 * d[0] + c) : c = 1 * d + c) : c = -1;
return c
}
function Yx(a, b, c, d) {
(a = pw(a)) ? Vx(a) ? d = bi(a, {
src_vid: c,
feature: "iv",
annotation_id: b
}) : (a ? (b = Wx(a), b = "com" == b[0] && "google" == b[1] && "plus" == b[2]) : b = !1, b && d ? (d = ra(Zx, d.cb, d.Va), a = new M(a), yf(a, d(a.Qb)), d = a.toString()) : d = a): d = null;
return d
}
function Zx(a, b, c) {
c = c.replace(/\/(u|b)\/[0-9]+/g, "");
var d = /^[0-9]+$/;
a && d.test(a) && (c = "/b/" + a + c);
b && d.test(b) && (c = "/u/" + b + c);
return c
}
function $x(a) {
return a.target ? "new" == a.target ? "_blank" : "_top" : Vx(pw(a)) ? "_top" : "_blank"
};
function ay(a, b) {
this.j = a;
this.g = b;
this.b = {}
}
function by(a, b, c, d) {
b && b.A && (c = cy(a, b, 2, c), a.b[b.id] = c["p-time"], bc(c, d || {}), a.log_(c))
}
function dy(a, b, c, d, e) {
b && b.A && Kx(b) && (d = cy(a, b, 3, d), d["i-time"] = a.b[b.id] || "", bc(d, e || {}), a.log_(d, c))
}
function ey(a, b, c, d) {
b && b.A && (c = cy(a, b, 4, c), c["i-time"] = a.b[b.id] || "", bc(c, d || {}), a.log_(c))
}
function fy(a, b, c) {
a = a.g.getVideoData();
a.mb ? (c = a.mb[c]) && -1 != c.search(Yn) && (a = Aa("[ANNOTATION_ID]"), 0 <= c.indexOf("[ANNOTATION_ID]") ? c = c.replace("[ANNOTATION_ID]", b) : 0 <= c.indexOf(a) && (c = c.replace(a, b)), Qd(c)) : a.ja && Qd(bi(a.ja, {
label: c,
value: "a_id=" + b
}))
}
function cy(a, b, c, d) {
var e = {};
e["iv-event"] = c;
e["a-id"] = b.id;
e["a-type"] = gy(b);
if (c = Kx(b)) e.link = escape(pw(c)), c.b && (e["l-class"] = c.b);
e["p-time"] = a.g.getCurrentTime().toFixed(2);
e.ps = a.g.R().vb;
if (b.D) {
var g = new Cf(b.D);
y(g.Xa(), function (a) {
e[a] = g.get(a)
})
}
e["a-type"] = d || e["a-type"];
return e
}
function gy(a) {
switch (a.type) {
case "text":
switch (a.style) {
case "popup":
return 1;
case "speech":
return 2;
case "anchored":
return 8;
case "label":
return 9;
case "title":
return 4;
default:
return 0
}
case "highlight":
return 3;
case "image":
switch (a.style) {
case "video":
return 11;
case "channel":
return 10;
default:
return 0
}
default:
return 0
}
}
ay.prototype.log_ = function (a, b) {
this.j.I("command_log", "iv", a, b)
};
function hy(a, b) {
this.$ = a;
this.context = b;
this.P = this.O = this.M = null;
this.D = 0
}
function iy(a, b, c, d, e, g) {
b = new Ds(b, c, {
id: d
});
b.namespace = "iv-module";
e && b.eb.subscribe("onEnter", e, a);
g && b.eb.subscribe("onExit", g, a);
a.context.eb.I("command_add_cuerange", [b], a.context.g.getPlayerType())
}
f = hy.prototype;
f.uj = function () {
this.context.eb.subscribe("onResize", this.zd, this)
};
f.K = function () {
return this.$
};
function jy(a, b, c, d, e) {
Av(a.context.b, b, "click", ra(a.ah, b, c, d, e), "iv-click-target", a);
Av(a.context.b, b, "touchend", ra(a.ah, b, c, d, e), "iv-click-target", a)
}
f.ah = function (a, b, c, d, e) {
e.stopPropagation();
e.preventDefault();
var g = Yx(b, c, this.context.k.videoId);
a = t(function () {
this.context.g.pauseVideo();
window.open(g, $x(b))
}, this);
Vx(pw(b)) && "new" != b.target || (a(), a = null);
c = {};
c.interval = v() - this.D;
dy(this.context.logger, d, a, null, c);
"cta" == d.style && fy(this.context.logger, d.id, "cta_annotation_clicked");
return !1
};
f.show = function () {
this.D = v()
};
f.hide = function () {};
f.destroy = function () {
hd(this.K())
};
function ky(a) {
a.P || (a.P = xd(a.K(), "html5-video-player"));
return a.P
}
function ly(a) {
var b = a.context.j.Zc;
if (!b) return null;
var c = a.context.j.zf || new ce(0, 0, b.width, b.height),
d = -c.top,
e = b.height - c.top,
g;
a.O || (a.O = H("html5-video-container", ky(a)));
g = a.O;
if (!g) return null;
g = 35 - (parseInt(me(g, "bottom"), 10) || 0);
a.M || (a.M = H("html5-info-bar", ky(a)));
(a = a.M) && "none" != me(a, "display") && (d += Ce(a).height);
return new be(d, b.width - c.left, e - g, -c.left)
}
f.zd = function () {};
function my(a, b, c) {
this.id = a;
this.type = b.card_type;
this.A = b.teaser_text || b.title;
this.j = b.teaser_image_url || b.image_url;
this.Ed = b.start_ms;
this.b = b.end_ms;
this.ha = c
};
function ny(a, b, c, d) {
my.call(this, a, b, d);
this.k = b.banner_image_url;
this.B = b.image_url;
this.g = b.g_plus_url;
this.title = b.title;
this.description = b.description;
this.o = b.html_blobs;
this.url = c
}
w(ny, my);
function oy(a, b, c, d) {
my.call(this, a, b, d);
this.B = b.profile_image_url;
this.k = b.intro;
this.C = b.image_url;
this.g = b.playlist_video_count;
this.title = b.title;
this.o = b.meta_info;
this.url = c
}
w(oy, my);
function py(a, b, c, d) {
my.call(this, a, b, d);
this.D = b.image_url;
this.title = b.title;
this.description = b.description;
this.g = b.custom_message;
this.url = c
}
w(py, my);
function qy(a, b, c, d) {
py.call(this, a, b, c, d);
this.C = b.ypc_item_type;
this.B = b.ypc_item_id;
this.o = b.ypc_flow_type;
this.k = "true" == b.logged_in_user
}
w(qy, py);
function ry(a, b, c, d) {
my.call(this, a, b, d);
this.B = b.profile_image_url;
this.k = b.intro;
this.C = b.image_url;
this.g = b.video_duration;
this.title = b.title;
this.o = b.meta_info;
this.description = b.description;
this.url = c
}
w(ry, my);
function sy(a) {
a && (a.style.display = "block")
}
function ty(a) {
a && (a.style.display = "none")
}
function uy(a, b) {
var c = lg("requestAnimationFrame", window);
return J(function () {
c ? c.call(window, a) : a()
}, b || 0)
};
function X(a) {
this.template = new dv(a);
S(this, this.template);
this.element = this.template.K();
this.$ = "block";
this.ka = !0;
this.rd = [];
this.qa = {}
}
w(X, jh);
f = X.prototype;
f.K = function () {
return this.element
};
f.X = function (a, b) {
this.template.X(a, b)
};
f.fd = function () {
this.template.fd()
};
f.na = function (a, b) {
iv(this.template, b || "content", a)
};
f.show = function () {
var a = this.element;
a && (a.style.display = this.$);
this.ka = !0;
this.element.removeAttribute("aria-hidden")
};
f.hide = function () {
ty(this.element);
this.ka = !1;
this.element.setAttribute("aria-hidden", "true")
};
f.Fb = function (a) {
Cg(this.element, a)
};
f.listen = function (a, b, c, d) {
return vy(this, this.element, a, b, c, d)
};
function vy(a, b, c, d, e, g, h) {
b = R(b, c, t(d, e || a), h);
a.rd.push(b);
r(g) && (a.qa[g] ? a.qa[g].push(b) : a.qa[g] = [b]);
return b
}
f.Ja = function (a) {
yg(a)
};
function wy(a, b) {
a.Ja(a.qa[b]);
a.qa[b] = []
}
f.stopPropagation = function (a) {
this.listen(a, this.HE)
};
f.HE = function (a) {
a.stopPropagation()
};
f.addEventListener = function (a, b, c) {
this.element.addEventListener ? this.element.addEventListener(a, b, c) : this.element.attachEvent && this.element.attachEvent("on" + a, b)
};
f.removeEventListener = function (a, b, c) {
this.element.removeEventListener ? this.element.removeEventListener(a, b, c) : this.element.detachEvent && this.element.detachEvent("on" + a, b)
};
f.dispatchEvent = function (a) {
return this.element.dispatchEvent(a)
};
f.fireEvent = function (a, b) {
return this.element.fireEvent(a, b)
};
f.J = function () {
this.Ja(this.rd);
delete this.element;
X.G.J.call(this)
};
function xy(a) {
var b = Fd("YPC_LOADER_JS");
if (window.spf) {
var c = "";
if (b) {
var d = b.indexOf("jsbin/"),
e = b.lastIndexOf(".js"),
g = d + 6; - 1 < d && -1 < e && e > g && (c = b.substring(g, e), c = c.replace(yy, ""), c = c.replace(zy, ""), c = c.replace("debug-", ""), c = c.replace("tracing-", ""))
}
spf.script.load(b, c, a)
} else Ay(b, a)
}
function Ay(a, b) {
var c = By(a),
d = document.getElementById(c),
e = d && eg(d, "loaded"),
g = d && !e;
e ? b && b() : (b && (uh(c, b), ma(b)), g || (d = Cy(a, c, function () {
eg(d, "loaded") || (cg(d, "loaded", "true"), xh(c), J(ra(Ah, c), 0))
})))
}
function Cy(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 By(a) {
var b = document.createElement("a");
b.href = a;
a = b.href.replace(/^[a-zA-Z]+:\/\//, "//");
return "js-" + Va(a)
}
var yy = /-vfl[a-zA-Z0-9_+=-]+/,
zy = /-[a-zA-Z]{2,3}_[a-zA-Z]{2,3}(?=(\/|$))/;
function Dy() {
var a = Fd("YPC_LOADER_CSS");
if (window.spf) {
var b = a.match(Ey);
spf.style.load(a, b ? b[1] : "", void 0)
} else Fy(a)
}
function Fy(a) {
var b = Gy(a),
c = document.getElementById(b),
d = c && eg(c, "loaded");
d || c && !d || (c = Hy(a, b, function () {
eg(c, "loaded") || (cg(c, "loaded", "true"), xh(b), J(ra(Ah, b), 0))
}))
}
function Hy(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 Gy(a) {
var b = document.createElement("a");
b.href = a;
a = b.href.replace(/^[a-zA-Z]+:\/\//, "//");
return "css-" + Va(a)
}
var Ey = /cssbin\/(?:debug-)?([a-zA-Z0-9_-]+?)(?:-2x|-web|-rtl|-vfl|.css)/;
function Iy() {
return !!p("yt.scheduler.instance")
}
function Jy(a, b) {
void 0 === b && (b = NaN);
var c = p("yt.scheduler.instance.addJob");
return c ? (isNaN(b) && (b = 0), c(a, 0, b)) : isNaN(b) ? (a(), NaN) : J(a, b || 0)
}
function Ky(a, b) {
return Jy(a, b)
}
function Ly(a) {
var b = p("yt.scheduler.instance.cancelJob");
b ? b(a) : K(a)
}
function My() {
var a = p("yt.scheduler.instance.start");
a && (K(Ny), a())
}
var Ny = 0;
function Oy() {
var a = p("yt.scheduler.instance.pause");
a && (a(), K(Ny), Ny = J(My, 800))
};
var Py = p("yt.pubsub2.instance_") || new oh;
oh.prototype.subscribe = oh.prototype.subscribe;
oh.prototype.unsubscribeByKey = oh.prototype.Lb;
oh.prototype.publish = oh.prototype.I;
oh.prototype.clear = oh.prototype.clear;
ca("yt.pubsub2.instance_", Py, void 0);
var Qy = p("yt.pubsub2.subscribedKeys_") || {};
ca("yt.pubsub2.subscribedKeys_", Qy, void 0);
var Ry = p("yt.pubsub2.topicToKeys_") || {};
ca("yt.pubsub2.topicToKeys_", Ry, void 0);
var Sy = p("yt.pubsub2.isAsync_") || {};
ca("yt.pubsub2.isAsync_", Sy, void 0);
ca("yt.pubsub2.skipSubKey_", null, void 0);
var Ty = 2;
function Uy(a, b, c, d) {
var e = {
itemData: {
itemId: b,
itemType: a
},
flowType: c
};
Vy(function () {
p("yt.www.ypc.checkout.showYpcOverlay")(e, d)
})
}
function Vy(a) {
if (Ty) {
Dy();
var b = Fd("YPC_LOADER_CONFIGS"),
c = function () {
(Ty -= 1) || Wy(a)
};
xy(c);
ii(b, {
onSuccess: function (a, b) {
Dd(b.configs);
Kd(b.messages);
c()
}
})
} else a && a()
}
function Wy(a) {
y(Fd("YPC_LOADER_CALLBACKS"), function (a) {
(a = p(a)) && a()
});
a && a()
};
function Xy(a) {
this.b = a
}
function Yy(a, b) {
var c = Zy(a, b.url, b.id),
d = b.g ? ["a", "iv-card-gplus", {
href: b.g,
target: "_blank",
title: Ld("YTP_ON_GOOGLE_PLUS")
}] : null,
c = new X(["article", "iv-card-channel", {
style: "background-image: url(" + b.k + ");"
},
["a", ["iv-card-image", "iv-click-target"], {
href: c
},
["img", {
src: b.B
}]
],
["div", "iv-card-content", d, ["h1", "iv-click-target", b.title],
["div", "iv-card-subscribe", ""],
["p", "", b.description]
]
]),
e = c.K();
e && Lb(b.o, function (a, b) {
var c = Qc(b, e);
y(c, function (b) {
b.innerHTML = a
})
}, c);
return c
}
function $y(a, b) {
var c = Zy(a, b.url, b.id),
d = ["ul", "iv-card-meta-info"];
y(b.o, function (a) {
d.push(["li", "", a])
});
c = ["article", ["iv-card-watchable", "iv-card-playlist"],
["h1", {
style: "background-image: url(" + b.B + ");"
},
b.k
],
["div", "iv-click-target", ["a", ["iv-card-image", "iv-click-target"], {
href: c
},
["img", {
src: b.C
}],
["div", "iv-card-image-overlay", ["span", "iv-card-playlist-video-count", b.g.toString()],
["span", "iv-card-playlist-play-all", Ld("YTP_PLAY_ALL")]
]
],
["div", ["iv-card-content", "iv-click-target"],
["h2",
"", b.title
], d
]
]
];
return new X(c)
}
function az(a, b) {
var c = Zy(a, b.url, b.id);
return new X(["article", "iv-card-simple", ["div", "iv-card-image", {
style: "background-image: url(" + b.D + ");"
}],
["div", "iv-card-content", ["h1", "", b.title],
["p", "", b.description],
["a", ["iv-click-target", "yt-uix-button", "yt-uix-button-primary", "yt-uix-button-size-large"], {
href: c,
role: "button"
},
["span", "yt-uix-button-content", b.g]
]
]
])
}
function bz(a, b, c) {
var d = az(a, b),
e = d.K();
Av(a.b.b, e, "click", ra(a.g, b, c), "iv-click-target", a);
return d
}
function cz(a, b) {
var c = Zy(a, b.url, b.id),
d = ["ul", "iv-card-meta-info"];
y(b.o, function (a) {
d.push(["li", "", a])
});
return new X(["article", ["iv-card-watchable", "iv-card-video"],
["h1", {
style: "background-image: url(" + b.B + ");"
},
b.k
],
["div", "iv-click-target", ["a", ["iv-card-image", "iv-click-target"], {
href: c
},
["img", {
src: b.C
}],
["span", "iv-card-video-duration", b.g]
],
["div", ["iv-card-content", "iv-click-target"],
["h2", "", b.title], d
]
]
])
}
Xy.prototype.g = function (a, b, c) {
c.stopPropagation();
c.preventDefault();
Fd("YPC_LOADER_ENABLED") ? (this.b.g.pauseVideo(), this.b.g.isFullscreen() && dz(this.b.g.app), this.b.eb.I("external_overlay_activated"), Uy(a.C, a.B, a.o, a.k)) : b(c.target, a.url, a.id, a.ha, c)
};
function Zy(a, b, c) {
return b ? Yx(b, c, a.b.k.videoId, a.b.j) : null
};
function ez(a, b) {
hy.call(this, a, b);
this.U = !1;
this.N = I("div", ["iv-cards-thumbnails", "hid"]);
this.T = I("button", void 0, I("div"));
this.A = I("div", "iv-cards-background", I("div"), this.T);
this.o = I("div");
this.F = I("span");
this.k = I("div", ["iv-cards-notif", "iv-cards-notif-inactive"], void 0, this.o, I("button", {
type: "button"
}, I("div", void 0, this.F)));
this.g = I("div", "iv-cards-details");
this.C = new Xy(this.context);
this.b = [];
this.L = null;
this.W = 0;
this.j = -1;
this.Jb = null;
this.H = this.B = !1;
O(this.K(), "iv-cards");
iy(this,
1E3 * this.context.k.Pa - 1200, 2147483647, "", this.Lu);
this.context.g.addEventListener("onStateChange", t(this.Mu, this))
}
w(ez, hy);
var fz = {
channel: ny,
fundraising: py,
playlist: oy,
product: py,
tip: qy,
video: ry
};
function gz(a, b) {
return new Tv(a, [b, a.offsetTop], 200, $v)
}
function hz(a, b, c) {
a = new Xv(a, 200, $v);
b && hk(a, "end", b, !1, c);
return a
}
function iz(a) {
var b = new Yv(a, 200, $v);
hk(b, "end", ra(function (a, b) {
je(a, "opacity", "");
b.target.J()
}, a));
return b
}
function jz(a) {
Ge(a.A, !1);
a.K().appendChild(a.A);
ak(a.A, "click", a.Oi, !1, a);
ak(a.A, "touchend", a.Oi, !1, a);
a.K().appendChild(a.N);
Ge(a.g, !1);
a.K().appendChild(a.g);
a.K().appendChild(a.k);
kz(a);
a.context.b.listen(a.k, "click", a.Gq, a);
a.context.b.listen(a.k, "touchend", a.Gq, a);
a.context.b.listen(a.k, "mouseover", function () {
lz(this);
this.Jb && this.Jb.dm.stop()
}, a);
a.context.b.listen(a.k, "mouseout", function () {
this.Jb && this.Jb.dm.start(200)
}, a);
a.context.eb.subscribe("external_overlay_activated", a.Oi, a);
var b =
ly(a);
ex(a.K(), b ? 445 < b.right - b.left && 243 < b.bottom - b.top : !1)
}
f = ez.prototype;
f.add = function (a) {
this.U || (jz(this), this.U = !0);
var b = (new X(["button", {
type: "button",
style: "background-image: url(" + a.j + ");"
}])).K();
Ge(b, !1);
var c, d;
switch (a.type) {
case "fundraising":
case "product":
if (c = az(this.C, a)) d = c.K(), jy(this, d, a.url, a.id, a.ha);
break;
case "tip":
(c = bz(this.C, a, t(this.ah, this))) && (d = c.K());
break;
case "video":
if (c = cz(this.C, a)) d = c.K(), jy(this, d, a.url, a.id, a.ha);
break;
case "playlist":
if (c = $y(this.C, a)) d = c.K(), jy(this, d, a.url, a.id, a.ha);
break;
case "channel":
if (c = Yy(this.C, a)) d =
c.K(), jy(this, d, a.url, a.id, a.ha)
}
if (d) {
var e = {
be: a,
Tk: d,
Dg: b
},
g = xb(this.b, e, function (a, b) {
return a.be.Ed - b.be.Ed
});
0 > g && (g = -(g + 1));
ub(this.b, g, 0, e);
gd(this.N, b, g);
1 < this.b.length && gx(this.N);
c.X(this.g, g);
c = ra(this.hy, e);
this.context.b.listen(b, "click", c, this);
this.context.b.listen(d, "click", c, this);
this.context.b.listen(b, "touchend", c, this);
this.context.b.listen(d, "touchend", c, this);
iy(this, a.Ed, a.b, a.id, ra(this.iy, a), this.jy)
}
};
f.ah = function (a, b, c, d, e) {
vd(a, "article", "iv-card-active") ? ez.G.ah.call(this, a, b, c, d, e) : e.preventDefault()
};
f.hy = function (a, b) {
var c = ib(this.b, function (b) {
return b === a
});
mz(this, c, !0);
vd(b.target, "button", "yt-uix-button") || b.stopPropagation()
};
f.iy = function () {
nz(this, ++this.W);
1 == this.context.g.getPlayerState() ? lz(this) : this.H = !0
};
f.jy = function () {
nz(this, --this.W)
};
function nz(a, b) {
0 == b ? (a.F.innerHTML = "", O(a.k, "iv-cards-notif-inactive")) : (10 > b ? a.F.innerHTML = b : a.F.innerHTML = "*", P(a.k, "iv-cards-notif-inactive"))
}
function oz(a, b) {
if (!a.Jb) {
a.zd();
var c = new X(["div", "", ["span", "", b.A],
["span", "iv-card-image", {
style: "background-image: url(" + b.j + ");"
}]
]);
a.o.innerHTML = "";
ed(a.o, jd(c.K()));
by(a.context.logger, b.ha, 50)
}
}
function lz(a) {
if (!a.Jb) {
var b = pz(a);
if (!(0 > b)) {
oz(a, a.b[b].be);
Ae(a.o, "");
var c = a.o.offsetWidth;
(new Vv(a.o, 0, c, 400, $v)).play();
a.Jb = {
zB: new Vv(a.o, c, 0, 200, $v),
dm: new Bv(function () {
this.Jb && (this.Jb.zB.play(), this.Jb = null)
}, 4E3, a),
jv: b
};
a.Jb.dm.start()
}
}
}
function kz(a) {
a.zd();
iz(a.k)
}
f.Gq = function (a) {
a && a.stopPropagation();
if (!this.B) {
a = new Nv;
ze(this.K(), this.context.j.Zc);
for (var b = 0; b < this.b.length; ++b) {
var c = this.b[b].Dg;
a.add(iz(c));
Fe(c, 0);
Ge(c, !0);
a.add(gz(c, b * (c.offsetWidth + 15)))
}
a.add(hz(this.k));
a.add(iz(this.A));
for (b = 0; b < this.b.length; ++b) a.add(iz(this.b[b].Tk));
this.B = !0;
hk(a, "end", this.Gp, !1, this);
a.play();
this.D = v();
this.g.style.width = 445 * this.b.length + "px";
Ge(this.g, !0);
Fe(this.g, 1);
this.zd();
a = this.Jb ? this.Jb.jv : Math.max(0, pz(this));
mz(this, a, !1);
b = {};
b.notif =
this.Jb ? "1" : "0";
dy(this.context.logger, this.b[a].be.ha, null, 50, b);
this.L = this.context.b.listen(this.K(), "keydown", this.Ww, this)
}
};
f.Gp = function () {
this.B = !1
};
f.Ww = function (a) {
switch (a.keyCode) {
case 27:
this.Oi();
break;
case 37:
0 < this.j && mz(this, this.j - 1, !0);
break;
case 39:
this.j + 1 < this.b.length && mz(this, this.j + 1, !0);
break;
case 9:
mz(this, this.j + 1 < this.b.length ? this.j + 1 : 0, !0)
}
a.stopPropagation();
a.preventDefault();
return !1
};
f.Oi = function (a) {
a && a.stopPropagation();
if (!this.B) {
var b = new Nv;
y(this.b, function (a) {
b.add(hz(a.Dg));
b.add(gz(a.Dg, 0))
});
b.add(hz(this.A));
b.add(iz(this.k));
b.add(hz(this.g, function () {
ze(this.K(), "", "")
}, this));
this.B = !0;
hk(b, "end", this.Gp, !1, this);
b.play();
a = {};
a.interval = v() - this.D;
ey(this.context.logger, this.b[this.j].be.ha, null, a);
this.L && this.context.b.Ja(this.L)
}
};
f.Lu = function () {
"none" != this.g.style.display && this.context.g.pauseVideo()
};
function mz(a, b, c) {
var d = a.b[b];
a.T.focus();
if (a.j != b) {
if (0 <= a.j) {
var e = a.b[a.j];
P(e.Dg, "yt-uix-button-toggled");
P(e.Tk, "iv-card-active")
}
a.j = b;
O(d.Dg, "yt-uix-button-toggled");
O(d.Tk, "iv-card-active");
gz(a.g, qz(a).x).play();
b = {};
b.nav = c ? "1" : "0";
by(a.context.logger, d.be.ha, null, b)
}
}
function qz(a) {
var b = ly(a),
c = b.right - b.left,
b = b.bottom - b.top,
d = Ce(a.g);
return new E(445 * -(isNaN(void 0) ? a.j || 0 : NaN) + (c - 445) / 2, (b - d.height + (1 < a.b.length ? 63 : 0)) / 2)
}
f.zd = function () {
var a = ly(this);
a && (ex(this.K(), a ? 445 < a.right - a.left && 243 < a.bottom - a.top : !1), fx(this.g) && (ze(this.K(), this.context.j.Zc), oe(this.g, qz(this))), oe(this.K(), a.left, a.top))
};
f.Mu = function (a) {
1 == a && this.H && (this.H = !1, lz(this))
};
function pz(a) {
var b = 1E3 * a.context.g.getCurrentTime();
return lb(a.b, function (a) {
return a.be.Ed <= b && b < a.be.b
})
};
function rz(a, b, c) {
hy.call(this, a, b);
this.ha = c;
this.g = !1
}
w(rz, hy);
rz.prototype.uj = function () {
rz.G.uj.call(this);
var a = this.ha.data;
"start_ms" in a && "end_ms" in a && iy(this, this.ha.data.start_ms, this.ha.data.end_ms, this.ha.id, this.show, this.hide)
};
function sz(a, b, c) {
rz.call(this, a, b, c);
this.j = null;
this.k = !1;
this.oj = null;
this.Hd = !1;
this.b = 0
}
w(sz, rz);
function tz(a) {
var b = a.ha.data;
a.b = b.image_width;
a.j = I("img", {
src: b.image_url,
"class": "branding-img iv-click-target iv-view-target hid",
width: b.image_width,
height: b.image_height
});
var c = I("div", "branding-img-container", a.j);
a.K().appendChild(c);
var d = I("div", "iv-branding-context-name");
pd(d, b.channel_name);
var e = I("div", "iv-branding-context-subscribe");
a.ha.j ? e.innerHTML = a.ha.j : b.num_subscribers && pd(e, b.num_subscribers);
c = I("div", "iv-branding-context-subscribe-caret");
d = I("div", ["branding-context-container-inner",
"iv-view-target"
], c, d, e);
e = I("div", "branding-context-container-outer", d);
je(e, "right", a.b + "px");
a.K().appendChild(e);
jy(a, a.K(), Kx(a.ha), a.ha.id, a.ha);
a.oj = new Bv(ra(function (a) {
var b = Ce(a.parentElement);
(new Uv(a.parentElement, [b.width, b.height], [0, 0], 200, Zv)).play();
this.Hd = !1
}, d), 500, a);
Av(a.context.b, a.K(), "mouseover", ra(function (a, b, c) {
this.oj.stop();
if (!this.Hd) {
var d = Ce(a);
Ae(a, d.width);
c = Math.min(d.height, c);
c = Math.max(c / 2 - 10, 0);
oe(b, d.width, c);
this.Hd = !0;
b = 9;
d = Ce(a);
c = Ce(a.parentElement);
(new Uv(a.parentElement, [c.width, c.height], [d.width + b, d.height], 200, Zv)).play()
}
}, d, c, b.image_height), "iv-view-target", a);
Av(a.context.b, a.K(), "mouseout", t(a.oj.start, a.oj), "iv-view-target", a)
}
sz.prototype.show = function () {
if (!this.g) {
sz.G.show.call(this);
this.k || (tz(this), this.k = !0);
this.zd();
by(this.context.logger, this.ha);
gx(this.K());
this.g = !0;
var a = this.j,
b, c = Ee(a).width,
d = ja(void 0) ? void 0 : c;
b = b || 0;
oe(a, d);
b = new Sv(a, [d, a.offsetTop], [d - c - b, a.offsetTop], 200, Zv);
ak(b, "begin", ra(gx, a));
b.play()
}
};
sz.prototype.hide = function () {
this.g && (hx(this.K()), this.g = !1)
};
sz.prototype.zd = function () {
var a = ly(this);
if (a) {
var b = a.right - this.b - 20,
a = a.top + 20;
oe(this.K(), b, a)
}
};
function uz(a, b, c, d, e, g) {
this.b = a;
this.j = b;
this.k = c;
this.logger = d;
this.g = e;
this.eb = g
};
function vz(a, b, c) {
rz.call(this, a, b, c);
this.gj = this.j = this.o = !1;
this.k = 5E3;
this.b = null;
this.Pf = I("div", "iv-promo-contents")
}
w(vz, rz);
function wz(a) {
var b = a.ha.data;
a.k = b.collapse_delay_ms || a.k;
var c = ["iv-promo", "iv-promo-inactive"];
a.context.j.b.ca && c.push("iv-promo-exp");
var d;
if (b.image_url) {
d = I("div", "iv-promo-img");
var e = I("img", {
src: b.image_url,
"class": "iv-click-target"
});
d.appendChild(e);
b.video_duration ? (e = I("span", ["iv-promo-video-duration", "iv-click-target"], b.video_duration), d.appendChild(e)) : b.playlist_length && (e = I("span", ["iv-promo-playlist-length", "iv-click-target"], b.playlist_length.toString()), d.appendChild(e))
}
var e =
I("div", "iv-promo-txt"),
g, h, k;
switch (a.ha.style) {
case "cta":
case "website":
g = I("p", "iv-click-target", I("strong", null, b.text_line_1));
h = I("p", ["iv-promo-link", "iv-click-target"], b.text_line_2);
O(e, "iv-click-target");
break;
case "playlist":
case "video":
g = I("p", "iv-click-target", b.text_line_1);
h = I("p", "iv-click-target", I("strong", null, b.text_line_2));
O(e, "iv-click-target");
c.push("iv-promo-video");
break;
case "vote":
g = I("p", null, I("strong", null, b.text_line_1)), h = I("p", null, b.text_line_2), k = I("div", "iv-promo-button"),
b = I("button", ["yt-uix-button", "yt-uix-button-primary"], I("span", "yt-uix-button-content", b.button_text)), a.context.b.listen(b, "click", function (a) {
a.stopPropagation();
dy(this.context.logger, this.ha, null, null, {
contest_vote: "1"
});
var b = this.ha.data;
a = H("iv-promo-txt", this.Pf);
var c = H("iv-promo-button", this.Pf),
d = I("div", ["iv-promo-txt", "iv-click-target"]),
e = I("p", "iv-click-target", I("strong", null, b.text_line_3)),
b = I("p", "iv-click-target", b.text_line_4);
ed(d, e, b);
hd(c);
id(d, a);
jy(this, this.Pf, Kx(this.ha),
this.ha.id, this.ha)
}, a), k.appendChild(b), c.push("iv-promo-with-button")
}
g && e.appendChild(g);
h && e.appendChild(h);
a.Pf.appendChild(e);
k && a.Pf.appendChild(k);
g = I("div", "iv-promo-actions");
h = I("div", "iv-promo-expand");
g.appendChild(h);
a.context.b.listen(a.K(), "mouseover", a.kr, a);
a.context.b.listen(h, "touchend", function (a) {
a.stopPropagation();
this.kr();
this.gj = !1
}, a);
a.context.b.listen(a.K(), "mouseout", a.eA, a);
h = I("div", "iv-promo-close");
g.appendChild(h);
xz(a, t(function () {
this.hide()
}, a), h);
$f(a.K(), c);
d && dd(a.K(), d);
dd(a.K(), a.Pf);
dd(a.K(), g);
jy(a, a.K(), Kx(a.ha), a.ha.id, a.ha)
}
f = vz.prototype;
f.show = function () {
this.g || (vz.G.show.call(this), this.o || (wz(this), this.o = !0), this.zd(), gx(this.K()), by(this.context.logger, this.ha || null), "cta" == this.ha.style && fy(this.context.logger, this.ha.id, "cta_annotation_shown"), P(this.K(), "iv-promo-inactive"), this.g = !0, this.b && (uk(this.b), this.b = null), yz(this), zz(this, this.k))
};
f.hide = function () {
this.g && (O(this.K(), "iv-promo-inactive"), this.g = !1)
};
f.kr = function () {
this.gj = !0;
yz(this);
zz(this, 500)
};
f.eA = function () {
this.gj = !1;
Az(this)
};
function Az(a) {
a.j || a.gj || a.b || (O(a.K(), "iv-promo-collapsed"), a.j = !0)
}
function yz(a) {
a.j && (P(a.K(), "iv-promo-collapsed"), a.j = !1)
}
function zz(a, b) {
a.b || (a.b = tk(function () {
this.b && (uk(this.b), this.b = null);
Az(this)
}, b, a))
}
f.zd = function () {
var a = ly(this);
if (a) {
var b = Be(this.K()),
b = b.width < a.right - a.left && b.height < a.bottom - a.top ? a.bottom - b.height - -8 - 25 : a.bottom;
oe(this.K(), a.left, b)
}
};
function xz(a, b, c) {
function d(a) {
ey(this.context.logger, this.ha);
"cta" == this.ha.style && fy(this.context.logger, this.ha.id, "cta_annotation_closed");
b(a);
a.stopPropagation()
}
a.context.b.listen(c, "click", t(d, a));
a.context.b.listen(c, "touchend", t(d, a))
};
function Bz(a, b, c) {
this.b = {};
this.g = !1;
this.o = "ivTrigger:" + a;
this.j = c;
Ex(b, function (a, b) {
var c = Cz(b.state, b.b);
this.j.subscribe(c, t(this.k, this, c, a));
this.b[c] = a
}, this)
}
Bz.prototype.k = function (a, b, c, d) {
this.b[a] = b ? !c : c;
a = Nb(this.b, function (a) {
return a
});
this.g != a && (this.g = a, this.j.I(this.o, a, d))
};
function Cz(a, b) {
var c = "ivTriggerCondition:" + a;
return b ? c + ":" + b : c
};
function Dz(a, b, c) {
this.j = a;
this.ha = b;
this.b = c;
this.g = null;
this.o = this.isVisible = !1;
Ez(b, a)
}
function Ez(a, b) {
Rx(a, function (c) {
return new Bz(a.id, c, b)
})
}
Dz.prototype.hide = function () {
this.isVisible = !1;
this.j.ia("onResize", this.k, this);
this.b && this.b.hide()
};
Dz.prototype.show = function () {
this.isVisible = !0;
this.b && this.b.show();
this.j.subscribe("onResize", this.k, this)
};
Dz.prototype.destroy = function () {
this.j.ia("onResize", this.k, this);
if (this.b) {
var a = this.b;
a.C.removeAll();
a.g && hd(a.g);
a.j && a.j.K() && hd(a.j.K())
}
Fz(this)
};
function Fz(a) {
a.g && (a.g.stop(), a.g = null)
}
Dz.prototype.k = function () {
this.b && Gz(this.b)
};
function Hz() {};
function Iz(a, b, c, d, e, g, h, k) {
this.o = a;
this.B = b;
this.A = c;
this.C = d;
this.b = e;
this.g = g;
this.j = n(h) ? h : null;
this.k = n(k) ? k : null
}
w(Iz, Hz);
function Jz() {
this.aa = [];
this.da = [];
this.Sd = []
}
Jz.prototype.Zf = null;
Jz.prototype.qd = null;
Jz.prototype.Oj = !0;
var Kz = [2, 2, 6, 6, 0];
f = Jz.prototype;
f.clear = function () {
this.aa.length = 0;
this.da.length = 0;
this.Sd.length = 0;
delete this.Zf;
delete this.qd;
delete this.Oj;
return this
};
function Lz(a, b, c) {
0 == bb(a.aa) ? a.Sd.length -= 2 : (a.aa.push(0), a.da.push(1));
a.Sd.push(b, c);
a.qd = a.Zf = [b, c]
}
f.ab = function (a) {
var b = bb(this.aa);
if (null == b) throw Error("Path cannot start with lineTo");
1 != b && (this.aa.push(1), this.da.push(0));
for (b = 0; b < arguments.length; b += 2) {
var c = arguments[b],
d = arguments[b + 1];
this.Sd.push(c, d)
}
this.da[this.da.length - 1] += b / 2;
this.qd = [c, d]
};
f.close = function () {
var a = bb(this.aa);
if (null == a) throw Error("Path cannot start with close");
4 != a && (this.aa.push(4), this.da.push(1), this.qd = this.Zf);
return this
};
function Mz(a, b, c, d, e) {
var g = a.qd[0] - b * Math.cos(d * Math.PI / 180),
h = a.qd[1] - c * Math.sin(d * Math.PI / 180),
g = g + b * Math.cos((d + e) * Math.PI / 180),
h = h + c * Math.sin((d + e) * Math.PI / 180);
a.aa.push(3);
a.da.push(1);
a.Sd.push(b, c, d, e, g, h);
a.Oj = !1;
a.qd = [g, h]
}
function Nz(a, b) {
for (var c = a.Sd, d = 0, e = 0, g = a.aa.length; e < g; e++) {
var h = a.aa[e],
k = Kz[h] * a.da[e];
b(h, c.slice(d, d + k));
d += k
}
}
f.clone = function () {
var a = new this.constructor;
a.aa = this.aa.concat();
a.da = this.da.concat();
a.Sd = this.Sd.concat();
a.Zf = this.Zf && this.Zf.concat();
a.qd = this.qd && this.qd.concat();
a.Oj = this.Oj;
return a
};
f.isEmpty = function () {
return 0 == this.aa.length
};
function Oz(a, b) {
this.D = a;
this.F = null == b ? 1 : b
}
w(Oz, Hz);
function Pz(a, b) {
this.b = a;
this.g = b
};
function Qz() {}
ea(Qz);
Qz.prototype.b = 0;
function Rz(a) {
U.call(this);
this.B = a || Mc()
}
w(Rz, U);
f = Rz.prototype;
f.JB = Qz.getInstance();
f.ta = null;
f.ef = !1;
f.Md = null;
f.Ij = null;
f.Kj = null;
f.Jj = null;
f.getId = function () {
return this.ta || (this.ta = ":" + (this.JB.b++).toString(36))
};
f.K = function () {
return this.Md
};
f.ci = function (a) {
if (this.Ij && this.Ij != a) throw Error("Method not supported");
Rz.G.ci.call(this, a)
};
f.ts = function () {
this.Md = this.B.createElement("div")
};
f.Ih = function () {
Sz(this, function (a) {
a.ef && a.Ih()
});
this.o && this.o.removeAll();
this.ef = !1
};
f.J = function () {
this.ef && this.Ih();
this.o && (this.o.dispose(), delete this.o);
Sz(this, function (a) {
a.dispose()
});
this.Md && hd(this.Md);
this.Ij = this.Md = this.Jj = this.Kj = null;
Rz.G.J.call(this)
};
f.pd = function () {
return this.Md
};
function Sz(a, b) {
a.Kj && y(a.Kj, b, void 0)
}
f.removeChild = function (a, b) {
if (a) {
var c = r(a) ? a : a.getId();
a = this.Jj && c ? Yb(this.Jj, c) || null : null;
if (c && a) {
var d = this.Jj;
c in d && delete d[c];
ob(this.Kj, a);
b && (a.Ih(), a.Md && hd(a.Md));
c = a;
if (null == c) throw Error("Unable to set parent component");
c.Ij = null;
Rz.G.ci.call(c, null)
}
}
if (!a) throw Error("Child is not in parent component");
return a
};
function Tz(a, b, c, d, e) {
Rz.call(this, e);
this.width = a;
this.height = b;
this.j = c || null;
this.A = d || null
}
w(Tz, Rz);
Tz.prototype.g = null;
Tz.prototype.Ah = function () {
return this.ef ? Be(this.K()) : ja(this.width) && ja(this.height) ? new G(this.width, this.height) : null
};
function Uz(a) {
var b = a.Ah();
return b ? b.width / (a.j ? new G(a.j, a.A) : a.Ah()).width : 0
}
Tz.prototype.resume = function () {};
function Vz(a, b) {
U.call(this);
this.Ch = a;
this.Gk = b;
this[Oj] = !1
}
w(Vz, U);
f = Vz.prototype;
f.Gk = null;
f.Ch = null;
f.K = function () {
return this.Ch
};
f.addEventListener = function (a, b, c, d) {
ak(this.Ch, a, b, c, d)
};
f.removeEventListener = function (a, b, c, d) {
ik(this.Ch, a, b, c, d)
};
f.J = function () {
Vz.G.J.call(this);
var a = this.Ch;
if (a)
if (Pj(a)) a.removeAllListeners(void 0);
else if (a = dk(a)) {
var b = 0,
c;
for (c in a.b)
for (var d = a.b[c].concat(), e = 0; e < d.length; ++e) jk(d[e]) && ++b
}
};
function Wz(a, b, c, d) {
Vz.call(this, a, b);
a = this.Gk;
b = this.K();
c ? (b.setAttribute("stroke", c.g), c = c.b, r(c) && -1 != c.indexOf("px") ? b.setAttribute("stroke-width", parseFloat(c) / Uz(a)) : b.setAttribute("stroke-width", c)) : b.setAttribute("stroke", "none");
c = this.Gk;
a = this.K();
if (d instanceof Oz) a.setAttribute("fill", d.D), a.setAttribute("fill-opacity", d.F);
else if (d instanceof Iz) {
b = "lg-" + d.o + "-" + d.B + "-" + d.A + "-" + d.C + "-" + d.b + "-" + d.g;
var e = Xz(c, b);
if (!e) {
var e = Yz(c, "linearGradient", {
x1: d.o,
y1: d.B,
x2: d.A,
y2: d.C,
gradientUnits: "userSpaceOnUse"
}),
g = "stop-color:" + d.b;
ja(d.j) && (g += ";stop-opacity:" + d.j);
g = Yz(c, "stop", {
offset: "0%",
style: g
});
e.appendChild(g);
g = "stop-color:" + d.g;
ja(d.k) && (g += ";stop-opacity:" + d.k);
d = Yz(c, "stop", {
offset: "100%",
style: g
});
e.appendChild(d);
e = Zz(c, b, e)
}
a.setAttribute("fill", "url(#" + e + ")")
} else a.setAttribute("fill", "none")
}
w(Wz, Vz);
function $z(a, b) {
Vz.call(this, a, b)
}
w($z, Vz);
function aA(a, b) {
Vz.call(this, a, b)
}
w(aA, Vz);
function bA(a, b, c, d) {
Wz.call(this, a, b, c, d)
}
w(bA, Wz);
function cA(a, b) {
Vz.call(this, a, b)
}
w(cA, $z);
cA.prototype.clear = function () {
fd(this.K())
};
function dA(a, b, c, d) {
Wz.call(this, a, b, c, d)
}
w(dA, bA);
function eA(a, b) {
Vz.call(this, a, b)
}
w(eA, aA);
function fA(a, b, c, d, e) {
Tz.call(this, a, b, c, d, e);
this.b = {};
this.C = qc && !zc(526);
this.D = new yk(this)
}
var gA;
w(fA, Tz);
var hA = 0;
function Yz(a, b, c) {
a = a.B.b.createElementNS("http://www.w3.org/2000/svg", b);
if (c)
for (var d in c) a.setAttribute(d, c[d]);
return a
}
f = fA.prototype;
f.ts = function () {
var a = Yz(this, "svg", {
width: this.width,
height: this.height,
overflow: "hidden"
}),
b = Yz(this, "g");
this.k = Yz(this, "defs");
this.g = new cA(b, this);
a.appendChild(this.k);
a.appendChild(b);
this.Md = a;
this.j && (this.K().setAttribute("preserveAspectRatio", "none"), this.C ? this.mr() : this.K().setAttribute("viewBox", "0 0 " + (this.j ? this.j + " " + this.A : "")))
};
f.mr = function () {
if (this.ef) {
var a = this.Ah();
if (0 == a.width) this.K().style.visibility = "hidden";
else {
this.K().style.visibility = "";
var b = a.width / this.j,
a = a.height / this.A;
this.g.K().setAttribute("transform", "scale(" + b + " " + a + ") translate(0 0)")
}
}
};
f.Ah = function () {
if (!pc) return this.ef ? Be(this.K()) : fA.G.Ah.call(this);
var a = this.width,
b = this.height,
c = r(a) && -1 != a.indexOf("%"),
d = r(b) && -1 != b.indexOf("%");
if (!this.ef && (c || d)) return null;
var e, g;
c && (e = this.K().parentNode, g = Ce(e), a = parseFloat(a) * g.width / 100);
d && (e = e || this.K().parentNode, g = g || Ce(e), b = parseFloat(b) * g.height / 100);
return new G(a, b)
};
f.clear = function () {
this.g.clear();
fd(this.k);
this.b = {}
};
function iA(a, b, c, d) {
b = Yz(a, "path", {
d: jA(b)
});
c = new dA(b, a, c, d);
a.g.K().appendChild(c.K())
}
function jA(a) {
var b = [];
Nz(a, function (a, d) {
switch (a) {
case 0:
b.push("M");
Array.prototype.push.apply(b, d);
break;
case 1:
b.push("L");
Array.prototype.push.apply(b, d);
break;
case 2:
b.push("C");
Array.prototype.push.apply(b, d);
break;
case 3:
var e = d[3];
b.push("A", d[0], d[1], 0, 180 < Math.abs(e) ? 1 : 0, 0 < e ? 1 : 0, d[4], d[5]);
break;
case 4:
b.push("Z")
}
});
return b.join(" ")
}
function Zz(a, b, c) {
if (b in a.b) return a.b[b];
var d = "_svgdef_" + hA++;
c.setAttribute("id", d);
a.b[b] = d;
a.k.appendChild(c);
return d
}
function Xz(a, b) {
return b in a.b ? a.b[b] : null
}
f.Ih = function () {
fA.G.Ih.call(this);
this.C && this.D.Ja(kA(), "tick", this.mr)
};
f.J = function () {
delete this.b;
delete this.k;
delete this.g;
fA.G.J.call(this)
};
function kA() {
gA || (gA = new rk(400), gA.start());
return gA
};
function lA(a, b, c) {
this.b = a;
this.g = 0;
this.B = b;
this.C = c || 70;
this.j = !1
}
lA.prototype.start = function (a) {
this.A = v();
this.g = a;
this.o = this.A + this.g;
this.j = !0;
gx(this.b);
Id(this.k);
this.k = Hd(t(this.D, this), this.C)
};
lA.prototype.stop = function () {
this.j = !1;
hx(this.b);
this.k && Id(this.k)
};
lA.prototype.D = function () {
if (this.j) {
var a = v(),
b;
b = 0 == this.g || a >= this.o ? 0 : 1 - (a - this.A) / this.g;
var c = H("countdowntimer-diminishing-pieslice", this.b),
d = kg("svg", this.b);
!d && this.b.querySelectorAll && (d = this.b.querySelectorAll("svg"), d = d.length ? d[0] : null);
var d = parseInt(d.getAttribute("width"), 10),
e = new Jz,
g = d / 2 - 5;
Lz(e, d / 2, d / 2);
e.ab(d / 2, 5);
Mz(e, g, g, -90, 360 * -b);
e.ab(d / 2, d / 2);
e.close();
c.setAttribute("d", jA(e));
a >= this.o && (this.stop(), this.B && this.B())
}
};
function mA() {
this.element = this.b = null;
this.priority = 0;
this.o = this.C = !1;
this.A = null
}
w(mA, jh);
mA.prototype.listen = function (a, b, c) {
return this.element.listen(a, b, c || this)
};
mA.prototype.Ja = function (a) {
this.element.Ja(a)
};
function nA(a, b, c, d) {
X.call(this, ["div", {
className: "ytp-button",
role: "button",
"aria-label": "{{label}}",
"aria-disabled": "{{disabled}}",
tabindex: "{{tabindex}}"
}, "{{content}}"]);
this.$ = "inline-block";
this.D = a;
this.H = this.g = this.o = null;
this.k = !1;
this.listen("click", this.xB);
this.listen("keypress", this.yB);
this.D.Sg(this.element, t(this.wB, this));
b && oA(this, b);
c && pA(this, c);
d && (this.g = d)
}
w(nA, X);
function oA(a, b) {
b && "" != b && (a.o && P(a.element, a.o), a.o = b, O(a.element, b))
}
function pA(a, b) {
iv(a.template, "label", b)
}
function qA(a, b) {
a.H = b;
iv(a.template, "tabindex", b)
}
f = nA.prototype;
f.wB = function () {
return this.k ? null : this.g ? this.g : null
};
f.enable = function () {
this.k = !1;
this.template.update({
disabled: null,
tabindex: this.H
});
P(this.element, "ytp-disabled")
};
f.disable = function () {
this.k = !0;
this.template.update({
disabled: "true",
tabindex: null
});
O(this.element, "ytp-disabled")
};
f.xB = function (a) {
this.k && (a.stopImmediatePropagation(), a.preventDefault())
};
f.yB = function (a) {
if (13 == a.keyCode || 32 == a.keyCode) a.stopPropagation(), a.preventDefault(), this.Fb("click")
};
f.J = function () {
this.D.pn(this.element);
this.D = null;
nA.G.J.call(this)
};
function rA(a, b, c) {
X.call(this, ["div", "ytp-segmented-control"]);
this.k = a;
this.g = -1;
this.b = [];
this.j = new zv(this);
n(b) && sA(this, b, c)
}
w(rA, X);
function sA(a, b, c) {
nh(a.b);
a.b = [];
a.j.removeAll();
for (var d = 0; d < b.length; d++) {
var e = new nA(a.k);
a.b[d] = e;
c ? e.na(["div", b[d]]) : e.na(b[d]);
0 != d && O(e.K(), "ytp-segmented-control-other");
tA(e, d == a.g);
a.j.listen(e, "click", a.o);
e.X(a.element)
}
}
rA.prototype.X = function (a, b) {
rA.G.X.call(this, a, b);
for (var c = 0, d = 0; d < this.b.length; d++) c = Math.max(c, Be(this.b[d].K()).width);
if (c)
for (d = 0; d < this.b.length; d++) Ae(this.b[d].K(), c)
};
function uA(a, b) {
a.g = b;
for (var c = 0; c < a.b.length; c++) tA(a.b[c], c == b)
}
rA.prototype.getSelected = function () {
return this.g
};
function vA(a, b) {
for (var c = 0; c < a.b.length; c++) qA(a.b[c], b)
}
function tA(a, b) {
if (b) {
var c = a.K();
P(c, "ytp-segmented-control-deselected");
O(c, "ytp-segmented-control-selected")
} else c = a.K(), P(c, "ytp-segmented-control-selected"), O(c, "ytp-segmented-control-deselected")
}
rA.prototype.o = function (a) {
for (var b = 0; b < this.b.length; b++)
if (this.b[b] == a.currentTarget) {
b != this.g && (uA(this, b), Cg(this.element, "change"));
break
}
};
rA.prototype.J = function () {
sA(this, []);
this.k = null;
rA.G.J.call(this)
};
function wA(a) {
mA.call(this);
this.b = Y(0, "YTP_ANNOTATIONS");
this.element = new rA(a, [Y(0, "YTP_ON"), Y(0, "YTP_OFF")]);
S(this, this.element);
vA(this.element, 2400);
this.priority = 2;
uA(this.element, 1)
}
w(wA, mA);
wA.prototype.getSelected = function () {
return this.element.getSelected()
};
function xA(a, b) {
this.start = a < b ? a : b;
this.end = a < b ? b : a
}
xA.prototype.clone = function () {
return new xA(this.start, this.end)
};
function yA() {
this.b = !1;
this.o = this.j = null
}
function zA(a, b, c) {
a.j ? (ze(a.j.K(), b, c), a.j.clear()) : (b = new fA(b, c, void 0, void 0, void 0), a.j = b, a.j.ts(), a.o = I("div"), b = a.j.K(), a.o.appendChild(b));
return a.j
}
yA.prototype.K = function () {
return this.o
};
yA.prototype.g = function () {};
function AA(a, b, c) {
var d = document.createElementNS("http://www.w3.org/2000/svg", a);
b && Lb(b, function (a, b) {
d.setAttribute(b, a)
});
for (var e = 2; e < arguments.length; e++) d.appendChild(arguments[e]);
return d
}
function BA(a, b) {
var c;
c = ":" + (Qz.getInstance().b++).toString(36);
b.setAttribute("result", c);
a.appendChild(b);
return c
};
function CA(a, b) {
var c = BA(a, AA("feGaussianBlur", {
"in": b,
stdDeviation: "1.8"
})),
c = BA(a, AA("feDiffuseLighting", {
"in": c,
surfaceScale: "4",
diffuseConstant: "1"
}, AA("feDistantLight", {
azimuth: "270",
elevation: "15",
"lighting-color": "white"
}))),
c = BA(a, AA("feComposite", {
"in": c,
in2: b,
operator: "in"
}));
return BA(a, AA("feComposite", {
in2: c,
"in": b,
operator: "arithmetic",
k2: 1,
k3: .5,
k4: 0
}))
}
function DA(a, b) {
var c = BA(a, AA("feOffset", {
"in": b,
dx: "-7",
dy: "-7"
})),
c = BA(a, AA("feGaussianBlur", {
"in": c,
stdDeviation: "3"
})),
c = BA(a, AA("feColorMatrix", {
"in": c,
type: "matrix",
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"
})),
d = BA(a, AA("feColorMatrix", {
"in": b,
type: "matrix",
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0"
})),
d = BA(a, AA("feGaussianBlur", {
"in": d,
stdDeviation: "1"
})),
c = BA(a, AA("feComposite", {
operator: "out",
"in": c,
in2: d
}));
return BA(a, AA("feComposite", {
operator: "over",
"in": b,
in2: c
}))
}
function EA(a, b) {
return b
}
function FA(a) {
var b = AA("filter", {
filterUnits: "userSpaceOnUse"
}),
c = "SourceGraphic";
y(a, function (a) {
t: {
switch (a) {
case "bevel":
a = CA;
break t;
case "dropshadow":
a = DA;
break t
}
a = EA
}
c = a(b, c)
});
return b
}
function GA(a) {
a = fb(a, function (a) {
return a in HA
});
zb(a, function (a, c) {
return HA[a] - HA[c]
});
return a
}
function IA(a) {
return B(a, function (a) {
return "dropshadow" == a
}) ? new be(0, 7, 7, 0) : new be(0, 0, 0, 0)
}
var HA = {
bevel: 1,
dropshadow: 2
};
function JA(a, b, c, d, e) {
b = KA(b, c, d ? d.b / 2 + 1 : 0);
iA(a, b, d, e)
}
function KA(a, b, c) {
var d = new Jz;
Lz(d, a.left + b + c, a.top + c);
d.ab(a.left + a.width - b - c, a.top + c);
Mz(d, b, b, -90, 90);
d.ab(a.left + a.width - c, a.top + a.height - b - c);
Mz(d, b, b, 0, 90);
d.ab(a.left + b + c, a.top + a.height - c);
Mz(d, b, b, 90, 90);
d.ab(a.left + c, a.top + b + c);
Mz(d, b, b, 180, 90);
d.close();
return d
}
function LA(a, b, c, d) {
var e = a.L;
e ? a = new Iz(e.o * b / 100, e.B * c / 100, e.A * b / 100, e.C * c / 100, e.b, e.g, e.j, e.k) : (b = MA(d, a.j), a = new Oz(a.o, b));
return a
}
function MA(a, b) {
return a ? Math.max(b, .9) : b
}
function NA(a, b) {
var c = new be(a.top, a.left + a.width, a.top + a.height, a.left),
d = IA(b);
la(d) ? (c.top -= d.top, c.right += d.right, c.bottom += d.bottom, c.left -= d.left) : (c.top -= d, c.right += void 0, c.bottom += void 0, c.left -= NaN);
return de(c)
}
function OA(a, b, c) {
if (c.length && (b = Rc("g", void 0, b), b.length)) {
var d = GA(c);
if (d) {
c = "effects:" + (d ? d.join("|") : "");
var e = Xz(a, c);
e ? a = e : (d = FA(d), a = 0 < d.childNodes.length ? Zz(a, c, d) : null)
} else a = null;
a && b[0].setAttribute("filter", "url(#" + a + ")")
}
};
function PA() {
yA.call(this);
this.k = 0
}
w(PA, yA);
PA.prototype.g = function (a, b, c) {
var d = a.b,
e = d.C,
g = this.b && Ox(a),
e = (e += g ? 1 : 0) ? new Pz(e, g ? d.A : d.B) : null;
if (g = Sx(a)) {
var h = qx(g, b, c);
if (!(0 >= h.width || 0 >= h.height)) {
var k;
if (k = (a = (a = Tx(a)) && a.b ? a.b : null) && a.length ? a[0] : null) {
var l;
c = c ? qx(c, b) : null;
a = lx(k, new ce(k.F, k.H, k.A, k.k), b);
c ? (a.top += c.top, a.left += c.left) : (a.top += b.top, a.left += b.left);
l = new E(a.left, a.top);
c = h.clone();
a = new ce(l.x, l.y, 1, 1);
var g = Math.max(c.left + c.width, a.left + a.width),
q = Math.max(c.top + c.height, a.top + a.height);
c.left = Math.min(c.left,
a.left);
c.top = Math.min(c.top, a.top);
c.width = g - c.left;
c.height = q - c.top;
c = NA(c, d.b);
a = zA(this, c.width, c.height);
var g = LA(d, c.width, c.height, this.b),
h = new ce(h.left - c.left, h.top - c.top, h.width, h.height),
s = new E(l.x - c.left, l.y - c.top);
this.k = 17 * nx(b, k.j, k.b ? k.b : "xy");
b = d.g;
k = e ? e.b / 2 : 0;
l = QA(h, s);
var q = this.A(h, b, s, l),
u = s.x,
s = s.y,
z = h.width,
F = h.height,
L = h.left,
h = h.top,
ba = new Jz;
Lz(ba, L + b + k, h + k);
"t" == l && (ba.ab(q.start, h + k), ba.ab(u, s), ba.ab(q.end, h + k));
ba.ab(L + z - b - k, h + k);
Mz(ba, b, b, -90, 90);
"r" == l && (ba.ab(L + z -
k, q.start), ba.ab(u, s), ba.ab(L + z - k, q.end));
ba.ab(L + z - k, h + F - b - k);
Mz(ba, b, b, 0, 90);
"b" == l && (ba.ab(q.end, h + F - k), ba.ab(u, s), ba.ab(q.start, h + F - k));
ba.ab(L + b + k, h + F - k);
Mz(ba, b, b, 90, 90);
"l" == l && (ba.ab(L + k, q.end), ba.ab(u, s), ba.ab(L + k, q.start));
ba.ab(L + k, h + b + k);
Mz(ba, b, b, 180, 90);
ba.close();
iA(a, ba, e, g);
if (e = this.K()) O(e, "annotation-shape"), O(e, "annotation-speech-shape"), oe(e, c.left, c.top), ze(e, c.width, c.height), OA(a, e, d.b)
}
}
}
};
function QA(a, b) {
var c = a.top - b.y,
d = b.x - a.left - a.width,
e = b.y - a.top - a.height,
g = a.left - b.x,
h = Math.max(c, d, e, g);
if (0 > h) return "i";
switch (h) {
case c:
return "t";
case d:
return "r";
case e:
return "b";
case g:
return "l"
}
return "i"
}
PA.prototype.A = function (a, b, c, d) {
function e(a, c, d) {
h = Math.min(Math.max(d - 2 * b, 0), g);
k = Fb(a - h / 2, c + b, c + d - h - b)
}
var g = this.k,
h = 0,
k = 0;
"t" == d || "b" == d ? e(c.x, a.left, a.width) : "l" != d && "r" != d || e(c.y, a.top, a.height);
return new xA(k, k + h)
};
function RA() {
yA.call(this)
}
w(RA, yA);
RA.prototype.g = function (a, b, c) {
var d = Sx(a);
d && (b = qx(d, b, c), 0 >= b.width || 0 >= b.height || (a = a.b, c = NA(b, a.b), d = zA(this, c.width, c.height), JA(d, new ce(0, 0, b.width, b.height), a.g, new Pz(!a.k && this.b ? 1 : a.k, a.o), new Oz("#000", 0)), b = this.K(), O(b, "annotation-shape"), Fe(b, MA(this.b, a.j)), oe(b, c.left, c.top), ze(b, c.width, c.height)))
};
var SA = window.location.protocol + "//i.ytimg.com/",
TA = 4 / 3;
function UA(a, b, c) {
var d;
switch (b.Ud) {
case 30:
d = VA;
break;
default:
d = WA
}
return d(a, b, c)
}
function WA(a, b, c) {
if (!c) {
c = a.clientHeight;
a = a.clientWidth;
if ((900 < a || 600 < c) && b.Or) return b.Or;
if ((430 < a || 320 < c) && b.Pr) return b.Pr
}
return b.Aj ? b.Aj : b.videoId ? XA(b.videoId) : ""
}
function VA(a, b) {
return b.Aj ? b.Aj : b.videoId ? qf("//docs.google.com/vt", {
id: b.videoId,
authuser: b.Va,
authkey: b.dr
}) : "//docs.google.com/images/doclist/cleardot.gif"
}
function XA(a, b) {
return (SA + "vi/" + escape(a) + "/" + escape(b || "hqdefault.jpg")).replace("i.", "i" + (a.charCodeAt(0) % 1 + 1) + ".")
};
function YA(a, b, c) {
yA.call(this);
this.k = a || 0;
this.B = b || 0;
this.A = c || !1
}
w(YA, yA);
function ZA(a, b) {
var c = a.width,
d = a.height,
e = 0,
g = 0;
0 < b && (a.width / a.height > b ? (d = a.width / b, g = (a.height - d) / 2) : (c = a.height * b, e = (a.width - c) / 2));
return new ce(e, g, c, d)
}
YA.prototype.g = function (a, b, c) {
var d = qx(Sx(a), b, c);
if (!(0 >= d.width || 0 >= d.height)) {
var e = ZA(d, this.B);
e.left += d.left;
e.top += d.top;
b = a.b;
c = NA(e, b.b);
var g = zA(this, c.width, c.height),
h = new Oz("#000", 0),
e = ZA(e, this.k);
a = a.k ? a.k.b ? a.k.b : a.k.videoId ? XA(a.k.videoId, "hqdefault.jpg") : "" : "";
e = Yz(g, "image", {
x: e.left,
y: e.top,
width: e.width,
height: e.height,
"image-rendering": "optimizeQuality",
preserveAspectRatio: "none"
});
e.setAttributeNS("http://www.w3.org/1999/xlink", "href", a);
e = new eA(e, g);
g.g.K().appendChild(e.K());
if (a = this.K()) {
var k = MA(this.b, b.j);
Fe(a, k);
if (this.A && 0 < b.k) {
var k = new Pz(b.k, b.o),
d = new ce(0, 0, d.width, d.height),
l;
l = KA(d, b.g, k.b / 2 + 1);
var q = Xz(g, "mask");
if (q) l = q;
else {
var q = document.createElementNS("http://www.w3.org/2000/svg", "mask"),
s = document.createElementNS("http://www.w3.org/2000/svg", "path");
s.setAttribute("d", jA(l));
s.setAttribute("fill", "#FFF");
q.appendChild(s);
l = Zz(g, "mask", q)
}
e = e.K();
l && e.setAttribute("mask", "url(#" + l + ")");
JA(g, d, b.g, k, h)
}
O(a, "annotation-shape");
O(a, "annotation-image-shape");
oe(a, c.left, c.top);
ze(a, c.width, c.height);
OA(g, a, b.b)
}
}
};
function $A() {
yA.call(this)
}
w($A, yA);
$A.prototype.g = function (a, b, c) {
var d = Sx(a);
if (d) {
var e = qx(d, b, c);
if (!(0 >= e.width || 0 >= e.height)) {
b = a.b;
c = NA(e, b.b);
var d = zA(this, c.width, c.height),
g = b.C;
a = this.b && Ox(a);
a = (g += a ? 1 : 0) ? new Pz(g, a ? b.A : b.B) : null;
g = new ce(0, 0, e.width, e.height);
e = LA(b, e.width, e.height, this.b);
JA(d, g, b.g, a, e);
if (a = this.K()) O(a, "annotation-shape"), O(a, "annotation-popup-shape"), oe(a, c.left, c.top), ze(a, c.width, c.height), OA(d, a, b.b)
}
}
};
function aB() {
PA.call(this)
}
w(aB, PA);
aB.prototype.A = function (a, b, c, d) {
function e(a, c, d) {
h = Math.min(Math.max(d - 2 * b, 0), g);
k = a <= c + d / 2 ? Math.max(c + d / 4 - h / 2, c + b) : Math.min(c + 3 * d / 4 - h / 2, c + d - h - b)
}
var g = this.k,
h = 0,
k = 0;
"t" == d || "b" == d ? e(c.x, a.left, a.width) : "l" != d && "r" != d || e(c.y, a.top, a.height);
return new xA(k, k + h)
};
function bB(a, b, c, d, e) {
this.b = a;
this.F = b;
this.B = c;
this.N = d;
this.H = e;
this.C = new zv(this);
this.D = this.j = this.o = this.k = this.A = this.g = null
}
function cB(a, b) {
var c = t(function (a, c, g) {
c = g ? dB(this, c, t(g, this)) : dB(this, c);
this.C.listen(b, a, c)
}, a);
c("mouseover", "d", a.M);
c("mouseout", "c", a.L);
c("click", "a");
c("touchend", "a")
}
function eB(a) {
if (a.b.C) {
var b;
Nx(a.b, function (a) {
return "close" == a.type
}) ? b = a.g : (a.o = I("div", ["annotation-close-button", "hid"]), cg(a.o, "annotation_id", a.b.id), a.g.appendChild(a.o), b = a.o);
var c = function (a) {
a.stopPropagation()
};
a.C.listen(b, "click", dB(a, "b", c));
a.C.listen(b, "touchend", dB(a, "b", c))
}
}
function dB(a, b, c) {
return t(function (a) {
if (this.H) c && c(a);
else if (a.target instanceof Element) {
var e = a.target;
hx(e);
try {
var g = document.elementFromPoint(a.clientX, a.clientY);
if (xd(g, "annotation")) {
var h = document.createEvent("MouseEvent");
h.initMouseEvent(a.type, a.bubbles, a.cancelable, a.view, a.detail, a.screenX, a.screenY, a.clientX, a.clientY, a.ctrlKey, a.altKey, a.shiftKey, a.metaKey, a.button, a.relatedTarget);
g.dispatchEvent(h)
}
} finally {
gx(e)
}
}
e = Ee(a.target);
a = new E(a.clientX, a.clientY);
"c" == b && e.contains(a) ||
this.N.I(b, this.b)
}, a)
}
bB.prototype.M = function () {
this.o && gx(this.o);
this.k && Fe(this.k, 1);
var a = fB(this);
this.j && (this.j.b = !0, Fe(this.g, gB(this) ? 1 : 0), a && this.j.g(this.b, a, hB(this)))
};
bB.prototype.L = function () {
this.o && hx(this.o);
this.k && Fe(this.k, 0);
var a = fB(this);
this.j && (this.j.b = !1, Fe(this.g, gB(this) ? 1 : 0), a && this.j.g(this.b, a, hB(this)))
};
function hB(a) {
return a.D ? Sx(a.D) : null
}
function Gz(a) {
if (a.g || a.j) {
var b = Sx(a.b);
if (b) {
var c = fB(a),
d = hB(a);
if (a.g && c) {
b = qx(b, c, d);
ze(a.g, b.width, b.height);
oe(a.g, b.left, b.top);
var e = a.B.zf;
if (e) {
var g;
g = (g = Sx(a.b)) && e ? mx(e, g.o, g.b ? g.b : "xy") : 1;
var e = Ux(a.b, e),
h;
h = a.b.b;
h.F ? h = h.F : (h = "speech" == a.b.style ? 1.6 : .8, h = new be(h, h, h, h));
h = new be(360 * h.top * e / 100, 640 * h.right * g / 100, 360 * h.bottom * e / 100, 640 * h.left * g / 100);
a.k && (h.right += 1.5 * c.height / 100);
a.g.style.padding = h.top + "px " + h.right + "px " + h.bottom + "px " + h.left + "px";
"label" == a.b.style && a.A && (a.A.style.padding =
a.g.style.padding);
a.k && (g = g / e * c.height * 4.2 / 100, g = new G(g, g), ze(a.k, g), "highlight" == a.b.type || "label" == a.b.style ? (e = 1.5 * c.height / 100, g = new E(b.width - g.width - e, b.height - g.height - e)) : g = new E(b.width - g.width - 3 * c.height / 100, (b.height - g.height) / 2), oe(a.k, g));
a.o && (g = 9 <= c.left + c.width - (b.left + b.width), e = 9 <= b.top - c.top, oe(a.o, g && e ? new E(b.width - 9, -9) : g ? new E(b.width - 9, 45 < b.height ? 9 : b.height - 9) : e ? new E(45 < b.width ? b.width - 9 - 18 : -9, -9) : b.width / c.width > b.height / c.height ? new E(45 < b.width ? b.width - 9 - 18 : -9, b.height -
9) : new E(-9, 45 < b.height ? 9 : b.height - 9)))
}
}
a.j && c && a.j.g(a.b, c, d);
if (a.g) {
c = a.g;
d = a.b.b;
c.style.color = "highlightText" == a.b.style ? d.H : d.A;
c.style.fontSize = 360 * d.N * Ux(a.b, a.B.zf) / 100 + "px";
b = a.b.style;
c.style.textAlign = d.textAlign ? d.textAlign : "title" == b || "highlightText" == b ? "center" : "left";
d.D && (c.style.fontWeight = d.D);
a = a.g;
c = a.style.overflow;
d = H("annotation-link-icon", a);
b = fx(d);
g = H("annotation-close-button", a);
e = fx(g);
d && b && hx(d);
g && e && hx(g);
var k = h = "",
l = H("inner-text", a);
l && (h = l.style.overflow, k = l.style.position,
l.style.overflow = "visible", l.style.position = "static");
a.style.overflow = "scroll";
if (a.scrollHeight > a.offsetHeight || a.scrollWidth > a.offsetWidth) {
for (var q = Pe(a), s = q, u = 5, z = Math.floor(q / 2); z;) a.scrollHeight <= a.offsetHeight && a.scrollWidth <= a.offsetWidth ? (u = s, s = Math.min(s + z, q)) : s = Math.max(s - z, u), z = Math.floor(z / 2), a.style.fontSize = s + "px";
s != u && (a.scrollHeight > a.offsetHeight || a.scrollWidth > a.offsetWidth) && (a.style.fontSize = u + "px")
}
a.style.overflow = c;
l && (l.style.overflow = h, l.style.position = k);
g && e && gx(g);
d && b && gx(d)
}
}
}
}
bB.prototype.show = function () {
var a = this.b.b,
a = (a && 0 == a.j || "title" == this.b.style || "highlightText" == this.b.style || "pause" == this.b.type ? !1 : !0) && !this.j,
b = !this.g,
c = "widget" == this.b.type;
if (a) {
var d = fB(this);
if (d) {
var e = null;
"highlight" == this.b.type || "label" == this.b.style ? e = new RA : "popup" == this.b.style ? e = new $A : "anchored" == this.b.style ? e = new PA : "speech" == this.b.style ? e = new aB : "image" == this.b.type && ("video" == this.b.style ? e = new YA(4 / 3, 16 / 9, !0) : "channel" == this.b.style && (e = new YA));
e && (e.g(this.b, d, hB(this)),
this.j = e, d = e.K()) && (hx(d), O(d, "annotation-type-" + this.b.type.toLowerCase()), this.F(d))
}
}
if (b) {
d = ["annotation", "hid"];
"highlightText" != this.b.style || d.push("annotation-no-mouse");
d.push("annotation-type-" + this.b.type.toLowerCase());
this.g = I("div", d);
this.b.B && (this.A = I("div", "inner-text"), "label" == this.b.style && (O(this.A, "label-text"), this.A.style.backgroundColor = this.b.b.o), pd(this.A, this.b.B), this.g.appendChild(this.A));
cg(this.g, "annotation_id", this.b.id);
this.F(this.g);
cB(this, this.g);
if (Ox(this.b) &&
"image" != this.b.type && Mx(this.b)) {
if (d = Kx(this.b)) this.g.title = pw(d);
this.k = I("span", "annotation-link-icon");
this.g.appendChild(this.k)
}
eB(this);
Ox(this.b) || (this.g.style.cursor = "default")
}
c && ("subscribe" == this.b.style ? H("yt-uix-subscription-button", this.g) || (this.g.innerHTML = this.b.j) : this.b.j && (this.g.innerHTML = this.b.j));
if (a || b) {
t: {
a = this.b.g.b;
if (a.length && (a = xx(a[0]))) {
a = a.B;
break t
}
a = 0
}
this.g && (this.g.style.zIndex = a);
this.j && this.j.K() && (this.j.K().style.zIndex = a)
}
gx(this.g);
Fe(this.g, gB(this) ?
1 : 0);
Gz(this);
this.j && gx(this.j.K())
};
bB.prototype.hide = function () {
hx(this.g);
this.j && hx(this.j.K())
};
function gB(a) {
return "label" != a.b.style || a.j.b
}
function fB(a) {
var b = a.B.zf;
return b ? "player_relative" == a.b.H ? (a = a.B.Zc) ? new ce(-b.left, -b.top, a.width, a.height) : null : new ce(0, 0, b.width, b.height) : null
};
function iB(a) {
Ot.call(this, a);
this.gk = !0;
this.wa = "iv-module";
this.jc = "iv";
this.H = !1;
this.O = !0;
this.loaded = !1;
this.k = 0;
this.g = {};
this.D = {};
this.A = new ay(this.N, this.b);
a = jB;
this.o = new wA(bu(this));
S(this, this.o);
this.o.listen("change", this.su, this);
this.subscribe("onHideControls", this.pu, this);
this.subscribe("onShowControls", this.ru, this);
this.subscribe("onStateChange", this.qu, this);
this.subscribe("d", this.uu, this);
this.subscribe("c", this.tu, this);
this.subscribe("a", this.nu, this);
this.subscribe("b",
this.ou, this);
var b = new dv(["div", [a.ku, "hid"],
["svg", {
width: "60",
height: "60"
},
["g", "", ["circle", "countdowntimer-background-circle", {
cx: "30",
cy: "30",
r: "15"
}],
["path", "countdowntimer-diminishing-pieslice", {
d: "M30,30 z"
}],
["circle", "countdowntimer-middle-dot", {
cx: "30",
cy: "30",
r: "4"
}]
]
]
]);
S(this, b);
b = b.K();
this.M = I("DIV", [a.mu, "html5-stop-propagation"]);
this.B = I("DIV", a.lu);
Rt(this, I("DIV", a.ju, this.M, this.B));
Rt(this, b);
this.C = new lA(b, t(this.nk, this));
this.j = null;
this.L = [];
this.F = null
}
w(iB, Ot);
iB.o = "AnnotationsModule";
var jB = {
ju: "video-annotations",
ku: "countdowntimer",
lu: "video-custom-annotations",
mu: "video-legacy-annotations"
};
iB.k = function (a) {
switch (a.type) {
case "branding":
case "promotion":
case "survey":
return !0
}
return !1
};
iB.j = function (a) {
return "card" == a.type
};
iB.g = function (a) {
return iB.Ka(a) ? new iB(a) : null
};
iB.Ka = function (a) {
return "leanback" == a.R().ba ? !1 : Kr(a.getVideoData(), "iv3_module")
};
iB.b = function () {
return I("div", ["annotation", "annotation-type-custom", "hid"])
};
f = iB.prototype;
f.Ka = function () {
return iB.Ka(this.b)
};
f.create = function () {
iB.G.create.call(this);
cu(this, this.o);
1 == (this.b.R().ua || this.b.getVideoData().va) && this.load()
};
f.destroy = function () {
du(this, this.o);
iB.G.destroy.call(this)
};
f.su = function () {
var a = this.loaded || this.k,
b = 0 == this.o.getSelected();
a && !b ? (this.unload(), this.log({
toggle: 0
})) : !a && b && (this.load(), this.log({
toggle: 1
}))
};
f.qu = function (a) {
this.O = W(a.state, 8);
0 > vv(a, 4) && this.C.stop()
};
f.load = function () {
iB.G.load.call(this);
var a = this.b.getVideoData(),
b = t(this.Er, this, a.videoId);
Iy() && (b = kB(this, b));
b = {
format: "XML",
method: "GET",
zb: b
};
a.Tm && (this.k++, ii(a.Tm, b));
a.Sm && (b = t(this.Er, this, a.videoId), Iy() && (b = kB(this, b)), b = {
format: "XML",
method: "GET",
zb: b
}, this.k++, ii(a.Sm, b));
uA(this.o.element, 0)
};
f.unload = function () {
uA(this.o.element, 1);
this.A.log_({
"iv-event": 1
});
this.nk();
Pt(this);
Lb(this.g, function (a) {
a.destroy()
});
Lb(this.D, function (a) {
a.destroy()
});
this.j && (this.j.destroy(), this.j = null);
this.k = 0;
this.loaded = !1;
this.g = {};
this.D = {};
iB.G.unload.call(this)
};
function lB(a, b) {
for (var c = {}, d = 0; d < b.attributes.length; d++) {
var e = b.attributes[d];
c[e.name] = e.nodeValue
}
for (d = 0; d < b.childNodes.length; d++)
if (e = b.childNodes[d], e.tagName) {
var g;
if (c[e.tagName]) g = c[e.tagName];
else if ("html_blob" == e.tagName || "data" == e.tagName) {
0 < e.childNodes.length && (c[e.tagName] = e.childNodes[0].nodeValue.trim());
continue
} else g = [], c[e.tagName] = g;
e && "TEXT" == e.tagName ? 1 == e.childNodes.length && 3 == e.childNodes[0].nodeType ? g.push(e.childNodes[0].nodeValue) : g.push("") : e && g.push(lB(a, e))
}
return c
}
f.Er = function (a, b) {
if (this.k && !this.loaded && this.b.getVideoData().videoId == a) {
this.k--;
var c = b.responseXML ? b.responseXML.getElementsByTagName("annotations") : null;
if (di(b) && c) {
mB(this, c[0]);
O(Zs(this.b), this.wa + "-loaded");
0 == this.k && (this.loaded = !0);
var c = [],
d;
for (d in this.g) {
var e = this.g[d].ha,
g;
if (e.g)
if (g = e.g, g.b.length)
if (g = g.b[0].g || g.b[0].b || g.b[0].j, !g || 2 > g.length) g = null;
else {
var h = g.length - 1;
g = 0 >= g[0].g && 0 >= g[h].g ? null : {
start: g[0].g,
end: g[h].g
}
} else g = null;
else g = null; if (h = g)
if (g = 1E3 * h.start,
h = 1E3 * h.end, 0 == g && (g++, h++), g == h && h++, !(h < g)) {
var k = {
id: d
};
"marker" == e.type && (k.style = "ytp-chapter-marker", k.tooltip = e.B, k.visible = !0);
e = new Ds(g, h, k);
c.push(e)
}
}
this.Hf.apply(this, c)
}
}
};
function nB(a, b) {
var c = oB(a, b);
if (!c && "marker" != b.type) return null;
Qx(b, function (a) {
a = t(this.nD, this, b.id, a);
this.subscribe("ivTrigger:" + b.id, a)
}, a);
return new Dz(a.N, b, c)
}
function pB(a, b) {
var c = iB.b(),
d = null;
switch (b.type) {
case "branding":
a.B.appendChild(c);
d = new sz(c, qB(a), b);
break;
case "promotion":
a.B.appendChild(c), d = new vz(c, qB(a), b)
}
d && d.uj();
return d
}
function rB(a, b) {
if (!a.j) {
var c = iB.b();
a.B.appendChild(c);
a.j = new ez(c, qB(a));
a.j.uj()
}
var c = a.j,
d = b && b.data && b.data.card_type;
if (d) {
var e = Kx(b);
e && fz[d] && c.add(new fz[d](b.id, b.data, e, b))
}
}
function qB(a) {
a.F || (a.F = new uz(new zv(a), a.b.R(), a.b.getVideoData(), a.A, a.b, a.N));
return a.F
}
function mB(a, b) {
for (var c = b.getElementsByTagName("annotation"), d = 0; d < c.length; d++) {
var e = lB(a, c[d]),
g = null;
try {
g = Jx(e)
} catch (h) {}
g && (iB.k(g) ? (e = pB(a, g)) && (a.D[g.id] = e) : iB.j(g) ? rB(a, g) : (e = nB(a, g)) && (a.g[g.id] = e))
}
Lb(a.g, function (a) {
var b = a.ha;
b.g && b.g.g && (b = this.g[b.g.g]) && (a.b.D = b.ha)
}, a)
}
f.Ic = function (a) {
iB.G.Ic.call(this, a);
a = a.getId();
var b = this.g[a];
b && !b.o && (b = b.ha, "pause" == b.type ? sB(this, b) : (tB(this, a), by(this.A, b)))
};
f.ld = function (a) {
iB.G.ld.call(this, a);
uB(this, a.getId())
};
function sB(a, b) {
if (a.O) {
var c = Lx(b, function (a) {
return "pause" == a.type && !!a.duration && !!a.duration.value
});
c && (a.H = !0, a.I("command_pause"), a.C.start(1E3 * c.duration.value))
}
}
function vB(a, b, c, d) {
d ? tB(a, b, c) : uB(a, b, c)
}
function uB(a, b, c) {
if (b = a.g[b]) Fz(b), c && c.g ? (a = t(a.ys, a, b), b.g = new Bv(a, 2E3), b.g.start()) : a.ys(b)
}
f.ys = function (a) {
a && (a.hide(), wB(this, "shown", !1, a.ha.id), xB(this, a.ha, "hidden"))
};
function tB(a, b, c) {
if (b = a.g[b]) Fz(b), c && c.k ? (a = t(a.gs, a, b), b.g = new Bv(a, 2E3), b.g.start()) : a.gs(b)
}
f.gs = function (a) {
a && (a.show(), wB(this, "shown", !0, a.ha.id), xB(this, a.ha, "shown"))
};
f.nD = function (a, b, c) {
var d = this.g[a];
if (d && b.value != c) {
b.value = c;
var e = !1;
Qx(d.ha, function (a) {
e |= a.value
});
vB(this, a, b, e)
}
};
f.nu = function (a) {
if (a && a.id) {
var b = Kx(a);
if (b) {
var c = t(function () {
xB(this, a, "click")
}, this);
Vx(pw(b)) && "new" != b.target || (c(), c = null);
dy(this.A, a, c)
}
}
};
function xB(a, b, c) {
Px(b, function (a) {
if (a.trigger == c && "openUrl" == a.type) {
var e = this.b.getVideoData(),
g = Xx(a.url, e.videoId);
if (-1 != g) this.I("command_seek", g), this.nk();
else if (e = Yx(a.url, b.id, e.videoId, this.b.R())) this.pauseVideo(), window.open(e, $x(a.url))
}
}, a)
}
f.pu = function () {
wB(this, "playerControlShow", !1)
};
f.ru = function () {
wB(this, "playerControlShow", !0)
};
f.uu = function (a) {
wB(this, "rollOver", !0, a.id)
};
f.tu = function (a) {
wB(this, "rollOver", !1, a.id)
};
f.ou = function (a) {
if (a || a.id) this.g[a.id].o = !0, uB(this, a.id), a && (ey(this.A, a), xB(this, a, "close")), wB(this, "closed", !0, a.id)
};
f.nk = function () {
this.C.stop();
this.H && (this.H = !1, this.I("command_play"))
};
function oB(a, b) {
if (yB(b)) {
var c = b.C || Nx(b, function (a) {
return "click" == a || "rollOut" == a || "rollOut" == a
});
return new bB(b, t(a.M.appendChild, a.M), a.b.R(), a.N, c)
}
return null
}
function yB(a) {
if ("highlight" == a.type || "image" == a.type || "widget" == a.type) return !0;
if ("text" == a.type)
for (var b in Gx)
if (a.style == Gx[b]) return !0;
return !1
}
function wB(a, b, c, d) {
a.I(Cz(b, d), c, d)
}
function kB(a, b) {
return t(function () {
if (!this.ea()) {
var a = Array.prototype.slice.call(arguments, 0);
a.unshift(b);
b = ra.apply(window, a);
this.L.push(Jy(b, void 0))
}
}, a)
}
f.J = function () {
for (var a = this.L, b = 0, c = a.length; b < c; b++) Ly(a[b]);
this.L.length = 0;
iB.G.J.call(this)
};
function zB(a, b) {
return a + " {" + b.join("; ") + "; }"
}
function AB(a, b, c) {
c = c || {};
var d = c.jd;
d || (d = document.createElement("style"), d.setAttribute("type", "text/css"), document.getElementsByTagName("head")[0].appendChild(d), d = d.sheet || d.styleSheet);
c.reset && BB(d);
b = b instanceof Array ? b.join(";") : b;
d.insertRule ? d.insertRule(a + "{" + b + "}", d.cssRules.length) : d.addRule(a, b, -1);
return d
}
function BB(a) {
for (var b = (a.cssRules || a.rules).length; 0 < b; b--) {
var c = a;
c.deleteRule ? c.deleteRule(0) : c.removeRule(0)
}
};
function CB(a, b, c) {
X.call(this, ["div", "ytp-drop-down", "{{content}}"]);
this.o = !1;
this.B = 0;
this.D = this.C = null;
this.g = new X(["div", "ytp-drop-down-menu", "{{content}}", {
tabindex: -1
}]);
S(this, this.g);
this.b = new nA(a, "ytp-drop-down-label");
S(this, this.b);
this.b.listen("click", this.F, this);
this.A = new X(["div", "ytp-drop-down-label-content", "{{content}}"]);
S(this, this.A);
this.b.na([this.A, ["div", "ytp-drop-down-arrow"]]);
this.na([this.g, this.b]);
this.stopPropagation("click");
n(b) && this.k(b);
n(c) && this.D != c &&
(this.g.na(c), this.D = c, DB(this));
DB(this)
}
w(CB, X);
CB.prototype.k = function (a) {
this.C != a && (this.A.na(a), this.C = a, DB(this))
};
CB.prototype.j = function () {
this.o = !1;
DB(this)
};
CB.prototype.F = function () {
this.o = !this.o;
DB(this);
this.o && this.g.K().focus()
};
function EB(a, b) {
b > a.B && (a.B = b, a.element.style.minWidth = a.B + "px")
}
function DB(a) {
a.o ? (a.g.show(), vy(a, window, "blur", a.j, a, "menu"), vy(a, document, "click", a.j, a, "menu")) : (a.g.hide(), wy(a, "menu"));
var b = Be(a.b.K());
a.g.K().style.bottom = b.height - 1 + "px";
EB(a, b.width)
};
function FB(a, b) {
nA.call(this, a, "ytp-drop-down-menu-button");
this.b = new X(["div", "ytp-drop-down-menu-button-check"]);
S(this, this.b);
this.j = !!b
}
w(FB, nA);
FB.prototype.na = function (a) {
FB.G.na.call(this, [this.b, a])
};
function GB(a, b) {
Q(a.element, "ytp-drop-down-menu-button-selected", b);
a.j || Q(a.element, "ytp-drop-down-menu-button-checked", b)
}
function HB(a, b) {
Q(a.element, "ytp-drop-down-menu-button-separated", b)
}
function IB(a, b) {
Q(a.element, "ytp-drop-down-menu-button-checked", b)
};
function JB(a, b, c, d) {
X.call(this, ["div", "ytp-drop-down-menu-content", "{{content}}"]);
this.C = a;
this.o = !!d;
this.j = {};
this.k = [];
this.b = this.g = null;
this.A = b;
this.B = c
}
w(JB, X);
function KB(a, b) {
Bb(a.k, b) || (Lb(a.j, function (a) {
a.fd()
}), a.k = [], b && y(b, function (a) {
this.k.push(a);
var b = LB(this, a);
this.o && IB(b, a == this.b);
GB(b, a == this.g);
b.X(this.element)
}, a))
}
function MB(a, b) {
null != a.g && GB(LB(a, a.g), !1);
null != b && GB(LB(a, b), !0);
a.g = b;
a.o || (a.b = b)
}
JB.prototype.getSelected = function () {
return this.g
};
function NB(a, b) {
Lb(a.j, function (a) {
qA(a, b)
})
}
function LB(a, b) {
var c = a.j[b.toString()];
if (c) return c;
c = new FB(a.C, a.o);
S(a, c);
a.j[b.toString()] = c;
c.na(a.A(b));
c.listen("click", t(a.B, a, b));
return c
};
function OB(a) {
mA.call(this);
this.D = this.j;
this.k = {};
this.k[this.j] = Y(0, "YTP_TRANSLATE_MENU_ITEM");
this.k.contribute = Y(0, "YTP_CONTRIBUTE_MENU_ITEM");
this.F = !0;
this.b = Y(0, "YTP_SUBTITLES");
this.g = new JB(a, t(this.H, this), t(this.M, this));
S(this, this.g);
this.element = new CB(a, void 0, this.g);
S(this, this.element);
EB(this.element, 150);
this.priority = 2;
this.o = !0;
this.A = "captions";
this.B = this.L = !1
}
w(OB, mA);
OB.prototype.j = "translate";
function PB(a, b) {
var c = [a.j];
a.B && c.push("contribute");
for (var d = 0; d < b.length; d++) {
var e = b[d],
g = e.toString();
a.k[g] || (a.k[g] = QB(e));
c.push(g)
}
KB(a.g, c);
c = !a.L;
d = LB(a.g, a.j);
c ? d.disable() : d.enable();
c = !a.B;
HB(LB(a.g, a.j), c);
a.B && HB(LB(a.g, "contribute"), !0);
c = 2100;
NB(a.g, c++);
c = c++;
qA(a.element.b, c)
}
function RB(a, b) {
a.k[b] && (a.D = b, MB(a.g, b), a.element.k(a.H(b)))
}
function SB(a, b) {
a.L = b;
var c = !b,
d = LB(a.g, a.j);
c ? d.disable() : d.enable()
}
OB.prototype.H = function (a) {
return this.k[a]
};
OB.prototype.M = function (a) {
this.element.j();
a == this.j ? (this.F = !0, this.element.Fb("select")) : "contribute" == a ? (this.F = !1, this.element.Fb("select")) : (RB(this, a), this.element.Fb("change"))
};
function TB(a) {
mA.call(this);
this.b = Y(0, "YTP_SUBTITLES");
this.element = new rA(a, [Y(0, "YTP_ON"), Y(0, "YTP_OFF")]);
S(this, this.element);
vA(this.element, 2200);
this.priority = 1;
this.C = !0;
this.A = "captions";
uA(this.element, 1)
}
w(TB, mA);
TB.prototype.N = function () {
this.element.Fb("select")
};
TB.prototype.getSelected = function () {
return this.element.getSelected()
};
function UB(a) {
X.call(this, a)
}
w(UB, X);
UB.prototype.A = function () {};
var VB = {
II: "monoSerif",
fJ: "propSerif",
HI: "monoSans",
eJ: "propSans",
CASUAL: "casual",
CURSIVE: "cursive",
DJ: "smallCaps"
},
WB = {
NONE: "none",
DROP_SHADOW: "dropShadow",
RAISED: "raised",
DEPRESSED: "depressed",
$J: "uniform"
},
XB = ["left", "right", "center"],
YB = {
id: 0,
priority: 0,
anchorPoint: 7,
Zi: 50,
IE: 80,
ne: 95,
Fd: 15,
pm: 100,
isVisible: !0,
textAlign: XB[2],
Te: 0,
backgroundColor: "#080808",
foregroundColor: "#fff",
DE: 1,
Ln: 1
},
ZB = {
id: 98
},
$B = {
id: 99,
priority: 1,
anchorPoint: 0,
Zi: 5,
ne: 7,
Fd: 2,
pm: 32,
textAlign: XB[0]
},
aC = ["CA", "MX", "US"];
var bC = [{
ga: "#fff",
message: "YTP_COLOR_WHITE"
}, {
ga: "#ff0",
message: "YTP_COLOR_YELLOW"
}, {
ga: "#0f0",
message: "YTP_COLOR_GREEN"
}, {
ga: "#0ff",
message: "YTP_COLOR_CYAN"
}, {
ga: "#00f",
message: "YTP_COLOR_BLUE"
}, {
ga: "#f0f",
message: "YTP_COLOR_MAGENTA"
}, {
ga: "#f00",
message: "YTP_COLOR_RED"
}, {
ga: "#080808",
message: "YTP_COLOR_BLACK"
}],
cC = [{
ga: 0,
text: "0%"
}, {
ga: .25,
text: "25%"
}, {
ga: .5,
text: "50%"
}, {
ga: .75,
text: "75%"
}, {
ga: 1,
text: "100%"
}],
dC = [{
ga: "fontFamilyOption",
message: "YTP_FONT_FAMILY",
options: [{
ga: "monoSerif",
message: "YTP_FONT_FAMILY_MONO_SERIF"
}, {
ga: "propSerif",
message: "YTP_FONT_FAMILY_PROP_SERIF"
}, {
ga: "monoSans",
message: "YTP_FONT_FAMILY_MONO_SANS"
}, {
ga: "propSans",
message: "YTP_FONT_FAMILY_PROP_SANS"
}, {
ga: "casual",
message: "YTP_FONT_FAMILY_CASUAL"
}, {
ga: "cursive",
message: "YTP_FONT_FAMILY_CURSIVE"
}, {
ga: "smallCaps",
message: "YTP_FONT_FAMILY_SMALL_CAPS"
}]
}, {
ga: "color",
message: "YTP_FONT_COLOR",
options: bC
}, {
ga: "fontSizeIncrement",
message: "YTP_FONT_SIZE",
options: [{
ga: -2,
text: "50%"
}, {
ga: -1,
text: "75%"
}, {
ga: 0,
text: "100%"
}, {
ga: 1,
text: "150%"
}, {
ga: 2,
text: "200%"
}, {
ga: 3,
text: "300%"
}, {
ga: 4,
text: "400%"
}]
}, {
ga: "background",
message: "YTP_BACKGROUND_COLOR",
options: bC
}, {
ga: "backgroundOpacity",
message: "YTP_BACKGROUND_OPACITY",
options: cC
}, {
ga: "windowColor",
message: "YTP_WINDOW_COLOR",
options: bC
}, {
ga: "windowOpacity",
message: "YTP_WINDOW_OPACITY",
options: cC
}, {
ga: "charEdgeStyle",
message: "YTP_CHAR_EDGE_STYLE",
options: [{
ga: "none",
message: "YTP_EDGE_STYLE_NONE"
}, {
ga: "dropShadow",
message: "YTP_EDGE_STYLE_DROP_SHADOW"
}, {
ga: "raised",
message: "YTP_EDGE_STYLE_RAISED"
}, {
ga: "depressed",
message: "YTP_EDGE_STYLE_DEPRESSED"
}, {
ga: "uniform",
message: "YTP_EDGE_STYLE_OUTLINE"
}]
}, {
ga: "textOpacity",
message: "YTP_FONT_OPACITY",
options: [{
ga: .25,
text: "25%"
}, {
ga: .5,
text: "50%"
}, {
ga: .75,
text: "75%"
}, {
ga: 1,
text: "100%"
}]
}];
function eC(a, b, c, d) {
X.call(this, ["li", "ytp-subtitles-settings-dialog-list-option", "{{content}}"]);
var e = b.text || (b.message ? Y(0, b.message) : ""),
e = [new dv(["div", "ytp-subtitles-settings-dialog-list-text", e])];
d && (d = new dv(["div", "ytp-subtitles-settings-dialog-list-swatch"]), d.K().style.background = b.ga, e.unshift(d));
c ? e.unshift(new dv(["div", "ytp-subtitles-settings-dialog-list-caret"])) : e.unshift(new dv(["div", "ytp-subtitles-settings-dialog-list-check"]));
this.b = new nA(a);
S(this, this.b);
this.b.na(e);
this.na(this.b)
}
w(eC, X);
eC.prototype.setEnabled = function (a) {
Q(this.b.K(), "ytp-subtitles-settings-dialog-list-selected", a)
};
function fC(a) {
X.call(this, ["div", ["ytp-subtitles-settings-dialog", "ytp-dialog", "html5-stop-propagation"],
["div", "ytp-dialog-body", ["div", "ytp-subtitles-settings-dialog-top-level", "{{top}}"],
["div", "ytp-subtitles-settings-dialog-sub-level", "{{sub}}"]
],
["div", "ytp-dialog-buttons", "{{buttons}}"]
]);
this.o = a;
this.g = null;
var b = Y(0, "YTP_DONE"),
c = new nA(a, "ytp-dialog-button", b);
S(this, c);
c.na(b);
c.listen("click", ra(this.Fb, "cancel"), this);
b = Y(0, "YTP_RESET");
a = new nA(a, "ytp-dialog-button", b);
S(this, a);
a.na(b);
O(a.K(), "ytp-dialog-button-left");
a.listen("click", ra(this.Fb, "select"), this);
this.j = {};
this.b = {};
this.template.update({
top: gC(this, dC),
buttons: [a, c]
})
}
w(fC, UB);
function gC(a, b, c) {
var d = new X(["ul", "ytp-subtitles-settings-dialog-list"]),
e, g = !1;
n(c) ? (a.b = {}, e = a.b) : (a.j = {}, e = a.j, g = !0);
for (var h = 0; h < b.length; h++) {
var k = b[h],
l = new eC(a.o, k, g, b == bC);
g ? l.listen("click", t(a.k, a, k.options, k.ga)) : c && l.listen("click", t(a.B, a, c, k.ga));
e[k.ga] = l;
l.X(d.K())
}
return d
}
fC.prototype.k = function (a, b) {
this.template.update({
sub: gC(this, a, b)
});
hC(this, this.j, b);
hC(this, this.b, this.g[b])
};
function hC(a, b, c) {
Lb(b, function (a, b) {
a.setEnabled(b == c)
}, a)
}
function iC(a, b) {
a.g = b;
var c = dC[0];
c && c.options && a.k(c.options, c.ga)
}
fC.prototype.B = function (a, b) {
this.g && (this.g[a] = b, this.Fb("change"));
hC(this, this.b, b)
};
fC.prototype.A = function () {
var a = this.o.Wc(),
b = 2 * Math.floor(Math.min(560, Math.max(230, .65 * a.width)) / 2);
this.K().style.width = b + "px";
this.template.b["ytp-dialog-body"].style.height = a.height - 140 + "px"
};
fC.prototype.J = function () {
this.j = [];
this.b = [];
fC.G.J.call(this)
};
function jC(a) {
var b = ["div", ["ytp-dialog", "html5-stop-propagation"],
["div", "ytp-dialog-title", Y(0, "YTP_TRANSLATE_DIALOG_TITLE")],
["div", "ytp-dialog-body", "{{content}}"],
["div", "ytp-dialog-buttons", "{{buttons}}"]
];
X.call(this, b);
var c = Y(0, "YTP_DISMISS"),
b = new nA(a, "ytp-dialog-button", c);
S(this, b);
b.na(c);
b.listen("click", ra(this.Fb, "change"), this);
var c = Y(0, "YTP_CANCEL"),
d = new nA(a, "ytp-dialog-button", c);
S(this, d);
d.na(c);
d.listen("click", ra(this.Fb, "cancel"), this);
this.g = new JB(a, t(this.j, this), t(this.o,
this), !0);
S(this, this.g);
this.g.element.style.maxHeight = "100px";
this.b = new CB(a, void 0, this.g);
S(this, this.b);
EB(this.b, 200);
this.k = null;
this.template.update({
content: this.b,
buttons: [b, d]
})
}
w(jC, UB);
function kC(a, b) {
a.k = b;
a.b.k(b ? a.j(b) : null)
}
jC.prototype.getSelected = function () {
return this.k
};
jC.prototype.o = function (a) {
this.b.j();
kC(this, a)
};
jC.prototype.j = function (a) {
return a.vi + " -- " + a.Uk
};
var lC;
function mC(a, b) {
ia(b) && (b = b.join(" "));
if ("" === b || void 0 == b) {
var c;
lC || (lC = {
atomic: !1,
autocomplete: "none",
dropeffect: "none",
haspopup: !1,
live: "off",
multiline: !1,
multiselectable: !1,
orientation: "vertical",
readonly: !1,
relevant: "additions text",
required: !1,
sort: "none",
busy: !1,
disabled: !1,
hidden: !1,
invalid: "false"
});
c = lC;
"pressed" in c ? a.setAttribute("aria-pressed", c.pressed) : a.removeAttribute("aria-pressed")
} else a.setAttribute("aria-pressed", b)
};
function nC(a, b, c, d, e) {
nA.call(this, a, b, c, c);
this.F = b;
this.L = this.N = c;
this.A = d || null;
this.B = e || null;
this.C = e || null;
this.b = !1
}
w(nC, nA);
function oC(a) {
oA(a, a.b && a.A ? a.A : a.F);
pA(a, a.b && a.B ? a.B : a.N);
a.g = a.b && a.C ? a.C : a.L;
Q(a.element, "ytp-button-pressed", a.b)
}
function pC(a) {
a.b = !0;
mC(a.element, !0);
oC(a)
}
function qC(a) {
a.b = !1;
mC(a.element, !1);
oC(a)
}
function rC(a, b) {
a.F = b;
oC(a)
}
nC.prototype.J = function () {
this.C = this.B = this.A = null;
nC.G.J.call(this)
};
function sC(a) {
a = a || YB;
sa(this, a)
}
f = sC.prototype;
f.anchorPoint = 7;
f.Zi = 50;
f.ne = 95;
f.IE = 80;
f.Te = 0;
f.textAlign = "center";
f.backgroundColor = "#080808";
f.foregroundColor = "#fff";
f.DE = 1;
f.Ln = 1;
f.Fd = 15;
f.pm = 32;
f.isVisible = !0;
f.Ps = '"Arial Unicode Ms", Arial';
f.pD = "100%";
function tC(a, b) {
this.id = a;
this.Fa = new sC(b);
var c = "caption-window";
0 == this.id && (c = "standard-caption-window");
this.ya = I("div", {
id: "caption-window-" + this.id,
"class": c
});
this.Sb = I("span", {
"class": "captions-text",
style: "visibility: hidden"
});
this.Sb.innerHTML = "C";
this.za = I("span", {
"class": "captions-text",
tabindex: 7E3,
"aria-live": "assertive"
});
this.Pj = I("div", {
"class": "caption-window-transform"
});
this.Pj.appendChild(this.za);
this.ya.appendChild(this.Pj)
}
tC.prototype.id = 0;
f = tC.prototype;
f.Fa = null;
f.eh = "";
f.Tc = null;
f.ya = null;
f.Pj = null;
f.za = null;
f.Sb = null;
f.type = 1;
f.Lj = function () {
var a;
this.Sb.style.fontFamily = this.za.style.fontFamily;
this.ya.appendChild(this.Sb);
a = this.Sb.offsetHeight;
this.ya.removeChild(this.Sb);
return a
};
f.cf = function () {
this.za && (0 != this.id && (Ae(this.ya, "100%"), Ae(this.ya, this.za.offsetWidth)), uC(this), ex(this.ya, this.Fa.isVisible))
};
function uC(a) {
oe(a.ya, a.Fa.Zi + "%", a.Fa.ne + "%");
for (var b = 0; 8 >= b; b++) P(a.ya, "anchor-point-" + b);
O(a.ya, "anchor-point-" + a.Fa.anchorPoint)
}
f.Dr = function (a) {
var b = [];
y(a, function (a) {
a.Nj ? b[b.length - 1] += a.oe : b.push(a.oe)
});
this.We(b.join("\n"));
this.Tc = a
};
f.We = function (a) {
this.eh = a = vC(a);
this.za.innerHTML = this.eh;
this.Mn();
this.cf()
};
function wC(a, b) {
b && (b = b.replace(/<[^>]*>?/g, ""), a.We(b))
}
f.Mn = function () {
this.ya.style.textAlign = this.Fa.textAlign;
this.za.style.backgroundColor = this.Fa.backgroundColor;
this.za.style.color = this.Fa.foregroundColor;
this.za.style.opacity = this.Fa.Ln;
this.za.style.fontFamily = this.Fa.Ps;
this.za.style.fontSize = this.Fa.pD;
1 == this.Fa.Te ? this.za.setAttribute("dir", "rtl") : this.za.removeAttribute("dir")
};
f.toString = function () {
var a = "Caption window (" + this.id + "): " + this.eh,
b;
for (b in this.Fa) a += b + " " + this.Fa[b] + " | ";
return a
};
function vC(a) {
a = a.split("\n");
for (var b = 0, c = a.length; b < c; b++) a[b] = a[b] ? "&nbsp;" + a[b] + "&nbsp;" : "";
return a.join("<br>")
}
f.Qj = function () {
this.Tc = [];
this.We("")
};
function xC() {
this.o = 20971520;
this.k = 8388608;
this.g = 5242880;
this.ra = NaN;
this.A = this.D = 2;
this.M = 25;
this.H = 2097152;
this.b = !0;
this.j = 1800;
this.O = this.L = !1;
this.C = 1.15;
this.Zh = Nn.auto;
this.N = !0;
this.P = Wq("xboxone");
this.B = this.F = 0;
this.T = !1
};
function yC() {
this.aa = []
}
yC.prototype.contains = function (a) {
a = xb(this.aa, a);
return 0 <= a || 0 > a && 1 == (-a - 1) % 2
};
yC.prototype.length = function () {
return this.aa.length / 2
};
function zC(a) {
if ("undefined" != typeof DOMParser) return (new DOMParser).parseFromString(a, "application/xml");
if ("undefined" != typeof ActiveXObject) {
var b = AC();
b.loadXML(a);
return b
}
throw Error("Your browser does not support loading xml documents");
}
function BC(a) {
if ("undefined" != typeof XMLSerializer) return (new XMLSerializer).serializeToString(a);
if (a = a.xml) return a;
throw Error("Your browser does not support serializing XML documents");
}
function AC() {
var a = new ActiveXObject("MSXML2.DOMDocument");
if (a) {
a.resolveExternals = !1;
a.validateOnParse = !1;
try {
a.setProperty("ProhibitDTD", !0), a.setProperty("MaxXMLSize", 2048), a.setProperty("MaxElementDepth", 256)
} catch (b) {}
}
return a
};
function CC() {
this.g = [];
this.j = []
};
function DC(a) {
this.b = a.Ed;
this.k = a.priority;
this.uc = a.uc || this.uc
}
DC.prototype.b = 0;
DC.prototype.k = 0;
DC.prototype.uc = 0;
DC.prototype.toString = function () {
return this.b + ", " + this.uc
};
function EC(a) {
DC.call(this, a);
this.oe = a.text || this.oe;
this.Pi = a.windowId || this.Pi;
this.Nj = a.params.append || this.Nj;
this.Zs = a.params.row || this.Zs;
this.Ys = a.params.rD || this.Ys
}
w(EC, DC);
f = EC.prototype;
f.oe = "";
f.Nj = !1;
f.Zs = 0;
f.Ys = 0;
f.Pi = 0;
f.toString = function () {
return this.b + ", " + this.uc + ": " + this.oe
};
function FC(a) {
var b = a.firstChild && a.firstChild.nodeValue || "",
c = 1E3 * parseFloat(a.getAttribute("start") || 0);
a.getAttribute("t") && (c = parseInt(a.getAttribute("t"), 10));
var d = 1E3 * parseFloat(a.getAttribute("dur") || 0);
a.getAttribute("d") && (d = parseFloat(a.getAttribute("d")));
var e = parseInt(a.getAttribute("w"), 10) || 0,
b = {
Ed: c,
uc: d,
text: b,
windowId: e,
priority: 5,
params: {}
};
a.getAttribute("r") && (b.params.row = parseInt(a.getAttribute("r"), 10));
a.getAttribute("c") && (b.params.rD = parseInt(a.getAttribute("c"), 10));
a.getAttribute("append") && (b.priority = 6, b.params.append = !0);
return new EC(b)
}
function GC(a) {
DC.call(this, a);
this.id = a.windowId || this.id;
this.params = a.params
}
w(GC, DC);
GC.prototype.id = 0;
GC.prototype.params = null;
GC.prototype.j = "";
GC.prototype.g = !1;
function HC() {
return new GC({
Ed: -2147483648,
uc: 4294967295,
params: YB
})
};
function IC(a) {
CC.call(this);
this.j.push(HC());
a = a.firstChild.childNodes;
for (var b = 0, c = a.length; b < c; b++) {
var d = FC(a[b]);
this.g.push(d)
}
}
w(IC, CC);
function JC(a) {
CC.call(this);
this.b = {};
a = a.firstChild.childNodes;
for (var b = 0, c = a.length; b < c; b++) switch (a[b].tagName) {
case "window":
var d = a[b],
e = parseInt(d.getAttribute("id"), 10);
t: {
var g = this.b[e];
if (d.getAttribute("t") || d.getAttribute("start")) {
var h = parseInt(d.getAttribute("t"), 10);
d.getAttribute("start") && (h = 1E3 * parseFloat(d.getAttribute("start")));
g && (g.b + g.uc >= h ? g.uc = h : g = null);
switch (d.getAttribute("op")) {
case "kill":
d = null;
break t;
case "define":
g = null
}
g ? g.o = !0 : g = HC();
var k = {};
sa(k, g ? g.params :
YB);
d.getAttribute("id") && (k.id = d.getAttribute("id"));
d.getAttribute("op") && (k.KE = d.getAttribute("op"));
d.getAttribute("rc") && (k.Fd = parseInt(d.getAttribute("rc"), 10));
d.getAttribute("cc") && (k.pm = parseInt(d.getAttribute("cc"), 10));
d.getAttribute("ap") && (g = parseInt(d.getAttribute("ap"), 10), k.anchorPoint = 0 > g || 8 < g ? 7 : g);
d.getAttribute("ah") && (k.Zi = parseInt(d.getAttribute("ah"), 10));
d.getAttribute("av") && (k.ne = parseInt(d.getAttribute("av"), 10));
d.getAttribute("id") && (k.id = parseInt(d.getAttribute("id"),
10) || 0);
d.getAttribute("vs") && (k.isVisible = Boolean(d.getAttribute("vs")));
d.getAttribute("ju") && (k.textAlign = XB[parseInt(d.getAttribute("ju"), 10)]);
d.getAttribute("pd") && (k.Te = 1, 0 == parseInt(d.getAttribute("pd"), 10) && (k.Te = 0));
d.getAttribute("bc") && (k.backgroundColor = parseInt(d.getAttribute("bc"), 16));
d.getAttribute("bo") && (k.opacity = parseInt(d.getAttribute("bo"), 10) / 100);
d.getAttribute("fc") && (k.foregroundColor = parseInt(d.getAttribute("fc"), 16));
d.getAttribute("sd") && (k.Xl = parseInt(d.getAttribute("sd"),
10));
g = parseInt(d.getAttribute("d"), 10) || 1E3 * parseFloat(d.getAttribute("dur")) || 2147483647;
d = {
Ed: h,
uc: g,
params: k,
windowId: parseInt(d.getAttribute("id"), 10)
};
d = new GC(d)
} else d = null
}
this.b[e] = d;
this.j.push(d);
break;
case "text":
e = FC(a[b]), this.g.push(e), d = e.Pi, this.b[d] && (d = this.b[d], e = e.oe, "" != d.j && (d.g = !0), d.j += e)
}
}
w(JC, CC);
function KC() {
CC.call(this)
}
w(KC, CC);
function LC(a) {
this.b = a.languageCode;
this.vi = a.languageName || null;
this.Uk = a.languageOriginal || null;
this.id = a.id || null;
this.g = a.is_default || !1
}
LC.prototype.toString = function () {
return this.b + "_" + this.vi + "_" + this.Uk + "_" + this.id + "_" + this.g
};
function MC(a) {
a = a || {};
this.F = a.formats || "";
this.o = a.format || 1;
if (1 == this.o)
for (var b = this.F.split(","), c = 0; c < b.length; c++) {
var d = parseInt(b[c], 10);
isNaN(d) || (this.o = Math.max(d, this.o))
}
this.g = a.languageCode || "";
this.A = a.languageName;
this.j = a.kind || "";
this.k = a.name;
this.ta = a.id;
this.H = a.is_servable;
this.B = a.is_default;
this.C = a.is_translateable;
this.D = a.vss_id || "";
this.b = null;
a.translationLanguage && (this.b = new LC(a.translationLanguage))
}
function NC(a) {
var b = {
format: a.o,
languageCode: a.g,
languageName: a.A,
displayName: QB(a),
kind: a.j,
name: a.k,
id: a.ta,
is_servable: a.H,
is_default: a.B,
is_translateable: a.C
};
a.b && (a = a.b, b.translationLanguage = {
languageCode: a.b,
languageName: a.vi,
languageOriginal: a.Uk,
id: a.id,
is_default: a.g
});
return b
}
function QB(a) {
var b = [a.A];
if ("asr" == a.j) {
var c = Ld("YTP_ASR_SETTINGS_LABEL");
b.push(" (", c, ")")
}
a.k && b.push(" - ", a.k);
a.b && b.push(" >> ", a.b.vi);
return b.join("")
}
MC.prototype.toString = function () {
var a = [this.g, ": ", this.k, " (", this.j, ")"];
this.b && a.push(" >> ", this.b.b);
return a.join("")
};
MC.prototype.equals = function (a) {
if (!a) return !1;
var b = this.b,
c = a.b;
if (b && c) {
if (b.b != c.b) return !1
} else if (b || c) return !1;
return this.g == a.g && this.k == a.k && this.j == a.j
};
function OC(a, b) {
CC.call(this);
this.j.push(HC());
for (var c = a.split(PC), d = 1; d < c.length; d++) {
var e;
e = c[d];
var g = b;
if ("" == e || 0 == e.search(QC)) e = null;
else {
var h = e.split(RC),
k = 0,
l = h[k++].match(SC);
l || (l = h[k++].match(SC));
l ? (e = TC(l[1], g), g = TC(l[3], g), h = h.slice(k).join("\n"), e = new EC({
Ed: e,
uc: g - e,
text: h,
windowId: 0,
priority: 5,
params: {}
})) : e = null
}
e && this.g.push(e)
}
}
w(OC, CC);
var QC = /NOTE/,
PC = /[\r\n|\r|\n]{2,}/,
RC = /\r\n|\r|\n/,
SC = /(([\d]{2}:)?[\d]{2}:[\d]{2}\.[\d]{3})[\t ]+--\x3e[\t ]+(([\d]{2}:)?[\d]{2}:[\d]{2}\.[\d]{3})/;
function TC(a, b) {
for (var c = a.split(":"), d = 0, e = 0; e < c.length; e++) d = 60 * d + parseFloat(c[e]);
return 1E3 * d + b
};
function UC(a, b) {
this.b = [];
this.g = [];
var c;
c = a ? "WEBVTT" == a.substring(0, 6) ? new OC(a, b || 0) : (c = zC(a)) && c.firstChild ? "timedtext" == c.firstChild.tagName ? 3 == parseInt(c.firstChild.getAttribute("format"), 10) ? new KC : new JC(c) : new IC(c) : null : null;
c && (this.g = c.j, this.b = c.g)
};
function VC(a, b) {
this.xa = a;
this.V = b;
this.A = new yC;
this.k = !0;
this.B = this.j = this.o = this.b = null;
this.g = 0
}
w(VC, jh);
VC.prototype.J = function () {
Id(this.g);
this.g = 0;
this.k = !0
};
VC.prototype.resume = function () {
this.k = !1;
Id(this.g);
this.seek(this.V.getCurrentTime());
WC(this)
};
VC.prototype.seek = function (a) {
this.b = bb(this.B.qi(a).b)
};
function XC(a, b) {
a.o = b
}
function YC(a) {
var b;
if (b = !a.k && null !== a.b) b = a.b, b = b.b.Eg(b);
return b && !a.j && !(a.b && 30 < a.b.startTime - a.V.getCurrentTime())
}
function ZC(a) {
var b;
b = a.b;
b = Jo(b.b, b);
if (!a.A.contains(b.b[0].k)) {
ii(Go(b), {
format: "RAW",
zb: t(a.C, a),
withCredentials: !0
});
a.j = b;
var c = a.A,
d = a.j.b[0].k,
e = xb(c.aa, d);
0 <= e || 0 > e && 1 == (-e - 1) % 2 || (e = -e - 1, 0 < e && 1 == d - c.aa[e - 1] && e < c.aa.length && 1 == c.aa[e] - d ? (pb(c.aa, e), pb(c.aa, e - 1)) : 0 < e && 1 == d - c.aa[e - 1] ? c.aa[e - 1] = d : e < c.aa.length && 1 == c.aa[e] - d ? c.aa[e] = d : (ub(c.aa, e, 0, d), ub(c.aa, e + 1, 0, d)))
}
a.b = bb(b.b)
}
VC.prototype.C = function (a) {
null == a.responseText || 400 <= a.status || this.k || null === this.o || (a = new UC(a.responseText, 1E3 * this.j.b[0].startTime), this.o(a));
this.j = null
};
function WC(a) {
a.g = Hd(t(function () {
YC(this) && ZC(this)
}, a), 1E3);
YC(a) && ZC(a)
};
function $C() {
this.j = [];
this.g = [];
this.b = -1
}
function aD(a, b) {
return b ? a.g.concat(a.j) : a.g
}
function bD(a, b) {
switch (b.j) {
case "asr":
return cD(b, a.j);
default:
if (b.B || 0 > a.b) a.b = a.g.length;
return cD(b, a.g)
}
}
function cD(a, b) {
return B(b, t(a.equals, a)) ? !1 : (b.push(a), !0)
};
function dD(a) {
this.bq = !!a;
this.b = new $C;
this.A = []
}
function eD(a, b) {
return B(aD(a.b, !0), function (a) {
return a.toString() == b
})
}
dD.prototype.seek = function () {};
dD.prototype.B = function () {};
function fD(a, b) {
dD.call(this);
this.j = a;
this.g = new VC(new xC, b)
}
w(fD, dD);
fD.prototype.k = function (a, b) {
XC(this.g, function (c) {
b(c, a)
});
this.g.B = this.j.b[a.g];
this.g.resume()
};
fD.prototype.o = function (a) {
bD(this.b, new MC({
format: 1,
languageCode: "en",
languageName: "English",
name: "",
is_servable: !0,
is_default: !0,
is_translateable: !1
}));
a()
};
fD.prototype.seek = function (a) {
this.g.seek(a)
};
fD.prototype.B = function () {
var a = this.g;
Id(a.g);
a.g = 0;
a.k = !0
};
function gD(a, b) {
tC.call(this, a, b);
this.za.style.display = "block";
this.za.style.padding = "0";
this.ac = [];
var c = this.za;
P(c, "captions-text");
O(c, "caption-painton-text-rows")
}
w(gD, tC);
f = gD.prototype;
f.type = 0;
f.yq = "";
f.dh = !1;
f.Ob = null;
f.ac = null;
f.Lj = function () {
return this.ac[0] ? this.ac[0].offsetHeight : 0
};
function hD(a) {
return a.ac.reduce(function (a, c) {
return Math.max(a, c.offsetWidth)
}, 0)
}
f.cf = function () {
0 != this.id && (Ae(this.ya, "100%"), Ae(this.ya, this.dh ? hD(this) : this.Ob.width));
var a = Math.round(this.Fa.Fd * this.Lj());
this.ya.style.maxHeight = a + "px";
uC(this);
ex(this.ya, this.Fa.isVisible)
};
f.We = function (a) {
this.Qj();
a = vC(a);
this.dh || (this.eh = a);
a = a.split("<br>");
for (var b = 0, c = a.length; b < c; b++)
if (a[b]) {
var d = I("div", {
"class": "caption-row-holder"
}),
e = I("span", {
"class": "caption-row captions-text"
});
d.appendChild(e);
e.innerHTML = a[b];
this.dh || (this.za.style.height = this.Ob.height + "px", this.za.style.width = this.Ob.width + "px", d.style.position = "absolute", d.style.top = this.Ob.wq[b] + "px", d.style.left = this.Ob.uq[b] + "px");
this.za.appendChild(d);
this.ac.push(e)
}
this.Mn();
this.cf()
};
f.Qj = function () {
for (var a = 0, b = this.ac.length; a < b; a++) {
var c = xd(this.ac[a], "caption-row-holder");
hd(c)
}
this.ac = []
};
f.Mn = function () {
this.ya.style.textAlign = this.Fa.textAlign;
for (var a = 0, b = this.ac.length; a < b; a++) this.ac[a].style.backgroundColor = this.Fa.backgroundColor;
this.za.style.color = this.Fa.foregroundColor;
this.za.style.opacity = this.Fa.Ln;
this.za.style.fontFamily = this.Fa.Ps;
1 == this.Fa.Te ? this.za.setAttribute("dir", "rtl") : this.za.removeAttribute("dir")
};
function iD(a, b) {
tC.call(this, a, b);
this.Tc = [];
this.ue = [];
this.Rb = [];
this.Yf = new rk(433);
this.Yf.stop();
R(this.Yf, "tick", t(this.GD, this))
}
w(iD, tC);
f = iD.prototype;
f.type = 2;
f.tD = 32;
f.Rb = null;
f.ve = 0;
f.ue = null;
f.Yf = null;
f.cf = function () {
Ae(this.ya, "100%");
var a = this.ya.offsetWidth,
a = Math.min(jD(this), a);
Ae(this.ya, a + "px");
Ae(this.Pj, "100%");
this.za.style.whiteSpace = "nowrap";
uC(this);
ex(this.ya, this.Fa.isVisible)
};
f.Dr = function (a) {
var b = a.length;
if (0 >= b) this.Qj();
else {
for (var c = 0; c < b && 0 <= this.Tc.indexOf(a[c]);) c++;
this.Tc = this.Tc.concat(a.slice(c));
kD(this)
}
};
f.Qj = function () {
this.Tc = [];
this.Rb = [];
this.ve = 0;
this.Rb = [];
this.ue = [];
lD(this)
};
function kD(a) {
if (!mD(a))
if (a.ve >= a.Tc.length) lD(a);
else {
var b = a.Rb.length - 1;
0 > b && (a.ue.push(0), a.ve = 0, a.Rb.push(""), b = 0);
for (var c = a.Tc.length, d = a.ve; d < c; d++) {
var e = a.Tc[d];
if ("\n" == e.oe) {
a.ve++;
a.ue[b]++;
break
}
if (e.Nj || 0 == a.Rb[b].length) a.Rb[b] += e.oe, a.ve++, a.ue[b]++;
else break
}
lD(a);
d < c && !mD(a) && (b = a.Lj(), O(a.za, "caption-rollup"), a.ya.style.overflow = "hidden", a.za.style.top = -b + "px", a.Yf.start())
}
}
function mD(a) {
return a.Yf.gd || Zf(a.za, "caption-rollup")
}
f.GD = function () {
this.ya.style.overflow = "visible";
this.za.style.top = 0;
this.Yf.stop();
P(this.za, "caption-rollup");
this.Rb.push("");
this.ue.push(0);
kD(this)
};
function lD(a) {
if (!mD(a)) {
for (; a.Rb.length < a.Fa.Fd;) a.Rb.unshift(""), a.ue.unshift(0);
for (; a.Rb.length > a.Fa.Fd;) {
a.Rb.shift();
var b = a.ue.shift();
0 < b && (a.ve -= b, a.Tc.splice(0, b))
}
a.We(a.Rb.join("\n"))
}
}
function jD(a) {
a.Sb.style.fontFamily = a.za.style.fontFamily;
a.Sb.style.fontSize = a.za.style.fontSize;
a.za.appendChild(a.Sb);
a.Sb.innerHTML = "\u2014";
var b = a.Sb.offsetWidth;
a.Sb.innerHTML = "&nbsp;";
b = 2 * a.Sb.offsetWidth + b * a.tD;
a.za.removeChild(a.Sb);
return b
};
function nD(a, b, c, d) {
dD.call(this, d);
c || (c = Zh(a).hl || "", c = c.split("_").join("-"));
this.g = bi(a, {
hl: c
});
this.j = b;
this.C = {}
}
w(nD, dD);
nD.prototype.k = function (a, b) {
var c = oD(this, a);
ii(c, {
format: "RAW",
onSuccess: function (c) {
c = new UC(c.responseText);
b(c, a)
},
withCredentials: !0
})
};
nD.prototype.o = function (a, b, c) {
var d = this.g;
b = {
type: "list",
tlangs: 1,
v: this.j,
fmts: Number(b || !1),
vssids: 1
};
this.bq && (b.asrs = 1);
d = bi(d, b);
b = t(function (b) {
if ((b = b.responseXML) && b.firstChild) {
for (var d = this.b, h = b.getElementsByTagName("track"), k = h.length, l = 0; l < k; l++) {
var q = h[l].getAttribute("formats"),
s = c,
u = h[l].getAttribute("lang_code"),
z = h[l].getAttribute("lang_translated"),
F = h[l].getAttribute("name"),
L = h[l].getAttribute("kind"),
ba = h[l].getAttribute("id"),
kb = "true" == h[l].getAttribute("lang_default"),
Tf = "true" == h[l].getAttribute("cantran"),
Qw = h[l].getAttribute("vss_id"),
q = new MC({
formats: q,
format: s,
languageCode: u,
languageName: z,
name: F,
kind: L,
id: ba,
is_servable: !0,
is_default: kb,
is_translateable: Tf,
vss_id: Qw
});
bD(d, q)
}
b = b.getElementsByTagName("target");
d = b.length;
for (h = 0; h < d; h++) k = b[h].getAttribute("lang_code"), l = b[h].getAttribute("lang_translated"), q = b[h].getAttribute("lang_original"), s = b[h].getAttribute("id"), u = "true" == b[h].getAttribute("lang_default"), k = {
languageCode: k,
languageName: l,
languageOriginal: q,
id: s,
is_default: u
}, this.C[k.languageCode] = k.languageName, this.A.push(new LC(k))
}
a()
}, this);
ii(d, {
format: "RAW",
onSuccess: b,
withCredentials: !0
})
};
function oD(a, b) {
var c = a.g,
d = {
v: a.j,
type: "track",
lang: b.g,
name: b.k,
kind: b.j,
fmt: b.o
};
b.b && (d.tlang = b.b.b);
return c = bi(c, d)
};
function pD(a) {
Ot.call(this, a);
Kd({
YTP_TRANSLATE_MENU_ITEM: "Translate captions",
YTP_CONTRIBUTE_MENU_ITEM: "Add subtitles/CC",
YTP_TRANSLATE_DIALOG_TITLE: "\u00dcbersetzen...",
YTP_ASR_SETTINGS_LABEL: "Automatische Untertitel",
YTP_FONT_FAMILY: "Schriftfamilie",
YTP_FONT_SIZE: "Schriftgr\u00f6\u00dfe",
YTP_FONT_COLOR: "Schriftfarbe",
YTP_FONT_OPACITY: "Deckkraft der Schriftart",
YTP_BACKGROUND_COLOR: "Hintergrundfarbe",
YTP_BACKGROUND_OPACITY: "Hintergrund-Deckkraft",
YTP_WINDOW_COLOR: "Fensterfarbe",
YTP_WINDOW_OPACITY: "Fenster-Deckkraft",
YTP_COLOR_WHITE: "Wei\u00df",
YTP_COLOR_YELLOW: "Gelb",
YTP_COLOR_GREEN: "Gr\u00fcn",
YTP_COLOR_CYAN: "Cyan",
YTP_COLOR_BLUE: "Blau",
YTP_COLOR_MAGENTA: "Magenta",
YTP_COLOR_RED: "Rot",
YTP_COLOR_BLACK: "Schwarz",
YTP_FONT_FAMILY_MONO_SERIF: "Nicht proportionale Serifenschrift",
YTP_FONT_FAMILY_PROP_SERIF: "Proportionale Serifenschrift",
YTP_FONT_FAMILY_MONO_SANS: "Nicht proportionale serifenlose Schrift",
YTP_FONT_FAMILY_PROP_SANS: "Proportionale serifenlose Schrift",
YTP_FONT_FAMILY_CASUAL: "Casual",
YTP_FONT_FAMILY_CURSIVE: "Kursiv",
YTP_FONT_FAMILY_SMALL_CAPS: "Kapit\u00e4lchen",
YTP_CHAR_EDGE_STYLE: "Stil der Zeichenr\u00e4nder",
YTP_EDGE_STYLE_NONE: "Keine Auswahl",
YTP_EDGE_STYLE_RAISED: "Erh\u00f6ht",
YTP_EDGE_STYLE_DEPRESSED: "Abgesenkt",
YTP_EDGE_STYLE_OUTLINE: "Umriss",
YTP_EDGE_STYLE_DROP_SHADOW: "Schlagschatten"
});
this.gk = !0;
this.W = !1;
this.tb = new zv(this);
this.C = a.R();
this.A = null;
this.ca = a.app.g;
this.ja = {};
this.$ = [];
this.Da = 0;
this.B = {};
this.T = {};
this.qa = this.Ca = this.va = this.ua = !1;
this.oa = new tC(99, $B);
this.j = this.k = this.F = null;
this.Ba = !1;
this.O = this.H = 0;
this.M = new nC(bu(this), "ytp-subtitles-button", Y(bu(this), "YTP_SUBTITLES"), "ytp-subtitles-button-active");
this.M.listen("click", this.rx, this);
qA(this.M, 6500);
this.D = new TB(bu(this));
S(this, this.D);
uA(this.D.element, 1);
this.D.listen("change", this.Bx, this);
this.D.listen("select", this.Cx, this);
this.o = new OB(bu(this));
S(this, this.o);
this.o.listen("change", this.$p, this);
this.o.listen("select", this.qx, this);
SB(this.o, !1);
this.L = new fC(bu(this));
S(this, this.L);
this.L.listen("change", t(this.Ce,
this, !0));
this.L.listen("cancel", this.ox, this);
this.L.listen("select", this.dq, this);
this.P = new jC(bu(this));
S(this, this.P);
this.P.listen("change", this.xx, this);
this.P.listen("cancel", this.pg, this);
this.subscribe("onResize", t(this.lo, this));
this.subscribe("onBackgroundChange", t(this.yx, this));
this.subscribe("onTextOpacityChange", t(this.zx, this));
this.subscribe("onWindowOpacityChange", t(this.Ax, this));
this.subscribe("onFontSizeIncrease", t(this.wx, this));
this.subscribe("onFontSizeDecrease", t(this.vx,
this));
this.subscribe("onShowControls", t(this.ux, this));
this.subscribe("onHideControls", t(this.tx, this));
"detailpage" == this.C.ba && (a = H("captions-account-settings-link", Zs(a))) && gx(a)
}
w(pD, Ot);
pD.prototype.wa = "captions";
pD.prototype.jc = "cc";
pD.prototype.qn = "subtitlesModuleData";
pD.prototype.Aa = 1;
var qD = {
background: "#080808",
backgroundOpacity: 1,
charEdgeStyle: "uniform",
color: "#fff",
fontFamily: '"Arial Unicode Ms", Arial',
fontFamilyOption: "propSans",
fontSizeIncrement: 0,
textOpacity: 1,
windowColor: "#080808",
windowOpacity: 0
};
function rD(a) {
return a.C.Wb ? !!a.ca.b.textTracks : !1
}
f = pD.prototype;
f.create = function () {
pD.G.create.call(this);
this.A = this.b.getVideoData(); - 1 == aC.indexOf(this.C.$) && O(Zs(this.b), "cc-international");
this.g = Zb(qD);
sa(this.g, Vt(this, "display-settings"));
iC(this.L, this.g);
rD(this) || (this.I("module_menu_button_add", this.wa, this.M), cu(this, this.D));
var a;
1 == this.C.g.cc_load_policy || 1 == this.A.xo || "alwayson" == Er(this.A, "yt:cc") || rD(this) ? a = !0 : (a = Vt(this, "module-enabled"), a = null != a ? !!a : "on" == Er(this.A, "yt:cc") || this.C.g.cc_prefer_on);
a && this.load()
};
function sD(a) {
du(a, a.o);
du(a, a.D);
a.I("module_menu_button_remove", a.wa)
}
f.destroy = function () {
sD(this);
pD.G.destroy.call(this)
};
function tD(a) {
a.k.o(t(a.CC, a), !0, rD(a) ? "vtt" : void 0)
}
f.load = function () {
this.qa = "alwayson" == Er(this.A, "yt:cc");
this.Ca = "1" == this.A.k.cc_auto_caps || "1" == this.C.g.cc_auto_caps;
this.o.B = "1" == this.A.k.cc_contribute || "1" == this.C.g.cc_contribute;
if (this.W || this.loaded) this.loaded && (pD.G.load.call(this), this.W = !1, rD(this) || (this.Ce(), this.lo()));
else {
this.W = !0;
this.loaded = !1;
if (this.A.qb) this.k = new fD(this.A.j, this.b), this.subscribe("seekto", this.Ro, this);
else {
var a = this.A.k.cc_lang_pref || this.C.g.cc_lang_pref || Er(this.A, "yt:cc_default_lang") || this.C.o,
a = a &&
a.split("_").join("-");
this.k = new nD(this.A.Af, this.A.videoId, a, this.A.Hk)
}
tD(this)
}
};
f.unload = function () {
this.oc && (uD(this, !1), this.Wl("control_subtitles_set_track"));
if (rD(this)) {
var a;
a = Rc("track", void 0, void 0);
for (var b = 0; b < a.length; b++) hd(a[b])
} else vD(this, !1), wD(this), this.ia("seekto", this.Ro, this), this.k = null, this.pg();
this.va = this.W = !1;
this.loaded && (this.loaded = !1, pD.G.unload.call(this))
};
f.log_ = function () {};
f.CC = function () {
if (this.k)
if (this.W = !1, rD(this)) {
for (var a = this.ca.b, b = this.k, c = [], d = aD(b.b, void 0), e = 0; e < d.length; e++) {
var g = d[e],
h = oD(b, g),
h = {
kind: "subtitles",
label: g.k,
srclang: g.g,
src: h
};
g.B && (h["default"] = 1);
c.push(I("track", h))
}
vt(a, c)
} else a = this.P, b = this.k.A, KB(a.g, b), b.length ? kC(a, b[0]) : kC(a, null), a = aD(this.k.b, !0), 0 < a.length ? (this.log_("Caption track list loaded, found " + a.length + " tracks."), cu(this, this.o), PB(this.o, a), b = this.k.b.b, (a = a[b] && a[b].toString()) && RB(this.o, a), b = this.k, a = b.b.b,
b = aD(b.b, !0), (a = 0 > a ? null : b[a]) ? (this.ua = !0, xD(this, a)) : (this.loaded || (this.loaded = !0, this.load(), a = this.k.b.j, a.length && (a = a[0].toString(), RB(this.o, a), (this.va || this.Ca) && yD(this, a))), this.I("publish_external_event", "onCaptionsTrackListChanged"))) : (this.log_("No captions found."), sD(this), this.unload())
};
f.Hx = function (a, b) {
this.k && (this.loaded || (this.loaded = !0, this.load()), this.ua && (this.ua = !1, this.I("publish_external_event", "onCaptionsTrackListChanged")), !b || this.j && b.equals(this.j) || zD(this, b), AD(this, a.g.concat(a.b)))
};
function zD(a, b) {
wD(a);
a.j = b;
a.Ba = Gw.test(b.g);
var c = {
trackName: b.k,
trackKind: b.j
};
b.b ? (c.trackLangCode = b.b.b, c.fromLangCode = b.g) : c.trackLangCode = b.g;
a.log(c);
wC(a.oa, QB(b));
Rt(a, a.oa.ya);
a.O || (a.O = J(t(a.Xw, a), 0));
a.I("publish_external_event", "captionschanged", NC(b));
rC(a.M, "ytp-subtitles-button-active");
uA(a.D.element, 0);
SB(a.o, !0);
Wt(a, "module-enabled", !0);
a.I("vss_segment")
}
function AD(a, b) {
a.log_("Caption track loaded with " + b.length + " events.");
var c = [];
y(b, function (a) {
var b;
this.Da++;
b = "caption" + this.Da.toString();
c.push(new Ds(a.b, a.b + a.uc, {
id: b
}));
this.ja[b] = a
}, a);
a.Hf.apply(a, c)
}
f.Ic = function (a) {
if (a = BD(this, a)) this.$.push(a), this.H || (this.H = J(t(this.ij, this), 0))
};
f.ld = function (a) {
if (a = BD(this, a)) ob(this.$, a), this.H || (this.H = J(t(this.ij, this), 0))
};
function BD(a, b) {
var c = b.getId();
return 0 != c.indexOf("caption") ? null : a.ja[c]
}
f.fB = function (a) {
if (a instanceof GC) {
var b = this.B[a.id];
sa(a.params, this.g);
b && b.type != (a.params.Xl ? 2 : a.g ? 0 : 1) && (hd(b.ya), delete this.B[a.id]);
if (!this.B[a.id]) {
var b = this.B,
c = a.id,
d;
t: {
d = a.id;
var e = a.params;
switch (a.params.Xl ? 2 : a.g ? 0 : 1) {
case 0:
d = new gD(d, e);
break t;
case 2:
d = new iD(d, e);
break t;
default:
d = new tC(d, e)
}
}
b[c] = d;
b = this.B[a.id].ya;
Q(b, "captions-asr", "asr" == this.j.j);
null != a.params.Te && (a.params.Te = this.Ba ? 1 : 0);
0 == this.B[a.id].id ? (O(b, this.wa), gd(this.b.app.g.F, b, 0)) : Rt(this, b)
}
sa(this.B[a.id].Fa,
a.params);
if (0 == (a.params.Xl ? 2 : a.g ? 0 : 1)) {
b = this.B[a.id];
b.yq = a.j;
b.Ob = {};
b.dh = !0;
b.We(b.yq);
b.Ob.Fd = b.ac.length;
b.Ob.width = b.ya.offsetWidth;
b.Ob.height = b.ya.offsetHeight;
b.Ob.uq = [];
b.Ob.wq = [];
for (a = 0; a < b.Ob.Fd; a++) b.Ob.wq.push(b.ac[a].offsetTop), b.Ob.uq.push(b.ac[a].offsetLeft);
b.dh = !1;
b.We(b.eh)
}
} else b = a.Pi, this.T[b] || (this.T[b] = []), this.T[b].push(a)
};
f.lo = function () {
this.loaded && (this.Aa = CD(this.ca).height / 360, this.Ce(), Lb(this.B, function (a) {
a.cf()
}, this))
};
function DD(a) {
var b = [];
Lb(a.B, function (a) {
a instanceof gD && b.push(a)
});
if (0 != b.length) {
b.sort(function (a, b) {
return b.Fa.ne - a.Fa.ne
});
var c = CD(a.ca).height,
d = b[0].Fa.ne;
y(b, function (a) {
a.Fa.ne = d;
var b = Math.round(a.Fa.Fd * a.Lj());
d -= Math.round(b / c * 100);
a.cf()
}, a)
}
}
f.Xw = function () {
this.O = 0;
hd(this.oa.ya)
};
f.ij = function () {
this.H = 0;
this.loaded && (Xb(this.T), this.$.sort(function (a, b) {
return a.b == b.b ? a.k - b.k : a.b - b.b
}), y(this.$, this.fB, this), Lb(this.B, function (a, b) {
this.T[b] ? a.Dr(this.T[b]) : (hd(a.ya), delete this.B[b])
}, this), DD(this), this.F && this.F.cf(), this.log_("Refreshing caption display..."))
};
function ED(a, b) {
var c = H(a).querySelectorAll("." + b + " input[type=radio]"),
d = lb(c, function (a) {
return a.checked
}),
d = (-1 == d ? 1 : d + 1) % c.length;
c[d].click()
}
f.yx = function () {
ED("captions-settings-background-opacity", "captions-settings-background-opacity-radio")
};
f.zx = function () {
ED("captions-settings-text-opacity", "captions-settings-text-opacity-radio")
};
f.Ax = function () {
ED("captions-settings-window-opacity", "captions-settings-window-opacity-radio")
};
f.ux = function () {
var a = this.B[0];
a && a.ya && (a = a.ya, P(a, "controls-hidden"), O(a, "controls-visible"))
};
f.tx = function () {
var a = this.B[0];
a && a.ya && (a = a.ya, Zf(a, "controls-visible") && (P(a, "controls-visible"), O(a, "controls-hidden")))
};
f.vx = function () {
FD(this, -1)
};
f.wx = function () {
FD(this, 1)
};
function FD(a, b) {
var c = a.g.fontSizeIncrement + b,
c = Math.max(-2, Math.min(4, c));
a.g.fontSizeIncrement = c;
a.Ce()
}
function GD(a, b) {
var c = H(b);
c && (c.querySelector('input[value="' + a.toFixed(1) + '"]').checked = !0)
}
function HD(a, b, c) {
var d = H(b);
d && (b = d.querySelector("span.yt-uix-form-input-select-value"), d = d.querySelector("select"), d.value = a.g[c], pd(b, d.options[d.selectedIndex].text))
}
function wD(a) {
a.j && (a.j = null, Pt(a), a.$ = [], a.ja = {}, a.j = null, a.ij(), rC(a.M, "ytp-subtitles-button"), uA(a.D.element, 1), SB(a.o, !1), a.k.B())
}
function yD(a, b) {
var c = eD(a.k, b);
xD(a, c);
a.log_("Caption change failed for " + b)
}
function xD(a, b) {
if (b && (!a.j || !b.equals(a.j)))
if (a.oc) a.j = b, uD(a, !0), a.Wl("control_subtitles_set_track", NC(b)), a.loaded || (a.loaded = !0, a.load());
else if (a.C.b.Ia) {
var c = a.ca.b,
d = a.k,
e = {
v: d.j,
type: "track",
lang: b.g,
name: b.k,
kind: b.j,
fmt: "vtt"
};
b.b && (e.tlang = b.b.b);
var g = document.createElement("track");
g.src = bi(d.g, e);
g.mode = "showing";
g.setAttribute("kind", "captions");
g.setAttribute("default", "");
vt(c, [g]);
zD(a, b)
} else a.k.k(b, t(a.Hx, a)), a.W = !0
}
f.xx = function () {
if (!this.qa) {
this.pg();
var a = this.P.getSelected();
if (a) {
var b = this.j,
c = new MC;
c.g = b.g;
c.A = b.A;
c.k = b.k;
c.j = b.j;
c.B = !1;
c.C = b.C;
c.D = b.D;
c.b = a;
bD(this.k.b, c) && (a = c.toString(), cu(this, this.o), PB(this.o, aD(this.k.b, !0)), RB(this.o, a));
xD(this, c)
}
}
};
f.ox = function () {
this.pg();
this.oc && this.j && this.Wl("control_subtitles_set_track", NC(this.j))
};
f.dq = function () {
delete this.g;
this.g = Zb(qD);
iC(this.L, this.g);
Wt(this, "display-settings", this.g);
this.Ce()
};
f.Ce = function (a) {
ID(this);
var b = Pv(this.g.background),
c = this.g.backgroundOpacity;
this.Ia = AB(".captions-text, .caption-row", "background-color: rgba(" + b[0] + "," + b[1] + "," + b[2] + "," + c + ") !important;", {
jd: this.Ia,
reset: !0
});
GD(c, "captions-settings-background-opacity");
b = Pv(this.g.color);
c = this.g.textOpacity;
this.ib = AB(".captions-text", "color: rgba(" + b[0] + "," + b[1] + "," + b[2] + "," + c + ") !important;", {
jd: this.ib,
reset: !0
});
GD(c, "captions-settings-text-opacity");
b = Pv(this.g.windowColor);
c = this.g.windowOpacity;
this.kb =
AB(".caption-window-transform", "background-color: rgba(" + b[0] + "," + b[1] + "," + b[2] + "," + c + ") !important;", {
jd: this.kb,
reset: !0
});
GD(c, "captions-settings-window-opacity");
var b = this.g.charEdgeStyle,
d = this.g.textOpacity;
if ("none" == b) this.ka && BB(this.ka);
else {
var c = "",
e = "rgba(34, 34, 34, " + d + ")",
d = "rgba(204, 204, 204, " + d + ")";
switch (b) {
case "dropShadow":
c = "text-shadow: 2px 2px 3px " + e + ", 2px 2px 4px " + e + ", 2px 2px 5px " + e + ";";
break;
case "raised":
c = "text-shadow: 1px 1px " + e + ", 2px 2px " + e + ", 3px 3px " + e +
";";
break;
case "depressed":
c = "text-shadow: 1px 1px " + d + ", 0 1px " + d + ", -1px -1px " + e + ", 0 -1px " + e + ";";
break;
case "uniform":
c = "text-shadow: 0 0 4px " + e + ", 0 0 4px " + e + ", 0 0 4px " + e + ", 0 0 4px " + e + ";"
}
this.ka = AB(".captions-text", c, {
jd: this.ka,
reset: !0
})
}
HD(this, "captions-settings-char-edge-style", "charEdgeStyle");
c = b = "";
switch (this.g.fontFamilyOption) {
case "monoSerif":
b = '"Courier New", Courier, "Nimbus Mono L", "Cutive Mono", monospace';
break;
case "propSerif":
b = '"Times New Roman", Times, Georgia, Cambria, "PT Serif Caption", serif';
break;
case "monoSans":
b = '"Deja Vu Sans Mono", "Lucida Console", Monaco, Consolas, "PT Mono", monospace';
break;
case "propSans":
b = '"Arial Unicode Ms", Arial, Helvetica, Verdana, "PT Sans Caption", sans-serif';
break;
case "casual":
b = '"Comic Sans MS", Impact, Handlee, fantasy';
break;
case "cursive":
b = '"Monotype Corsiva", "URW Chancery L", "Apple Chancery", "Dancing Script", cursive';
break;
case "smallCaps":
b = '"Arial Unicode Ms", Arial, Helvetica, Verdana, "Marcellus SC", sans-serif', c = "font-variant: small-caps;"
}
this.Ua =
AB(".captions-text", c + "font-family: " + b + " !important;", {
jd: this.Ua,
reset: !0
});
this.g.fontFamily = b;
HD(this, "captions-settings-font-family", "fontFamilyOption");
b = "font-size: " + Math.round(16 * (1 + .25 * (this.g.fontSizeIncrement || 0)) * this.Aa) + "px;";
this.hb = AB(".caption-window-transform", b, {
jd: this.hb,
reset: !0
});
this.ij();
n(a) && !a || Wt(this, "display-settings", this.g)
};
function ID(a) {
var b = [],
c = t(function (a) {
var c = this.g[a];
c && b.push(a + ": " + c + " !important")
}, a);
c("color");
c("background");
c = {
jd: a.Ma,
reset: !0
};
a.Ma = AB(".captions-text", b, c);
var d = Pv(a.g.windowColor),
c = {
jd: a.mb,
reset: !0
};
a.mb = AB(".caption-window-transform", "background-color: rgba(" + d[0] + "," + d[1] + "," + d[2] + ", 1)", c)
}
f.rx = function () {
this.loaded || this.load()
};
f.Bx = function () {
var a = 0 == this.D.getSelected();
this.loaded && !a ? (this.unload(), Wt(this, "module-enabled", !1), eu(this), this.I("vss_segment")) : !this.loaded && a ? (this.va = !0, this.load()) : this.o.D && this.$p()
};
f.Cx = function () {
St(this, this.L);
eu(this)
};
f.$p = function () {
yD(this, this.o.D)
};
f.qx = function () {
this.o.F ? this.qa || St(this, this.P) : Tt(this, this.C.wb + "timedtext_video?v=" + this.A.videoId);
eu(this)
};
function JD(a) {
return pD.prototype.Ka(a) ? new pD(a) : null
}
f.vt = function (a, b) {
switch (a) {
case "fontSize":
return isNaN(b) || (this.g.fontSizeIncrement = Math.max(-2, Math.min(4, b)), this.Ce()), this.g.fontSizeIncrement;
case "reload":
b && tD(this);
break;
case "stickyLoading":
this.C.Ib() && Wt(this, "module-enabled", !!b);
break;
case "track":
if (b) {
if (!la(b)) break;
var c = new MC(b);
c.equals(this.j) || (xD(this, c), RB(this.o, c.toString()))
} else return this.j ? NC(this.j) : {};
return "";
case "tracklist":
return this.loaded ? A(aD(this.k.b, b && b.includeAsr), function (a) {
return NC(a)
}) : [];
case "displaySettings":
return b &&
la(b) && KD(this, b), c = Zb(this.g), delete c.fontFamily, c;
case "sampleSubtitles":
vD(this, !!b)
}
};
function vD(a, b) {
if (b && !a.F) {
a.F = new tC(98, ZB);
var c = a.F.ya;
O(c, a.wa);
gd(a.b.app.g.F, c, 0);
wC(a.F, Y(bu(a), "YTP_SAMPLE_SUBTITLES"))
} else !b && a.F && (hd(a.F.ya), a.F = null)
}
f.Xr = function () {
var a = "reload fontSize track tracklist displaySettings sampleSubtitle".split(" ");
this.C.Ib() && a.push("stickyLoading");
return a
};
var LD = /^#(?:[0-9a-f]{3}){1,2}$/i;
f = pD.prototype;
f.yn = function (a, b) {
return a && r(a) && LD.test(a) ? a : b
};
f.zn = function (a, b) {
return ja(a) && !isNaN(a) ? Math.max(0, Math.min(1, parseFloat(a))) : b
};
f.hC = function (a, b) {
return a && r(a) && Sb(WB, a) ? a : b
};
f.iC = function (a, b) {
return a && r(a) && Sb(VB, a) ? a : b
};
f.jC = function (a, b) {
return ja(a) && !isNaN(a) ? Math.max(-2, Math.min(4, a)) : b
};
var MD = null;
function KD(a, b) {
if (b)
if (Yb(b, "reset")) a.dq();
else {
if (!MD) {
var c = {};
c.color = a.yn;
c.textOpacity = a.zn;
c.background = a.yn;
c.backgroundOpacity = a.zn;
c.windowColor = a.yn;
c.windowOpacity = a.zn;
c.charEdgeStyle = a.hC;
c.fontFamilyOption = a.iC;
c.fontSizeIncrement = a.jC;
MD = c
}
var c = MD,
d;
for (d in c) a.g[d] = c[d](b[d], a.g[d]);
a.Ce(ND(a.C))
}
}
f = pD.prototype;
f.Ka = function (a) {
return !!a.getVideoData().Af
};
f.Fi = function (a) {
a ? (a = this.j, wD(this), this.j = a) : (uD(this, this.loaded), this.j && xD(this, this.j))
};
function uD(a, b) {
b ? (rC(a.M, "ytp-subtitles-button-active"), uA(a.D.element, 0)) : (rC(a.M, "ytp-subtitles-button"), uA(a.D.element, 1))
}
f.Ro = function () {
this.k.seek(this.b.getCurrentTime())
};
f.Zg = function () {
var a = this.j;
return a ? {
cc: a.D
} : null
};
f.J = function () {
this.tb.removeAll();
this.H && (K(this.H), this.H = 0);
this.O && (Id(this.O), this.O = 0);
pD.G.J.call(this)
};
function OD(a) {
Ot.call(this, a);
this.wa = "ypc_license_checker";
this.jc = "ypc_license";
this.A = !1;
this.o = 0;
this.k = !1;
this.g = NaN;
this.C = Sp();
this.B = a.R().wb + "ypc_license_server";
this.j = null
}
w(OD, Ot);
var PD = {
LICENSE_DENIED_CANNOT_ACTIVATE_RENTAL: "YTP_ERROR_CANNOT_ACTIVATE_RENTAL",
LICENSE_DENIED_NOT_SIGNED_IN: "YTP_ERROR_NOT_SIGNED_IN",
LICENSE_DENIED_VIDEO_NOT_FOUND: "YTP_ERROR_VIDEO_NOT_FOUND",
LICENSE_DENIED_NO_ACTIVE_PURCHASE_AGREEMENT: "YTP_ERROR_PURCHASE_REFUNDED",
LICENSE_DENIED_PURCHASE_NOT_FOUND: "YTP_ERROR_PURCHASE_NOT_FOUND",
LICENSE_DENIED_PURCHASE_EXPIRED: "YTP_ERROR_RENTAL_EXPIRED",
LICENSE_DENIED_STREAMING_UNAVAILABLE: "YTP_ERROR_STREAMING_UNAVAILABLE",
LICENSE_DENIED_ALREADY_PINNED_ON_A_DEVICE: "YTP_ERROR_ALREADY_PINNED_ON_A_DEVICE",
LICENSE_DENIED_CONCURRENT_PLAYBACK: "YTP_ERROR_STOPPED_BY_ANOTHER_PLAYBACK",
LICENSE_DENIED_TOO_MANY_STREAMS_PER_USER: "YTP_ERROR_TOO_MANY_STREAMS_PER_USER",
LICENSE_DENIED_TOO_MANY_STREAMS_PER_ENTITLEMENT: "YTP_ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT",
LICENSE_DENIED_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED: "YTP_ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED",
LICENSE_DENIED_UNUSUAL_ACTIVITY: "YTP_ERROR_UNUSUAL_ACTIVITY",
LICENSE_DENIED_UNKNOWN: "YTP_ERROR_RETRYABLE_ERROR",
LICENSE_DENIED_PLAYBACK_CAP: "YTP_ERROR_LICENSE"
};
function QD(a) {
return Kr(a.getVideoData(), "ypc_license_checker_module")
}
f = OD.prototype;
f.Ka = function () {
return QD(this.b)
};
f.create = function () {
OD.G.create.call(this);
var a = new Ds(1E3, 2147483646, {
priority: 0
});
this.Hf(a);
this.subscribe("heartbeatparams", this.hD, this);
this.subscribe("onStateChange", this.iD, this)
};
function RD(a) {
return QD(a) ? new OD(a) : null
}
f.Ic = function () {
this.A = !0;
SD(this, 6E4)
};
f.hD = function (a) {
this.j = a;
SD(this, 6E4)
};
f.iD = function (a) {
W(a.state, 2) ? (this.o = 0, this.g && (K(this.g), this.g = NaN), this.k = !1) : (W(a.state, 1) || W(a.state, 8)) && SD(this, 6E4)
};
function SD(a, b) {
if (!a.g && a.A && (!Dr(a.b.getVideoData()) || a.j)) {
var c = b;
void 0 == c && (c = a.k ? a.j ? 1E3 * a.j.b : 6E4 : 1E3);
a.g = J(t(a.Gx, a), c)
}
}
f.Gx = function () {
var a, b, c, d = this.b.getVideoData();
Dr(d) ? (b = "GET", a = {}, c = qf(this.j.url, {
request_id: Sp()
}), d.C && (c = qf(c, {
vvt: d.C
})), d.B && (c = qf(c, {
access_token: d.B
}))) : (b = "POST", a = {
video_id: d.videoId,
player_id: this.C,
request_id: Sp(),
purchase_id: d.ak,
version: "4",
player_time_seconds: this.b.getCurrentTime().toString(),
gid: d.rd,
ypc_token: d.of
}, d.C && (a.vvt = d.C), d.B && (a.access_token = d.B), c = this.B);
c = qf(c, {
cpn: d.Ea
});
ii(c, {
format: "RAW",
method: b,
hd: a,
timeout: 3E4,
onSuccess: t(this.nA, this),
onError: t(this.mA, this),
ih: t(this.oA, this),
withCredentials: !0
})
};
f.nA = function (a) {
if (this.g) {
a = a.responseText;
var b;
t: {
b = a;
var c = b.match(TD);
if (c) {
if ("0" != c[1]) {
b = 1;
break t
}
b = c[3]
}
b = b in PD ? 1 : 64 <= b.length && b.match(/[0-9a-fA-f]+/) ? 0 : -1
} - 1 == b ? UD(this, "decode") : (this.o = 0, this.g = NaN, 1 == b ? (this.k = !1, b = "YTP_ERROR_LICENSE", (c = a.match(TD)) ? (a = parseInt(c[1], 10)) && (b = hu(a)) : a in PD && (b = PD[a]), a = Ld(b), uv(this.b.app.j, 150, a, void 0)) : (this.k = !0, SD(this)))
}
};
f.mA = function (a) {
UD(this, "net-" + a.status)
};
f.oA = function () {
UD(this, "timeout")
};
function UD(a, b) {
if (a.g)
if (a.log({
errorType: b
}), a.g = NaN, 5 < ++a.o) {
var c = Ld("YTP_ERROR_LICENSE");
uv(a.b.app.j, 150, c, void 0)
} else SD(a)
}
var TD = /^GLS\/1.0 (\d+) (\w+).*?\r\n\r\n([^]*)$/;
function VD() {
this.b = [];
this.g = []
}
ea(VD);
var WD = p("yt.player.utils.VideoTagPool.instance_") || VD.getInstance();
ca("yt.player.utils.VideoTagPool.instance_", WD, void 0);
VD.prototype.j = function (a) {
if (!(this.b.length >= a)) {
a -= this.b.length;
for (var b = 0; b < a; b++) {
var c = XD(this);
this.b.push(c)
}
}
};
function XD(a, b) {
var c = document.createElement("video");
sa(c, nt);
R(c, "loadeddata", t(c.sC, c));
R(c, "volumechange", t(c.tC, c));
Tg && 6 <= lq && R(c, "webkitbeginfullscreen", t(c.play, c));
b || ot(c);
a.g.push(c);
return c
}
VD.prototype.A = function (a) {
return this.b.length ? this.b.pop() : XD(this, a)
};
VD.prototype.o = function (a) {
a && C(this.g, a) && (tt(a), Bg(a), ob(this.g, a))
};
VD.prototype.k = function (a) {
return this.b.length >= (a || 1)
};
VD.prototype.fillPool = VD.prototype.j;
VD.prototype.getTag = VD.prototype.A;
VD.prototype.releaseTag = VD.prototype.o;
VD.prototype.hasTags = VD.prototype.k;
var YD = {
TI: "0",
VI: "1",
pE: "2",
OI: "3"
};
function ZD(a, b, c, d) {
if (this.j = !!c) this.Im = Math.max(800, this.Im);
this.element = a;
this.F = b;
this.A = d;
$D ? a.ontouchstart = t(this.nC, this) : a.onmousedown = t(this.mC, this);
a.onclick = t(this.xq, this)
}
var $D = "ontouchstart" in document,
aE = [],
bE = !1;
function cE() {
$D && !bE && (bE = !0, document.addEventListener("click", function (a) {
for (var b = new E(a.clientX, a.clientY), c = 0, d; d = aE[c]; c++)
if (25 > Hb(d, b)) {
a.stopPropagation();
a.preventDefault();
aE.splice(c, 1);
break
}
}, !0))
}
function dE(a) {
aE.push(a);
window.setTimeout(function () {
var b = aE.indexOf(a); - 1 != b && aE.splice(b, 1)
}, 2500)
}
f = ZD.prototype;
f.Im = 1E3;
f.nC = function (a) {
if (!(1 < a.touches.length || a._stop)) {
this.b = a._stop = !0;
this.j || (this.element.ontouchend = t(this.xq, this), document.body.addEventListener("touchend", eE(this), !1));
document.body.addEventListener("touchmove", fE(this), !1);
document.body.addEventListener("touchcancel", eE(this), !1);
gE(this, a);
this.H = window.setTimeout(t(this.Xi, this, !0), 100);
var b = a.touches[0];
this.g = new E(b.clientX, b.clientY);
this.j || this.A && !this.A(a) || dE(this.g)
}
};
f.mC = function (a) {
a.stopPropagation();
this.b = !0;
gE(this, a);
this.Xi(!0)
};
f.xq = function (a) {
"touchend" == a.type && !this.b || a._stop || (a._stop = !0, this.Xi(!0), window.setTimeout(t(function () {
this.hj();
this.F(a)
}, this), 0))
};
f.VC = function (a) {
1 < a.touches.length ? this.hj() : (a = a.touches[0], a = new E(a.clientX, a.clientY), this.g && 12 < Hb(this.g, a) && this.hj())
};
function fE(a) {
a.k || (a.k = t(a.VC, a));
return a.k
}
f.hj = function () {
window.clearTimeout(this.H);
window.clearTimeout(this.C);
this.Xi(!1);
this.b = !1;
document.body.removeEventListener("touchmove", fE(this), !1);
document.body.removeEventListener("touchend", eE(this), !1);
document.body.removeEventListener("touchcancel", eE(this), !1)
};
function eE(a) {
a.o || (a.o = t(a.hj, a));
return a.o
}
f.Xi = function (a) {
this.D && Lc(this.element, this.D, a)
};
function gE(a, b) {
a.B && (a.C = window.setTimeout(t(function () {
this.b = !1;
this.B(b)
}, a), a.Im))
};
function hE() {
X.call(this, ["div", ["html5-bezel", "html5-center-overlay"],
["div", "{{icon}}"]
]);
this.b = NaN;
this.hide()
}
w(hE, X);
hE.prototype.g = function () {
O(this.element, "html5-bezel-fade");
this.b = J(t(this.hide, this), 300)
};
hE.prototype.hide = function () {
hE.G.hide.call(this);
iE(this)
};
hE.prototype.setIcon = function (a) {
iv(this.template, "icon", a)
};
hE.prototype.show = function (a) {
iE(this);
a && this.setIcon(a);
hE.G.show.call(this)
};
function iE(a) {
K(a.b);
P(a.element, "html5-bezel-fade")
};
function jE(a) {
X.call(this, a);
this.T = new Ki;
S(this, this.T)
}
w(jE, X);
jE.prototype.subscribe = function (a, b, c) {
return this.T.subscribe(a, b, c)
};
jE.prototype.ia = function (a, b, c) {
return this.T.ia(a, b, c)
};
jE.prototype.Lb = function (a) {
return this.T.Lb(a)
};
jE.prototype.I = function (a, b) {
return this.T.I.apply(this.T, arguments)
};
function kE() {
this.g = this.b = null
}
function Y(a, b, c) {
return Ld(b, c, void 0)
}
f = kE.prototype;
f.Sg = function (a, b) {
this.b && this.b.Sg(a, b)
};
f.wf = function (a, b, c) {
this.b && this.b.wf(a, b, c)
};
f.pn = function (a) {
this.b && this.b.pn(a)
};
f.Wc = function () {
return this.g.Wc()
};
f.Db = function () {
return this.g.Db()
};
function lE(a) {
X.call(this, ["span"]);
this.element.innerHTML = a
}
w(lE, X);
function mE(a, b) {
X.call(this, ["span", "", "{{sparkline_container}}"]);
this.j = a;
this.g = b;
this.b = new lE("");
S(this, this.b);
iv(this.template, "sparkline_container", this.b)
}
w(mE, X);
function nE() {
X.call(this, ["div", "html5-video-info-panel", ["span", "html5-video-info-panel-close", {
role: "button",
title: "close"
}, "[x]"],
["div", "html5-video-info-panel-content", ["table", "html5-video-info-table", ["tr", "", ["th", "", "Video ID:"],
["td", "", "{{video_id}}"]
],
["tr", "", ["th", "", "Dimensions:"],
["td", "", "{{dimensions}}"]
],
["tr", "", ["th", "", "Resolution:"],
["td", "", "{{resolution}}"]
],
["tr", "", ["th", "", "Volume:"],
["td", "", "{{volume}}"]
],
["tr", "", ["th", "", "Stream Type:"],
["td", "", "{{stream_type}}"]
],
["tr", {
style: "{{cpn_style}}"
},
["th", "", "CPN:"],
["td", "", "{{cpn}}"]
],
["tr", "", ["th", "", "Mime Type:"],
["td", "", "{{mime}}"]
],
["tr", "", ["th", "", "DASH:"],
["td", "", "{{dash}}"]
],
["tr", {
style: "{{drm_style}}"
},
["th", "", "Protected:"],
["td", "", "{{drm}}"]
],
["tr", "", ["th", "", "Bandwidth:"],
["td", "", ["span", "", "{{bandwidth_sparkline}}"],
["span", "", "{{bandwidth_kbps}}"]
]
]
],
["table", ["html5-video-info-table", "html5-video-element-info-table"],
["tr", "", ["th", "", "Decoded Frames"],
["th", "", "Dropped Frames"],
["th", "",
"Parsed Frames"
],
["th", "", "Presented Frames"]
],
["tr", "", ["td", "", "{{decoded_frames}}"],
["td", "", "{{dropped_frames}}"],
["td", "", "{{parsed_frames}}"],
["td", "", "{{presented_frames}}"]
],
["tr", "", ["th", "", "Video Bytes Decoded"],
["th", "", "Audio Bytes Decoded"],
["th", "", "Painted Frames"],
["th", "", "Paint Delay"]
],
["tr", "", ["td", "", "{{video_bytes_decoded}}"],
["td", "", "{{audio_bytes_decoded}}"],
["td", "", "{{painted_frames}}"],
["td", "", "{{paint_delay}}"]
]
]
]
]);
this.g = this.template.b["html5-video-info-panel-close"];
this.b = new mE(200, 14);
S(this, this.b);
iv(this.template, "bandwidth_sparkline", this.b)
}
w(nE, X);
nE.prototype.update = function (a) {
a.dimensions = a.video_element_width + " x " + a.video_element_height;
1 < a.device_pixel_ratio && (a.dimensions += " * " + a.device_pixel_ratio);
a.resolution = a.video_width + " x " + a.video_height;
a.volume += "%";
a.drm_flavor ? (a.drm_style = "", a.drm = a.drm_flavor + " / " + a.drm_key_system) : (a.drm_style = "display:none", a.drm = "");
var b = a.bandwidth_history;
a.bandwidth_kbps = (8 * bb(b) / 1024).toFixed(0) + " Kbps";
for (var c = this.b, d = c.b, e = Math.max.apply(Math, b) || 1, g = [], h = 0; h < b.length; h++) g.push(h / b.length *
c.j + "," + c.g * (1 - b[h] / e));
b = '<svg width="' + c.j + '" height="' + c.g + '" viewbox="0 0 ' + c.j + " " + c.g + '"><g><polyline stroke="white" fill="none" points="' + g.join(" ") + '"/></g></svg>';
d.element.innerHTML = b;
a.cpn_style = a.cpn ? "" : "display:none";
this.template.update(a)
};
nE.prototype.J = function () {
this.g = null;
nE.G.J.call(this)
};
function oE(a) {
jE.call(this, ["div", "html5-video-player", {
tabindex: -1
}]);
this.app = a;
this.g = this.ib = null;
this.L = new ce(0, 0, 0, 0);
this.b = null;
this.ua = new ce(0, 0, 0, 0);
this.F = this.M = null;
this.Tb = this.zc = 0;
this.ja = null;
this.W = 0;
this.Aa = null;
a = a.R();
this.xc = io() || "blazer" == a.vb;
this.mb = 0;
this.o = null;
this.A = new kE;
this.bh()
}
w(oE, jE);
f = oE.prototype;
f.bh = function () {
this.app.subscribe("initializingmode", this.eE, this);
this.app.subscribe("videoplayerreset", this.gE, this);
this.app.subscribe("videodatachange", this.fE, this)
};
f.initialize = function (a) {
this.ib = Pc(a);
this.element.setAttribute("id", this.app.O.attrs.id);
cg(this.element, "version", this.app.O.assets.js);
this.element.style.display = "none";
this.X(this.ib);
Kd({
YTP_ADVERTISEMENT: "Werbung",
YTP_AUDIO_TRACK_TITLE: "Audiotrack",
YTP_AUTO: "Automatisch",
YTP_AUTO_WITH_QUALITY_2: "Automatisch ($VIDEO_QUALITY)",
YTP_CENTERED_PLAYER: "Zentrierter Player",
YTP_CHANGE_QUALITY_WITH_QUALITY_2: "Qualit\u00e4t ($VIDEO_QUALITY) \u00e4ndern",
YTP_COPY_DEBUG_INFO: "Debug-Informationen kopieren",
YTP_COPY_VIDEO_URL: "Video-URL kopieren",
YTP_COPY_VIDEO_URL_AT_TIME: "Video-URL an dieser Stelle kopieren",
YTP_GET_DEBUG_INFO: "Informationen zur Fehlerbehebung abrufen",
YTP_GET_VIDEO_URL: "Video-URL abrufen",
YTP_GET_VIDEO_URL_AT_TIME: "Video-URL f\u00fcr die aktuelle Wiedergabeposition abrufen",
YTP_GET_EMBED: "Einbettungscode abrufen",
YTP_DEFAULT_PLAYER: "Standardplayer",
YTP_DEFAULT_VIEW: "Default view",
YTP_EMBED_COPY: "Einbettungscode kopieren",
YTP_ERROR_GENERIC: "Ein Fehler ist aufgetreten, versuche es sp\u00e4ter erneut.",
YTP_ERROR_GENERIC_WITH_LINK_2: "Es ist ein Fehler aufgetreten. Versuche es bitte sp\u00e4ter noch einmal. $BEGIN_LINKWeitere Informationen$END_LINK",
YTP_EXIT_FULLSCREEN: "Vollbildmodus beenden",
YTP_FEATURED: "Angesagt",
YTP_FULLSCREEN: "Vollbild",
YTP_LARGE_PLAYER: "Gro\u00dfer Player",
YTP_MIX: "Mix",
YTP_MORE: "Mehr anzeigen",
YTP_MDX_TITLE: "Wiedergeben auf",
YTP_MDX_TOOLTIP: "Auf TV abspielen",
YTP_MDX_MY_COMPUTER: "Dieser Computer",
YTP_MUTE: "Stummschalten",
YTP_NEXT: "Weiter",
YTP_NORMAL_SPEED: "Standard",
YTP_ON: "Ein",
YTP_OFF: "Aus",
YTP_OPTIONS: "Optionen",
YTP_PLAY_ALL: "Alle ansehen",
YTP_PREVIOUS: "Vorheriges",
YTP_PLAYLIST: "Playlist",
YTP_PLAYLIST_UP_NEXT: "N\u00e4chstes Video",
YTP_QUALITY_TITLE: "Qualit\u00e4t",
YTP_REPLAY: "Nochmal",
YTP_REPORT_ISSUE: "Problem bei der Wiedergabe melden",
YTP_SETTINGS: "Einstellungen",
YTP_SHARE: "Teilen",
YTP_SHARE_WITH_PLAYLIST: "Mit Playlist teilen",
YTP_SHOW_VIDEO_INFO: "Statistiken f\u00fcr Computerfreaks",
YTP_SMALL_PLAYER: "Kleiner Player",
YTP_SPEED_TITLE: "Geschwindigkeit",
YTP_ST_COLLAPSE: "Minimieren",
YTP_ST_EXPAND: "Erweitern",
YTP_SUBTITLES: "Untertitel",
YTP_THEATER_MODE: "Theater mode",
YTP_UNMUTE: "Stummschaltung aufheben",
YTP_URL_NAVIGATE: "Auf YouTube ansehen",
YTP_WATCH_ALL: "Ganzes Video ansehen",
YTP_WATCH_LATER: "Sp\u00e4ter ansehen",
YTP_WATCH_LATER_AS_2: "Sp\u00e4ter als $USER_NAME ansehen",
YTP_SUBSCRIBE_AS: "Als $USER_NAME abonnieren",
YTP_LIKE_AS: "Als $USER_NAME positiv bewerten",
YTP_DISLIKE_AS: "Als $USER_NAME negativ bewerten",
YTP_WATCH_NEXT: "Videoempfehlung",
YTP_PLAY: "Wiedergabe",
YTP_WATERMARK: "Wasserzeichen",
YTP_ERROR_STREAMING_UNAVAILABLE: "Die Videowiedergabe ist derzeit nicht verf\u00fcgbar, weil das Video f\u00fcr die Offline-Wiedergabe heruntergeladen wurde.",
YTP_ERROR_LICENSE: "Bei diesem Video ist ein Lizenzierungsfehler aufgetreten.",
YTP_ERROR_VIDEO_NOT_FOUND: "Dieses Video konnte nicht gefunden werden.",
YTP_ERROR_ALREADY_PINNED_ON_A_DEVICE: "Dieses Video wurde bereits auf die maximale Anzahl an Ger\u00e4ten heruntergeladen, die durch den Inhaber des Urheberrechts genehmigt wurden. Bevor du das Video hier abspielen kannst, muss es von einem anderen Ger\u00e4t entfernt werden.",
YTP_ERROR_CANNOT_ACTIVATE_RENTAL: "Bei der Aktivierung deines Leihvideos ist ein Fehler aufgetreten. Bitte aktualisiere diese Seite oder versuche es sp\u00e4ter erneut.",
YTP_ERROR_PURCHASE_NOT_FOUND: "Dieses Video ist kostenpflichtig.",
YTP_ERROR_PURCHASE_REFUNDED: "Die Kaufkosten f\u00fcr dieses Videos wurden erstattet.",
YTP_ERROR_STOPPED_BY_ANOTHER_PLAYBACK: "Dein Konto gibt dieses Video an einem anderen Standort wieder. Aktualisiere diese Seite, um die Wiedergabe fortzusetzen.",
YTP_ERROR_TOO_MANY_STREAMS_PER_USER: "Die Wiedergabe wurde gestoppt, da zu viele Videos, die zum selben Konto geh\u00f6ren, abgespielt werden.",
YTP_ERROR_TOO_MANY_STREAMS_PER_ENTITLEMENT: "Die Wiedergabe wurde gestoppt, da dieses Video auf zu vielen Ger\u00e4ten abgespielt wurde.",
YTP_ERROR_STREAMING_DEVICES_QUOTA_PER_24H_EXCEEDED: "Es wurden innerhalb von 24 Stunden zu viele Ger\u00e4te/IP-Adressen verwendet.",
YTP_ERROR_UNUSUAL_ACTIVITY: "Aufgrund ungew\u00f6hnlicher Kontoaktivit\u00e4ten ist dieses Video derzeit nicht verf\u00fcgbar.",
YTP_ERROR_NOT_SIGNED_IN: "Melde dich an, um die Wiedergabe fortzusetzen.",
YTP_CLOSE: "Schlie\u00dfen",
YTP_ANNOTATIONS: "Anmerkungen",
YTP_DONE: "Fertig",
YTP_SHARE_THIS_PLAYLIST: "Diese Playlist teilen",
YTP_UPLOADED_BY_2: "von $AUTHOR",
YTP_PAUSE: "Pause",
YTP_AUTOPLAY: "Autoplay",
YTP_AUTOPLAY_COUNTDOWN_2: "N\u00e4chstes Video in $SECONDS_LEFT",
YTP_CANCEL: "Abbrechen",
YTP_ON_GOOGLE_PLUS: "Auf Google+",
YTP_STILL_THERE: "Bist du noch da? Klicke unten auf die Schaltfl\u00e4che, um mit der Wiedergabe der Playlist fortzufahren.",
YTP_DISMISS: "OK",
YTP_RESET: "Zur\u00fccksetzen",
YTP_STOP: "Livewiedergabe abbrechen",
YTP_LIKE: "Mag ich",
YTP_DISLIKE: "Mag ich nicht",
YTP_MORE_INFO: "Info",
YTP_SCREENREADER_VOLUME_SETTING: "Lautst\u00e4rke",
YTP_SCREENREADER_VOLUME_MUTED: "Stumm geschaltet",
YTP_SCREENREADER_VOLUME_MUTE: "Stumm schalten",
YTP_SCREENREADER_VOLUME_UNMUTE: "Stummschaltung aufheben",
YTP_SCREENREADER_CONTROL_TOGGLE: "Umschalten",
YTP_SAMPLE_SUBTITLES: "So werden die Untertitel mit der aktuellen Konfiguration aussehen.",
YTP_HTML5_CONTEXT_MENU_LINK: "\u00dcber den HTML5-Videoplayer",
YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK: "Dieses Videoformat wird nicht unterst\u00fctzt.",
YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK_WITH_LINK: "Dein Browser erkennt zurzeit keines der verf\u00fcgbaren Videoformate. $BEGIN_LINKKlicke hier, um unsere h\u00e4ufig gestellten Fragen zu HTML5-Videos aufzurufen.$END_LINK",
YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK_FLASH: "F\u00fcr die Videowiedergabe ist Adobe Flash Player erforderlich. $BEGIN_LINKHole dir den aktuellen Flash Player$END_LINK.",
YTP_ERROR_CAST_SESSION_DEVICE_MISMATCHED: "Das Ger\u00e4t in der Sitzung stimmt nicht mit dem erforderlichen Ger\u00e4t \u00fcberein.",
YTP_ERROR_CAST_SESSION_VIDEO_MISMATCHED: "Das Video in der Sitzung stimmt nicht mit dem erforderlichen Video \u00fcberein.",
YTP_ERROR_CAST_TOKEN_EXPIRED: "Die Sitzung ist abgelaufen. Bitte aktualisiere die Seite.",
YTP_ERROR_CAST_TOKEN_FAILED: "Die Sitzung ist nicht verf\u00fcgbar. Bitte aktualisiere die Seite oder versuche es sp\u00e4ter erneut.",
YTP_ERROR_CAST_TOKEN_MALFORMED: "Ung\u00fcltige Sitzung. Bitte aktualisiere die Seite oder versuche es sp\u00e4ter erneut.",
YTP_ERROR_GEO_FAILURE: "Dieses Video ist in deinem Land nicht verf\u00fcgbar.",
YTP_ERROR_INVALID_DRM_MESSAGE: "Die f\u00fcr das DRM-System spezifische Nachricht ist ung\u00fcltig.",
YTP_ERROR_RENTAL_EXPIRED: "Die Leihdauer f\u00fcr dieses Video ist abgelaufen.",
YTP_ERROR_RETRYABLE_ERROR: "Ein vor\u00fcbergehender Serverfehler ist aufgetreten. Bitte versuche es sp\u00e4ter erneut.",
YTP_ERROR_SERVER_ERROR: "Ein interner Serverfehler ist aufgetreten. Bitte versuche es sp\u00e4ter erneut.",
YTP_ERROR_STREAMING_NOT_ALLOWED: "Die Wiedergabe ist nicht gestattet, da dieses Video mit einem anderen Ger\u00e4t verbunden ist.",
YTP_ERROR_UNSUPPORTED_DEVICE: "Die Wiedergabe wird auf diesem Ger\u00e4t nicht unterst\u00fctzt.",
YTP_ERROR_VIDEO_FORBIDDEN: "Der Zugriff auf dieses Video ist nicht zul\u00e4ssig.",
YTP_MDX_STATUS_CONNECTED: "Wiedergabe auf",
YTP_MDX_STATUS_CONNECTING: "Wird verbunden mit",
YTP_MDX_STATUS_ERROR: "Fehler auf",
YTP_MDX_PLAYER_ERROR: "Dieses Video ist nicht f\u00fcr die Remote-Wiedergabe verf\u00fcgbar.",
YTP_MDX_PLAYER_RECONNECT_TIME: "Bitte pr\u00fcfe deine Internetverbindung. Erneuter Versuch in $FORMATTED_TIME...",
YTP_MDX_PLAYER_RECONNECT_BUTTON: "Erneut verbinden",
YTP_DEVICE_FALLBACK: "Leider ist das Video auf diesem Ger\u00e4t nicht verf\u00fcgbar.",
YTP_AD_RESUME_MESSAGE: "Dein Video wird nach der folgenden Anzeige fortgesetzt.",
YTP_VISIT_ADVERTISERS_SITE: "Zur Website des Werbetreibenden"
});
this.Os()
};
f.Os = function () {
this.I("templateready")
};
f.eE = function () {
this.ua = new ce(0, 0, 0, 0);
this.L = new ce(0, 0, 0, 0)
};
f.addClass = function (a) {
$f(this.element, arguments)
};
f.removeClass = function (a) {
ag(this.element, arguments)
};
f.Ng = function () {
this.hm();
var a = this.app.R();
this.addClass("el-" + a.ba);
this.addClass("ps-" + a.vb);
Q(this.element, "html5-native-controls", a.Wb);
Q(this.element, "html5-mobile", a.Vb);
a.Xd || this.addClass("html5-chromeless");
a.Xb || this.addClass("tag-pool-enabled");
this.element.style.display = "";
a = new dv(["div", "html5-video-container"]);
S(this, a);
a.X(this.element);
this.g = a.K();
this.M = new dv(["div", "html5-video-content"]);
S(this, this.M);
this.M.X(this.g);
a = new dv(["div", "html5-video-controls"]);
S(this, a);
a.X(this.element);
this.F = a.K();
this.o = new nE;
this.o.X(this.element);
vy(this, this.o.g, "click", this.rm);
S(this, this.o);
this.xc ? this.ja = R(window, "resize", t(this.oh, this)) : (a = Iy() ? t(this.EB, this) : t(this.oh, this), this.ja = Hd(a, 250))
};
f.Fj = function (a) {
a ? sy(this.F) : ty(this.F)
};
f.EB = function () {
this.W && Ly(this.W);
this.W = Ky(t(this.oh, this), 0)
};
f.oh = function () {
Jb(this.Db(), fe(this.L)) || this.Rf()
};
f.Rf = function () {
if (this.b) {
var a = this.Db();
if (!a.isEmpty()) {
var b, c = pE(this),
d = this.Db();
b = 1;
var e = qE(this),
g = !1,
h;
e ? (h = rE(this, d, c, e, !1), b = sE(new G(h.width, h.height)) / sE(c), h = new ce(h.left + h.width / 2 * (1 - 1 / b), h.top, h.width / b, h.height)) : h = new ce(0, 0, d.width, d.height);
ee(this.ua, h) || (this.ua = h, ze(this.b, fe(h)), oe(this.b, new E(h.left, h.top)), g = !0);
c = rE(this, d, c, e);
ee(this.L, c) || (this.L = c, ze(this.M.K(), c.width, c.height), oe(this.M.K(), c.left, c.top), g = !0);
kx(this.b, "transform", 1 == b ? "none" : "scaleX(" + b + ")");
b = g;
if (g = !Jb(a, fe(this.L))) this.L.width = a.width, this.L.height = a.height, this.cn(a);
(b || g) && this.I("resize")
}
}
};
f.cn = function () {};
f.Ml = function () {};
f.fE = function (a, b) {
this.zj(b)
};
f.gE = function (a) {
a.getVideoData() && this.zj(a.getVideoData())
};
f.zj = function (a) {
this.b && (this.b.setAttribute("data-youtube-id", a.videoId), Uq && (a.title ? this.b.setAttribute("title", a.title) : this.b.removeAttribute("title")), a.Bm && (this.b.poster = a.Bm));
var b = Er(a, "yt:bgcolor");
this.g.style.backgroundColor = b ? b : "";
this.zc = $p(Er(a, "yt:stretch"));
a = Er(a, "yt:crop");
this.Tb = "fullwidth" == a ? Infinity : $p(a)
};
f.mh = function () {};
f.Em = function () {};
f.Wc = function () {
return this.element ? new G(this.element.clientWidth, this.element.clientHeight) : new G(0, 0)
};
f.Db = function () {
return this.g ? new G(this.g.clientWidth, this.g.clientHeight) : new G(0, 0)
};
f.xs = function () {
return this.Db()
};
function CD(a) {
return a.b ? new G(a.b.clientWidth, a.b.clientHeight) : new G(0, 0)
}
function pE(a) {
return a.b ? new G(a.b.videoWidth, a.b.videoHeight) : new G(0, 0)
}
function tE(a) {
return rE(a, a.Db(), pE(a), qE(a), void 0)
}
function rE(a, b, c, d, e) {
c.isEmpty() ? d = b : d ? (c = a.zc || sE(c), a = a.Tb || c, d = sE(b), d = a > d ? new G(b.width, b.width / (isFinite(a) ? a : c)) : a < d ? new G(b.height * a, b.height) : b.clone(), e || (c > a ? d.width = d.height * c : c < a && (d.height = d.width / c))) : (e = c.clone(), d = e.scale(Kb(e) > Kb(b) ? b.width / e.width : b.height / e.height));
return new ce((b.width - d.width) / 2, (b.height - d.height) / 2, d.width, d.height)
}
function sE(a) {
var b = 16 / 9;
return 1 > Math.abs(b * a.height - a.width) || 1 > Math.abs(b / a.width - a.height) ? b : Kb(a)
}
function qE(a) {
return !a.app.R().Wb && !pE(a).isEmpty()
}
f.jk = function () {};
function Ls(a) {
a.o && (a.o.show(), a.Hs(), Id(a.mb), a.mb = Hd(t(a.Hs, a), 500))
}
f.Hs = function () {
var a = us(this.app),
b = this.app.getVideoData(),
c = this.app.ng(),
d = this.b,
e = this.app.R(),
g = b.videoId,
h = d.videoWidth,
k = d.videoHeight,
l = d.clientWidth,
d = d.clientHeight,
q = window.devicePixelRatio,
s = Math.round(this.app.C.volume),
u;
t: {
if (b.Be && (u = b.Be.match(/url=(https?)/)) && 2 == u.length) {
u = u[1];
break t
}
u = ""
}
u = u || e.protocol;
var z = this.app;
if (z.va) {
var F = [];
z.va.N.forEach(t(F.push, F));
z = F
} else z = [0];
c = {
video_id: g,
video_width: h,
video_height: k,
video_element_width: l,
video_element_height: d,
device_pixel_ratio: q,
cpn: "",
mime: "",
dash: "no",
drm_flavor: "",
drm_key_system: "",
volume: s,
stream_type: u,
bandwidth_history: z,
decoded_frames: c.hmewdfc || c.hmemdf || "-",
dropped_frames: c.hmewdrop || "-",
parsed_frames: c.hmempf || "-",
presented_frames: c.hmempresented || "-",
video_bytes_decoded: c.hmewvdbc || "-",
audio_bytes_decoded: c.hmewadbc || "-",
painted_frames: c.hmempainted || "-",
paint_delay: c.hmempaintdelay || "-"
};
b.b && (g = b.b, c.dash = g.b && g.Wa ? "no" : "yes", c.mime = b.b.xd);
if (a = a.C ? a.C.b : null) c.drm_flavor = a.g, c.drm_key_system = a.b;
"TVHTML5" ==
e.ye && (c.cpn = b.Ea);
this.o.update(c)
};
f.rm = function (a) {
a && a.stopPropagation();
this.o && (Id(this.mb), this.o.hide())
};
f.hm = function () {
this.A.g = this
};
f.J = function () {
this.ja && (this.xc ? yg(this.ja) : Id(this.ja), this.W && Ly(this.W));
this.Aa && yg(this.Aa);
this.rm();
this.o && Bg(this.o.g);
this.F = this.M = this.b = this.g = this.ib = null;
oE.G.J.call(this)
};
function uE(a) {
X.call(this, ["div", "ytp-dialog-holder", "{{content}}"]);
this.g = a;
this.b = null
}
w(uE, X);
uE.prototype.show = function () {
uE.G.show.call(this);
vE(this)
};
function vE(a) {
if (a.b) {
a.b.A();
var b = a.g.Wc(),
c = Be(a.b.K());
a = a.b;
b = new E(Math.floor((b.width - c.width) / 2), Math.floor((b.height - c.height) / 2));
a.K().style.marginLeft = b.x + "px";
a.K().style.marginTop = b.y + "px"
}
}
uE.prototype.J = function () {
this.b = null;
uE.G.J.call(this)
};
function wE(a, b) {
X.call(this, ["canvas"]);
this.element.width = a;
this.element.height = b;
this.width = a;
this.height = b;
this.context = this.element.getContext("2d");
this.b = 0;
this.o = null
}
w(wE, X);
wE.prototype.j = function (a, b) {
K(this.b);
this.context && (this.b = uy(t(this.j, this, a, b), b), a.call(this, new Date - this.o))
};
wE.prototype.J = function () {
K(this.b);
this.context = null;
wE.G.J.call(this)
};
function xE(a, b) {
wE.call(this, a, b);
this.A = null;
this.B = this.C = this.k = this.g = 0;
O(this.element, "ytp-tv-static");
yE(this, a, b)
}
w(xE, wE);
function zE(a) {
for (var b = Math.floor(.6 * a), c = b; c < a; ++c) {
for (var d = !1, e = 2; e < Math.sqrt(c); e++) {
if (!(c % e)) {
d = !1;
break
}
d = !0
}
if (d) return c
}
return b
}
function yE(a, b, c) {
if (b && c) {
a.width = a.element.width = b;
a.height = a.element.height = c;
var d = document.createElement("canvas");
d.width = b;
d.height = c;
for (var e = d.getContext("2d"), g = e.getImageData(0, 0, b, c), h = b * c, k = 0; k < h; k++) {
var l = 4 * k;
g.data[l] = g.data[l + 1] = g.data[l + 2] = Math.floor(35 * Math.random());
g.data[l + 3] = 255
}
e.putImageData(g, 0, 0);
a.A = d;
a.C = zE(b);
a.B = zE(c / 10);
a.context.scale(1.5, 1.5)
}
}
xE.prototype.show = function () {
xE.G.show.call(this);
var a = this.D;
this.o = new Date;
this.j(a, 75)
};
xE.prototype.D = function () {
var a = 1 - 1 / 1.5;
this.g = (this.g + this.C) % (this.width * a);
this.k = (this.k + this.B) % (this.height * a);
this.context.drawImage(this.A, -1 * this.g, -1 * this.k)
};
xE.prototype.hide = function () {
K(this.b);
xE.G.hide.call(this)
};
function AE() {
X.call(this, ["div", ["ytp-error", "html5-stop-propagation"],
["div", "ytp-error-content", ["div", "ytp-error-content-wrap", "{{content}}"]]
]);
this.$ = "table";
this.g = [];
if (void 0 == Mp) {
var a = document.createElement("canvas");
Mp = !(!a.getContext || !a.getContext("2d"))
}
Mp && (this.b = new xE(1, 1), this.b.X(this.element, 0), S(this, this.b))
}
w(AE, X);
AE.prototype.show = function () {
AE.G.show.call(this);
BE(this);
this.b && this.b.show()
};
AE.prototype.hide = function () {
AE.G.hide.call(this);
this.b && this.b.hide()
};
function BE(a) {
a.b && yE(a.b, a.element.clientWidth, a.element.clientHeight)
}
AE.prototype.J = function () {
yg(this.g);
this.g = [];
AE.G.J.call(this)
};
function CE(a, b) {
var c = ["ytp-large-play-button", "html5-center-overlay", "ytp-scalable-icon-shrink"],
d;
b && c.push("ytp-housebrand-large-play-button");
a ? b ? c.push("ytp-housebrand-large-play-button-image") : c.push("ytp-large-play-button-image") : d = b ? '<svg><path fill-rule="evenodd" clip-rule="evenodd" fill="#1F1F1F" class="ytp-housebrand-large-play-button-svg" d="M59.6,1.35c0.267,0.5,0.4,1.133,0.4,1.9v53.5c0,0.767-0.133,1.4-0.4,1.9c-0.5,0.9-1.45,1.35-2.85,1.35H3.25c-1.4,0-2.333-0.433-2.8-1.3C0.15,58.167,0,57.517,0,56.75V3.25c0-0.833,0.167-1.5,0.5-2C1,0.417,1.917,0,3.25,0h53.5C58.15,0,59.1,0.45,59.6,1.35z M21,41.65l22.7-11.8L21,18V41.65z"/><polygon fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" points="21,41.65 21,18 43.7,29.85"/></svg>' :
'<svg><path fill-rule="evenodd" clip-rule="evenodd" fill="#1F1F1F" class="ytp-large-play-button-svg" d="M84.15,26.4v6.35c0,2.833-0.15,5.967-0.45,9.4c-0.133,1.7-0.267,3.117-0.4,4.25l-0.15,0.95c-0.167,0.767-0.367,1.517-0.6,2.25c-0.667,2.367-1.533,4.083-2.6,5.15c-1.367,1.4-2.967,2.383-4.8,2.95c-0.633,0.2-1.316,0.333-2.05,0.4c-0.767,0.1-1.3,0.167-1.6,0.2c-4.9,0.367-11.283,0.617-19.15,0.75c-2.434,0.034-4.883,0.067-7.35,0.1h-2.95C38.417,59.117,34.5,59.067,30.3,59c-8.433-0.167-14.05-0.383-16.85-0.65c-0.067-0.033-0.667-0.117-1.8-0.25c-0.9-0.133-1.683-0.283-2.35-0.45c-2.066-0.533-3.783-1.5-5.15-2.9c-1.033-1.067-1.9-2.783-2.6-5.15C1.317,48.867,1.133,48.117,1,47.35L0.8,46.4c-0.133-1.133-0.267-2.55-0.4-4.25C0.133,38.717,0,35.583,0,32.75V26.4c0-2.833,0.133-5.95,0.4-9.35l0.4-4.25c0.167-0.966,0.417-2.05,0.75-3.25c0.7-2.333,1.567-4.033,2.6-5.1c1.367-1.434,2.967-2.434,4.8-3c0.633-0.167,1.333-0.3,2.1-0.4c0.4-0.066,0.917-0.133,1.55-0.2c4.9-0.333,11.283-0.567,19.15-0.7C35.65,0.05,39.083,0,42.05,0L45,0.05c2.467,0,4.933,0.034,7.4,0.1c7.833,0.133,14.2,0.367,19.1,0.7c0.3,0.033,0.833,0.1,1.6,0.2c0.733,0.1,1.417,0.233,2.05,0.4c1.833,0.566,3.434,1.566,4.8,3c1.066,1.066,1.933,2.767,2.6,5.1c0.367,1.2,0.617,2.284,0.75,3.25l0.4,4.25C84,20.45,84.15,23.567,84.15,26.4z M33.3,41.4L56,29.6L33.3,17.75V41.4z"/><polygon fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" points="33.3,41.4 33.3,17.75 56,29.6"/></svg>';
X.call(this, ["div", c]);
d && (this.element.innerHTML = d)
}
w(CE, X);
function DE(a) {
this.g = a || 1;
wE.call(this, 30 * this.g, 30 * this.g);
this.A = this.width / 2;
this.k = this.height / 2;
this.B = 0;
this.context.translate(this.A, this.k);
this.hide()
}
w(DE, wE);
DE.prototype.show = function () {
DE.G.show.call(this);
var a = this.C;
this.o = new Date;
this.j(a, 125)
};
DE.prototype.C = function () {
this.context.clearRect(-this.A, -this.k, this.width, this.height);
for (var a = this.B++ % 8, b = 0; 8 > b; b++) {
var c = 2 * Math.PI / 8 * (a + b),
d = 11 * this.g * Math.cos(c),
c = 11 * this.g * Math.sin(c),
e = (b + 1) / 9;
this.context.beginPath();
this.context.arc(d, c, 4 * this.g, 0, 2 * Math.PI, !1);
this.context.fillStyle = "rgba(189, 189, 189, " + e + ")";
this.context.fill()
}
};
DE.prototype.hide = function () {
K(this.b);
DE.G.hide.call(this)
};
function EE(a) {
X.call(this, ["div", "ytp-thumbnail"]);
this.b = a
}
w(EE, X);
EE.prototype.show = function (a) {
if (a || this.element.childNodes.length) {
if (a) {
fd(this.element);
var b = this.element,
c = this.b;
if (null != jx("backgroundSize")) {
if (d = document.createElement("div"), b = UA(b, a, c)) d.style.backgroundImage = "url(" + b + ")"
} else {
var d = document.createElement("img");
d.src = UA(b, a, c);
a = d;
b.clientWidth / b.clientHeight < TA ? (a.style.height = "100%", a.style.width = "auto") : (a.style.height = "auto", a.style.width = "100%")
}
O(d, "video-thumbnail");
this.element.appendChild(d)
}
EE.G.show.call(this)
}
};
function FE(a, b, c, d, e, g, h) {
var k, l;
if (k = c.offsetParent) {
var q = "HTML" == k.tagName || "BODY" == k.tagName;
q && "static" == ne(k, "position") || (l = ue(k), q || (q = (q = ve(k)) && pc ? -k.scrollLeft : !q || oc && zc("8") || "visible" == ne(k, "overflowX") ? k.scrollLeft : k.scrollWidth - k.clientWidth - k.scrollLeft, l = Ib(l, new E(q, k.scrollTop))))
}
k = l || new E;
l = Ee(a);
if (q = te(a)) {
var s = de(q),
q = Math.max(l.left, s.left),
u = Math.min(l.left + l.width, s.left + s.width);
if (q <= u) {
var z = Math.max(l.top, s.top),
s = Math.min(l.top + l.height, s.top + s.height);
z <= s && (l.left =
q, l.top = z, l.width = u - q, l.height = s - z)
}
}
q = Mc(a);
z = Mc(c);
if (q.b != z.b) {
var u = q.b.body,
z = zd(z),
s = new E(0, 0),
F = Yc(Oc(u)),
L = u;
do {
var ba = F == z ? ue(L) : we(L);
s.x += ba.x;
s.y += ba.y
} while (F && F != z && (L = F.frameElement) && (F = F.parent));
u = Ib(s, ue(u));
oc && !yd(q) && (u = Ib(u, Ad(q)));
l.left += u.x;
l.top += u.y
}
a = GE(a, b);
b = new E(a & 2 ? l.left + l.width : l.left, a & 1 ? l.top + l.height : l.top);
b = Ib(b, k);
e && (b.x += (a & 2 ? -1 : 1) * e.x, b.y += (a & 1 ? -1 : 1) * e.y);
var kb;
h && (kb = te(c)) && (kb.top -= k.y, kb.right -= k.x, kb.bottom -= k.y, kb.left -= k.x);
return HE(b, c, d, g, kb,
h, void 0)
}
function HE(a, b, c, d, e, g, h) {
a = a.clone();
var k = 0,
l = GE(b, c);
c = Ce(b);
h = h ? h.clone() : c.clone();
if (d || 0 != l) l & 2 ? a.x -= h.width + (d ? d.right : 0) : d && (a.x += d.left), l & 1 ? a.y -= h.height + (d ? d.bottom : 0) : d && (a.y += d.top);
if (g && (e ? (k = a, d = 0, 65 == (g & 65) && (k.x < e.left || k.x >= e.right) && (g &= -2), 132 == (g & 132) && (k.y < e.top || k.y >= e.bottom) && (g &= -5), k.x < e.left && g & 1 && (k.x = e.left, d |= 1), k.x < e.left && k.x + h.width > e.right && g & 16 && (h.width = Math.max(h.width - (k.x + h.width - e.right), 0), d |= 4), k.x + h.width > e.right && g & 1 && (k.x = Math.max(e.right - h.width, e.left),
d |= 1), g & 2 && (d = d | (k.x < e.left ? 16 : 0) | (k.x + h.width > e.right ? 32 : 0)), k.y < e.top && g & 4 && (k.y = e.top, d |= 2), k.y <= e.top && k.y + h.height < e.bottom && g & 32 && (h.height = Math.max(h.height - (e.top - k.y), 0), k.y = e.top, d |= 8), k.y >= e.top && k.y + h.height > e.bottom && g & 32 && (h.height = Math.max(h.height - (k.y + h.height - e.bottom), 0), d |= 8), k.y + h.height > e.bottom && g & 4 && (k.y = Math.max(e.bottom - h.height, e.top), d |= 2), g & 8 && (d = d | (k.y < e.top ? 64 : 0) | (k.y + h.height > e.bottom ? 128 : 0)), k = d) : k = 256, k & 496)) return k;
oe(b, a);
Jb(c, h) || (a = Oc(b), e = yd(Mc(a)), !oc || e &&
zc("8") ? (b = b.style, pc ? b.MozBoxSizing = "border-box" : qc ? b.WebkitBoxSizing = "border-box" : b.boxSizing = "border-box", b.width = Math.max(h.width, 0) + "px", b.height = Math.max(h.height, 0) + "px") : (a = b.style, e ? (oc ? (e = Ie(b, "paddingLeft"), c = Ie(b, "paddingRight"), g = Ie(b, "paddingTop"), d = Ie(b, "paddingBottom"), e = new be(g, c, d, e)) : (e = me(b, "paddingLeft"), c = me(b, "paddingRight"), g = me(b, "paddingTop"), d = me(b, "paddingBottom"), e = new be(parseFloat(g), parseFloat(c), parseFloat(d), parseFloat(e))), b = Le(b), a.pixelWidth = h.width - b.left - e.left -
e.right - b.right, a.pixelHeight = h.height - b.top - e.top - e.bottom - b.bottom) : (a.pixelWidth = h.width, a.pixelHeight = h.height)));
return k
}
function GE(a, b) {
return (b & 4 && ve(a) ? b ^ 2 : b) & -5
};
var IE = {},
JE = "ontouchstart" in document;
function KE(a, b, c) {
var d;
switch (a) {
case "mouseover":
case "mouseout":
d = 3;
break;
case "mouseenter":
case "mouseleave":
d = 9
}
return wd(c, function (a) {
return Zf(a, b)
}, !0, d)
}
function LE(a) {
var b = "mouseover" == a.type && "mouseenter" in IE || "mouseout" == a.type && "mouseleave" in IE,
c = a.type in IE || b;
if ("HTML" != a.target.tagName && c) {
if (b) {
var b = "mouseover" == a.type ? "mouseenter" : "mouseleave",
c = IE[b],
d;
for (d in c.fc) {
var e = KE(b, d, a.target);
e && !wd(a.relatedTarget, function (a) {
return a == e
}, !0) && c.I(d, e, b, a)
}
}
if (b = IE[a.type])
for (d in b.fc)(e = KE(a.type, d, a.target)) && b.I(d, e, a.type, a)
}
}
R(document, "blur", LE, !0);
R(document, "change", LE, !0);
R(document, "click", LE);
R(document, "focus", LE, !0);
R(document, "mouseover", LE);
R(document, "mouseout", LE);
R(document, "mousedown", LE);
R(document, "keydown", LE);
R(document, "keyup", LE);
R(document, "keypress", LE);
R(document, "cut", LE);
R(document, "paste", LE);
JE && (R(document, "touchstart", LE), R(document, "touchend", LE), R(document, "touchcancel", LE));
function ME() {
this.o = {};
this.A = []
}
ME.prototype.md = function (a) {
return xd(a, Z(this))
};
function Z(a, b) {
return "yt-uix" + (a.Td ? "-" + a.Td : "") + (b ? "-" + b : "")
}
function NE(a, b, c) {
b = uh(b, c, a);
a.A.push(b)
}
function OE(a, b, c, d) {
d = Z(a, d);
var e = t(c, a);
b in IE || (IE[b] = new oh);
IE[b].subscribe(d, e);
a.o[c] = e
}
ME.prototype.b = function (a, b, c) {
var d = this.Y(a, b);
if (d && (d = p(d))) {
var e = vb(arguments, 2);
ub(e, 0, 0, a);
d.apply(null, e)
}
};
ME.prototype.Y = function (a, b) {
return eg(a, b)
};
function PE(a, b) {
cg(a, "tooltip-text", b)
}
ME.prototype.removeData = function (a, b) {
fg(a, b)
};
function QE() {
ME.call(this)
}
w(QE, ME);
ea(QE);
f = QE.prototype;
f.Td = "tooltip";
f.Rj = 0;
f.register = function () {
OE(this, "mouseover", this.ht);
OE(this, "mouseout", this.On);
OE(this, "click", this.On);
OE(this, "touchstart", this.RD);
OE(this, "touchend", this.kt);
OE(this, "touchcancel", this.kt)
};
f.ht = function (a) {
if (!(this.Rj && 1E3 > v() - this.Rj)) {
var b = parseInt(this.Y(a, "tooltip-hide-timer"), 10);
b && (this.removeData(a, "tooltip-hide-timer"), K(b));
var b = t(function () {
RE(this, a);
this.removeData(a, "tooltip-show-timer")
}, this),
c = parseInt(this.Y(a, "tooltip-show-delay"), 10) || 0,
b = J(b, c);
cg(a, "tooltip-show-timer", b.toString());
a.title && (PE(a, SE(this, a)), a.title = "")
}
};
f.On = function (a) {
var b = parseInt(this.Y(a, "tooltip-show-timer"), 10);
b && (K(b), this.removeData(a, "tooltip-show-timer"));
b = t(function () {
TE(this, a);
this.removeData(a, "tooltip-hide-timer")
}, this);
b = J(b, 50);
cg(a, "tooltip-hide-timer", b.toString());
if (b = this.Y(a, "tooltip-text")) a.title = b
};
f.RD = function (a, b, c) {
this.Rj = 0;
a = KE(b, Z(this), c.changedTouches[0].target);
this.ht(a)
};
f.kt = function (a, b, c) {
this.Rj = v();
a = KE(b, Z(this), c.changedTouches[0].target);
this.On(a)
};
function UE(a, b, c) {
PE(b, c);
a = a.Y(b, "content-id");
if (a = Pc(a)) a.innerHTML = c
}
function SE(a, b) {
return a.Y(b, "tooltip-text") || b.title
}
function RE(a, b) {
if (b) {
var c = SE(a, b);
if (c) {
var d = Pc(VE(a, b));
if (!d) {
d = document.createElement("div");
d.id = VE(a, b);
d.className = Z(a, "tip");
var e = document.createElement("div");
e.className = Z(a, "tip-body");
var g = document.createElement("div");
g.className = Z(a, "tip-arrow");
var h = document.createElement("div");
h.className = Z(a, "tip-content");
var k = WE(a, b),
l = VE(a, b, "content");
h.id = l;
cg(b, "content-id", l);
e.appendChild(h);
k && d.appendChild(k);
d.appendChild(e);
d.appendChild(g);
(Eg() || document.body).appendChild(d);
UE(a, b, c);
(c = parseInt(a.Y(b, "tooltip-max-width"), 10)) && e.offsetWidth > c && (e.style.width = c + "px", O(h, Z(a, "normal-wrap")));
h = Zf(b, Z(a, "reverse"));
XE(a, b, d, e, k, h) || XE(a, b, d, e, k, !h);
var q = Z(a, "tip-visible");
J(function () {
O(d, q)
}, 0)
}
}
}
}
function XE(a, b, c, d, e, g) {
Q(c, Z(a, "tip-reverse"), g);
var h = 0;
g && (h = 1);
var k = Ce(b);
g = new E((k.width - 10) / 2, g ? k.height : 0);
var l = ue(b);
HE(new E(l.x + g.x, l.y + g.y), c, h);
var l = Uc(window),
q = ye(c);
c = Ce(d);
var s = Math.floor(c.width / 2),
h = !!(l.height < q.y + k.height),
k = !!(q.y < k.height);
g = !!(q.x < s);
l = !!(l.width < q.x + s);
q = (c.width + 3) / -2 - -5;
a = a.Y(b, "force-tooltip-direction");
if ("left" == a || g) q = -5;
else if ("right" == a || l) q = 20 - c.width - 3;
a = Math.floor(q) + "px";
d.style.left = a;
e && (e.style.left = a, e.style.height = c.height + "px", e.style.width =
c.width + "px");
return !(h || k)
}
function TE(a, b) {
if (b) {
var c = Pc(VE(a, b));
c && (YE(c), hd(c), a.removeData(b, "content-id"))
}
}
function VE(a, b, c) {
a = Z(a) + hg(b);
c && (a += "-" + c);
return a
}
function WE(a, b) {
var c = null;
ic && Zf(b, Z(a, "masked")) && ((c = Pc("yt-uix-tooltip-shared-mask")) ? (c.parentNode.removeChild(c), gx(c)) : (c = document.createElement("iframe"), c.src = 'javascript:""', c.id = "yt-uix-tooltip-shared-mask", c.className = Z(a, "tip-mask")));
return c
}
function YE(a) {
var b = Pc("yt-uix-tooltip-shared-mask"),
c = b && wd(b, function (b) {
return b == a
}, !1, 2);
b && c && (b.parentNode.removeChild(b), hx(b), document.body.appendChild(b))
};
function ZE(a, b) {
ag(a, ["html5-async-progress", "html5-async-success", "html5-async-error"]);
b && O(a, b);
TE(QE.getInstance(), a)
};
function $E(a) {
mA.call(this);
this.j = null;
this.g = new JB(a, t(this.k, this), t(this.B, this));
S(this, this.g);
this.b = Y(0, "YTP_AUDIO_TRACK_TITLE");
this.element = new CB(a, void 0, this.g);
S(this, this.element);
EB(this.element, 100);
this.priority = 0;
this.o = !0
}
w($E, mA);
function aF(a, b) {
a.j != b && (a.j = b, MB(a.g, b), a.element.k(a.k(b)))
}
$E.prototype.k = function (a) {
return a.name
};
$E.prototype.B = function (a) {
this.element.j();
aF(this, a);
this.element.Fb("change")
};
function bF(a) {
this.gb = a;
this.kf = 0;
this.La = new zv(this);
cF(this, "focusin", "focusout", 1, this.gb);
cF(this, "mouseover", "mouseout", 2, this.gb);
cF(this, "mousedown", "mouseup", 4, document)
}
function cF(a, b, c, d, e) {
function g() {
this.kf |= d;
Q(this.gb, "ytp-block-autohide", !!this.kf);
this.La.Ja(h);
h = this.La.listen(e, c, k)
}
var h, k;
k = function () {
this.kf &= ~d;
Q(this.gb, "ytp-block-autohide", !!this.kf);
this.La.Ja(h);
h = this.La.listen(this.gb, b, g)
};
h = a.La.listen(a.gb, b, g)
}
bF.prototype.J = function () {
this.kf && P(this.gb, "ytp-block-autohide");
this.La.removeAll();
bF.G.J.call(this)
};
function dF(a) {
nA.call(this, a);
qA(this, 6900);
eF(this)
}
w(dF, nA);
function eF(a) {
oA(a, "ytp-button-fullscreen-enter");
var b = Y(0, "YTP_FULLSCREEN");
pA(a, b);
a.g = b
};
function fF(a, b) {
X.call(this, ["div", ["ytp-menu-container", "html5-stop-propagation"], {
tabindex: -1
},
["div", "ytp-menu", ["div", "ytp-menu-content", "{{content}}"]]
]);
this.k = a;
this.j = b || !1;
this.b = [];
this.g = [];
this.stopPropagation("click")
}
w(fF, X);
fF.prototype.add = function (a) {
for (var b = this.b.length, c = 0; c < this.b.length; c++) {
if (this.b[c] == a) return;
if (c < b && this.b[c].priority < a.priority) {
b = c;
break
}
}
ub(this.b, b, 0, a);
gF(this)
};
fF.prototype.remove = function (a) {
ob(this.b, a);
gF(this)
};
function gF(a) {
nh(a.g);
a.g = [];
var b, c, d = [],
e = 1 == a.b.length || a.j;
e && a.b.length && (c = new X(["div", "ytp-menu-row", ["div", "ytp-menu-cell", a.b[0].b]]), d.push(c));
var g = !1;
for (b = 0; b < a.b.length; b++) g = g || a.b[b].C;
var h = g ? ["ytp-menu-cell", "ytp-menu-cell-span"] : "ytp-menu-cell";
for (b = 0; b < a.b.length; b++) {
var k = a.b[b];
c = k.o;
c = e ? !g || c ? new X(["div", "ytp-menu-row", ["div", h, "{{content}}"]]) : new X(["div", "ytp-menu-row", ["div", "ytp-menu-cell", "{{content}}"],
["div", "ytp-menu-cell", "{{more}}"]
]) : !g || k.o ? new X(["div", "ytp-menu-row", ["div", ["ytp-menu-cell", "ytp-menu-title"], k.b],
["div", h, "{{content}}"]
]) : new X(["div", "ytp-menu-row", ["div", ["ytp-menu-cell", "ytp-menu-title"], k.b],
["div", "ytp-menu-cell", "{{content}}"],
["div", "ytp-menu-cell", "{{more}}"]
]);
c.na(k.element);
c.na(hF(a, k), "more");
d.push(c)
}
a.na(d)
}
function hF(a, b) {
if (b.C) {
var c = Y(0, "YTP_OPTIONS"),
d = new nA(a.k, "ytp-menu-more-options", c);
qA(d, 2700);
d.na(c);
a.g.push(d);
d.listen("click", b.N, b);
return d
}
return null
}
fF.prototype.J = function () {
this.b = [];
gF(this);
fF.G.J.call(this)
};
function iF(a) {
nA.call(this, a);
qA(this, 6E3);
jF(this)
}
w(iF, nA);
function jF(a) {
oA(a, "ytp-button-play");
var b = Y(0, "YTP_PLAY");
pA(a, b)
};
function kF(a) {
X.call(this, ["div", "ytp-playlist-controls", "{{content}}"]);
this.g = new nA(a, "ytp-button-prev", Y(0, "YTP_PREVIOUS"), Y(0, "YTP_PREVIOUS"));
S(this, this.g);
qA(this.g, 6050);
this.b = new nA(a, "ytp-button-next", Y(0, "YTP_NEXT"), Y(0, "YTP_NEXT"));
S(this, this.b);
qA(this.b, 6051);
this.na([this.g, this.b])
}
w(kF, X);
function lF(a, b) {
Ki.call(this);
this.g = !!b;
this.gb = a;
this.La = new zv(this);
this.b = this.j = null;
mF(this)
}
w(lF, Ki);
function mF(a) {
a.b = null;
a.j = null;
a.La.listen(a.gb, nF("over"), a.pB);
a.La.listen(a.gb, "touchstart", a.qB)
}
f = lF.prototype;
f.pB = function (a) {
this.La.removeAll();
this.La.listen(this.gb, nF("move"), this.ls);
this.La.listen(this.gb, nF("out"), this.ms);
this.g && this.La.listen(this.gb, nF("down"), this.ks);
this.I("hoverstart", sg(a), tg(a), a.target);
this.I("hovermove", sg(a), tg(a), a.target)
};
f.ls = function (a) {
this.b && sg(this.b) == sg(a) && tg(this.b) == tg(a) && this.b.relatedTarget == a.target || this.I("hovermove", sg(a), tg(a), a.target);
this.b = null
};
f.ms = function (a) {
a.relatedTarget && nd(this.gb, a.relatedTarget) ? (this.b = a, this.I("hovermove", sg(a), tg(a), a.relatedTarget)) : (this.La.removeAll(), mF(this), this.I("hoverend", sg(a), tg(a), a.relatedTarget))
};
f.ks = function (a) {
ja(a.button) && 0 != a.button || (a.preventDefault(), this.La.removeAll(), this.La.listen(document, nF("move"), this.jD), this.La.listen(document, nF("up"), this.kD), this.I("dragstart", sg(a), tg(a), a.target), this.I("dragmove", sg(a), tg(a), a.target))
};
f.jD = function (a) {
this.I("hovermove", sg(a), tg(a), a.target);
this.I("dragmove", sg(a), tg(a), a.target)
};
f.kD = function (a) {
this.La.removeAll();
a.target && nd(this.gb, a.target) ? (this.La.listen(this.gb, nF("move"), this.ls), this.La.listen(this.gb, nF("out"), this.ms), this.La.listen(this.gb, nF("down"), this.ks), this.I("dragend", sg(a), tg(a), a.target)) : (mF(this), this.I("dragend", sg(a), tg(a), a.target), this.I("hoverend", sg(a), tg(a), a.target))
};
f.qB = function (a) {
var b = a.changedTouches[0];
b && (this.La.removeAll(), this.La.listen(this.gb, "touchmove", this.FB), this.La.listen(this.gb, "touchend", this.Vr), this.La.listen(this.gb, "touchcancel", this.Vr), this.j = b.identifier, this.I("hoverstart", b.pageX, b.pageY, a.target), this.I("hovermove", b.pageX, b.pageY, a.target), this.g && (this.I("dragstart", b.pageX, b.pageY, a.target), this.I("dragmove", b.pageX, b.pageY, a.target)))
};
f.FB = function (a) {
var b = oF(this, a);
b && (a.preventDefault(), this.I("hovermove", b.pageX, b.pageY, a.target), this.g && this.I("dragmove", b.pageX, b.pageY, a.target))
};
f.Vr = function (a) {
var b = oF(this, a);
b && (a.preventDefault(), this.La.removeAll(), mF(this), this.g && this.I("dragend", b.pageX, b.pageY, a.target), this.I("hoverend", b.pageX, b.pageY, a.target))
};
function oF(a, b) {
for (var c = 0; c < b.changedTouches.length; c++) {
var d = b.changedTouches[c];
if (d.identifier == a.j) return d
}
return null
}
function nF(a) {
return window.navigator.msPointerEnabled ? "MSPointer" + a.charAt(0).toUpperCase() + a.substr(1) : "mouse" + a
}
f.J = function () {
this.La.removeAll();
lF.G.J.call(this)
};
function pF(a, b, c, d, e, g, h, k) {
this.b = a;
this.B = b;
this.j = c;
this.o = d;
this.k = e;
this.A = g;
this.g = h;
this.C = k
}
pF.prototype.clone = function () {
return new pF(this.b, this.B, this.j, this.o, this.k, this.A, this.g, this.C)
};
pF.prototype.equals = function (a) {
return this.b == a.b && this.B == a.B && this.j == a.j && this.o == a.o && this.k == a.k && this.A == a.A && this.g == a.g && this.C == a.C
};
function qF(a, b) {
if (0 == b) return a.b;
if (1 == b) return a.g;
var c = Gb(a.b, a.j, b),
d = Gb(a.j, a.k, b),
e = Gb(a.k, a.g, b),
c = Gb(c, d, b),
d = Gb(d, e, b);
return Gb(c, d, b)
}
function rF(a, b) {
var c = (b - a.b) / (a.g - a.b);
if (0 >= c) return 0;
if (1 <= c) return 1;
for (var d = 0, e = 1, g = 0; 8 > g; g++) {
var h = qF(a, c),
k = (qF(a, c + 1E-6) - h) / 1E-6;
if (1E-6 > Math.abs(h - b)) return c;
if (1E-6 > Math.abs(k)) break;
else h < b ? d = c : e = c, c -= (h - b) / k
}
for (g = 0; 1E-6 < Math.abs(h - b) && 8 > g; g++) h < b ? (d = c, c = (c + e) / 2) : (e = c, c = (c + d) / 2), h = qF(a, c);
return c
};
var sF = new function () {
this.b = new pF(0, 0, 0, 0, .58, 1, 1, 1)
};
function tF(a, b) {
this.g = a;
this.b = b
}
function uF(a) {
return a.b - a.g
}
function vF(a, b) {
return a.g + b * uF(a)
}
function wF(a, b, c) {
if (!uF(a)) return Infinity;
a = (b - a.g) / uF(a);
return c ? Fb(a, 0, 1) : a
};
function xF(a, b, c, d) {
var e = Math.min(c / (b.Cq / b.$i), d / (b.Bq / b.rows)),
g = b.Cq * e,
e = b.Bq * e,
g = Math.floor(g / b.$i) * b.$i,
e = Math.floor(e / b.rows) * b.rows,
h = g / b.$i,
k = e / b.rows,
l = Math.floor((c - h) / 2);
c = Math.ceil((c - h) / 2);
var q = Math.floor((d - k) / 2);
d = b.ky * h * -1;
var s = b.row * k * -1;
a = a.style;
a.width = h + "px";
a.height = k + "px";
h = q + "px";
a.marginTop = h;
a.marginBottom = h;
a.marginLeft = l + "px";
a.marginRight = c + "px";
a.backgroundImage = "url(" + b.url + ")";
a.backgroundPosition = d + "px " + s + "px";
a.backgroundSize = g + "px " + e + "px"
};
function yF(a, b) {
jE.call(this, ["div", "html5-storyboard", ["div", "html5-storyboard-filmstrip", ["img", "html5-storyboard-thumbnail", {
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}]],
["div", "html5-storyboard-lens", ["img", "html5-storyboard-lens-thumbnail", {
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}],
["span", "html5-storyboard-lens-timestamp"]
]
]);
this.B = !1;
this.o = new vk(this.Xu, 250, this);
S(this, this.o);
this.ce = b;
this.b = this.template.b["html5-storyboard-filmstrip"];
this.A = this.template.b["html5-storyboard-lens"];
this.C = this.template.b["html5-storyboard-lens-thumbnail"];
this.D = this.template.b["html5-storyboard-lens-timestamp"];
this.j = this.template.b["html5-storyboard-thumbnail"];
hd(this.j);
this.g = 0;
this.F = a;
this.k = new tF(0, 0)
}
w(yF, jE);
f = yF.prototype;
f.nq = !1;
f.ce = 0;
f.Gl = 0;
f.Lk = 0;
f.Tq = 10;
f.Yb = 0;
f.Ti = 0;
f.wm = 0;
f.Dc = null;
f.Je = null;
f.disable = function () {
this.nq = !0
};
f.mq = function () {
for (var a = this.b.cloneNode(!0), b = this.Dc.b[0].g, c, d, e = 0; e < b; e++) d = this.j.cloneNode(!1), c = Aq(this.Je, e, this.Yb), xF(d, c, this.Yb, this.Ti), a.appendChild(d);
id(a, this.b);
this.b = a
};
f.Kp = function (a, b) {
Ge(this.b, !1);
for (var c, d, e = a; e <= b; e++)
if (d = this.b.children[e]) c = Aq(this.Je, e, this.Yb), xF(d, c, this.Yb, this.Ti);
Ge(this.b, !0)
};
function zF(a, b) {
if (b != a.wm) {
var c = Aq(a.Je, b, 2 * a.Yb),
d = Math.round(2 * a.Yb),
e = Math.round(2 * a.Ti);
xF(a.C, c, d, e);
a.wm = b
}
}
f.Xu = function () {
for (var a = this.Gl, b = Math.max(Math.floor(a / this.Yb), 0), a = Math.min(Math.ceil((a + this.ce) / this.Yb), this.Dc.b[0].g - 1); b <= a; b++) {
for (var c = this.Je, d = b, e = Dp(c.b, 2 * this.Yb), g = void 0, h = void 0; 0 <= e; e--)
if (g = c.b.b[e], h = Math.floor(d / (g.b * g.j)), !g.k[h]) {
var g = c,
k = e,
l = k + "-" + h;
g.o[l] || (g.o[l] = !0, xq(g.j, k, {
Sp: k,
Tp: h
}))
}
Bq(c)
}
};
function AF(a, b) {
a.Tq = Math.min(10, Math.ceil(a.ce / 72));
a.Yb = Math.floor(a.ce / a.Tq);
a.Ti = .555 * a.Yb;
a.Lk = a.Yb * a.Dc.b[0].g;
Ae(a.b, a.Lk);
var c = Math.round(2 * a.Yb),
d = .555 * c + 12;
ze(a.A, c, d);
oe(a.A, (a.ce - c) / 2);
c = d + 20;
a.K().style.height = pe(c, !0);
b && (a.Kp(0, a.Dc.b[0].g - 1), zF(a, a.wm), a.B = !0)
}
f.show = function () {
this.Dc && yF.G.show.call(this)
};
f.J = function () {
this.Je = this.Dc = null;
Ly(this.g);
yF.G.J.call(this)
};
function BF(a, b, c, d) {
this.width = b;
this.g = c;
this.o = d;
this.b = b - c - d;
this.k = Fb(a - c, 0, this.b);
this.position = this.k + c;
this.j = this.k / this.b
};
function CF() {
X.call(this, ["div", "ytp-progress-tooltip", ["div", "ytp-progress-tooltip-thumbnail-container", ["div", "ytp-progress-tooltip-thumbnail"]],
["div", "ytp-progress-tooltip-text-container", ["div", "ytp-progress-tooltip-text", "{{text}}"]],
["div", "ytp-progress-tooltip-timestamp-container", ["div", "ytp-progress-tooltip-timestamp", "{{timestamp}}"]],
["div", "ytp-progress-tooltip-arrow"]
]);
this.j = this.template.b["ytp-progress-tooltip-arrow"];
this.b = -1;
this.$ = "";
this.g = new tF(0, 0);
this.hide()
}
w(CF, X);
f = CF.prototype;
f.Si = !1;
f.If = null;
f.Ug = null;
f.disable = function () {
this.Si = !0
};
f.show = function () {
this.Si || CF.G.show.call(this)
};
f.reset = function () {
P(this.K(), "with-thumbnail");
this.Ug = this.If = null
};
f.Mx = function (a, b) {
(a <= this.b || this.b <= b) && DF(this)
};
function DF(a) {
var b = Aq(a.Ug, a.b, 108);
xF(a.template.b["ytp-progress-tooltip-thumbnail"], b, 108, 60)
}
f.J = function () {
this.j = this.Ug = this.If = null;
CF.G.J.call(this)
};
function EF(a, b) {
var c = ["div", "ytp-progress-bar-container", ["div", ["html5-progress-bar", "html5-stop-propagation", "ytp-force-transform"],
["div", "ytp-progress-bar-padding"],
["div", "ytp-progress-list", ["div", "ytp-unloaded-progress"],
["div", "ytp-play-progress"],
["div", "ytp-load-progress"],
["div", "ytp-spacecast-load-progress"],
["div", "ytp-clip-start-exclude"],
["div", "ytp-clip-end-exclude"],
["div", "html5-ad-progress-list"],
["div", "ytp-marker-crenellation-list"],
["div", "ytp-marker-progress-list"]
],
["div",
"ytp-scrubber-pull-indicator"
],
["div", "html5-scrubber-button"]
],
["div", "ytp-bound-time-left", "{{boundTimeLeft}}"],
["div", "ytp-bound-time-right", "{{boundTimeRight}}"],
["div", ["ytp-clip-start", "html5-clip-marker", "yt-uix-tooltip"], {
title: Y(0, "YTP_TOOLTIP_CLIP_MARKER")
}],
["div", ["ytp-clip-end", "html5-clip-marker", "yt-uix-tooltip"], {
title: Y(0, "YTP_TOOLTIP_CLIP_MARKER")
}],
["div", "html5-progress-screenreader", {
"aria-live": "assertive"
}]
];
jE.call(this, c);
this.k = a.Wc().width;
this.D = 1;
this.N = this.U = this.A =
this.kb = this.H = 0;
this.ua = this.template.b["html5-ad-progress-list"];
this.gc = this.template.b["ytp-marker-progress-list"];
this.ib = this.template.b["ytp-marker-crenellation-list"];
this.F = {};
this.P = {};
this.M = Infinity;
this.ca = this.template.b["ytp-clip-end"];
this.Ca = new lF(this.ca, !0);
S(this, this.Ca);
this.Ca.subscribe("hoverstart", this.no, this);
this.Ca.subscribe("hoverend", this.mo, this);
vy(this, this.ca, "click", this.lk);
this.va = this.template.b["ytp-clip-end-exclude"];
this.hb = this.template.b["ytp-clip-start-exclude"];
this.O = 0;
this.ja = this.template.b["ytp-clip-start"];
this.Ba = new lF(this.ja, !0);
S(this, this.Ba);
this.Ba.subscribe("hoverstart", this.no, this);
this.Ba.subscribe("hoverend", this.mo, this);
vy(this, this.ja, "click", this.lk);
this.j = null;
this.Ma = this.template.b["ytp-unloaded-progress"];
this.Ia = this.template.b["ytp-load-progress"];
this.C = 0;
this.Ua = this.template.b["ytp-play-progress"];
this.B = 0;
this.L = this.template.b["html5-progress-bar"];
this.o = null;
this.zc = new bF(this.K());
S(this, this.zc);
this.mb = this.template.b["html5-progress-screenreader"];
this.g = null;
this.oa = this.template.b["html5-scrubber-button"];
this.xc = this.template.b["ytp-scrubber-pull-indicator"];
this.tb = 0;
this.Aa = !1;
this.Da = new E;
this.b = new tF(0, 0);
this.Tb = !1;
this.W = b;
FF(this)
}
w(EF, jE);
f = EF.prototype;
f.Ox = function () {
this.g && this.g.show()
};
f.Qx = function (a, b, c) {
var d = ue(this.K()),
e = GF(this).b,
g = c ? c.getAttribute("data-tooltip") : null;
g && (a = wF(this.b, Number(c.getAttribute("data-position"))) * e + ue(this.L).x);
this.Da.x = a - d.x;
this.Da.y = b - d.y;
g ? HF(this, g) : HF(this)
};
function HF(a, b) {
if (a.g) {
var c = a.Tb ? a.b.b : 0,
d = GF(a),
e = a.g;
if (!e.Si) {
var g = 50;
e.If ? (g = 108, b && (g *= 2)) : b && (g = 108);
e.K().style.padding = "2px";
e.K().style.width = g + "px";
g = g / 2 + 2;
g = (new BF(d.position, d.width, g, g)).position - g;
e.K().style.left = g + "px";
e.j.style.left = Fb(d.position, 0, d.width) - g - 5 + "px";
c = kv(vF(e.g, d.j) - c);
e.na(c, "timestamp");
e.If && (d = Cp(e.If, d.j), d != e.b && (e.b = d, DF(e)));
b ? (O(e.K(), "with-text"), e.na(b, "text")) : P(e.K(), "with-text")
}
}
}
f.Px = function () {
this.g && this.g.hide()
};
f.Nx = function (a, b) {
var c = IF(this);
this.tb = c.g - GF(this).j * (c.g + c.o);
this.g && this.j && (this.g.hide(), this.j.show());
this.A && (Id(this.A), this.A = 0);
this.kb = b;
this.Aa = !0;
this.I("beginseeking")
};
f.Rx = function () {
this.U = 0;
P(this.K(), "ytp-pull-ui");
P(this.K(), "ytp-pulling");
if (0 < this.H) {
var a = v(),
b = this.H,
c = GF(this).position;
this.A && Id(this.A);
this.A = uy(t(this.Fo, this, a, b, c), 0)
}
this.g && this.j && (this.g.show(), this.j.hide());
this.Aa = !1;
this.I("endseeking")
};
f.Fo = function (a, b, c) {
var d, e = (v() - a) / 200;
d = sF.b;
e = rF(d, e);
if (0 == e) d = d.B;
else if (1 == e) d = d.C;
else {
var g = Gb(d.B, d.o, e),
h = Gb(d.o, d.A, e);
d = Gb(d.A, d.C, e);
g = Gb(g, h, e);
h = Gb(h, d, e);
d = Gb(g, h, e)
}
e = c + d * (this.B * this.k - c);
if (0 > d || 1 < d) d = 1;
JF(this, (1 - d) * b, e, this.B);
this.A = 1 > d ? uy(t(this.Fo, this, a, b, c), 0) : 0
};
function JF(a, b, c, d) {
b = Fb(b, 0, 40);
a.H = b;
var e = a.D,
g = Math.max(uF(a.b) / a.k, 1);
a.D = b / 40 * (g - 1) + 1;
b = a.k * a.D;
a.N = Fb(d * b - c, 0, b - a.k);
e != a.D && FF(a)
}
f.Sx = function (a, b) {
var c = !1,
d = !1,
e = GF(this);
3600 <= uF(this.b) && (JF(this, this.kb - b - 10, e.position, e.j), d = !0, c = 4 < this.H, e = GF(this));
Q(this.K(), "ytp-pull-ui", d);
c && O(this.K(), "ytp-pulling");
c = 0;
e.g && 0 >= e.position ? c = -1 : e.o && e.position >= e.width && (c = 1);
!this.A || c && c == this.U || K(this.A);
c && (this.A = uy(t(this.dp, this, v(), this.N), 0));
this.U = c;
this.I("seekto", vF(this.b, e.j), !1)
};
f.dp = function (a, b) {
if (this.U) {
var c = this.k * (this.D - 1);
this.N = Fb(b + this.U * (v() - a) * .3, 0, c);
FF(this);
this.I("seekto", vF(this.b, GF(this).j), !1);
0 < this.N && this.N < c && (this.A = uy(t(this.dp, this, a, b), 0))
}
};
function FF(a) {
var b = GF(a),
c = jd(a.ib),
d = 0;
if (8 < a.H)
for (var e = (-b.g + b.width) / b.b * (uF(a.b) / 60), g = Math.ceil(-b.g / b.b * (uF(a.b) / 60)); g < e; g++) {
var h = c[d];
h || (h = document.createElement("div"), h.style.width = "1px", a.ib.appendChild(h));
d++;
h.className = 0 == g % 60 ? "ytp-60m-progress" : 0 == g % 30 ? "ytp-30m-progress" : 0 == g % 15 ? "ytp-15m-progress" : "ytp-1m-progress";
h.style.left = 60 * g / uF(a.b) * b.b + "px"
}
for (e = c.length - 1; e >= d; e--) hd(c[e]);
c = (-b.g + b.width) / b.b;
a.na(kv(vF(a.b, -b.g / b.b)), "boundTimeLeft");
a.na(kv(vF(a.b, c)), "boundTimeRight");
a.L.style.width = b.b + "px";
a.K().style.height = a.H + (a.W ? 20 : 8) + "px";
b = b.g;
kx(a.L, "transform", b ? "translatex(" + b + "px)" : "");
a.oa.style.height = a.H + (a.W ? 12 : 6) + "px";
for (var k in a.F) KF(a, a.F[k], a.P[k]);
LF(a);
MF(a, a.B, a.C)
}
function GF(a) {
var b = a.Da.x;
if (a.Aa) var c = a.W ? 32 : 16,
b = (b + a.tb - c / 2) / (a.k - c) * a.k;
c = a.k * a.D;
b = Fb(b, 0, a.k);
return new BF(b, a.k, -a.N, -(c - a.N - a.k))
}
function IF(a) {
var b = a.W ? 32 : 16,
c = a.k * a.D;
return new BF(a.B * (c - b) + b / 2, c, b / 2, b / 2)
}
function MF(a, b, c) {
(b < a.O || b > a.M) && a.lk();
a.B = b;
a.C = Math.max(a.B, c);
var d = wF(a.b, a.O, !0),
e = wF(a.b, a.M, !0),
g = Fb(b, d, e);
c = Fb(c, d, e);
var h = g;
g < e && (h = a.k * a.D, h = (g * h - g) / h);
a.Ua.style.left = lv(d) + "%";
kx(a.Ua, "transform", "scalex(" + (h - d) + ")");
kx(a.oa, "transformOrigin", lv(b) + "%");
b = IF(a).position + "px";
a.oa.style.left = b;
a.xc.style.left = b;
a.Ia.style.left = lv(d) + "%";
kx(a.Ia, "transform", "scalex(" + (c - d) + ")");
a.Ma.style.left = lv(d) + "%";
kx(a.Ma, "transform", "scalex(" + (e - d) + ")")
}
function LF(a) {
var b = a.O > a.b.g,
c = 0 < a.b.b && a.M < a.b.b;
Q(a.K(), "ytp-clip-start-enabled", b);
Q(a.K(), "ytp-clip-end-enabled", c);
b = b ? wF(a.b, a.O) : 0;
c = c ? wF(a.b, a.M) : 1;
a.ja.style.left = lv(b) + "%";
a.ca.style.left = lv(c) + "%";
a.hb.style.width = lv(b) + "%";
a.va.style.left = lv(c) + "%";
a.va.style.width = lv(1 - c) + "%"
}
f.no = function () {
O(this.K(), "ytp-clip-hover")
};
f.mo = function () {
P(this.K(), "ytp-clip-hover")
};
f.lk = function () {
this.O = 0;
LF(this);
MF(this, this.B, this.C);
this.M = Infinity;
LF(this);
MF(this, this.B, this.C)
};
function KF(a, b, c) {
var d = GF(a).b,
e = wF(a.b, b.start / 1E3, !0) * d;
switch (b.style) {
case "ytp-chapter-marker":
a = Ft(b);
var g = a / 2,
d = Fb(e, g, d - g) - g;
break;
default:
a = Math.min(Math.min(wF(a.b, b.end / 1E3) * d, d) - e, Ft(b)), d = Fb(e, 0, d - a)
}
c.style.width = a + "px";
c.style.left = d + "px";
c.className = b.style
}
function NF(a, b) {
y(b, function (a) {
if (a.de) {
var b = a.getId();
if (!this.F[b]) {
var e = document.createElement("div");
a.g && (e.setAttribute("data-tooltip", a.g), e.setAttribute("data-position", a.start / 1E3));
this.F[b] = a;
this.P[b] = e;
KF(this, a, e);
"ytp-chapter-marker" == a.style ? this.gc.appendChild(e) : this.ua.appendChild(e)
}
} else OF(this, a)
}, a)
}
function PF(a, b) {
y(b, function (a) {
OF(this, a)
}, a)
}
function OF(a, b) {
var c = b.getId();
a.F[c] == b && (hd(a.P[c]), delete a.F[c], delete a.P[c])
}
function QF(a, b) {
var c = a.L;
P(c, "spacecast-cached");
b && J(function () {
O(c, "spacecast-cached")
}, 100)
}
f.J = function () {
this.A && (K(this.A), this.A = 0);
this.o && (this.o.dispose(), this.o = null);
this.Ia = this.ja = this.hb = this.ca = this.va = this.ua = null;
this.P = {};
this.Ma = this.oa = this.mb = this.L = this.Ua = null;
this.W = !1;
EF.G.J.call(this)
};
function RF(a) {
mA.call(this);
this.B = this.k = "unknown";
this.b = Y(0, "YTP_QUALITY_TITLE");
this.j = new JB(a, t(this.D, this), t(this.F, this), !0);
S(this, this.j);
this.g = NaN;
this.element = new CB(a, void 0, this.j);
S(this, this.element);
EB(this.element, 100);
this.priority = -1;
this.o = !0
}
w(RF, mA);
RF.prototype.Kn = function () {
return this.k
};
function SF(a, b, c) {
if (a.k != b || a.B != c) {
a.k = b;
a.B = c;
MB(a.j, c);
var d = a.j;
null != d.b && IB(LB(d, d.b), !1);
null != b && IB(LB(d, b), !0);
d.b = b;
"auto" == c && c != b ? (b = Y(0, "YTP_AUTO_WITH_QUALITY_2", {
VIDEO_QUALITY: TF(b)
}), b = new lE(b)) : b = a.D(b);
isNaN(a.g) || (Iy() ? Ly(a.g) : K(a.g));
Iy() ? a.g = Ky(t(a.element.k, a.element, b), 0) : a.g = J(t(a.element.k, a.element, b), 0)
}
}
function TF(a) {
switch (a) {
case "highres":
return "2160p";
case "hd1440":
return "1440p";
case "hd1080":
return "1080p";
case "hd720":
return "720p";
case "large":
return "480p";
case "medium":
return "360p";
case "small":
return "240p";
case "tiny":
return "144p";
case "auto":
return Ld("YTP_AUTO")
}
return ""
}
RF.prototype.D = function (a) {
var b = ["span", "", TF(a)];
"highres" == a ? (b.push(" "), b.push(["sup", "", "4K"])) : 0 == a.indexOf("hd") && (b.push(" "), b.push(["sup", "", "HD"]));
return new dv(b)
};
RF.prototype.F = function (a) {
this.element.j();
this.element.Fb("blur");
if ("auto" != this.B || "auto" != a) SF(this, a, a), this.element.Fb("change")
};
RF.prototype.J = function () {
Iy() ? Ly(this.g) : K(this.g);
RF.G.J.call(this)
};
function UF(a) {
nC.call(this, a, "ytp-settings-button", Y(0, "YTP_SETTINGS"), "ytp-settings-button-active");
qA(this, 6600);
this.j = new X(["div", "{{content}}"]);
S(this, this.j);
this.na(this.j);
VF(this, "")
}
w(UF, nC);
function VF(a, b) {
"highres" == b ? a.j.na("ytp-settings-4k-quality-badge") : -1 != b.indexOf("hd") ? a.j.na("ytp-settings-hd-quality-badge") : a.j.na("")
};
function WF(a, b, c) {
var d = c ? Y(0, "YTP_THEATER_MODE") : Y(0, "YTP_LARGE_PLAYER");
c = c ? Y(0, "YTP_DEFAULT_VIEW") : Y(0, "YTP_DEFAULT_PLAYER");
d = b ? d : Y(0, "YTP_LARGE_PLAYER");
b = b ? c : Y(0, "YTP_SMALL_PLAYER");
nC.call(this, a, "ytp-size-toggle-large", d, "ytp-size-toggle-small", b);
qA(this, 6800)
}
w(WF, nC);
function XF(a) {
mA.call(this);
this.j = 1;
this.b = Y(0, "YTP_SPEED_TITLE");
this.g = new JB(a, t(this.k, this), t(this.B, this));
S(this, this.g);
this.element = new CB(a, void 0, this.g);
S(this, this.element);
EB(this.element, 100);
YF(this, this.j);
this.priority = 1;
this.o = !0
}
w(XF, mA);
function YF(a, b) {
a.j = b;
MB(a.g, b);
a.element.k(a.k(b))
}
XF.prototype.k = function (a) {
return 1 == a ? Y(0, "YTP_NORMAL_SPEED") : a.toString()
};
XF.prototype.B = function (a) {
this.element.j();
YF(this, a);
this.element.Fb("change")
};
function ZF() {
X.call(this, ["div", ["ytp-time-display", "html5-control"],
["span", "ytp-time-current", "{{current}}"],
["span", "ytp-time-separator", " / "],
["span", "ytp-time-duration", "{{duration}}"],
["span", "ytp-time-live-badge", "Live"]
]);
this.b = this.template.b["ytp-time-live-badge"]
}
w(ZF, X);
ZF.prototype.uf = function (a) {
iv(this.template, "duration", kv(a))
};
ZF.prototype.J = function () {
this.b = null;
ZF.G.J.call(this)
};
function $F(a) {
this.C = a;
X.call(this, ["div", "ytp-volume-control", ["div", "ytp-volume-panel", {
role: "slider",
"aria-valuemin": "0",
"aria-valuemax": "100",
"aria-valuenow": "{{valuenow}}",
"aria-valuetext": "{{valuetext}}",
tabindex: 6200
},
["div", "ytp-volume-slider", ["div", "ytp-volume-slider-foreground"]]
]]);
this.b = new nA(this.C, "ytp-button-volume", Y(0, "YTP_BUTTON_VOLUME"));
S(this, this.b);
this.b.X(this.element, 0);
qA(this.b, 6100);
this.A = this.template.b["ytp-volume-panel"];
this.g = this.template.b["ytp-volume-slider"];
this.o = this.template.b["ytp-volume-slider-foreground"];
this.k = this.j = 0;
this.B = new bF(this.A);
S(this, this.B)
}
w($F, X);
function aG(a) {
a.j || (a.j = a.g.clientWidth);
return a.j
}
$F.prototype.setVolume = function (a, b) {
var c = Y(0, b ? "YTP_UNMUTE" : "YTP_MUTE");
this.b.g = c;
var c = Math.round(a),
d = c + "% " + Y(0, "YTP_SCREENREADER_VOLUME_SETTING") + (b ? " " + Y(0, "YTP_SCREENREADER_VOLUME_MUTED") : ""),
e = Y(0, b ? "YTP_SCREENREADER_VOLUME_UNMUTE" : "YTP_SCREENREADER_VOLUME_MUTE") + " " + Y(0, "YTP_SCREENREADER_CONTROL_TOGGLE");
pA(this.b, e);
iv(this.template, "valuenow", c);
iv(this.template, "valuetext", d);
c = "max";
b || 0 == a ? c = "off" : 20 > a ? c = "min" : 40 > a ? c = "quiet" : 60 > a ? c = "normal" : 80 > a && (c = "loud");
cg(this.b.K(), "value", c);
c = aG(this);
this.k || (this.k = this.o.clientWidth);
c = c - this.k;
d = b ? 0 : a;
0 >= d ? c = 0 : 100 <= d || (d = (c - 0) * d / 100, c = 0 >= d ? 0 : d >= c ? c : 0 + Math.round(d));
this.o.style.left = c + "px"
};
function bG(a, b, c, d) {
Ki.call(this);
this.yb = a;
this.mk = new zv(this);
this.vu = !!c;
this.wu = !!d;
this.xu = b;
this.Xc = null;
this.b = {};
this.g = {};
this.k = this.j = this.Wd = this.Cc = this.Zd = null;
this.o = new zv(this);
this.uo = this.ic = null;
this.B = -1;
this.A = null;
this.C = !1;
this.xf = new X(["div", "ytp-video-controls-clickguard"]);
this.xf.hide();
S(this, this.xf)
}
w(bG, Ki);
f = bG.prototype;
f.ed = null;
f.Gc = null;
f.He = null;
f.ti = null;
f.ii = null;
f.Kq = !1;
f.dd = null;
f.disable = function (a) {
cG(this, a, !0)
};
f.enable = function (a) {
cG(this, a, !1)
};
function cG(a, b, c) {
for (var d = 0; d < b.length; d++) switch (b[d]) {
case "audio":
Q(a.ed, "disabled-control-audio", c);
break;
case "play_pause":
var e = a.Gc;
c ? e.disable() : e.enable();
break;
case "seek":
Q(a.ed, "disabled-control-seek", c)
}
}
f.setVolume = function (a, b) {
if (this.B != a || this.A != b) this.bd.setVolume(a, b), this.B = a, this.A = b
};
f.uf = function (a) {
this.Cd.uf(a)
};
function dG(a, b) {
iv(a.Cd.template, "current", kv(b))
}
f.Mv = function () {
this.I("mutetoggled")
};
function eG(a, b) {
if (b) {
if (a.Kq) {
var c = a.Gc;
oA(c, "ytp-button-stop");
var d = Y(0, "YTP_STOP")
} else c = a.Gc, oA(c, "ytp-button-pause"), d = Y(0, "YTP_PAUSE");
pA(c, d)
} else jF(a.Gc)
}
f.Lv = function () {
this.I("playpausetoggled")
};
f.Iv = function (a) {
a = (a - ue(this.bd.g).x) / aG(this.bd) * 100;
a = {
volume: Fb(a, 0, 100),
muted: !1
};
this.I("volumechanged", a)
};
f.Hv = function () {
this.I("fullscreentoggled")
};
function fG(a, b) {
var c = a.g[b.A || "__default__"];
c && c.add(b)
}
function gG(a, b) {
var c = a.g[b.A || "__default__"];
c && c.remove(b)
}
function hG(a, b, c, d) {
if (!a.b[b]) {
a.b[b] = c;
if ("remote" == b) gd(md(a.Xc.K()), c.K(), 0);
else {
var e = c.K();
d = d || a.Xc.K();
d.parentNode && d.parentNode.insertBefore(e, d.nextSibling)
}
c.listen("click", ra(a.gA, b), a, "menuButtonClick");
c = new fF(a.yb, "__default__" != b);
S(a, c);
c.hide();
c.X(a.ed);
a.g[b] = c
}
}
f.Jv = function () {
var a = this.Cb.K();
if (!Zf(a, "html5-async-progress")) {
var b = Zf(a, "html5-async-success");
ZE(a, "html5-async-progress");
this.I("watchlater", b)
}
};
f.Kv = function () {
this.I("watchonyoutube")
};
function iG(a, b, c) {
a.wd();
a.I("showdialog");
var d = a.yb.Wc();
ze(a.xf.K(), d);
a.xf.show();
c && (a.k = c, pC(a.k));
a.j = b;
a.j.show();
a.j.K().focus();
a.o.listen(window, "blur", a.wd);
a.o.listen(document, "click", a.wd)
}
f.wd = function () {
this.o.removeAll();
this.j && (this.j.hide(), this.j = null);
this.k && (qC(this.k), this.k = null);
this.xf.hide()
};
f.gA = function (a, b) {
b.stopPropagation();
var c = this.b[a];
c && (c.b ? this.wd() : iG(this, this.g[a], c))
};
f.Cv = function () {
this.I("audiotrackchanged", this.Zd.j)
};
f.Ev = function () {
var a = this.Cc.Kn();
this.I("qualitychanged", a);
this.I("controlclick", "quality-" + a)
};
f.Dv = function () {
this.wd()
};
f.Fv = function () {
var a = this.ic;
a.b ? qC(a) : pC(a);
this.I("sizechangerequested", 1 == this.ic.b)
};
f.Gv = function () {
var a = this.Wd.j;
this.I("speedchanged", a);
this.I("controlclick", "speed-" + a)
};
f.Vy = function (a) {
var b = a.target;
a = b == this.Gc.K() ? "playpause" : b == this.bd ? "volume" : b == this.Cd ? "time" : b == this.Xc ? "settings" : b == this.Cb ? "watchlater" : b == this.dd ? "youtube" : b == this.ee.K() ? "fullscreen" : b == this.ic ? "size" : a.target.className;
this.I("controlclick", a)
};
f.J = function () {
this.yo.dispose();
this.mk.removeAll();
this.o.removeAll();
this.wd();
this.Cb = this.dd = this.ii = this.bd = this.ed = null;
for (var a in this.b) {
var b = this.b[a];
b && (b.fd(), wy(b, "menuButtonClick"))
}
this.b = {};
this.g = {};
this.ic = this.Xc = this.Wd = this.Cc = null;
this.C || (this.B = -1, this.A = null);
bG.G.J.call(this)
};
function jG(a) {
ii("/playlist_video_ajax?action_add_to_watch_later_list=1", {
method: "POST",
Fh: {
privacy: a.privacy || null,
feature: a.VE || null,
authuser: a.Va || null,
pageid: a.cb || null
},
hd: {
video_ids: a.$a,
src_playlist_id: a.YE,
full_list_id: a.WE || null,
new_playlist_name: a.XE || null,
plid: Fd("PLAYBACK_ID") || null
},
context: a.context,
onError: a.onError,
onSuccess: a.onSuccess,
zb: a.zb
})
}
function kG(a) {
ii("/playlist_video_ajax?action_delete_from_watch_later_list=1", {
method: "POST",
hd: {
video_ids: a.$a,
session_token: Fd("XSRF_TOKEN")
},
context: a.context,
onError: a.onError,
onSuccess: a.onSuccess,
zb: a.zb
})
};
function lG(a, b) {
this.A = a;
this.k = [];
this.B = b;
this.o = []
}
w(lG, jh);
function mG(a, b, c) {
a.k.push(a.A.subscribe(b, c, a))
}
function nG(a, b, c) {
a.o.push(a.B.subscribe(b, c, a))
}
function oG(a) {
for (var b = 0; b < a.k.length; b++) a.A.Lb(a.k[b]);
for (b = 0; b < a.o.length; b++) a.B.Lb(a.o[b])
}
lG.prototype.J = function () {
oG(this);
lG.G.J.call(this)
};
function pG(a, b) {
lG.call(this, a, b);
this.j = !1;
this.g = a;
this.b = b;
var c = a.R();
c.color && O(this.b.L, c.color);
if (c.Wi) {
var d = this.b,
c = c.b.Ca;
d.g = new CF;
d.g.X(d.K());
S(d, d.g);
d.j = new yF(c, d.k);
d.j.hide();
d.j.X(d.K(), 0);
S(d, d.j)
}
qG(this)
}
w(pG, lG);
function qG(a) {
oG(a);
a.j = !0;
mG(a, "cuerangesadded", a.KC);
mG(a, "cuerangesremoved", a.LC);
mG(a, "cuerangemarkersupdated", a.JC);
mG(a, "presentingplayerstatechange", a.PC);
mG(a, "progresssync", a.Aq);
mG(a, "resize", a.NC);
mG(a, "seekto", a.QC);
mG(a, "videodatachange", a.RC);
mG(a, "videoplayerreset", a.zq);
mG(a, "videoready", a.OC);
nG(a, "beginseeking", a.IC);
nG(a, "endseeking", a.MC);
nG(a, "seekto", a.HC)
}
f = pG.prototype;
f.KC = function (a) {
NF(this.b, a)
};
f.LC = function (a) {
PF(this.b, a)
};
f.JC = function (a) {
NF(this.b, a)
};
f.NC = function (a) {
var b = this.b;
b.k = a.width;
FF(b);
b.j && (b = b.j, a = a.width, !b.Dc || b.ce == a && b.B || (b.ce = a, AF(b, !0)))
};
f.QC = function (a) {
var b = this.g.Hb.Jg();
a = wF(new tF(b.pp, b.np), a);
b = this.b;
MF(b, n(a) ? a : b.B, n(void 0) ? void 0 : b.C);
if (this.b.j && (b = this.b.j, b.Dc)) {
b.Gl = b.Lk * a - b.ce / 2;
oe(b.b, -1 * b.Gl);
var c = Cp(b.Dc, a);
zF(b, c);
a = vF(b.k, a);
pd(b.D, kv(a));
wk(b.o)
}
};
f.PC = function (a) {
if (0 > vv(a, 16)) {
a = this.b;
var b = this.g.getCurrentTime();
a.mb.innerHTML = Math.floor(100 * a.B) + "% at " + Math.floor(b) + " of " + Math.floor(a.b.b) + " seconds"
}
};
f.zq = function (a) {
if (1 != a.getPlayerType()) {
if (!this.j) return;
oG(this);
this.j = !1;
mG(this, "videoplayerreset", this.zq)
} else if (!this.j) {
qG(this);
var b = this.b;
fd(b.ua);
b.F = {};
b.P = {};
NF(this.b, a.A.j || []);
this.b.g && this.b.g.reset()
}
this.Aq()
};
f.RC = function (a, b) {
var c = new tF(0, b.Pa),
d = this.b;
d.b = c;
FF(d);
this.b.g && (this.b.g.g = c);
this.b.j && (this.b.j.k = c);
c = this.b;
c.O = b.tg;
LF(c);
MF(c, c.B, c.C);
c = this.b;
c.M = b.ai;
LF(c);
MF(c, c.B, c.C);
QF(this.b, !!b.U)
};
f.OC = function (a) {
if (this.b.g) {
var b = this.b.g;
if (!b.Si)
if (Fr(a)) {
O(b.K(), "with-thumbnail");
b.If = Fr(a);
b.Ug = Gr(a);
var c = t(b.Mx, b);
b.Ug.subscribe("l", c)
} else b.reset()
}
this.b.j && (b = this.b.j, b.j && fd(b.b), P(b.K(), "enabled"), b.Dc = Fr(a), b.Je = Gr(a), b.Dc && !b.nq && (O(b.K(), "enabled"), c = t(b.Kp, b), b.Je.subscribe("l", c), AF(b), b.F ? (Ly(b.g), b.g = Ky(t(b.mq, b))) : b.mq()));
this.b.Tb = a.Ab ? !0 : !1;
Lr(a) ? (a = this.b, a.o && (a.o.dispose(), a.o = null)) : (a = this.b, a.o || (a.o = new lF(a.L, !0), a.o.subscribe("hoverstart", a.Ox, a), a.o.subscribe("hovermove",
a.Qx, a), a.o.subscribe("hoverend", a.Px, a), a.o.subscribe("dragstart", a.Nx, a), a.o.subscribe("dragmove", a.Sx, a), a.o.subscribe("dragend", a.Rx, a)))
};
f.Aq = function (a, b) {
var c = this.g.Hb.Jg(),
d = n(a) ? a : c.current,
e = new tF(c.pp, n(b) ? b : c.np),
c = wF(e, c.loaded),
d = wF(e, d),
g = this.b;
g.b = e;
FF(g);
g = this.b;
MF(g, n(d) ? d : g.B, n(c) ? c : g.C);
this.b.g && (this.b.g.g = e);
this.b.j && (this.b.j.k = e)
};
f.IC = function () {
rG(this.g.j)
};
f.MC = function () {
this.g.j.Ii()
};
f.HC = function (a, b) {
js(this.g, a, b)
};
f.J = function () {
pG.G.J.call(this)
};
function sG(a, b) {
lG.call(this, a, b);
mG(this, "applicationplayerstatechange", this.uy);
mG(this, "controlsdisabled", this.xy);
mG(this, "controlsenabled", this.yy);
mG(this, "liveviewshift", this.By);
mG(this, "fullscreentoggled", this.Ay);
mG(this, "presentingplayerstatechange", this.Xy);
mG(this, "progresssync", this.az);
mG(this, "threedenabled", this.Qy);
mG(this, "videoplayerreset", this.$y);
mG(this, "videodatachange", this.Zy);
mG(this, "onPlaybackQualityChange", this.My);
mG(this, "onVolumeChange", this.Ry);
mG(this, "menu_button_add",
this.Cy);
mG(this, "menu_button_remove", this.Ey);
mG(this, "menu_item_add", this.Fy);
mG(this, "menu_item_remove", this.Gy);
mG(this, "menu_show", this.Hy);
nG(this, "fullscreentoggled", this.zy);
nG(this, "mutetoggled", this.Iy);
nG(this, "nextvideo", this.Jy);
nG(this, "playpausetoggled", this.Ky);
nG(this, "previousvideo", this.Ly);
nG(this, "qualitychanged", this.Ny);
nG(this, "audiotrackchanged", this.vy);
nG(this, "seekto", this.Yy);
nG(this, "sizechangerequested", this.Oy);
nG(this, "speedchanged", this.Py);
nG(this, "volumechanged",
this.Sy);
nG(this, "watchlater", this.Ty);
nG(this, "watchonyoutube", this.Uy);
nG(this, "controlclick", this.wy);
nG(this, "showdialog", this.Wy);
this.g = a;
this.b = b;
this.j = new pG(a, b.ti);
S(this, this.j);
var c = a.R();
if (c.sc) {
var d = this.b;
this.g.R().ud ? pC(d.ic) : qC(d.ic);
d.ic.show()
}
c.Mf || this.b.Cb.hide();
c.Ff && this.b.ee.show();
if (c.ug) {
var d = this.b,
e = d.Wd;
KB(e.g, this.g.b.ug ? tq : [1]);
var g = 2500;
NB(e.g, g++);
g = g++;
qA(e.element.b, g);
fG(d, d.Wd)
}
if (c.b.F)
for (d = this.b, e = [d.Gc, d.bd, d.Cd, d.Cb, d.dd, d.ee, d.Xc], g = 0; g < e.length; g++) d.mk.listen(e[g],
"click", d.Vy);
d = null != c.Ee && 0 == c.Ee.search("^https?://www.youtube.com");
("detailpage" == c.ba || "profilepage" == c.ba || d) && this.b.dd.hide()
}
w(sG, lG);
f = sG.prototype;
f.xy = function (a) {
this.b.disable(a)
};
f.yy = function (a) {
this.b.enable(a)
};
f.By = function (a) {
Q(this.b.Cd.element, "ytp-time-live-dvr", !a)
};
f.Ay = function (a) {
var b = this.b;
this.g.R();
a ? (a = b.ee, oA(a, "ytp-button-fullscreen-exit"), b = Y(0, "YTP_EXIT_FULLSCREEN"), pA(a, b), a.g = b) : eF(b.ee);
tG(this)
};
f.Xy = function (a) {
W(a.state, 2) || (0 < vv(a, 8) ? eG(this.b, !0) : 0 > vv(a, 8) ? eG(this.b, !1) : 0 > vv(a, 2) && eG(this.b, W(a.state, 8)));
0 > vv(a, 16) && (a = this.g.getCurrentTime(), uG(this) && dG(this.b, a))
};
f.uy = function (a) {
if (W(a.state, 2)) {
a = this.b.Gc;
oA(a, "ytp-button-replay");
var b = Y(0, "YTP_REPLAY");
pA(a, b)
}
};
f.Qy = function () {
var a = this.b,
b = this.g.getVideoData().Jf,
c = H("html5-threed-conversion-on", a.ii),
a = H("html5-threed-conversion-off", a.ii);
ex(c, !b);
ex(a, b)
};
f.$y = function (a) {
if (uG(this)) {
var b = a.getCurrentTime();
uG(this) && dG(this.b, b);
ZE(this.b.Cb.K());
YF(this.b.Wd, 1);
a.getVideoData() && vG(this, a.getVideoData())
}
};
f.Zy = function (a, b) {
uG(this) && vG(this, b)
};
function tG(a) {
a.g.o && ("detailpage" != a.g.R().ba || a.g.R().xb) ? a.b.He.show() : a.b.He.hide()
}
function vG(a, b) {
a.b.uf(b.Pa);
var c = us(a.g),
d = a.b,
e = vs(c),
g = d.Cc;
KB(g.j, e);
NB(g.j, 2600);
qA(g.element.b, 2601);
e.length ? fG(d, d.Cc) : gG(d, d.Cc);
d = a.b;
e = ss(a.g);
g = wG(a.g);
SF(d.Cc, e, g);
VF(d.Xc, e);
d = a.b;
c.b.g ? (c.ja || (c.ja = xp(c.b.g)), c = c.ja) : c = [];
KB(d.Zd.g, c);
1 < c.length ? fG(d, d.Zd) : gG(d, d.Zd);
c = a.b;
(d = (d = us(a.g, void 0)) ? xG(d) : null) && aF(c.Zd, d);
e = a.b;
c = b.qb;
d = b.Ab;
e.Kq = c && !d;
e = e.Cd;
Q(e.element, "ytp-time-liveonly", c && !d);
Q(e.element, "ytp-time-live", c && d);
W(a.g.getPlayerState(), 2) || eG(a.b, W(a.g.getPlayerState(),
8));
tG(a)
}
f.My = function (a) {
if (uG(this)) {
var b = this.b,
c = wG(this.g);
SF(b.Cc, a, c);
VF(b.Xc, a)
}
};
f.Ry = function (a) {
this.b.setVolume(a.volume, a.muted)
};
f.Fy = function (a) {
fG(this.b, a)
};
f.Gy = function (a) {
gG(this.b, a)
};
f.Cy = function (a, b) {
hG(this.b, a, b)
};
f.Ey = function (a) {
var b = this.b,
c = b.b[a];
c && (c.fd(), wy(c, "menuButtonClick"), b.b[a] = null, b.g[a].dispose(), b.g[a] = null)
};
f.Hy = function (a) {
var b = this.b;
a && b.g[a] ? iG(b, b.g[a], b.b[a]) : b.wd()
};
f.az = function (a) {
a = n(a) ? a : this.g.Hb.Jg().current;
uG(this) && dG(this.b, a)
};
f.zy = function () {
yG(this.g, !this.g.R().xb)
};
f.Iy = function () {
this.g.C.muted ? ms(this.g) : ls(this.g)
};
f.Jy = function () {
Fs(this.g)
};
f.Ky = function () {
zG(this.g)
};
f.Ly = function () {
Gs(this.g)
};
f.Ny = function (a) {
ts(this.g, a, 1)
};
f.vy = function (a) {
var b = us(this.g, 1);
if (b && !b.ea() && !W(b.k, 128) && b.b.g.b && (b = b.j, !b.ea())) {
var c = b.k;
a = a.id;
c.o = "m";
c.g = c.B.b[a];
c.C = c.g;
AG(b, new BG(c.C, c.j, c.o));
CG(b, b.j, b.k.g);
DG(b.j, !1);
b.j.g = null;
EG(b)
}
};
f.Wy = function (a) {
this.g.hk(a)
};
f.Yy = function (a) {
js(this.g, a, !0)
};
f.Oy = function (a) {
FG(this.g, a)
};
f.Py = function (a) {
rs(this.g, a)
};
f.Sy = function (a) {
GG(this.g, a)
};
f.Uy = function () {
HG(this.g)
};
f.wy = function (a) {
IG(this.g, a)
};
f.Ty = function (a) {
(a ? kG : jG).call(this, JG(this, a ? this.lE : this.mE))
};
function JG(a, b) {
return {
$a: Ms(a.g).videoId,
Va: a.g.R().Va,
cb: a.g.R().cb,
onSuccess: b,
onError: a.lC,
context: a
}
}
f.mE = function () {
var a = this.b.Cb.K();
ZE(a, "html5-async-success");
this.g.I("WATCH_LATER_VIDEO_ADDED")
};
f.lE = function () {
ZE(this.b.Cb.K());
this.g.I("WATCH_LATER_VIDEO_REMOVED")
};
f.lC = function (a, b) {
var c = b && b.error_message,
d = this.b.Cb.K();
ZE(d, "html5-async-error");
if (c) {
var e = QE.getInstance(),
g = SE(e, d);
UE(e, d, c);
RE(e, d);
PE(d, g)
}
};
function uG(a) {
return 1 == us(a.g).getPlayerType()
};
var KG = {
0: [],
1: ["autohide-controls", "autominimize-progress-bar"],
2: ["autominimize-controls-aspect", "autohide-controls-fullscreenonly", "autominimize-progress-bar"],
3: ["autominimize-progress-bar"]
};
function LG(a) {
oE.call(this, a);
this.U = this.H = this.N = this.D = null;
this.Ba = [];
this.Ca = this.ca = this.tb = this.j = this.va = null;
this.Ma = this.P = !1;
this.hb = {
x: 0,
y: 0
};
this.Ua = null;
this.C = new uE(this.A);
S(this, this.C);
a = this.app.R().Ub ? 4E3 : 3E3;
this.oa = new Bv(this.Am, a, this);
S(this, this.oa);
this.oa.start()
}
w(LG, oE);
f = LG.prototype;
f.bh = function () {
LG.G.bh.call(this);
this.app.subscribe("appstatechange", this.cD, this);
this.app.subscribe("applicationplayerstatechange", this.dD, this);
this.app.subscribe("initializingmode", this.fD, this);
this.app.subscribe("presentingplayerstatechange", this.eD, this);
this.app.subscribe("onDetailedError", this.gD, this)
};
f.Ng = function () {
LG.G.Ng.call(this);
var a = this.app.R();
this.Jn(a);
this.xn(a);
this.Cn()
};
f.Jn = function (a) {
a.N && this.addClass(a.N + "-theme");
a.Ac && this.addClass("house-brand");
!a.Gf && a.Xd || this.addClass("modest-branding");
a.Ql && this.addClass("html5-hide-share");
a.Up || this.addClass("html5-hide-volume");
a.Ub && (this.addClass("html5-tablet"), O(document.body, "html5-tablet-body"));
a.Wb || (this.Ba = KG[a.Hi], 0 <= this.Ba.indexOf("autohide-controls") && this.addClass("hide-controls-when-cued"));
MG(this) && this.addClass("ideal-aspect");
a.b.L && this.addClass("ytp-autohide-fade")
};
f.xn = function (a) {
if (a.Xd && !a.Wb) {
this.j = new bG(this.A, a.Ub, a.b.g, "en" == a.o);
a.b.ub && (this.j.C = !0);
var b = this.j;
b.ed = this.F;
b.uo = new bF(b.ed);
S(b, b.uo);
b.xf.X(b.ed);
b.ti || (b.ti = new EF(b.yb, b.xu));
b.ti.X(b.ed);
var c = new dv(["div", ["html5-player-chrome", "html5-stop-propagation"]]);
S(b, c);
c.X(b.ed);
c = c.K();
b.Gc = new iF(b.yb);
S(b, b.Gc);
b.Gc.X(c);
b.Gc.listen("click", b.Lv, b);
b.He = new kF(b.yb);
S(b, b.He);
b.He.X(c);
b.He.b.listen("click", ra(b.I, "nextvideo"), b);
b.He.g.listen("click", ra(b.I, "previousvideo"), b);
b.bd = new $F(b.yb);
S(b, b.bd);
b.bd.X(c);
b.bd.b.listen("click", b.Mv, b);
b.yo = new lF(b.bd.g, !0);
b.yo.subscribe("dragmove", b.Iv, b);
b.Cd = new ZF;
S(b, b.Cd);
b.Cd.X(c);
b.mk.listen(b.Cd.b, "click", ra(b.I, "seekto", Infinity));
b.ii = H("html5-threed-popup-menu", b.ed);
b.ee = new dF(b.yb);
b.ee.X(c);
S(b, b.ee);
b.ee.listen("click", b.Hv, b);
b.ic = new WF(b.yb, b.vu, b.wu);
b.ic.hide();
b.ic.X(c);
S(b, b.ic);
b.ic.listen("click", b.Fv, b);
b.dd = new nA(b.yb, "ytp-button-watch-on-youtube", Y(0, "YTP_URL_NAVIGATE"), Y(0, "YTP_URL_NAVIGATE"));
qA(b.dd,
6700);
b.dd.X(c);
S(b, b.dd);
b.dd.listen("click", b.Kv, b);
b.Xc = new UF(b.yb);
S(b, b.Xc);
hG(b, "__default__", b.Xc, b.dd.K());
b.Dl = new nA(b.yb, "ytp-button-playlist", Y(0, "YTP_PLAYLIST"), Y(0, "YTP_PLAYLIST"));
qA(b.Dl, 6400);
b.Dl.X(c);
S(b, b.Dl);
b.Cb = new nA(b.yb, "ytp-button-watch-later", Y(0, "YTP_WATCH_LATER"));
b.yb.wf(b.Cb.K(), "YTP_WATCH_LATER_AS_2", Y(0, "YTP_WATCH_LATER"));
b.Cb.X(c);
qA(b.Cb, 6300);
pA(b.Cb, Y(0, "YTP_WATCH_LATER"));
S(b, b.Cb);
b.Cb.listen("click", b.Jv, b);
b.Cc = new RF(b.yb);
S(b, b.Cc);
b.Cc.listen("change",
b.Ev, b);
b.Cc.listen("blur", b.Dv, b);
b.Wd = new XF(b.yb);
S(b, b.Wd);
b.Wd.listen("change", b.Gv, b);
b.Zd = new $E(b.yb);
S(b, b.Zd);
b.Zd.listen("change", b.Cv, b);
S(this, this.j);
this.tb = new sG(this.app, this.j);
S(this, this.tb)
}
a.kp && (this.Ua = new CE(a.Vb, a.Ac), this.Ua.X(this.g), S(this, this.Ua));
this.N = new DE(2);
O(this.N.element, "html5-video-loader");
O(this.N.element, "html5-center-overlay");
O(this.N.element, "ytp-scalable-icon-grow");
this.N.X(this.g);
S(this, this.N);
this.H = new EE(a.Vb);
this.H.X(this.g);
S(this, this.H);
this.U = new hE;
this.U.X(this.g);
S(this, this.U);
this.C.hide();
this.C.X(this.element)
};
f.cn = function (a) {
LG.G.cn.call(this, a);
NG(this, a);
this.D && BE(this.D);
Q(this.element, "ideal-aspect", MG(this));
this.C.ka && vE(this.C)
};
f.Ml = function () {
LG.G.Ml.call(this);
NG(this, this.Db())
};
f.cD = function (a) {
2 == a ? OG(this) : PG(this);
this.app.R().b.j && 3 == a && this.H.show(this.app.getVideoData())
};
f.eD = function (a) {
if (this.element) {
var b;
b = a.state;
if (W(b, 2)) b = ["ended-mode"];
else {
var c = [];
W(b, 8) ? c.push("playing-mode") : W(b, 4) && c.push("paused-mode");
W(b, 1) && !W(b, 32) && c.push("buffering-mode");
W(b, 32) && c.push("seeking-mode");
W(b, 64) && c.push("unstarted-mode");
b = c
}
W(a.state, 2) || (b = b.concat(this.Ba));
this.Ca && ag(this.element, this.Ca);
$f(this.element, b);
this.Ca = b;
W(us(this.app).k, 1) ? this.N.show() : this.N.hide();
b = us(this.app);
this.app.R().b.j && b.Rh() && !W(b.k, 1) && this.H.hide();
0 > vv(a, 64) && QG(this.app)
}
};
f.dD = function (a) {
!W(a.state, 2) || this.app.R().Ac || RG() ? 0 > vv(a, 2) && PG(this) : OG(this)
};
f.Cn = function () {
var a = this.app.R();
if (a.Mp) {
if (a.Ub) {
var b = t(function (a) {
return SG(a)
}, this);
this.ca = new ZD(this.element, t(function (a) {
Zf(this.element, "cued-mode") ? WD.hasTags(void 0) && this.tm(a) : SG(a) && (this.P ? this.en() : this.Am(), this.j && this.j.wd())
}, this), !1, b);
vy(this, this.element, "gesturechange", this.mB);
vy(this, this.element, "gestureend", this.nB)
} else this.um(), vy(this, this.element, "click", this.en), vy(this, this.element, "mousemove", this.en), vy(this, this.element, "mouseout", this.Am);
var c = t(function () {
var b =
this.b;
b && (ot(b), WD.fillPool(4), a.Ub && cE(), (b = wg(this.element, "click", c, !0)) && yg(b))
}, this);
vy(this, this.element, "click", c, void 0, void 0, !0)
}
};
f.um = function () {
vy(this, this.g, "click", this.tm);
vy(this, this.g, "dblclick", this.is)
};
f.tm = function (a) {
SG(a) && (this.element.focus(), Zf(this.element, "cued-mode") || !this.app.R().Wb) && (TG(this), zG(this.app));
IG(this.app, "screenclick")
};
f.is = function (a) {
6 != this.app.F && this.app.R().Ff && (SG(a) && dz(this.app), IG(this.app, "screendoubleclick"))
};
f.mB = function (a) {
var b = a.scale,
c = this.app.R().xb;
b * (c ? -1 : 1) > (c ? -.7 : 1.3) && dz(this.app);
a.preventDefault()
};
f.nB = function (a) {
a = a.scale;
var b = this.app.R().xb;
a * (b ? -1 : 1) > (b ? -.9 : 1.1) && dz(this.app)
};
function SG(a) {
return !xd(a.target, "html5-stop-propagation")
}
function MG(a) {
a = Kb(new G(a.element.clientWidth, a.element.clientHeight)).toFixed(1);
return "1.3" == a || "1.8" == a
}
f.en = function (a) {
if (a) {
var b = a.x || a.screenX;
a = a.y || a.screenY;
if (this.hb.x == b && this.hb.y == a) return;
this.hb = {
x: b,
y: a
}
}
this.app.b.B = v();
this.Ma = !1;
this.oa.start();
this.P && (this.P = !1, this.removeClass("ytp-user-idle"), this.app.Za("onShowControls"))
};
f.Am = function (a) {
if (a && (a = a.relatedTarget) && nd(this.element, a)) return;
this.Ma = !0;
this.oa.stop();
if (!this.P) {
a = this.j && null != this.j.j;
var b = xs(this.app.B, "playlist"),
b = b && b.loaded;
!this.Ma || a || b || (this.P = !0, this.addClass("ytp-user-idle"), this.app.Za("onHideControls"))
}
};
function OG(a) {
a.H.show(a.app.getVideoData());
a.addClass("cued-mode")
}
function PG(a) {
a.app.R().b.j || a.H.hide();
a.removeClass("cued-mode")
}
f.mh = function (a) {
if (a) {
var b = this.C;
b.b = a;
b.na(a);
this.C.show()
} else a = this.C, a.b = null, a.na(null), this.C.hide()
};
f.gD = function (a) {
if (this.element) {
this.D || (this.D = new AE, this.D.X(this.element), S(this, this.D));
var b = this.app.R(),
c = a.message,
d = "embedded" == b.ba;
a = a.messageKey;
var e;
"YTP_ERROR_GENERIC" != a || b.Ac ? "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK_FLASH" == a ? (e = "https://get.adobe.com/flashplayer/", d = !0) : "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK" != a || b.Ac || (e = "/html5", a = "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK_WITH_LINK") : (e = "//support.google.com/youtube/?p=player_error1", a = "YTP_ERROR_GENERIC_WITH_LINK_2");
e &&
(c = Ld(a, {
BEGIN_LINK: '<br/><a href="' + e + '"' + (d ? ' target="_blank"' : "") + ">",
END_LINK: "</a>"
}));
b = this.D;
yg(b.g);
b.g = [];
iv(b.template, "content", new lE(c));
this.D.show()
}
};
f.fD = function () {
this.D && this.D.hide()
};
function TG(a) {
var b = a.app.getPlayerState(),
c = a.app.getVideoData(),
d = "html5-bezel-pause";
W(b, 8) ? c.qb && !c.Ab && (d = "html5-bezel-stop") : d = "html5-bezel-play";
a = a.U;
a.show(d);
a.b = J(t(a.g, a), 10)
}
f.Rf = function () {
var a = this.app.R();
cg(document.documentElement, "player-size", a.xb ? "fullscreen" : a.ud ? "large" : "small");
LG.G.Rf.call(this)
};
function UG(a, b) {
var c = "scale(" + a + ") !important";
b && (c = "translate(-50%, -50%) " + c);
return ["transform: " + c, "-webkit-transform: " + c, "-moz-transform: " + c, "-o-transform: " + c, "-ms-transform: " + c]
}
function NG(a, b) {
if (!b.isEmpty()) {
var c = b.width,
d = b.height,
e = 0,
g = 0;
c / d > 480 / 360 ? (e = d, g = 360) : (e = c, g = 480);
c = [];
d = Fb(e / g, .5, 1);
c.push(zB(".ytp-scalable-icon-shrink", UG(d, !1)));
d = Fb(e / g * .33, .5, 1);
c.push(zB(".ytp-scalable-icon-grow", UG(d, !0)));
e = a.va;
g = !1;
e || (g = !0, e = bd("style"));
e.innerHTML = c instanceof Array ? c.join("") : c;
g && document.getElementsByTagName("head")[0].appendChild(e);
a.va = e
}
}
f.jk = function (a) {
this.j && eG(this.j, a)
};
f.J = function () {
Bg(this.element);
hd(this.va);
lh(this.ca);
LG.G.J.call(this);
this.H = this.ca = this.U = this.va = null
};
function VG(a, b, c) {
jE.call(this, ["div", ["html5-endscreen", c || "base-endscreen", "html5-stop-propagation"],
["div", "html5-endscreen-content"]
]);
this.$ = "";
this.b = this.template.b["html5-endscreen-content"];
this.j = a;
this.eb = b;
this.Ec = !1
}
w(VG, jE);
VG.prototype.create = function () {
this.Ec = !0
};
VG.prototype.destroy = function () {
this.Ec = !1
};
function WG(a, b) {
var c = !!a.featured,
d = "1" == a.is_episodic,
e = !!a.endscreen_autoplay_session_data;
return b && (c || d) || e
};
function XG() {
X.call(this, ["div", "ytp-channel-banner-container", ["img", "ytp-channel-banner", {
src: "{{banner}}"
}]])
}
w(XG, X);
function YG() {
X.call(this, ["div", "ytp-subscribe-card", ["img", "ytp-author-image", {
src: "{{image}}"
}],
["div", "ytp-subscribe-card-right", ["div", "ytp-author-name", "{{author}}"],
["div", "html5-subscribe-button-container"]
]
])
}
w(YG, X);
function ZG() {
X.call(this, ["div", "ytp-watch-next-card", ["div", "ytp-watch-next-content", ["div", "ytp-watch-next-header", "{{watchnext}}"],
["img", "ytp-watch-next-thumbnail", {
src: "{{image}}"
}],
["div", "ytp-watch-next-title", "{{title}}"],
["div", "ytp-watch-next-views", "{{views}}"],
["div", "ytp-watch-next-uploaded", "{{uploaded}}"]
]]);
this.videoId = null;
iv(this.template, "watchnext", Y(0, "YTP_WATCH_NEXT"))
}
w(ZG, X);
function $G(a, b) {
if (b) {
a.videoId = b.id;
var c = XA(a.videoId, "default.jpg");
iv(a.template, "image", c);
iv(a.template, "title", b.title);
iv(a.template, "views", b.view_count_string);
gx(a.template.K())
} else hx(a.template.K())
};
function aH(a, b, c, d, e, g, h) {
a && (a = {
video_id: a,
html5: 1,
page_subscribe: b ? 1 : 0
}, g && (a.authuser = g), h && (a.pageid = h), ii("/get_video_metadata", {
method: "GET",
onError: d,
onSuccess: c,
Fh: a,
context: e
}))
};
function bH(a, b, c) {
VG.call(this, a, b, "subscribecard-endscreen");
this.o = new XG;
S(this, this.o);
this.A = new dv(["div", "ytp-channel-curtain"]);
S(this, this.A);
this.k = new YG;
S(this, this.k);
(this.g = c ? new ZG : null) && S(this, this.g);
this.hide()
}
w(bH, VG);
bH.prototype.create = function () {
bH.G.create.call(this);
fd(this.b);
this.o.X(this.b);
this.A.X(this.b);
this.k.X(this.b);
if (this.g) {
var a = this.j.getVideoData().W;
a && WG(a[0]) && ($G(this.g, a[0]), this.g.X(this.b))
}
aH(this.j.getVideoData().videoId, !0, this.B, da, this, this.j.R().Va, this.j.R().cb)
};
bH.prototype.B = function (a, b) {
if (this.Ec) {
var c = b.user_info,
d = this.j.getVideoData();
d && (d.Ca = c.external_id);
d = c.channel_logo_url || c.image_url;
iv(this.o.template, "banner", c.channel_banner_url);
iv(this.k.template, "image", d);
iv(this.k.template, "author", c.channel_title || c.username);
this.g && b.watch_next && ($G(this.g, b.watch_next), this.g.X(this.element));
c = c.subscription_button_html;
this.k.template.b["html5-subscribe-button-container"].innerHTML = c ? c : ""
}
};
function cH(a, b) {
return C(a.b.b, b)
};
function dH(a, b) {
var c = ["div", ["video-ads", "html5-stop-propagation"],
["div", "video-ad-interstitial", ["span", "", Y(0, "YTP_AD_RESUME_MESSAGE")]],
["div", "video-ad-status-bar", ["div", "video-ad-label", Y(0, "YTP_ADVERTISEMENT")],
["div", "video-ad-time-left"],
["div", ["html5-progress-bar", "html5-stop-propagation"],
["div", ["html5-ad-progress-list", "html5-progress-list"]]
]
],
["div", "ad-container", {
id: "osd-id"
}]
];
X.call(this, c);
this.V = b
}
w(dH, X);
dH.prototype.g = null;
dH.prototype.j = null;
dH.prototype.b = null;
function eH(a) {
if (!a.g && (a.g = a.template.b["ad-container"], a.V.R().Xb)) {
var b = cH(a.V.R(), "927622") ? "ad-container-single-media-element-annotations" : "ad-container-single-media-element";
O(a.g, b)
}
return a.g
}
function fH(a) {
a.b && (a.V.R().Xb ? (P(a.b, "ad-video"), gH(a.V.app, a.b), a.b = null) : (hd(a.b), tt(a.b)))
}
function hH(a) {
if (!a.j) {
if (a.V.R().Ub) {
var b = bd("button");
O(b, "video-click-tracking");
ed(b, Ld("YTP_VISIT_ADVERTISERS_SITE"));
var c = bd("div");
O(c, "video-click-tracking-container");
c.appendChild(b);
eH(a).appendChild(c)
} else b = bd("div"), $f(b, ["video-click-tracking", "ad-video"]), eH(a).appendChild(b);
a.j = b
}
return a.j
}
dH.prototype.J = function () {
dH.G.J.call(this);
this.b && (gH(this.V.app, this.b), this.b = null);
fH(this);
fd(eH(this));
fd(hH(this));
this.j = this.g = null;
delete this.V
};
function iH(a) {
if (!a.b) {
var b;
b = a.V.app;
if (b.b.Xb) {
var c = qe(b.k),
d = Ce(b.k);
b.W = new ce(c.x, c.y, d.width, d.height);
jH(b.A);
ut(b.k, 1);
tt(b.k);
b = b.k
} else b = WD.getTag(void 0);
a.b = b;
$f(a.b, ["video-stream", "ad-video"])
}
return a.b
};
function kH() {
wE.call(this, 84, 84);
this.g = this.width / 2;
this.k = this.height / 2
}
w(kH, wE);
var lH = 3 * Math.PI / 2,
mH = 2 * Math.PI;
function nH(a, b) {
var c = a.app.g.A;
jE.call(this, ["a", "videowall-still", {
tabIndex: 0
},
["span", "videowall-still-featured-label", Y(0, "YTP_FEATURED")],
["span", "videowall-still-info", ["span", "videowall-still-info-bg"],
["span", "videowall-still-info-title", "{{title}}"],
["span", "videowall-still-info-author", "{{author}}"],
["span", "videowall-still-info-duration", "{{duration}}"],
["span", "videowall-still-info-view-count", "{{view_count}}"]
],
["div", ["videowall-still-listlabel-episodic", "videowall-still-listlabel"],
["div", "videowall-still-listlabel-episodic-heading", Y(0, "YTP_PLAYLIST_UP_NEXT")],
["span", "videowall-still-listlabel-episodic-icon"],
["div", "videowall-still-listlabel-episodic-info", ["span", "videowall-still-listlabel-episodic-index", ["span", "", "{{episodic_index}}"], " / ", ["span", "", "{{episodic_length}}"]],
["span", "", "{{episodic_title}}"]
]
],
["span", ["videowall-still-listlabel-regular", "videowall-still-listlabel"],
["span", "videowall-still-listlabel-icon"], Y(0, "YTP_PLAYLIST"), ["span", "videowall-still-listlabel-length",
" (", ["span", "", "{{playlist_length}}"], ")"
]
],
["span", ["videowall-still-listlabel-mix", "videowall-still-listlabel"],
["span", "videowall-still-listlabel-mix-icon"], Y(0, "YTP_MIX"), ["span", "videowall-still-listlabel-length", " (50+)"]
]
]);
this.V = a;
this.D = b;
this.F = c;
this.A = "";
this.B = {};
this.g = {};
this.C = this.o = null;
this.j = 0;
this.b = this.k = null;
this.listen("click", this.Vu);
this.listen("keypress", this.Wu)
}
w(nH, jE);
f = nH.prototype;
f.update = function (a, b) {
this.B = a.session_data;
this.g = a.endscreen_autoplay_session_data;
this.g || "1" != a.endscreen_autoplay || (this.g = {
autonav: "1",
feature: "related-auto",
playnext: "1"
});
this.A = a.id || a.video_id;
this.o = a.list;
var c = !1,
d = !1,
e = !1;
this.g || ("1" == a.is_episodic ? d = !0 : this.o && "RD" == Or(this.o).type ? e = !0 : this.o && (c = !0));
var g = "mqdefault.jpg";
b && (g = "hqdefault.jpg");
var h = Zb(a);
c || d || e ? (h.title || (h.title = a.playlist_title, h.author = a.playlist_author), h.playlist_length || (h.playlist_length = 0), h.episodic_title =
h.title, h.episodic_index = parseInt(h.index, 10) + 1, h.episodic_length = h.playlist_length) : h.duration = kv(a.length_seconds);
var k = this.A;
c && a.thumbnail_ids && (k = a.thumbnail_ids.split(",")[0]);
g = XA(k, g);
this.element.style.backgroundImage = "url(" + g + ")";
this.template.update(h);
Q(this.element, "videowall-still-featured", !!a.featured);
Q(this.element, "videowall-still-list", c);
Q(this.element, "videowall-still-episodic", d);
Q(this.element, "videowall-still-mix", e)
};
f.select = function (a, b) {
oH(this);
var c = this.V.app,
d = this.A,
e = a ? this.g : this.B,
g = this.o || void 0;
if (!d && !g) throw Error("Playback source is invalid");
d = {
video_id: d,
list: g
};
c.b.xb || "detailpage" != c.b.ba ? g ? (c.P = !1, Es(c, d, void 0, void 0, void 0)) : ys(c, d, 1) : (g = new rr(d), g = pH(c.b, g, {}), p("yt.player.exports.navigate")(g, e, !0), c.ek(g, b))
};
f.Np = function () {
var a = new Date - this.C,
b = this.k,
c = a / 1E4;
b.context.clearRect(0, 0, b.width, b.height);
b.context.beginPath();
b.context.arc(b.g, b.k, 42, 0, mH);
b.context.fillStyle = "rgba(0, 0, 0, 0.6)";
b.context.fill();
var d = Math.sqrt(3) / 2 * 35;
b.context.save();
b.context.fillStyle = "#fff";
b.context.translate(d, b.g);
b.context.beginPath();
b.context.lineTo(0, d / 2);
b.context.lineTo(28, 0);
b.context.lineTo(0, -d / 2);
b.context.closePath();
b.context.fill();
b.context.restore();
b.context.beginPath();
b.context.arc(b.g, b.k, 40,
lH, c * mH + lH, !1);
b.context.lineWidth = 4;
b.context.strokeStyle = "#fff";
b.context.stroke();
b = Math.max(1E4 - a, 0);
iv(this.b, "autoplay", Ld("YTP_AUTOPLAY_COUNTDOWN_2", {
SECONDS_LEFT: Math.ceil(b / 1E3)
}));
1E4 <= a && this.select(!0)
};
f.Zw = function (a) {
a.stopPropagation();
this.j && (this.D.log({
cancelButtonClick: "1"
}), oH(this))
};
function oH(a) {
a.j && (Id(a.j), a.j = 0, Q(a.element, "videowall-still-autoplay", !1))
}
f.Vu = function (a) {
this.select(!1, a.ctrlKey);
a.stopPropagation()
};
f.Wu = function (a) {
switch (a.keyCode) {
case 13:
case 32:
this.select(), a.preventDefault()
}
};
f.J = function () {
oH(this);
nH.G.J.call(this)
};
function qH(a, b, c) {
VG.call(this, a, b, "videowall-endscreen");
this.C = c;
this.A = [];
this.g = this.k = null;
this.B = !1;
this.o = 0;
this.eb.subscribe("onResize", this.hB, this);
this.eb.subscribe("videodatachange", this.iB, this);
this.hide()
}
w(qH, VG);
qH.b = "feature-video";
f = qH.prototype;
f.create = function () {
qH.G.create.call(this);
var a = this.j.getVideoData();
a && (this.g = a.W);
rH(this)
};
f.destroy = function () {
fd(this.b);
this.g = [];
qH.G.destroy.call(this)
};
f.show = function () {
qH.G.show.call(this);
var a;
if (a = this.g && this.g.length) a = !!sH(this, 0).g;
if (a) {
a = sH(this, 0);
oH(a);
if (!a.b) {
a.b = new dv(["div", ["videowall-still-listlabel-autoplay", "videowall-still-listlabel"],
["div", "videowall-still-listlabel-autoplay-label", ["span", "videowall-still-listlabel-autoplay-label-message", Y(0, "YTP_AUTOPLAY")], " ", ["span", "", "{{autoplay}}"]]
]);
S(a, a.b);
a.b.X(a.element);
var b = new nA(a.F);
S(a, b);
b.listen("click", a.Zw, a);
b.X(a.b.K(), 0);
oA(b, "videowall-still-listlabel-autoplay-cancel");
b.na(Y(0, "YTP_CANCEL"));
a.k = new kH;
S(a, a.k);
O(a.k.K(), "autoplay-play-canvas");
a.k.X(a.element)
}
Q(a.element, "videowall-still-autoplay", !0);
a.D.log({
cancelButtonShow: "1"
});
a.C = new Date;
a.j = Hd(t(a.Np, a), 50);
a.Np()
}
};
f.hide = function () {
qH.G.hide.call(this);
var a = this.A[0];
a && oH(a)
};
function rH(a) {
if (a.Ec) {
fd(a.b);
var b = Be(a.K()),
c = b.height,
d;
t: {
if (Zf(Zs(a.j), "ad-showing") && (d = H("ad-container"))) {
d = Ce(d).height;
break t
}
d = 0
}
b.height = c - d;
d = Math.floor(b.width / 158);
var e = Math.floor(b.height / (158 / 1.45));
if (1 > e || 1 > d) a.o = 0;
else {
var g = a.g.length,
c = !1;
WG(a.g[0], 2 < e && 2 < d) && (c = !0, g += 3);
Q(a.b, qH.b, c);
for (var h = 0, k = 0, l = Kb(b), q = !0; 0 <= g && (h < d || k < e);) {
var s = g >= k,
u = g >= h;
if (q && u || !s && u) g -= h, k++;
else if (s) g -= k, h++;
else break;
q = h / k * 1.45 > l
}
a.B = q;
d = new G(h, k);
a.B ? (e = 1 / d.width, e *= b.width, g = e / 1.45) :
(e = 1 / d.height, g = b.height * e, e = 1.45 * g);
e = new G(Math.floor(e), Math.floor(g));
a.o = d.width * d.height;
c && (a.o -= 3);
a.k && BB(a.k);
c = tH(e);
g = {
jd: a.k
};
a.k = AB(".videowall-still", c, g);
c = tH(e.clone().scale(2));
g.jd = a.k;
h = "." + qH.b + " .videowall-still:first-child";
AB(h, c, g);
c = e.width * d.width;
d = e.height * d.height;
ze(a.b, c, d);
oe(a.b, (b.width - c) / 2, (b.height - d) / 2)
}
b = 0;
for (c = a.o; b < c; b++) sH(a, b).X(a.b)
}
}
function sH(a, b) {
var c = a.A[b];
c || (c = new nH(a.j, a.C), S(a, c), a.A[b] = c);
c.update(a.g[b], 0 == b && a.g[0].featured);
return c
}
function tH(a) {
return ["width:" + a.width + "px", "height:" + a.height + "px"]
}
f.hB = function () {
rH(this)
};
f.iB = function () {
var a = this.j.getVideoData().W;
this.g != a && (this.g = a, rH(this))
};
function uH(a) {
Ot.call(this, a);
Kd({});
this.wa = "endscreen";
this.jc = "end";
this.g = null;
var b = a.R();
vH(a) ? this.g = new qH(this.b, this.N, this) : b.qh ? (a = b.b.D, b = new bH(this.b, this.N, a), a && R(b.g.K(), "click", t(this.Vz, this)), this.g = b) : this.g = new VG(this.b, this.N);
this.g.X(Zs(this.b))
}
w(uH, Ot);
function wH(a) {
var b = a.R(),
c = a.getVideoData(),
d = 1 == us(a.app).getPlayerType();
a = !vH(a) || !(!c.W || !c.W.length);
return xH(b) && !Kr(c, "ypc_module") && d && a
}
function vH(a) {
a = a.R();
return a.Kc && !a.qh
}
f = uH.prototype;
f.Ka = function (a) {
return wH(a)
};
f.create = function () {
uH.G.create.call(this);
var a = Math.max(1E3 * (this.b.getVideoData().Pa - 10), 0),
a = new Ds(a, 2147483647, {
id: "preload"
}),
b = new Ds(2147483647, 2147483647, {
id: "load",
priority: 6
});
this.Hf(a, b)
};
f.destroy = function () {
Pt(this);
this.g.destroy();
uH.G.destroy.call(this)
};
f.load = function () {
uH.G.load.call(this);
this.g.show();
if (this.b.R().qh && .01 > Math.random()) {
var a = this.b.R().b.D;
this.log({
trailerEndscreenShow: 1,
watchNext: a ? 1 : 0
})
}
this.loaded = !0
};
f.unload = function () {
uH.G.unload.call(this);
this.g.hide();
this.loaded = !1
};
f.Ic = function (a) {
uH.G.Ic.call(this, a);
"preload" == a.getId() ? this.g.create() : yH(this.b.app) || this.load()
};
f.ld = function (a) {
"load" == a.getId() && this.unload();
uH.G.ld.call(this, a)
};
f.Vz = function (a) {
var b = this.g.g.videoId,
b = zH(this.b.R(), b, null);
Tt(this, b, a.ctrlKey)
};
function AH(a) {
return wH(a) ? new uH(a) : null
};
function BH(a) {
var b = document.location.protocol + "//" + document.domain + "/post_login",
b = pf(b, "mode", "subscribe"),
b = pf("/signin?context=popup", "next", b),
b = pf(b, "feature", "sub_button");
if (b = window.open(b, "loginPopup", "width=375,height=440,resizable=yes,scrollbars=yes", !0)) {
var c = uh("LOGGED_IN", function (b) {
wh(Fd("LOGGED_IN_PUBSUB_KEY"));
Dd("LOGGED_IN", !0);
a(b)
});
Dd("LOGGED_IN_PUBSUB_KEY", c);
b.moveTo((screen.width - 375) / 2, (screen.height - 440) / 2)
}
}
ca("yt.pubsub.publish", xh, void 0);
function CH() {
ME.call(this)
}
w(CH, ME);
ea(CH);
f = CH.prototype;
f.Td = "subscription-button";
f.register = function () {
OE(this, "click", this.dt);
NE(this, "subscription-subscribe-loading", this.ct);
NE(this, "subscription-subscribe-loaded", this.bt);
NE(this, "subscription-unsubscirbe-loading", this.ct);
NE(this, "subscription-unsubscribe-loaded", this.bt);
NE(this, "subscription-subscribe-success", this.ND);
NE(this, "subscription-unsubscribe-success", this.OD);
NE(this, "subscription-enable-ypc", this.MD);
NE(this, "subscription-disable-ypc", this.LD)
};
f.dt = function (a) {
var b = this.Y(a, "href"),
c;
c = (c = Fd("PLAYER_CONFIG")) && c.args && void 0 !== c.args.authuser ? !0 : !(!Fd("SESSION_INDEX") && !Fd("LOGGED_IN"));
if (b) a = this.Y(a, "target") || "_self", window.open(b, a);
else if (c) {
b = this.Y(a, "channel-external-id");
c = this.Y(a, "sessionlink");
var d;
if (this.Y(a, "ypc-enabled")) {
d = this.Y(a, "ypc-item-type");
var e = this.Y(a, "ypc-item-id"),
g = this.Y(a, "ypc-offers-url");
d = {
itemType: d,
itemId: e,
offersUrl: g,
subscriptionElement: a
}
} else d = null;
e = this.Y(a, "parent-url");
this.Y(a, "is-subscribed") ?
(g = this.Y(a, "subscription-id"), xh("subscription-unsubscribe", b, g, d, a, c, e)) : xh("subscription-subscribe", b, d, a, c, e)
} else DH(this, a)
};
f.ct = function (a) {
this.dg(a, this.lt, !0)
};
f.bt = function (a) {
this.dg(a, this.lt, !1)
};
f.ND = function (a, b) {
this.dg(a, this.nt, !0, b)
};
f.OD = function (a) {
this.dg(a, this.nt, !1)
};
f.MD = function (a) {
this.dg(a, this.cE)
};
f.LD = function (a) {
this.dg(a, this.bE)
};
f.nt = function (a, b, c) {
b ? (cg(a, "is-subscribed", "true"), c && cg(a, "subscription-id", c)) : (this.removeData(a, "is-subscribed"), this.removeData(a, "subscription-id"));
EH(this, a)
};
f.lt = function (a, b) {
var c = xd(a, "yt-uix-button-subscription-container");
Q(c, "yt-subscription-button-disabled-mask-container", b);
a.setAttribute("aria-busy", b ? "true" : "false");
a.disabled = b
};
function EH(a, b) {
var c = a.Y(b, "style-type"),
d = !!a.Y(b, "is-subscribed"),
c = "-" + c,
e = "yt-uix-button-subscribed" + c;
Q(b, "yt-uix-button-subscribe" + c, !d);
Q(b, e, d);
a.Y(b, "subscriber-count-tooltip") && !a.Y(b, "subscriber-count-show-when-subscribed") && (c = Z(QE.getInstance()), Q(b, c, !d), b.title = d ? "" : a.Y(b, "subscriber-count-title"));
d ? J(function () {
O(b, "hover-enabled")
}, 1E3) : P(b, "hover-enabled")
}
f.cE = function (a) {
var b = !!this.Y(a, "ypc-item-type"),
c = !!this.Y(a, "ypc-item-id"),
d = !!this.Y(a, "ypc-offers-url");
!this.Y(a, "ypc-enabled") && b && c && d && (O(a, "ypc-enabled"), cg(a, "ypc-enabled", "true"))
};
f.bE = function (a) {
this.Y(a, "ypc-enabled") && (P(a, "ypc-enabled"), this.removeData(a, "ypc-enabled"))
};
function FH(a, b) {
var c = Qc(Z(a));
return fb(c, function (a) {
return b == this.Y(a, "channel-external-id")
}, a)
}
f.CE = function (a, b, c) {
var d = vb(arguments, 2);
y(a, function (a) {
b.apply(this, rb(a, d))
}, this)
};
f.dg = function (a, b, c) {
var d = FH(this, a),
d = rb([d], vb(arguments, 1));
this.CE.apply(this, d)
};
function DH(a, b) {
var c = t(function (a) {
a.discoverable_subscriptions && Dd("SUBSCRIBE_EMBED_DISCOVERABLE_SUBSCRIPTIONS", a.discoverable_subscriptions);
this.dt(b)
}, a);
BH(c)
};
function GH(a, b, c) {
b || (b = {});
var d = c || window;
c = "undefined" != typeof a.href ? a.href : String(a);
a = b.target || a.target;
var e = [],
g;
for (g in b) switch (g) {
case "width":
case "height":
case "top":
case "left":
e.push(g + "=" + b[g]);
break;
case "target":
case "noreferrer":
break;
default:
e.push(g + "=" + (b[g] ? 1 : 0))
}
g = e.join(",");
if (b.noreferrer) {
if (b = d.open("", a, g)) oc && -1 != c.indexOf(";") && (c = "'" + c.replace(/'/g, "%27") + "'"), b.opener = null, c = Ca(c), b.document.write('<META HTTP-EQUIV="refresh" content="0; url=' + c + '">'), b.document.close()
} else b =
d.open(c, a, g);
return b
}
function HH(a, b) {
var c;
c = b || {};
c.target = c.target || a.target || "YouTube";
c.width = c.width || 600;
c.height = c.height || 600;
(c = GH(a, c)) ? (c.opener || (c.opener = window), c.focus()) : c = null;
return !c
};
function IH(a) {
X.call(this, ["div", "ytp-action-buttons"]);
this.j = new nA(a, "ytp-button-info", Y(0, "YTP_MORE_INFO"));
S(this, this.j);
this.j.X(this.element);
qA(this.j, 3500);
this.k = new nA(a, "ytp-button-share", Y(0, "YTP_SHARE"));
S(this, this.k);
this.k.X(this.element);
qA(this.k, 3400);
this.b = new nA(a, "ytp-button-dislike", Y(0, "YTP_DISLIKE"));
S(this, this.b);
qA(this.b, 3300);
cg(this.b.K(), "tooltip-below", "1");
a.wf(this.b.K(), "YTP_DISLIKE_AS", Y(0, "YTP_DISLIKE"));
this.g = new nA(a, "ytp-button-like", Y(0, "YTP_LIKE"));
S(this, this.g);
qA(this.g, 3200);
cg(this.g.K(), "tooltip-below", "1");
a.wf(this.g.K(), "YTP_LIKE_AS", Y(0, "YTP_LIKE"))
}
w(IH, X);
function JH() {
X.call(this, ["div", "ytp-sentiment-display", ["div", "ytp-sentiment-bar", ["div", "ytp-sentiment-bar-likes"],
["div", "ytp-sentiment-bar-dislikes"]
]]);
this.g = this.template.b["ytp-sentiment-bar-likes"];
this.b = this.template.b["ytp-sentiment-bar-dislikes"]
}
w(JH, X);
JH.prototype.J = function () {
this.b = this.g = null;
JH.G.J.call(this)
};
function KH() {
var a = ["button", "ytp-button-share-more", {
tabIndex: 3800
},
["div", ["ytp-button-share-more-icon", "yt-uix-button-icon-new-window"]],
["span", "ytp-button-share-more-content", Y(0, "YTP_MORE")]
];
X.call(this, a)
}
w(KH, X);
function LH(a, b, c, d) {
nA.call(this, a, "share-service-icon-" + d + "-sharebar", b, c);
O(this.element, "share-service-icon-sharebar");
qA(this, 3700)
}
w(LH, nA);
function MH() {
X.call(this, ["div", "ytp-share-url-container", {
tabIndex: 3600
},
["input", "ytp-share-url"]
]);
this.b = this.template.b["ytp-share-url"]
}
w(MH, X);
MH.prototype.J = function () {
this.b = null;
MH.G.J.call(this)
};
function NH(a, b) {
var c = ["div", "share-bar", ["div", "share-bar-content"],
["div", "share-bar-playlist", ["input", ["ytp-share-bar-checkbox", "ytp-share-bar-checked"], {
type: "checkbox",
checked: "checked"
}],
["div", "share-bar-playlist-message", Y(0, "YTP_SHARE_WITH_PLAYLIST")]
]
];
jE.call(this, c);
this.k = b;
this.B = a;
this.Qa = new zv(this);
this.b = null;
this.o = [];
this.j = this.g = null;
this.A = new nA(this.B, "yt-uix-button-icon-share-bar-close", Y(0, "YTP_CLOSE"), Y(0, "YTP_CLOSE"));
this.A.X(this.template.b["share-bar-content"]);
qA(this.A, 3900)
}
w(NH, jE);
function OH(a) {
var b = {
action_get_share_info: 1,
feature: "player_embedded",
video_id: a.j ? a.j.videoId : void 0
};
a.k.Va && (b.authuser = a.k.Va);
a.k.cb && (b.pageid = a.k.cb);
var c;
PH(a) ? (c = H("ytp-share-bar-checkbox"), c = !c || Zf(c, "ytp-share-bar-checked")) : c = !1;
c && (b.list = PH(a));
ii("/share_ajax", {
context: a,
method: "GET",
onError: a.F,
onSuccess: a.C,
Fh: b
})
}
NH.prototype.C = function (a, b) {
if (!this.ea()) {
QH(this);
var c = this.template.b["share-bar-content"];
this.b = new MH;
S(this, this.b);
Sc(this.b.b, {
value: b.url_short
});
this.b.X(c);
for (var d = b.links, e = 0; e < Math.min(3, d.length); e++) {
var g = new LH(this.B, d[e].name, d[e].sname, d[e].img);
S(this, g);
g.X(c);
this.Qa.listen(g, "click", ra(HH, d[e].url, {}));
this.o.push(g)
}
this.g = new KH;
S(this, this.g);
this.Qa.listen(this.g, "click", t(this.H, this, b.more));
this.g.X(c);
this.Qa.listen(this.template.b["ytp-share-bar-checkbox"], "click",
this.D);
this.I("menu_show")
}
};
NH.prototype.F = function () {};
NH.prototype.H = function (a) {
GH(a)
};
function PH(a) {
return a.j ? a.j.Na : void 0
}
NH.prototype.D = function () {
var a = H("ytp-share-bar-checkbox");
bg(a, "ytp-share-bar-checked");
OH(this)
};
function QH(a) {
a.Qa.removeAll();
a.b && (a.b.fd(), a.b = null);
a.g && (a.g.fd(), a.g = null);
y(a.o, function (a) {
hd(a.K())
});
a.o = []
};
function RH(a, b) {
jE.call(this, ["div", ["html5-info-bar", "html5-stop-propagation"],
["div", "html5-title", ["div", ["html5-like-dislike-buttons", "hid"]],
["div", "", "{{titlelogobutton}}"],
["div", "html5-title-text-wrapper", "{{titlebutton}}"]
],
["div", "html5-info-panel", ["div", "html5-info-panel-loading-icon"],
["div", ["html5-info-panel-content", "hid"],
["div", "", ["div", "html5-author-img", ["img", "", {
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
}]],
["div", "html5-author-info", ["div", "html5-author-name"]],
["div", "html5-subscribe-button-container"]
],
["div", "", ["div", "html5-video-info", ["div", "html5-view-count"]],
["p", "html5-description-text", {
dir: "auto"
}]
]
]
]
]);
this.j = b;
this.B = a;
this.Qa = new zv(this);
this.N = new bF(this.K());
S(this, this.N);
this.b = null;
var c = this.template.b["html5-title"];
this.A = new nA(this.B);
O(this.A.K(), "html5-title-text");
S(this, this.A);
qA(this.A, 3100);
this.A.listen("click", this.Sk, this);
iv(this.template, "titlebutton", this.A);
var d = new nA(this.B, "html5-title-logo",
Y(0, "YTP_URL_NAVIGATE"), Y(0, "YTP_URL_NAVIGATE"));
S(this, d);
d.na("YouTube");
qA(d, 3550);
cg(d.K(), "tooltip-below", "1");
d.listen("click", this.Sk, this);
iv(this.template, "titlelogobutton", d);
this.k = new IH(this.B);
S(this, this.k);
this.k.X(c, 1);
this.Qa.listen(this.k.k, "click", this.ki);
this.Qa.listen(this.k.j, "click", this.zk);
this.j.Ac && this.k.j.hide();
this.o = null;
this.F = !1;
this.g = null
}
w(RH, jE);
f = RH.prototype;
f.update = function (a) {
this.b = a;
if (this.g) {
var b = this.g;
b.j = a;
OH(b)
}
a = a.title || "";
this.A.na(a);
pA(this.A, a)
};
f.Sk = function () {
this.wt()
};
f.zk = function () {
if (!this.F) {
this.F = !0;
aH(this.b ? this.b.videoId : void 0, !1, this.fA, da, this, this.j.Va, this.j.cb);
if (!this.o) {
var a = this.template.b["html5-info-panel-loading-icon"];
this.o = new DE;
S(this, this.o);
O(this.o.element, "html5-info-panel-loader");
this.o.X(a);
S(this, this.o)
}
this.o.show()
}
P(this.element, "show-share");
return bg(this.element, "show-more-info")
};
f.ki = function (a) {
P(this.element, "show-more-info");
if ("detailpage" != this.j.ba) {
if (!this.g) {
var b = this.g = new NH(this.B, this.j);
b.j = this.b;
OH(b);
this.g.X(this.template.b["html5-info-bar"]);
this.Qa.listen(this.g.A, "click", this.ki);
this.g.subscribe("menu_show", t(this.pq, this))
}
bg(this.element, "show-share");
this.pq();
a && a.stopPropagation();
Q(this.element, "share-with-playlist", !!PH(this.g))
}
};
f.pq = function () {
Zf(this.element, "show-share") && this.g.b && this.g.b.K().focus()
};
f.fA = function (a, b) {
if (!this.ea()) {
var c = this.template.b["html5-info-panel"],
d = b.user_info;
this.b && (this.b.Ca = d.external_id);
var e = H("html5-author-img", c).getElementsByTagName("img")[0];
e.src = d.image_url;
this.Qa.listen(e, "click", this.Oq);
e = H("html5-author-name", c);
pd(e, d.channel_title || d.public_name || d.username);
this.Qa.listen(e, "click", this.Oq);
var e = b.video_info,
g = H("html5-subscribe-button-container", c);
g.innerHTML = d.subscription_button_html ? d.subscription_button_html : "";
d = CH.getInstance();
(d = H(Z(d),
g)) && this.B.wf(d, "YTP_SUBSCRIBE_AS");
H("html5-view-count", c).innerHTML = e.view_count_string;
var d = parseInt(e.likes_count_unformatted, 10),
g = parseInt(e.dislikes_count_unformatted, 10),
h = new JH;
S(this, h);
var k = 0,
l = 0;
0 < d + g && (k = 100 * d / (d + g), l = 100 * g / (d + g));
h.g.style.width = k + "%";
h.b.style.width = l + "%";
h.X(H("html5-video-info", c), 2);
d = H("html5-description-text", c);
pd(d, e.description);
this.o.hide();
c = H("html5-info-panel-content", c);
gx(c)
}
};
f.Oq = function () {
var a = this.j,
b = this.b,
c = "",
c = b.Ca ? a.wb + "channel/UC" + b.Ca : a.wb + "user/" + b.th;
this.hn(c)
};
f.hn = function (a) {
GH(a)
};
f.wt = function () {
this.hn(pH(this.j, this.b))
};
f.J = function () {
this.Qa.removeAll();
this.b = this.j = null;
RH.G.J.call(this)
};
function SH() {
X.call(this, ["div", "ytp-playlist-tray-index-length", ["span", "ytp-playlist-tray-index", "{{index}}"], " / ", ["span", "ytp-playlist-tray-length", "{{length}}"]])
}
w(SH, X);
SH.prototype.Og = function (a) {
iv(this.template, "index", a + 1)
};
function TH(a) {
nC.call(this, a, "ytp-button-expand", Y(0, "YTP_ST_EXPAND"), "ytp-button-collapse", Y(0, "YTP_ST_COLLAPSE"));
this.na([
["div", "ytp-button-playlist-icon"],
["div", "ytp-button-playlist-text", Y(0, "YTP_PLAYLIST")]
])
}
w(TH, nC);
function UH(a) {
X.call(this, ["div", "ytp-playlist-tray-controller"]);
this.g = new TH(a);
this.g.X(this.template.K());
S(this, this.g);
this.b = new SH;
this.b.X(this.template.K());
S(this, this.b)
}
w(UH, X);
function VH(a, b) {
X.call(this, ["div", "ytp-playlist-tray-item", ["span", "ytp-playlist-tray-item-index", "{{index}}"],
["span", "ytp-playlist-tray-item-now-playing", "\u25b6"],
["img", "ytp-playlist-tray-item-thumbnail", {
src: "{{image}}"
}],
["span", "ytp-playlist-tray-item-title", "{{title}}"],
["span", "ytp-playlist-tray-item-author", "{{author}}"]
]);
this.b = b;
this.template.update({
index: b + 1,
title: a.title,
author: a.th,
image: XA(a.videoId, "default.jpg")
})
}
w(VH, X);
VH.prototype.Og = function (a) {
Q(this.element, "ytp-playlist-tray-item-current", this.b == a)
};
function WH() {
X.call(this, ["div", "ytp-playlist-tray-tray"]);
this.b = null;
this.k = new zv(this);
this.g = []
}
w(WH, X);
function XH(a, b) {
b != a.b && (a.b && a.b.ia("shuffle", a.j, a), a.b = b, a.b.subscribe("shuffle", a.j, a), a.j())
}
WH.prototype.j = function () {
this.k.removeAll();
this.g = [];
fd(this.element);
for (var a = 0; a <= this.b.Zb - 1; ++a) {
var b = $r(this.b, a);
b && (b = new VH(b, a), b.Og(this.b.Ha), this.g.push(b), this.k.listen(b, "click", ra(this.o, a)), b.X(this.element))
}
};
WH.prototype.o = function (a) {
a = {
index: a
};
var b = document.createEvent("CustomEvent");
b.initCustomEvent("playvideoat", !0, !0, a || null);
this.dispatchEvent(b)
};
WH.prototype.J = function () {
this.k.removeAll();
WH.G.J.call(this)
};
function YH(a) {
Ot.call(this, a);
var b = Zs(a);
this.B = new zv(this);
this.C = a.app.g.A;
this.k = new dv(["div", ["ytp-playlist-tray-container", "html5-stop-propagation"]]);
S(this, this.k);
Ys(this.b, this.k.K());
this.j = new WH;
this.B.listen(this.j, "playvideoat", t(this.nv, this));
S(this, this.j);
this.j.X(this.k.K(), 0);
this.o = H("ytp-button-playlist", b);
R(this.o, "click", t(this.ep, this));
this.A = !1;
this.g = new UH(this.C);
this.g.X(H("html5-title", void 0), 0);
this.B.listen(this.g.g, "click", this.ep);
this.subscribe("fullscreentoggled",
this.Ko, this);
this.subscribe("videodatachange", this.Lo, this);
this.subscribe("clearvideooverlays", this.unload, this)
}
w(YH, Ot);
f = YH.prototype;
f.wa = "playlist";
f.create = function () {
YH.G.create.call(this);
var a = this.b.lc();
a && (this.kh(), a.subscribe("shuffle", this.kh, this))
};
f.kh = function () {
var a = this.b.Hl(),
b = this.g.b;
null != a ? b.show() : b.hide();
this.g.b.Og(a);
a = this.g.b;
b = this.b.lc();
iv(a.template, "length", b.Zb)
};
f.destroy = function () {
var a = this.b.lc();
a ? a.ia("shuffle", this.kh, this) : (this.ia("fullscreentoggled", this.Ko, this), this.ia("videodatachange", this.Lo, this), this.ia("clearvideooverlays", this.unload, this), XH(this.j, null), YH.G.destroy.call(this))
};
f.load = function () {
this.loaded = !0;
YH.G.load.call(this);
var a = this.b.lc();
this.A || (XH(this.j, a), this.kh(), a.subscribe("shuffle", this.kh, this), this.A = !0);
for (var a = this.j, b = 0; b < a.g.length; b++) a.g[b].Og(a.b.Ha);
pC(this.g.g)
};
f.unload = function () {
this.loaded = !1;
YH.G.unload.call(this);
qC(this.g.g)
};
f.nv = function (a) {
this.b.zp(a.detail.index);
this.unload()
};
f.ep = function () {
this.loaded ? this.unload() : (this.I("command_clear_video_overlays"), this.load())
};
f.hide = function () {
var a = H("ytp-playlist-tray-info");
P(a, "show-more-info");
P(a, "show-share")
};
f.Ko = function (a) {
var b = this.b.R().ba;
this.loaded && !a && "detailpage" == b && this.unload()
};
f.Lo = function () {
this.g.b.Og(this.b.Hl());
var a = this.g.b,
b = this.b.lc();
iv(a.template, "length", b.Zb)
};
YH.Ka = function (a) {
return !!a.lc()
};
YH.prototype.Ka = function (a) {
return YH.Ka(a)
};
YH.b = function (a) {
return YH.Ka(a) ? new YH(a) : null
};
YH.prototype.J = function () {
Bg(this.o);
this.o = null;
YH.G.J.call(this)
};
function ZH(a) {
Qd("/gen_204?" + a, void 0)
}
function $H(a, b, c, d, e, g) {
var h = {};
b && (h.v = b);
c && (h.list = c);
d && (h.url = d);
a = {
name: a,
locale: e,
feature: g
};
for (var k in h) a[k] = h[k];
h = qf("/sharing_services", a);
Qd(h)
};
function aI(a, b) {
this.b = a;
this.g = !!b
}
w(aI, jh);
function bI(a, b, c) {
if (c)
if (a.g) cI(b, c);
else {
var d;
a.b && (d = dI(a.b));
d && b.length ? (d = [d, "/cache/videos?q=", b.join("&q=")].join(""), ii(d, {
format: "JSON",
method: "GET",
context: a,
timeout: 2E3,
onSuccess: function (a, d) {
var h = 0;
d && d.aB && (h = d.aB.length);
eI("search", "success", {
"num-requested": b.length,
"num-cached": h
});
c(d)
},
onError: function () {
eI("search", "error", {
"num-requested": b.length
});
c({})
},
ih: function () {
eI("search", "timeout", {
"num-requested": b.length
});
fI("__notfound__");
c({})
}
})) : c({})
}
}
function gI(a, b, c) {
if (c)
if (a.g) c({
id: b,
OE: [{
PE: 18,
QE: 14200992E5
}]
});
else {
var d;
a.b && (d = dI(a.b));
d && b ? (d = [d, "cache/videos", b, "metadata"].join("/"), ii(d, {
format: "JSON",
method: "GET",
context: a,
timeout: 600,
onSuccess: function (a, d) {
c(d);
eI("meta", "success", {
v: b
})
},
onError: function () {
eI("meta", "error", {
v: b
});
c({})
},
ih: function () {
eI("meta", "timeout", {
v: b
});
fI("__notfound__");
c({})
}
})) : c({})
}
}
function eI(a, b, c) {
a = {
a: "spacecast",
module: "cache",
request: a,
status: b
};
bc(a, c);
ZH(of(a))
}
function cI(a, b) {
a.length ? b({
ids: a
}) : b({})
}
aI.prototype.J = function () {
this.b = null;
aI.G.J.call(this)
};
function hI(a) {
(this.b = a) && fI("http://" + a)
}
w(hI, jh);
function dI(a) {
var b;
(b = (b = Sh("yt-spacecast-uri")) && b.hasOwnProperty("uri") ? b.uri : null) ? "__notfound__" == b && (b = null): b = a.b ? "http://" + a.b : null;
return b
}
hI.prototype.reset = function () {
Th("yt-spacecast-uri")
};
function fI(a) {
var b = Sh("yt-spacecast-uri");
b || (b = {});
a ? b.uri = a : delete b.uri;
Ph("yt-spacecast-uri", b)
};
var iI = p("yt.prefs.UserPrefs.prefs_") || {};
ca("yt.prefs.UserPrefs.prefs_", iI, void 0);
function jI() {
ME.call(this)
}
w(jI, ME);
f = jI.prototype;
f.md = function (a) {
var b = ME.prototype.md.call(this, a);
return b ? b : a
};
f.Y = function (a, b) {
var c = jI.G.Y.call(this, a, b);
return c ? c : (c = jI.G.Y.call(this, a, "card-config")) && (c = p(c)) && c[b] ? c[b] : null
};
f.show = function (a) {
var b = this.md(a);
if (b) {
O(b, Z(this, "active"));
var c = kI(this, a, b);
if (c) {
c.cardTargetNode = a;
c.cardRootNode = b;
lI(this, a, c);
var d = Z(this, "card-visible"),
e = this.Y(a, "card-delegate-show") && this.Y(b, "card-action");
this.b(b, "card-action", a);
this.j = a;
hx(c);
J(t(function () {
e || gx(c);
mI(c);
O(c, d)
}, this), 10)
}
}
};
function kI(a, b, c) {
var d = c || b,
e = Z(a, "card");
c = a.pd(d);
var g = Pc(Z(a, "card") + hg(d));
if (g) return a = H(Z(a, "card-body"), g), nd(a, c) || (hd(c), a.appendChild(c)), g;
g = document.createElement("div");
g.id = Z(a, "card") + hg(d);
g.className = e;
(d = a.Y(d, "card-class")) && $f(g, d.split(/\s+/));
d = document.createElement("div");
d.className = Z(a, "card-border");
b = a.Y(b, "orientation") || "horizontal";
e = document.createElement("div");
e.className = "yt-uix-card-border-arrow yt-uix-card-border-arrow-" + b;
var h = document.createElement("div");
h.className = Z(a, "card-body");
a = document.createElement("div");
a.className = "yt-uix-card-body-arrow yt-uix-card-body-arrow-" + b;
hd(c);
h.appendChild(c);
d.appendChild(a);
d.appendChild(h);
g.appendChild(e);
g.appendChild(d);
document.body.appendChild(g);
return g
}
function lI(a, b, c) {
var d = a.Y(b, "orientation") || "horizontal",
e = a.Y(b, "position"),
g = !!a.Y(b, "force-position"),
d = "horizontal" == d,
h = "bottomright" == e || "bottomleft" == e,
k = "topright" == e || "bottomright" == e,
l, q;
k && h ? (q = 7, l = 4) : k && !h ? (q = 6, l = 5) : !k && h ? (q = 5, l = 6) : (q = 4, l = 7);
var s = ve(document.body),
e = ve(b);
s != e && (q ^= 2);
var u;
d ? (e = b.offsetHeight / 2 - 12, u = new E(-12, b.offsetHeight + 6)) : (e = b.offsetWidth / 2 - 6, u = new E(b.offsetWidth + 6, -12));
var z = Ce(c),
e = Math.min(e, (d ? z.height : z.width) - 24 - 6);
6 > e && (e = 6, d ? u.y += 12 - b.offsetHeight /
2 : u.x += 12 - b.offsetWidth / 2);
var F = null;
g || (F = 10);
z = Z(a, "card-flip");
a = Z(a, "card-reverse");
Q(c, z, k);
Q(c, a, h);
F = FE(b, q, c, l, u, null, F);
!g && F && (F & 48 && (k = !k, q ^= 2, l ^= 2), F & 192 && (h = !h, q ^= 1, l ^= 1), Q(c, z, k), Q(c, a, h), FE(b, q, c, l, u));
s && (b = Ee(c), g = Uc(window), c.style.left = "", c.style.right = g.width - b.left - b.width + "px");
b = H("yt-uix-card-body-arrow", c);
g = H("yt-uix-card-border-arrow", c);
d = d ? h ? "top" : "bottom" : !s && k || s && !k ? "left" : "right";
b.setAttribute("style", "");
g.setAttribute("style", "");
b.style[d] = e + "px";
g.style[d] = e +
"px";
h = H("yt-uix-card-arrow", c);
k = H("yt-uix-card-arrow-background", c);
h && k && (c = "right" == d ? Ce(c).width - e - 13 : e + 11, e = c / Math.sqrt(2), h.style.left = c + "px", h.style.marginLeft = "1px", k.style.marginLeft = -e + "px", k.style.marginTop = e + "px")
}
f.hide = function (a) {
if (a = this.md(a)) {
var b = Pc(Z(this, "card") + hg(a));
b && (P(a, Z(this, "active")), P(b, Z(this, "card-visible")), hx(b), this.j = null, b.cardTargetNode = null, b.cardRootNode = null, b.cardMask && (hd(b.cardMask), b.cardMask = null))
}
};
function nI(a) {
a.j && a.hide(a.j)
}
f.fC = function (a, b) {
var c = this.md(a);
if (c) {
if (b) {
var d = this.pd(c);
if (!d) return;
d.innerHTML = b
}
Zf(c, Z(this, "active")) && (c = kI(this, a, c), lI(this, a, c), gx(c), mI(c))
}
};
f.pd = function (a) {
var b = a.cardContentNode;
if (!b) {
var c = Z(this, "content"),
d = Z(this, "card-content");
(b = (b = this.Y(a, "card-id")) ? Pc(b) : H(c, a)) || (b = document.createElement("div"));
var e = b;
P(e, c);
O(e, d);
a.cardContentNode = b
}
return b
};
function mI(a) {
var b = a.cardMask;
b || (b = document.createElement("iframe"), b.src = 'javascript:""', $f(b, ["yt-uix-card-iframe-mask"]), a.cardMask = b);
document.body.appendChild(b);
b.style.top = a.offsetTop + "px";
b.style.left = a.offsetLeft + "px";
b.style.height = a.clientHeight + "px"
};
function oI() {
ME.call(this);
this.g = {};
this.k = {}
}
w(oI, jI);
ea(oI);
f = oI.prototype;
f.Td = "clickcard";
f.register = function () {
OE(this, "click", this.iE, "target");
OE(this, "click", this.hE, "close")
};
f.iE = function (a, b, c) {
b = vd(c.target, "button");
b && b.disabled || (a = (b = this.Y(a, "card-target")) ? Pc(b) : a, b = this.md(a), this.Y(b, "disabled") || (Zf(b, Z(this, "active")) ? (this.hide(a), P(b, Z(this, "active"))) : (this.show(a), O(b, Z(this, "active")))))
};
f.show = function (a) {
oI.G.show.call(this, a);
var b = this.md(a);
if (!eg(b, "click-outside-persists")) {
var c = ma(a);
if (this.g[c]) return;
b = R(document, "click", t(this.eC, this, a));
this.g[c] = b
}
a = R(window, "resize", t(this.fC, this, a, void 0));
this.k[c] = a
};
f.hide = function (a) {
oI.G.hide.call(this, a);
a = ma(a);
var b = this.g[a];
b && (yg(b), this.g[a] = null);
if (b = this.k[a]) yg(b), this.k[a] = null
};
f.eC = function (a, b) {
xd(b.target, "yt-uix" + (this.Td ? "-" + this.Td : "") + "-card") || this.hide(a)
};
f.hE = function (a) {
(a = xd(a, Z(this, "card"))) && this.hide(a.cardTargetNode)
};
function pI() {
ME.call(this)
}
w(pI, jI);
ea(pI);
f = pI.prototype;
f.Td = "hovercard";
f.register = function () {
OE(this, "mouseenter", this.XD, "target");
OE(this, "mouseleave", this.ZD, "target");
OE(this, "mouseenter", this.YD, "card");
OE(this, "mouseleave", this.$D, "card")
};
f.XD = function (a) {
if (qI != a) {
qI && (this.hide(qI), qI = null);
var b = t(this.show, this, a),
c = parseInt(this.Y(a, "delay-show"), 10),
b = J(b, -1 < c ? c : 200);
cg(a, "card-timer", b.toString());
qI = a;
a.alt && (cg(a, "card-alt", a.alt), a.alt = "");
a.title && (cg(a, "card-title", a.title), a.title = "")
}
};
f.ZD = function (a) {
var b = parseInt(this.Y(a, "card-timer"), 10);
K(b);
this.md(a).isCardHidable = !0;
b = parseInt(this.Y(a, "delay-hide"), 10);
b = -1 < b ? b : 200;
J(t(this.qD, this, a), b);
if (b = this.Y(a, "card-alt")) a.alt = b;
if (b = this.Y(a, "card-title")) a.title = b
};
f.qD = function (a) {
this.md(a).isCardHidable && (this.hide(a), qI = null)
};
f.YD = function (a) {
a && (a.cardRootNode.isCardHidable = !1)
};
f.$D = function (a) {
a && this.hide(a.cardTargetNode)
};
var qI = null;
function rI(a, b) {
this.Lc = a;
this.k = !1;
this.g = new oh;
this.o = zg(this.Lc, "click", t(this.jB, this), "yt-dialog-dismiss");
sI(this);
this.j = b
}
var tI = {
LOADING: "loading",
qE: "content",
xK: "working"
};
function uI(a, b) {
a.ea() || a.g.subscribe("post-all", b)
}
function sI(a) {
a = H("yt-dialog-fg-content", a.Lc);
var b = [];
Lb(tI, function (a) {
b.push("yt-dialog-show-" + a)
});
ag(a, b);
O(a, "yt-dialog-show-content")
}
f = rI.prototype;
f.show = function () {
if (!this.ea()) {
document.activeElement && document.activeElement != document.body && document.activeElement.blur();
this.b || (this.b = Pc("yt-dialog-bg"), this.b || (this.b = bd("div"), this.b.id = "yt-dialog-bg", this.b.className = "yt-dialog-bg", document.body.appendChild(this.b)));
var a;
t: {
var b = window,
c = b.document;
a = 0;
if (c) {
a = c.body;
var d = c.documentElement;
if (!a && !d) {
a = 0;
break t
}
b = Uc(b).height;
if (Vc(c) && d.scrollHeight) a = d.scrollHeight != b ? d.scrollHeight : d.offsetHeight;
else {
var c = d.scrollHeight,
e = d.offsetHeight;
d.clientHeight != e && (c = a.scrollHeight, e = a.offsetHeight);
a = c > b ? c > e ? c : e : c < e ? c : e
}
}
}
this.b.style.height = a + "px";
gx(this.b);
ng(this.Lc);
a = vI(this);
wI(a);
this.j || R(document, "keydown", t(this.Jq, this));
a = this.Lc;
d = uh("player-added", this.oB, this);
cg(a, "player-ready-pubsub-key", d);
gx(this.Lc);
O(document.body, "yt-dialog-active");
nI(oI.getInstance());
nI(pI.getInstance())
}
};
function xI() {
var a = Qc("yt-dialog");
return gb(a, function (a) {
return fx(a)
})
}
f.oB = function () {
ng(this.Lc)
};
function vI(a) {
var b = Rc("iframe", null, a.Lc);
y(b, function (a) {
var b = eg(a, "onload");
b && (b = p(b)) && R(a, "load", b);
if (b = eg(a, "src")) a.src = b
}, a);
return sb(b)
}
function wI(a) {
y(document.getElementsByTagName("iframe"), function (b) {
-1 == db(a, b) && O(b, "iframe-hid")
})
}
function yI() {
var a = Qc("iframe-hid");
y(a, function (a) {
P(a, "iframe-hid")
})
}
f.jB = function (a) {
a = a.currentTarget;
a.disabled || (a = eg(a, "action") || "", zI(this, a))
};
function zI(a, b) {
if (!a.ea()) {
a.g.I("pre-all");
a.g.I("pre-" + b);
hx(a.Lc);
nI(oI.getInstance());
nI(pI.getInstance());
xI() || (hx(a.b), P(document.body, "yt-dialog-active"), og(), yI());
if (!a.j) {
var c = t(a.Jq, a);
(c = wg(document, "keydown", c, !1)) && yg(c)
}
if (c = a.Lc) {
var d = eg(c, "player-ready-pubsub-key");
d && (wh(d), fg(c, "player-ready-pubsub-key"))
}
a.g.I("post-all");
xh("yt-ui-dialog-hide-complete", a);
"cancel" == b && xh("yt-ui-dialog-cancelled", a);
a.g && a.g.I("post-" + b)
}
}
f.Jq = function (a) {
J(t(function () {
27 == a.keyCode && zI(this, "cancel")
}, this), 0)
};
f.ea = function () {
return this.k
};
f.dispose = function () {
fx(this.Lc) && zI(this, "dispose");
yg(this.o);
this.g.dispose();
this.g = null;
this.k = !0
};
ca("yt.ui.Dialog", rI, void 0);
function AI() {
ME.call(this);
this.g = [];
this.j = {}
}
w(AI, ME);
ea(AI);
f = AI.prototype;
f.Td = "button";
f.Nf = null;
f.register = function () {
OE(this, "click", this.aE);
OE(this, "keydown", this.VD);
OE(this, "keypress", this.WD);
NE(this, "page-scroll", this.UD)
};
f.aE = function (a) {
a && !a.disabled && (BI(this, a), this.click(a))
};
f.VD = function (a, b, c) {
if (!(c.altKey || c.ctrlKey || c.shiftKey) && (b = CI(this, a))) {
var d = function (a) {
var b = "";
a.tagName && (b = a.tagName.toLowerCase());
return "ul" == b || "table" == b
},
e;
d(b) ? e = b : e = qd(b, d);
if (e) {
e = e.tagName.toLowerCase();
var g;
"ul" == e ? g = this.kE : "table" == e && (g = this.jE);
g && DI(this, a, b, c, t(g, this))
}
}
};
f.UD = function () {
var a = this.j;
if (0 != Ob(a))
for (var b in a) {
var c = a[b],
d = xd(c.activeButtonNode || c.parentNode, Z(this));
if (void 0 == d || void 0 == c) break;
EI(this, d, c, !0)
}
};
function DI(a, b, c, d, e) {
var g = fx(c),
h = 9 == d.keyCode;
h || 32 == d.keyCode || 13 == d.keyCode ? (d = FI(a, c)) ? (b = kd(d), "a" == b.tagName.toLowerCase() ? window.location = b.href : Cg(b, "click")) : h && GI(a, b) : g ? 27 == d.keyCode ? (FI(a, c), GI(a, b)) : e(b, c, d) : (a = Zf(b, Z(a, "reverse")) ? 38 : 40, d.keyCode == a && (Cg(b, "click"), d.preventDefault()))
}
f.WD = function (a, b, c) {
c.altKey || c.ctrlKey || c.shiftKey || (a = CI(this, a), fx(a) && c.preventDefault())
};
function FI(a, b) {
var c = Z(a, "menu-item-highlight"),
d = H(c, b);
d && P(d, c);
return d
}
function HI(a, b, c) {
O(c, Z(a, "menu-item-highlight"));
b.setAttribute("aria-activedescendant", c.getAttribute("id"))
}
f.jE = function (a, b, c) {
var d = FI(this, b);
b = kg("table", b);
var e = kg("tr", b),
e = Rc("td", null, e).length;
b = Rc("td", null, b);
d = II(d, b, e, c); - 1 != d && (HI(this, a, b[d]), c.preventDefault())
};
f.kE = function (a, b, c) {
if (40 == c.keyCode || 38 == c.keyCode) {
var d = FI(this, b);
b = fb(Rc("li", null, b), fx);
d = II(d, b, 1, c);
HI(this, a, b[d]);
c.preventDefault()
}
};
function II(a, b, c, d) {
var e = b.length;
a = db(b, a);
if (-1 == a)
if (38 == d.keyCode) a = e - c;
else {
if (37 == d.keyCode || 38 == d.keyCode || 40 == d.keyCode) a = 0
} else 39 == d.keyCode ? (a % c == c - 1 && (a -= c), a += 1) : 37 == d.keyCode ? (0 == a % c && (a += c), a -= 1) : 38 == d.keyCode ? (a < c && (a += e), a -= c) : 40 == d.keyCode && (a >= e - c && (a -= e), a += c);
return a
}
function JI(a, b) {
var c = b.iframeMask;
c || (c = document.createElement("iframe"), c.src = 'javascript:""', c.className = Z(a, "menu-mask"), b.iframeMask = c);
return c
}
function EI(a, b, c, d) {
var e = xd(b, Z(a, "group")),
g = !!a.Y(b, "button-menu-ignore-group"),
e = e && !g ? e : b,
g = 5,
h = 4,
k = Ee(b);
if (Zf(b, Z(a, "reverse"))) {
g = 4;
h = 5;
k = k.top + "px";
try {
c.style.maxHeight = k
} catch (l) {}
}
Zf(b, "flip") && (Zf(b, Z(a, "reverse")) ? (g = 6, h = 7) : (g = 7, h = 6));
var q;
a.Y(b, "button-has-sibling-menu") ? q = se(e) : a.Y(b, "button-menu-root-container") && (q = KI(a, b));
oc && !zc("8") && (q = null);
var s;
q && (s = Ee(q), s = new be(-s.top, s.left, s.top, -s.left));
q = new E(0, 1);
Zf(b, Z(a, "center-menu")) && (q.x -= Math.round((Ce(c).width - Ce(b).width) /
2));
d && (q.y += Wc(document).y);
if (a = JI(a, b)) b = Ce(c), a.style.width = b.width + "px", a.style.height = b.height + "px", FE(e, g, a, h, q, s, 65), d && kx(a, "position", "fixed");
FE(e, g, c, h, q, s, 65)
}
function KI(a, b) {
if (a.Y(b, "button-menu-root-container")) {
var c = a.Y(b, "button-menu-root-container");
return xd(b, c)
}
return document.body
}
f.ds = function (a) {
if (a) {
var b = CI(this, a);
if (b) {
a.setAttribute("aria-pressed", "true");
a.setAttribute("aria-expanded", "true");
b.originalParentNode = b.parentNode;
b.activeButtonNode = a;
b.parentNode.removeChild(b);
var c;
this.Y(a, "button-has-sibling-menu") ? c = a.parentNode : c = KI(this, a);
c.appendChild(b);
b.style.minWidth = a.offsetWidth - 2 + "px";
var d = JI(this, a);
d && c.appendChild(d);
(c = !!this.Y(a, "button-menu-fixed")) && (this.j[hg(a).toString()] = b);
EI(this, a, b, c);
yh("yt-uix-button-menu-before-show", a, b);
gx(b);
this.b(a,
"button-menu-action", !0);
O(a, Z(this, "active"));
b = t(this.Mq, this, a, !1);
c = t(this.Mq, this, a, !0);
d = t(this.uz, this, a, void 0);
this.Nf && CI(this, this.Nf) == CI(this, a) || LI(this);
xh("yt-uix-button-menu-show", a);
yg(this.g);
this.g = [R(document, "click", c), R(document, "contextmenu", b), R(window, "resize", d)];
this.Nf = a
}
}
};
function GI(a, b) {
if (b) {
var c = CI(a, b);
if (c) {
a.Nf = null;
b.setAttribute("aria-pressed", "false");
b.setAttribute("aria-expanded", "false");
b.removeAttribute("aria-activedescendant");
hx(c);
a.b(b, "button-menu-action", !1);
var d = JI(a, b),
e = hg(c).toString();
delete a.j[e];
J(function () {
d && d.parentNode && d.parentNode.removeChild(d);
c.originalParentNode && (c.parentNode.removeChild(c), c.originalParentNode.appendChild(c), c.originalParentNode = null, c.activeButtonNode = null)
}, 1)
}
var e = xd(b, Z(a, "group")),
g = [Z(a, "active")];
e && g.push(Z(a, "group-active"));
ag(b, g);
xh("yt-uix-button-menu-hide", b);
yg(a.g);
a.g.length = 0
}
}
f.uz = function (a, b) {
var c = CI(this, a);
if (c) {
b && (c.innerHTML = b);
var d = !!this.Y(a, "button-menu-fixed");
EI(this, a, c, d)
}
};
f.Mq = function (a, b, c) {
c = c || window.event;
c = c.target || c.srcElement;
3 == c.nodeType && (c = c.parentNode);
var d = xd(c, Z(this));
if (d) {
var d = CI(this, d),
e = CI(this, a);
if (d == e) return
}
var d = xd(c, Z(this, "menu")),
e = d == CI(this, a),
g = Zf(c, Z(this, "menu-item")),
h = Zf(c, Z(this, "menu-close"));
if (!d || e && (g || h))
if (GI(this, a), d && b && this.Y(a, "button-menu-indicate-selected")) {
if (a = H(Z(this, "content"), a)) Fc && "innerText" in c ? b = c.innerText.replace(/(\r\n|\r|\n)/g, "\n") : (b = [], ud(c, b, !0), b = b.join("")), b = b.replace(/ \xAD /g, " ").replace(/\xAD/g,
""), b = b.replace(/\u200B/g, ""), Fc || (b = b.replace(/ +/g, " ")), " " != b && (b = b.replace(/^\s*/, "")), pd(a, b);
MI(this, d, c)
}
};
function MI(a, b, c) {
var d = Z(a, "menu-item-selected");
a = Qc(d, b);
y(a, function (a) {
P(a, d)
});
O(c.parentNode, d)
}
function CI(a, b) {
if (!b.widgetMenu) {
var c = a.Y(b, "button-menu-id"),
c = c && Pc(c),
d = Z(a, "menu");
c ? $f(c, [d, Z(a, "menu-external")]) : c = H(d, b);
b.widgetMenu = c
}
return b.widgetMenu
}
function BI(a, b) {
if (a.Y(b, "button-toggle")) {
var c = xd(b, Z(a, "group"));
if (c && a.Y(c, "button-toggle-group")) {
var d = a.Y(c, "button-toggle-group"),
c = Qc(Z(a), c),
e = Z(a, "toggled"),
g = Zf(b, e);
y(c, function (a) {
a != b || "optional" == d && g ? P(a, e) : O(b, e)
})
} else bg(b, Z(a, "toggled"))
}
}
f.click = function (a) {
if (CI(this, a)) {
var b = CI(this, a),
c = xd(b.activeButtonNode || b.parentNode, Z(this));
c && c != a ? (GI(this, c), J(t(this.ds, this, a), 1)) : fx(b) ? GI(this, a) : this.ds(a);
a.focus()
}
this.b(a, "button-action")
};
function LI(a) {
a.Nf && GI(a, a.Nf)
};
function NI() {
ME.call(this)
}
w(NI, ME);
ea(NI);
f = NI.prototype;
f.Sc = null;
f.dj = null;
f.Td = "overlay";
f.register = function () {
OE(this, "click", this.ut, "target");
OE(this, "click", this.hide, "close");
OI(this)
};
f.ut = function (a) {
if (!this.Sc || !fx(this.Sc.Lc)) {
var b = this.md(a);
a = PI(b, a);
b || (b = a ? a.overlayParentNode : null);
if (b && a) {
var c = !!this.Y(b, "disable-shortcuts") || !1;
this.Sc = new rI(a, c);
this.dj = b;
var d = H("yt-dialog-fg", a);
if (d) {
var e = this.Y(b, "overlay-class") || "",
g = this.Y(b, "overlay-style") || "default",
h = this.Y(b, "overlay-shape") || "default",
e = e ? e.split(" ") : [];
e.push(Z(this, g));
e.push(Z(this, h));
$f(d, e)
}
this.Sc.show();
OI(this);
c || (c = t(function (a) {
Zf(a.target, "yt-dialog-base") && QI(this)
}, this), a = H("yt-dialog-base",
a), this.g = R(a, "click", c));
this.b(b, "overlay-shown");
nI(oI.getInstance());
LI(AI.getInstance())
}
}
};
function OI(a) {
a.j || (a.j = uh("yt-uix-overlay-hide", RI));
a.Sc && uI(a.Sc, function () {
var a = NI.getInstance();
a.dj = null;
a.Sc.dispose();
a.Sc = null
})
}
function QI(a) {
if (a.Sc) {
var b = a.dj;
zI(a.Sc, "overlayhide");
a.b(b, "overlay-hidden");
a.dj = null;
a.g && (yg(a.g), a.g = null);
a.Sc = null
}
}
function PI(a, b) {
var c;
if (a)
if (c = H("yt-dialog", a)) {
var d = Pc("body-container");
d && (d.appendChild(c), a.overlayContentNode = c, c.overlayParentNode = a)
} else c = a.overlayContentNode;
else b && (c = xd(b, "yt-dialog"));
return c
}
f.pd = function (a) {
return H("yt-dialog-content", a.overlayContentNode || a)
};
f.hide = function () {
xh("yt-uix-overlay-hide")
};
function RI() {
QI(NI.getInstance())
}
f.show = function (a) {
this.ut(a)
};
function SI(a) {
this.g = a;
this.b = [];
this.b.push(uh("yt-uix-load-more-success", this.j, this))
}
w(SI, jh);
var TI = !1;
SI.prototype.j = function () {
var a = {},
b = rb(sb(Qc("spacecast-item")), sb(Qc("yt-lockup-video")));
y(b, function (b) {
var c = b.getAttributeNode("data-context-item-id");
if (c && c.value) {
var c = c.value,
g = a[c];
g || (g = [], a[c] = g);
g.push(b)
}
});
var b = Rb(a),
c = v();
bI(this.g, b, t(this.k, this, a, c))
};
SI.prototype.k = function (a, b, c) {
b = v() - b;
var d = 0;
c && c.ids && (UI(), y(c.ids, function (b) {
y(a[b], function (a) {
O(a, "spacecast-cached")
})
}), d = c.ids.length);
ZH(of({
a: "spacecast",
module: "highlight",
count: Rb(a).length,
cached: d,
"cache-latency": b
}));
VI()
};
function VI() {
if (Fd("INIT_SPACECAST_PROMO") && !TI) {
var a = H("spacecast-promo-overlay");
a && (TI = !0, NI.getInstance().show(a))
}
}
function UI() {
var a = p("yt.player.getPlayerByElement");
a && a("player-api")
}
SI.prototype.J = function () {
this.g = null;
this.b.length && (wh(this.b), this.b = []);
SI.G.J.call(this)
};
function WI() {
this.j = this.g = this.b = null
}
w(WI, jh);
ea(WI);
WI.prototype.init = function (a) {
this.b || (this.b = new hI(a || null), this.g = new aI(this.b), this.j = new SI(this.g))
};
WI.prototype.J = function () {
this.k && (this.j.dispose(), this.j = null);
this.g && (this.g.dispose(), this.g = null);
this.b && (this.b.dispose(), this.b = null);
WI.G.J.call(this);
delete WI.bm
};
function XI(a) {
Ot.call(this, a);
this.jc = this.wa = "spacecast";
this.g = null
}
w(XI, Ot);
f = XI.prototype;
f.Ka = function () {
return !!this.b.getVideoData().Da
};
function YI(a) {
return a.getVideoData().Da ? new XI(a) : null
}
f.create = function () {
XI.G.create.call(this);
var a = this.b.getVideoData().Da,
b = WI.getInstance();
b && b.init(a);
this.g = b;
this.load()
};
f.destroy = function () {
this.loaded && this.unload();
this.g = null
};
f.load = function () {
XI.G.load.call(this);
var a = this.b.getVideoData().videoId,
b = this.g.g,
c = v();
gI(b, a, t(this.kA, this, c))
};
f.unload = function () {
this.loaded = !1;
XI.G.unload.call(this)
};
f.kA = function (a, b) {
var c = v() - a,
d = 0;
if (b) {
var e = b.id,
g = b.fmt_list;
if (e && g) {
var h = {};
y(g, function (a) {
a.itag && (h[a.itag.toString()] = !0)
});
if (e = ZI(this, dI(this.g.b), e, h)) d = this.b.getVideoData(), d.U = e, Cr(d), this.b.rp("auto"), d = 1
}
}
Qt(this);
ZH(of({
a: "spacecast",
module: "player",
cached: d,
"cache-latency": c
}))
};
function ZI(a, b, c, d) {
if (!b) return null;
a = a.b.getVideoData();
a = vr(a.Be);
a = fb(a, function (a) {
return !!d[a.itag]
});
if (!a.length) return null;
var e = $h(b) || "",
g = Number(ff(b)[4] || null) || null;
return A(a, function (a) {
var b = N(N(xf(wf(vf(Rf(a.url), "http"), e), g), "orig_host", ai(a.url)), "scid", c);
a.url = b.toString();
return of(a)
}).join(",")
};
function $I() {
var a = dc,
b;
if (b = Op()) t: {
if (navigator.plugins && 0 < navigator.plugins.length)
for (b = 0; b < navigator.plugins.length; b++)
if (0 <= navigator.plugins[b].name.indexOf("NVIDIA 3D Vision")) {
b = !0;
break t
}
b = !1
}
if (b) t: {
var c = navigator.userAgent.match(/Firefox[\/\s](\d+\.\d+)/);
if (c && 1 < c.length && 4 <= c[1]) {
c = document.createElement("embed");
c.setAttribute("id", "NvImageDetectionFFID");
c.setAttribute("style", "visibility: hidden");
c.setAttribute("width", 25);
c.setAttribute("height", 25);
c.setAttribute("type", "image/jps");
ed(document.documentElement, c);
c = Pc("NvImageDetectionFFID");
try {
if (null != c) {
b = 27527 <= c.NvGetDriverVersion();
break t
}
} catch (d) {}
}
b = !1
}
return b || !(!a || -1 == a.indexOf("Sony"))
};
function aJ(a) {
mA.call(this);
this.b = "3D";
this.element = new rA(a, [Y(0, "YTP_ON"), Y(0, "YTP_OFF")]);
S(this, this.element);
vA(this.element, 2300);
this.priority = 10;
this.C = !0;
uA(this.element, 1)
}
w(aJ, mA);
aJ.prototype.N = function () {
this.element.Fb("select")
};
aJ.prototype.getSelected = function () {
return this.element.getSelected()
};
function bJ(a) {
var b = ["div", ["ytp-dialog", "html5-stop-propagation"],
["div", "ytp-dialog-title", Y(0, "YTP_THREED_HTML5_WARNING_DIALOG_TITLE")],
["div", "ytp-dialog-body", "{{content}}"],
["div", "ytp-dialog-buttons", "{{buttons}}"]
];
X.call(this, b);
b = Y(0, "YTP_THREED_HTML5_WARNING_DIALOG_CHANGE_MODE");
this.b = new nA(a, "ytp-dialog-button", b);
S(this, this.b);
this.b.na(b);
b = Y(0, "YTP_CLOSE");
this.g = new nA(a, "ytp-dialog-button", b);
this.g.na(b);
S(this, this.g);
this.template.update({
content: new lE(Y(0, "YTP_THREED_HTML5_WARNING_DIALOG_MESSAGE", {
BEGIN_LINK: '<a href="//support.google.com/youtube/bin/answer.py?answer=1229982">',
END_LINK: "</a>"
})),
buttons: [this.b, this.g]
})
}
w(bJ, UB);
function cJ(a) {
Ot.call(this, a);
Kd({
YTP_THREED_HTML5_WARNING_DIALOG_TITLE: "Keine HTML5 3D-Hardware erkannt",
YTP_THREED_HTML5_WARNING_DIALOG_MESSAGE: "$BEGIN_LINKRichte die 3D-Wiedergabe mit HTML5 korrekt ein$END_LINK oder \u00e4ndere die 3D-Anzeigemodi.",
YTP_THREED_HTML5_WARNING_DIALOG_CHANGE_MODE: "3D-Anzeigemodus \u00e4ndern"
});
this.g = new aJ(bu(this));
S(this, this.g);
uA(this.g.element, 1);
this.g.listen("change", this.Iz, this);
this.g.listen("select", this.Jz, this);
this.j = new bJ(bu(this));
S(this, this.j);
this.j.b.listen("click", this.Rq, this);
this.j.g.listen("click", this.pg, this)
}
w(cJ, Ot);
f = cJ.prototype;
f.qn = "threeDModuleData";
f.wa = "threed";
f.jc = "threed";
f.create = function () {
dJ(this.b.app, void 0);
cu(this, this.g);
cJ.G.create.call(this)
};
f.destroy = function () {
du(this, this.g);
dJ(this.b.app, !0);
cJ.G.destroy.call(this)
};
function eJ(a) {
return cJ.prototype.Ka(a) ? new cJ(a) : null
}
f.Ka = function (a) {
a = a.getVideoData();
return !!a.oa || !!a.Qr
};
function fJ(a, b) {
if (a.b.getVideoData().Jf != b)
if (St(a), $I()) {
var c = a.b.app,
d = us(c);
d.b.g && d.b.g.b || (d.b.Jf = !d.b.Jf, Cr(d.b), gJ(d, "r"));
dJ(c)
} else b && (St(a, a.j), uA(a.g.element, 1), eu(a))
}
f.Rq = function () {
Tt(this, "/select_3d_mode?video_id=" + this.b.getVideoData().videoId)
};
f.Iz = function () {
0 == this.g.getSelected() ? fJ(this, !0) : fJ(this, !1)
};
f.Jz = function () {
eu(this);
this.Rq()
};
function hJ(a) {
Ot.call(this, a);
Kd({
YTP_YPC_START_RENTAL_HEADER: "M\u00f6chtest du diese Ausleihe starten?",
YTP_YPC_START_RENTAL_BUTTON: "Videoverleihzeitraum starten"
});
this.g = new dv(["div", "ytp-ypc-clickwrap-overlay", ["h2", "header", Ld("YTP_YPC_START_RENTAL_HEADER")],
["div", "description", this.b.getVideoData().k.ypc_clickwrap_message],
["button", "confirm-button", Ld("YTP_YPC_START_RENTAL_BUTTON")]
]);
ty(this.g.K());
Ys(this.b, this.g.K());
S(this, this.g);
this.j = this.g.b["confirm-button"]
}
w(hJ, Ot);
f = hJ.prototype;
f.wa = "ypc_clickwrap";
f.jc = "ypc-clickwrap";
f.Ka = function () {
return Kr(this.b.getVideoData(), "ypc_clickwrap_module")
};
function iJ(a) {
return Kr(a.getVideoData(), "ypc_clickwrap_module") ? new hJ(a) : null
}
f.create = function () {
hJ.G.create.call(this);
this.load()
};
f.destroy = function () {
this.loaded && this.unload();
hJ.G.destroy.call(this)
};
f.load = function () {
hJ.G.load.call(this);
sy(this.g.K());
R(this.j, "click", t(this.DB, this));
this.loaded = !0
};
f.unload = function () {
ty(this.g.K());
Bg(this.j);
this.loaded = !1;
hJ.G.unload.call(this)
};
f.DB = function () {
Qt(this);
this.destroy()
};
function jJ(a) {
a = a.k;
this.o = a.ypc_offer_button_text;
this.description = a.ypc_offer_description;
this.B = a.ypc_offer_headline;
this.A = a.ypc_full_video_message;
this.g = a.ypc_offer_id;
this.b = a.ypc_buy_url;
this.j = a.ypc_item_thumbnail;
this.title = a.ypc_item_title;
this.k = a.ypc_item_url;
this.videoId = a.ypc_vid
};
function kJ() {
X.call(this, ["div", ["ytp-drawer", "html5-stop-propagation"],
["div", "ytp-drawer-content", "{{content}}"],
["a", "ytp-drawer-close-button"],
["a", "ytp-drawer-open-button"]
]);
this.g = this.template.b["ytp-drawer-close-button"];
vy(this, this.g, "click", this.hide);
this.b = this.template.b["ytp-drawer-open-button"];
vy(this, this.b, "click", this.show);
this.na(null);
this.hide()
}
w(kJ, X);
kJ.prototype.hide = function () {
O(this.element, "ytp-drawer-closed")
};
kJ.prototype.na = function (a) {
a ? (kJ.G.na.call(this, a), sy(this.element)) : ty(this.element)
};
kJ.prototype.show = function () {
J(ra(P, this.element, "ytp-drawer-closed"), 0)
};
kJ.prototype.J = function () {
Bg(this.g);
Bg(this.b);
this.b = this.g = null;
kJ.G.J.call(this)
};
function lJ(a, b) {
Ki.call(this);
this.b = new kJ;
S(this, this.b);
this.g = document.createElement("div");
$f(this.g, ["html5-stop-propagation", "html5-ypc-endscreen"]);
this.k = document.createElement("div");
O(this.k, "html5-ypc-overlay");
this.j = new dv(["div", "html5-ypc-module", ["div", "html5-ypc-action-heading", "{{heading}}"],
["div", "html5-ypc-thumbnail", "{{thumbnail_element}}"],
["div", "html5-ypc-title", "{{title}}"],
["div", "html5-ypc-description", "{{description}}"],
["button", "html5-ypc-purchase", "{{button_label}}"]
]);
S(this, this.j);
this.o = this.j.b["html5-ypc-purchase"];
R(this.o, "click", t(this.A, this));
pd(this.k, b.A);
var c = b.title;
b.k && (c = ["a", {
href: b.k,
target: "blank_"
},
b.title
]);
var d = "";
b.j && (d = ["img", {
src: b.j
}]);
this.j.update({
heading: b.B,
title: c,
thumbnail_element: d,
description: b.description,
button_label: b.o
});
this.X(a)
}
w(lJ, Ki);
lJ.prototype.J = function () {
lJ.G.J.call(this);
this.o && Bg(this.o);
hd(this.g);
hd(this.k);
this.k = this.g = this.b = null
};
lJ.prototype.X = function (a) {
this.b.X(a);
this.b.na(this.j.K());
a.appendChild(this.g)
};
function mJ(a) {
var b = a.j.K();
a.g.appendChild(b);
a.b.na(null);
sy(a.g)
}
lJ.prototype.A = function () {
this.I("ypcContentRequest")
};
function nJ(a) {
Ot.call(this, a);
this.j = this.g = null;
this.k = NaN
}
w(nJ, Ot);
f = nJ.prototype;
f.wa = "ypc";
f.jc = "ypc";
f.Ka = function () {
return Kr(this.b.getVideoData(), "ypc_module")
};
function oJ(a) {
return Kr(a.getVideoData(), "ypc_module") ? new nJ(a) : null
}
f.create = function () {
nJ.G.create.call(this);
this.g = new jJ(this.b.getVideoData());
J(t(this.load, this), 0)
};
f.destroy = function () {
this.loaded && this.unload();
this.g = null
};
f.load = function () {
if (this.g) {
nJ.G.load.call(this);
var a = this.b.getVideoData();
if (this.g.videoId && !a.ua) this.b.cq({
video_id: this.g.videoId,
ypc_preview: 1
});
else {
var b = H("html5-video-container", Zs(this.b));
this.j = new lJ(b, this.g);
this.j.subscribe("ypcContentRequest", this.Fx, this);
this.g.videoId && gd(this.b.app.g.F, this.j.k, 0);
xH(this.b.R()) && (b = new Ds(2147483647, 2147483647, {
priority: 2
}), this.Hf(b));
this.j.b.show();
K(this.k);
this.k = J(t(function () {
this.j.b.hide()
}, this), 1E4);
this.loaded = !0;
this.g.videoId ?
a.ua && Qt(this) : mJ(this.j)
}
}
};
f.unload = function () {
Pt(this);
nh(this.j);
this.j = null;
this.loaded = !1;
nJ.G.unload.call(this)
};
f.Ic = function (a) {
nJ.G.Ic.call(this, a);
mJ(this.j)
};
f.ld = function (a) {
nJ.G.ld.call(this, a);
a = this.j;
ty(a.g);
a.b.na(a.j.K())
};
f.Fx = function () {
if (this.g.b) "embedded" == this.b.R().ba ? GH(this.g.b) : window.location = qf(this.g.b, {}) + "";
else if (this.g.g) {
var a = p("yt.www.watch.player.handleEndPreview");
a && (this.b.isFullscreen() && dz(this.b.app), a(this.g.g))
}
};
function pJ(a, b, c) {
this.o = R(a, "click", t(this.F, this));
this.A = R(a, "dblclick", t(this.C, this));
this.D = b;
this.j = c;
this.g = new Bv(this.B, 200, this);
S(this, this.g);
this.b = !0;
this.k = null
}
w(pJ, jh);
pJ.prototype.F = function (a) {
0 != this.g.ta ? (this.g.stop(), this.j(a), this.b = !1) : (this.k = a, this.g.start(), this.b = !0)
};
pJ.prototype.C = function (a) {
this.b && this.j(a)
};
pJ.prototype.B = function () {
this.D(this.k);
this.b = !0
};
pJ.prototype.J = function () {
yg(this.o);
yg(this.A);
pJ.G.J.call(this)
};
function qJ(a, b) {
var c, d;
d || (d = 0);
c || (c = te(document.body));
var e = new E(sg(b), tg(b));
HE(e, a, d, null, c, 5)
};
function rJ(a) {
X.call(this, ["div", ["ytp-dialog", "html5-stop-propagation"],
["div", "ytp-dialog-body", "{{content}}"],
["div", "ytp-dialog-buttons", "{{buttons}}"]
]);
this.b = new X(["input", "html5-modal-panel-input", {
type: "text",
readonly: "readonly"
}]);
S(this, this.b);
rc && this.b.K().removeAttribute("readonly");
this.b.listen("click", this.j, this);
var b = Y(0, "YTP_CLOSE");
this.g = new nA(a, "ytp-dialog-button", b);
this.g.na(b);
S(this, this.g);
this.template.update({
content: this.b,
buttons: this.g
});
this.listen("contextmenu",
this.k)
}
w(rJ, UB);
rJ.prototype.k = function (a) {
a.stopPropagation()
};
rJ.prototype.j = function () {
this.b.K().select()
};
function sJ(a, b) {
X.call(this, ["ul", ["html5-context-menu", "yt-uix-button-menu"],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-copy-video-url"], Y(0, "YTP_GET_VIDEO_URL")]],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-copy-video-url-at-current-time"], Y(0, "YTP_GET_VIDEO_URL_AT_TIME")]],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-copy-embed-html"], Y(0, "YTP_GET_EMBED")]],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-report-playback-issue"],
Y(0, "YTP_REPORT_ISSUE")
]],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-copy-debug-info"], Y(0, "YTP_GET_DEBUG_INFO")]],
["li", "", ["span", ["yt-uix-button-menu-item", "html5-context-menu-show-video-info"], Y(0, "YTP_SHOW_VIDEO_INFO")]],
["li", "", ["a", ["yt-uix-button-menu-item", "html5-context-menu-link"], {
target: "_blank",
href: "/html5"
},
Y(0, "YTP_HTML5_CONTEXT_MENU_LINK")
]]
]);
this.V = a;
this.V.subscribe("internalvideodatachange", this.Fq, this);
this.j = new zv(this);
this.b = new zv(this);
this.g = new rJ(b);
S(this, this.g);
this.g.g.listen("click", this.nz, this);
var c = {
gz: this.oz,
hz: this.pz,
iz: t(this.Lq, this, !1),
jz: t(this.Lq, this, !0),
lz: this.rz,
mz: this.tz,
kz: this.qz
},
d;
for (d in c) tJ(this, d, c[d]);
this.hide()
}
w(sJ, X);
f = sJ.prototype;
f.nz = function () {
this.V.g.mh()
};
function uJ(a, b) {
var c = a.g;
c.b.K().value = b;
c.b.K().focus();
J(t(c.j, c), 100);
a.V.g.mh(a.g)
}
function tJ(a, b, c) {
a.j.listen(a.template.b[mv[b]], "click", function (a) {
a.stopImmediatePropagation();
a.preventDefault();
c.call(this, a);
this.hide();
a = b.replace("CONTEXT_MENU_", "").toLowerCase();
IG(this.V, "contextmenu." + a)
})
}
f.Fq = function (a, b) {
ex(this.template.b["html5-context-menu-copy-embed-html"], b.oq)
};
f.Lq = function (a) {
uJ(this, Bs(this.V, a))
};
f.pz = function () {
var a = Fd("EMBED_HTML_TEMPLATE"),
b = Fd("EMBED_HTML_URL"),
c = this.V.g.Wc(),
d = this.V.getVideoData().videoId,
b = b.replace(/__videoid__/g, d),
a = a.replace(/__url__/g, Ca(b)),
a = a.replace(/__width__/g, c.width),
a = a.replace(/__height__/g, c.height);
uJ(this, a)
};
f.qz = function (a) {
vJ(this.V, a.target.getAttribute("href"))
};
f.rz = function () {
var a = this.V.getVideoData(),
b = this.V.R(),
c = this.V.g,
d = c.Wc(),
c = CD(c),
d = {
cr: b.$,
csipt: b.ca,
ec: 108,
feature: b.A,
h: c.height,
hl: b.o,
playerh: d.height,
playerw: d.width,
ptk: a.M,
referrer: b.F,
screenh: window.screen.height,
screenw: window.screen.width,
sdetail: a.Ua,
sourceid: a.Xj,
vid: b.oa,
vq: b.wi,
w: c.width
};
sa(d, this.V.ng());
(c = us(this.V)) && sa(d, c.getDebugInfo(!0));
d.videoId && (d.v = d.videoId, delete d.videoId);
b.Vb && (d.mobile = "1");
this.V.Th("streamingerror", d);
d = !0;
"detailpage" == b.ba && (d = p("yt.player.exports.feedbackStart")("59", {
html5: !0,
player: !0
}));
d && (this.V.pauseVideo(), window.open(wJ(b, a)))
};
f.oz = function () {
uJ(this, Cs(this.V, !0))
};
f.tz = function () {
Ls(this.V.g)
};
f.uC = function (a) {
a.preventDefault();
this.ka ? (a.stopPropagation(), qJ(this.element, a)) : (qJ(this.element, a), this.show(), this.b.listen(this.element, "contextmenu", function (a) {
a.preventDefault()
}), a = t(function () {
this.b.listen(window, "blur", this.hide);
this.b.listen(document, "click", this.hide)
}, this), J(a, 0), this.b.listen(document, "keydown", this.IB))
};
f.IB = function (a) {
27 == a.keyCode && (this.hide(), a.stopPropagation())
};
f.hide = function (a) {
a && 2 == a.button || (sJ.G.hide.call(this), this.b.removeAll())
};
f.J = function () {
this.j.removeAll();
this.b.removeAll();
this.V.ia("internalvideodatachange", this.Fq, this);
this.V = null;
sJ.G.J.call(this)
};
function xJ(a, b) {
RH.call(this, a, b.R());
this.V = b;
this.D = 2;
this.H = this.C = !1;
this.Qa.listen(this.k.g, "click", this.my);
this.Qa.listen(this.k.b, "click", this.ly);
this.V.subscribe("presentingplayerstatechange", this.qq, this)
}
w(xJ, RH);
f = xJ.prototype;
f.update = function (a) {
xJ.G.update.call(this, a);
yJ(this, a.gm);
a && a.zo && !this.V.o ? (a = this.k, a.b.X(a.element), a.g.X(a.element)) : (a = this.k, a.g.fd(), a.b.fd())
};
f.ki = function (a) {
var b = Zf(this.element, "show-share");
this.I("share-click");
b || xJ.G.ki.call(this, a)
};
f.Sk = function (a) {
this.I("title-click", a)
};
f.zk = function () {
var a = Zf(this.element, "show-more-info");
this.I("info-click");
if (a) this.H && this.V.Vd();
else {
xJ.G.zk.call(this);
var b = this.V.getPlayerState();
this.H = W(b, 8) && !W(b, 2);
this.V.pauseVideo()
}
return !a
};
f.my = function () {
zJ(this, 0)
};
f.ly = function () {
zJ(this, 1)
};
f.qq = function (a) {
W(a.state, 8) && P(this.element, "show-more-info")
};
function zJ(a, b) {
if (!a.C && (a.D == b && (b = 2), yJ(a, b), a.b)) {
if ("detailpage" != a.j.ba) {
a.C = !0;
var c = {
Bb: a.b.Bb,
onSuccess: t(function () {
this.C = !1
}, a),
onError: t(function () {
this.C = !1
}, a),
Va: a.j.Va,
cb: a.j.cb
};
rq(a.b.videoId, b, c)
}
a.V.I("RATE_SENTIMENT", {
videoId: a.b.videoId,
sentiment: b
})
}
}
function yJ(a, b) {
a.D = b;
Q(a.element, "sentiment-like", 0 == b);
Q(a.element, "sentiment-dislike", 1 == b)
}
f.hn = function (a) {
vJ(this.V, a)
};
f.wt = function () {
HG(this.V)
};
f.J = function () {
this.V.ia("presentingplayerstatechange", this.qq, this);
this.V = null;
xJ.G.J.call(this)
};
function AJ(a, b, c, d, e, g, h, k) {
this.o = [];
y(Eb(b), function (b) {
this.o.push(R(a, b, t(this.Zu, this)))
}, this);
y(Eb(d), function (b) {
this.o.push(R(a, b, t(this.Yu, this)))
}, this);
this.A = g || null;
this.F = c;
this.D = h || 0;
this.j = 0;
this.k = !1;
this.C = e;
this.B = k || 0;
this.b = 0;
this.g = !1
}
f = AJ.prototype;
f.Zu = function (a) {
K(this.b);
this.b = 0;
this.j = J(t(this.kB, this, a), this.D)
};
f.Yu = function (a) {
K(this.j);
this.j = 0;
this.b = J(t(this.gB, this, a), this.B)
};
f.kB = function (a) {
this.g || this.k || (this.k = !0, this.F.call(this.A || m, a))
};
f.gB = function (a) {
!this.g && this.k && (this.k = !1, this.C.call(this.A || m, a))
};
f.dispose = function () {
this.g = !0;
K(this.j);
K(this.b);
yg(this.o)
};
f.ea = function () {
return this.g
};
function BJ() {
X.call(this, ["div", "ytp-tooltip", ["div", "ytp-tooltip-body", "{{content}}"],
["div", "ytp-tooltip-arrow"]
]);
this.b = this.template.b["ytp-tooltip-body"]
}
w(BJ, X);
BJ.prototype.hide = function () {
BJ.G.hide.call(this);
oe(this.b, 0)
};
BJ.prototype.J = function () {
fd(this.b);
this.b = null;
BJ.G.J.call(this)
};
function CJ(a, b) {
this.b = {};
this.Qm = a;
this.g = b
}
w(CJ, jh);
CJ.prototype.Sg = function (a, b) {
var c, d = new AJ(a, "mouseover", function () {
if (this.Qm) {
var d = new BJ;
d.X(this.Qm);
c = d
} else c = null; if (c && (d = b && b(a), !b || d)) {
d = d || eg(a, "tooltip") || "";
if (r(d)) {
var g = cd(d),
d = bd("span");
d.className = "ytp-text-tooltip";
d.appendChild(g)
}
iv(c.template, "content", d);
var g = !!eg(a, "tooltip-below"),
d = c,
h = Ce(a),
h = new E(h.width / 2, g ? h.height : 0),
k = ue(a),
h = new E(k.x + h.x, k.y + h.y),
g = !!g;
Q(d.element, "ytp-tooltip-below", g);
if (k = se(d.element)) var l = ue(k),
q = Le(k),
h = Ib(h, new E(l.x + q.left, l.y + q.top));
HE(h, d.element, g ? 1 : 0);
d.show();
var q = Ce(d.b),
g = q.width / 2 * -1,
s = Uc(window),
u = Wc(document),
h = u.x,
s = s.width + u.x,
u = h,
z = s;
k && (k = Ce(k), u = l.x, z = k.width + l.x);
k = ue(d.b);
l = k.x + g;
k = k.x + q.width + g;
l < Math.max(h, u) ? g -= l - Math.max(h, u) : k > Math.min(s, z) && (g -= k - Math.min(s, z));
oe(d.b, g)
}
}, ["mouseout", "mousedown"], function () {
c && (c.hide(), lh(c), c = null)
}, this, 10, 50);
this.b[ma(a)] = d
};
CJ.prototype.wf = function (a, b, c) {
var d = this.g;
this.Sg(a, function () {
if (d) {
var a = "detailpage" == d.ba;
if (!d.ja || a) return c
} else return c;
var g = d.ja,
h = d.Ba,
a = bd("div");
O(a, "ytp-identity-tooltip");
var k = bd("img");
k.src = h;
h = bd("span");
g = cd(Ld(b, {
USER_NAME: g
}));
ed(h, g);
ed(a, k, h);
return a
})
};
CJ.prototype.pn = function (a) {
a = ma(a);
lh(this.b[a]);
this.b[a] = null
};
CJ.prototype.J = function () {
this.g = this.Qm = null;
for (var a in this.b) lh(this.b[a]);
this.b = {};
CJ.G.J.call(this)
};
function DJ(a) {
LG.call(this, a);
this.k = this.Ia = this.B = this.O = null;
this.td = this.Da = !1;
this.gc = {
"watch-small": new G(640, 360),
"watch-medium": new G(854, 480),
"watch-large": new G(1280, 720)
};
this.sd = {
Mi: new G(1540, 1040),
k: new G(1320, 940),
j: new G(1400, 760),
b: new G(1294, 700)
};
this.kb = {
Mi: new G(1280, 720),
g: new G(960, 540),
fx: new G(854, 480),
bx: new G(640, 360)
}
}
w(DJ, LG);
DJ.b = 50;
DJ.g = 200;
f = DJ.prototype;
f.bh = function () {
DJ.G.bh.call(this);
this.app.subscribe("clearvideooverlays", this.lD, this)
};
f.Os = function () {
var a = this.app.O.assets;
if (a.css && !Pp()) {
var a = {
rel: "stylesheet",
type: "text/css",
href: a.css
},
b = document.getElementById("www-player-css");
a.id = "www-player-css";
var c = b || document.createElement("link");
Sc(c, a);
b || document.getElementsByTagName("head")[0].appendChild(c);
this.or(DJ.g)
} else this.Da = !0;
this.I("templateready")
};
f.or = function (a) {
0 >= a || Pp() ? (this.Da = !0, this.element && sy(this.element)) : J(t(this.or, this, a - 1), DJ.b)
};
f.Ng = function () {
this.Da || ty(this.element);
DJ.G.Ng.call(this)
};
f.Jn = function (a) {
DJ.G.Jn.call(this, a);
a.tc || this.addClass("hide-info-bar");
a.sc && this.Rf()
};
f.xn = function (a) {
DJ.G.xn.call(this, a);
var b = new X(["img", ["html5-watermark", "html5-stop-propagation", "ytp-scalable-icon-shrink", "hid"], {
src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
alt: Y(0, "YTP_WATERMARK")
}]);
this.O = b.K();
b.X(this.element);
this.B = new sJ(this.app, this.A);
S(this, this.B);
this.B.X(document.body);
this.k = new xJ(this.A, this.app);
this.k.X(this.element);
S(this, this.k);
a.Ac && O(this.B.K(), "house-brand")
};
f.um = function () {
this.app.R().Ff ? this.Ia || (this.Ia = new pJ(this.g, t(this.tm, this), t(this.is, this)), S(this, this.Ia)) : DJ.G.um.call(this)
};
f.Fj = function (a) {
DJ.G.Fj.call(this, a);
a ? sy(this.k.K()) : ty(this.k.K())
};
f.zj = function (a) {
DJ.G.zj.call(this, a);
this.k && this.k.update(a);
var b = this.app;
if (b.getVideoData().qa ? !b.b.Rk : b.b.Fc) {
if (a = a.qa) this.O.src = a;
gx(this.O)
}
};
f.Cn = function () {
DJ.G.Cn.call(this);
var a = this.app.R();
a.Ub || (vy(this, this.element, "click", t(this.As, this, !1), void 0, void 0, !0), vy(this, this.element, "keydown", t(this.As, this, !0), void 0, void 0, !0), vy(this, this.element, "focus", this.vC, void 0, void 0, !0));
a.Bk || (vy(this, this.element, "keypress", this.zC), vy(this, this.element, "keydown", this.yC));
a = t(this.B.uC, this.B);
Uq && this.ca ? this.ca.B = a : vy(this, this.element, "contextmenu", a);
vy(this, this.O, "click", this.zs);
this.k.subscribe("title-click", t(this.zs, this));
this.k.subscribe("share-click", t(this.xC, this));
this.k.subscribe("info-click", t(this.wC, this))
};
f.zC = function (a) {
this.app.b.B = v();
var b = !1,
c = a.keyCode;
if (179 == c || 178 == c) 179 == c && (this.I("playpausetoggled", !0), a.preventDefault(), b = !0), 178 == c && (this.app.b.B = v(), os(this.app), a.preventDefault(), b = !0);
98 == c && (this.app.ff("onBackgroundChange"), b = !0);
111 == c && (this.app.ff("onTextOpacityChange"), b = !0);
119 == c && (this.app.ff("onWindowOpacityChange"), b = !0);
if (61 == c || 43 == c) this.app.ff("onFontSizeIncrease"), b = !0;
if (45 == c || 95 == c) this.app.ff("onFontSizeDecrease"), b = !0;
32 == c && SG(a) && (TG(this), zG(this.app), a.preventDefault(),
b = !0);
48 <= c && 57 >= c && (js(this.app, (c - 48) / 10 * ks(this.app)), a.preventDefault(), b = !0);
this.app.R().Ib() && this.app.Oh("onKeyPress", {
keyCode: c,
handled: b
})
};
f.yC = function (a) {
var b = !1,
c = a.keyCode;
if (38 == c || 40 == c || 37 == c || 39 == c) {
b = 5;
a.ctrlKey && (b *= 2);
if (38 == c) b = this.app, GG(b, {
volume: b.C.volume + 5,
muted: !1
});
else if (40 == c) b = this.app, GG(b, {
volume: b.C.volume - 5,
muted: !1
});
else if (37 == c) {
var d = this.app,
b = -1 * b;
js(d, d.getCurrentTime() + b, !1, 250, void 0)
} else 39 == c && (d = this.app, js(d, d.getCurrentTime() + b, !1, 250, void 0));
b = !0
}
36 == c && (js(this.app, 0), b = !0);
35 == c && (js(this.app, Infinity), b = !0);
27 == c && (Eg() ? (yG(this.app, !1), b = !0) : null != this.j.j ? (this.j.wd(), b = !0) : this.C.ka &&
(this.mh(), b = !0));
b && a.preventDefault();
this.app.R().Ib() && this.app.Oh("onKeyPress", {
keyCode: c,
altKey: a.altKey,
ctrlKey: a.ctrlKey,
metaKey: a.metaKey,
shiftKey: a.shiftKey,
handled: b,
fullscreen: this.app.R().xb
})
};
f.zs = function (a) {
a.preventDefault();
HG(this.app)
};
f.xC = function () {
this.app.Qh();
if ("detailpage" == this.app.R().ba) {
yG(this.app, !1);
var a = this.app,
b = a.getVideoData();
a.I("SHARE_CLICKED", {
videoId: b.videoId,
listId: b.Na,
feature: "player_" + a.b.ba
})
}
};
f.wC = function () {
this.app.Qh()
};
f.lD = function () {
var a = this.k;
P(a.element, "show-share");
P(a.element, "show-more-info")
};
f.As = function (a) {
this.td = a
};
f.vC = function () {
Q(this.element, "ytp-keyboard-focus", this.td)
};
f.Em = function (a) {
DJ.G.Em.call(this, a);
this.B && (a ? this.B.X(this.element) : this.B.X(document.body), this.B.hide());
a && this.element.focus()
};
f.hm = function () {
DJ.G.hm.call(this);
if (!this.app.R().Vb) {
var a = new CJ(this.element, this.app.R());
S(this, a);
this.A.b = a;
var b = Qc("ytp-tooltip-anchor", this.element);
y(b, function (b) {
a.Sg(b)
})
}
};
f.Db = function () {
var a = this.app.R(),
b = us(this.app) && 2 == us(this.app).getPlayerType();
if ("detailpage" == a.ba && !a.xb && !b) {
b = Pc("player");
if (!b) return DJ.G.Db.call(this);
if (a.b.Vc) return this.app.R().ud ? (a = Uc(window), a = a.width >= this.sd.Mi.width && a.height >= this.sd.Mi.height ? this.kb.Mi : this.kb.fx) : a = this.kb.bx, a;
if (a.b.g) return DJ.G.Db.call(this);
for (var c in this.gc)
if (Zf(b, c)) return this.gc[c]
}
return DJ.G.Db.call(this)
};
f.xs = function () {
var a = this.Db();
this.app.R().Xd && (a.height += 3);
return a
};
f.J = function () {
DJ.G.J.call(this);
Bg(this.O);
this.O = null
};
function EJ(a) {
this.k = Math.exp(Math.log(.5) / a);
this.g = this.j = 0
}
EJ.prototype.b = function (a, b) {
var c = Math.pow(this.k, a);
this.g = b * (1 - c) + c * this.g;
this.j += a
};
EJ.prototype.o = function () {
return this.g / (1 - Math.pow(this.k, this.j))
};
function FJ(a) {
this.g = window.Float32Array ? new Float32Array(a) : Array(a);
this.b = a - 1
}
FJ.prototype.add = function (a) {
this.b = (this.b + 1) % this.g.length;
this.g[this.b] = a
};
FJ.prototype.forEach = function (a) {
for (var b = this.b + 1; b < this.g.length; b++) a(this.g[b] || 0);
for (b = 0; b <= this.b; b++) a(this.g[b] || 0)
};
function GJ(a, b, c) {
this.D = 0;
this.B = a;
this.k = b || .5;
this.A = c || 0;
this.C = "index";
this.g = 0;
this.j = []
}
GJ.prototype.b = function (a, b) {
HJ(this, "index");
this.j.push({
index: this.D++,
weight: a,
value: b
});
this.g += a;
for (HJ(this, "index"); this.g > this.B;) {
var c = this.g - this.B,
d = this.j[0];
d.weight <= c ? (this.g -= d.weight, this.j.shift()) : (this.g -= c, d.weight -= c)
}
};
function IJ(a, b) {
HJ(a, "value");
var c = b * a.g,
d = 0,
e = NaN;
a.j.some(function (a) {
d += a.weight;
e = a.value;
if (d >= c) return !0
});
return e
}
GJ.prototype.o = function () {
return this.A ? (IJ(this, this.k - this.A) + IJ(this, this.k) + IJ(this, this.k + this.A)) / 3 : IJ(this, this.k)
};
function HJ(a, b) {
a.C != b && (a.C = b, Ab(a.j, b))
};
function JJ(a) {
this.b = a;
this.A = this.D = this.F = 0;
this.N = new FJ(100);
this.H = 0;
this.B = new GJ(16, .6);
this.C = new EJ(4);
this.b.j ? this.j = new EJ(this.b.g) : this.j = new GJ(this.b.g, .5, .1);
this.g = this.o = this.k = 0;
a = Sh("yt-player-bandwidth") || {};
this.j.b(this.b.k, 0 < a.byterate ? a.byterate : 13E4);
0 < a.delay && this.B.b(1, +a.delay);
0 < a.tailDelay && this.C.b(1, +a.tailDelay);
this.A = v()
}
function KJ(a, b, c) {
a.b.b || (b = Math.max(b, .05), a.j.b(b, c / b), LJ(a))
}
function MJ(a, b, c) {
a.B.b(1, c);
1E4 < v() - a.A && NJ(a);
0 == a.k && (a.o = b / 1E3);
a.k++
}
function OJ(a, b, c) {
isNaN(c) || (a.D += c);
isNaN(b) || (a.F += b / 1E3);
LJ(a)
}
function PJ(a, b, c) {
b = Math.max(b, 8192);
a.C.b(1, c / b);
1E4 < v() - a.A && NJ(a)
}
function QJ(a) {
a = a.B.o();
return a = isNaN(a) ? .5 : a
}
function RJ(a) {
return a.C.o() || 0
}
function SJ(a) {
a = a.j.o();
return 0 < a ? a : 1
}
function TJ(a) {
var b = {};
b.delay = QJ(a);
b.tailDelay = RJ(a);
b.byterate = SJ(a);
return b
}
function NJ(a) {
var b = TJ(a);
Ph("yt-player-bandwidth", b, 2592E3);
a.A = v()
}
function LJ(a) {
var b = v();
500 < b - a.H && (a.N.add(1 / (1 / SJ(a) + RJ(a))), a.H = b)
};
function UJ() {
this.g = 17;
this.k = .5;
this.b = this.j = !1
};
function VJ() {
this.b = [];
this.k = {};
this.C = {};
this.D = {};
this.g = this.o = null;
this.j = [];
this.A = null
}
w(VJ, jh);
VJ.prototype.B = function (a) {
if (this.g) {
var b;
var c = ma(a);
b = this.k[c];
if (!b)
if (this.g) {
if (b = a(this.g)) {
a = this.k[c] = b;
for (var d in this.o) a.subscribe(d, this.o[d]);
a.subscribe("command_log_timing", this.F, this);
S(this, b)
}
} else b = null;
b && b.Ka(this.g) && !C(this.b, b) && (b.create(), this.b.push(b), C(this.j, b.wa) && (b.oc = this.A, b.Fi(!!b.oc)))
}
};
function WJ(a) {
y(a.b, function (a) {
a.destroy()
});
a.b = []
}
function XJ(a, b, c) {
YJ(a);
a.A = b;
a.j = sb(c);
y(a.b, function (a) {
0 <= db(c, a.wa) && (a.oc = b, a.Fi(!!a.oc))
})
}
function YJ(a) {
y(a.j, function (a) {
if (a = xs(this, a)) a.oc = null, a.Fi(!1)
}, a);
a.A = null;
a.j = []
}
function Js(a, b, c, d) {
return b && c ? (a = xs(a, b)) ? a.vt(c, d) : null : null
}
function Ks(a, b) {
if (!b) return A(a.b, function (a) {
return a.wa
});
var c = xs(a, b);
return c ? c.Xr() : []
}
function xs(a, b) {
return B(a.b, function (a) {
return a.wa == b
})
}
VJ.prototype.H = function (a, b) {
y(this.b, function (c) {
c.I(a, b)
})
};
function ZJ(a) {
var b = {};
y(a.b, function (a) {
sa(b, a.Zg())
});
return b
}
VJ.prototype.F = function (a, b) {
sa(this.D, a || null);
sa(this.C, b || null)
};
VJ.prototype.isAvailable = function (a) {
return (a = xs(this, a)) ? a.gk : !1
};
function $J(a) {
this.b = {};
for (var b = 0; b < a.length; b++) {
var c = a[b];
this.b[c.b] = c
}
}
function aK(a) {
a = Qb(a.b);
zb(a, function (a, c) {
return a.b - c.b
});
return a
};
function bK(a, b, c) {
this.j = a;
this.b = b;
this.k = !!c.Xe;
this.g = c.pa
};
function cK() {
this.Pc = {};
this.g = this.bc().b;
this.b = null
}
f = cK.prototype;
f.bc = function () {
var a = this.constructor,
b;
if (!(b = a.ft)) {
var c;
b = a.PD;
var d = [];
for (c in b) 0 != c && d.push(new bK(a, c, b[c]));
c = new $J(d);
b = a.ft = c
}
return b
};
f.get = function (a, b) {
a.j.bc();
this.bc();
var c;
c = a.b;
var d = dK(this, c);
c = this.g[c].k ? d[b || 0] : d;
return c
};
f.set = function (a, b) {
a.j.bc();
this.bc();
eK(this, a.b, b)
};
f.add = function (a, b) {
a.j.bc();
this.bc();
fK(this, a.b, b)
};
f.clear = function (a) {
a.j.bc();
this.bc();
a = a.b;
delete this.Pc[a];
this.b && delete this.b[a]
};
f.equals = function (a) {
if (!a || this.constructor != a.constructor) return !1;
for (var b = aK(this.bc()), c = 0; c < b.length; c++) {
var d = b[c],
e = d.b;
if (null != this.Pc[e] != (null != a.Pc[e])) return !1;
if (null != this.Pc[e]) {
var g = 11 == d.g || 10 == d.g,
h = dK(this, e),
e = dK(a, e);
if (d.k) {
if (h.length != e.length) return !1;
for (d = 0; d < h.length; d++) {
var k = h[d],
l = e[d];
if (g ? !k.equals(l) : k != l) return !1
}
} else if (g ? !h.equals(e) : h != e) return !1
}
}
return !0
};
function gK(a, b) {
for (var c = aK(a.bc()), d = 0; d < c.length; d++) {
var e = c[d],
g = e.b;
if (null != b.Pc[g]) {
a.b && delete a.b[e.b];
var h = 11 == e.g || 10 == e.g;
if (e.k)
for (var e = dK(b, g) || [], k = 0; k < e.length; k++) fK(a, g, h ? e[k].clone() : e[k]);
else e = dK(b, g), h ? (h = dK(a, g)) ? gK(h, e) : eK(a, g, e.clone()) : eK(a, g, e)
}
}
}
f.clone = function () {
var a = new this.constructor;
a != this && (a.Pc = {}, a.b && (a.b = {}), gK(a, this));
return a
};
function dK(a, b) {
var c = a.Pc[b];
return null == c ? null : c
}
function eK(a, b, c) {
a.Pc[b] = c;
a.b && (a.b[b] = c)
}
function fK(a, b, c) {
a.Pc[b] || (a.Pc[b] = []);
a.Pc[b].push(c);
a.b && delete a.b[b]
}
function hK(a, b) {
a.PD = b;
a.bc = function () {
return a.ft || (new a).bc()
}
};
function iK() {
cK.apply(this)
}
w(iK, cK);
function jK() {
cK.apply(this)
}
w(jK, cK);
hK(iK, {
0: {
name: "MessageDetails",
mf: "logs_proto.MessageDetails"
},
1: {
name: "may_appear_in",
Xe: !0,
pa: 11,
type: jK
}
});
hK(jK, {
0: {
name: "Type",
HK: iK,
mf: "logs_proto.MessageDetails.Type"
},
1: {
name: "source_type",
required: !0,
pa: 9,
type: String
},
2: {
name: "log_type",
required: !0,
pa: 9,
type: String
}
});
var kK = {
qF: 0,
aH: 1,
lH: 2,
pF: 3,
yF: 4,
ZG: 5,
jH: 6,
gH: 7,
hH: 8,
iH: 9,
eH: 10,
fH: 11,
AF: 12,
zF: 13,
oF: 14,
iF: 15,
$G: 20,
nH: 21,
hF: 22,
bH: 23,
mH: 24,
kH: 25,
vF: 30,
oH: 31,
uF: 32,
wF: 33,
dH: 40,
cH: 41,
BF: 42,
CF: 43,
jF: 50,
mF: 51,
rF: 52,
sF: 53,
tF: 54,
eF: 55,
fF: 56,
xF: 57,
nF: 58,
lF: 60,
kF: 61,
gF: 70,
dF: 80,
DF: 90
};
function lK() {
cK.apply(this)
}
w(lK, cK);
function mK() {
cK.apply(this)
}
w(mK, cK);
function nK() {
cK.apply(this)
}
w(nK, cK);
function oK() {
cK.apply(this)
}
w(oK, cK);
function pK() {
cK.apply(this)
}
w(pK, cK);
function qK() {
cK.apply(this)
}
w(qK, cK);
hK(lK, {
0: {
name: "YtAdType",
mf: "video.YtAdType"
},
1: {
name: "ad_namespace",
required: !0,
pa: 14,
defaultValue: 0,
type: {
dG: 0,
BH: 1,
eG: 2,
tH: 3,
MH: 4,
yH: 5,
xH: 6,
qt: 7,
vH: 8,
AG: 9,
sH: 10,
wH: 11,
qG: 12,
yK: 13
}
},
2: {
name: "ad_format",
required: !0,
pa: 14,
defaultValue: 0,
type: {
$F: 0,
lI: 1,
jI: 2,
NI: 3,
dK: 4,
mI: 5,
gI: 6,
iI: 7,
DK: 8,
GH: 9
}
},
3: {
name: "ad_invideo",
pa: 14,
defaultValue: 0,
type: {
bG: 0,
PG: 1,
QG: 2,
RG: 3,
uH: 4,
OG: 5,
BG: 6
}
},
4: {
name: "invideo_autoplay",
pa: 14,
defaultValue: 0,
type: {
vG: 0,
yE: 1
}
},
5: {
name: "ad_instream",
pa: 14,
defaultValue: 0,
type: {
aG: 0,
YJ: 1,
bK: 2,
Zm: 3,
zG: 4
}
},
6: {
name: "ad_instream_long",
pa: 8,
type: Boolean
}
});
hK(mK, {
0: {
name: "AdId",
mf: "video.AdId"
},
1: {
name: "ad_network",
pa: 14,
defaultValue: 1,
type: {
OTHER: 1,
bF: 2
}
},
2: {
name: "ad_network_name",
pa: 9,
type: String
},
3: {
name: "ad_id",
required: !0,
pa: 9,
type: String
}
});
hK(nK, {
0: {
name: "YtAdEvent",
mf: "video.YtAdEvent"
},
1: {
name: "ad_event_type",
required: !0,
pa: 14,
defaultValue: 0,
type: {
MF: 0,
TF: 1,
NF: 2,
WF: 3,
OF: 4,
PF: 5,
JF: 6,
HF: 7,
pH: 8,
FF: 9,
UF: 10,
VF: 11,
GF: 12,
rH: 13,
XF: 14,
KF: 15,
qH: 16,
LF: 17,
IF: 18,
YF: 100,
ZF: 101,
RF: 130,
QF: 131,
SF: 132
}
},
2: {
name: "wall_time",
required: !0,
pa: 2,
type: Number
},
3: {
name: "media_time",
required: !0,
pa: 2,
type: Number
},
4: {
name: "logentry_time_usec",
required: !0,
pa: 3,
type: String
},
5: {
name: "ad_error_type",
pa: 14,
defaultValue: 0,
type: kK
}
});
hK(oK, {
0: {
name: "YtAdSlot",
mf: "video.YtAdSlot"
},
1: {
name: "slot_time",
required: !0,
pa: 2,
type: Number
},
2: {
name: "ad_type",
required: !0,
pa: 11,
type: lK
},
3: {
name: "ad_events",
Xe: !0,
pa: 11,
type: nK
},
4: {
name: "ad_video_duration",
pa: 2,
type: Number
},
5: {
name: "ad_id",
pa: 9,
type: String
},
6: {
name: "slot_index",
pa: 5,
type: Number
}
});
hK(pK, {
0: {
name: "YtVideoMetadata",
mf: "video.YtVideoMetadata"
},
1: {
name: "content_owner_ids",
Xe: !0,
pa: 9,
type: String
},
2: {
name: "video_duration_seconds",
pa: 2,
type: Number
},
3: {
name: "all_content_owner_ids",
pa: 9,
type: String
}
});
hK(qK, {
0: {
name: "YtWatchAdInfo",
mf: "video.YtWatchAdInfo"
},
1: {
name: "video_id",
required: !0,
pa: 9,
type: String
},
2: {
name: "allowed_ads",
Xe: !0,
pa: 11,
type: lK
},
3: {
name: "ad_slots",
Xe: !0,
pa: 11,
type: oK
},
4: {
name: "ps",
pa: 9,
type: String
},
5: {
name: "el",
pa: 9,
type: String
},
6: {
name: "country",
pa: 9,
type: String
},
7: {
name: "feature",
pa: 9,
type: String
},
8: {
name: "blocked",
pa: 8,
type: Boolean
},
9: {
name: "plid",
pa: 9,
type: String
},
10: {
name: "video_metadata",
pa: 11,
type: pK
},
11: {
name: "experiment_id",
Xe: !0,
pa: 3,
type: String
},
12: {
name: "ad_flags",
pa: 4,
type: String
},
13: {
name: "all_experiment_ids",
pa: 9,
type: String
},
14: {
name: "no_ads_returned",
pa: 8,
type: Boolean
},
15: {
name: "ad_errors",
Xe: !0,
pa: 14,
defaultValue: 0,
type: kK
},
16: {
name: "ad_slot_with_event",
pa: 11,
type: oK
}
});
function rK(a, b) {
Ts.call(this, a, b)
}
w(rK, Ts);
f = rK.prototype;
f.Lg = function () {
is(this.app, !0, this.b);
this.app.Vd(this.b)
};
f.pauseVideo = function () {
this.app.pauseVideo(this.b)
};
f.Rs = function (a, b, c) {
is(this.app, !0, this.b);
var d = this.app,
e = this.b;
d.qf(d.getCurrentTime() + a, b, c, e)
};
f.Mg = function (a, b) {
is(this.app, !0, this.b);
this.app.qf(a, b, void 0, this.b)
};
f.yk = function () {
qs(this.app, this.b)
};
function sK(a) {
this.app = a;
Ot.call(this, a.Hb)
}
w(sK, Ot);
sK.prototype.Ns = function () {
return -1
};
var tK = {
sO: function (a, b) {
var c = a[0];
a[0] = a[b % a.length];
a[b] = c;
return a
},
Ra: function (a, b) {
return a.slice(b)
},
EF: function (a) {
return a.reverse()
}
};
function uK(a) {
a = a.split("");
a = tK.sO(a, 25);
a = tK.EF(a, 63);
a = tK.Ra(a, 1);
a = tK.sO(a, 49);
a = tK.sO(a, 52);
return a.join("")
};
var vK = {
jJ: "red",
WHITE: "white"
};
var wK = {
vE: "0",
FJ: "1",
XG: "2"
};
var xK = {
"ad-trueview-indisplay-pv": 6,
"ad-trueview-insearch": 7
},
yK = {
"ad-trueview-indisplay-pv": 2,
"ad-trueview-insearch": 2
},
zK = {
adunit: {
tc: !1,
kp: !1,
Fc: !1
},
detailpage: {
sc: !0
}
};
zK.embedded = {
Ff: Dg(),
Fc: !0
};
zK.profilepage = {
qh: !0
};
var AK = "blogger books docs google-live play picasaweb".split(" "),
BK = {
blazer: {
GK: "youtube_mobile",
yc: !1,
EE: !1,
Wi: !1,
Rn: !1,
Vb: !0,
sc: !1,
Wb: !1,
Xb: !1,
Ub: !0
},
blogger: {
De: !1,
fg: !1,
hc: !1,
tc: !1,
Kc: !1,
sc: !1,
Mf: !1,
Fc: !1,
Yc: "bl"
},
books: {
De: !1,
fg: !1,
hc: !1,
tc: !1,
Kc: !1,
sc: !0,
Mf: !1,
Fc: !1,
Yc: "gb"
},
docs: {
De: !1,
fg: !1,
hc: !1,
tc: !1,
Kc: !1,
sc: !1,
Mf: !1,
Fc: !1,
Yc: "gd"
},
"google-live": {
De: !1,
fg: !1,
hc: !1,
tc: !1,
Kc: !1,
sc: !1,
Mf: !1,
Fc: !1,
Yc: "gl"
},
play: {
tc: !1,
Kc: !1,
sc: !1,
Fc: !1,
Yc: "gp"
},
"native": {
Wi: !1,
Rn: !1,
Wb: !0
},
picasaweb: {
De: !1,
fg: !1,
hc: !1,
tc: !1,
Kc: !1,
sc: !1,
Mf: !1,
Fc: !1,
Yc: "pw"
},
touch: {
Wi: !1,
Rn: !1,
Ub: !0
}
};
function CK(a) {
a = Zb(a);
this.g = {};
this.b = new uq(a.fexp);
this.origin = Xp(this.origin, a.origin);
this.Ee = Xp(this.Ee, a.loaderUrl);
if ("adunit" != a.el || jo(this.Ee)) this.ba = a.el || this.ba;
var b = zK[this.ba];
b && sa(this, b);
b = a.ps;
if (!C(AK, b) || this.Ib()) this.vb = b || this.vb;
(b = BK[this.vb]) && sa(this, b);
this.Ac = this.Ib() && C(AK, this.vb);
this.ug = !(!Np().defaultPlaybackRate || nc || Ug || Tg || Vg);
if (a.use_media_volume) b = !1;
else {
var b = Np(),
c = b.muted;
b.muted = !c;
b = b.muted != c
}
this.Up = b;
this.vp = Vg;
if (Ug || Tg) this.wo = "blazer" != this.vb;
this.Mp = "0" != a.add_player_event_listeners;
b = Up(this.Ff, a.fs);
this.Ff = "detailpage" == this.ba ? b : b && Dg();
this.Va = Xp(this.Va, a.authuser);
this.Hi = Vp(this.Hi, a.autohide, YD);
this.yc = Up(this.yc, a.autoplay);
this.Sl = Up(this.Sl, a.autoplayoverride);
this.color = Vp(this.color, a.color, vK);
this.C = Xp(this.C, a.content_v);
this.Tl = Vp(this.Tl, a.controls, wK);
this.Bk = Up(this.Bk, a.disablekb);
this.Ji = Up(this.Ji, a.edu_mode);
this.j = Xp(this.j, a.eurl);
this.H = Xp(this.H, a.framer);
this.ua = Vp(this.ua, a.iv_load_policy, Fp);
this.o = Xp(this.o,
a.hl);
this.Wp = Up(this.Wp, a.bwlogging);
this.Vb = Up(this.Vb, a.is_html5_mobile_device);
this.ud = Up(this.ud, a.player_wide);
this.Xp = Up(this.Xp, a.is_playground);
this.Vh = Up(this.Vh, a.privembed);
this.Zp = Up(this.Zp, a.loop);
this.Gf = Up(this.Gf, a.modestbranding);
"red" != this.color && (this.Gf = !1);
this.Yp = Up(this.Yp, a.on3g);
this.cb = Xp(this.cb, a.pageid);
this.wi = aq(this.wi, a.vq);
this.Vk = Xp(this.Vk, a.playerapiid);
this.gi = Up(this.gi, a.playsinline);
this.Fk = Up(this.Fk, a.playonclick);
this.$ = Xp(this.$, a.cr);
this.hc = Up(this.hc,
a.logwatch);
this.Ak = Up(this.Ak, a.canplaylive);
this.tc = Up(this.tc, a.showinfo);
this.Kc = Up(this.Kc, a.rel);
this.sc = Up(this.sc, a.enablesizebutton);
this.Ql = Up(this.Ql, a.ss);
this.N = Xp(this.N, a.theme);
this.Wb = Up(this.Wb, a.use_native_controls);
this.Xb = !Tg && Up(this.Xb, a.svt);
this.Ib() && (this.wk = Up(this.wk, a.retryneterr), this.Rk = Up(this.Rk, a.nologo));
this.Wb && (this.Gf = !0, this.ua = 3);
this.Ki = Up(this.Ki, a.ssl);
if (this.mi = Up(this.mi, a.ssl_stream)) this.Ki = !0;
if (this.Ub = Up(this.Ub, a.use_tablet_controls)) this.N = "dark",
this.Hi = "blazer" == this.vb ? "3" : "1";
b = this.og;
if (c = a.video_container_override) {
var d = c.split("x");
2 == d.length && (c = parseInt(d[0], 10), d = parseInt(d[1], 10), b = isNaN(c) || isNaN(d) || 0 >= c * d ? b : new G(c, d))
}
this.og = b;
this.Ma = Xp(this.Ma, a.attrib);
this.oa = Xp(this.oa, a.sk);
this.protocol = this.Ki ? "https" : "http";
this.Xd = "0" != this.Tl;
this.Yj = Up(this.Xd, a.store_user_volume);
this.ae = Up(this.ae, a.use_media_volume);
if (b = a.BASE_YT_URL) c = (c = b && b.match(Un)) ? c[0] : "", d = fo(b) ? b : "", c != d && Jd(Error(b + " behavior is not consistent")),
d && (this.wb = d);
if (c = b = a.gdatabaseurl) c = !!b && -1 != b.search(Xn), d = fo(b), c != d && Jd(Error(b + " behavior is not consistent")), c = d;
c && (this.Vo = b);
DK(this, a);
b = !this.b.qa;
("detailpage" == this.ba || b && "unknown" == this.j || "undefined" == this.j) && delete this.j;
this.Fc = this.Gf && !this.Wb ? !this.tc : this.tc || this.Xd ? !1 : this.Fc;
this.b.Ba && (En = uK);
b = this.yc || "detailpage" == this.ba;
c = !0;
this.Vb && (c = !1);
Wq("nintendo wiiu") && (c = !1);
this.Sl && (c = !0);
this.Nh = b && c;
this.g = a
}
w(CK, jh);
f = CK.prototype;
f.sf = null;
f.Mp = !0;
f.Ff = !0;
f.Va = "";
f.Hi = "2";
f.yc = !1;
f.Sl = !1;
f.wb = "/";
f.Vo = "//gdata.youtube.com/";
f.EE = !0;
f.color = "red";
f.Tl = "1";
f.ye = "web";
f.ze = "html5";
f.Bk = !1;
f.Ji = !1;
f.Wi = !0;
f.Rn = !0;
f.ug = !1;
f.Up = !1;
f.ba = "detailpage";
f.Wp = !1;
f.Ac = !1;
f.Vb = !1;
f.xb = !1;
f.hr = !1;
f.ud = !1;
f.De = !0;
f.Xp = !1;
f.Vh = !1;
f.fg = !0;
f.Kg = !1;
f.Ee = "";
f.Zp = !1;
f.Gf = !1;
f.wi = qp;
f.Vk = "";
f.Yp = !1;
f.cb = "";
f.vb = null;
f.gi = !1;
f.vp = !1;
f.wk = !1;
f.Nh = !1;
f.hc = !1;
f.Ak = !0;
f.Xd = !0;
f.Yj = !0;
f.ae = !1;
f.tc = !0;
f.kp = !0;
f.Kc = !0;
f.qh = !1;
f.sc = !1;
f.Mf = !0;
f.Fc = !1;
f.Ql = !1;
f.Rk = !1;
f.wo = !1;
f.Wb = !1;
f.Xb = !0;
f.Ki = !1;
f.mi = !1;
f.Ub = !1;
f.Zc = null;
f.og = null;
f.Sq = null;
f.zf = null;
f.Sa = null;
f.pi = null;
f.Yc = "yt";
f.Fk = !1;
function As(a, b) {
a.va = b.get("d", a.va);
a.qa = b.get("f", a.qa)
}
function DK(a, b) {
if (b) {
var c;
(c = b.adformat) || (c = (c = b.attrib) && c in xK && c in yK ? yK[c] + "_" + xK[c] : void 0);
if (c) {
var d = c.match(/^(\d*)_((\d*)_?(\d*))$/);
d && 5 == d.length && (d = d[3], d = 6 == d || 7 == d || 8 == d || 10 == d, a.Ib() || d) && (a.k = c, a.g.adformat = b.adformat, d || (a.ba = "adunit"))
}
}
a.sf = (b && b.adpings ? Yh(b.adpings) : null) || a.sf;
c = b.agcid;
a.Ia = c;
a.g.agcid = c;
c = b.feature;
a.A = c;
a.g.feature = c;
c = b.referrer;
a.F = c;
a.g.referrer = c;
a.Ua = b.q;
a.L = Xp(a.L, b.cbrand);
a.M = Xp(a.M, b.cbr);
a.O = Xp(a.O, b.cbrver);
a.ye = Xp(a.ye, b.c);
a.ze = Xp(a.ze,
b.cver);
a.P = Xp(a.P, b.cmodel);
a.T = Xp(a.T, b.cnetwork);
a.U = Xp(a.U, b.cos);
a.W = Xp(a.W, b.cosver);
a.D = Xp(a.D, b.cplatform);
a.b.g = Up(a.b.g, b.flexwatch_enabled);
a.hc = Up(a.hc, b.logwatch);
a.Aa = Wp(a.Aa, b.user_age);
a.Ba = Xp(a.Ba, b.user_display_image);
a.ja = Xp(a.ja, b.user_display_name);
a.Da = Xp(a.Da, b.user_gender);
a.ka = Xp(a.ka, b.eventid);
a.ca = Xp(a.ca, b.csi_page_type);
a.Ca = Up(a.Ca, b.enablecsi)
}
function EK(a) {
var b = {};
b.c = a.ye;
a.ze && (b.cver = a.ze);
a.D && (b.cplatform = a.D);
a.L && (b.cbrand = a.L);
a.P && (b.cmodel = a.P);
a.T && (b.cnetwork = a.T);
a.M && (b.cbr = a.M);
a.O && (b.cbrver = a.O);
a.U && (b.cos = a.U);
a.W && (b.cosver = a.W);
return b
}
function FK(a, b) {
switch (b.Ud) {
case 38:
var c = b.videoId.indexOf(":");
return qf("//play.google.com/books/volumes/" + b.videoId.slice(0, c) + "/content/media", {
aid: b.videoId.slice(c + 1),
sig: b.hg
});
case 30:
return c = "//docs.google.com/", a.wb != CK.prototype.wb && (c = a.wb), qf(c + "get_video_info", {
docid: b.videoId,
authuser: b.Va,
authkey: b.dr,
eurl: a.j
});
case 33:
return qf("//google-liveplayer.appspot.com/get_video_info", {
key: b.videoId
});
default:
c = {
html5: "1",
video_id: b.videoId,
cpn: b.Ea,
eurl: a.j,
ps: a.vb,
el: a.ba,
hl: a.o,
list: b.Na,
agcid: a.Ia,
sts: 16230
};
b.C ? c.vvt = b.C : b.B && (c.access_token = b.B);
a.k && (c.adformat = a.k);
b.va && (c.iv_load_policy = b.va);
b.lg && (c.autoplay = "1");
b.Km && (c.noiba = "1");
b.Lm && (c.mdx = "1");
b.Mm && (c.utpsa = "1");
b.kb && (c.is_fling = "1");
var d;
d = (d = a.pi) ? new G(d.clientWidth, d.clientHeight) : new G(Number.NaN, Number.NaN);
d.width && (c.width = d.width);
d.height && (c.height = d.height);
b.ua && (c.ypc_preview = "1");
b.xe && (c.splay = "1");
a.C && (c.content_v = a.C);
b.Jm && (c.livemonitor = 1);
a.Va && (c.authuser = a.Va);
a.cb && (c.pageid = a.cb);
a.ka &&
(c.ei = a.ka);
a.mi && (c.ssl_stream = "1");
io() && (c.iframe = "1");
b.Mh && (c.tst = b.Mh);
sa(c, EK(a));
return qf(a.wb + "get_video_info", c)
}
}
function GK(a) {
return a.Ji ? "//s.youtubeeducation.com/" : a.fg ? "//s.youtube.com/" : "//video.google.com/"
}
function HK(a) {
return GK(a) + (a.b.N ? "api/stats/qoe" : "stream_204")
}
function IK(a) {
return a.F ? a.F.slice(0, 128) : ""
}
function pH(a, b, c, d) {
return zH(a, b.videoId, b.Na, c, d)
}
function zH(a, b, c, d, e) {
b = {
v: b,
list: c
};
d && sa(b, d);
a = qf(a.protocol + "://" + ("www.youtube-nocookie.com" == window.location.host || a.Ji ? "www.youtube.com" : window.location.host) + "/watch", b);
if (e) {
d = "";
d = "!" == "#".charAt(1) ? "#".substr(0, 2) : "#";
b = "#";
"#" == b.charAt(0) && (b = "!" == b.charAt(1) ? b.substr(2) : b.substr(1));
b = Yh(b);
for (var g in e) b[g] = e[g];
e = d + of(b);
a = a + e
}
return a
}
function wJ(a, b) {
if ("play" != a.vb) return "https://support.google.com/youtube/?p=report_playback";
var c = {
contact_type: "playbackissue",
html5: 1,
plid: b.Bb,
ei: b.A,
v: b.videoId,
p: "movies_playback"
};
b.b && (c.fmt = b.b.id);
b.Ea && (c.cpn = b.Ea);
b.Ud && (c.partnerid = b.Ud);
return qf("//support.google.com/googleplay/", c)
}
function JK(a) {
var b = {};
if (!a.Sa) return b;
a.Sa.webkitDecodedFrameCount && (b.hmewdfc = a.Sa.webkitDecodedFrameCount, b.hmewdrop = a.Sa.webkitDroppedFrameCount, b.hmewvdbc = a.Sa.webkitVideoDecodedByteCount, b.hmewadbc = a.Sa.webkitAudioDecodedByteCount);
a.Sa.mozParsedFrames && (b.hmempf = a.Sa.mozParsedFrames, b.hmemdf = a.Sa.mozDecodedFrames, b.hmempresented = a.Sa.mozPresentedFrames, b.hmempainted = a.Sa.mozPaintedFrames, b.hmempaintdelay = a.Sa.mozPaintDelay);
return b
}
function KK(a) {
var b = p("yt.www.watch.activity.getTimeSinceActive", window);
if ("detailpage" == a.ba && b) return b();
var c;
a.B && (c = v() - a.B);
return c
}
function xH(a) {
return "leanback" == a.ba || a.Ac || !a.Kc && !a.qh ? !1 : !0
}
function Os(a) {
return "detailpage" != a.ba && "embedded" != a.ba && "profilepage" != a.ba ? !1 : !0
}
f.Ib = function () {
var a = document.location.toString(),
b = !!a && -1 != a.search(Vn),
c = fo(a);
b != c && Jd(Error(a + " behavior is not consistent"));
a = c && !io();
if (c = c && io()) {
var c = this.Ee,
b = !!c && -1 != c.search(ao),
d = fo(c) || go(c, co);
b != d && Jd(Error(c + " behavior is not consistent"));
c = d
}
return c || a
};
function ND(a) {
return Wg && Wq("crkey") || "tv" == a.D
}
f.J = function () {
this.pi = this.Sa = null;
CK.G.J.call(this)
};
function LK(a, b) {
this.b = a;
this.xa = b
}
function MK(a, b, c, d) {
var e = RJ(a.b) + 1 / SJ(a.b);
d = Math.max(.9 * (d - 3), QJ(a.b) + 8192 * e);
c = d / e / (b + c);
c = Math.max(a.xa.A, Math.min(a.xa.M, c));
a = Math.max(a.xa.H, Math.ceil(a.xa.A * b));
return Math.min(a, Math.max(Math.ceil(c * b), 65536))
}
function NK(a) {
if (a.xa.O) return 1 / (RJ(a.b) + 1 / SJ(a.b));
var b = SJ(a.b);
a = QJ(a.b) + 1048576 * RJ(a.b);
return b * Math.min(1, 1048576 / (b * a))
};
function BG(a, b, c) {
this.b = a;
this.Wa = b;
this.g = c
};
function OK(a, b, c, d) {
this.M = a;
this.xa = b;
this.B = c;
this.D = d;
this.j = this.C = this.b = null;
this.o = "i";
this.H = -1;
this.A = this.g = null;
this.k = [];
this.F = this.N = 0;
this.L = null
}
function PK(a, b, c) {
"m" == c && sp(a.b) && !sp(b) && (c = "a");
if ("m" == c && sp(b)) return a.o = c, QK(a, b), a.j = RK(a), new BG(a.g, a.j, c);
var d = a.b.equals(b);
if ("m" == a.o && sp(a.b) && d) return null;
"r" != c || d || (a.H = -1);
QK(a, b);
b = RK(a);
if ("r" == c && !d && b == a.j) return a.j = b, new BG(a.g, b, c);
a.o = c;
return null
}
function SK(a, b) {
TK(a);
a.L = b;
a.F = v();
a.H = -1;
QK(a, a.b)
}
function TK(a) {
return !!a.F && v() - a.F <= 1E3 * a.xa.B
}
function RK(a) {
if (sp(a.b) || !(8E3 > v() - a.H)) {
a.F && !TK(a) && (a.F = 0, QK(a, a.b));
var b = NK(a.M);
if (sp(a.b)) a.A = a.B.b[a.k[a.k.length - 1].id];
else {
for (var c = Math.min(a.N, a.k.length - 1), d = b / 1.05 - a.g.info.ra; 0 < c && !(a.k[c].ra <= d); c--);
for (b = b / a.xa.C - a.g.info.ra; c < a.k.length - 1 && !(a.k[c + 1].ra >= b); c++);
a.N = c;
a.A = a.B.b[a.k[c].id]
}
}
return a.A
}
function UK(a) {
var b = a.o;
a.o = "a";
a.H = v();
return new BG(a.C, a.j, b)
}
function QK(a, b) {
a.b = b;
var c = a.D.g;
if (!sp(a.b) && (c = fb(c, function (a) {
return a.ra > this.xa.ra ? !1 : !this.B.b[a.id].o
}, a), TK(a))) {
var c = fb(c, function (a) {
return a.id != this.L.id
}, a),
d = fb(c, function (a) {
return "140" == a.id || "134" == a.id || "243" == a.id
});
d.length && (c = d)
}
c.length || (c = a.D.g);
c = fb(c, a.b.k, a.b);
c.length || (c = [a.D.g[0]]);
c.sort(function (a, b) {
return a.ra - b.ra
});
for (d = 1; d < c.length; d++) {
var e = c[d - 1],
g = c[d];
e.ra * a.xa.C > g.ra && (pb(c, e.Wa.width <= g.Wa.width ? d - 1 : d), d--)
}
a.k = c
}
function VK(a) {
var b = B(a.D.b, function (a) {
return !!a.o && a.o.b
});
b || (b = a.D.b[0]);
a.g = a.B.b[b.id]
}
function WK(a) {
var b = NK(a.M) / 1.05 - a.g.info.ra,
c = lb(a.k, function (a) {
return this.xa.Zh && this.xa.Zh < Nn[a.Wa.b] ? !1 : a.ra < b
}, a);
0 > c && (c = 0);
a.N = c;
a.A = a.B.b[a.k[c].id]
};
function XK(a) {
this.j = a;
this.pendingRequests_ = [];
this.b = [];
this.k = this.g = null;
this.o = 0;
this.ra = a.info.ra;
this.A = this.B = !1
}
function YK(a, b) {
a.pendingRequests_.push(b);
a.g = bb(b.info.b);
a.o += Ho(b.info)
}
function ZK(a) {
for (; a.pendingRequests_.length && 5 == a.pendingRequests_[0].state;) {
var b = a.pendingRequests_.shift();
a.o -= Ho(b.info);
a.o += bb(b.k).buffer.byteLength;
y(b.k, a.D, a)
}
}
XK.prototype.D = function (a) {
if (4 == a.info.type) {
var b = a.info.b.Cr(a);
a.info == this.g && (this.g = bb(b).info);
tb(this.b, b)
} else 3 == a.info.type && this.b.push(a)
};
function $K(a, b) {
if (a.B) return a.b[0].Z;
var c = a.j.info.b;
if (a.b[0].info.o >= b) return null;
var d;
for (d = 1; d < a.b.length; d++) {
var e = a.b[d].buffer != a.b[d - 1].buffer;
if (a.b[d].info.o > b || e) break
}
d--;
var e = a.b[d].Z.end,
g = a.b[d].info.B - b;
if (c && 1 < g) {
c = Math.floor((b - a.b[d].info.o) / a.b[d].info.D * a.b[d].info.g);
if (0 == c) return null;
e = a.b[d].Z.start + c - 1
}
return new Rn(a.b[0].b ? 0 : a.b[0].Z.start, e)
}
function aL(a) {
a.pendingRequests_.length ? a.g = bb(a.pendingRequests_[a.pendingRequests_.length - 1].info.b) : a.b.length ? a.g = bb(a.b).info : a.g = a.k
}
function bL(a, b) {
var c = cL(a, b);
if (0 <= c) return c;
a.g = a.j.qi(b).b[0];
a.k && a.k.C && (a.k = null);
return a.g.startTime
}
function DG(a, b) {
dL(a);
if (a.j.info.Wa && a.k && !a.k.A && b) {
var c = ib(a.b, function (a) {
return a.info.A
});
a.b = vb(a.b, 0, c + 1);
a.B = !0
} else a.b = []; if (a.b.length)
for (a.o = a.b[0].buffer.byteLength, c = 1; c < a.b.length; c++) a.b[c].buffer != a.b[c - 1].buffer && (a.o += a.b[c].buffer.byteLength);
else a.o = 0
}
function eL(a) {
var b = !1,
c;
for (c = 0; c < a.pendingRequests_.length; c++)
if (7 == a.pendingRequests_[c].state) {
b = !0;
break
}
if (b) {
for (; c < a.pendingRequests_.length;) a.C(a.pendingRequests_.pop());
aL(a)
}
}
function fL(a) {
return gb(a.b, function (a) {
return a.info.A
})
}
function gL(a) {
return !!a.k && a.k.C
}
function hL(a) {
var b = [];
a.k && b.push(a.k);
y(a.b, function (a) {
b.push(a.info)
});
y(a.pendingRequests_, function (a) {
y(a.info.b, function (a) {
3 != a.type && 4 != a.type || b.push(a)
})
});
a.g && a.g != bb(b) && b.push(a.g);
return b
}
function iL(a) {
if (!a.g || !a.g.g) return !1;
a = hL(a);
if (!a.length) return !1;
for (var b = 1; b < a.length; b++)
if (!(1E-6 >= Math.abs(a[b].o - a[b - 1].B))) return !1;
return !0
}
function cL(a, b) {
if (iL(a)) {
var c;
t: {
c = hL(a);
for (var d = 0; d < c.length; d++)
if (c[d].o <= b && c[d].startTime + c[d].duration >= b) {
c = c[d];
break t
}
c = null
}
if (c) return c.startTime
}
return NaN
}
function jL(a) {
return gb(a.pendingRequests_, function (a) {
return 1 == a.timing.priority && 3 <= a.state
})
}
function kL(a) {
return !!(a.g && a.j.mc() && a.g.b != a.j && a.g.b.info.ra < a.j.info.ra)
}
function lL(a, b) {
return !!(a.g && !a.g.C && a.g.B < b)
}
XK.prototype.C = function (a) {
zo(a.info.b[0]) || a.dispose();
this.o -= Ho(a.info)
};
function dL(a) {
y(a.pendingRequests_, a.C, a);
a.pendingRequests_ = [];
a.g = null
};
function mL(a, b, c) {
this.xa = a;
this.info = b;
this.timing = c;
this.state = 1;
this.b = this.k = null;
this.D = NaN;
this.o = this.j = 0;
this.g = NaN;
this.A = null;
this.C = "";
this.B = 0
}
mL.g = !1;
mL.b = 1E4;
function nL(a) {
var b;
b = a.timing;
b = {
rt: ((v() - b.j) / 1E3).toFixed(2),
lb: b.b,
pt: (b.N / 1E3).toFixed(2),
pb: b.H
};
b.shost = $h(a.C) || "";
a.B && (b.rc = a.B.toString());
return b
}
f = mL.prototype;
f.start = function () {
var a = 1 == this.state,
b = 6 == this.state;
1 == this.state || 4 == this.state || b && oL(this);
pL(this, 2);
if (b) {
if (2 > this.j) {
this.j++;
a = mL.b * (.5 + Math.random());
1 == this.j && (a = 2E3);
J(t(this.vm, this), a);
return
}
b = this.info.g;
if (!(this.D <= b.j)) {
b.g++;
b.j = wo - 1;
var c = ko(b.b);
b.b = oo(c, "cmo", encodeURIComponent("pf=" + b.g));
c.match("c\\.youtube\\.com/") && (b.b += "&cmo=sensitive_content%3Dyes")
}
this.j = 0
}
a ? this.vm() : J(t(this.vm, this), 0)
};
f.vm = function () {
if (!this.ea()) {
this.D = wo++;
var a;
a = Go(this.info);
a = oo(a, "keepalive", "yes");
this.j && (a = oo(a, "playerretry", this.j.toString()));
this.C = a;
this.b = new XMLHttpRequest;
this.b.open("GET", a);
this.b.responseType = "arraybuffer";
this.b.withCredentials = !0;
var b = t(this.ov, this);
this.b.addEventListener("load", b, !1);
this.b.addEventListener("error", b, !1);
this.b.send();
this.o = 0;
b = this.timing;
b.j = v();
b.o = b.j;
b.b = 0;
b.D = !1;
b.F = !1;
b.k = 0;
b.C = TJ(b.g);
qL(b);
b.N = b.B - b.j;
this.b.addEventListener("progress", t(this.pv,
this), !1);
0 < this.xa.j && !zo(this.info.b[0]) && (this.g = J(t(this.Wo, this), this.xa.j));
mo(a, "itag");
mo(a, "range");
Math.round(this.info.b[0].o);
Math.round(bb(this.info.b).B);
v()
}
};
f.pv = function (a) {
if (!this.ea()) {
this.b && (this.B = this.b.status);
var b = this.timing,
c = a.timeStamp;
a = a.loaded;
c = c > b.j ? c : v();
20 > c - b.o || rL(b, c, a);
b = this.timing;
b.b > b.L && 8192 < b.b && 3 > this.state && pL(this, 3)
}
};
f.ov = function (a) {
var b = this.b;
if (!this.ea() && a.target == b) {
this.g && (K(this.g), this.g = NaN);
this.B = b.status;
a = null == b.response || 400 <= b.status;
if (!a) {
var b = b.response,
c;
t: {
if (2048 > b.byteLength && (c = String.fromCharCode.apply(String, new Uint8Array(b)), ho(c))) break t;
c = ""
}
if (c) {
c = no(c, "keepalive");
c = no(c, "playerretry");
b = this.info;
if (b.j) {
var d = b.j;
if (d) {
var e = d.split("?");
if (0 < e.length)
for (var g = e[0].split("/"), d = 0; d < g.length; d += 2) c = no(c, g[d]);
if (1 < e.length)
for (e = e[1].split("&"), d = 0; d < e.length; d++) c = no(c,
e[d].split("=")[0])
}
}
c = no(c, "range");
b.g.b = c;
pL(this, 4)
} else if (this.info.Z && b.byteLength != this.info.Z.length) a = !0;
else {
c = this.info.b;
1 != c.length || c[0].Z || (d = c[0], e = Tn(0, b.byteLength), d = new yo(d.type, d.b, e, d.k, d.startTime, d.duration, d.j, e.length, d.C), c[0] = d);
for (var d = [], e = 0, h = !1, g = !1, k = 0; k < c.length; k++) {
var l = c[k],
q = b,
s = Tn(e, l.g),
u = !1;
if (1 == l.type) b.slice ? q = b.slice(e, e + l.g) : (h = new Uint8Array(b, e, e + l.g), q = (new Uint8Array(h)).buffer), s = Tn(0, l.g), h = !0;
else if (3 == l.type || 4 == l.type) u = h && !g, g = !0;
d.push(new Po(l,
q, s, u));
e += l.g
}
this.k = d;
c = this.timing;
d = v();
b = b.byteLength;
c.D || (c.D = !0, d = d > c.j ? d : v(), rL(c, d, b), e = (d - c.j) / 1E3, c.F || !(8192 <= c.b) || c.g.b.b || KJ(c.g, e, b), 8192 <= c.b && PJ(c.g, b, c.k), OJ(c.g, d - c.j, c.b), sL(c));
v();
pL(this, 5)
}
}
a && (oL(this), pL(this, 6))
}
};
function oL(a) {
if (2 > a.j) a = !0;
else {
var b = a.info.g;
a = !(a.D > b.j && 1 <= b.g)
}
return a
}
function pL(a, b) {
a.state = b;
4 <= a.state && sL(a.timing);
a.A && a.A(a)
}
f.Wo = function () {
this.g = NaN;
if (!this.ea()) {
var a = v(),
b = !1;
if (8192 <= this.timing.b) {
var c = this.timing.B;
qL(this.timing);
this.timing.B - c >= .8 * this.xa.j ? (this.o++, b = 5 <= this.o) : this.o = 0
} else b = this.timing, b = 5E3 < a - (b.j + 1E3 * b.C.delay);
b ? (b = this.timing, a = a > b.j ? a : v(), 8192 <= b.b ? (b.k += (a - b.o) / 1E3, PJ(b.g, b.H, b.k)) : MJ(b.g, a, (a - b.j) / 1E3), OJ(b.g, a - b.j, b.b), tL(this), pL(this, 7)) : this.g = J(t(this.Wo, this), this.xa.j)
}
};
f.ea = function () {
return -1 == this.state
};
f.dispose = function () {
pL(this, -1);
this.A = this.k = null;
tL(this);
K(this.g);
this.g = NaN
};
function tL(a) {
if (a.b) {
var b = a.b;
a.b = null;
b.abort()
}
sL(a.timing)
};
function uL(a, b, c, d) {
this.g = a;
this.priority = b;
this.H = c;
this.L = d;
this.b = this.o = this.j = NaN;
this.F = this.D = this.A = !1;
this.k = 0;
this.B = this.N = NaN
}
function sL(a) {
if (a.A) {
var b = a.g;
b.k--;
0 == b.k && b.g && (b.j.b(.1, b.g / .1), b.g = 0);
a.A = !1
}
}
function rL(a, b, c) {
if (!a.A) 8192 <= c && (MJ(a.g, b, (b - a.j) / 1E3), a.A = !0);
else if (!a.g.b.b) {
var d = (b - a.o) / 1E3,
e = c - a.b;
0 < e && (.2 < d || 1024 > e ? (a.k += d, .2 < d && KJ(a.g, .05, e)) : KJ(a.g, d, e), a.F = !0)
}
if (a.A && a.g.b.b && (e = c - a.b, d = a.g, d.b.b)) {
if (0 < d.k) {
for (var g = b / 1E3, h = 0; d.o + .1 < g && 10 > h; h++) d.j.b(.1, d.g / .1), d.g = 0, d.o += .1;
d.g += e
}
LJ(d)
}
a.o = b;
a.b = c
}
function qL(a) {
var b = a.H - a.b,
b = 1E3 * (b * a.C.tailDelay + b / a.C.byterate),
c = v(),
b = 8192 <= a.b ? b + c : b + Math.max(c, a.j + 1E3 * a.C.delay);
a.B = b
};
function vL(a, b, c, d) {
Ki.call(this);
this.A = a;
this.xa = b;
this.C = c;
this.g = this.j = null;
this.D = new LK(a, b);
this.b = null;
this.k = new OK(this.D, b, this.C, d);
this.o = this.$ = this.O = this.P = NaN;
this.F = !1;
this.L = NaN;
this.U = 0;
this.B = !1;
this.ca = {};
this.M = "";
this.W = !1;
this.H = 0
}
w(vL, Ki);
vL.k = !1;
vL.b = 2 / 24;
vL.g = 1E3;
vL.j = 1E4;
f = vL.prototype;
f.initialize = function (a, b, c) {
a = a || 0;
var d = this.k;
d.o = "i";
VK(d);
d.C = d.g;
QK(d, b);
WK(d);
d.j = d.A;
b = UK(d);
this.j = new XK(b.b);
this.g = new XK(b.Wa);
this.I("formatchange", b);
0 != a || c || (this.j.j.j || wL(this, this.j, !0), this.g.j.j || wL(this, this.g, !0));
this.seek(a);
xL(this, "gv")
};
f.resume = function () {
this.B = !1
};
f.cz = function (a) {
this.resume();
this.b = a;
Sq(a) && (a.b.addEventListener("updateend", t(this.qc, this), !1), a.j.addEventListener("updateend", t(this.qc, this), !1));
xL(this, "msa");
this.qc();
this.$ = Hd(t(this.qc, this), vL.j)
};
function yL(a) {
a.b && a.b.b && a.b.b.removeEventListener && (a.b.b.removeEventListener("updateend", t(a.qc, a), !1), a.b.j.removeEventListener("updateend", t(a.qc, a), !1));
a.b = null;
a.B = !0;
a.j && (DG(a.g, !1), DG(a.j, !1))
}
function zL(a) {
a.b && Qq(a.b) && yL(a)
}
function AL(a, b, c) {
if (!b.g) {
if (!b.j.mc()) return b.j.j || wL(a, b, !1), !1;
bL(b, a.o)
}
if (a.B) return !1;
var d = b.pendingRequests_.length + c.pendingRequests_.length;
if (jL(b) || jL(c)) d -= 1;
if (2 <= d + 1) return !1;
d = b.g;
4 == d.type && d.b.mc() && (b.g = bb(d.b.Ei(d)), d = b.g);
!d.C && !d.b.Eg(d) || d.b.info.b && 4 == d.type ? a = !1 : kL(b) && a.xa.b ? a = !0 : (!(c = d.C || b.o + c.o > a.xa.g || lL(c, d.B)) && (c = 3 == d.type) && (d = d.B, b = BL(a, b, !0), sp(a.k.b) || (c = (v() - a.U) / 1E3, b = Math.min(b, 30 + 2 * c)), c = d > a.o + b), a = c ? !1 : !0);
return a
}
function CL(a, b, c) {
if (!a.b || Pq(a.b) || Sq(a.b)) {
var d = a.o,
e;
e = a.D;
c = MK(e, b.j.info.ra, c.j.info.ra, 0);
e = QJ(e.b) + c * RJ(e.b) + c / SJ(e.b);
e = Math.max(e, e + 5 - c / b.j.info.ra);
d = d + e;
if (b.g && d <= b.g.B) t: {
(e = a.xa.L) || (a = a.k, e = !!(a.j && a.A && a.j.info.ra < a.A.info.ra && "r" == a.o)), a = e;
if (b.pendingRequests_.length) {
if (b.pendingRequests_[0].info.b[0].startTime <= d) break t;
dL(b)
}
for (e = b.b.length - 1; 0 <= e; e--) c = b.b[e], c.info.startTime > d && (b.b.pop(), b.b.length && b.b[e - 1].buffer == c.buffer || (b.o -= c.buffer.byteLength));
aL(b);
a && d < b.g.startTime &&
(b.g = b.j.qi(d, !0).b[0])
}
}
}
function DL(a, b, c) {
AL(a, b, c);
var d = b.g;
if (b.g.b.mc()) {
kL(b) && a.xa.b && CL(a, b, c);
var d = b.g,
e = d.B - a.o,
g;
(g = b.j.mc() && b.g.b != b.j) && !kL(b) && (g = 15 >= e);
var h = !d.Z || 0 == d.g && 0 == d.j ? 0 : d.Z.length - (d.j + d.g);
g && 0 == h && (g = d.startTime + vL.b, d.g && (g += d.duration), bL(b, g), d = b.g, g = !1);
d.b.Rl() ? (c = MK(a.D, d.b.info.ra, c.j.info.ra, e), e = g, c = Co(d, c), c.Z && 1 < c.b.length && (e ? c = Co(d, c.b[0].g) : (e = c.b[c.b.length - 1], g = e.g / c.Z.length, !e.A && .4 > g && (c = Co(d, c.Z.length - e.g)))), d = c) : d = Jo(d.b, d)
} else d.b.Rl() ? (c = MK(a.D, b.j.info.ra, c.j.info.ra,
0), d = Co(d, c)) : d = Jo(d.b, d);
YK(b, EL(a, d, !1))
}
function EL(a, b, c) {
if (3 == b.b[b.b.length - 1].type) {
var d;
t: {
d = a.k;
var e = b.b[0].b;
if (e.info.Wa) {
if (d.j != e) {
d.j = e;
d = UK(d);
break t
}
} else d.C = e;
d = null
}
AG(a, d)
}
e = c ? 2 : 1;
a.B && (e = 0);
c = Ho(b);
d = a.A;
var g = a.D,
h = Math.min(2.5, QJ(g.b)),
g = NK(g);
b = new mL(a.xa, b, new uL(d, e, c, c - h * g));
a = t(a.ty, a);
b.A = a;
b.start();
return b
}
function AG(a, b) {
b && a.I("formatchange", b)
}
f.ty = function (a) {
if (!this.ea() && 3 <= a.state) {
var b = a.info.b[0].b,
c = !this.ka && b.info.Wa,
d = !this.T && b.info.b;
6 == a.state && oL(a) ? (this.tf(!1, 209, nL(a)), b.info.Wa && 0 < a.j && this.xa.B && !TK(this.k) ? (SK(this.k, b.info), dL(this.g), zo(a.info.b[0]) && wL(this, this.g, !1), this.qc()) : a.start()) : 4 == a.state ? (c ? xL(this, "vrr") : d && xL(this, "arr"), a.start()) : 5 == a.state ? (c ? (this.ka = a.C, Iy() && Oy()) : d && (this.T = a.C), y(a.k, function (a) {
zo(a.info) && a.info.b.Cp(a)
}), hb(a.k, function (a) {
return Qo(a)
}) && !a.k[0].info.b.Kl() ? this.qc() :
this.tf(!0, 126, nL(a))) : 7 == a.state ? (this.tf(!1, 210, nL(a)), EG(this)) : 3 == a.state ? (this.qc(), c && Iy() && Zf(document.body, "exp-js-scheduler-aggressive") && Oy()) : zo(a.info.b[0]) ? (b.o = !0, this.qc()) : this.tf(!0, 121, nL(a))
}
};
function EG(a) {
if (isNaN(a.P)) {
var b = t(a.qc, a);
a.P = J(b, 0)
}
}
function FL(a) {
if (isNaN(a.O)) {
var b = t(function () {
this.qc();
this.O = NaN
}, a);
a.O = J(b, vL.g)
}
}
f.qc = function () {
this.P = NaN;
zL(this);
if (this.b && !Rq(this.b))
if (this.C.g) Infinity != this.L && (this.L = Infinity, this.b.uf(Infinity));
else if (!isFinite(this.L)) {
var a = Math.floor(Math.max(this.j.j.index.Fe(), this.g.j.index.Fe()));
0 < a && (this.b.uf(a), this.L = a)
}
if (!this.ea())
if (a = this.C, v() - a.B >= a.o) {
a = this.C;
if (!a.k) {
var b = oo(a.D, "start_seq", (Pb(a.b).index.kc() + 1).toString());
kp(a, b)
}
FL(this)
} else if ("prerender" == window.document.webkitVisibilityState) FL(this);
else {
zL(this);
ZK(this.g);
ZK(this.j);
eL(this.g);
eL(this.j);
a = !1;
if (this.b && ((a = GL(this, this.g, this.b.j)) && !this.H && (this.H = v(), xL(this, "vda")), b = it(this.b.j.buffered, this.o), isNaN(b) && !gL(this.g) && this.b.b.buffered.length || (gL(this.g) && (b = NaN), a |= GL(this, this.j, this.b.b, b)), gL(this.g) && gL(this.j) && Pq(this.b) && !Rq(this.b))) {
a = this.b;
Pq(a) && a.g.endOfStream();
NJ(this.A);
return
}
CG(this, this.g, RK(this.k));
CG(this, this.j, this.k.g);
if (this.g.j.o || this.j.j.o) this.tf(!0, 121);
else {
b = this.H ? v() - this.H : 0;
if (this.W || b >= this.xa.F) AL(this, this.g, this.j) && DL(this,
this.g, this.j), AL(this, this.j, this.g) && DL(this, this.j, this.g);
if (this.xa.N && this.M && !this.B && !this.g.pendingRequests_.length && !this.j.pendingRequests_.length && (b = 30 + this.o, !lL(this.g, b) && !lL(this.j, b))) {
b = this.M;
this.M = "";
var c = $h(b);
ii(b, {
format: "RAW",
responseType: "arraybuffer",
timeout: 15E3,
onError: t(this.tf, this, !1, 211, {
shost: c
})
})
}
a && (Sq(this.b) || EG(this))
}
}
};
function GL(a, b, c, d) {
if (c.updating) return !0;
var e = b.b.length ? b.b[0] : null;
if (!e) return !1;
!b.k || b.k.A || Ao(b.k, e.info) || (b.k = null, Pq(a.b) && c.abort(), c.g = null);
var g;
e.b ? g = !1 : (g = e.info.b.b, c.g == g ? g = !1 : (HL(a, c, g), c.g = g, a.I("initsegment", c.g), g = !0));
if (g && c.updating) return !0;
g = BL(a, b, !1);
g = a.o + g;
0 <= d && (g = Math.min(g, d));
d = $K(b, g);
if (!d) return !1;
g = new Uint8Array(e.buffer, d.start, d.length);
if (a.C.j && 3 == e.info.type && ja(c.timestampOffset)) {
var h = 0,
h = a.xa.P && !b.A ? -Ro(e) : -(Ro(e) - e.info.startTime);
c.timestampOffset !=
h && (c.timestampOffset = h)
}
if (!HL(a, c, g)) return !1;
if (!a.C.j || !a.xa.P || b.A) {
for (var k; b.b.length;) {
if (b.b[0].Z.end > d.end) {
k = b.b[0];
var l = d.end - b.b[0].Z.start + 1,
l = Math.min(l, k.info.g),
h = new yo(k.info.type, k.info.b, k.info.Z, k.info.k, k.info.startTime, k.info.duration, k.info.j, l, !1);
g = Tn(k.Z.start, l);
h = new Po(h, k.buffer, g, k.b);
l = new yo(k.info.type, k.info.b, k.info.Z, k.info.k, k.info.startTime, k.info.duration, k.info.j + l, k.info.g - l, k.info.C);
g = new Rn(g.end + 1, k.Z.end);
g = [h, new Po(l, k.buffer, g, !1)];
k = g[0];
b.b[0] =
g[1]
} else k = b.b.shift();
g = b;
h = k.info;
g.k = h;
g.B && g.k.A && (g.B = !1);
g.ra = Math.max(g.ra, h.b.info.ra);
if (k.Z.end == d.end) break
}
b.b.length && k.buffer == b.b[0].buffer || (b.o -= k.buffer.byteLength)
}
b.A || (b.A = !0);
e.b && (c.g = e.info.b.b, a.I("initsegment", c.g));
return !Sq(a.b) || c.updating
}
function HL(a, b, c) {
if (Sq(a.b)) try {
b.appendBuffer(c)
} catch (d) {
return !1
} else b.append(c);
return !Qq(a.b)
}
function BL(a, b, c) {
var d;
d = sp(a.k.b) && a.xa.b ? b.j.info.b ? 10485760 : 62914560 : b.j.info.b ? a.xa.k : a.xa.o;
c && (d += a.xa.g);
return d / (sp(a.k.b) ? b.g ? b.g.b.info.ra : b.j.info.ra : b.ra)
}
f.seek = function (a) {
if (!this.ea()) {
zL(this);
this.U = v();
this.g.j = RK(this.k);
var b = IL(this, this.g, a, this.b && this.b.j);
this.j.j = this.k.g;
var c = IL(this, this.j, b, this.b && this.b.b);
this.o = Math.max(a, b, c);
this.F = !0;
EG(this)
}
};
function IL(a, b, c, d) {
if (b.j.mc())
if (d) {
var e = it(d.buffered, c),
g = NaN,
h = b.k;
h && (g = it(d.buffered, h.b.index.Ri(h.k)));
if (e == g && iL(b)) return c;
d = cL(b, c);
if (0 <= d) return d;
DG(b, !0);
b.j.info.Wa && b.k && !b.k.A && !fL(b) && (d = b.k, b.b.length && (d = bb(b.b).info), d = b.g || d, d = Co(d, d.Z.length - (d.g + d.j)), YK(b, EL(a, d, !0)));
if (isNaN(e)) return bL(b, c);
bL(b, e + vL.b)
} else bL(b, c);
else b.j.j || wL(a, b, !1), 0 != c && dL(b);
return c
}
function CG(a, b, c) {
b.j != c && (b.j = c, c.j || wL(a, b, !1))
}
function wL(a, b, c) {
var d = c ? 65536 : 0;
c && !isNaN(a.xa.D) && (d = Math.floor(Math.max(d, a.xa.D * b.j.info.ra)));
c = b.j.Gr(d);
y(c, function (a) {
var c = EL(this, a, !0);
!zo(a.b[a.b.length - 1]) && YK(b, c)
}, a);
b.j.j = !0
}
f.J = function () {
yL(this);
this.j && (dL(this.j), dL(this.g));
Id(this.$);
this.g = this.j = null;
vL.G.J.call(this)
};
f.tf = function (a, b, c) {
var d;
if (c)
for (var e in c) d = (d ? d + ";" : "") + e + "." + c[e];
this.I(a ? "fatalerror" : "softerror", b, d);
a && (this.b && Pq(this.b) && (a = this.b, Pq(a) && a.g.endOfStream("network")), this.dispose())
};
vL.prototype.getDebugInfo = function () {
var a = {
lct: this.o.toFixed(3),
lsk: this.F,
lmf: sp(this.k.b),
lbw: SJ(this.A).toFixed(3),
lhd: QJ(this.A).toFixed(3),
ltd: (1E9 * RJ(this.A)).toFixed(3),
laa: this.j.k ? Fo(this.j.k) : "",
lva: this.g.k ? Fo(this.g.k) : "",
lar: this.j.g ? Fo(this.j.g) : "",
lvr: this.g.g ? Fo(this.g.g) : ""
};
this.b && !Qq(this.b) && (a.lab = gt(this.b.b.buffered), a.lvb = gt(this.b.j.buffered));
return a
};
function xL(a, b, c) {
a.ca[b] = c ? window.performance.timing.navigationStart + c : v()
};
function JL(a, b, c, d) {
this.j = a;
this.F = b;
this.A = c;
this.b = d;
this.o = "";
this.g = this.B = this.C = this.D = null;
this.k = new Kq(this);
S(this, this.k);
this.b && (Lq(this.k, this.b, ["message", "mskeymessage"], this.Io), Lq(this.k, this.b, ["error", "mskeyerror"], this.Ho), Lq(this.k, this.b, ["ready", "mskeyadded"], this.Go))
}
w(JL, jh);
f = JL.prototype;
f.setCallbacks = function (a, b, c, d) {
this.D = a;
this.C = b;
this.B = c;
this.g = d
};
f.Io = function (a) {
this.D.call(this.g, a)
};
f.Ho = function (a) {
var b;
this.b ? (b = this.b.error.code, a = this.b.error.systemCode) : (b = a.errorCode.code, a = a.systemCode);
this.C.call(this.g, b, a)
};
f.Go = function (a) {
this.B.call(this.g, a)
};
f.update = function (a) {
this.b ? this.b.update(a) : this.j.addKey ? this.j.addKey(this.F.b, a, this.A, this.o) : this.j.webkitAddKey(this.F.b, a, this.A, this.o)
};
f.J = function () {
this.j = null;
JL.G.J.call(this)
};
function KL(a, b) {
this.b = a;
this.k = b;
this.A = {};
this.j = null;
this.o = new Kq(this);
S(this, this.o);
Fq() || (Lq(this.o, this.b, ["keymessage", "webkitkeymessage"], this.D), Lq(this.o, this.b, ["keyerror", "webkitkeyerror"], this.C), Lq(this.o, this.b, ["keyadded", "webkitkeyadded"], this.B));
this.g = null
}
w(KL, jh);
function LL(a) {
a.g = new(Fq())(a.k.b);
a.b && (a.b.msSetMediaKeys ? a.b.msSetMediaKeys(a.g) : a.b.setMediaKeys(a.g))
}
function ML(a, b) {
var c = a.A[b.sessionId];
!c && a.j && (c = a.j, a.j = null, c.o = b.sessionId, a.A[b.sessionId] = c);
return c
}
KL.prototype.D = function (a) {
var b = ML(this, a);
b && b.Io(a)
};
KL.prototype.C = function (a) {
var b = ML(this, a);
b && b.Ho(a)
};
KL.prototype.B = function (a) {
var b = ML(this, a);
b && b.Go(a)
};
KL.prototype.J = function () {
this.b = null;
KL.G.J.call(this)
};
var NL = null,
OL = null;
function PL(a, b) {
this.url = a;
this.b = b
};
function QL(a, b, c) {
this.b = a;
this.headers = b;
this.message = c
};
function RL(a, b, c, d, e, g, h) {
this.F = a;
this.g = d;
this.A = e;
this.H = g;
this.o = {
JE: h
};
Vs(this, a.j);
this.b = [];
this.k = this.C = this.D = !1;
var k;
try {
var l = c.b;
if (Fq()) {
b.g || LL(b);
var q = c.g || "video/mp4",
s;
if ("com.microsoft.playready" == b.k.b) {
var u = new Uint8Array(270);
for (a = 0; 135 > a; a++) u[2 * a] = '<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="true"></LicenseAcquisition></PlayReadyCDMData>'.charCodeAt(a);
s = b.g.createSession(q, l, u)
} else s = b.g.createSession(q, l);
k = new JL(null, null,
null, s)
} else b.b.generateKeyRequest ? b.b.generateKeyRequest(b.k.b, l) : b.b.webkitGenerateKeyRequest(b.k.b, l), b.j = new JL(b.b, b.k, l, null), k = b.j
} catch (z) {
b = "g", z instanceof DOMException && (b += z.code), this.g.I("licenseerror", 5, b, "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK"), k = null
}
if (this.j = k) this.j.setCallbacks(this.Mk, this.av, this.$u, this), S(this, this.j)
}
w(RL, jh);
function Vs(a, b) {
if (fo(b)) {
for (var c in a.o) b = uf(b, c, a.o[c]);
a.B = b
} else SL(a, "u")
}
f = RL.prototype;
f.start = function () {
this.ea() || (this.D = !0, this.b.length && this.Mk(this.b.shift()))
};
f.Mk = function (a) {
if (!this.ea())
if (this.k && a.defaultURL && Vs(this, a.defaultURL), this.D) {
a = a.message;
if ("com.microsoft.playready" == this.F.b) {
for (var b = "", c = 0; c < a.length; c += 2) b += String.fromCharCode(a[c]);
b = (new DOMParser).parseFromString(b, "text/xml").querySelector("Challenge");
a = Uint8Array;
b = b.childNodes[0].data;
if (!NL)
for (NL = {}, OL = {}, c = 0; 65 > c; c++) NL[c] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c), OL[NL[c]] = c;
for (var c = OL, d = [], e = 0; e < b.length;) {
var g = c[b.charAt(e++)],
h = e < b.length ? c[b.charAt(e)] : 0;
++e;
var k = e < b.length ? c[b.charAt(e)] : 64;
++e;
var l = e < b.length ? c[b.charAt(e)] : 64;
++e;
if (null == g || null == h || null == k || null == l) throw Error();
d.push(g << 2 | h >> 4);
64 != k && (d.push(h << 4 & 240 | k >> 2), 64 != l && d.push(k << 6 & 192 | l))
}
a = new a(d)
}
a = {
format: "RAW",
method: "POST",
gx: a,
responseType: "arraybuffer",
withCredentials: !0,
onSuccess: this.hx,
onError: this.fp,
context: this
};
b = this.B;
this.A && (this.H ? b = uf(b, "access_token", this.A) : a.headers = {
Authorization: "Bearer " + this.A
});
ii(b, a)
} else this.b.push(a),
this.C || (this.C = !0, this.g.I("newsession", this))
};
f.$u = function () {
this.ea() || (this.k || (this.g.I("sessionready"), this.k = !0), this.b.length && this.Mk(this.b.shift()))
};
f.hx = function (a) {
if (!this.ea())
if (0 != a.status && a.response) {
t: {
a = new Uint8Array(a.response);
var b = 0,
c = String.fromCharCode.apply(String, a.subarray(0, 16384)).split("\r\n"),
d = c[0];
pb(c, 0);
c.pop();
var b = b + (d.length + 2),
e = d.match(/^GLS\/1.\d ([0-9]{1,3}) (\w+)$/);
if (null != e) {
d = e[1];
isFinite(d) && (d = String(d));
for (var d = r(d) ? /^\s*-?0x/i.test(d) ? parseInt(d, 16) : parseInt(d, 10) : NaN, g = {}, h = 0; h < c.length; h++) {
e = c[h];
b += e.length + 2;
if (0 == e.length) {
a = new QL(d, g, a.subarray(b));
break t
}
e = e.match(/([^:]+):\s+([^]+)/);
if (null == e) break;
g[e[1]] = e[2]
}
}
a = null
}
a ? 0 != a.b ? SL(this, "f" + a.b, hu(a.b)) : (b = (b = a.headers["Authorized-Format-Types"]) ? b.split(",") : null, c = null, (d = a.headers["Heartbeat-Url"]) && (c = new PL(d, parseInt(a.headers["Heartbeat-Interval-Secs"], 10) || 60)), (b || c) && this.g.I("newlicense", b, c), this.j.update(a.message)) : SL(this, "r0", "YTP_ERROR_SERVER_ERROR")
} else this.fp(a)
};
f.av = function (a, b) {
this.ea() || SL(this, "s" + a + "." + b)
};
f.fp = function (a) {
SL(this, "r" + a.status)
};
function SL(a, b, c) {
a.ea() || a.g.I("licenseerror", 206, b, c);
a.dispose()
}
f.J = function () {
this.g = null;
RL.G.J.call(this)
};
function TL(a, b) {
this.b = a;
this.g = b || null
};
function UL(a, b) {
Ki.call(this);
this.C = a;
this.b = b;
this.subscribe("newlicense", this.Iu, this);
this.subscribe("newsession", this.Ju, this);
this.subscribe("sessionready", this.Ku, this);
this.O = Sp();
this.L = null;
this.M = !1;
this.B = {};
this.g = [];
this.j = pp;
this.H = new KL("com.microsoft.playready" == b.b ? null : a, b);
S(this, this.H);
this.o = new KL(a, b);
S(this, this.o);
this.A = 2;
this.D = new Kq(this);
S(this, this.D);
this.k = !1;
this.F = null;
Lq(this.D, this.C, Fq() ? ["needkey", "msneedkey"] : ["needkey", "webkitneedkey"], this.Hu)
}
w(UL, Ki);
f = UL.prototype;
f.Hu = function (a) {
VL(this, new TL(a.initData, a.contentType), !0)
};
function VL(a, b, c) {
if (!(a.ea() || "com.microsoft.playready" == a.b.b ^ !c || (c = b.b, a.k && "widevine" == a.b.g))) {
var d = String.fromCharCode.apply(String, c);
if (!a.B[d]) {
a.B[d] = !0;
d = "clearkey" == a.b.g;
if (112 == c[4] && 115 == c[5] && 115 == c[6] && 104 == c[7] && d) {
t: {
for (var e = new DataView(c.buffer), d = 0; d < e.byteLength;) {
var g = e.getUint32(d, !1);
if (1886614376 != e.getUint32(d + 4, !1)) break;
if (1477738184 == e.getUint32(d + 12, !1) && 69420633 == e.getUint32(d + 16, !1) && 2464609580 == e.getUint32(d + 20, !1) && 1558758348 == e.getUint32(d + 24, !1)) {
e = e.getUint32(d +
28, !1);
if (16 != e) break;
c = c.subarray(d + 32, d + 32 + e);
break t
}
d += g
}
c = null
}
if (!c) return
}
a.g.push(b);
1 < a.g.length || (WL(a, b), a.k = !0)
}
}
}
function WL(a, b) {
var c = new RL(a.b, a.H, b, a, a.L, a.M, a.O);
S(a, c)
}
f.Iu = function (a, b) {
a && C(a, "HD") && !rp(this.j) && "com.microsoft.playready" != this.b.b && (this.j = qp, this.I("qualitychange"));
b && !this.F && (this.F = b, this.I("heartbeatparams", b))
};
f.Ju = function () {
this.ea() || (this.g.shift(), this.g.length && WL(this, this.g[0]))
};
f.Ku = function () {
this.A--;
0 == this.A && LL(this.o)
};
f.J = function () {
this.C = null;
this.g = [];
UL.G.J.call(this)
};
function XL(a) {
this.j = {};
this.j.c1a = t(this.k, this);
this.j.c3a = t(this.o, this);
(this.b = a) && this.b.$ ? this.g = Yh(this.b.$) : this.g = []
}
XL.prototype.k = function () {
var a = p("yt.abuse.botguardInitialized");
return a && a() ? (a = p("yt.abuse.invokeBotguard")()) ? "r1a=" + a : null : null
};
XL.prototype.o = function (a) {
return "r3a=" + Math.floor(this.b.Pa % Ya(a.c3a))
};
function YL(a, b, c) {
this.b = a;
this.j = b;
this.g = c
};
function ZL(a) {
this.b = a
}
function $L(a, b) {
return tp(tp(a.b.wi, b.am), b.rf)
}
function aM(a, b) {
var c;
c = !!b.g.b;
var d;
a.b.og ? d = a.b.og.clone() : Tg && !a.b.gi ? d = window.screen && window.screen.width ? new G(window.screen.width, window.screen.height) : null : a.b.Zc && (d = a.b.Zc.clone());
d ? ((Tg || hc || c) && d.scale(window.devicePixelRatio || 1), c = d) : c = new G(640, 360);
var e;
d = b.g.g;
if (d.length) {
for (var g = 0; g < d.length && !(e = d[g].Wa, null === c || .85 * e.width < c.width && .85 * e.height < c.height); g++);
e = op("auto", e.b, !1)
} else e = qp;
c = e.b;
a.b.b.P && (c = Math.max(c, Nn.large));
Wg && Wq("crkey") && (c = Math.max(c, Nn.hd1080));
a.b.b.ja && (c = Math.min(c, Nn.hd720));
if (d = (Wq("armv7") || Wq("android")) && !ND(a.b)) d = b.g.g[0], d = "9" == d.g || "(" == d.g;
d && (c = Math.min(c, Nn.large));
a.b.b.W && a.b.Zc && 540 == a.b.Zc.height && (c = Math.max(c, Nn.hd720));
c = Math.max(c, Nn.medium);
d = e.g;
g = Nn.small;
a.b.b.M && d < g && c >= g && (d = g);
if (e.b != c || e.g != d) e = new np(d, c, e.j);
return e
};
function bM() {
this.k = this.b = NaN;
this.j = this.g = !1
}
function Ct(a, b, c, d) {
if (d = 1 < d) a.j = !0;
if (a.g) b != a.b && (a.g = !1);
else if (0 < b && a.b == b) return c - a.k > (d || !a.j ? 1500 : 400);
a.b = b;
a.k = c;
return !1
};
function cM() {
this.b = this.g = !1
}
cM.prototype.start = function () {
this.g = !0
};
function dM() {
this.g = 0;
this.b = this.o = this.j = this.k = NaN
};
var eM = {};
function fM(a) {
return a ? 24 == a.length && "UC" == a.slice(0, 2) ? a.substr(2) : 22 == a.length ? a : null : null
};
var gM;
gM = {
o: ["v. Chr.", "n. Chr."],
k: ["v. Chr.", "n. Chr."],
B: "JFMAMJJASOND".split(""),
M: "JFMAMJJASOND".split(""),
A: "Januar Februar M\u00e4rz April Mai Juni Juli August September Oktober November Dezember".split(" "),
L: "Januar Februar M\u00e4rz April Mai Juni Juli August September Oktober November Dezember".split(" "),
F: "Jan. Feb. M\u00e4rz Apr. Mai Juni Juli Aug. Sep. Okt. Nov. Dez.".split(" "),
P: "Jan Feb M\u00e4r Apr Mai Jun Jul Aug Sep Okt Nov Dez".split(" "),
$: "Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),
U: "Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "),
N: "So. Mo. Di. Mi. Do. Fr. Sa.".split(" "),
T: "So Mo Di Mi Do Fr Sa".split(" "),
C: "SMDMDFS".split(""),
O: "SMDMDFS".split(""),
H: ["Q1", "Q2", "Q3", "Q4"],
D: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"],
b: ["vorm.", "nachm."],
g: ["EEEE, d. MMMM y", "d. MMMM y", "dd.MM.y", "dd.MM.yy"],
W: ["HH:mm:ss zzzz", "HH:mm:ss z", "HH:mm:ss", "HH:mm"],
j: ["{1} {0}", "{1} {0}", "{1} {0}", "{1} {0}"],
sE: 0,
ca: [5, 6],
tE: 3
};
function hM(a, b, c, d, e, g) {
r(a) ? (this.A = "y" == a ? b : 0, this.o = "m" == a ? b : 0, this.b = "d" == a ? b : 0, this.g = "h" == a ? b : 0, this.j = "n" == a ? b : 0, this.k = "s" == a ? b : 0) : (this.A = a || 0, this.o = b || 0, this.b = c || 0, this.g = d || 0, this.j = e || 0, this.k = g || 0)
}
hM.prototype.equals = function (a) {
return a.A == this.A && a.o == this.o && a.b == this.b && a.g == this.g && a.j == this.j && a.k == this.k
};
hM.prototype.clone = function () {
return new hM(this.A, this.o, this.b, this.g, this.j, this.k)
};
hM.prototype.add = function (a) {
this.A += a.A;
this.o += a.o;
this.b += a.b;
this.g += a.g;
this.j += a.j;
this.k += a.k
};
function iM(a, b, c) {
ja(a) ? (this.b = jM(a, b || 0, c || 1), kM(this, c || 1)) : la(a) ? (this.b = jM(a.getFullYear(), a.getMonth(), a.getDate()), kM(this, a.getDate())) : (this.b = new Date(v()), this.b.setHours(0), this.b.setMinutes(0), this.b.setSeconds(0), this.b.setMilliseconds(0))
}
function jM(a, b, c) {
b = new Date(a, b, c);
0 <= a && 100 > a && b.setFullYear(b.getFullYear() - 1900);
return b
}
f = iM.prototype;
f.Cj = gM.sE;
f.Dj = gM.tE;
f.clone = function () {
var a = new iM(this.b);
a.Cj = this.Cj;
a.Dj = this.Dj;
return a
};
f.getFullYear = function () {
return this.b.getFullYear()
};
f.getMonth = function () {
return this.b.getMonth()
};
f.getDate = function () {
return this.b.getDate()
};
f.getTime = function () {
return this.b.getTime()
};
function lM(a) {
a = a.b.getTimezoneOffset();
if (0 == a) a = "Z";
else {
var b = Math.abs(a) / 60,
c = Math.floor(b),
b = 60 * (b - c);
a = (0 < a ? "-" : "+") + Sa(c) + ":" + Sa(b)
}
return a
}
f.set = function (a) {
this.b = new Date(a.getFullYear(), a.getMonth(), a.getDate())
};
f.add = function (a) {
if (a.A || a.o) {
var b = this.getMonth() + a.o + 12 * a.A,
c = this.getFullYear() + Math.floor(b / 12),
b = b % 12;
0 > b && (b += 12);
var d;
t: {
switch (b) {
case 1:
d = 0 != c % 4 || 0 == c % 100 && 0 != c % 400 ? 28 : 29;
break t;
case 5:
case 8:
case 10:
case 3:
d = 30;
break t
}
d = 31
}
d = Math.min(d, this.getDate());
this.b.setDate(1);
this.b.setFullYear(c);
this.b.setMonth(b);
this.b.setDate(d)
}
a.b && (a = new Date((new Date(this.getFullYear(), this.getMonth(), this.getDate(), 12)).getTime() + 864E5 * a.b), this.b.setDate(1), this.b.setFullYear(a.getFullYear()),
this.b.setMonth(a.getMonth()), this.b.setDate(a.getDate()), kM(this, a.getDate()))
};
f.Ej = function (a, b) {
return [this.getFullYear(), Sa(this.getMonth() + 1), Sa(this.getDate())].join(a ? "-" : "") + (b ? lM(this) : "")
};
f.equals = function (a) {
return !(!a || this.getFullYear() != a.getFullYear() || this.getMonth() != a.getMonth() || this.getDate() != a.getDate())
};
f.toString = function () {
return this.Ej()
};
function kM(a, b) {
a.getDate() != b && a.b.setUTCHours(a.b.getUTCHours() + (a.getDate() < b ? 1 : -1))
}
f.valueOf = function () {
return this.b.valueOf()
};
function mM(a, b, c, d, e, g, h) {
this.b = ja(a) ? new Date(a, b || 0, c || 1, d || 0, e || 0, g || 0, h || 0) : new Date(a ? a.getTime() : v())
}
w(mM, iM);
f = mM.prototype;
f.add = function (a) {
iM.prototype.add.call(this, a);
a.g && this.b.setHours(this.b.getHours() + a.g);
a.j && this.b.setMinutes(this.b.getMinutes() + a.j);
a.k && this.b.setSeconds(this.b.getSeconds() + a.k)
};
f.Ej = function (a, b) {
var c = iM.prototype.Ej.call(this, a);
return a ? c + " " + Sa(this.b.getHours()) + ":" + Sa(this.b.getMinutes()) + ":" + Sa(this.b.getSeconds()) + (b ? lM(this) : "") : c + "T" + Sa(this.b.getHours()) + Sa(this.b.getMinutes()) + Sa(this.b.getSeconds()) + (b ? lM(this) : "")
};
f.equals = function (a) {
return this.getTime() == a.getTime()
};
f.toString = function () {
return this.Ej()
};
f.clone = function () {
var a = new mM(this.b);
a.Cj = this.Cj;
a.Dj = this.Dj;
return a
};
var nM = ["3djj8jS0370cu_ghKs_Ong", "LsooMJoIpl_7ux2jvdPB-Q", "JkWoS4RsldA1coEIot5yDA", "jVkjd2VWCWO-9DHRQER3Yg", "L8ZULXASCc1I_oaOT0NaOQ"];
function oM(a) {
this.g = a;
this.b = 0;
this.o = NaN;
this.j = 0;
this.aa = [];
this.k = pM(this.g);
this.A = this.B = 0
}
function qM(a) {
a.k.startTime = a.j;
a.k.endTime = a.b;
a.aa.length && bb(a.aa).isEmpty() ? a.aa[a.aa.length - 1] = a.k : a.aa.length && a.k.isEmpty() || a.aa.push(a.k);
a.B += a.b - a.j;
a.k = pM(a.g);
a.j = a.b
}
function rM(a) {
return a.B + a.g.j() - a.j
}
function sM(a) {
a.aa.length && a.b == a.j || qM(a);
var b = a.aa;
a.aa = [];
return b
}
oM.prototype.update = function () {
var a = this.g.j() || 0,
b = tM(this.g);
if (a != this.b || uM(this, a, b)) {
if (a < this.b || a - this.b > b - this.o + .5 || uM(this, a, b)) qM(this), this.j = a;
this.o = b;
this.b = a
}
};
function uM(a, b, c) {
c -= a.o;
return b == a.b && .5 < c
};
function vM(a, b) {
this.b = b;
this.k = !1;
this.g = a
}
vM.prototype.j = function () {
return {
ps: this.b.vb,
el: this.b.ba
}
};
vM.prototype.send = function () {
this.k || (Qd(qf(this.b.wb + "set_awesome", this.j())), this.k = !0)
};
function wM(a, b, c) {
vM.call(this, b, c);
this.o = a
}
w(wM, vM);
wM.prototype.j = function () {
var a = wM.G.j.call(this);
sa(a, EK(this.b));
var b = Fb(this.g.ig / this.g.Pa, 0, 1);
sa(a, {
html5: "1",
video_id: this.g.videoId,
eurl: this.b.j,
framer: this.b.H,
feature: this.b.A,
list: this.g.Na,
w: b,
l: this.g.Pa,
plid: this.g.Bb,
ei: this.g.A,
access_token: this.g.B,
tpmt: rM(this.o),
cpn: this.g.Ea
});
this.b.k && (a.adformat = this.b.k);
this.b.F && (a.referrer = IK(this.b));
this.b.yc && (a.autoplay = "1");
this.b.Va && (a.authuser = this.b.Va);
this.b.cb && (a.pageid = this.b.cb);
this.g.xe && (a.splay = "1");
this.g.L && (a.subscribed =
this.g.L);
sa(a, wM.G.j.call(this));
sa(a, EK(this.b));
return a
};
function xM(a) {
this.b = a;
this.j = {};
this.N = NaN;
this.o = new Bv(this.Gu, 3E4, this);
S(this, this.o);
this.A = new Bv(this.xk, 100, this);
S(this, this.A);
this.g = "N";
this.k = 0;
this.D = this.L = NaN;
this.M = "";
this.C = this.F = 0;
this.H = this.B = !1
}
w(xM, jh);
var yM = {
5: "N",
"-1": "N",
3: "B",
0: "EN",
2: "PA",
1: "PL"
};
function zM(a, b, c, d) {
var e = a.j[b];
e || (e = [], a.j[b] = e);
a = 0 <= d ? d : tM(a.b);
e.push(a.toFixed(3) + ":" + c.join(":"))
}
f = xM.prototype;
f.xk = function (a) {
a = a || tM(this.b);
var b = this.b.o();
if (!isNaN(this.O) && !isNaN(b.j)) {
var c = b.j - this.O;
0 < c && zM(this, "bwm", [c, (b.o - this.P).toFixed(3)], a)
}
this.O = b.j;
this.P = b.o;
isNaN(b.b) || zM(this, "bwe", [b.b.toFixed(0)], a);
isNaN(b.g) || (c = b.g, b.k < c && (c = b.k), this.L != c && (zM(this, "bh", [c.toFixed(3)], a), this.L = c), this.b.g.b.B && 3 > c && ("PL" == this.g || "B" == this.g) && this.A.start());
zM(this, "cmt", [this.b.j()], a)
};
function AM(a) {
var b = {
event: "streamingstats"
};
a.b.b.b && (b.fmt = a.b.b.b.id);
b.cpn = a.b.b.Ea;
b.ei = a.b.b.A;
b.el = a.b.g.ba;
b.docid = a.b.b.videoId;
b.ns = a.b.g.Yc;
b.fexp = a.b.g.b.b.toString();
a.b.g.k && (b.adformat = a.b.g.k);
a.b.b.qb && (b.live = a.b.b.Ab ? "dvr" : "live");
b.html5 = "1";
return b
}
f.vg = function (a) {
if (!this.ea() && !Wb(this.j)) {
0 != this.A.ta || this.xk(a);
a = JK(this.b.g).hmewdrop;
0 <= a && a != this.D && zM(this, "df", [a - (this.D || 0)]);
this.D = a;
a = AM(this);
bc(a, EK(this.b.g));
a = qf(HK(this.b.g), a);
for (var b in this.j) a += "&" + b + "=" + this.j[b].join(",");
Qd(a);
this.j = {};
this.o.start()
}
};
f.Wg = function () {
zM(this, "vps", ["N"]);
this.N = Hd(t(this.vg, this), 1E4);
this.o.start()
};
f.onError = function (a, b) {
var c = this.b.j(),
d = a;
5 == a && (d = 208);
c = [d, c.toFixed(3)];
b && c.push(b);
zM(this, "error", c)
};
f.Gu = function () {
"PL" == this.g && (zM(this, "vps", [this.g]), this.vg())
};
f.J = function () {
xM.G.J.call(this);
Id(this.N)
};
function BM(a, b, c, d) {
this.b = [];
this.o = [];
this.F = !1;
this.g = "watchtime" == c;
this.ka = "playback" == c;
this.ca = "delayplay" == c;
this.va = (this.D = "atr" == c) ? "/api/stats/" + c : GK(b) + "api/stats/" + c;
d && (this.po = d.fs, d.rtn && (this.kg = d.rtn), this.g ? (this.rd = d.state, 0 < d.rti && (this.Ph = d.rti)) : (this.qa = d.mos, this.ja = d.volume, d.at && (this.N = d.at), d.allowed && (this.A = d.allowed), d.ex_ads && (this.C = d.ex_ads)));
this.Ca = b.k;
this.Yh = b.yc;
this.Aa = b.C;
this.Da = b.L;
this.Ia = b.M;
this.Vc = b.O;
this.Ma = b.ye;
this.Ua = b.ze;
this.hb = b.P;
this.ib =
b.T;
this.mb = b.U;
this.kb = b.W;
this.tb = b.D;
this.Tb = b.j;
this.xc = b.ba;
this.o = b.b.b;
this.M = b.o;
this.oo = b.Yc;
this.of = b.F;
this.O = b.$;
this.j = b.A;
this.gg = b.Ua;
this.W = b.Aa;
this.$ = b.Da;
this.ua = KK(b);
!a.b || a.Ia.isEmpty();
this.Yh = a.lg || this.Yh;
this.U = a.Mh;
this.Ba = a.Ea;
this.k = a.ig;
this.L = a.nf;
this.jg = a.b.id;
this.qo = a.xe;
this.zc = a.Lh;
a.qb && (this.ub = a.Ab ? "dvr" : "live");
this.sd = a.Wj;
this.Ud = a.Ud;
this.Bb = a.Bb;
this.gc = a.A;
this.Na = a.Na;
this.j = a.Aa || this.j;
this.P = a.hb;
this.T = a.ib;
this.hg = a.L;
this.videoId = a.videoId;
this.td =
a.Ma
}
f = BM.prototype;
f.Yh = !1;
f.lv = !1;
f.vo = !1;
f.po = !1;
f.Fu = !1;
f.qo = !1;
f.oo = "yt";
f.Ph = null;
f.kg = null;
f.send = function () {
if (!this.F) {
var a = CM(this),
a = qf(this.va, a);
this.D ? this.B && ii(a, {
method: "POST",
hd: {
atr: this.B
}
}) : Qd(a);
this.F = !0
}
};
function CM(a) {
var b = {
ns: a.oo,
el: a.xc,
cpn: a.Ba,
docid: a.videoId,
ver: 2,
referrer: a.of,
cmt: a.yf(a.k),
plid: a.Bb,
ei: a.gc,
fmt: a.jg,
fs: a.po ? "1" : "0",
rt: a.yf(a.oa),
c: a.Ma,
cver: a.Ua,
adformat: a.Ca,
content_v: a.Aa,
euri: a.Tb,
subscribed: a.hg,
lact: a.ua,
live: a.ub,
cplatform: a.tb,
cbrand: a.Da,
cmodel: a.hb,
cnetwork: a.ib,
cbr: a.Ia,
cbrver: a.Vc,
cos: a.mb,
cosver: a.kb,
mos: a.qa,
q: a.gg,
osid: a.td,
state: a.rd,
volume: a.ja
};
a.Yh && (b.autoplay = "1");
a.vo && (b["final"] = "1");
a.qo && (b.splay = "1");
a.L && (b.delay = a.L);
a.M && (b.hl = a.M);
a.O && (b.cr =
a.O);
n(a.W) && a.$ && (b.uga = a.$ + a.W);
n(a.H) && (b.len = a.yf(a.H));
!a.g && 0 < a.o.length && (b.fexp = a.o.toString());
null != a.kg && (b.rtn = a.yf(a.kg));
a.j && (b.feature = a.j);
a.Na && (b.list = a.Na);
a.P && (b.ctrl = a.P);
a.T && (b.ytr = a.T);
a.g ? (b.idpj = a.zc, b.ldpj = a.sd, null != a.Ph && (b.rti = a.yf(a.Ph))) : (n(a.N) && (b.at = a.N), n(a.A) && (b.allowed = a.A), n(a.C) && (b.ex_ads = a.C));
(a.ka || a.ca) && a.U && (b.tst = a.U);
a.g && (b.st = DM(a, A(a.b, function (a) {
return a.startTime
})), b.et = DM(a, A(a.b, function (a) {
return a.endTime
})));
gb(a.b, function (a) {
return 0 !=
a.visibilityState
}) && (b.vis = DM(a, A(a.b, function (a) {
return a.visibilityState
})));
gb(a.b, function (a) {
return 1 != a.playbackRate
}) && (b.rate = DM(a, A(a.b, function (a) {
return a.playbackRate
})));
gb(a.b, function (a) {
return "-" != a.vk
}) && (b.cc = A(a.b, function (a) {
return a.vk
}).join(","));
return b
}
f.yf = function (a) {
return (1 * a.toFixed(3)).toString()
};
function DM(a, b) {
return A(b, a.yf).join(",")
};
function EM(a) {
this.b = a;
this.g = null;
a.o && (this.g = new xM(a), S(this, this.g));
this.j = new oM(a);
this.A = "paused";
this.B = NaN;
this.D = [10, 10, 10, 40];
this.H = this.C = 0;
this.L = this.F = this.N = this.k = !1;
this.o = NaN;
this.M = new wM(this.j, this.b.b, this.b.g)
}
w(EM, jh);
function FM(a, b, c) {
var d = tM(a.b);
c = isNaN(c) ? d : c;
c = Math.ceil(c);
var e = a.D[a.C];
a.C + 1 < a.D.length && a.C++;
c = c + e;
d = 1E3 * (c - d);
a.B = J(t(a.rB, a, c, b), d);
return c
}
f = EM.prototype;
f.rB = function (a, b) {
if (!this.ea()) {
this.B = NaN;
this.j.update();
var c = sM(this.j),
d = GM(this, c);
b && (d.Ph = a);
var e = 400 < this.H;
!(1 < c.length) && c[0].isEmpty() || e || (d.kg = FM(this, !0, a));
d.send();
this.H++
}
};
function HM(a, b) {
var c = IM(a.b);
sa(c, {
state: a.A
});
c = new BM(a.b.b, a.b.g, b, c);
c.k = a.b.j();
c.H = a.b.B();
c.oa = tM(a.b);
c.b = [pM(a.b)];
return c
}
function GM(a, b) {
var c = HM(a, "watchtime");
c.b = b;
c.k = a.j.b;
return c
}
function JM(a) {
a.j.update();
return GM(a, sM(a.j))
}
function KM(a) {
var b = a.b.g;
a = a.b.b;
var c = a.Aa || b.A,
c = {
ns: b.Yc,
html5: "1",
el: b.ba,
ps: b.vb,
fexp: b.b.b.join(",") || void 0,
feature: c || void 0,
ctrl: a.hb || void 0,
ytr: a.ib || void 0,
list: a.Na,
d: b.va,
f: b.qa
};
b.yc && (c.autoplay = "1");
a.L && (c.subscribed = a.L);
return c
}
f.Wg = function () {
this.g && this.g.Wg()
};
f.onError = function (a, b) {
if (this.g) this.g.onError(a, b)
};
function LM(a, b) {
if (!a.ea()) {
W(b.state, 2) ? (a.A = "paused", a.k && JM(a).send()) : W(b.state, 8) ? (a.A = "playing", a.k && isNaN(a.B) && FM(a, !1)) : a.A = "paused";
if (a.g) {
var c = a.g,
d = b.state,
e;
e = b.state;
if (W(e, 128)) e = "ER";
else if (W(e, 16) || W(e, 32)) e = "S";
else {
var g = yM[Et(e)];
"B" == g && W(e, 4) && (g = "PB");
e = g
} if (e != c.g) {
var g = e,
h = tM(c.b);
if (!(h < c.k)) {
if ("PL" == c.g) c.C += h - c.k;
else if ("B" == c.g && c.B && (c.B = !1, c.F += h - c.k, !c.H && 10 <= c.F && 180 >= c.C)) {
c.b.C();
if (!c.ea()) {
var k = AM(c);
k.qoealert = "1";
k = qf(HK(c.b.g), k);
Qd(k)
}
c.H = !0
}
"B" != g ||
"PL" != c.g && "PB" != c.g || (c.B = !0);
c.k = h
}!c.b.g.b.B || "B" != e && "PB" != e ? zM(c, "cmt", [c.b.j().toFixed(3)]) : c.xk();
zM(c, "vps", [e]);
c.g = e
}
if (W(d, 128)) c.onError(d.b.errorCode, d.b.errorDetail);
(W(d, 2) || W(d, 128)) && c.vg()
}
a.o && W(b.state, 128) && (a.$h("error-100"), K(a.o))
}
}
function MM(a) {
a.o = Hd(t(a.$h, a, "heartbeat"), 3E4)
}
f.$h = function (a) {
var b = this.b.g,
c = this.b.b,
d = {
ns: b.Yc,
el: b.ba,
eurl: b.j,
fmt: c.b ? c.b.id : 0,
html5: 1,
list: c.Na,
plid: c.Bb,
cpn: c.Ea,
ei: c.A,
ps: b.vb,
noflv: 1,
st: this.b.j(),
video_id: c.videoId,
metric: a
};
b.yc && (d.autoplay = "1");
c.kk && (d.tmi = "1");
"heartbeat" == a && (d.tpmt = rM(this.j));
sa(d, EK(b));
Qd(qf("//www.youtube.com/live_204", d))
};
f.J = function () {
EM.G.J.call(this);
K(this.B);
this.B = NaN;
var a = this.j;
Id(a.A);
a.A = NaN
};
EM.prototype.getDebugInfo = function () {
return CM(HM(this, "playback"))
};
function NM(a) {
if (!a.F) {
a.b.b.o.eventLabel = a.b.g.ba;
a.b.b.o.playerStyle = a.b.g.vb;
a.b.b.H && (a.b.b.o.feature = "pyv");
a.b.b.o.vid = a.b.b.videoId;
a.b.b.o.isAd = !("adunit" != a.b.g.ba && !a.b.b.H);
var b = a.b.b.o;
b && b.uid && (eM[b.uid] = b);
t: {
b = a.b.b.o.uid;
if (!b) {
b = Fd("CONVERSION_CONFIG_DICT");
if (!b) break t;
b = b.uid || null;
if (!b) break t
}
i: {
var c = Fd("CONVERSION_CONFIG_DICT");
if (r(b)) {
var d = fM(b);
if (!c || c.uid != d)
if (c = eM[d], !c || c.uid != d) break i
}
var e;
if (c && c.baseUrl && c.uid) {
var g = c.rmktEnabled,
d = c.focEnabled && (!c.isAd ||
!1);
if (g || d) {
var h = {};
if (g) {
g = {
utuid: c.uid,
type: "view"
};
c.vid && (g.utvid = c.vid);
c.eventLabel && (g.el = c.eventLabel);
c.playerStyle && (g.ps = c.playerStyle);
c.feature && (g.feature = c.feature);
c.ppe && (g.ppe = c.ppe);
c.subscribed && (g.subscribed = c.subscribed);
c.engaged && (g.engaged = c.engaged);
var k = [];
for (e in g) k.push(encodeURIComponent(e) + "=" + encodeURIComponent(g[e]));
e = k.join(";");
h.data = e
}
d && c.vid && c.uid && (c.oeid || c.ieid) && (c.oeid && (h.oeid = c.oeid), c.ieid && (h.ieid = c.ieid), h.evid = c.vid);
d && (h.label = "followon_view",
h.foc_id = c.uid);
e = qf(c.baseUrl, h)
} else e = null
} else e = null;
e && Qd(e)
}(e = Fd("CONVERSION_CONFIG_DICT")) && (!r(b) || e.uid == fM(b)) && Sb(nM, e.uid) && e.baseUrl && e.uid && e.focEnabled && !e.isAd && (b = {
label_no_cache: "followon_view",
foc_id_no_cache: e.uid,
random_no_cache: Math.round(1E4 * Math.random())
}, (b = qf(e.baseUrl, b)) && Qd(b))
}
a.F = !0
}
};
function OM() {
this.endTime = this.startTime = -1;
this.vk = "-";
this.playbackRate = 1;
this.visibilityState = 0
}
OM.prototype.isEmpty = function () {
return this.endTime == this.startTime
};
function PM(a, b, c, d, e, g, h) {
this.b = a;
this.g = b;
this.A = c;
this.B = d;
this.j = e;
this.o = g || null;
this.C = h || function () {};
this.k = -1
}
function tM(a) {
var b = window.performance && window.performance.now ? window.performance.now() : v();
0 > a.k && (a.k = b);
return Math.round(b - a.k) / 1E3
}
function IM(a) {
var b = a.A();
a = a.b;
var c = {};
a.b && (c.fmt = a.b.id, a.ca && (c.afmt = a.ca.id));
a.oa && (c.threed = a.ck);
c.plid = a.Bb;
c.ei = a.A;
c.list = a.Na;
c.cpn = a.Ea;
a.videoId && (c.v = a.videoId);
a.El && (c.infringe = 1);
a.xe && (c.splay = 1);
a.qb && (c.live = a.Ab ? "dvr" : "live");
a.lg && (c.autoplay = 1);
a.Ua && (c.sdetail = a.Ua);
a.Ud && (c.partnerid = a.Ud);
a.Ma && (c.osid = a.Ma);
sa(b, c);
return b
}
function pM(a) {
var b = new OM;
b.vk = a.A().cc || "-";
var c = a.g;
b.playbackRate = c.Sa && c.Sa.playbackRate || 1;
(c = lg("visibilityState", document)) && "visible" != c && (b.visibilityState = 3);
a.g.xb ? b.visibilityState = 2 : a.g.hr && (b.visibilityState = 1);
return b
};
function QM(a, b) {
this.state = a;
this.b = b
}
function vv(a, b) {
return W(a.state, b) && !W(a.b, b) ? 1 : !W(a.state, b) && W(a.b, b) ? -1 : 0
};
function RM(a, b) {
Ki.call(this);
this.Ca = new bM;
this.A = new Ht(t(this.getCurrentTime, this), t(this.getPlayerState, this), t(this.Rh, this));
S(this, this.A);
this.U = NaN;
this.H = this.C = null;
this.B = a;
this.oa = new ZL(a);
this.ua = !1;
this.D = this.j = null;
this.L = [];
this.P = new cM;
this.M = new cM;
this.va = NaN;
this.k = new wt;
this.Ia = b;
this.T = this.ka = null;
this.F = NaN;
this.W = new zv(this);
this.b = new rr;
this.g = this.O = null;
this.ca = NaN;
this.o = null;
this.Aa = !1;
this.$ = 0;
this.Da = null;
this.qa = !1;
this.ja = null
}
w(RM, Ki);
function Ss(a) {
Iy() ? Ly(a.$) : K(a.$)
}
f = RM.prototype;
f.J = function () {
K(this.ca);
Id(this.va);
Rs(this);
Ss(this);
jH(this);
nh(this.j, this.T, this.W, this.b);
this.W = this.j = this.H = null;
this.qa = !1
};
function SM(a, b, c) {
a.L.length = 0;
a.P = new cM;
a.M = new cM;
a.U = NaN;
a.F = NaN;
a.O = null;
a.Aa = !1;
a.g && tt(a.g);
TM(a);
Rs(a);
Ss(a);
nh(a.j, a.b, a.D);
a.j = null;
a.D = null;
a.A.reset();
if (2 == a.Ia || jo(a.B.Ee)) b.Yo = !0;
a.b = b;
a.b.subscribe("dataupdated", a.tv, a);
a.b.subscribe("dataloaded", a.gp, a);
a.b.subscribe("onStatusFail", a.sv, a);
b.pf && b.pf > b.Ya && (b = b.pf, a.H && (a.A.Bg(a.H), a.H = null), a.H = new Ds(1E3 * b, 2147483646), a.H.eb.subscribe("onEnter", a.sg, a), a.A.ri(a.H));
Rs(a);
a.b.Ae || (c = new PM(a.b, a.B, c, t(a.Yd, a), t(a.getCurrentTime,
a), t(a.qv, a), t(a.rv, a)), a.o = new EM(c));
a.qa = !1;
UM(a, "newdata");
VM(a, new wt)
}
function Rs(a) {
if (a.o) {
var b = a.o;
if (!b.ea() && b.k) {
b.A = "paused";
var c = JM(b);
c.vo = !0;
c.send();
b.g && (c = b.g, "PL" == c.g && (zM(c, "vps", ["PA"]), c.g = "PA"), c.vg());
K(b.o);
b.dispose()
}
lh(a.o);
a.o = null
}
}
f.getVideoData = function () {
return this.b
};
f.R = function () {
return this.B
};
function WM(a) {
return !(!a.b.g || !a.b.g.g.length)
}
function XM(a) {
if (Hr(a.b)) return !0;
uv(a, 2);
return !1
}
function YM(a) {
XM(a) && !a.P.g && (a.P.start(), a.o && a.o.Wg(), a.gp())
}
f.gp = function () {
if (Ir(this.b)) Ir(this.b), this.P.b = !0, this.L = sb(this.b.D), Cr(this.b), WM(this) && (this.b.Ab && (ZM(this, this.b.Pa), $M(this, !0)), this.b.g.b && aN(this), gJ(this, "i")), UM(this, "dataloaded"), this.M.g && bN(this);
else if (this.b.ka) {
var a = this.b;
a.ka = !1;
var b = a.O,
c = $h(b),
b = 0 > rr.g.indexOf(c) ? ko(b) : lo(b),
c = t(a.Oz, a),
a = t(a.$l, a);
kp(new bp(b), b, c, a)
} else this.b.Qe || (a = FK(this.B, this.b), Jr(this.b, a))
};
function cN(a) {
YM(a);
XM(a) && (a.M.g || (a.M.start(), VM(a, Dt(a.k, 8))), bN(a))
}
function bN(a) {
if (!(a.M.b || !a.P.b || W(a.k, 128) || a.L.length || (a.A.zg || a.A.Wg(), a.L.length || 0 < dt(a.A.g, -2147483648).length))) {
a.b.qb && dN(a, Infinity, !0);
a.M.b = !0;
if (a.o) {
var b = a.o;
b.b.b.Wh && b.b.b.Dk && (b.$h("connected"), MM(b))
}
a.I("playbackready", a)
}
}
f.sg = function (a) {
this.pauseVideo();
VM(this, !1 == a ? new wt : new wt(zt()))
};
function eN(a, b, c, d) {
a.b.b = c;
a.b.ca = d || c;
if (a.o) {
d = a.b;
var e = aM(a.oa, d),
e = B(d.g.g, t(e.k, e));
d = a.o;
e = new YL(c, b, e ? e.id : "");
d.g && (c = d.g, d = tM(c.b), zM(c, "vfs", [e.b.id, e.g, c.M, e.j], d), c.M = e.b.id, e = c.b.g, e = e.Sa ? new G(0 < e.Sa.style.width.indexOf("px") ? parseInt(e.Sa.style.width, 10) : e.Sa.clientWidth, 0 < e.Sa.style.height.indexOf("px") ? parseInt(e.Sa.style.height, 10) : e.Sa.clientHeight) : new G(Number.NaN, Number.NaN), 0 < e.width && 0 < e.height && zM(c, "view", [Math.round(e.width), Math.round(e.height)], d), zM(c, "vps", [c.g],
d), c.vg(d))
}
a.I("internalvideoformatchange", a.b, "m" == b)
}
function uv(a, b, c, d) {
if (Sb(fu, c)) var e = c;
else var g = c;
VM(a, Bt(a.k, 128, {
errorCode: b,
errorDetail: d,
message: g,
messageKey: e
}));
fN(a)
}
function gN(a, b) {
a.L = a.L.filter(function (a) {
return b != a
});
a.M.g && bN(a)
}
f.Rh = function () {
return W(this.k, 8) && !W(this.k, 64) && !W(this.k, 2)
};
f.getPlayerState = function () {
return this.k
};
f.getPlayerType = function () {
return this.Ia
};
function hN(a, b) {
a.g && jH(a);
a.g = b;
iN(a)
}
function jH(a) {
a.D = null;
a.j && (a.j.B = !0);
a.g && (a.o && a.P.g && W(a.k, 64) && LM(a.o, new QM(new wt(4), a.k)), TM(a), a.W.removeAll(), tt(a.g), a.g = null)
}
function jN(a) {
cN(a);
W(a.k, 64) && VM(a, Dt(a.k, 8));
if (a.M.b && a.g)
if (a.b.g) {
var b;
if (a.b.g.b) kN(a), b = a.Da, a.j.resume();
else {
a.j && (a.j.dispose(), a.j = null);
b = a.b.P.b;
var c = a.b,
d = {};
c.M && (d.ptk = c.M, d.oid = c.Tb, d.ptchn = c.tb, d.pltype = c.gc);
sa(b.g, d);
sa(b.g, {
c: a.B.ye,
cver: a.B.ze
})
}
a.g.Gd != b ? lN(a, b) : (Lr(a.b) && qt(a.g) && dN(a, Infinity, !0), rt(a.g))
} else uv(a, 5, "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK")
}
function vs(a) {
if (!a.b.g) return [];
var b = mN(a);
a = wp(a.b.g, b);
a.length && (a = a.concat(["auto"]));
return a
}
function nN(a) {
return tp(tp($L(a.oa, a.b), aM(a.oa, a.b)), mN(a))
}
function mN(a) {
return a.b.rk ? qp : a.C ? a.C.j : WM(a) && a.b.g.b && cp(a.b.j) ? pp : qp
}
function gJ(a, b, c) {
if (!a.ea() && !W(a.k, 128) && (c && (a.b.rf = c), WM(a))) {
"m" == b && c && rp(c) && (b = "a");
c = nN(a);
if (a.b.g.b) {
if ("i" != b) {
var d = a.j;
d.ea() || (AG(d, PK(d.k, c, b)), CG(d, d.g, RK(d.k)), sp(d.k.b) && "m" == b && (DG(d.g, !0), d.g.j.mc() && bL(d.g, d.o)), kL(d.g) && CL(d, d.g, d.j), EG(d))
}
} else a.b.P = pr(a.b.F, c), eN(a, b, a.b.P.getInfo());
a.Rh() && jN(a)
}
}
function xG(a) {
if (!a.getVideoData().ca) return null;
var b = a.getVideoData().ca;
return B(a.ja, function (a) {
return a.id == b.id
})
}
function aN(a) {
lp(a.b.j, {
c: a.B.ye,
cver: a.B.ze
});
var b = a.B,
c = new xC;
b.b.Aa && (c.O = !0);
b.b.ua && (c.L = !0, c.C = 1.25);
b.b.ka && (c.A = 1.5);
b.b.oa && (c.Zh = Nn.hd720);
b.b.$ && (c.D = 3.5);
b.b.va && (c.F = 300);
b.b.Da && (c.B = 90);
c.T = !!b.b.Ma;
ND(b) && (c.o = 8388608, c.k = 524288, c.g = 2097152, c.H = 1048576, c.A = 1.5, c.M = 15, c.b = !1, c.N = !1, c.F = 0, c.B = 90, Vq() && (c.ra = 28E4));
Wg && Wq("crkey") && (c.o = 20971520, c.k = 1572864, c.g = 20971520, c.b = !0, c.j = 1E3, c.Zh = Nn.hd720);
b = b.og || new G(window.screen.width, window.screen.height);
2560 <= b.width && 1440 <= b.height &&
(c.o = 52428800, c.k = 5242880, c.g = 20971520, c.H = 8388608);
a.j = new vL(a.ka, c, a.b.j, a.b.g);
a.j.subscribe("initsegment", a.au, a);
a.j.subscribe("formatchange", a.cu, a);
a.j.subscribe("fatalerror", a.bu, a);
a.j.subscribe("softerror", a.du, a);
c = C(a.L, "spacecast");
a.j.initialize(a.b.Ya, nN(a), c);
a.b.zc && (a.j.M = a.b.zc);
a.L.length && (a.j.B = !0)
}
function kN(a) {
if (!a.D) {
a.j ? a.j.seek(a.getCurrentTime()) : aN(a);
a.D = new Mq(a.g, a.b.Pa, a.b.g.g[0].xd, a.b.g.b[0].xd);
try {
var b = Oq(a.D)
} catch (c) {
c.message = "window.URL object overwritten by external code";
window.setTimeout(function () {
throw c;
}, 0);
uv(a, 5, "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK");
return
}
a.Da = new Xq(b, !1, !0);
Nq(a.D, t(a.j.cz, a.j))
}
}
f.au = function (a) {
if (this.C) {
var b = this.C;
if ("com.microsoft.playready" == b.b.b) {
for (var c = new Uint8Array(0), d = new DataView(a.buffer, a.byteOffset, a.length), e = 0; e < a.length - 8;) {
var g = d.getUint32(e);
if (1 > g) break;
var h = d.getUint32(e + 4);
if (1836019574 == h) e += 8;
else {
if (1886614376 == h) {
var h = a.subarray(e, e + g),
k = new Uint8Array(c.length + h.length);
k.set(c);
k.set(h, c.length);
c = k
}
e += g
}
}
a = c;
0 != a.length && VL(b, new TL(a), !1)
}
}
};
f.cu = function (a) {
eN(this, a.g, a.Wa.info, a.b.info)
};
f.bu = function (a, b) {
uv(this, a, void 0, b);
this.j = null;
this.D && (this.D.dispose(), this.D = null)
};
f.du = function (a, b) {
this.o.onError(a, b);
var c;
if (c = 209 == a)
if (c = this.B.b.U) c = this.b, c = v() - c.$j > rr.o;
c && (this.o.onError(127), this.I("urlauthexpired"))
};
f.pauseVideo = function () {
if (W(this.k, 64)) {
var a = this.k;
VM(this, Bt(a, a.g & -9))
}
this.g && this.g.pauseVideo()
};
function fN(a) {
a.pauseVideo();
a.g && (TM(a), a.D && (a.D.dispose(), a.D = null), a.b && (a.b.Ya = a.getCurrentTime()), a.F = NaN, st(a.g), W(a.k, 128) || VM(a, Bt(a.k)))
}
function dN(a, b, c, d) {
if (a.g) {
b = Fb(b || 0, 0, oN(a));
b >= oN(a) ? $M(a, !0) : $M(a, !1);
a.b.Ya = b;
a.F = b;
var e = a.Ca;
e.b = b;
e.g = !0;
c ? a.Ii() : (rG(a), d && (a.T || (a.T = new Bv(a.Ii, d, a)), a.T.start()), pN(a, !0));
a.H && b > a.b.pf && (a.A.Bg(a.H), a.H = null);
a.I("seekto", a, b)
} else a.b.Ya = b || 0
}
function rG(a) {
W(a.k, 32) || (VM(a, Dt(a.k, 32)), W(a.k, 8) && a.pauseVideo(), a.I("beginseeking", a))
}
f.Ii = function () {
if (!isNaN(this.F) && this.g) {
var a = this.Yd();
!this.b.qb && this.F >= Math.floor(a) ? (this.F = a, this.I("endseeking", this), this.pauseVideo(), this.sg()) : (this.j && this.j.seek(this.F), pt(this.g, this.F))
}
this.T && (this.T.dispose(), this.T = null);
W(this.k, 32) && (a = this.k, VM(this, Bt(a, a.g & -33)), this.I("endseeking", this))
};
f.getCurrentTime = function () {
if (!isNaN(this.F)) return this.F;
var a = 0;
this.g && 1 <= this.g.readyState ? a = this.g.getCurrentTime() : this.b && (a = this.b.ig || this.b.Ya || 0);
return a
};
f.Yd = function () {
return Lr(this.b) ? Infinity : this.b ? this.b.Pa : 0
};
f.qv = function () {
var a = new dM;
if (this.ka && this.j) {
var b = this.ka;
a.j = b.D;
a.o = b.F;
a.b = SJ(b);
b = this.j;
b.b && !Qq(b.b) && (a.g = kt(b.b.j.buffered, b.o), a.k = kt(b.b.b.buffered, b.o));
a.b = NK(b.D);
SJ(b.A);
QJ(b.A);
RJ(b.A)
} else this.g && (a.g = kt(this.g.buffered, this.getCurrentTime()));
return a
};
function qN(a) {
if (a.g)
if (Lr(a.b)) a = 1;
else if (Mr(a.b))
if (a.ua) a = 0;
else {
var b = a.g;
a = (0 < jt(b.buffered) && b.duration ? b.buffered.end(b.buffered.length - 1) : 0) / a.Yd()
} else a = ws(a.g);
else a = 0;
return a
}
RM.prototype.getDebugInfo = function (a) {
var b = {};
a && (this.o && sa(b, this.o.getDebugInfo()), this.g && sa(b, this.g.getDebugInfo()), this.j && sa(b, this.j.getDebugInfo()), W(this.k, 128) && (b.debug_error = this.k.b));
b.debug_videoId = this.b.videoId;
return b
};
f = RM.prototype;
f.tv = function () {
UM(this)
};
f.sv = function (a) {
uv(this, parseInt(a.errorcode, 10), unescape(a.reason), a.errordetail)
};
function UM(a, b) {
a.I("internalvideodatachange", b || "dataupdated", a, a.b)
}
function iN(a) {
y("loadstart loadeddata loadedmetadata play playing pause ended suspend progress seeking seeked timeupdate durationchange error waiting abort".split(" "), function (a) {
this.W.listen(this.g, a, this.oC)
}, a)
}
f.oC = function (a) {
var b = a.target;
if (b == this.g && b.currentSrc) {
switch (a.type) {
case "error":
if (this.B.wk && b.error && b.error.errorCode == b.error.MEDIA_ERR_NETWORK) {
setTimeout(t(function () {
this.g && (this.b.P && this.g.load(), jN(this))
}, this), 500);
if (this.o) this.o.onError(201);
return
}
break;
case "durationchange":
if (!this.b.Ab || this.b.j && !this.b.j.g) b = b.duration || 0, (!this.D || isFinite(b) && 0 < b) && ZM(this, b);
break;
case "ended":
VM(this, Bt(this.k, 4));
this.ok();
break;
case "loadedmetadata":
this.b.Ya && (this.g.currentTime =
this.b.Ya), this.B.wo && this.b.Ya && (this.U = this.b.Ya, this.g.pauseVideo());
case "loadeddata":
this.ca && K(this.ca);
break;
case "loadstart":
Id(this.va);
this.di() || (this.va = Hd(t(this.di, this), 100));
break;
case "progress":
this.U && this.g.seekable.length && this.g.seekable.end(0) > this.U && (this.g.currentTime = this.U, this.U = NaN, this.Ba = this.W.listen(this.g, "canplay", this.Av));
case "suspend":
pN(this);
this.I("onLoadProgress", this, qN(this));
break;
case "seeked":
rN(this);
break;
case "playing":
fq("plev");
break;
case "timeupdate":
this.Aa = !0, this.di(), rN(this), pN(this), this.I("onVideoProgress", this, b.getCurrentTime())
}
this.I("videoelementevent", a);
a = xt(this.k, a, this.Ca);
VM(this, a)
}
};
f.di = function () {
var a = this.g;
a && this.Aa && !this.b.uk && !hq("vfp") && 2 <= a.readyState && !a.ended && 0 < jt(a.buffered) && fq("vfp");
if ((a = this.g) && !this.b.uk && 0 < (a.duration || 0) && (!hq("paft") && hq("plev") && qt(a) && 2 <= a.readyState && 0 < jt(a.buffered) && fq("pbr"), 0 < a.getCurrentTime())) {
Id(this.va);
this.b.uk = !0;
sN(this);
if (this.o) {
a = this.o;
if (!a.k) {
var b = HM(a, "playback");
a.D = [10 + a.b.b.Lh, 10, 10, 40 + a.b.b.Wj - a.b.b.Lh, 40];
var c = a.j;
Id(c.A);
c.A = NaN;
c.A = Hd(t(c.update, c), 100);
c.o = tM(c.g);
c.k = pM(c.g);
b.kg = FM(a, !0);
b.Fu = !0;
b.send();
!a.b.g.hc || a.b.g.Vh || a.k || (b = a.b.g, c = a.b.b, b = {
noflv: "1",
html5: "1",
video_id: c.videoId,
cpn: c.Ea,
plid: c.Bb,
ei: c.A,
referrer: IK(b),
eurl: b.j,
framer: b.H,
feature: b.A,
fmt: c.b ? c.b.id : 0,
ptk: c.M,
skl: c.jo,
access_token: c.B,
ucid: c.td
}, sa(b, KM(a)), delete b.fexp, b = qf(a.b.g.wb + "user_watch", b), Qd(b));
a.b.b.M && (b = a.b.g, c = a.b.b, b = qf(b.wb + "ptracking", {
html5: "1",
video_id: c.videoId,
cpn: c.Ea,
plid: c.Bb,
ei: c.A,
ptk: c.M,
oid: c.Tb,
ptchn: c.tb,
pltype: c.gc,
content_v: b.C
}), Qd(b));
if (a.b.b.ho && a.b.g.De && !a.k) {
var b = a.b.g,
c = a.b.b,
d = {
noflv: 1,
video_id: c.videoId,
cpn: c.Ea,
el: b.ba,
ps: b.vb,
referrer: IK(b),
eurl: b.j,
framer: b.H,
fmt: c.b ? c.b.id : 0,
ptk: c.M,
subscribed: c.L,
t: c.gg
};
b.yc && (d.autoplay = "1");
c.xe && (d.splay = "1");
0 < c.Ya && (d.start = 1E3 * c.Ya);
c.kk && (d.tmi = "1");
b = qf(a.b.g.wb + "get_video", d);
Qd(b)
}
a.b.b.Wh && (a.$h("playback"), a.o || MM(a));
a.k = !0;
a = a.j;
a.b = a.g.j();
a.o = tM(a.g);.5 < a.b - a.j && (a.j = a.b)
}
this.b.H && this.B.b.A && Qd(this.b.H);
J(t(this.ok, this), 4500)
}
this.I("playbackstarted");
this.j && (this.j.W = !0);
Iy() && My();
return !0
}
return !1
};
function sN(a) {
var b = v(),
c = a.getCurrentTime(),
d = a.b;
if (!hq("pbs")) {
var e = 1E3 * (c - d.Ya);
0 > e && (e = 0);
fq("pbs", b - e);
cq.measure && cq.getEntriesByName && (cq.getEntriesByName("mark_navigation_requested")[0] ? cq.measure("measure_above_the_fold", "mark_navigation_requested") : cq.measure("measure_above_the_fold"))
}
d.videoId && (b = d.videoId, jq(void 0).docid = b);
d.A && (b = d.A, jq(void 0).ei = b);
d.Ea && (b = d.Ea, jq(void 0).cpn = b);
0 < d.Ya && (b = d.Ya.toString(), jq(void 0).start = b);
a.g && qt(a.g) && (jq(void 0).paused = 1);
d.b ? (d = d.b.id,
jq(void 0).fmt = d) : jq(void 0).fmt = "-1";
d = Math.round(qN(a) * a.Yd()).toString();
jq(void 0).tds = d;
c = c.toFixed(3);
jq(void 0).cmt = c;
if (a.j) {
a = a.j;
window && window.performance && window.performance.getEntriesByName && (c = window.performance.getEntriesByName(a.ka), c.length && (c = c[0], xL(a, "vri", c.fetchStart), xL(a, "vdns", c.domainLookupEnd), xL(a, "vreq", c.requestStart), xL(a, "fvb", c.responseStart), xL(a, "vrc", c.responseEnd)), c = window.performance.getEntriesByName(a.T), c.length && (c = c[0], xL(a, "ari", c.fetchStart), xL(a, "adns",
c.domainLookupEnd), xL(a, "areq", c.requestStart), xL(a, "fab", c.responseStart), xL(a, "arc", c.responseEnd)));
a = a.ca;
for (var g in a) fq(g, a[g])
}
}
f.Av = function () {
this.Ba && (this.W.Ja(this.Ba), this.Ba = void 0, rt(this.g))
};
function pN(a, b) {
if (a.g && a.b) {
var c = a.getCurrentTime();
if (c < tN(a)) dN(a, oN(a), !0);
else {
if (a.j) {
var d = a.j;
d.resume();
if (d.F) {
var e = d.o <= c && c < d.o + 10,
g = !d.xa.T || 0 <= ht(d.b.b.buffered, d.o) && 0 <= ht(d.b.j.buffered, d.o);
e && g && (d.F = !1)
}
d.F || (d.o = c);
FL(d)
}
Mr(a.b) && c > a.Yd() && (d = a.Yd(), 0 == d && (d = c), ZM(a, 1.2 * d));
5 < c && (a.b.Ya = c);
(d = Iy()) ? Ly(a.$): K(a.$);
qt(a.g) || (e = t(a.kv, a), a.$ = a.g.played && 0 == a.g.played.length ? d ? Jy(e, 100) : J(e, 100) : d ? Jy(e, 500) : J(e, 500));
a.b.ig = c;
!b && a.Rh() && a.o && (d = a.o, d.j.update(), d.b.b.Pa && d.b.b.nf &&
!d.L && rM(d.j) >= d.b.b.nf && d.k && d.b.b.nf && (e = HM(d, "delayplay"), e.lv = !0, e.send(), d.L = !0), e = d.M, !e.k && e.b.De && !e.b.Vh && e.g.Pa && rM(e.o) >= e.g.Jo && d.M.send(), d.b.b.Pa && !d.F && rM(d.j) >= d.b.b.Sn && NM(d));
a.di() && a.b.fk && 0 < a.b.ig && (d = a.o, d.k && (e = d.b.g, g = d.b.b, d = {
ns: "yt",
docid: g.videoId,
plid: g.Bb,
ei: g.A,
cpn: g.Ea,
fmt: g.b ? g.b.id : 0,
el: e.ba,
ps: e.vb,
subscribed: g.L,
yttk: "1",
st: d.b.j(),
et: d.b.j(),
ctp: "1",
vid: e.oa
}, d = qf("//s2.youtube.com/s", d), Qd(d)), a.b.fk = !1);
a.I("progresssync", a, b);
a.b.mv = c
}
}
}
f.kv = function () {
this.g && (W(this.k, 8) && Ct(this.Ca, this.getCurrentTime(), Date.now(), kt(this.g.buffered, this.g.getCurrentTime())) && VM(this, Dt(this.k, 1)), pN(this))
};
function VM(a, b) {
var c = a.k;
if (b.g != c.g || b.b != c.b) {
c = new QM(b, a.k);
a.k = b;
0 > vv(c, 8) && $M(a, !1);
0 < vv(c, 32) && $M(a, !1);
Mr(a.b) && W(c.state, 2) && (ZM(a, a.getCurrentTime()), pN(a, !0));
a.o && LM(a.o, c);
var d = a.A;
if (d.zg && !d.xi)
if (Kt(d), W(c.state, 2)) {
d.A = null;
for (var e = [], g = 0; g < d.b.length; g++) {
var h = d.b[g];
h.active && 2147483647 > h.end && e.push(h)
}
g = dt(d.g, 2147483646);
g = g.concat(et(d.g, 2147483646));
e = Mt(d, e).concat(Lt(d, g));
Nt(d, e)
} else W(c.state, 16) ? (d.k = Jt(d), d.o.stop(), d.o.start(), d.nc()) : (d.o.stop(), W(c.b, 16) ? (d.k =
Jt(d), null != ft(d.g, Math.max(d.k - 2E3, 0)) && (d.Tg = tk(t(d.nc, d)))) : d.nc());
a.I("statechange", c)
}
}
f.rv = function () {
this.I("connectionissue")
};
function rN(a) {
W(a.k, 2) || W(a.k, 32) || (a.F = NaN)
}
function $M(a, b) {
a.b.Ab && a.ua != b && (a.ua = b, a.I("liveviewshift", b))
}
function lN(a, b) {
ot(a.g, b);
a.D && !b.b && (a.D = null);
Dr(a.b) && uN(a);
K(a.ca);
a.ca = J(t(a.Uz, a), 15E3);
a.B.vp ? J(t(function () {
rt(this.g)
}, a), 0) : rt(a.g)
}
function uN(a) {
var b = Dr(a.b);
if (b && !a.C && a.g)
if (b = Gq(a.g, a.b.b.xd, b)) {
a.C = new UL(a.g, b);
a.C.subscribe("newsession", a.Sz, a);
a.C.subscribe("licenseerror", a.Pz, a);
a.C.subscribe("qualitychange", a.Qz, a);
a.C.subscribe("heartbeatparams", a.Rz, a);
var b = a.C,
c = a.B.b.O;
b.L = a.b.B;
b.M = c;
S(a, a.C)
} else uv(a, 203, "YTP_HTML5_NO_AVAILABLE_FORMATS_FALLBACK")
}
function TM(a) {
a.C && (a.C.dispose(), a.C = null)
}
f.Sz = function (a) {
var b = EK(this.B);
b.cpn = this.b.Ea;
this.b.C && (b.vvt = this.b.C);
this.B.Va && (b.authuser = this.B.Va);
this.B.cb && (b.pageid = this.B.cb);
bc(a.o, b);
Vs(a, a.B);
this.I("newlicensesession", a)
};
f.Pz = function (a, b, c) {
uv(this, a, n(c) ? c : "YTP_ERROR_LICENSE", b)
};
f.Qz = function () {
gJ(this, "r");
UM(this)
};
f.Rz = function (a) {
this.I("heartbeatparams", a)
};
f.Uz = function () {
this.o.onError(102);
this.I("loadsofttimeout")
};
function ZM(a, b) {
a.b.Pa != b && (a.b.Pa = b, UM(a))
}
f.ok = function () {
if (!this.qa) {
var a = new XL(this.b),
b;
"c1a" in a.g ? (b = p("yt.abuse.botguardInitialized"), b = !(b && b())) : b = !1;
if (b) J(t(this.ok, this), 4500);
else {
this.qa = !0;
var c;
if (a.b && a.b.$) {
b = [a.b.$];
for (c in a.j)
if (a.g[c]) {
var d = a.j[c](a.g);
d && b.push(d)
}
c = b.join("&")
} else c = null;
c && (a = this.o, a.N || (b = HM(a, "atr"), b.B = c, b.send(), a.N = !0))
}
}
};
function oN(a) {
if (!a.g) return 0;
if (a.j) {
var b = a.j,
c = Math.floor(Math.min(b.j.j.index.Fe(), b.g.j.index.Fe()));
return Math.max(b.C.g ? c - 14 : c, tN(a))
}
a = a.g;
return (1 > a.seekable.length ? NaN : a.seekable.end(a.seekable.length - 1)) || 0
}
function tN(a) {
return a.b.j ? (a = Pb(a.b.j.b)) ? a.index.ej() : 0 : 0
};
function vN() {
this.j = !1;
this.g = 0;
this.b = ""
};
function wN(a, b, c) {
this.k = b;
this.b = c;
this.j = a
}
wN.prototype.getMessage = function () {
return this.k
};
wN.prototype.getErrorCode = function () {
return this.b
};
wN.prototype.toString = function () {
return "AdError " + this.getErrorCode() + ": " + this.getMessage() + (null != this.g ? " Caused by: " + this.g : "")
};
function xN(a, b) {
T.call(this, "adError");
this.j = a;
this.k = b ? b : null
}
w(xN, T);
var yN = "creativeview start firstquartile midpoint thirdquartile complete mute unmute pause rewind resume fullscreen exitfullscreen expand collapse close acceptinvitation acceptinvitationlinear engagedview videoShareClicked videoShareShown skipshown skip replay stop click progress userClose".split(" ");
function zN(a, b) {
T.call(this, a);
this.j = b
}
w(zN, T);
zN.prototype.getAd = function () {
return this.j
};
var AN = {
CONTENT_PAUSE_REQUESTED: "contentPauseRequested",
CONTENT_RESUME_REQUESTED: "contentResumeRequested",
CLICK: "click",
FH: "engagedview",
JH: "expandedChanged",
STARTED: "start",
zr: "impression",
PAUSED: "pause",
mJ: "resume",
FIRST_QUARTILE: "firstquartile",
MIDPOINT: "midpoint",
THIRD_QUARTILE: "thirdquartile",
COMPLETE: "complete",
USER_CLOSE: "userClose",
LOADED: "loaded",
ALL_ADS_COMPLETED: "allAdsCompleted",
SKIPPED: "skip",
CJ: "skipshown",
AJ: "skippableStateChanged",
cG: "adMetadata",
cF: "adBreakReady",
xI: "log",
VOLUME_CHANGED: "volumeChange",
rK: "mute",
SG: "companionBackfill",
CK: "youTubeVideoMetadata",
BK: "youTubeChannelMetadata"
};
var BN = ["://secure-...imrworldwide.com/", "www.google.com/pagead/sul", "www.youtube.com/gen_204\\?a=sul"];
function CN(a) {
return x(a) ? !1 : null != B(BN, function (b) {
return null != a.match(b)
})
}
function DN(a) {
a = CN(a) ? 'javascript:"data:text/html,<body><img src=\\"' + a + '\\"></body>"' : a;
var b = I("iframe", {
src: a,
style: "display:none"
});
a = Oc(b).body;
var c, d = tk(function () {
jk(c);
hd(b)
}, 15E3);
c = hk(b, ["load", "error"], function () {
tk(function () {
uk(d);
hd(b)
}, 5E3)
});
a.appendChild(b)
};
var EN = ["google-developers.appspot.com", "devsite.googleplex.com"],
FN = ["*.googlesyndication.com"],
GN = ["*.youtu.be", "*.youtube.com"],
HN = "ad.doubleclick.net bid.g.doubleclick.net corp.google.com ggpht.com google.co.uk google.com googleads.g.doubleclick.net googleads4.g.doubleclick.net googleadservices.com googlesyndication.com googleusercontent.com gstatic.com prod.google.com pubads.g.doubleclick.net s0.2mdn.net static.doubleclick.net static.doubleclick.net surveys.g.doubleclick.net youtube.com ytimg.com".split(" "),
IN = ["googleads.g.doubleclick.net", "pubads.g.doubleclick.net"];
function JN(a) {
var b;
if (b = null != a)(b = KN(EN, a)) || (b = If(new M(a)), b = null != b ? va(b, ".corp.google.com") || "corp.google.com" == b : !1), b = b || (null != a ? KN(GN, a) : !1);
return b
}
function KN(a, b) {
try {
var c = If(new M(b)),
c = c.replace(/^www./i, "");
return gb(a, function (a) {
return LN(a, c)
})
} catch (d) {
return !1
}
}
function LN(a, b) {
if (x(b)) return !1;
a = a.toLowerCase();
b = b.toLowerCase();
return "*." == a.substr(0, 2) ? (a = a.substr(2), a.length > b.length ? !1 : b.substr(-a.length) == a && (b.length == a.length || "." == b.charAt(b.length - a.length - 1))) : a == b
}
function MN(a) {
if ("https:" == window.location.protocol) {
var b = new M(a);
if ((new RegExp("^https?://([a-z0-9-]{1,63}\\.)*(" + HN.join("|").replace(/\./g, ".") + ")(:[0-9]+)?([/?#]|$)", "i")).test(a)) return vf(b, "https"), b.toString()
}
return a
};
function NN(a) {
window.open(MN(a), "_blank")
}
function ON(a, b, c) {
null != a ? (N(a, "label", b), null != c && N(a, "value", c.join(";")), a = a.toString()) : a = "";
PN(a)
}
function PN(a, b, c) {
null != b && (a = QN(a, b));
null != c && (x(c) || (b = new M(a), Xf(b.b, "label") && (N(b, "acvw", c), a = b.toString())));
a = MN(a);
DN(a)
}
function RN(a, b) {
null != a && y(a, function (a) {
PN(a, b)
})
}
function QN(a, b) {
return a.replace(/\[[a-zA-Z0-9_]+\]/g, function (a) {
try {
var d = Yb(b, a),
d = d.toString();
if (!x(d)) return encodeURIComponent(d).replace("%2C", ",")
} catch (e) {}
return a
})
};
function SN(a, b) {
this.message = a;
this.errorCode = b
}
SN.prototype.getErrorCode = function () {
return this.errorCode
};
SN.prototype.getMessage = function () {
return this.message
};
var TN = new SN("Unable to request ads from server. Cause: {0}.", 1005),
UN = new SN("Unable to request ads from server due to network error.", 1012),
VN = new SN("Cannot parse the {0} value for the adslist response: {1}.", 900),
WN = new SN("Invalid usage of the API. Cause: {0}", 900),
XN = new SN("Unable to display one or more required companions.", 602),
YN = new SN("There was a problem requesting ads from the server.", 1005),
ZN = new SN("The provided ad type: {0} is not supported.", 1005),
$N = new SN("The provided {0} information: {1} is invalid.",
1101),
aO = new SN("The response does not contain any valid ads.", 1009),
bO = new SN("The overlay ad content could not be displayed since creative dimensions do not align with display area.", 501),
cO = new SN("The ad playlist response was malformed or empty.", 1010),
dO = new SN("The ad response was not understood and cannot be parsed.", 1010),
eO = new SN("An unexpected error occurred and the cause is not known. Refer to the inner error for more info.", 900),
fO = new SN("The ad response contains unexpected element. Cause {0}.",
1010),
gO = new SN("No assets were found in the VAST ad response.", 200),
hO = new SN("Duplicate node in <{0}>: {1}", 101),
iO = new SN("The VAST response document is empty.", 1009),
jO = new SN("Linear assets were found in the VAST ad response, but none of them matched the video player's capabilities.", 403),
kO = new SN("Ad request reached a timeout.", 301),
lO = new SN("VAST response was malformed and could not be parsed.", 100),
mO = new SN("VAST media file loading reached a timeout of {0} seconds.", 402),
nO = new SN("Ad request could not be completed due to a network error.",
301),
oO = new SN("Non linear assets were found in the VAST ad response, but none of them matched the video player's capabilities.", 503),
pO = new SN("The maximum number of VAST wrappers ({0}) has been reached.", 302),
qO = new SN("VAST media file duration differs from the VAST response duration by {0} seconds.", 202),
rO = new SN("Video player received an ad with unexpected or incompatible linearity", 201),
sO = new SN("Unknown node in <{0}>: {1}", 101),
tO = new SN("Invalid VAST resource type: {0}", 101),
uO = new SN("Invalid VAST version",
102),
vO = new SN("No additional VAST wrappers allowed.", 300),
wO = new SN("No Ads VAST response after one or more Wrappers", 303),
xO = new SN("There was an error playing the video ad.", 400),
yO = new SN("VMAP unsupported node in <{0}>: {1}", 1010),
zO = new SN("An unexpected error occurred within the VPAID creative. Refer to the inner error for more info.", 901);
function AO(a, b, c) {
return BO("adLoadError", a, b || null, vb(arguments, 2))
}
function CO(a, b, c) {
return BO("adPlayError", a, b || null, vb(arguments, 2))
}
function DO(a, b, c, d, e) {
a.apply(null, rb([c, d], vb(arguments, 3)));
b.S(new zN("log", null))
}
function BO(a, b, c, d) {
if (c instanceof wN) return c;
var e = b.errorCode;
b = b.message;
if (0 < d.length)
for (var g = 0; g < d.length; g++) b = b.replace(new RegExp("\\{" + g + "\\}", "ig"), d[g]);
a = new wN(a, b, e);
a.g = c;
return a
}
function EO(a, b, c, d) {
var e = CO.apply(null, rb([b, c], vb(arguments, 3)));
a.S(new xN(e))
};
function FO(a) {
return (a = a.match(/^\w{2,3}([-_]|$)/)) ? a[0].replace(/[_-]/g, "") : ""
};
function GO(a) {
return (a = a.exec(dc)) ? a[1] : ""
}
var HO = function () {
if (Rg) return GO(/Firefox\/([0-9.]+)/);
if (oc || nc) return xc;
if (Wg) return GO(/Chrome\/([0-9.]+)/);
if (Xg) return GO(/Version\/([0-9.]+)/);
if (Tg || Ug) {
var a;
if (a = /Version\/(\S+).*Mobile\/(\S+)/.exec(dc)) return a[1] + "." + a[2]
} else {
if (Vg) return (a = GO(/Android\s+([0-9.]+)/)) ? a : GO(/Version\/([0-9.]+)/);
if (Sg) return GO(/Camino\/([0-9.]+)/)
}
return ""
}();
var IO = {},
JO = "",
KO = /OS (\S+) like/,
LO = /Android (\S+);/;
function MO() {
return kc || Pa(dc, "Mobile")
}
function NO(a, b) {
if (null == IO[b]) {
var c = OO(a);
c ? (c.replace(/_/g, "."), IO[b] = 0 <= Ta(c, b)) : IO[b] = !1
}
return IO[b]
}
function OO(a) {
xa(JO) && (a = a.exec(dc)) && (JO = a[1]);
return JO
};
function PO() {
this.g = .05 > Math.random();
this.b = Math.floor(4503599627370496 * Math.random())
}
ea(PO);
function QO(a, b, c, d) {
if (a.g || d) {
c = c || {};
c.lid = b;
c = RO(a, c);
var e = new M("http://pagead2.googlesyndication.com/pagead/gen_204");
Lb(c, function (a, b) {
N(e, b, null != a ? "boolean" == typeof a ? a ? "t" : "f" : "" + a : "")
}, a);
a = SO();
vf(e, a.Mb);
PN(e.toString())
}
}
function RO(a, b) {
b.id = "";
var c = SO();
b.c = a.b;
b.domain = c.Gb;
return b
}
function SO() {
var a = Yc(),
b = document;
return new M(a.parent == a ? a.location.href : b.referrer)
};
function TO() {}
f = TO.prototype;
f.$C = !1;
f.Ms = !1;
f.gq = !0;
f.baseYouTubeUrl = null;
f.Uf = -1;
f.contentId = null;
f.hs = !1;
f.uh = null;
f.Dn = null;
f.useShareButton = !1;
f.useStyledNonLinearAds = !1;
f.useVideoAdUi = !0;
f.youTubeAdNamespace = 0;
f.showContentThumbnail = !0;
f.loadVideoTimeout = 15E3;
var UO = {
"application/flash": "Flash",
"application/shockwave-flash": "Flash",
"application/x-shockwave-flash": "Flash",
"image/jpeg": "Image",
"image/jpg": "Image",
"image/png": "Image",
"image/gif": "Image",
text: "Text"
},
VO = ["ADSENSE", "ADSENSE/ADX"],
WO = ["DART", "DART_DFA", "DART_DFP"],
XO = ["GDFP"],
YO = {
KI: "video/mp4",
MI: "video/mpeg",
yI: "application/x-mpegURL",
UI: "video/ogg",
RJ: "video/3gpp",
uK: "video/webm",
JI: "audio/mpeg",
LI: "audio/mp4"
};
function ZO(a, b, c) {
if (D(a)) return null;
a = fb(a, function (a) {
var b = a.j;
return "application/x-mpegurl" == ya(a.b).toLowerCase() || "progressive" == b
});
D(c) || (c = A(c, function (a) {
return a.toLowerCase()
}), a = fb(a, function (a) {
return C(c, ya(a.b).toLowerCase())
}));
if (!ja(b) || 0 >= b) b = gc("iPad") || gc("Android") && !gc("Mobile") || gc("Silk") || !(gc("iPod") || gc("iPhone") || gc("Android")) ? 1E3 : 500;
return $O(a, b)
}
function $O(a, b) {
return aP(a, b) || bP(a, b) || cP(a, b)
}
function aP(a, b) {
var c = null;
y(a, function (a) {
var e = a.Ue,
g = a.ke;
e > b || g < b || !(null == c || c.Ue > e) || (c = a)
});
return c
}
function bP(a, b) {
var c = null;
y(a, function (a) {
var e = a.Ue,
g = a.ke;
g > b || (null == c || c.ke < g ? c = a : null != c && c.ke == g && c.Ue > e && (c = a))
});
return c
}
function cP(a, b) {
var c = null;
y(a, function (a) {
var e = a.Ue,
g = a.ke;
if (!(e < b))
if (null != c && c.Ue == e && c.ke < g) c = a;
else if (null == c || c.Ue > e) c = a
});
return c
};
function dP() {
U.call(this);
this.k = this.o = this.j = !1;
this.g = 0;
this.A = [];
this.B = !1
}
w(dP, U);
function eP(a, b) {
null == b || a.j || (a.b = b, a.C = !lc && !vc, a.D = lc || vc, a.j = !0, a.b instanceof U || a.C ? a.b.addEventListener("click", t(a.Zo, a), !1) : a.D ? (a.b.addEventListener("touchstart", t(a.bp, a), !1), a.b.addEventListener("touchmove", t(a.ap, a), !1), a.b.addEventListener("touchend", t(a.$o, a), !1)) : a.j = !1)
}
function fP(a) {
null != a.b && a.j && (a.C ? a.b.removeEventListener("click", t(a.Zo, a), !1) : a.D && (a.b.removeEventListener("touchstart", t(a.bp, a), !1), a.b.removeEventListener("touchmove", t(a.ap, a), !1), a.b.removeEventListener("touchend", t(a.$o, a), !1)), a.j = !1, a.o = !1, a.k = !1, a.g = 0, a.A = [], a.B = !1)
}
f = dP.prototype;
f.bp = function (a) {
this.o = !0;
this.g = a.touches.length;
this.B = gP(this, a.touches) || 1 != a.touches.length;
hP(this, a.touches)
};
f.ap = function (a) {
this.k = !0;
this.g = a.touches.length
};
f.$o = function (a) {
this.o && 1 == this.g && !this.k && !this.B && gP(this, a.changedTouches) && this.S(new T("click"));
this.g = a.touches.length;
0 == this.g && (this.k = this.o = !1)
};
f.Zo = function () {
this.S(new T("click"))
};
function hP(a, b) {
a.A = [];
y(b, function (a) {
nb(this.A, a.identifier)
}, a)
}
function gP(a, b) {
return gb(b, function (a) {
return C(this.A, a.identifier)
}, a)
}
f.J = function () {
fP(this);
dP.G.J.call(this)
};
function iP(a, b, c, d, e, g, h, k, l) {
this.j = a;
this.b = b;
isNaN(c) && isNaN(d) && isNaN(e) ? e = d = 0 : isNaN(d) && !isNaN(e) ? d = e : !isNaN(d) && isNaN(e) ? e = d : !isNaN(c) && isNaN(d) && isNaN(e) && (d = e = c);
this.Ue = d;
this.ke = e;
this.o = h;
this.g = k;
this.k = l
}
iP.prototype.getHeight = function () {
return this.o
};
function jP(a, b, c, d, e, g, h) {
this.b = a;
this.g = b;
this.j = c;
this.k = h;
this.o = d;
this.A = e;
this.rb = g
};
function kP() {
U.call(this)
}
w(kP, U);
var lP = {
xG: "beginFullscreen",
CLICK: "click",
CH: "end",
EH: "endFullscreen",
ERROR: "error",
AI: "mediaLoadTimeout",
PAUSE: "pause",
PLAY: "play",
zJ: "skip",
HJ: "start",
SJ: "timeUpdate",
qK: "volumeChange"
};
function mP(a) {
U.call(this);
this.b = a;
this.N = new pk(4);
this.C = this.M = 0;
this.H = this.j = this.B = !1;
this.size = this.Cm();
this.D = this.Yi();
this.O = 15E3;
this.F = !1
}
w(mP, kP);
f = mP.prototype;
f.Wr = function (a, b, c, d) {
a = fb(a, function (a) {
if (!d && x(a.g)) a = !1;
else {
var b = a.b;
"progressive" != a.j && "application/x-mpegurl" != ya(b).toLowerCase() ? a = !1 : (b = ya(b).toLowerCase(), a = xa(b) || kc && NO(LO, 2.3) && La(b, "application/ogg") ? !1 : kc && (La(b, "video/mp4") || La(b, "video/3gpp")) || (lc || vc) && (La(b, "application/x-mpegurl") || La(b, "application/vnd.apple.mpegurl")) ? !0 : !xa(this.b.canPlayType(b)))
}
return a
}, this);
return ZO(a, b, c)
};
f.Cs = function () {
return fb(Qb(YO), function (a) {
return !xa(this.b.canPlayType(a))
}, this)
};
f.Bl = function (a) {
this.O = 0 < a.rb ? a.rb : 15E3
};
f.wg = function (a) {
nP(this);
this.b.src = a;
this.b.load()
};
f.wn = function () {
return this.b.src
};
f.setVolume = function (a) {
this.b.volume = a
};
f.he = function () {
return this.b.volume
};
f.play = function () {
this.F = !1;
tk(this.b.play, 0, this.b);
this.L = tk(this.CB, this.O, this)
};
f.pause = function () {
this.F = !0;
this.b.pause()
};
f.lh = function () {
return this.b.paused ? lc || vc || Wg ? this.b.currentTime < this.b.duration : !0 : !1
};
f.Gi = function () {
return this.b.muted
};
f.$m = function () {
lc && this.b.webkitSupportsFullscreen && this.b.webkitDisplayingFullscreen && this.b.webkitExitFullscreen()
};
f.Yi = function () {
if (lc) return this.b.webkitSupportsFullscreen && this.b.webkitDisplayingFullscreen;
var a = window.screen.availWidth || window.screen.width,
b = window.screen.availHeight || window.screen.height,
c = ka(this.b.getBoundingClientRect) ? this.b.getBoundingClientRect() : {
width: this.b.offsetWidth,
height: this.b.offsetHeight
};
return c.width >= a && c.height >= b
};
f.Rg = function (a) {
var b;
t: {
for (b = this.N.Ta(); b.length;) {
var c = b.pop();
if (0 < c) {
b = c;
break t
}
}
b = -1
}
return b >= a
};
f.Bf = function (a) {
this.b.currentTime = a
};
f.getCurrentTime = function () {
return this.b.currentTime
};
f.yd = function () {
return isNaN(this.b.duration) ? -1 : this.b.duration
};
f.Le = function () {
return this.b.ended
};
f.Cm = function () {
return new G(this.b.offsetWidth, this.b.offsetHeight)
};
f.br = function () {
return this.b.seeking
};
f.J = function () {
this.vf();
this.b = null;
mP.G.J.call(this)
};
f.oi = function () {
this.vf();
this.g = new yk(this);
this.g.listen(this.b, "canplay", this.Ez);
this.g.listen(this.b, "ended", this.Bz);
this.g.listen(this.b, "webkitbeginfullscreen", this.Vl);
this.g.listen(this.b, "webkitendfullscreen", this.Iq);
this.g.listen(this.b, "pause", this.Cz);
this.g.listen(this.b, "playing", this.Gz);
this.g.listen(this.b, "timeupdate", this.Hz);
this.g.listen(this.b, "volumechange", this.Dz);
this.g.listen(this.b, "error", this.Hp);
this.o = new dP;
this.g.listen(this.o, "click", this.Az);
eP(this.o, this.b);
this.A = new rk(1E3);
this.g.listen(this.A, "tick", this.Fz);
this.A.start()
};
f.vf = function () {
null != this.o && (fP(this.o), this.o = null);
null != this.A && this.A.dispose();
null != this.g && (this.g.dispose(), this.g = null);
nP(this)
};
function nP(a) {
a.j = !1;
a.H = !1;
a.N.clear();
uk(a.L);
lh(a.k)
}
function oP(a) {
a.j || (a.j = !0, uk(a.L), a.S("start"), (!kc || kc && NO(LO, 3)) && (!lc || (lc || vc) && NO(KO, 4)) || a.Vl())
}
f.Ez = function () {
var a;
if (a = Xg) a = dc, a = !(null != a && Pa(a, "Samsung") && Pa(a, "SMART-TV"));
a && !this.H && (this.Bf(.001), this.H = !0)
};
f.Gz = function () {
this.S("play");
lc || vc || Vg || oP(this)
};
f.Hz = function () {
if (!this.j && (lc || vc || Vg)) {
if (0 >= this.getCurrentTime()) return;
if (Vg && this.Le() && 1 == this.yd()) {
this.Hp();
return
}
oP(this)
}
if (lc || vc) {
if (!this.B && 1.5 < this.getCurrentTime() - this.M) {
this.B = !0;
this.Bf(this.C);
return
}
this.M = this.getCurrentTime();
this.B = !1;
this.getCurrentTime() > this.C && (this.C = this.getCurrentTime())
}
this.N.add(this.b.currentTime);
this.S("timeUpdate")
};
f.Dz = function () {
this.S("volumeChange")
};
f.Cz = function () {
var a;
this.j && (lc || vc) && !this.F && 2 > pP(this) - this.b.currentTime ? (this.k = new rk(250), this.g.listen(this.k, "tick", this.Ux), this.k.start(), a = !0) : a = !1;
a || this.S("pause")
};
f.Bz = function () {
var a = !0;
(lc || vc) && (a = this.C >= this.b.duration - 1.5);
!this.B && a && this.S("end")
};
f.Vl = function () {
this.S("beginFullscreen")
};
f.Iq = function () {
this.S("endFullscreen")
};
f.Hp = function () {
uk(this.L);
this.S("error")
};
f.Az = function () {
this.S("click")
};
f.Fz = function () {
var a = this.Cm(),
b = this.Yi();
if (a.width != this.size.width || a.height != this.size.height)!this.D && b ? this.Vl() : this.D && !b && this.Iq(), this.D = b, this.size = a
};
f.CB = function () {
if (!this.j) {
try {
QO(PO.getInstance(), 16)
} catch (a) {}
nP(this);
this.S("mediaLoadTimeout")
}
};
f.Ux = function () {
if (this.Le() || !this.lh()) lh(this.k);
else {
var a = this.b.duration - this.b.currentTime,
b = pP(this) - this.b.currentTime;
0 < b && (2 <= b || 2 > a) && (lh(this.k), this.play())
}
};
function pP(a) {
for (var b = a.b.buffered.length - 1; 0 <= b;) {
if (a.b.buffered.start(b) <= a.b.currentTime) return a.b.buffered.end(b);
b--
}
return 0
};
var qP = new function () {
this.j = "always";
this.b = this.k = this.g = !1
};
function rP(a) {
null != a ? KN(FN, a) ? (a = a.match(/yt_vid\/([a-zA-Z0-9_-]{11})/), a = null != a && 1 < a.length ? a[1] : null) : a = null != a && KN(GN, a) ? sP(a) : null : a = null;
return a
}
function tP(a, b, c) {
if (null == a) return null;
c = new M((null != c ? c : "//www.youtube.com/") + "watch");
var d = c.b;
d.set("v", a);
d.set("feature", b ? "trueview-instream" : "instream");
zf(c, d);
return c.toString()
}
function sP(a) {
if (x(a)) return null;
var b = a.match(/^https?:\/\/[^\/]*youtu\.be\/([a-zA-Z0-9_-]+)$/);
if (null != b && 2 == b.length) return b[1];
b = a.match(/^https?:\/\/[^\/]*youtube.com\/video\/([a-zA-Z0-9_-]+)$/);
if (null != b && 2 == b.length) return b[1];
b = a.match(/^https?:\/\/[^\/]*youtube.com\/watch\/([a-zA-Z0-9_-]+)$/);
if (null != b && 2 == b.length) return b[1];
a = Mf(new M(a));
return Xf(a, "v") ? a.get("v").toString() : Xf(a, "video_id") ? a.get("video_id").toString() : null
};
function uP(a) {
U.call(this);
this.O = "ima-chromeless-video";
var b = null;
null != a && (r(a) ? this.O = a : b = a);
this.P = new yk(this);
this.o = null;
this.k = !1;
this.C = -1;
this.N = !1;
this.A = -1;
this.j = this.H = this.D = null;
this.M = "";
this.g = !1;
this.T = null != b;
this.F = this.L = this.V = null;
this.B = void 0;
null != b ? (this.g = !0, this.V = b, this.B = 2) : (a = t(this.Wx, this), vP ? a() : (wP.push(a), a = bd("script"), a.src = "//www.youtube.com/iframe_api", b = document.getElementsByTagName("script")[0], b.parentNode.insertBefore(a, b)))
}
w(uP, kP);
var xP = ["video/mp4", "video/webm"],
yP = {
el: "adunit",
controls: 0,
showinfo: 0,
html5: 1
},
wP = [],
vP = !1;
f = uP.prototype;
f.Wr = function (a, b, c) {
var d = B(a, function (a) {
return null !== rP(a.g)
});
return null !== d || !D(c) && (c = fb(c, function (a) {
return C(xP, a)
}), d = ZO(a, b, c), null !== d) ? d : B(a, function (a) {
return C(xP, a.b)
})
};
f.Bl = function (a) {
this.j = a
};
f.wg = function (a, b) {
null !== a && (this.M = a, this.g ? zP(this, a, b) : (this.D = a, this.H = b))
};
f.wn = function () {
return this.M
};
f.setVolume = function (a) {
this.T ? this.S("volumeChange") : this.g ? (a = Fb(100 * a, 0, 100), this.V.setVolume(a), this.A = -1, this.S("volumeChange")) : this.A = a
};
f.he = function () {
return this.g ? this.V.getVolume() / 100 : this.A
};
f.play = function () {
if (!x(this.M)) {
if (!this.k) {
AP(this);
var a = 15E3;
null != this.j && 0 < this.j.rb && (a = this.j.rb);
this.U = tk(this.pA, a, this)
}
this.g ? (this.N = !1, BP(this), this.o = new rk(100), this.P.listen(this.o, "tick", this.wr), this.o.start(), this.V.playVideo()) : this.N = !0
}
};
f.pause = function () {
this.g && this.k && (BP(this), this.V.pauseVideo())
};
f.lh = function () {
return this.g ? 2 == this.V.getPlayerState(this.B) : !1
};
f.Gi = function () {
return this.W ? this.V.isMuted() : 0 == this.he()
};
f.$m = function () {};
f.Yi = function () {
return !1
};
f.Rg = function (a) {
return this.g ? this.V.getCurrentTime(this.B) >= a : !1
};
f.Bf = function (a) {
this.g ? this.V.seekTo(a, !1) : this.C = a
};
f.getCurrentTime = function () {
return this.g ? this.V.getCurrentTime(this.B) : -1
};
f.yd = function () {
return this.g && this.k ? this.V.getDuration(this.B) : -1
};
f.Cs = function () {
return Qb(YO)
};
f.Le = function () {
return this.g ? 0 == this.V.getPlayerState(this.B) : !1
};
f.Cm = function () {
var a = document.getElementById(this.O);
return new G(a.offsetWidth, a.offsetHeight)
};
f.br = function () {
return !1
};
f.oi = function () {
this.L = t(this.Js, this);
this.F = t(this.Hn, this);
this.T && (this.V.addEventListener("onAdStateChange", this.F), this.V.addEventListener("onReady", this.L), this.V.addEventListener("onStateChange", this.F))
};
f.vf = function () {
this.T && (this.V.removeEventListener("onAdStateChange", this.F), this.V.removeEventListener("onReady", this.L), this.V.removeEventListener("onStateChange", this.F))
};
f.Wx = function () {
var a = this.O,
b = {
playerVars: Zb(yP),
events: {
onError: t(this.mD, this),
onReady: t(this.Js, this),
onAdStateChange: t(this.Hn, this),
onStateChange: t(this.Hn, this)
}
},
c = p("YT");
this.V = null != c && null != c.Player ? new c.Player(a, b) : null
};
function zP(a, b, c) {
var d = {};
if (null != a.j) {
var e = a.j.g;
null != e && (d.agcid = e);
e = a.j.b;
null != e && (d.adformat = e);
(e = a.j.j) && (d.cta_conversion_urls = e);
d.iv_load_policy = a.j.o ? 1 : 3;
a.j.k && (d.noiba = 1);
a.j.A && (d.utpsa = 1)
}
e = rP(b);
null === e ? d.url_encoded_third_party_media = "url=" + encodeURIComponent(b) + "&type=" + encodeURIComponent(null === c ? "" : c) : d.videoId = e;
a.k = !1;
a.V.cueVideoByPlayerVars(d)
}
f.mD = function () {
this.S("error")
};
f.Js = function () {
this.g = !0; - 1 != this.A && (this.setVolume(this.A), this.A = -1);
null != this.D && (zP(this, this.D, this.H), this.H = this.D = null); - 1 != this.C && (this.Bf(this.C), this.C = -1);
this.N && this.play()
};
f.Hn = function (a) {
switch (a.data) {
case 0:
this.k ? this.S("end") : this.S("error");
break;
case 1:
this.k || (AP(this), this.k = !0, this.S("start"));
this.S("play");
break;
case 2:
this.S("pause")
}
};
function BP(a) {
a.P.Ja(a.o, "tick", a.wr);
null != a.o && (a.o.stop(), a.o = null)
}
function AP(a) {
null != a.U && uk(a.U)
}
f.wr = function () {
this.S("timeUpdate")
};
f.pA = function () {
this.S("mediaLoadTimeout")
};
f.J = function () {
BP(this);
AP(this);
this.vf();
this.g = !1;
this.P.dispose();
this.C = -1;
this.H = null;
this.N = !1;
this.D = null;
this.A = -1;
this.L = this.V = this.j = null;
this.k = !1;
this.M = "";
uP.G.J.call(this)
};
ca("onYouTubeIframeAPIReady", function () {
vP = !0;
y(wP, function (a) {
a()
});
mb(wP)
}, window);
function CP(a, b) {
if (null == a || !nd(Oc(a), a)) throw CO($N, null, "containerElement", "element");
this.o = a;
this.g = this.b = null;
this.k = b;
this.j = null;
this.b = I("div", {
style: "display:none;"
});
this.g = I("video", {
style: "background-color:#000;position:absolute;width:100%;height:100%;"
});
this.j = I("div", {
style: "position:absolute;width:100%;height:100%;"
});
this.o.appendChild(this.b);
this.b.appendChild(this.g);
if (this.k) {
var c = I("div", {
id: this.k,
style: "display:none;background-color:#000;position:absolute;width:100%;height:100%;"
});
this.b.appendChild(c)
}
this.b.appendChild(this.j)
}
w(CP, jh);
CP.prototype.initialize = function () {
(lc || vc || kc) && this.g.load()
};
CP.prototype.dispose = function () {
hd(this.b)
};
CP.prototype.show = function () {
var a = this.b;
null != a && (a.style.display = "block")
};
CP.prototype.hide = function () {
var a = this.b;
null != a && (a.style.display = "none")
};
function DP(a) {
U.call(this);
this.b = a || Xa();
this.g = []
}
w(DP, U);
DP.prototype.j = !1;
DP.prototype.connect = function () {
for (this.j = !0; !D(this.g);) {
var a = this.g.shift();
this.sendMessage(a.name, a.type, a.data)
}
};
DP.prototype.send = function (a, b, c) {
this.j ? this.sendMessage(a, b, c) : this.g.push({
name: a,
type: b,
data: c
})
};
function EP(a, b, c, d, e) {
T.call(this, a);
this.kd = b;
this.bf = c;
this.Wq = d;
this.k = e
}
w(EP, T);
EP.prototype.getOrigin = function () {
return this.k
};
EP.prototype.toString = function () {
return ""
};
function FP(a, b) {
DP.call(this, b);
this.k = a;
this.Hc = null;
this.o = new yk(this);
this.logger = null;
this.o.listen(Yc(), "message", this.receive)
}
w(FP, DP);
function GP(a) {
if (null == a || !r(a) || 0 != a.lastIndexOf("ima://", 0)) return null;
a = a.substr(6);
try {
return Td(a)
} catch (b) {
return null
}
}
FP.prototype.sendMessage = function (a, b, c) {
null != this.Hc && null != this.Hc.postMessage && this.Hc.postMessage(HP(this, a, b, c), "*");
null != this.Hc && null == this.Hc.postMessage && QO(PO.getInstance(), 11)
};
FP.prototype.J = function () {
this.o.dispose();
FP.G.J.call(this)
};
FP.prototype.receive = function (a) {
a = a.b;
var b = GP(a.data);
if (null != b) {
if (null == this.Hc) this.Hc = a.source;
else if (this.Hc != a.source) return;
var c = b.channel;
null != c && c == this.k && (c = b.sid, null != c && ("*" != this.b && c != this.b || this.S(new EP(b.name, b.type, b.data || {}, b.sid, a.origin))))
}
};
function HP(a, b, c, d) {
var e = {};
e.name = b;
e.type = c;
null != d && (e.data = d);
e.sid = a.b;
e.channel = a.k;
return "ima://" + Vd(e)
};
function IP(a, b) {
U.call(this);
this.k = a;
this.j = b;
this.b = {};
this.g = new yk(this);
this.g.listen(Yc(), "message", this.o)
}
w(IP, U);
IP.prototype.send = function (a) {
var b = a.getChannelId();
this.b.hasOwnProperty(b) ? this.b[b].send(a.type, a.kd, a.bf) : a.getChannelId()
};
function JP(a, b, c, d) {
a.b.hasOwnProperty(b) || (c = new FP(b, c), a.g.listen(c, a.k, function (a) {
a = new KP(a.type, a.kd, a.bf, a.Wq, a.getOrigin(), b);
this.S(a)
}), c.Hc = d, c.connect(), a.b[b] = c)
}
IP.prototype.J = function () {
this.g.dispose();
nh(this.b);
IP.G.J.call(this)
};
IP.prototype.o = function (a) {
a = a.b;
var b = GP(a.data);
if (null != b) {
var c = b.channel;
if (this.j && !this.b.hasOwnProperty(c)) {
var d = b.sid;
JP(this, c, d, a.source);
this.S(new KP(b.name, b.type, b.data || {}, d, a.origin, c))
}
}
};
function KP(a, b, c, d, e, g) {
EP.call(this, a, b, c, d, e);
this.j = g
}
w(KP, EP);
KP.prototype.getChannelId = function () {
return this.j
};
function LP() {
var a = p("google.ima.gptProxyInstance", Yc());
if (null != a) return a;
yk.call(this);
this.k = new IP("gpt", !0);
this.listen(this.k, "gpt", this.A);
this.b = null;
MP() || Yc().top === Yc() || (this.b = new IP("gpt", !1), this.listen(this.b, "gpt", this.o))
}
w(LP, yk);
function MP() {
return !!p("googletag.cmd", Yc())
}
function NP() {
var a = p("googletag.console", Yc());
return null != a ? a : null
}
LP.prototype.A = function (a) {
var b = a.getOrigin(),
c = ff("//imasdk.googleapis.com"),
b = ff(b);
if (c[3] == b[3] && c[4] == b[4])
if (null != this.b) JP(this.b, a.getChannelId(), a.Wq, Yc().parent), null != this.b && this.b.send(a);
else if (c = a.bf, null != c && n(c.scope)) {
var b = c.scope,
c = c.args,
d;
if ("proxy" == b) c = a.kd, "isGptPresent" == c ? d = MP() : "isConsolePresent" == c && (d = null != NP());
else if (MP())
if ("pubads" == b || "companionAds" == b) {
d = a.kd;
var e, g = Yc().googletag;
if (null != g && null != g[b] && (g = g[b](), null != g && (d = g[d], null != d))) try {
e = d.apply(g,
c)
} catch (h) {}
d = e
} else if ("console" == b) {
if (g = a.kd, e = NP(), null != e && (g = e[g], null != g)) try {
g.apply(e, c)
} catch (k) {}
} else if (null === b) {
e = a.kd;
d = Yc();
if (C(["googleGetCompanionAdSlots", "googleSetCompanionAdContents"], e) && (e = d[e], null != e)) try {
g = e.apply(d, c)
} catch (l) {}
d = g
}
n(d) && (a.bf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment