Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Liverail Ad Manager - Unmin.
/*
LiveRail.AdManager
release 2.2.8
build 201511261816
*/
! function(a, b) {
a.getVPAIDAd = b()
}(this, function() {
var requirejs, require, define;
! function(a) {
function b(a, b) {
return r.call(a, b)
}
function c(a, b) {
var c, d, e, f, g, h, i, j, k, l, m, n = b && b.split("/"),
o = p.map,
q = o && o["*"] || {};
if (a && "." === a.charAt(0))
if (b) {
for (n = n.slice(0, n.length - 1), a = a.split("/"), g = a.length - 1, p.nodeIdCompat && t.test(a[g]) && (a[g] = a[g].replace(t, "")), a = n.concat(a), k = 0; k < a.length; k += 1)
if (m = a[k], "." === m) a.splice(k, 1), k -= 1;
else if (".." === m) {
if (1 === k && (".." === a[2] || ".." === a[0])) break;
k > 0 && (a.splice(k - 1, 2), k -= 2)
}
a = a.join("/")
} else 0 === a.indexOf("./") && (a = a.substring(2));
if ((n || q) && o) {
for (c = a.split("/"), k = c.length; k > 0; k -= 1) {
if (d = c.slice(0, k).join("/"), n)
for (l = n.length; l > 0; l -= 1)
if (e = o[n.slice(0, l).join("/")], e && (e = e[d])) {
f = e, h = k;
break
}
if (f) break;
!i && q && q[d] && (i = q[d], j = k)
}!f && i && (f = i, h = j), f && (c.splice(0, h, f), a = c.join("/"))
}
return a
}
function d(b, c) {
return function() {
return k.apply(a, s.call(arguments, 0).concat([b, c]))
}
}
function e(a) {
return function(b) {
return c(b, a)
}
}
function f(a) {
return function(b) {
n[a] = b
}
}
function g(c) {
if (b(o, c)) {
var d = o[c];
delete o[c], q[c] = !0, j.apply(a, d)
}
if (!b(n, c) && !b(q, c)) throw new Error("No " + c);
return n[c]
}
function h(a) {
var b, c = a ? a.indexOf("!") : -1;
return c > -1 && (b = a.substring(0, c), a = a.substring(c + 1, a.length)), [b, a]
}
function i(a) {
return function() {
return p && p.config && p.config[a] || {}
}
}
var j, k, l, m, n = {},
o = {},
p = {},
q = {},
r = Object.prototype.hasOwnProperty,
s = [].slice,
t = /\.js$/;
l = function(a, b) {
var d, f = h(a),
i = f[0];
return a = f[1], i && (i = c(i, b), d = g(i)), i ? a = d && d.normalize ? d.normalize(a, e(b)) : c(a, b) : (a = c(a, b), f = h(a), i = f[0], a = f[1], i && (d = g(i))), {
f: i ? i + "!" + a : a,
n: a,
pr: i,
p: d
}
}, m = {
require: function(a) {
return d(a)
},
exports: function(a) {
var b = n[a];
return "undefined" != typeof b ? b : n[a] = {}
},
module: function(a) {
return {
id: a,
uri: "",
exports: n[a],
config: i(a)
}
}
}, j = function(c, e, h, i) {
var j, k, p, r, s, t, u = [],
v = typeof h;
if (i = i || c, "undefined" === v || "function" === v) {
for (e = !e.length && h.length ? ["require", "exports", "module"] : e, s = 0; s < e.length; s += 1)
if (r = l(e[s], i), k = r.f, "require" === k) u[s] = m.require(c);
else if ("exports" === k) u[s] = m.exports(c), t = !0;
else if ("module" === k) j = u[s] = m.module(c);
else if (b(n, k) || b(o, k) || b(q, k)) u[s] = g(k);
else {
if (!r.p) throw new Error(c + " missing " + k);
r.p.load(r.n, d(i, !0), f(k), {}), u[s] = n[k]
}
p = h ? h.apply(n[c], u) : void 0, c && (j && j.exports !== a && j.exports !== n[c] ? n[c] = j.exports : p === a && t || (n[c] = p))
} else c && (n[c] = h)
}, requirejs = require = k = function(b, c, d, e, f) {
if ("string" == typeof b) return m[b] ? m[b](c) : g(l(b, c).f);
if (!b.splice) {
if (p = b, p.deps && k(p.deps, p.callback), !c) return;
c.splice ? (b = c, c = d, d = null) : b = a
}
return c = c || function() {}, "function" == typeof d && (d = e, e = f), e ? j(a, b, c, d) : setTimeout(function() {
j(a, b, c, d)
}, 4), k
}, k.config = function(a) {
return k(a)
}, requirejs._defined = n, define = function(a, c, d) {
c.splice || (d = c, c = []), b(n, a) || b(o, a) || (o[a] = [a, c, d])
}, define.amd = {
jQuery: !0
}
}(), define("../../lib/almond", function() {}), define("Handshake", ["require", "exports"], function() {
var a;
return function(a) {
function b() {
var a, b, d, e = this;
if ("function" == typeof window.postMessage) {
for (("https:" === window.location.protocol || "http:" !== window.location.protocol && window.parent && "https:" === window.parent.location.protocol) && (b = !0), a = (b ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/js/handshake.html", h = "", d = 0; 50 > d; d += 1) h += Math.random().toString(36).substr(2, 5);
i = document.createElement("iframe"), i.style.display = "none", i.src = a, document.body.appendChild(i), i.onload = function() {
i.contentWindow && i.contentWindow.postMessage ? i.contentWindow.postMessage(h, a) : i && i.parentNode === document.body && document.body.removeChild(i)
}, window.addEventListener ? window.addEventListener("message", function(a) {
var b = a.origin,
d = a.data;
c.apply(e, [b, d])
}, !1) : window.attachEvent && window.attachEvent("onmessage", function(a) {
a || (a = window.event);
var b = a.origin,
d = a.data;
c.apply(e, [b, d])
})
}
}
function c(a, b) {
var c, e, f;
if (a.match(/^https?:\/\/cdn-static(-secure)?\.liverail\.com/) && b && "string" == typeof b && "lrHandshakeResponse=" === b.substr(0, 20)) {
for (c = b.substr(20), e = "", f = 0; f < c.length; f += 1) e += String.fromCharCode(c.charCodeAt(f) - h.charCodeAt(f));
i && i.parentNode === document.body && (document.body.removeChild(i), delete i), d(e.split("&"))
}
}
function d(b) {
var c, d;
for (a.handshakeResponse = {
debug: 0,
debugIdFilter: "",
inspector: !1
}, c = 0; c < b.length; c += 1) switch (d = b[c].split("="), d[0]) {
case "debug":
a.handshakeResponse.debug = parseInt(d[1], 10);
break;
case "debugIdFilter":
a.handshakeResponse.debugIdFilter = decodeURIComponent(d[1]);
break;
case "inspector":
a.handshakeResponse.inspector = "true" === d[1]
}
k = !0, e()
}
function e() {
var a;
for (a = 0; a < l.length; a += 1) l[a]();
l = []
}
function f(a) {
return "undefined" == typeof a && (a = window), a.location.href && "about:blank" !== a.location.href ? a : a.parent
}
function g(a) {
if ("undefined" == typeof a && (a = null), "function" == typeof a && l.push(a), k) e();
else if (!j) {
j = !0;
var c = f().location.href;
c.match(/^https?:\/\/[A-Za-z0-9.\-_]+\.liverail\.com/) ? d(document.cookie.split("; ")) : b()
}
}
a.handshakeResponse = {};
var h, i, j, k, l = [];
a.check = g
}(a || (a = {})), a
}), ! function() {
var a = function() {
var b = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g,
c = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
d = /[^-+\dA-Z]/g,
e = function(a, b) {
for (a = String(a), b = b || 2; a.length < b;) a = "0" + a;
return a
},
f = function(a) {
var b = new Date(a.getFullYear(), a.getMonth(), a.getDate());
b.setDate(b.getDate() - (b.getDay() + 6) % 7 + 3);
var c = new Date(b.getFullYear(), 0, 4);
c.setDate(c.getDate() - (c.getDay() + 6) % 7 + 3);
var d = b.getTimezoneOffset() - c.getTimezoneOffset();
b.setHours(b.getHours() - d);
var e = (b - c) / 6048e5;
return 1 + Math.floor(e)
},
g = function(a) {
var b = a.getDay();
return 0 === b && (b = 7), b
};
return function(h, i, j, k) {
var l = a;
if (1 != arguments.length || "[object String]" != Object.prototype.toString.call(h) || /\d/.test(h) || (i = h, h = void 0), h = h || new Date, h instanceof Date || (h = new Date(h)), isNaN(h)) throw TypeError("Invalid date");
i = String(l.masks[i] || i || l.masks["default"]);
var m = i.slice(0, 4);
("UTC:" == m || "GMT:" == m) && (i = i.slice(4), j = !0, "GMT:" == m && (k = !0));
var n = j ? "getUTC" : "get",
o = h[n + "Date"](),
p = h[n + "Day"](),
q = h[n + "Month"](),
r = h[n + "FullYear"](),
s = h[n + "Hours"](),
t = h[n + "Minutes"](),
u = h[n + "Seconds"](),
v = h[n + "Milliseconds"](),
w = j ? 0 : h.getTimezoneOffset(),
x = f(h),
y = g(h),
z = {
d: o,
dd: e(o),
ddd: l.i18n.dayNames[p],
dddd: l.i18n.dayNames[p + 7],
m: q + 1,
mm: e(q + 1),
mmm: l.i18n.monthNames[q],
mmmm: l.i18n.monthNames[q + 12],
yy: String(r).slice(2),
yyyy: r,
h: s % 12 || 12,
hh: e(s % 12 || 12),
H: s,
HH: e(s),
M: t,
MM: e(t),
s: u,
ss: e(u),
l: e(v, 3),
L: e(Math.round(v / 10)),
t: 12 > s ? "a" : "p",
tt: 12 > s ? "am" : "pm",
T: 12 > s ? "A" : "P",
TT: 12 > s ? "AM" : "PM",
Z: k ? "GMT" : j ? "UTC" : (String(h).match(c) || [""]).pop().replace(d, ""),
o: (w > 0 ? "-" : "+") + e(100 * Math.floor(Math.abs(w) / 60) + Math.abs(w) % 60, 4),
S: ["th", "st", "nd", "rd"][o % 10 > 3 ? 0 : (o % 100 - o % 10 != 10) * o % 10],
W: x,
N: y
};
return i.replace(b, function(a) {
return a in z ? z[a] : a.slice(1, a.length - 1)
})
}
}();
a.masks = {
"default": "ddd mmm dd yyyy HH:MM:ss",
shortDate: "m/d/yy",
mediumDate: "mmm d, yyyy",
longDate: "mmmm d, yyyy",
fullDate: "dddd, mmmm d, yyyy",
shortTime: "h:MM TT",
mediumTime: "h:MM:ss TT",
longTime: "h:MM:ss TT Z",
isoDate: "yyyy-mm-dd",
isoTime: "HH:MM:ss",
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
expiresHeaderFormat: "ddd, dd mmm yyyy HH:MM:ss Z"
}, a.i18n = {
dayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, "undefined" != typeof exports ? module.exports = a : "undefined" != typeof define && define("DateFormat", [], function() {
return a
})
}(), define("MessageData", ["require", "exports"], function() {
var a = function() {
function a(a, b, c, d) {
this.timestamp = new Date, this.priority = a, this.method = b, this.contextName = c, this.args = d
}
return a
}();
return a
}), define("Logger", ["require", "exports", "Handshake", "DateFormat", "MessageData"], function(a, b, c, d, e) {
var f = function() {
function a(a) {
this.contextName = "", this.contextName = a || ""
}
return a.getDebugLevel = function() {
return null !== a.currentDebugLevelOverride ? a.currentDebugLevelOverride : c.handshakeResponse.debug
}, a.setDebugLevelOverride = function(b) {
a.currentDebugLevelOverride = Math.max(0, Math.min(3, b))
}, a.clearDebugLevelOverride = function() {
a.currentDebugLevelOverride = null
}, a.getDebugIdFilter = function() {
return c.handshakeResponse.debugIdFilter
}, a.dormant = function() {
return "object" != typeof console ? !0 : Function && Function.prototype && Function.prototype.bind ? !1 : !0
}, a.handleMessage = function(b) {
return a.dormant() || 0 === a.getDebugLevel() ? void 0 : void 0 === a.getDebugLevel() ? (a.messageQueue.push(b), void(a.handshakeInitiated || (a.handshakeInitiated = !0, c.check(a.flushMessageQueue)))) : void a.outputMessage(b)
}, a.flushMessageQueue = function() {
for (a.getDebugLevel() > 0 && a.getDebugIdFilter() && console.warn('Debug ID Filter set to "' + a.getDebugIdFilter() + '"'); a.messageQueue.length > 0;) a.outputMessage(a.messageQueue.shift())
}, a.outputMessage = function(b) {
if (!(b.priority > a.getDebugLevel()) && b.contextName.match(new RegExp(a.getDebugIdFilter()))) {
var c = "LIVERAIL [" + d(b.timestamp, "HH:MM:ss.l") + "]";
b.contextName && (c += "[" + b.contextName + "]");
var e = [c].concat(b.args);
Function.prototype.bind.call(b.method, console).apply(this, e)
}
}, a.prototype.log = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.log, this.contextName, b))
}, a.prototype.info = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.info, this.contextName, b))
}, a.prototype.warn = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.warn, this.contextName, b))
}, a.prototype.error = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.error, this.contextName, b))
}, a.prototype.debug = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(2, console.log, this.contextName, b))
}, a.prototype.verbose = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(3, console.log, this.contextName, b))
}, a.currentDebugLevelOverride = null, a.messageQueue = [], a
}();
return f
}), define("Utils", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.returnString = function(a, b) {
var c = b || "",
d = "" + a;
return "undefined" !== d && "null" !== d && "NaN" !== d && (c = d), c
}, a.returnFloat = function(a, b) {
var c = void 0 !== b ? b : NaN,
d = parseFloat(a);
return isNaN(d) || (c = d), c
}, a.returnInt = function(a, b) {
var c = void 0 !== b ? b : NaN,
d = parseInt(a, 10);
return isNaN(d) || (c = d), c
}, a.returnUnsignedInt = function(a, b) {
return Math.max(this.returnInt(a, b), 0)
}, a.returnBoolean = function(a, b) {
var c = b || !1;
return "boolean" == typeof a && (c = a), null === a && (c = !1), void 0 !== a && "string" != typeof a && (a = a.toString().toLowerCase()), ("true" === a || "1" === a || "yes" === a) && (c = !0), ("false" === a || "0" === a || "no" === a) && (c = !1), c
}, a.serialize = function(a) {
var b, c, d = [];
for (b in a)
if (a.hasOwnProperty(b))
if (Array.isArray(a[b]))
for (c = 0; c < a[b].length; c += 1) d.push(encodeURIComponent(b) + "[]=" + encodeURIComponent(a[b][c]));
else d.push(encodeURIComponent(b) + "=" + encodeURIComponent(a[b]));
return d.join("&")
}, a.retrieveCallingURL = function(a) {
for (var b = "", c = document.getElementsByTagName("script"), d = 0; d < c.length; d += 1)
if (-1 !== c[d].src.indexOf(a)) {
b = c[d].src;
break
}
return b
}, a.parseQueryString = function(a) {
var b, c, d = {},
e = a;
e.indexOf("?") > 0 && (e = e.slice(e.indexOf("?") + 1)), b = e.split("&");
for (var f = 0; f < b.length; f += 1)
if (b[f].length > 0 && (c = b[f].split("="), c[0] !== a && c[0].length > 0))
if (1 === c.length) d[c[0]] = null;
else if (2 === c.length) d[c[0]] = decodeURIComponent(c[1]);
else {
d[c[0]] = "";
for (var g = 1; g < c.length; g += 1) d[c[0]] += decodeURIComponent(c[g]), g < c.length - 1 && (d[c[0]] += "=")
}
return d
}, a.detectFlash = function() {
var a, b, c = !1;
try {
if (window.navigator && window.navigator.plugins && window.navigator.plugins.length > 0) window.navigator.mimeTypes && (a = window.navigator.mimeTypes["application/x-shockwave-flash"], a && a.enabledPlugin && a.enabledPlugin.description && (c = !0));
else if (void 0 !== ActiveXObject) {
try {
b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
} catch (d) {
b = {
activeXError: !0
}
}
b.activeXError || (c = !0)
}
} catch (e) {}
return c
}, a.detectHTML5 = function() {
return !!document.createElement("video").canPlayType
}, a.stringifyParameterObject = function(a) {
var b, c = 0,
d = "";
for (b in a) a.hasOwnProperty(b) && (c > 0 && (d += "&"), d += encodeURIComponent(b) + "=" + encodeURIComponent(a[b]), c += 1);
return d
}, a.base64encode = function(a) {
if (btoa) return btoa(a);
var b, c, d, e, f, g, h;
for (b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = a.length, d = 0, c = ""; e > d;) {
if (f = 255 & a.charCodeAt(d++), d === e) {
c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4), c += "==";
break
}
if (g = a.charCodeAt(d++), d === e) {
c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4 | (240 & g) >> 4), c += b.charAt((15 & g) << 2), c += "=";
break
}
h = a.charCodeAt(d++), c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4 | (240 & g) >> 4), c += b.charAt((15 & g) << 2 | (192 & h) >> 6), c += b.charAt(63 & h)
}
return c
}, a.detectDevice = function(a) {
var b = 0;
try {
var c = navigator.userAgent.toLowerCase();
switch (a) {
case "android":
c.indexOf("android") > -1 && (b = parseFloat(c.match(/android ([\.0-9]+)/)[1]));
break;
case "msie":
c.indexOf("msie") > -1 && (b = parseFloat(c.match(/msie ([\.0-9]+)/)[1]));
break;
case "ios":
c.match(/(iphone|ipod|ipad)/) && (b = parseFloat(c.match(/os ([0-9]+(_[0-9]+)?)/)[1].replace("_", ".")));
break;
case "phone":
c.match(/(iphone|ipod)/) && (b = parseFloat(c.match(/os ([0-9]+(_[0-9]+)?)/)[1].replace("_", ".")))
}
} catch (d) {}
return b
}, a.isFunction = function(a) {
return !!(a && a.constructor && a.call && a.apply)
}, a.genUniqueId = function() {
var a, b, c = window.performance,
d = ["now", "webkitNow", "msNow", "mozNow"];
if (c)
for (var e = 0; e < d.length; e += 1)
if (c[d[e]]) {
b = d[e];
break
}
return b && (a = function() {
return c[b]()
}), (a = a || Date.now || function() {
return (new Date).getTime()
})()
}, a.checkWindowSanity = function() {
return window && window.parent && !!Object
}, a.addElement = function(a) {
var b, c, d, e, f;
if (c = a.target, e = a.before, void 0 === c && (c = document.body), "string" == typeof c && (c = document.getElementById(a.target)), "string" == typeof e && (e = document.getElementById(a.before)), "object" == typeof c) {
if (d = "div", "string" == typeof a.type && (d = a.type), b = document.createElement(d), "string" == typeof a.html && (b.innerHTML = a.html), "object" == typeof a.attributes)
for (f in a.attributes) a.attributes.hasOwnProperty(f) && b.setAttribute(f, a.attributes[f]);
if ("object" == typeof a.events)
for (f in a.events) a.events.hasOwnProperty(f) && b.addEventListener(f, a.events[f]);
if ("function" == typeof a.onload && (b.onload = a.onload), "string" == typeof a.className && (b.className = a.className), "object" == typeof a.styles)
for (f in a.styles) a.styles.hasOwnProperty(f) && b.style.setProperty && b.style.setProperty(f, a.styles[f], "important");
return "object" == typeof e ? c.insertBefore(b, e) : c.appendChild(b), b
}
return null
}, a.videoElementIsFullscreen = function(a) {
var b = a;
if (b.fullscreenEnabled || b.fullScreen || b.webkitIsFullScreen || b.mozFullScreen || b.msFullscreenEnabled) {
var c = b.fullscreenElement || b.webkitFullscreenElement || b.mozFullScreenElement || b.msFullscreenElement;
if (c && "video" === c.tagName.toLowerCase()) return !0
}
return !1
}, a.addDocumentFullscreenEventListener = function(a, b, c) {
"undefined" == typeof c && (c = !1), a.addEventListener("fullscreenchange", b, c), a.addEventListener("webkitfullscreenchange", b, c), a.addEventListener("mozfullscreenchange", b, c), a.addEventListener("MSFullscreenChange", b, c)
}, a.removeDocumentFullscreenEventListener = function(a, b, c) {
"undefined" == typeof c && (c = !1), a.removeEventListener("fullscreenchange", b, c), a.removeEventListener("webkitfullscreenchange", b, c), a.removeEventListener("mozfullscreenchange", b, c), a.removeEventListener("MSFullscreenChange", b, c)
}, a
}();
return c
}), define("InstanceData", ["require", "exports", "Utils"], function(a, b, c) {
var d = function() {
function a() {
this.defaultAdLinear = !0, this.disableIframes = !1, this.debugLevel = null, this.processInstanceData()
}
return a.prototype.getCallingURL = function() {
return this.callingURL
}, a.prototype.getQueryStringParameters = function() {
return this.queryStringParameters
}, a.prototype.getDefaultAdLinear = function() {
return this.defaultAdLinear
}, a.prototype.getDisableIframes = function() {
return this.disableIframes
}, a.prototype.getDebugLevel = function() {
return this.debugLevel
}, a.prototype.processInstanceData = function() {
this.callingURL = c.retrieveCallingURL("LiveRail.AdManager"), this.queryStringParameters = c.parseQueryString(this.callingURL);
for (var a in this.queryStringParameters)
if (this.queryStringParameters.hasOwnProperty(a)) {
var b = this.queryStringParameters[a];
switch (a.toUpperCase()) {
case "DISABLEIFRAMES":
this.disableIframes = c.returnBoolean(b, this.disableIframes);
break;
case "LR_DEBUG":
var d = c.returnUnsignedInt(b);
isNaN(d) || (this.debugLevel = d);
break;
case "ADLINEAR":
this.defaultAdLinear = c.returnBoolean(b, this.defaultAdLinear)
}
}
}, a
}();
return d
}), define("EventSubscription", ["require", "exports"], function() {
var a = function() {
function a(a, b) {
this.fn = a, this.listenerScope = b
}
return a
}();
return a
}), define("EventManager", ["require", "exports", "EventSubscription"], function(a, b, c) {
var d = function() {
function a(a) {
var b = this;
this.eventHandlerStore = {}, this.handlerDictionary = {}, this.eventDictionary = {}, this.onEventListenerObjectPropertyChange = function(a) {
b.validateEvent(a.propertyName) && b.handlerDictionary.hasOwnProperty(a.propertyName) && b.handlerDictionary[a.propertyName].apply(b.listenerScope, b.args)
}, this.validEvents = a, this.eventListenerObject = document.createElement("div"), this.eventListenerObject.addEventListener || (this.eventListenerObject.style.display = "none", this.eventListenerObject.attachEvent("onpropertychange", this.onEventListenerObjectPropertyChange), document.body.appendChild(this.eventListenerObject))
}
return a.prototype.subscribe = function(b, d, e) {
!this.validateEvent(d) || "function" != typeof b || "object" != typeof e && void 0 !== e || (this.eventDictionary.hasOwnProperty(d) || (this.eventDictionary[d] = this.createCustomEvent(d)), this.eventHandlerStore.hasOwnProperty(d) || (this.eventHandlerStore[d] = []), -1 === a.findSubscriptionIndex(b, this.eventHandlerStore[d]) && this.eventHandlerStore[d].push(new c(b, e)))
}, a.prototype.unsubscribe = function(b, c) {
if (this.validateEvent(c) && this.eventHandlerStore.hasOwnProperty(c)) {
var d = a.findSubscriptionIndex(b, this.eventHandlerStore[c]);
d >= 0 && this.eventHandlerStore[c].splice(d, 1)
}
}, a.prototype.dispatch = function(a, b) {
if ("undefined" == typeof b && (b = []), this.validateEvent(a) && this.eventHandlerStore.hasOwnProperty(a))
for (var c = 0; c < this.eventHandlerStore[a].length; c++) this.eventHandlerStore[a][c], this.dispatchSubscription(a, this.eventHandlerStore[a][c], b)
}, a.prototype.createCustomEvent = function(a) {
var b = this;
if (this.eventListenerObject.addEventListener) {
this.eventListenerObject.addEventListener(a, function() {
b.handlerDictionary[a].apply(b.listenerScope, b.args)
}, !1);
var c = document.createEvent("UIEvents");
c.initEvent(a, !1, !1)
} else this.eventListenerObject.attachEvent && (this.eventListenerObject[a] = 0);
return c
}, a.prototype.validateEvent = function(a) {
return "string" == typeof a && (!this.validEvents || this.validEvents.hasOwnProperty(a))
}, a.findSubscriptionIndex = function(a, b) {
for (var c = -1, d = 0; d < b.length; d += 1)
if (b[d].fn === a) {
c = d;
break
}
return c
}, a.prototype.dispatchSubscription = function(a, b, c) {
this.handlerDictionary[a] = b.fn, this.listenerScope = b.listenerScope || {}, this.args = c, this.eventListenerObject.addEventListener ? this.eventListenerObject.dispatchEvent(this.eventDictionary[a]) : this.eventListenerObject.attachEvent && (this.eventListenerObject[a] += 1)
}, a
}();
return d
}), define("VPAIDEvents", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.AdLoaded = "AdLoaded", a.AdStarted = "AdStarted", a.AdStopped = "AdStopped", a.AdSkipped = "AdSkipped", a.AdSkippableStateChange = "AdSkippableStateChange", a.AdSizeChange = "AdSizeChange", a.AdLinearChange = "AdLinearChange", a.AdDurationChange = "AdDurationChange", a.AdExpandedChange = "AdExpandedChange", a.AdVolumeChange = "AdVolumeChange", a.AdImpression = "AdImpression", a.AdVideoStart = "AdVideoStart", a.AdVideoFirstQuartile = "AdVideoFirstQuartile", a.AdVideoMidpoint = "AdVideoMidpoint", a.AdVideoThirdQuartile = "AdVideoThirdQuartile", a.AdVideoComplete = "AdVideoComplete", a.AdClickThru = "AdClickThru", a.AdInteraction = "AdInteraction", a.AdUserAcceptInvitation = "AdUserAcceptInvitation", a.AdUserMinimize = "AdUserMinimize", a.AdUserClose = "AdUserClose", a.AdPaused = "AdPaused", a.AdPlaying = "AdPlaying", a.AdLog = "AdLog", a.AdError = "AdError", a
}();
return c
}), define("Adapter", ["require", "exports", "EventManager", "Logger", "VPAIDEvents"], function(a, b, c, d, e) {
var f = function() {
function a(a, b) {
this.adapterConfiguration = null, this.eventManager = new c(e), this.adLinear = !0, this.logger = new d(a), this.destroy(), b && b(this)
}
return a.prototype.getAdLinear = function() {
return this.adLinear
}, a.prototype.getAdWidth = function() {
return this.adWidth
}, a.prototype.getAdHeight = function() {
return this.adHeight
}, a.prototype.getAdExpanded = function() {
return this.adExpanded
}, a.prototype.getAdSkippableState = function() {
return !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return -2
}, a.prototype.getAdRemainingTime = function() {
return -2
}, a.prototype.getAdDuration = function() {
return this.adDuration
}, a.prototype.getAdVolume = function() {
return this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.onAdVolumeChange()
}, a.prototype.getAdCompanions = function() {
return this.adCompanions
}, a.prototype.getAdIcons = function() {
return this.adIcons
}, a.prototype.isPaused = function() {
return !1
}, a.prototype.getAdapterConfiguration = function() {
return this.adapterConfiguration
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, d, e, f) {
this.adapterConfiguration = f.adapterConfiguration
}, a.prototype.resizeAd = function(a, b, c) {}, a.prototype.startAd = function() {}, a.prototype.stopAd = function() {}, a.prototype.pauseAd = function() {}, a.prototype.resumeAd = function() {}, a.prototype.expandAd = function() {}, a.prototype.collapseAd = function() {}, a.prototype.skipAd = function() {}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.onAdLoaded = function() {
this.onEvent(e.AdLoaded)
}, a.prototype.onAdStarted = function() {
this.onEvent(e.AdStarted)
}, a.prototype.onAdStopped = function() {
this.destroy(), this.onEvent(e.AdStopped)
}, a.prototype.onAdSkipped = function() {
this.onEvent(e.AdSkipped)
}, a.prototype.onAdSkippableStateChange = function() {
this.onEvent(e.AdSkippableStateChange)
}, a.prototype.onAdSizeChange = function() {
this.onEvent(e.AdSizeChange)
}, a.prototype.onAdLinearChange = function() {
this.onEvent(e.AdLinearChange)
}, a.prototype.onAdDurationChange = function() {
this.onEvent(e.AdDurationChange)
}, a.prototype.onAdExpandedChange = function() {
this.onEvent(e.AdExpandedChange)
}, a.prototype.onAdVolumeChange = function() {
this.onEvent(e.AdVolumeChange)
}, a.prototype.onAdImpression = function() {
this.onEvent(e.AdImpression)
}, a.prototype.onAdVideoStart = function() {
this.onEvent(e.AdVideoStart)
}, a.prototype.onAdVideoFirstQuartile = function() {
this.onEvent(e.AdVideoFirstQuartile)
}, a.prototype.onAdVideoMidpoint = function() {
this.onEvent(e.AdVideoMidpoint)
}, a.prototype.onAdVideoThirdQuartile = function() {
this.onEvent(e.AdVideoThirdQuartile)
}, a.prototype.onAdVideoComplete = function() {
this.onEvent(e.AdVideoComplete)
}, a.prototype.onAdClickThru = function(a, b, c) {
this.onEvent(e.AdClickThru, [a, b, c])
}, a.prototype.onAdInteraction = function() {
this.onEvent(e.AdInteraction)
}, a.prototype.onAdUserAcceptInvitation = function() {
this.onEvent(e.AdUserAcceptInvitation)
}, a.prototype.onAdUserMinimize = function() {
this.onEvent(e.AdUserMinimize)
}, a.prototype.onAdUserClose = function() {
this.onEvent(e.AdUserClose)
}, a.prototype.onAdPaused = function() {
this.onEvent(e.AdPaused)
}, a.prototype.onAdPlaying = function() {
this.onEvent(e.AdPlaying)
}, a.prototype.onAdLog = function(a) {
this.onEvent(e.AdLog, [a])
}, a.prototype.onAdError = function(a, b) {
"undefined" == typeof b && (b = {}), this.destroy(), this.onEvent(e.AdError, [a, b])
}, a.prototype.onEvent = function(a, b) {
"undefined" == typeof b && (b = []), this.eventManager.dispatch(a, b)
}, a.prototype.destroy = function() {
this.adWidth = 0, this.adHeight = 0, this.adExpanded = !1, this.adDuration = -2, this.adVolume = 1, this.adCompanions = "", this.adIcons = !1
}, a.prototype.supports = function(a) {
return !1
}, a
}();
return f
}), define("Tracker", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
this.urls = [], this.type = a;
var c = parseFloat(b);
isNaN(c) || (this.value = c)
}
return a.formTrackerKey = function(a, b) {
return a + ("number" == typeof b ? b.toString() : "")
}, a.prototype.getType = function() {
return this.type
}, a.prototype.getValue = function() {
return this.value
}, a.prototype.addUrl = function(a) {
a && this.urls.push(a)
}, a.prototype.getUrls = function() {
return this.urls
}, a
}();
return c
}), define("AdCandidate", ["require", "exports", "Tracker"], function(a, b, c) {
var d = function() {
function a() {
this.clickThruUrl = "", this.impressionRegistered = !1, this.linearCreative = null, this.nonLinearCreative = null, this.thirdPartyData = {}, this.trackers = {}, this.companionAds = [], this.adExtensions = [], this.loadTime = 0, this.startTime = 0, this.stopTime = 0, this.maxCreativeDuration = 0
}
return a.prototype.hasValidClickthruUrl = function() {
return this.clickThruUrl.trim().length > 0
}, a.prototype.getLinearCreative = function() {
return this.linearCreative
}, a.prototype.setLinearCreative = function(a) {
this.linearCreative = a
}, a.prototype.getNonLinearCreative = function() {
return this.nonLinearCreative
}, a.prototype.setNonLinearCreative = function(a) {
this.nonLinearCreative = a
}, a.prototype.getThirdPartyData = function(a) {
return this.thirdPartyData[a]
}, a.prototype.setThirdPartyData = function(a, b) {
this.thirdPartyData[a] = b
}, a.prototype.addTracker = function(a) {
if (null !== a) {
var b = c.formTrackerKey(a.getType(), a.getValue());
this.trackers[b] || (this.trackers[b] = []), this.trackers[b].push(a)
}
}, a.prototype.getTrackers = function(a, b) {
var d = c.formTrackerKey(a, b);
return this.trackers[d] || []
}, a.prototype.addCompanionAd = function(a) {
this.companionAds.push(a)
}, a.prototype.getCompanionAds = function() {
return this.companionAds
}, a.prototype.addAdExtension = function(a) {
this.adExtensions.push(a)
}, a.prototype.getAdExtensions = function() {
return this.adExtensions
}, a.prototype.registerLoad = function() {
0 === this.loadTime && (this.loadTime = Date.now())
}, a.prototype.getLoadClock = function() {
return this.loadTime > 0 ? Date.now() - this.loadTime : 0
}, a.prototype.registerImpression = function() {
0 === this.startTime && (this.startTime = Date.now()), this.impressionRegistered = !0
}, a.prototype.hadImpression = function() {
return this.impressionRegistered
}, a.prototype.registerComplete = function() {
this.hadImpression() && 0 === this.stopTime && (this.stopTime = Date.now())
}, a.prototype.updateCreativeDuration = function(a) {
a > this.maxCreativeDuration && (this.maxCreativeDuration = a)
}, a.prototype.getDuration = function() {
var a = 0;
return this.hadImpression() && (a = this.maxCreativeDuration ? this.maxCreativeDuration : this.linearCreative ? this.linearCreative.getDuration() : this.getElapsedRealtime()), Math.max(0, a)
}, a.prototype.getElapsedRealtime = function() {
return Math.max(0, this.stopTime - this.startTime)
}, a.TYPE_LINEAR = "in", a.TYPE_OVERLAY = "ov", a
}();
return d
}), define("RendererEvents", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.Loaded = "Loaded", a.Impression = "Impression", a.Error = "Error", a
}();
return c
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LinearRendererEvents", ["require", "exports", "RendererEvents"], function(a, b, c) {
var d = function(a) {
function b() {
a.apply(this, arguments)
}
return __extends(b, a), b.Progress = "Progress", b.Ended = "Ended", b.Paused = "Paused", b.Resumed = "Resumed", b.VolumeChange = "VolumeChange", b
}(c);
return d
}), define("LogEvent", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c) {
"undefined" == typeof c && (c = {}), this.id = a, this.message = b, this.detail = c || {}
}
return a.eventWithType = function(b, c, d) {
return "undefined" == typeof c && (c = {}), "undefined" == typeof d && (d = null), new a(b.id, d || b.message, c)
}, a.prototype.description = function() {
var a = this,
b = "";
return Object.keys(this.detail).forEach(function(c) {
b += 0 === b.length ? " " : " ,", b += c + "=" + a.detail[c]
}), "(" + this.id + ") " + this.message + b
}, a
}();
return c
}), define("LogEventType", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.CreativeGeneralError = {
id: 400,
message: "General creative error"
}, a.CreativeFileNotFound = {
id: 401,
message: "Creative file not found"
}, a.CreativeFileTimeout = {
id: 402,
message: "Creative timed out"
}, a.CreativeFileUnsupported = {
id: 405,
message: "Problem displaying creative file"
}, a.CreativeComponentError = {
id: 901,
message: "Ad component emitted error event"
}, a.NoFill = {
id: 1001,
message: "No fill"
}, a.InvalidPlacement = {
id: 1003,
message: "Ad was loaded with no valid placement defined"
}, a.NoAvailableEnvironment = {
id: 1020,
message: "No available environment"
}, a.StartAdBeforeInitAd = {
id: 1021,
message: "initAd must be called before startAd"
}, a.InvalidSlotElement = {
id: 1022,
message: "environmentVars.slot is not a valid DOM element"
}, a.InvalidVideoElement = {
id: 1023,
message: "No valid video element"
}, a.UnsupportedDevice = {
id: 1024,
message: "Unsupported device"
}, a.UndefinedEnvironmentVars = {
id: 1025,
message: "environmentVars is not defined"
}, a.AdSourcesRequestFailed = {
id: 1101,
message: "LiveRail request for ad-sources failed"
}, a.AdSourcesRequestTimeout = {
id: 1102,
message: "LiveRail request for ad-sources timed out"
}, a.AdsRequestFailed = {
id: 1111,
message: "LiveRail request for ads failed"
}, a.AdsRequestTimeout = {
id: 1112,
message: "LiveRail request for ads timed out"
}, a.XMLParseFailure = {
id: 1201,
message: "Failed to parse LiveRail XML response"
}, a.XMLUnknownResponse = {
id: 1202,
message: "Unknown LiveRail XML response type"
}, a.XMLErrorMessage = {
id: 1203,
message: "LiveRail XML Error message"
}, a.XMLDuplicateSources = {
id: 1204,
message: "Second LiveRail XML contains sources"
}, a.NoAdSources = {
id: 1301,
message: "LiveRail returned no ad sources"
}, a.NoAdSlots = {
id: 1302,
message: "No ad-slots available"
}, a.AdapterMising = {
id: 2901,
message: "Adapter class not found"
}, a.AdCandidateStarted = {
id: 9001,
message: "Ad candidate started"
}, a.AdImpression = {
id: 9002,
message: "Creative AdImpression"
}, a.AdClickThrough = {
id: 9003,
message: "Creative AdClickThrough"
}, a.AdLoaded = {
id: 9004,
message: "Creative AdLoaded"
}, a.AdClickThroughFailed = {
id: 9910,
message: "Creative AdClickThrough failed"
}, a.MRCViewable = {
id: 9933,
message: "Ad placement met MRC viewable requirements"
}, a.FBViewable = {
id: 9934,
message: "Ad placement met FB viewable requirements"
}, a.ViewThrough = {
id: 9935,
message: "Ad placement met view through requirements"
}, a
}();
return c
}), define("Renderer", ["require", "exports", "EventManager", "RendererEvents"], function(a, b, c, d) {
var e = function() {
function a(a) {
this._adAsset = null, this._bgColor = a.getAdParameters().bgcolor, this._eventManager = new c, this._slot = a.slot, this._slotWindow = a.slotWindow
}
return a.prototype.destroy = function() {}, a.prototype.load = function(a) {
this._adAsset = a
}, a.prototype.start = function() {}, a.prototype.stop = function() {}, a.prototype.getAsset = function() {
return this._adAsset
}, a.prototype.getWidth = function() {
return 0
}, a.prototype.getHeight = function() {
return 0
}, a.prototype.impressionOccured = function() {
return !1
}, a.prototype.subscribe = function(a, b, c) {
this._eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this._eventManager.unsubscribe(a, b)
}, a.prototype.dispatchRendererLoaded = function() {
this._eventManager.dispatch(d.Loaded)
}, a.prototype.dispatchRendererImpression = function() {
this._eventManager.dispatch(d.Impression)
}, a.prototype.dispatchRendererError = function(a) {
this._eventManager.dispatch(d.Error, [a])
}, a
}();
return e
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LinearRenderer", ["require", "exports", "LinearRendererEvents", "Renderer"], function(a, b, c, d) {
var e = function(a) {
function b(b) {
a.call(this, b), this._videoSlot = b.videoSlot
}
return __extends(b, a), b.prototype.pause = function() {}, b.prototype.resume = function() {}, b.prototype.getCurrentTime = function() {
return -2
}, b.prototype.getDuration = function() {
return -2
}, b.prototype.getVolume = function() {
return -2
}, b.prototype.setVolume = function(a) {}, b.prototype.isPaused = function() {
return !1
}, b.prototype.isSeeking = function() {
return !1
}, b.prototype.dispatchRendererProgress = function() {
this._eventManager.dispatch(c.Progress)
}, b.prototype.dispatchRendererPaused = function() {
this._eventManager.dispatch(c.Paused)
}, b.prototype.dispatchRendererResumed = function() {
this._eventManager.dispatch(c.Resumed)
}, b.prototype.dispatchRendererEnded = function() {
this._eventManager.dispatch(c.Ended)
}, b.prototype.dispatchVolumeChange = function() {
this._eventManager.dispatch(c.VolumeChange)
}, b
}(d);
return e
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRLinearFlashRenderer", ["require", "exports", "LinearRenderer", "LogEvent", "Logger"], function(a, b, c, d, e) {
var f = function(a) {
function b() {
a.apply(this, arguments);
var b = this;
this.logger = new e("LRLinearFlashRenderer"), this._impressionOccurred = !1, this._paused = !1, this._progressMonitorInterval = null, this._volume = 1, this.onProgress = function() {
b.dispatchRendererProgress()
}
}
return __extends(b, a), b.prototype.destroy = function() {
this.stopProgressMonitor(), this.unloadFlashVPAID()
}, b.prototype.load = function(b) {
a.prototype.load.call(this, b), this.logger.log("load(", b, ")"), this.loadFlashPlayer()
}, b.prototype.start = function() {
this.logger.log("start()"), this._flashPlayer && (this._flashPlayer.setVolume(this._volume), this._flashPlayer.start())
}, b.prototype.stop = function() {
this.logger.log("stop()"), this._flashPlayer && this._flashPlayer.stop()
}, b.prototype.pause = function() {
this.logger.log("pause()"), this._flashPlayer && this._flashPlayer.pause()
}, b.prototype.resume = function() {
this.logger.log("resume()"), this._flashPlayer && this._flashPlayer.resume()
}, b.prototype.getWidth = function() {
return this._flashPlayer ? this._flashPlayer.offsetWidth : 0
}, b.prototype.getHeight = function() {
return this._flashPlayer ? this._flashPlayer.offsetHeight : 0
}, b.prototype.getCurrentTime = function() {
return this._flashPlayer ? this._flashPlayer.getCurrentTime() : -2
}, b.prototype.getDuration = function() {
return this._flashPlayer ? this._flashPlayer.getDuration() : -2
}, b.prototype.getVolume = function() {
return this._volume
}, b.prototype.setVolume = function(a) {
this._volume = a, this._flashPlayer && this._flashPlayer.setVolume(this._volume), this.dispatchVolumeChange()
}, b.prototype.isPaused = function() {
return this._paused
}, b.prototype.isSeeking = function() {
return !1
}, b.prototype.impressionOccured = function() {
return this._impressionOccurred
}, b.prototype.dispatchRendererEnded = function() {
a.prototype.dispatchRendererEnded.call(this)
}, b.prototype.dispatchRendererError = function(b) {
a.prototype.dispatchRendererError.call(this, b)
}, b.prototype.unloadFlashVPAID = function() {
this._slot && this._flashContainer && (this._slot.removeChild(this._flashContainer), this.logger.log("Unloaded Flash player"), void 0 !== this._targetSlotOriginalStylePosition && (this.logger.log("Resetting slot element position to " + this._targetSlotOriginalStylePosition), this._slot.style.setProperty("position", this._targetSlotOriginalStylePosition, this._targetSlotOriginalPriorityPosition)), this._flashPlayer = null, this._flashContainer = null)
}, b.prototype.loadFlashPlayer = function() {
var a, c, e, f, g = this,
h = "",
i = {
onReady: function() {
return g.logger.log("Flash player dispatched Ready event"), g.logger.log("Calling load on Flash player with url:", g._adAsset.getUrl()), g._flashPlayer.load(g._adAsset.getUrl()), !0
},
onLoaded: function() {
return g.logger.log("Flash player dispatched Loaded event"), g.dispatchRendererLoaded(), !0
},
onImpression: function() {
return g.logger.log("Flash player dispatched Impression event"), g._impressionOccurred = !0, g.startProgressMonitor(), g.dispatchRendererImpression(), !0
},
onEnded: function() {
return g.logger.log("Flash player dispatched Ended event"), g.destroy(), g.dispatchRendererEnded(), !0
},
onError: function(a, b) {
return g.logger.error("Flash player dispatched Error event, id=" + a, "message=" + b), g.destroy(), g.dispatchRendererError(new d(a, b)), !0
},
onPaused: function() {
return g.logger.log("Flash player dispatched Paused event"), g._paused === !1 && (g._paused = !0, g.dispatchRendererPaused()), !0
},
onResumed: function() {
return g.logger.log("Flash player dispatched Resumed event"), g._paused === !0 && (g._paused = !1, g.dispatchRendererResumed()), !0
}
};
this._slotWindow.LiveRail || (this._slotWindow.LiveRail = {}), this._slotWindow.LiveRail.FlashPlayerListeners || (this._slotWindow.LiveRail.FlashPlayerListeners = {}), b.instanceCount += 1, c = "LiveRail.FlashPlayerListeners.FlashBridge_" + b.instanceCount, e = ("https:" === this._slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/v4/flv-renderer.swf", a = "jscontext=" + c, h += '<object style="display: block; width: 100%; height: 100%;"', navigator.userAgent.match(/MSIE/i) ? (h += ' id="' + c + '"', h += ' name="' + c + '"', h += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">', h += '<param name="movie" value="' + e + '" />') : (h += ' data="' + e + '"', h += ' type="application/x-shockwave-flash">'), h += '<param name="quality" value="high" />', h += '<param name="allowfullscreen" value="true" />', h += '<param name="allowscriptaccess" value="always" />', h += '<param name="flashvars" value="' + a + '" />', h += '<param name="bgcolor" value="#000000" />', h += '<param name="wmode" value="opaque" />', h += "</object>", this._slotWindow.LiveRail.FlashPlayerListeners["FlashBridge_" + b.instanceCount] = i, this._flashContainer = this._slotWindow.document.createElement("div"), this._flashContainer.style.setProperty("position", "absolute", "important"), this._flashContainer.style.setProperty("position", "absolute", "important"), this._flashContainer.style.setProperty("top", "0px", "important"), this._flashContainer.style.setProperty("left", "0px", "important"), this._flashContainer.style.setProperty("width", "100%", "important"), this._flashContainer.style.setProperty("height", "100%", "important"), this._slotWindow.getComputedStyle ? f = this._slotWindow.getComputedStyle(this._slot, null).getPropertyValue("position") : this._slot.currentStyle && (f = this._slot.currentStyle.position), this._targetSlotOriginalStylePosition = void 0, this._targetSlotOriginalPriorityPosition = void 0, "static" === f && (this._targetSlotOriginalStylePosition = this._slot.style.getPropertyValue("position"), this._targetSlotOriginalPriorityPosition = this._slot.style.getPropertyPriority("position"), this._slot.style.setProperty("position", "relative", "important")), this._slot.appendChild(this._flashContainer), this._flashContainer.innerHTML = h, this._flashPlayer = this._flashContainer.childNodes[0], this.logger.verbose("Loaded JS-Flash event interface:", i)
}, b.prototype.startProgressMonitor = function() {
this._progressMonitorInterval || (this.logger.debug("Starting progress monitor at currentTime=" + this._flashPlayer.getCurrentTime()), this._progressMonitorInterval = setInterval(this.onProgress, b.ONPROGRESS_INTERVAL), this.onProgress())
}, b.prototype.stopProgressMonitor = function() {
if (this._progressMonitorInterval) {
this.logger.debug("Stopping progress monitor at currentTime=" + this._flashPlayer.getCurrentTime());
try {
clearInterval(this._progressMonitorInterval), this._progressMonitorInterval = null
} catch (a) {}
}
}, b.ONPROGRESS_INTERVAL = 500, b.FLASH_BRIDGE_URL = "http://static.liverail.com/swf/v4/flv-renderer.swf", b.instanceCount = 0, b
}(c);
return f
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRLinearHtmlRenderer", ["require", "exports", "LinearRenderer", "LogEvent", "LogEventType", "Logger", "Utils"], function(a, b, c, d, e, f, g) {
var h = function(a) {
function b() {
a.apply(this, arguments);
var b = this;
this.logger = new f("LRLinearHtmlRenderer"), this._impressionOccurred = !1, this._iosVersion = g.detectDevice("ios"), this._lastProgressTime = 0, this._lastRealTime = 0, this._volume = 1, this.onProgress = function() {
return b._videoSlot.src !== b._adAsset.getUrl() ? void b.dispatchRendererError(d.eventWithType(e.CreativeGeneralError, {
message: "Video element src changed unexpectedly"
})) : (b._videoSlot.controls = !1, b._videoSlotWasSeeked(b._videoSlot.currentTime) ? void b.resetToLastProgressTime() : (b._lastProgressTime < b._videoSlot.currentTime && (b._lastProgressTime = b._videoSlot.currentTime), b._lastRealTime = Date.now(), !b._impressionOccurred && b._videoSlot.currentTime > 0 && (b._impressionOccurred = !0, b._videoSlot.addEventListener("ended", b.onVideoSlotEnded, !1), b.dispatchRendererImpression()), void b.dispatchRendererProgress()))
}, this.onVideoSlotPause = function() {
!b._videoSlotPaused && b._impressionOccurred && b._videoSlot.currentTime < b._videoSlot.duration && (b._videoSlotPaused = !0, b.dispatchRendererPaused())
}, this.onVideoSlotPlay = function() {
b._videoSlotPaused && b._impressionOccurred && b._videoSlot.currentTime < b._videoSlot.duration && (b._videoSlotPaused = !1, b.dispatchRendererResumed())
}, this.onVideoSlotCanplay = function(a) {
if (b._videoSlot.removeEventListener("canplay", b.onVideoSlotCanplay, !1), b._videoSlot.currentTime >= 1) {
b.logger.log("Target element currentTime is " + b._videoSlot.currentTime + ", seeking to 0");
var c = function() {
b._videoSlot.removeEventListener("seeked", c, !1), b.dispatchRendererLoaded()
};
b._videoSlot.addEventListener("seeked", c, !1), b._videoSlot.currentTime = 0
} else b.dispatchRendererLoaded()
}, this.onVideoSlotLoadstart = function(a) {
b._videoSlot.removeEventListener("loadstart", b.onVideoSlotLoadstart, !1), b.dispatchRendererLoaded()
}, this.onVideoSlotEnded = function() {
if (g.checkWindowSanity()) {
b.logger.log("Video slot ended");
for (var a = 0, c = 0; c < b._videoSlot.seekable.length; c += 1) b._videoSlot.seekable.end(c) > a && (a = b._videoSlot.seekable.end(c));
if (b._videoSlotWasSeeked(a)) return b.resetToLastProgressTime(), void b._videoSlot.play();
b.dispatchRendererEnded()
}
}, this.onVideoSlotError = function() {
if (g.checkWindowSanity()) {
var a = e.CreativeGeneralError,
c = b._videoSlot.error;
if (b.logger.error("Ad video playback error:", c), c) switch (c.code) {
case c.MEDIA_ERR_NETWORK:
a = e.CreativeFileNotFound;
break;
case c.MEDIA_ERR_DECODE:
a = e.CreativeFileUnsupported;
break;
case c.MEDIA_ERR_SRC_NOT_SUPPORTED:
a = e.CreativeFileUnsupported
}
b.dispatchRendererError(d.eventWithType(a, {
url: b._adAsset.getUrl()
}))
}
}, this.onVideoSlotVolumeChange = function() {
b.dispatchVolumeChange()
}
}
return __extends(b, a), b.prototype.destroy = function() {
this.stopProgressMonitor(), this.unregister_videoSlot(), this._videoSlot && this._videoSlot.pause()
}, b.prototype.load = function(b) {
a.prototype.load.call(this, b), this.logger.log("load(", b, ")"), this._videoSlot.pause(), this._videoSlot.volume = this._volume, this.register_videoSlot(), this._videoSlot.src = this._adAsset.getUrl(), this._videoSlot.load()
}, b.prototype.start = function() {
this.logger.log("start()"), this.startProgressMonitor(), this.startAdVideoPlayback()
}, b.prototype.stop = function() {
this.logger.log("stop()"), this.dispatchRendererEnded()
}, b.prototype.pause = function() {
this.logger.log("pause()"), this._videoSlot && !this._videoSlot.paused && this._videoSlot.pause()
}, b.prototype.resume = function() {
this.logger.log("resume()"), this._videoSlot && this._videoSlot.paused && this._videoSlot.play()
}, b.prototype.getWidth = function() {
return this._videoSlot ? this._videoSlot.offsetWidth : 0
}, b.prototype.getHeight = function() {
return this._videoSlot ? this._videoSlot.offsetHeight : 0
}, b.prototype.getCurrentTime = function() {
return this._videoSlot && !isNaN(this._videoSlot.currentTime) ? this._videoSlot.currentTime : -2
}, b.prototype.getDuration = function() {
return this._videoSlot ? this._videoSlot.duration : -2
}, b.prototype.getVolume = function() {
return this._videoSlot ? this._videoSlot.volume : this._volume
}, b.prototype.setVolume = function(a) {
this._volume = a, this._videoSlot && (this._videoSlot.volume = this._volume)
}, b.prototype.isPaused = function() {
return this._videoSlot ? this._videoSlot.paused : !1
}, b.prototype.isSeeking = function() {
return this._videoSlot ? this._videoSlot.seeking : !1
}, b.prototype.impressionOccured = function() {
return this._impressionOccurred
}, b.prototype.dispatchRendererEnded = function() {
this.destroy(), a.prototype.dispatchRendererEnded.call(this)
}, b.prototype.dispatchRendererError = function(b) {
this.destroy(), a.prototype.dispatchRendererError.call(this, b)
}, b.prototype.register_videoSlot = function() {
this.logger.debug("Registering listeners on video slot element"), this._videoSlot.addEventListener("pause", this.onVideoSlotPause, !0), this._videoSlot.addEventListener("play", this.onVideoSlotPlay, !0), this._videoSlot.addEventListener("error", this.onVideoSlotError, !0), this._videoSlot.addEventListener("volumechange", this.onVideoSlotVolumeChange, !0), this._iosVersion ? (this.logger.debug("iOS version " + this._iosVersion + " detected, using canplay event to begin playback"), this._videoSlot.addEventListener("canplay", this.onVideoSlotCanplay, !1)) : this._videoSlot.addEventListener("loadstart", this.onVideoSlotLoadstart, !1)
}, b.prototype.unregister_videoSlot = function() {
this.logger.debug("Unregistering listeners on video slot element"), this._videoSlot.removeEventListener("pause", this.onVideoSlotPause, !0), this._videoSlot.removeEventListener("play", this.onVideoSlotPlay, !0), this._videoSlot.removeEventListener("error", this.onVideoSlotError, !0), this._videoSlot.removeEventListener("ended", this.onVideoSlotEnded, !1), this._videoSlot.removeEventListener("canplay", this.onVideoSlotCanplay, !1), this._videoSlot.removeEventListener("loadstart", this.onVideoSlotLoadstart, !1), this._videoSlot.removeEventListener("volumechange", this.onVideoSlotVolumeChange, !0)
}, b.prototype.startAdVideoPlayback = function() {
this._bgColor && this._videoSlot.style.setProperty("background-color", "#000", "important"), this.logger.debug("Calling _videoSlot.play()"), this._videoSlot.play()
}, b.prototype.startProgressMonitor = function() {
this._progressMonitorInterval || (this.logger.debug("Starting progress monitor at currentTime=" + this._videoSlot.currentTime), this._progressMonitorInterval = setInterval(this.onProgress, b.ONPROGRESS_INTERVAL))
}, b.prototype.stopProgressMonitor = function() {
if (this._progressMonitorInterval) {
this.logger.debug("Stopping progress monitor at currentTime=" + this._videoSlot.currentTime);
try {
clearInterval(this._progressMonitorInterval), this._progressMonitorInterval = null
} catch (a) {}
}
}, b.prototype._videoSlotWasSeeked = function(a) {
var b = a - this._lastProgressTime,
c = (Date.now() - this._lastRealTime) / 1e3,
d = 1;
return b > c + d ? (this.logger.warn("Video slot was seeked, progress=" + b + "s realtime=" + c + "s margin=" + d + "s"), !0) : !1
}, b.prototype.resetToLastProgressTime = function() {
var a = Math.max(0, this._lastProgressTime - .2);
this.logger.warn("Setting currentTime to:", a), this._videoSlot.currentTime = a
}, b.ONPROGRESS_INTERVAL = 250, b
}(c);
return h
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRAdapter", ["require", "exports", "Adapter", "AdCandidate", "LinearRendererEvents", "LogEvent", "LogEventType", "LRLinearFlashRenderer", "LRLinearHtmlRenderer", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g, h, i, j, k) {
var l = function(a) {
function b(b) {
var c = this;
a.call(this, "LRAdapter"), this.renderer = null, this.onStreamTimeout = function() {
c.logger.error("Ad video stream timed out after " + c.adapterConfiguration.adCreativeTimeout + " seconds"), c.onAdError(f.eventWithType(g.CreativeFileTimeout, {
url: c.renderer.getAsset().getUrl(),
kbps: c.renderer.getAsset().getKbps(),
type: c.renderer.getAsset().getMimeType(),
flash: c.renderer.getAsset().requiresFlash(),
timeout: c.adapterConfiguration.adCreativeTimeout
}))
}, this.onAdapterEnded = function() {
j.checkWindowSanity() && (c.logger.log("Renderer ended"), 3 === c.quartile && c.onAdVideoComplete(), c.onAdStopped())
}, this.onProgress = function() {
var a;
if (!window) return a = "Ad unit has been removed", c.logger.error(a), void c.onAdError(f.eventWithType(g.CreativeGeneralError, {
message: a
}));
if (window.parent && Object) {
var b = c.renderer.getCurrentTime(),
d = c.renderer.getDuration();
if (c.adDuration === d || isNaN(d) || (c.adDuration = d, c.onAdDurationChange()), c.renderer.impressionOccured()) {
if (!c.rendererStarted) {
if (!(c.renderer.getDuration() > 0)) return void c.logger.debug("Renderer has not yet started (currentTime=" + c.renderer.getCurrentTime() + " duration=" + c.renderer.getDuration() + ")");
c.clearStreamTimeout(), c.logger.debug("Renderer has started"), c.rendererStarted = !0, c.onAdVideoStart()
}
if (!c.dispatchedAdSkippableStateChange && c.getAdSkippableState() && (c.dispatchedAdSkippableStateChange = !0, c.eventManager.dispatch(k.AdSkippableStateChange)), c.renderer.impressionOccured() && !c.renderer.isSeeking() && !c.renderer.isPaused()) {
var e = d / 4;
0 === c.quartile && b >= e && (c.quartile += 1, c.onAdVideoFirstQuartile()), 1 === c.quartile && b >= 2 * e && (c.quartile += 1, c.onAdVideoMidpoint()), 2 === c.quartile && b >= 3 * e && (c.quartile += 1, c.onAdVideoThirdQuartile())
}
}
}
}, this.handleVideoElementFullscreen = function() {
j.videoElementIsFullscreen(c.slotWindow.document) && c.onAdError(f.eventWithType(g.CreativeGeneralError, {}, "Video element went fullscreen during Flash operation"))
}, this.destroy(), b(this)
}
return __extends(b, a), b.prototype.destroy = function() {
this.clearStreamTimeout(), this.slotWindow && j.removeDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.unregisterRenderer(), this.adCandidate = null, this.rendererStarted = !1, this.quartile = 0, this.dispatchedAdSkippableStateChange = !1, this.lastProgressTime = 0, this.lastRealTime = 0, a.prototype.destroy.call(this)
}, b.prototype.supports = function(a) {
return !0
}, b.prototype.getAdWidth = function() {
return this.renderer ? this.renderer.getWidth() : this.adWidth
}, b.prototype.getAdHeight = function() {
return this.renderer ? this.renderer.getHeight() : this.adHeight
}, b.prototype.getAdVolume = function() {
return this.renderer && (this.adVolume = this.renderer.getVolume()), a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
this.renderer ? this.renderer.setVolume(b) : a.prototype.setAdVolume.call(this, b)
}, b.prototype.getAdSkippableState = function() {
return 0 === this.getAdSkippableRemainingTime() ? !0 : !1
}, b.prototype.getAdSkippableRemainingTime = function() {
if (null !== this.linearCreative.getSkipOffset() && this.linearCreative.getSkipOffset() > -1) {
var a;
return a = this.linearCreative.getSkipIsPercent() ? this.renderer.getDuration() * this.linearCreative.getSkipOffset() / 100 - this.renderer.getCurrentTime() : this.linearCreative.getSkipOffset() - this.renderer.getCurrentTime(), Math.max(0, a)
}
return -2
}, b.prototype.getAdRemainingTime = function() {
return this.renderer.getDuration() > 0 ? this.renderer.getCurrentTime() > 0 ? this.renderer.getDuration() - this.renderer.getCurrentTime() : this.renderer.getDuration() : -2
}, b.prototype.isPaused = function() {
return this.renderer ? this.renderer.isPaused() : !1
}, b.prototype.initAd = function(b, c, e, j, k, l) {
a.prototype.initAd.call(this, b, c, e, j, k, l), this.logger.debug("initAd(", b, ",", c, ",", e, ",", j, ",", k, ",", l, ")");
var m = null,
n = null;
this.adCandidate = l.adCandidate;
var o = l.environmentData;
return this.slotWindow = o.slotWindow, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, this.adLinear ? (this.linearCreative = this.adCandidate.getLinearCreative(), m = this.linearCreative.getAdAsset(j, this.adapterConfiguration.mimeTypePriorityList), n = m.requiresFlash() ? new h(o) : new i(o), this.registerRenderer(n), this.renderer.load(m), void 0) : void this.onAdError(f.eventWithType(g.CreativeFileUnsupported, {
type: this.adCandidate.type
}))
}, b.prototype.startAd = function() {
if (this.logger.debug("startAd()"), this.renderer instanceof h) {
if (this.handleVideoElementFullscreen()) return;
j.addDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1)
}
this.setStreamTimeout(), this.renderer.start(), this.onAdStarted()
}, b.prototype.stopAd = function() {
this.renderer ? this.renderer.stop() : this.onAdStopped()
}, b.prototype.pauseAd = function() {
this.renderer.impressionOccured() && this.renderer.isPaused() === !1 && this.renderer.pause()
}, b.prototype.resumeAd = function() {
this.renderer.impressionOccured() && this.renderer.isPaused() === !0 && this.renderer.resume()
}, b.prototype.skipAd = function() {
this.getAdSkippableState() === !0 ? (this.logger.log("skipAd received -- initiating ad skip"), this.onAdSkipped(), this.onAdStopped()) : this.logger.warn("skipAd received -- ad not skippable at this time")
}, b.prototype.expandAd = function() {
this.logger.log("expandAd is not supported for this creative")
}, b.prototype.collapseAd = function() {
this.logger.log("collapseAd is not supported for this creative")
}, b.prototype.onAdImpression = function() {
a.prototype.onAdImpression.call(this)
}, b.prototype.setStreamTimeout = function() {
this.logger.log("Stream timeout set to " + this.adapterConfiguration.adCreativeTimeout + " seconds"), this.streamTimeout && this.clearStreamTimeout(), this.streamTimeout = setTimeout(this.onStreamTimeout, Math.round(1e3 * this.adapterConfiguration.adCreativeTimeout))
}, b.prototype.clearStreamTimeout = function() {
this.streamTimeout && (clearTimeout(this.streamTimeout), this.streamTimeout = null)
}, b.prototype.registerRenderer = function(a) {
this.renderer = a, this.renderer && (this.renderer.setVolume(this.adVolume), this.renderer.subscribe(this.onLinearRendererLoaded, e.Loaded, this), this.renderer.subscribe(this.onLinearRendererImpression, e.Impression, this), this.renderer.subscribe(this.onLinearRendererProgress, e.Progress, this), this.renderer.subscribe(this.onLinearRendererEnded, e.Ended, this), this.renderer.subscribe(this.onLinearRendererError, e.Error, this), this.renderer.subscribe(this.onLinearRendererPaused, e.Paused, this), this.renderer.subscribe(this.onLinearRendererResumed, e.Resumed, this), this.renderer.subscribe(this.onLinearRendererVolumeChange, e.VolumeChange, this))
}, b.prototype.unregisterRenderer = function() {
this.renderer && (this.renderer.unsubscribe(this.onLinearRendererLoaded, e.Loaded), this.renderer.unsubscribe(this.onLinearRendererImpression, e.Impression), this.renderer.unsubscribe(this.onLinearRendererProgress, e.Progress), this.renderer.unsubscribe(this.onLinearRendererEnded, e.Ended), this.renderer.unsubscribe(this.onLinearRendererError, e.Error), this.renderer.unsubscribe(this.onLinearRendererPaused, e.Paused), this.renderer.unsubscribe(this.onLinearRendererResumed, e.Resumed), this.renderer.unsubscribe(this.onLinearRendererVolumeChange, e.VolumeChange), this.renderer.destroy(), this.renderer = null)
}, b.prototype.onLinearRendererLoaded = function() {
this.onAdLoaded()
}, b.prototype.onLinearRendererImpression = function() {
this.onAdImpression()
}, b.prototype.onLinearRendererProgress = function() {
this.onProgress()
}, b.prototype.onLinearRendererEnded = function() {
this.onAdapterEnded()
}, b.prototype.onLinearRendererError = function(a) {
this.onAdError(a)
}, b.prototype.onLinearRendererPaused = function() {
j.checkWindowSanity() && a.prototype.onAdPaused.call(this)
}, b.prototype.onLinearRendererResumed = function() {
j.checkWindowSanity() && a.prototype.onAdPlaying.call(this)
}, b.prototype.onLinearRendererVolumeChange = function() {
a.prototype.setAdVolume.call(this, this.renderer.getVolume())
}, b
}(c);
return l
}), define("MimeType", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.Flash = "application/x-shockwave-flash", a.FLV = "video/x-flv", a.JavaScript = "application/javascript", a.JavaScriptAlt = "application/x-javascript", a.HLS = "application/x-mpegURL", a.HLSAlt = "application/vnd.apple.mpegURL", a.Mobile3GP = "video/3gpp", a.MP4 = "video/mp4", a.OGG = "video/ogg", a.WebM = "video/webm", a
}();
return c
}), define("FlashVPAIDBridge", ["require", "exports", "EventManager", "Logger", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f) {
var g = function() {
function a(a, b, e) {
var g = this;
this.logger = new d("FlashVPAIDBridge"), this.eventManager = new c(f), this.adVolume = -1, this.flashBuild = "201406161543", this.creativeUrl = a, this.slot = b.slot, this.slotWindow = b.slotWindow, this.bgcolor = b.getAdParameters().bgcolor, this.destroy(), this.loadFlashVPAID(function(a) {
g.flashVPAID = a, g.logger.log("Loaded Flash VPAID:", g.flashVPAID), e(g)
})
}
return a.prototype.getAdLinear = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdLinear() : !1
}, a.prototype.getAdWidth = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableRemainingTime() : -2
}, a.prototype.getAdRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdRemainingTime() : -2
}, a.prototype.getAdDuration = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdDuration() : -2
}, a.prototype.getAdVolume = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.bridgeInterfaceExists() && this.flashVPAID.setAdVolume(a)
}, a.prototype.getAdCompanions = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, d, f, g) {
if (this.logger.log("initAd() width:", a, " height:", b, " viewMode:", c, "desiredBitrate:", d, "creativeData:", f, "environmentVars:", g), this.bridgeInterfaceExists()) {
this.adVolume > -1 && (this.logger.debug("Setting Flash VPAID adVolume property to " + this.adVolume), this.flashVPAID.setAdVolume(this.adVolume));
var h = f.AdParameters || "";
this.flashVPAID.initAd(-1, -1, c, d, h, e.stringifyParameterObject(g))
}
}, a.prototype.resizeAd = function(a, b, c) {
return this.bridgeInterfaceExists() ? this.flashVPAID.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.startAd() : void 0
}, a.prototype.stopAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.stopAd() : void 0
}, a.prototype.pauseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.destroy = function() {
this.unloadFlashVPAID(), this.flashContainer = null, this.flashVPAID = null
}, a.prototype.loadFlashVPAID = function(b) {
function c() {
window.setTimeout(function() {
"function" == typeof f.getVPAID && null !== f.getVPAID() ? b(f) : c()
}, 100)
}
var d, e, f, g, h, i = this,
j = "",
k = {
onVPAIDEvent: function(a) {
return i.onVPAIDEvent(a)
}
};
this.slotWindow.LiveRail || (this.slotWindow.LiveRail = {}), this.slotWindow.LiveRail.VPAIDListeners || (this.slotWindow.LiveRail.VPAIDListeners = {}), a.instanceCount += 1, e = "LiveRail.VPAIDListeners.FlashVPAIDBridge_" + a.instanceCount, g = ("https:" === this.slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/ui/vpaid-player.swf", g += "?build=" + this.flashBuild, d = "jscontext=" + e, d += "&vpaidURL=" + encodeURIComponent(this.creativeUrl), d += "&allowDomains=*", d += "&currentSecurityDomain=false", j += '<object style="display: block; width: 100%; height: 100%;"', navigator.userAgent.match(/MSIE/i) ? (j += ' id="' + e + '"', j += ' name="' + e + '"', j += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">', j += '<param name="movie" value="' + g + '" />') : (j += ' data="' + g + '"', j += ' type="application/x-shockwave-flash">'), j += '<param name="quality" value="high" />', j += '<param name="allowfullscreen" value="true" />', j += '<param name="allowscriptaccess" value="always" />', j += '<param name="flashvars" value="' + d + '" />', this.bgcolor ? (j += '<param name="wmode" value="opaque" />', j += '<param name="bgcolor" value="#' + this.bgcolor + '" />') : j += '<param name="wmode" value="transparent" />', j += "</object>", this.slotWindow.LiveRail.VPAIDListeners["FlashVPAIDBridge_" + a.instanceCount] = k, this.flashContainer = this.slotWindow.document.createElement("div"), this.flashContainer.style.position = "absolute", this.flashContainer.style.top = "0px", this.flashContainer.style.left = "0px", this.flashContainer.style.width = "100%", this.flashContainer.style.height = "100%", this.slotWindow.getComputedStyle ? h = this.slotWindow.getComputedStyle(this.slot, null).getPropertyValue("position") : this.slot.currentStyle && (h = this.slot.currentStyle.position), this.targetSlotOriginalPosition = void 0, "static" === h && (this.targetSlotOriginalPosition = this.slot.style.position, this.slot.style.position = "relative"), this.slot.appendChild(this.flashContainer), this.flashContainer.innerHTML = j, f = this.flashContainer.childNodes[0], c(), this.logger.verbose("Loaded JS-Flash event interface:", k)
}, a.prototype.unloadFlashVPAID = function() {
this.slot && this.flashContainer && (this.slot.removeChild(this.flashContainer), this.logger.log("Unloaded Flash VPAID"), this.targetSlotOriginalPosition && (this.logger.log("Resetting slot element position to " + this.targetSlotOriginalPosition), this.slot.style.position = this.targetSlotOriginalPosition))
}, a.prototype.onVPAIDEvent = function(a) {
var b = this;
f.hasOwnProperty(a.type) && window.setTimeout(function() {
switch (b.logger.verbose("Received " + a.type + " event from Flash bridge:", a, ")"), a.type) {
case "AdClickThru":
b.eventManager.dispatch(f.AdClickThru, [a.data.url, a.data.id, a.data.playerHandles]);
break;
case "AdInteraction":
b.eventManager.dispatch(f.AdInteraction, [a.data.id]);
break;
case "AdLog":
b.eventManager.dispatch(f.AdLog, [a.data.message]);
break;
case "AdStopped":
b.destroy(), b.eventManager.dispatch(f.AdStopped);
break;
case "AdError":
b.destroy(), b.eventManager.dispatch(f.AdError, [a.data]);
break;
default:
b.eventManager.dispatch(a.type)
}
}, 0)
}, a.prototype.bridgeInterfaceExists = function() {
return this.flashVPAID && e.isFunction(this.flashVPAID.handshakeVersion)
}, a.instanceCount = 0, a
}();
return g
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDFlashWrapper", ["require", "exports", "Adapter", "AdCandidate", "FlashVPAIDBridge", "LogEvent", "LogEventType", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g, h, i) {
var j = function(a) {
function b() {
var b = this;
a.call(this, "VPAIDFlashWrapper"), this.handleVideoElementFullscreen = function() {
return h.videoElementIsFullscreen(b.slotWindow.document) ? (b.onLinearVPAIDError(f.eventWithType(g.CreativeGeneralError, {}, "Video element went fullscreen during Flash operation")), !0) : !1
}, this.onVPAIDInitTimeout = function() {
b.initTimeout = null, b.logger.error("VPAID initAd timed out after " + b.adapterConfiguration.timeoutVPAIDInit + " seconds"), b.onLinearVPAIDError(f.eventWithType(g.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "init",
timeout: b.adapterConfiguration.timeoutVPAIDInit
}))
}, this.clearVPAIDInitTimeout = function() {
b.initTimeout && (clearTimeout(b.initTimeout), b.initTimeout = null)
}, this.onVPAIDStartTimeout = function() {
b.startTimeout = null, b.logger.error("VPAID startAd timed out after " + b.adapterConfiguration.timeoutVPAIDStart + " seconds"), b.onLinearVPAIDError(f.eventWithType(g.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "start",
timeout: b.adapterConfiguration.timeoutVPAIDStart
}))
}, this.clearVPAIDStartTimeout = function() {
b.startTimeout && (clearTimeout(b.startTimeout), b.startTimeout = null)
}, this.destroy()
}
return __extends(b, a), b.prototype.initAd = function(b, c, f, g, h, i) {
var j = this;
a.prototype.initAd.call(this, b, c, f, g, h, i), this.logger.debug("initAd(", b, ",", c, ",", f, ",", g, ",", h, ",", i, ")"), this.active = !0, this.slot = i.slot, this.adCandidate = i.adCandidate;
var k = i.environmentData;
this.slotWindow = k.slotWindow, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, new e(this.adCandidate.getThirdPartyData("url"), k, function(a) {
j.flashBridge = a;
var d = j.adCandidate.getThirdPartyData("creativeData") || "";
j.registerBridge(j.flashBridge), j.startVPAIDInitTimeout(), j.flashBridge.initAd(b, c, f, g, {
AdParameters: d
}, {})
})
}, b.prototype.resizeAd = function(a, b, c) {
this.flashBridge.resizeAd(a, b, c)
}, b.prototype.startAd = function() {
this.handleVideoElementFullscreen() || (h.addDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.startVPAIDStartTimeout(), this.flashBridge.setAdVolume(this.adVolume), this.flashBridge.startAd())
}, b.prototype.stopAd = function() {
this.flashBridge.stopAd()
}, b.prototype.pauseAd = function() {
this.flashBridge.pauseAd()
}, b.prototype.resumeAd = function() {
this.flashBridge.resumeAd()
}, b.prototype.expandAd = function() {
this.flashBridge.expandAd()
}, b.prototype.collapseAd = function() {
this.flashBridge.collapseAd()
}, b.prototype.skipAd = function() {
this.flashBridge.skipAd()
}, b.prototype.getAdLinear = function() {
return this.flashBridge.getAdLinear()
}, b.prototype.getAdWidth = function() {
return this.flashBridge.getAdWidth()
}, b.prototype.getAdHeight = function() {
return this.flashBridge.getAdHeight()
}, b.prototype.getAdExpanded = function() {
return this.flashBridge.getAdExpanded()
}, b.prototype.getAdSkippableState = function() {
return this.flashBridge.getAdSkippableState()
}, b.prototype.getAdRemainingTime = function() {
return this.flashBridge.getAdRemainingTime()
}, b.prototype.getAdDuration = function() {
return this.flashBridge.getAdDuration()
}, b.prototype.getAdVolume = function() {
return this.flashBridge ? this.flashBridge.getAdVolume() : this.adVolume
}, b.prototype.setAdVolume = function(a) {
this.adVolume = a, this.flashBridge ? this.flashBridge.setAdVolume(this.adVolume) : this.onAdVolumeChange()
}, b.prototype.registerBridge = function(a) {
a && (this.logger.log("Registering event subscriptions on bridge instance:", a), a.subscribe(this.onAdLoaded, i.AdLoaded, this), a.subscribe(this.onAdStarted, i.AdStarted, this), a.subscribe(this.onAdStopped, i.AdStopped, this), a.subscribe(this.onAdSkipped, i.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, i.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, i.AdSizeChange, this), a.subscribe(this.onAdLinearChange, i.AdLinearChange, this), a.subscribe(this.onAdDurationChange, i.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, i.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, i.AdVolumeChange, this), a.subscribe(this.onAdImpression, i.AdImpression, this), a.subscribe(this.onAdVideoStart, i.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, i.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, i.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, i.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, i.AdVideoComplete, this), a.subscribe(this.onAdClickThru, i.AdClickThru, this), a.subscribe(this.onAdInteraction, i.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, i.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, i.AdUserMinimize, this), a.subscribe(this.onAdUserClose, i.AdUserClose, this), a.subscribe(this.onAdPaused, i.AdPaused, this), a.subscribe(this.onAdPlaying, i.AdPlaying, this), a.subscribe(this.onAdLog, i.AdLog, this), a.subscribe(this.onVPAIDAdError, i.AdError, this))
}, b.prototype.unregisterBridge = function(a) {
a && (this.logger.log("Unregistering event subscriptions on adapter instance:", a), a.unsubscribe(this.onAdLoaded, i.AdLoaded), a.unsubscribe(this.onAdStarted, i.AdStarted), a.unsubscribe(this.onAdStopped, i.AdStopped), a.unsubscribe(this.onAdSkipped, i.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, i.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, i.AdSizeChange), a.unsubscribe(this.onAdLinearChange, i.AdLinearChange), a.unsubscribe(this.onAdDurationChange, i.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, i.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, i.AdVolumeChange), a.unsubscribe(this.onAdImpression, i.AdImpression), a.unsubscribe(this.onAdVideoStart, i.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, i.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, i.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, i.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, i.AdVideoComplete), a.unsubscribe(this.onAdClickThru, i.AdClickThru), a.unsubscribe(this.onAdInteraction, i.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, i.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, i.AdUserMinimize), a.unsubscribe(this.onAdUserClose, i.AdUserClose), a.unsubscribe(this.onAdPaused, i.AdPaused), a.unsubscribe(this.onAdPlaying, i.AdPlaying), a.unsubscribe(this.onAdLog, i.AdLog), a.unsubscribe(this.onVPAIDAdError, i.AdError))
}, b.prototype.onAdLoaded = function() {
this.clearVPAIDInitTimeout(), this.eventManager.dispatch(i.AdLoaded)
}, b.prototype.onAdStarted = function() {
this.clearVPAIDStartTimeout(), this.eventManager.dispatch(i.AdStarted)
}, b.prototype.onAdStopped = function() {
this.destroy(), this.eventManager.dispatch(i.AdStopped)
}, b.prototype.onAdSkipped = function() {
this.eventManager.dispatch(i.AdSkipped)
}, b.prototype.onAdSkippableStateChange = function() {
this.eventManager.dispatch(i.AdSkippableStateChange)
}, b.prototype.onAdSizeChange = function() {
this.eventManager.dispatch(i.AdSizeChange)
}, b.prototype.onAdLinearChange = function() {
this.eventManager.dispatch(i.AdLinearChange)
}, b.prototype.onAdDurationChange = function() {
this.eventManager.dispatch(i.AdDurationChange)
}, b.prototype.onAdExpandedChange = function() {
this.eventManager.dispatch(i.AdExpandedChange)
}, b.prototype.onAdVolumeChange = function() {
this.eventManager.dispatch(i.AdVolumeChange)
}, b.prototype.onAdImpression = function() {
this.flashBridge.getAdVolume() !== this.adVolume && this.flashBridge.setAdVolume(this.adVolume), this.eventManager.dispatch(i.AdImpression)
}, b.prototype.onAdVideoStart = function() {
this.eventManager.dispatch(i.AdVideoStart)
}, b.prototype.onAdVideoFirstQuartile = function() {
this.eventManager.dispatch(i.AdVideoFirstQuartile)
}, b.prototype.onAdVideoMidpoint = function() {
this.eventManager.dispatch(i.AdVideoMidpoint)
}, b.prototype.onAdVideoThirdQuartile = function() {
this.eventManager.dispatch(i.AdVideoThirdQuartile)
}, b.prototype.onAdVideoComplete = function() {
this.eventManager.dispatch(i.AdVideoComplete)
}, b.prototype.onAdClickThru = function(a, b, c) {
this.eventManager.dispatch(i.AdClickThru, [a, b, c])
}, b.prototype.onAdInteraction = function() {
this.eventManager.dispatch(i.AdInteraction)
}, b.prototype.onAdUserAcceptInvitation = function() {
this.eventManager.dispatch(i.AdUserAcceptInvitation)
}, b.prototype.onAdUserMinimize = function() {
this.eventManager.dispatch(i.AdUserMinimize)
}, b.prototype.onAdUserClose = function() {
this.eventManager.dispatch(i.AdUserClose)
}, b.prototype.onAdPaused = function() {
this.eventManager.dispatch(i.AdPaused)
}, b.prototype.onAdPlaying = function() {
this.eventManager.dispatch(i.AdPlaying)
}, b.prototype.onAdLog = function(a) {
this.eventManager.dispatch(i.AdLog, [a])
}, b.prototype.onVPAIDAdError = function(a) {
this.logger.error("VPAID creative dispatched AdError with message:", a), this.onLinearVPAIDError(f.eventWithType(g.CreativeComponentError, {
url: this.adCandidate.getThirdPartyData("url"),
message: a
}))
}, b.prototype.destroy = function() {
this.flashBridge && (h.removeDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.flashBridge.stopAd(), this.unregisterBridge(this.flashBridge), this.flashBridge = null), a.prototype.destroy.call(this)
}, b.prototype.startVPAIDInitTimeout = function() {
this.logger.log("VPAID initAd timeout set to " + this.adapterConfiguration.timeoutVPAIDInit + " seconds"), this.initTimeout = setTimeout(this.onVPAIDInitTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDInit)
}, b.prototype.startVPAIDStartTimeout = function() {
this.logger.log("VPAID start timeout set to " + this.adapterConfiguration.timeoutVPAIDStart + " seconds"), this.startTimeout = setTimeout(this.onVPAIDStartTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDStart)
}, b.prototype.onLinearVPAIDError = function(a) {
this.destroy(), this.eventManager.dispatch(i.AdError, [a])
}, b
}(c);
return j
}), define("VPAIDMethods", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.getAdLinear = "getAdLinear", a.getAdWidth = "getAdWidth", a.getAdHeight = "getAdHeight", a.getAdExpanded = "getAdExpanded", a.getAdSkippableState = "getAdSkippableState", a.getAdSkippableRemainingTime = "getAdSkippableRemainingTime", a.getAdRemainingTime = "getAdRemainingTime", a.getAdDuration = "getAdDuration", a.getAdVolume = "getAdVolume", a.setAdVolume = "setAdVolume", a.getAdCompanions = "getAdCompanions", a.getAdIcons = "getAdIcons", a.handshakeVersion = "handshakeVersion", a.initAd = "initAd", a.resizeAd = "resizeAd", a.startAd = "startAd", a.stopAd = "stopAd", a.pauseAd = "pauseAd", a.resumeAd = "resumeAd", a.expandAd = "expandAd", a.collapseAd = "collapseAd", a.skipAd = "skipAd", a.subscribe = "subscribe", a.unsubscribe = "unsubscribe", a
}();
return c
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDHtmlWrapper", ["require", "exports", "Adapter", "AdCandidate", "LogEvent", "LogEventType", "Utils", "VPAIDEvents", "VPAIDMethods"], function(a, b, c, d, e, f, g, h, i) {
var j = function(a) {
function b() {
var b = this;
a.call(this, "VPAIDHtmlWrapper"), this.onVPAIDLoadTimeout = function() {
b.loadTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "load",
timeout: b.adapterConfiguration.timeoutVPAIDLoad
}))
}, this.clearVPAIDLoadTimeout = function() {
b.loadTimeout && (clearTimeout(b.loadTimeout), b.loadTimeout = null)
}, this.onVPAIDInitTimeout = function() {
b.initTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "init",
timeout: b.adapterConfiguration.timeoutVPAIDInit
}))
}, this.clearVPAIDInitTimeout = function() {
b.initTimeout && (clearTimeout(b.initTimeout), b.initTimeout = null)
}, this.onVPAIDStartTimeout = function() {
b.startTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "start",
timeout: b.adapterConfiguration.timeoutVPAIDStart
}))
}, this.clearVPAIDStartTimeout = function() {
b.startTimeout && (clearTimeout(b.startTimeout), b.startTimeout = null)
}, this.onCreativeAdLoaded = function() {
b.clearVPAIDInitTimeout(), a.prototype.onAdLoaded.call(b)
}, this.onCreativeAdStarted = function() {
a.prototype.onAdStarted.call(b)
}, this.onCreativeAdImpression = function() {
b.clearVPAIDStartTimeout(), b.VPAIDInstance.getAdVolume() !== b.adVolume && b.setAdVolume(b.adVolume), a.prototype.onAdImpression.call(b)
}, this.onCreativeAdStopped = function() {
b.active && (b.logEvent(h.AdStopped), setTimeout(function() {
b.destroyThirdPartyVPAID(), b.destroy(), b.eventManager.dispatch(h.AdStopped)
}, 0))
}, this.onCreativeAdSkipped = function() {
a.prototype.onAdSkipped.call(b)
}, this.onCreativeAdSkippableStateChange = function() {
a.prototype.onAdSkippableStateChange.call(b)
}, this.onCreativeAdSizeChange = function() {
a.prototype.onAdSizeChange.call(b)
}, this.onCreativeAdLinearChange = function() {
a.prototype.onAdLinearChange.call(b)
}, this.onCreativeAdDurationChange = function() {
a.prototype.onAdDurationChange.call(b)
}, this.onCreativeAdExpandedChange = function() {
a.prototype.onAdExpandedChange.call(b)
}, this.onCreativeAdVolumeChange = function() {
a.prototype.onAdVolumeChange.call(b)
}, this.onCreativeAdVideoStart = function() {
a.prototype.onAdVideoStart.call(b)
}, this.onCreativeAdVideoFirstQuartile = function() {
a.prototype.onAdVideoFirstQuartile.call(b)
}, this.onCreativeAdVideoMidpoint = function() {
a.prototype.onAdVideoMidpoint.call(b)
}, this.onCreativeAdVideoThirdQuartile = function() {
a.prototype.onAdVideoThirdQuartile.call(b)
}, this.onCreativeAdVideoComplete = function() {
a.prototype.onAdVideoComplete.call(b)
}, this.onCreativeAdClickThru = function(c, d, e) {
a.prototype.onAdClickThru.call(b, g.returnString(c, "").trim(), g.returnString(d, ""), g.returnBoolean(e))
}, this.onCreativeAdInteraction = function() {
a.prototype.onAdInteraction.call(b)
}, this.onCreativeAdUserAcceptInvitation = function() {
a.prototype.onAdUserAcceptInvitation.call(b)
}, this.onCreativeAdUserMinimize = function() {
a.prototype.onAdUserMinimize.call(b)
}, this.onCreativeAdUserClose = function() {
a.prototype.onAdUserClose.call(b)
}, this.onCreativeAdPaused = function() {
a.prototype.onAdPaused.call(b)
}, this.onCreativeAdPlaying = function() {
a.prototype.onAdPlaying.call(b)
}, this.onCreativeAdLog = function(a) {
b.logEvent(h.AdLog, [a])
}, this.onCreativeAdError = function(a) {
b.logger.error("VPAID creative dispatched AdError with message:", a), b.onLinearVPAIDError(e.eventWithType(f.CreativeComponentError, {
url: b.adCandidate.getThirdPartyData("url"),
message: a
}))
}, this.validateVPAIDCreative = function(a) {
var c = !0;
return "object" == typeof a ? [i.handshakeVersion, i.initAd, i.startAd, i.stopAd, i.subscribe, i.unsubscribe, i.getAdLinear, i.getAdVolume, i.setAdVolume].every(function(d) {
var e = a[d];
return "function" != typeof e ? (b.logger.error("VPAID creative is missing required " + d + " method"), c = !1, !1) : !0
}) : c = !1, c
}, this.destroy()
}
return __extends(b, a), b.prototype.initAd = function(b, c, e, f, g, h) {
var j = this;
a.prototype.initAd.call(this, b, c, e, f, g, h), this.logger.debug("initAd(", b, ",", c, ",", e, ",", f, ",", g, ",", h, ")"), this.active = !0, this.slot = h.slot, this.videoSlot = h.videoSlot, this.adCandidate = h.adCandidate, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, this.instantiateThirdPartyVPAID(this.adCandidate.getThirdPartyData("url"), function(a) {
j.VPAIDInstance = a, j.registerVPAIDSubscriptions(j.VPAIDInstance);
var d = {},
g = j.adCandidate.getThirdPartyData("creativeData");
g && (d.AdParameters = g);
var k = {
slot: j.slot,
videoSlot: j.videoSlot,
videoSlotCanAutoPlay: h.videoSlotCanAutoPlay
};
j.logger.log("Calling initAd() on VPAID creative, timeout=" + j.adapterConfiguration.timeoutVPAIDInit, "width=" + b, "height=" + c, "viewMode=" + e, "desiredBitrate=" + f, "creativeData=", d, "environmentVars=", k), j.initTimeout = setTimeout(j.onVPAIDInitTimeout, 1e3 * j.adapterConfiguration.timeoutVPAIDInit), j.callVPAIDInstanceMethodOrDie(i.initAd, [b, c, e, f, d, k])
}, function(a) {
j.onLinearVPAIDError(a)
})
}, b.prototype.resizeAd = function(a, b, c) {
this.callVPAIDInstanceMethod(i.resizeAd, [a, b, c])
}, b.prototype.startAd = function() {
this.logger.log("Calling startAd() on VPAID creative, timeout=" + this.adapterConfiguration.timeoutVPAIDStart), this.startTimeout = setTimeout(this.onVPAIDStartTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDStart), this.setAdVolume(this.adVolume), this.callVPAIDInstanceMethodOrDie(i.startAd)
}, b.prototype.stopAd = function() {
this.logger.log("Calling stopAd() on VPAID creative"), this.callVPAIDInstanceMethodOrDie(i.stopAd)
}, b.prototype.pauseAd = function() {
this.logger.log("Calling pauseAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.pauseAd)
}, b.prototype.resumeAd = function() {
this.logger.log("Calling resumeAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.resumeAd)
}, b.prototype.expandAd = function() {
this.logger.log("Calling expandAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.expandAd)
}, b.prototype.collapseAd = function() {
this.logger.log("Calling collapseAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.collapseAd)
}, b.prototype.skipAd = function() {
this.logger.log("Calling skipAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.skipAd)
}, b.prototype.getAdLinear = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdLinear) || a.prototype.getAdLinear.call(this) : a.prototype.getAdLinear.call(this)
}, b.prototype.getAdWidth = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdWidth) || a.prototype.getAdWidth.call(this) : a.prototype.getAdWidth.call(this)
}, b.prototype.getAdHeight = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdHeight) || a.prototype.getAdHeight.call(this) : a.prototype.getAdHeight.call(this)
}, b.prototype.getAdExpanded = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdExpanded) || a.prototype.getAdExpanded.call(this) : a.prototype.getAdExpanded.call(this)
}, b.prototype.getAdSkippableState = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdSkippableState) || a.prototype.getAdSkippableState.call(this) : a.prototype.getAdSkippableState.call(this)
}, b.prototype.getAdRemainingTime = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdRemainingTime) || a.prototype.getAdRemainingTime.call(this) : a.prototype.getAdRemainingTime.call(this)
}, b.prototype.getAdDuration = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdDuration) || a.prototype.getAdDuration.call(this) : a.prototype.getAdDuration.call(this)
}, b.prototype.getAdVolume = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdVolume) || a.prototype.getAdVolume.call(this) : a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
var c = this;
this.VPAIDInstance ? (this.callVPAIDInstanceMethod(i.setAdVolume, [b], function() {
a.prototype.setAdVolume.call(c, b)
}), 0 === b ? 0 === this.videoSlot.volume || this.videoSlot.muted || (this.logger.log("Failed to set volume to 0, setting video slot to muted=true"), this.videoSlot.muted = !0) : this.videoSlot.volume !== b && (this.logger.log("Failed to set volume to " + b + " setting video slot volume directly"), this.videoSlot.volume = b)) : a.prototype.setAdVolume.call(this, b)
}, b.prototype.onEvent = function(b, c) {
"undefined" == typeof c && (c = []), this.logEvent(b, c), a.prototype.onEvent.call(this, b, c)
}, b.prototype.logEvent = function(a, b) {
"undefined" == typeof b && (b = []), this.logger.log("Received " + a + " event with arguments:", b)
}, b.prototype.instantiateThirdPartyVPAID = function(a, b, c) {
var d = this;
this.logger.log("Loading VPAID creative, timeout=" + this.adapterConfiguration.timeoutVPAIDLoad + " url=" + a), this.loadTimeout = setTimeout(this.onVPAIDLoadTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDLoad), this.VPAIDLoader = document.createElement("iframe"), this.VPAIDLoader.style.setProperty("display", "none", "important"), document.body.appendChild(this.VPAIDLoader), this.VPAIDLoader.contentWindow.document.open(), this.VPAIDLoader.contentWindow.document.close();
var g = this.VPAIDLoader.contentWindow.document.createElement("script");
g.onload = function() {
var g = d.VPAIDLoader.contentWindow;
if ("function" != typeof g.getVPAIDAd) return void c(e.eventWithType(f.CreativeGeneralError, {
url: a,
message: "Creative does not provide getVPAIDAd constructor"
}));
var h = g.getVPAIDAd();
return d.validateVPAIDCreative(h) ? (h.handshakeVersion("2.0"), d.clearVPAIDLoadTimeout(), void(d.active && b(h))) : void c(e.eventWithType(f.CreativeGeneralError, {
url: a,
message: "Creative does not implement VPAID methods"
}))
}, g.onerror = function(b) {
this.clearVPAIDLoadTimeout(), this.active && c(e.eventWithType(f.CreativeGeneralError, {
message: "VPAID creative load failed with error: " + b.message,
url: a
}))
}, g.src = a, this.VPAIDLoader.contentWindow.document.body.appendChild(g)
}, b.prototype.onLinearVPAIDError = function(a) {
var b = this;
a.id !== f.CreativeComponentError.id && this.VPAIDInstance && this.active === !0 && (this.active = !1, this.stopAd()), setTimeout(function() {
b.destroyThirdPartyVPAID(), b.destroy(), b.eventManager.dispatch(h.AdError, [a])
}, 0)
}, b.prototype.destroyThirdPartyVPAID = function() {
this.clearVPAIDInitTimeout(), this.clearVPAIDLoadTimeout(), this.clearVPAIDStartTimeout(), this.unregisterVPAIDSubscriptions(this.VPAIDInstance), this.VPAIDInstance = null, document.body.removeChild(this.VPAIDLoader), this.VPAIDLoader = null, this.logger.log("Unloaded VPAID creative")
}, b.prototype.registerVPAIDSubscriptions = function(a) {
"object" == typeof a && "function" == typeof a.subscribe && (this.logger.log("Registering event subscriptions on VPAID instance:", a), a.subscribe(this.onCreativeAdLoaded, h.AdLoaded, this), a.subscribe(this.onCreativeAdStarted, h.AdStarted, this), a.subscribe(this.onCreativeAdStopped, h.AdStopped, this), a.subscribe(this.onCreativeAdSkipped, h.AdSkipped, this), a.subscribe(this.onCreativeAdSkippableStateChange, h.AdSkippableStateChange, this), a.subscribe(this.onCreativeAdSizeChange, h.AdSizeChange, this), a.subscribe(this.onCreativeAdLinearChange, h.AdLinearChange, this), a.subscribe(this.onCreativeAdDurationChange, h.AdDurationChange, this), a.subscribe(this.onCreativeAdExpandedChange, h.AdExpandedChange, this), a.subscribe(this.onCreativeAdVolumeChange, h.AdVolumeChange, this), a.subscribe(this.onCreativeAdImpression, h.AdImpression, this), a.subscribe(this.onCreativeAdVideoStart, h.AdVideoStart, this), a.subscribe(this.onCreativeAdVideoFirstQuartile, h.AdVideoFirstQuartile, this), a.subscribe(this.onCreativeAdVideoMidpoint, h.AdVideoMidpoint, this), a.subscribe(this.onCreativeAdVideoThirdQuartile, h.AdVideoThirdQuartile, this), a.subscribe(this.onCreativeAdVideoComplete, h.AdVideoComplete, this), a.subscribe(this.onCreativeAdClickThru, h.AdClickThru, this), a.subscribe(this.onCreativeAdInteraction, h.AdInteraction, this), a.subscribe(this.onCreativeAdUserAcceptInvitation, h.AdUserAcceptInvitation, this), a.subscribe(this.onCreativeAdUserMinimize, h.AdUserMinimize, this), a.subscribe(this.onCreativeAdUserClose, h.AdUserClose, this), a.subscribe(this.onCreativeAdPaused, h.AdPaused, this), a.subscribe(this.onCreativeAdPlaying, h.AdPlaying, this), a.subscribe(this.onCreativeAdLog, h.AdLog, this), a.subscribe(this.onCreativeAdError, h.AdError, this))
}, b.prototype.unregisterVPAIDSubscriptions = function(a) {
"object" == typeof a && "function" == typeof a.unsubscribe && (this.logger.log("Unregistering event subscriptions on VPAID instance:", a), a.unsubscribe(this.onCreativeAdLoaded, h.AdLoaded), a.unsubscribe(this.onCreativeAdStarted, h.AdStarted), a.unsubscribe(this.onCreativeAdStopped, h.AdStopped), a.unsubscribe(this.onCreativeAdSkipped, h.AdSkipped), a.unsubscribe(this.onCreativeAdSkippableStateChange, h.AdSkippableStateChange), a.unsubscribe(this.onCreativeAdSizeChange, h.AdSizeChange), a.unsubscribe(this.onCreativeAdLinearChange, h.AdLinearChange), a.unsubscribe(this.onCreativeAdDurationChange, h.AdDurationChange), a.unsubscribe(this.onCreativeAdExpandedChange, h.AdExpandedChange), a.unsubscribe(this.onCreativeAdVolumeChange, h.AdVolumeChange), a.unsubscribe(this.onCreativeAdImpression, h.AdImpression), a.unsubscribe(this.onCreativeAdVideoStart, h.AdVideoStart), a.unsubscribe(this.onCreativeAdVideoFirstQuartile, h.AdVideoFirstQuartile), a.unsubscribe(this.onCreativeAdVideoMidpoint, h.AdVideoMidpoint), a.unsubscribe(this.onCreativeAdVideoThirdQuartile, h.AdVideoThirdQuartile), a.unsubscribe(this.onCreativeAdVideoComplete, h.AdVideoComplete), a.unsubscribe(this.onCreativeAdClickThru, h.AdClickThru), a.unsubscribe(this.onCreativeAdInteraction, h.AdInteraction), a.unsubscribe(this.onCreativeAdUserAcceptInvitation, h.AdUserAcceptInvitation), a.unsubscribe(this.onCreativeAdUserMinimize, h.AdUserMinimize), a.unsubscribe(this.onCreativeAdUserClose, h.AdUserClose), a.unsubscribe(this.onCreativeAdPaused, h.AdPaused), a.unsubscribe(this.onCreativeAdPlaying, h.AdPlaying), a.unsubscribe(this.onCreativeAdLog, h.AdLog), a.unsubscribe(this.onCreativeAdError, h.AdError))
}, b.prototype.callVPAIDInstanceMethod = function(a, b, c) {
"undefined" == typeof b && (b = []), "undefined" == typeof c && (c = null);
try {
var d = this.VPAIDInstance;
return d[a].apply(d, b)
} catch (e) {
this.logger.error("VPAID instance uncaught error, method=" + a + " args=", b, "message=" + e.message, "error=", e), null !== c && c(e)
}
}, b.prototype.callVPAIDInstanceMethodOrDie = function(a, b) {
var c = this;
"undefined" == typeof b && (b = []), this.callVPAIDInstanceMethod(a, b, function(b) {
c.onLinearVPAIDError(e.eventWithType(f.CreativeGeneralError, {
url: c.adCandidate.getThirdPartyData("url"),
message: "Exception thrown calling " + a + " method: " + b.message
}))
})
}, b.prototype.destroy = function() {
this.active = !1, this.VPAIDInstance && (this.stopAd(), this.destroyThirdPartyVPAID()), this.videoSlot = null, this.slot = null, this.adapterConfiguration = null, this.adCandidate = null, a.prototype.destroy.call(this)
}, b
}(c);
return j
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDAdapter", ["require", "exports", "Adapter", "MimeType", "VPAIDEvents", "VPAIDFlashWrapper", "VPAIDHtmlWrapper"], function(a, b, c, d, e, f, g) {
var h = function(a) {
function b(b) {
a.call(this, "VPAIDAdapter"), this.destroy(), b && b(this)
}
return __extends(b, a), b.prototype.supports = function(a) {
return !1
}, b.prototype.initAd = function(b, c, e, h, i, j) {
a.prototype.initAd.call(this, b, c, e, h, i, j), this.logger.debug("initAd(", b, ",", c, ",", e, ",", h, ",", i, ",", j, ")"), this.active = !0;
var k = j.adCandidate;
k.getThirdPartyData("type") === d.JavaScript ? this.wrapper = new g : this.wrapper = new f, this.registerVPAIDWrapper(this.wrapper), this.wrapper.initAd(b, c, e, h, i, j)
}, b.prototype.resizeAd = function(a, b, c) {
this.wrapper.resizeAd(a, b, c)
}, b.prototype.startAd = function() {
this.wrapper.startAd()
}, b.prototype.stopAd = function() {
this.wrapper.stopAd()
}, b.prototype.pauseAd = function() {
this.wrapper.pauseAd()
}, b.prototype.resumeAd = function() {
this.wrapper.resumeAd()
}, b.prototype.expandAd = function() {
this.wrapper.expandAd()
}, b.prototype.collapseAd = function() {
this.wrapper.collapseAd()
}, b.prototype.skipAd = function() {
this.wrapper.skipAd()
}, b.prototype.getAdLinear = function() {
return this.wrapper ? this.wrapper.getAdLinear() : a.prototype.getAdLinear.call(this)
}, b.prototype.getAdWidth = function() {
return this.active && this.wrapper ? this.wrapper.getAdWidth() : a.prototype.getAdWidth.call(this)
}, b.prototype.getAdHeight = function() {
return this.active && this.wrapper ? this.wrapper.getAdHeight() : a.prototype.getAdHeight.call(this)
}, b.prototype.getAdExpanded = function() {
return this.active && this.wrapper ? this.wrapper.getAdExpanded() : a.prototype.getAdExpanded.call(this)
}, b.prototype.getAdSkippableState = function() {
return this.active && this.wrapper ? this.wrapper.getAdSkippableState() : a.prototype.getAdSkippableState.call(this)
}, b.prototype.getAdRemainingTime = function() {
return this.active && this.wrapper ? this.wrapper.getAdRemainingTime() : a.prototype.getAdRemainingTime.call(this)
}, b.prototype.getAdDuration = function() {
return this.active && this.wrapper ? this.wrapper.getAdDuration() : a.prototype.getAdDuration.call(this)
}, b.prototype.getAdVolume = function() {
return this.active && this.wrapper ? this.wrapper.getAdVolume() : a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
this.active && this.wrapper && this.wrapper.setAdVolume(b), a.prototype.setAdVolume.call(this, b)
}, b.prototype.onAdStarted = function() {
this.adLinear = this.wrapper.getAdLinear(), a.prototype.onAdStarted.call(this)
}, b.prototype.onAdLinearChange = function() {
this.adLinear = this.wrapper.getAdLinear(), a.prototype.onAdLinearChange.call(this)
}, b.prototype.isPaused = function() {
return this._paused
}, b.prototype.onAdPaused = function() {
this._paused = !0, a.prototype.onAdPaused.call(this)
}, b.prototype.onAdPlaying = function() {
this._paused = !1, a.prototype.onAdPlaying.call(this)
}, b.prototype.unregisterVPAIDWrapperInstance = function() {
this.logger.log("Unregistering VPAID wrapper"), this.unregisterVPAIDWrapper(this.wrapper), this.wrapper.destroy()
}, b.prototype.registerVPAIDWrapper = function(a) {
"object" == typeof a && "function" == typeof a.subscribe && (this.wrapper.setAdVolume(this.adVolume), this.logger.log("Registering event subscriptions on wrapper instance:", a), a.subscribe(this.onAdLoaded, e.AdLoaded, this), a.subscribe(this.onAdStarted, e.AdStarted, this), a.subscribe(this.onAdStopped, e.AdStopped, this), a.subscribe(this.onAdSkipped, e.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, e.AdSizeChange, this), a.subscribe(this.onAdLinearChange, e.AdLinearChange, this), a.subscribe(this.onAdDurationChange, e.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, e.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, e.AdVolumeChange, this), a.subscribe(this.onAdImpression, e.AdImpression, this), a.subscribe(this.onAdVideoStart, e.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, e.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, e.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, e.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, e.AdVideoComplete, this), a.subscribe(this.onAdClickThru, e.AdClickThru, this), a.subscribe(this.onAdInteraction, e.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, e.AdUserMinimize, this), a.subscribe(this.onAdUserClose, e.AdUserClose, this), a.subscribe(this.onAdPaused, e.AdPaused, this), a.subscribe(this.onAdPlaying, e.AdPlaying, this), a.subscribe(this.onAdLog, e.AdLog, this), a.subscribe(this.onAdError, e.AdError, this))
}, b.prototype.unregisterVPAIDWrapper = function(a) {
"object" == typeof a && "function" == typeof a.unsubscribe && (this.logger.log("Unregistering event subscriptions on wrapper instance:", a), a.unsubscribe(this.onAdLoaded, e.AdLoaded), a.unsubscribe(this.onAdStarted, e.AdStarted), a.unsubscribe(this.onAdStopped, e.AdStopped), a.unsubscribe(this.onAdSkipped, e.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, e.AdSizeChange), a.unsubscribe(this.onAdLinearChange, e.AdLinearChange), a.unsubscribe(this.onAdDurationChange, e.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, e.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, e.AdVolumeChange), a.unsubscribe(this.onAdImpression, e.AdImpression), a.unsubscribe(this.onAdVideoStart, e.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, e.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, e.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, e.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, e.AdVideoComplete), a.unsubscribe(this.onAdClickThru, e.AdClickThru), a.unsubscribe(this.onAdInteraction, e.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, e.AdUserMinimize), a.unsubscribe(this.onAdUserClose, e.AdUserClose), a.unsubscribe(this.onAdPaused, e.AdPaused), a.unsubscribe(this.onAdPlaying, e.AdPlaying), a.unsubscribe(this.onAdLog, e.AdLog), a.unsubscribe(this.onAdError, e.AdError))
}, b.prototype.destroy = function() {
this.active = !1, this.wrapper && (this.unregisterVPAIDWrapperInstance(), this.wrapper = null), a.prototype.destroy.call(this)
}, b
}(c);
return h
}), define("AdapterFactory", ["require", "exports", "LRAdapter", "VPAIDAdapter"], function(a, b, c, d) {
var e = function() {
function a() {
this.adapterInstanceDictionary = {}
}
return a.setInstanceData = function(a) {
this.instanceData = a
}, a.getAvailableAdapters = function() {
var a = ["LR"];
return this.instanceData && this.instanceData.getDisableIframes() !== !0 && a.push("VPAID"), a
}, a.prototype.getAdapterInstance = function(b, e) {
var f = this,
g = function(a) {
f.adapterInstanceDictionary[b] || (f.adapterInstanceDictionary[b] = a), e(f.adapterInstanceDictionary[b] || null)
};
if (-1 === a.getAvailableAdapters().indexOf(b) || this.adapterInstanceDictionary.hasOwnProperty(b)) g(this.adapterInstanceDictionary[b]);
else switch (b) {
case "LR":
new c(g);
break;
case "VPAID":
new d(g)
}
}, a
}();
return e
}), define("AdapterConfiguration", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
var c = a.getAdParameters();
this.adRequestTimeout = c.adRequestTimeout, this.adCreativeTimeout = c.adCreativeTimeout, this.timeoutVPAIDLoad = c.timeoutVPAIDLoad, this.timeoutVPAIDInit = c.timeoutVPAIDInit, this.timeoutVPAIDStart = c.timeoutVPAIDStart, this.desiredBitrate = c.desiredBitrate, this.linearSkin = c.linearSkin, this.indexMessage = c.indexMessage || b.indexMessage, this.countdownMessage = c.countdownMessage || b.countdownMessage, this.clickthroughMessage = c.clickthroughMessage || b.clickthroughMessage, this.skipCountdownMessage = c.skipCountdownMessage || b.skipCountdownMessage, this.skipMessage = c.skipMessage || b.skipMessage, this.showCountdown = c.showCountdown, this.clickElement = c.clickElement, this.playerHandlesClick = c.playerHandlesClick, this.pauseOnClick = c.pauseOnClick, this.placementType = b.placementType, this.allowExpand = b.allowExpand, this.allowSMS = b.allowSMS, this.allowTelephone = b.allowTelephone, this.allowWebcal = b.allowWebcal, this.allowResize = b.allowResize, this.allowPhoto = b.allowPhoto, this.allowCalendar = b.allowCalendar, this.mimeTypePriorityList = a.mimeTypePriorityList
}
return a.prototype.propertyOrDefault = function(a, b) {
return null !== a ? a : b
}, a
}();
return c
}), define("AdExtensionManager", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.prototype.init = function(a) {
this.adResponse = a
}, a.prototype.register = function(a, b) {
this.adapter = a, this.adCandidate = b
}, a.prototype.unregister = function() {}, a.prototype.onFullscreenEnter = function() {}, a.prototype.onFullscreenExit = function() {},
a
}();
return c
}), define("AdSourceRequestStatus", ["require", "exports"], function(a, b) {
var c;
return function(a) {
a[a.success = 0] = "success", a[a.empty = 1] = "empty", a[a.creativeError = 200] = "creativeError", a[a.ioError = 300] = "ioError", a[a.timeout = 301] = "timeout", a[a.wrapperLimit = 302] = "wrapperLimit"
}(c || (c = {})), c
}), define("AdSourceRequest", ["require", "exports", "AdSourceRequestStatus"], function(a, b, c) {
var d = function() {
function a(a, b) {
this.status = 0, this.totalDuration = 0, this.responses = [], this.id = a, this.adSource = b;
var c = b.getErc();
null !== c && (this.status = c)
}
return a.prototype.getId = function() {
return this.id
}, a.prototype.getAdSource = function() {
return this.adSource
}, a.prototype.getStatus = function() {
return this.status
}, a.prototype.setStatus = function(a) {
this.status = a
}, a.prototype.getTotalDuration = function() {
return this.totalDuration
}, a.prototype.increaseTotalDuration = function(a) {
this.totalDuration += a
}, a.prototype.addResponse = function(a) {
this.responses.push(a)
}, a.prototype.getResponses = function() {
return this.responses
}, a
}();
return d
}), define("HTTPRequest", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.aborted = !1
}
return a.prototype.setXMLHttpRequest = function(a) {
this.requestObject = a
}, a.prototype.getReadyState = function() {
return this.requestObject.readyState
}, a.prototype.abort = function() {
this.aborted = !0, this.requestObject.abort()
}, a.prototype.isAborted = function() {
return this.aborted
}, a
}();
return c
}), ! function() {
"use strict";
var a = {};
a.request = function(a) {
var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u;
if ("object" != typeof a || !a.url) return null;
d = "corserror", e = "error", f = "parsererror", g = "timeout", i = {
latency: null,
duration: null
}, q = a.url, o = "GET", "POST" === a.type && (o = "POST"), j = function(b) {
"function" == typeof a.onloadstart && a.onloadstart(b)
}, k = function(b) {
"function" == typeof a.onprogress && a.onprogress(b)
}, l = function(d) {
if (void 0 === c.responseText || null === c.responseText) return m(e), c;
if (r = d.responseText, "json" === a.dataType) try {
r = JSON.parse(d.responseText)
} catch (g) {
return void m(f, g)
}
if ("xml" === a.dataType) try {
if (r = d.responseXML || null, (!r || !d.responseXML.documentElement) && "string" == typeof d.responseText && d.responseText.length > 0) {
if (!window.DOMParser) throw null;
try {
r = (new window.DOMParser).parseFromString(d.responseText, "text/xml")
} catch (h) {
throw null
}
}
if (r && "parsererror" === r.documentElement.tagName) throw null;
if (r && r.getElementsByTagName("parsererror").length > 0) throw null
} catch (j) {
return void m(f)
}
b && (b = !1, "function" == typeof a.success && a.success(r, "success", c, i))
}, m = function(d, f) {
var g = e,
h = e;
s && (clearTimeout(s), s = void 0), b && (b = !1, "function" == typeof a.error && ("string" == typeof d && (g = d), "object" == typeof f && (h = f.message), a.error(c, g, h, i)))
}, b = !0;
try {
h = document.createElement("a"), h.href = q, n = h.hostname
} catch (v) {}
if (!window.XMLHttpRequest || "" !== n && window.location.hostname !== n && void 0 === (new window.XMLHttpRequest).withCredentials) {
if (!window.XDomainRequest) return window.setTimeout(function() {
m(d)
}, 0), null;
c = new window.XDomainRequest;
try {
c.open(o, q)
} catch (w) {
return window.setTimeout(function() {
m(e, w)
}, 0), c
}
c.onload = function() {
i.duration = Date.now() - p, l(c)
}, c.onprogress = function() {
i.latency = Date.now() - p
}, c.onerror = function(a) {
i.duration = Date.now() - p, m(e, a)
}, c.ontimeout = function(a) {
m(g, a)
}, "number" == typeof a.timeout && (c.timeout = a.timeout)
} else {
c = new window.XMLHttpRequest, c.overrideMimeType && ("json" === a.dataType && c.overrideMimeType("application/json"), "xml" === a.dataType && c.overrideMimeType("text/xml"));
try {
c.open(o, q, !0)
} catch (w) {
return window.setTimeout(function() {
m(e, w)
}, 0), c
}
if (c.withCredentials = !0, "POST" === o && c.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), c.onreadystatechange = function() {
return b && (2 === c.readyState && (i.latency = Date.now() - p), 4 === c.readyState) ? (i.duration = Date.now() - p, 200 !== c.status ? void m(e) : void l(c)) : void 0
}, c.onloadstart = j, "object" == typeof a.xhrFields)
for (u in a.xhrFields) a.xhrFields.hasOwnProperty(u) && (c[u] = a.xhrFields[u]);
"number" == typeof a.timeout && (t = a.timeout)
}
try {
c.onprogress = k, "number" == typeof t && (s = setTimeout(function() {
m(g)
}, t)), p = Date.now(), c.send(a.data)
} catch (x) {
window.setTimeout(function() {
m(e, x)
}, 0)
}
return c
}, "object" == typeof exports ? module.exports = a : "function" == typeof define && define("Ajax", [], function() {
return a
})
}(), ! function() {
function a() {
function a() {
! function(a) {
function b() {
function a(a) {
var b, c, e, f, g, h, j = d.dyn_tree,
k = d.stat_desc.static_tree,
l = d.stat_desc.extra_bits,
m = d.stat_desc.extra_base,
n = d.stat_desc.max_length,
p = 0;
for (f = 0; i >= f; f++) a.bl_count[f] = 0;
for (j[2 * a.heap[a.heap_max] + 1] = 0, b = a.heap_max + 1; o > b; b++) c = a.heap[b], f = j[2 * j[2 * c + 1] + 1] + 1, f > n && (f = n, p++), j[2 * c + 1] = f, c > d.max_code || (a.bl_count[f]++, g = 0, c >= m && (g = l[c - m]), h = j[2 * c], a.opt_len += h * (f + g), k && (a.static_len += h * (k[2 * c + 1] + g)));
if (0 !== p) {
do {
for (f = n - 1; 0 === a.bl_count[f];) f--;
a.bl_count[f]--, a.bl_count[f + 1] += 2, a.bl_count[n]--, p -= 2
} while (p > 0);
for (f = n; 0 !== f; f--)
for (c = a.bl_count[f]; 0 !== c;) e = a.heap[--b], e > d.max_code || (j[2 * e + 1] != f && (a.opt_len += (f - j[2 * e + 1]) * j[2 * e], j[2 * e + 1] = f), c--)
}
}
function b(a, b) {
var c = 0;
do c |= 1 & a, a >>>= 1, c <<= 1; while (--b > 0);
return c >>> 1
}
function c(a, c, d) {
var e, f, g, h = [],
j = 0;
for (e = 1; i >= e; e++) h[e] = j = j + d[e - 1] << 1;
for (f = 0; c >= f; f++) g = a[2 * f + 1], 0 !== g && (a[2 * f] = b(h[g]++, g))
}
var d = this;
d.build_tree = function(b) {
var e, f, g, h = d.dyn_tree,
i = d.stat_desc.static_tree,
j = d.stat_desc.elems,
k = -1;
for (b.heap_len = 0, b.heap_max = o, e = 0; j > e; e++) 0 !== h[2 * e] ? (b.heap[++b.heap_len] = k = e, b.depth[e] = 0) : h[2 * e + 1] = 0;
for (; b.heap_len < 2;) g = b.heap[++b.heap_len] = 2 > k ? ++k : 0, h[2 * g] = 1, b.depth[g] = 0, b.opt_len--, i && (b.static_len -= i[2 * g + 1]);
for (d.max_code = k, e = Math.floor(b.heap_len / 2); e >= 1; e--) b.pqdownheap(h, e);
g = j;
do e = b.heap[1], b.heap[1] = b.heap[b.heap_len--], b.pqdownheap(h, 1), f = b.heap[1], b.heap[--b.heap_max] = e, b.heap[--b.heap_max] = f, h[2 * g] = h[2 * e] + h[2 * f], b.depth[g] = Math.max(b.depth[e], b.depth[f]) + 1, h[2 * e + 1] = h[2 * f + 1] = g, b.heap[1] = g++, b.pqdownheap(h, 1); while (b.heap_len >= 2);
b.heap[--b.heap_max] = b.heap[1], a(b), c(h, d.max_code, b.bl_count)
}
}
function c(a, b, c, d, e) {
var f = this;
f.static_tree = a, f.extra_bits = b, f.extra_base = c, f.elems = d, f.max_length = e
}
function d(a, b, c, d, e) {
var f = this;
f.good_length = a, f.max_lazy = b, f.nice_length = c, f.max_chain = d, f.func = e
}
function e(a, b, c, d) {
var e = a[2 * b],
f = a[2 * c];
return f > e || e == f && d[b] <= d[c]
}
function f() {
function a() {
var a;
for (Ea = 2 * Aa, Ga[Ia - 1] = 0, a = 0; Ia - 1 > a; a++) Ga[a] = 0;
Va = P[Wa].max_lazy, Ya = P[Wa].good_length, Za = P[Wa].nice_length, Ua = P[Wa].max_chain, Qa = 0, Ma = 0, Sa = 0, Na = Ta = ba - 1, Pa = 0, Ha = 0
}
function d() {
var a;
for (a = 0; n > a; a++) $a[2 * a] = 0;
for (a = 0; j > a; a++) _a[2 * a] = 0;
for (a = 0; k > a; a++) ab[2 * a] = 0;
$a[2 * p] = 1, bb.opt_len = bb.static_len = 0, hb = jb = 0
}
function f() {
cb.dyn_tree = $a, cb.stat_desc = c.static_l_desc, db.dyn_tree = _a, db.stat_desc = c.static_d_desc, eb.dyn_tree = ab, eb.stat_desc = c.static_bl_desc, lb = 0, mb = 0, kb = 8, d()
}
function g(a, b) {
var c, d, e = -1,
f = a[1],
g = 0,
h = 7,
i = 4;
for (0 === f && (h = 138, i = 3), a[2 * (b + 1) + 1] = 65535, c = 0; b >= c; c++) d = f, f = a[2 * (c + 1) + 1], ++g < h && d == f || (i > g ? ab[2 * d] += g : 0 !== d ? (d != e && ab[2 * d]++, ab[2 * r]++) : 10 >= g ? ab[2 * s]++ : ab[2 * t]++, g = 0, e = d, 0 === f ? (h = 138, i = 3) : d == f ? (h = 6, i = 3) : (h = 7, i = 4))
}
function h() {
var a;
for (g($a, cb.max_code), g(_a, db.max_code), eb.build_tree(bb), a = k - 1; a >= 3 && 0 === ab[2 * b.bl_order[a] + 1]; a--);
return bb.opt_len += 3 * (a + 1) + 5 + 5 + 4, a
}
function i(a) {
bb.pending_buf[bb.pending++] = a
}
function l(a) {
i(255 & a), i(a >>> 8 & 255)
}
function o(a) {
i(a >> 8 & 255), i(255 & a & 255)
}
function q(a, b) {
var c, d = b;
mb > u - d ? (c = a, lb |= c << mb & 65535, l(lb), lb = c >>> u - mb, mb += d - u) : (lb |= a << mb & 65535, mb += d)
}
function J(a, b) {
var c = 2 * a;
q(65535 & b[c], 65535 & b[c + 1])
}
function ea(a, b) {
var c, d, e = -1,
f = a[1],
g = 0,
h = 7,
i = 4;
for (0 === f && (h = 138, i = 3), c = 0; b >= c; c++)
if (d = f, f = a[2 * (c + 1) + 1], !(++g < h && d == f)) {
if (i > g) {
do J(d, ab); while (0 !== --g)
} else 0 !== d ? (d != e && (J(d, ab), g--), J(r, ab), q(g - 3, 2)) : 10 >= g ? (J(s, ab), q(g - 3, 3)) : (J(t, ab), q(g - 11, 7));
g = 0, e = d, 0 === f ? (h = 138, i = 3) : d == f ? (h = 6, i = 3) : (h = 7, i = 4)
}
}
function fa(a, c, d) {
var e;
for (q(a - 257, 5), q(c - 1, 5), q(d - 4, 4), e = 0; d > e; e++) q(ab[2 * b.bl_order[e] + 1], 3);
ea($a, a - 1), ea(_a, c - 1)
}
function ga() {
16 == mb ? (l(lb), lb = 0, mb = 0) : mb >= 8 && (i(255 & lb), lb >>>= 8, mb -= 8)
}
function ha() {
q(_ << 1, 3), J(p, c.static_ltree), ga(), 9 > 1 + kb + 10 - mb && (q(_ << 1, 3), J(p, c.static_ltree), ga()), kb = 7
}
function ia(a, c) {
var d, e, f;
if (bb.pending_buf[ib + 2 * hb] = a >>> 8 & 255, bb.pending_buf[ib + 2 * hb + 1] = 255 & a, bb.pending_buf[fb + hb] = 255 & c, hb++, 0 === a ? $a[2 * c]++ : (jb++, a--, $a[2 * (b._length_code[c] + m + 1)]++, _a[2 * b.d_code(a)]++), 0 === (8191 & hb) && Wa > 2) {
for (d = 8 * hb, e = Qa - Ma, f = 0; j > f; f++) d += _a[2 * f] * (5 + b.extra_dbits[f]);
if (d >>>= 3, jb < Math.floor(hb / 2) && d < Math.floor(e / 2)) return !0
}
return hb == gb - 1
}
function ja(a, c) {
var d, e, f, g, h = 0;
if (0 !== hb)
do d = bb.pending_buf[ib + 2 * h] << 8 & 65280 | 255 & bb.pending_buf[ib + 2 * h + 1], e = 255 & bb.pending_buf[fb + h], h++, 0 === d ? J(e, a) : (f = b._length_code[e], J(f + m + 1, a), g = b.extra_lbits[f], 0 !== g && (e -= b.base_length[f], q(e, g)), d--, f = b.d_code(d), J(f, c), g = b.extra_dbits[f], 0 !== g && (d -= b.base_dist[f], q(d, g))); while (hb > h);
J(p, a), kb = a[2 * p + 1]
}
function ka() {
mb > 8 ? l(lb) : mb > 0 && i(255 & lb), lb = 0, mb = 0
}
function la(a, b, c) {
ka(), kb = 8, c && (l(b), l(~b)), bb.pending_buf.set(Da.subarray(a, a + b), bb.pending), bb.pending += b
}
function ma(a, b, c) {
q(($ << 1) + (c ? 1 : 0), 3), la(a, b, !0)
}
function na(a, b, e) {
var f, g, i = 0;
Wa > 0 ? (cb.build_tree(bb), db.build_tree(bb), i = h(), f = bb.opt_len + 3 + 7 >>> 3, g = bb.static_len + 3 + 7 >>> 3, f >= g && (f = g)) : f = g = b + 5, f >= b + 4 && -1 != a ? ma(a, b, e) : g == f ? (q((_ << 1) + (e ? 1 : 0), 3), ja(c.static_ltree, c.static_dtree)) : (q((aa << 1) + (e ? 1 : 0), 3), fa(cb.max_code + 1, db.max_code + 1, i + 1), ja($a, _a)), d(), e && ka()
}
function oa(a) {
na(Ma >= 0 ? Ma : -1, Qa - Ma, a), Ma = Qa, va.flush_pending()
}
function pa() {
var a, b, c, d;
do {
if (d = Ea - Sa - Qa, 0 === d && 0 === Qa && 0 === Sa) d = Aa;
else if (-1 == d) d--;
else if (Qa >= Aa + Aa - da) {
Da.set(Da.subarray(Aa, Aa + Aa), 0), Ra -= Aa, Qa -= Aa, Ma -= Aa, a = Ia, c = a;
do b = 65535 & Ga[--c], Ga[c] = b >= Aa ? b - Aa : 0; while (0 !== --a);
a = Aa, c = a;
do b = 65535 & Fa[--c], Fa[c] = b >= Aa ? b - Aa : 0; while (0 !== --a);
d += Aa
}
if (0 === va.avail_in) return;
a = va.read_buf(Da, Qa + Sa, d), Sa += a, Sa >= ba && (Ha = 255 & Da[Qa], Ha = (Ha << La ^ 255 & Da[Qa + 1]) & Ka)
} while (da > Sa && 0 !== va.avail_in)
}
function qa(a) {
var b, c = 65535;
for (c > xa - 5 && (c = xa - 5);;) {
if (1 >= Sa) {
if (pa(), 0 === Sa && a == z) return R;
if (0 === Sa) break
}
if (Qa += Sa, Sa = 0, b = Ma + c, (0 === Qa || Qa >= b) && (Sa = Qa - b, Qa = b, oa(!1), 0 === va.avail_out)) return R;
if (Qa - Ma >= Aa - da && (oa(!1), 0 === va.avail_out)) return R
}
return oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ra(a) {
var b, c, d = Ua,
e = Qa,
f = Ta,
g = Qa > Aa - da ? Qa - (Aa - da) : 0,
h = Za,
i = Ca,
j = Qa + ca,
k = Da[e + f - 1],
l = Da[e + f];
Ta >= Ya && (d >>= 2), h > Sa && (h = Sa);
do
if (b = a, Da[b + f] == l && Da[b + f - 1] == k && Da[b] == Da[e] && Da[++b] == Da[e + 1]) {
e += 2, b++;
do; while (Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && j > e);
if (c = ca - (j - e), e = j - ca, c > f) {
if (Ra = a, f = c, c >= h) break;
k = Da[e + f - 1], l = Da[e + f]
}
}
while ((a = 65535 & Fa[a & i]) > g && 0 !== --d);
return Sa >= f ? f : Sa
}
function sa(a) {
for (var b, c = 0;;) {
if (da > Sa) {
if (pa(), da > Sa && a == z) return R;
if (0 === Sa) break
}
if (Sa >= ba && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, c = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa), 0 !== c && Aa - da >= (Qa - c & 65535) && Xa != x && (Na = ra(c)), Na >= ba)
if (b = ia(Qa - Ra, Na - ba), Sa -= Na, Va >= Na && Sa >= ba) {
Na--;
do Qa++, Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, c = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa; while (0 !== --Na);
Qa++
} else Qa += Na, Na = 0, Ha = 255 & Da[Qa], Ha = (Ha << La ^ 255 & Da[Qa + 1]) & Ka;
else b = ia(0, 255 & Da[Qa]), Sa--, Qa++;
if (b && (oa(!1), 0 === va.avail_out)) return R
}
return oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ta(a) {
for (var b, c, d = 0;;) {
if (da > Sa) {
if (pa(), da > Sa && a == z) return R;
if (0 === Sa) break
}
if (Sa >= ba && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, d = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa), Ta = Na, Oa = Ra, Na = ba - 1, 0 !== d && Va > Ta && Aa - da >= (Qa - d & 65535) && (Xa != x && (Na = ra(d)), 5 >= Na && (Xa == w || Na == ba && Qa - Ra > 4096) && (Na = ba - 1)), Ta >= ba && Ta >= Na) {
c = Qa + Sa - ba, b = ia(Qa - 1 - Oa, Ta - ba), Sa -= Ta - 1, Ta -= 2;
do ++Qa <= c && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, d = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa); while (0 !== --Ta);
if (Pa = 0, Na = ba - 1, Qa++, b && (oa(!1), 0 === va.avail_out)) return R
} else if (0 !== Pa) {
if (b = ia(0, 255 & Da[Qa - 1]), b && oa(!1), Qa++, Sa--, 0 === va.avail_out) return R
} else Pa = 1, Qa++, Sa--
}
return 0 !== Pa && (b = ia(0, 255 & Da[Qa - 1]), Pa = 0), oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ua(b) {
return b.total_in = b.total_out = 0, b.msg = null, bb.pending = 0, bb.pending_out = 0, wa = W, za = z, f(), a(), D
}
var va, wa, xa, ya, za, Aa, Ba, Ca, Da, Ea, Fa, Ga, Ha, Ia, Ja, Ka, La, Ma, Na, Oa, Pa, Qa, Ra, Sa, Ta, Ua, Va, Wa, Xa, Ya, Za, $a, _a, ab, bb = this,
cb = new b,
db = new b,
eb = new b;
bb.depth = [];
var fb, gb, hb, ib, jb, kb, lb, mb;
bb.bl_count = [], bb.heap = [], $a = [], _a = [], ab = [], bb.pqdownheap = function(a, b) {
for (var c = bb.heap, d = c[b], f = b << 1; f <= bb.heap_len && (f < bb.heap_len && e(a, c[f + 1], c[f], bb.depth) && f++, !e(a, d, c[f], bb.depth));) c[b] = c[f], b = f, f <<= 1;
c[b] = d
}, bb.deflateInit = function(a, b, c, d, e, f) {
return d || (d = Z), e || (e = L), f || (f = y), a.msg = null, b == v && (b = 6), 1 > e || e > K || d != Z || 9 > c || c > 15 || 0 > b || b > 9 || 0 > f || f > x ? G : (a.dstate = bb, Ba = c, Aa = 1 << Ba, Ca = Aa - 1, Ja = e + 7, Ia = 1 << Ja, Ka = Ia - 1, La = Math.floor((Ja + ba - 1) / ba), Da = new Uint8Array(2 * Aa), Fa = [], Ga = [], gb = 1 << e + 6, bb.pending_buf = new Uint8Array(4 * gb), xa = 4 * gb, ib = Math.floor(gb / 2), fb = 3 * gb, Wa = b, Xa = f, ya = 255 & d, ua(a))
}, bb.deflateEnd = function() {
return wa != W && wa != X && wa != Y ? G : (bb.pending_buf = null, Ga = null, Fa = null, Da = null, bb.dstate = null, wa == X ? H : D)
}, bb.deflateParams = function(a, b, c) {
var d = D;
return b == v && (b = 6), 0 > b || b > 9 || 0 > c || c > x ? G : (P[Wa].func != P[b].func && 0 !== a.total_in && (d = a.deflate(A)), Wa != b && (Wa = b, Va = P[Wa].max_lazy, Ya = P[Wa].good_length, Za = P[Wa].nice_length, Ua = P[Wa].max_chain), Xa = c, d)
}, bb.deflateSetDictionary = function(a, b, c) {
var d, e = c,
f = 0;
if (!b || wa != W) return G;
if (ba > e) return D;
for (e > Aa - da && (e = Aa - da, f = c - e), Da.set(b.subarray(f, f + e), 0), Qa = e, Ma = e, Ha = 255 & Da[0], Ha = (Ha << La ^ 255 & Da[1]) & Ka, d = 0; e - ba >= d; d++) Ha = (Ha << La ^ 255 & Da[d + (ba - 1)]) & Ka, Fa[d & Ca] = Ga[Ha], Ga[Ha] = d;
return D
}, bb.deflate = function(a, b) {
var c, d, e, f, g;
if (b > C || 0 > b) return G;
if (!a.next_out || !a.next_in && 0 !== a.avail_in || wa == Y && b != C) return a.msg = Q[F - G], G;
if (0 === a.avail_out) return a.msg = Q[F - I], I;
if (va = a, f = za, za = b, wa == W && (d = Z + (Ba - 8 << 4) << 8, e = (Wa - 1 & 255) >> 1, e > 3 && (e = 3), d |= e << 6, 0 !== Qa && (d |= V), d += 31 - d % 31, wa = X, o(d)), 0 !== bb.pending) {
if (va.flush_pending(), 0 === va.avail_out) return za = -1, D
} else if (0 === va.avail_in && f >= b && b != C) return va.msg = Q[F - I], I;
if (wa == Y && 0 !== va.avail_in) return a.msg = Q[F - I], I;
if (0 !== va.avail_in || 0 !== Sa || b != z && wa != Y) {
switch (g = -1, P[Wa].func) {
case M:
g = qa(b);
break;
case N:
g = sa(b);
break;
case O:
g = ta(b)
}
if ((g == T || g == U) && (wa = Y), g == R || g == T) return 0 === va.avail_out && (za = -1), D;
if (g == S) {
if (b == A) ha();
else if (ma(0, 0, !1), b == B)
for (c = 0; Ia > c; c++) Ga[c] = 0;
if (va.flush_pending(), 0 === va.avail_out) return za = -1, D
}
}
return b != C ? D : E
}
}
function g() {
var a = this;
a.next_in_index = 0, a.next_out_index = 0, a.avail_in = 0, a.total_in = 0, a.avail_out = 0, a.total_out = 0
}
function h(a) {
var b = this,
c = new g,
d = 512,
e = z,
f = new Uint8Array(d);
"undefined" == typeof a && (a = v), c.deflateInit(a), c.next_out = f, b.append = function(a, b) {
var g, h, i = [],
j = 0,
k = 0,
l = 0;
if (a.length) {
c.next_in_index = 0, c.next_in = a, c.avail_in = a.length;
do {
if (c.next_out_index = 0, c.avail_out = d, g = c.deflate(e), g != D) throw "deflating: " + c.msg;
c.next_out_index && i.push(c.next_out_index == d ? new Uint8Array(f) : new Uint8Array(f.subarray(0, c.next_out_index))), l += c.next_out_index, b && c.next_in_index > 0 && c.next_in_index != j && (b(c.next_in_index), j = c.next_in_index)
} while (c.avail_in > 0 || 0 === c.avail_out);
return h = new Uint8Array(l), i.forEach(function(a) {
h.set(a, k), k += a.length
}), h
}
}, b.flush = function() {
var a, b, e = [],
g = 0,
h = 0;
do {
if (c.next_out_index = 0, c.avail_out = d, a = c.deflate(C), a != E && a != D) throw "deflating: " + c.msg;
d - c.avail_out > 0 && e.push(new Uint8Array(f.subarray(0, c.next_out_index))), h += c.next_out_index
} while (c.avail_in > 0 || 0 === c.avail_out);
return c.deflateEnd(), b = new Uint8Array(h), e.forEach(function(a) {
b.set(a, g), g += a.length
}), b
}
}
var i = 15,
j = 30,
k = 19,
l = 29,
m = 256,
n = m + 1 + l,
o = 2 * n + 1,
p = 256,
q = 7,
r = 16,
s = 17,
t = 18,
u = 16,
v = -1,
w = 1,
x = 2,
y = 0,
z = 0,
A = 1,
B = 3,
C = 4,
D = 0,
E = 1,
F = 2,
G = -2,
H = -3,
I = -5,
J = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29];
b._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28], b.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0], b.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576], b.d_code = function(a) {
return 256 > a ? J[a] : J[256 + (a >>> 7)]
}, b.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], b.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], b.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], b.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], c.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8], c.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5], c.static_l_desc = new c(c.static_ltree, b.extra_lbits, m + 1, n, i), c.static_d_desc = new c(c.static_dtree, b.extra_dbits, 0, j, i), c.static_bl_desc = new c(null, b.extra_blbits, 0, k, q);
var K = 9,
L = 8,
M = 0,
N = 1,
O = 2,
P = [new d(0, 0, 0, 0, M), new d(4, 4, 8, 4, N), new d(4, 5, 16, 8, N), new d(4, 6, 32, 32, N), new d(4, 4, 16, 16, O), new d(8, 16, 32, 32, O), new d(8, 16, 128, 128, O), new d(8, 32, 128, 256, O), new d(32, 128, 258, 1024, O), new d(32, 258, 258, 4096, O)],
Q = ["need dictionary", "stream end", "", "", "stream error", "data error", "", "buffer error", "", ""],
R = 0,
S = 1,
T = 2,
U = 3,
V = 32,
W = 42,
X = 113,
Y = 666,
Z = 8,
$ = 0,
_ = 1,
aa = 2,
ba = 3,
ca = 258,
da = ca + ba + 1;
g.prototype = {
deflateInit: function(a, b) {
var c = this;
return c.dstate = new f, b || (b = i), c.dstate.deflateInit(c, a, b)
},
deflate: function(a) {
var b = this;
return b.dstate ? b.dstate.deflate(b, a) : G
},
deflateEnd: function() {
var a = this;
if (!a.dstate) return G;
var b = a.dstate.deflateEnd();
return a.dstate = null, b
},
deflateParams: function(a, b) {
var c = this;
return c.dstate ? c.dstate.deflateParams(c, a, b) : G
},
deflateSetDictionary: function(a, b) {
var c = this;
return c.dstate ? c.dstate.deflateSetDictionary(c, a, b) : G
},
read_buf: function(a, b, c) {
var d = this,
e = d.avail_in;
return e > c && (e = c), 0 === e ? 0 : (d.avail_in -= e, a.set(d.next_in.subarray(d.next_in_index, d.next_in_index + e), b), d.next_in_index += e, d.total_in += e, e)
},
flush_pending: function() {
var a = this,
b = a.dstate.pending;
b > a.avail_out && (b = a.avail_out), 0 !== b && (a.next_out.set(a.dstate.pending_buf.subarray(a.dstate.pending_out, a.dstate.pending_out + b), a.next_out_index), a.next_out_index += b, a.dstate.pending_out += b, a.total_out += b, a.avail_out -= b, a.dstate.pending -= b, 0 === a.dstate.pending && (a.dstate.pending_out = 0))
}
};
var ea;
a.zip ? a.zip.Deflater = h : (ea = new h, a.addEventListener("message", function(b) {
var c = b.data;
c.init && (ea = new h(c.level), a.postMessage({
oninit: !0
})), c.append && a.postMessage({
onappend: !0,
data: ea.append(c.data, function(b) {
a.postMessage({
progress: !0,
current: b
})
})
}), c.flush && a.postMessage({
onflush: !0,
data: ea.flush()
})
}, !1))
}(this)
}! function(b) {
function c() {
var a = -1,
b = this;
b.append = function(c) {
var d, e = b.table;
for (d = 0; d < c.length; d++) a = a >>> 8 ^ e[255 & (a ^ c[d])]
}, b.get = function() {
return ~a
}
}
function d(a, b, c) {
return a.slice ? a.slice(b, b + c) : a.webkitSlice ? a.webkitSlice(b, b + c) : a.mozSlice ? a.mozSlice(b, b + c) : a.msSlice ? a.msSlice(b, b + c) : void 0
}
function e() {}
function f(a) {
function b(b, c) {
var f = new Blob([a], {
type: s
});
d = new g(f), d.init(function() {
e.size = d.size, b()
}, c)
}
function c(a, b, c, e) {
d.readUint8Array(a, b, c, e)
}
var d, e = this;
e.size = 0, e.init = b, e.readUint8Array = c
}
function g(a) {
function b(b) {
this.size = a.size, b()
}
function c(b, c, e, f) {
var g = new FileReader;
g.onload = function(a) {
e(new Uint8Array(a.target.result))
}, g.onerror = f, g.readAsArrayBuffer(d(a, b, c))
}
var e = this;
e.size = 0, e.init = b, e.readUint8Array = c
}
function h() {}
function i(a) {
function b(b) {
e = new Blob([], {
type: a
}), b()
}
function c(b, c) {
e = new Blob([e, o ? b : b.buffer], {
type: a
}), c()
}
function d(a) {
a(e)
}
var e, f = this;
f.init = b, f.writeUint8Array = c, f.getData = d
}
function j(a, b, c, d, e, f, g, h, i, j, k) {
function l() {
a.removeEventListener(t, m, !1), i(p)
}
function m(a) {
var b = a.data,
d = b.data;
b.onappend && (p += d.length, c.writeUint8Array(d, function() {
f(!1, d), n()
}, k)), b.onflush && (d ? (p += d.length, c.writeUint8Array(d, function() {
f(!1, d), l()
}, k)) : l()), b.progress && g && g(o + b.current, e)
}
function n() {
o = s * r, e > o ? b.readUint8Array(d + o, Math.min(r, e - o), function(b) {
q || (q = !0, h && h()), a.postMessage({
append: !0,
data: b
}), s++, f(!0, b)
}, j) : a.postMessage({
flush: !0
})
}
var o, p, q, s = 0;
p = 0, a.addEventListener(t, m, !1), n()
}
function k(a, b, c, d, e, f, g, h, i, j, k) {
function l() {
var s;
m = n * r, e > m ? b.readUint8Array(d + m, Math.min(r, e - m), function(b) {
q || (q = !0, h && h()), s = a.append(b, function() {}), p !== !1 && (g && g(d + m + r, e), o += s.length, f(!0, b), c.writeUint8Array(s, function() {
f(!1, s), n++, setTimeout(l, 1)
}, k))
}, j) : (s = a.flush(), s ? (o += s.length, c.writeUint8Array(s, function() {
f(!1, s), i(o)
}, k)) : i(o))
}
var m, n = 0,
o = 0,
p = !0,
q = !1;
return l(), {
terminate: function() {
p = !1
}
}
}
function l(d, e, f, g, h, i, l, m) {
function n(a, b) {
a && s.append(b)
}
function o(a) {
g(a, s.get()), URL.revokeObjectURL(r)
}
function p() {
q.removeEventListener(t, p, !1), j(q, d, e, 0, d.size, n, h, i, o, l, m)
}
var q, r, s = new c;
return b.Deflater.useWebWorkers ? (r = URL.createObjectURL(new Blob(["(", a.toString(), ")()"], {
type: "application/javascript"
})), q = new Worker(r), q.addEventListener(t, p, !1), q.postMessage({
init: !0,
level: f
})) : q = k(new b.zip.Deflater, d, e, 0, d.size, n, h, i, o, l, m), q
}
function m(a, b, d, e, f, g, h, i, j, k) {
function l() {
var c = m * r;
e > c ? a.readUint8Array(d + c, Math.min(r, e - c), function(a) {
o || (o = !0, i && i()), f && n.append(a), h && h(c, e, a), b.writeUint8Array(a, function() {
m++, l()
}, k)
}, j) : g(e, n.get())
}
var m = 0,
n = new c,
o = !1;
l()
}
function n(a, b) {
function c(a, b) {
f && f.terminate(), f = null, a && a(b)
}
function d() {
c(b, p)
}
function e() {
c(b, q)
}
var f;
return {
deflate: function(b, g, h, i, j) {
function k() {
c(function() {
a.getData(g)
})
}
function n() {
j = j || {}, b ? 0 === j.level ? m(b, a, 0, b.size, !0, k, h, i, e, d) : f = l(b, a, j.level, k, h, i, e, d) : k()
}
b ? b.init(n, e) : n()
},
cancel: c
}
}
var o, p = "Error while writing file data.",
q = "Error while reading file data.",
r = 16384,
s = "text/plain",
t = "message";
try {
o = 0 === new Blob([new DataView(new ArrayBuffer(0))]).size
} catch (u) {}
c.prototype.table = function() {
var a, b, c, d = [];
for (a = 0; 256 > a; a++) {
for (c = a, b = 0; 8 > b; b++) 1 & c ? c = c >>> 1 ^ 3988292384 : c >>>= 1;
d[a] = c
}
return d
}(), f.prototype = new e, f.prototype.constructor = f, g.prototype = new e, g.prototype.constructor = g, h.prototype.getData = function(a) {
a(this.data)
}, i.prototype = new h, i.prototype.constructor = i, b.zip = {}, b.Deflater = function() {}, b.Deflater.prototype = {
deflateText: function(a, b, c, d, e, g) {
var h = new i("application/octet-stream"),
j = this;
h.init(function() {
j.deflateWriter = n(h, c, !1);
var i = new f(a);
j.deflateWriter.deflate(i, b, d, e, g)
})
},
cancel: function() {
this.deflateWriter && (this.deflateWriter.cancel(), delete this.deflateWriter)
}
};
var v = !1;
try {
new Worker(URL.createObjectURL(new Blob(["//test"], {
type: "application/javascript"
}))), v = !0
} catch (w) {}
b.Deflater.useWebWorkers = v
}(this);
var b = !1;
try {
new Worker(URL.createObjectURL(new Blob(["//test"], {
type: "application/javascript"
}))), b = !0
} catch (c) {}
b || a.call(this)
}
var b = new a;
"undefined" != typeof exports ? module.exports = b.Deflater : "undefined" != typeof define && define("Deflater", [], function() {
return b.Deflater
})
}(), define("HTTP", ["require", "exports", "HTTPRequest", "Ajax", "Logger", "Deflater"], function(a, b, c, d, e, f) {
var g = function() {
function a() {}
return a.compressData = function(a, b) {
var c, d, e = this,
g = new f,
h = 0,
i = 0,
j = 200,
k = function() {
var d = i * h / 1024,
f = Math.round(d / (Date.now() - c) * 1e4) / 10;
e.logger.debug("Compression performance after " + j + "ms: " + d + "KB compressed (" + f + "KB/sec)"), 0 === d && (g.cancel(), e.logger.debug("Cancelling POST compression due to low performance"), b(a, !1))
},
l = function() {
d = setTimeout(k, j), c = Date.now()
},
m = function(a, b) {
0 === h && (h = a), i += 1
},
n = function(f) {
var g = Date.now() - c;
d && (clearTimeout(d), d = null), e.logger.debug("Compressed request data in " + g + "ms, " + Math.round(f.size / 10.24) / 100 + "KB / " + Math.round(a.length / 10.24) / 100 + "KB (" + Math.round(f.size / a.length * 100) + "% of original):"), b(f, !0)
},
o = function(c) {
d && (clearTimeout(d), d = null), b(a, !1)
},
p = {};
try {
g.deflateText(a, n, o, m, l, p)
} catch (q) {
o()
}
}, a.request = function(a) {
var b = this,
e = new c,
f = {
url: a.url,
type: a.type,
data: a.data,
timeout: "number" == typeof a.timeout ? 1e3 * a.timeout : void 0,
xhrFields: a.xhrFields,
onloadstart: a.onloadstart,
onprogress: a.onprogress,
dataType: a.dataType,
success: function(c, d, e, f) {
var g = (f.latency / 1e3).toFixed(1),
h = (f.duration / 1e3).toFixed(1);
b.logger.log("HTTP complete, status=" + e.status + ", latency=" + g + "s, duration=" + h + "s, url=" + a.url), a.success && a.success(c, d, e, f)
},
error: function(c, d, f, g) {
var h = "unknown";
c.readyState >= 4 && (h = c.status.toString()), e.isAborted() || b.logger.error("HTTP error, status=" + h + ", type=" + d + ", message=" + f + ", url=" + a.url), a.error && a.error(c, d, f, g)
}
};
return this.logger.log("HTTP load, timeout=" + a.timeout + " url=" + a.url), e.setXMLHttpRequest(d.request(f)), e
}, a.logger = new e("HTTP"), a
}();
return g
}), define("HTTPRequestQueue", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.requestQueue = []
}
return a.prototype.addRequest = function(a) {
var b = this.requestQueue.length;
return this.requestQueue.push(a), b
}, a.prototype.removeRequest = function(b) {
var c = this.requestQueue[b];
a.abortRequest(c), this.requestQueue.slice(b, 1)
}, a.prototype.removeAllRequests = function() {
this.requestQueue.forEach(function(b) {
a.abortRequest(b)
}), this.requestQueue = []
}, a.abortRequest = function(a) {
a && (a.getReadyState() > 1 || a.getReadyState() < 4) && a.abort()
}, a
}();
return c
}), define("LiveRailResponse", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.content = a.TYPE_UNKNOWN
}
return a.TYPE_UNKNOWN = null, a.TYPE_SOURCES = "sources", a.TYPE_ADS = "ads", a.TYPE_ERROR = "error", a
}();
return c
}), define("AdAsset", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c, d, e) {
this.mimeType = d, this.kbps = e, this.width = a, this.height = b, this.url = c
}
return a.prototype.getMimeType = function() {
return this.mimeType
}, a.prototype.getKbps = function() {
return this.kbps
}, a.prototype.getWidth = function() {
return this.width
}, a.prototype.getHeight = function() {
return this.height
}, a.prototype.getUrl = function() {
return this.url
}, a.prototype.toString = function() {
return "kbps=" + this.kbps + " width=" + this.width + " height=" + this.height + " mime=" + this.mimeType + " url=" + this.url
}, a.prototype.requiresFlash = function() {
return "video/x-flv" === this.mimeType || "application/x-shockwave-flash" === this.mimeType
}, a
}();
return c
}), define("AdExtension", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
this.id = a, this.url = b
}
return a.prototype.getId = function() {
return this.id
}, a.prototype.getUrl = function() {
return this.url
}, a
}();
return c
}), define("AdSlot", ["require", "exports", "Tracker", "AdCandidate"], function(a, b, c, d) {
var e = function() {
function a(a, b) {
this.trackers = {}, this.adCandidates = [], this.adCandidateIndex = -1, this.impressionOccurred = !1, this.type = a, this.rule = b
}
return a.prototype.addTracker = function(a) {
if (null !== a) {
var b = c.formTrackerKey(a.getType(), a.getValue());
this.trackers[b] || (this.trackers[b] = []), this.trackers[b].push(a)
}
}, a.prototype.addAdCandidate = function(a) {
null !== a && this.adCandidates.push(a)
}, a.prototype.getTrackers = function(a, b) {
var d = c.formTrackerKey(a, b);
return this.trackers[d] || null
}, a.prototype.getUniqueAdapterIds = function() {
var a = [],
b = {};
return this.adCandidates.forEach(function(c) {
b[c.adapter] || (a.push(c.adapter), b[c.adapter] = !0)
}), a
}, a.prototype.getNextAdCandidate = function() {
var a = null;
return this.adCandidateIndex + 1 < this.adCandidates.length && (this.adCandidateIndex += 1, a = this.adCandidates[this.adCandidateIndex]), a
}, a.prototype.getAdCandidateCount = function() {