geisha/public/js/minified/boot.js
2026-07-18 21:44:11 +02:00

1994 lines
351 KiB
JavaScript
Generated

/*
jQuery JavaScript Library v1.9.1
http://jquery.com/
Includes Sizzle.js
http://sizzlejs.com/
Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
Released under the MIT license
http://jquery.org/license
Date: 2013-2-4
//@ sourceMappingURL=jquery.min.map
*/
var $jscomp = $jscomp || {}; $jscomp.scope = {}; $jscomp.findInternal = function (a, b, c) { a instanceof String && (a = String(a)); for (var d = a.length, f = 0; f < d; f++) { var q = a[f]; if (b.call(c, q, f, a)) return { i: f, v: q } } return { i: -1, v: void 0 } }; $jscomp.ASSUME_ES5 = !1; $jscomp.ASSUME_NO_NATIVE_MAP = !1; $jscomp.ASSUME_NO_NATIVE_SET = !1; $jscomp.SIMPLE_FROUND_POLYFILL = !1;
$jscomp.defineProperty = $jscomp.ASSUME_ES5 || "function" == typeof Object.defineProperties ? Object.defineProperty : function (a, b, c) { a != Array.prototype && a != Object.prototype && (a[b] = c.value) }; $jscomp.getGlobal = function (a) { return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a }; $jscomp.global = $jscomp.getGlobal(this);
$jscomp.polyfill = function (a, b, c, d) { if (b) { c = $jscomp.global; a = a.split("."); for (d = 0; d < a.length - 1; d++) { var f = a[d]; f in c || (c[f] = {}); c = c[f] } a = a[a.length - 1]; d = c[a]; b = b(d); b != d && null != b && $jscomp.defineProperty(c, a, { configurable: !0, writable: !0, value: b }) } }; $jscomp.polyfill("Array.prototype.find", function (a) { return a ? a : function (a, c) { return $jscomp.findInternal(this, a, c).v } }, "es6", "es3"); $jscomp.arrayIteratorImpl = function (a) { var b = 0; return function () { return b < a.length ? { done: !1, value: a[b++] } : { done: !0 } } };
$jscomp.arrayIterator = function (a) { return { next: $jscomp.arrayIteratorImpl(a) } }; $jscomp.SYMBOL_PREFIX = "jscomp_symbol_"; $jscomp.initSymbol = function () { $jscomp.initSymbol = function () { }; $jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol) }; $jscomp.SymbolClass = function (a, b) { this.$jscomp$symbol$id_ = a; $jscomp.defineProperty(this, "description", { configurable: !0, writable: !0, value: b }) }; $jscomp.SymbolClass.prototype.toString = function () { return this.$jscomp$symbol$id_ };
$jscomp.Symbol = function () { function a(c) { if (this instanceof a) throw new TypeError("Symbol is not a constructor"); return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX + (c || "") + "_" + b++, c) } var b = 0; return a }();
$jscomp.initSymbolIterator = function () { $jscomp.initSymbol(); var a = $jscomp.global.Symbol.iterator; a || (a = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("Symbol.iterator")); "function" != typeof Array.prototype[a] && $jscomp.defineProperty(Array.prototype, a, { configurable: !0, writable: !0, value: function () { return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this)) } }); $jscomp.initSymbolIterator = function () { } };
$jscomp.initSymbolAsyncIterator = function () { $jscomp.initSymbol(); var a = $jscomp.global.Symbol.asyncIterator; a || (a = $jscomp.global.Symbol.asyncIterator = $jscomp.global.Symbol("Symbol.asyncIterator")); $jscomp.initSymbolAsyncIterator = function () { } }; $jscomp.iteratorPrototype = function (a) { $jscomp.initSymbolIterator(); a = { next: a }; a[$jscomp.global.Symbol.iterator] = function () { return this }; return a };
$jscomp.iteratorFromArray = function (a, b) { $jscomp.initSymbolIterator(); a instanceof String && (a += ""); var c = 0, d = { next: function () { if (c < a.length) { var f = c++; return { value: b(f, a[f]), done: !1 } } d.next = function () { return { done: !0, value: void 0 } }; return d.next() } }; d[Symbol.iterator] = function () { return d }; return d }; $jscomp.polyfill("Array.prototype.keys", function (a) { return a ? a : function () { return $jscomp.iteratorFromArray(this, function (a) { return a }) } }, "es6", "es3");
$jscomp.polyfill("Array.prototype.values", function (a) { return a ? a : function () { return $jscomp.iteratorFromArray(this, function (a, c) { return c }) } }, "es8", "es3");
(function (a, b) {
function c(a) { var g = a.length, b = e.type(a); return e.isWindow(a) ? !1 : 1 === a.nodeType && g ? !0 : "array" === b || "function" !== b && (0 === g || "number" == typeof g && 0 < g && g - 1 in a) } function d(a) { var g = Wa[a] = {}; return e.each(a.match(da) || [], function (a, b) { g[b] = !0 }), g } function f(a, l, c, w) {
if (e.acceptData(a)) {
var g, v, h = e.expando, d = "string" == typeof l, f = a.nodeType, m = f ? e.cache : a, k = f ? a[h] : a[h] && h; if (k && m[k] && (w || m[k].data) || !d || c !== b) return k || (f ? a[h] = k = qa.pop() || e.guid++ : k = h), m[k] || (m[k] = {}, f || (m[k].toJSON = e.noop)),
("object" == typeof l || "function" == typeof l) && (w ? m[k] = e.extend(m[k], l) : m[k].data = e.extend(m[k].data, l)), g = m[k], w || (g.data || (g.data = {}), g = g.data), c !== b && (g[e.camelCase(l)] = c), d ? (v = g[l], null == v && (v = g[e.camelCase(l)])) : v = g, v
}
} function q(a, b, c) {
if (e.acceptData(a)) {
var g, l, v = a.nodeType, h = v ? e.cache : a, d = v ? a[e.expando] : e.expando; if (h[d]) {
if (b && (l = c ? h[d] : h[d].data)) {
e.isArray(b) ? b = b.concat(e.map(b, e.camelCase)) : b in l ? b = [b] : (b = e.camelCase(b), b = b in l ? [b] : b.split(" ")); var f = 0; for (g = b.length; g > f; f++)delete l[b[f]];
if (!(c ? n : e.isEmptyObject)(l)) return
} (c || (delete h[d].data, n(h[d]))) && (v ? e.cleanData([a], !0) : e.support.deleteExpando || h != h.window ? delete h[d] : h[d] = null)
}
}
} function p(a, l, c) { if (c === b && 1 === a.nodeType) { var g = "data-" + l.replace(xb, "-$1").toLowerCase(); if (c = a.getAttribute(g), "string" == typeof c) { try { c = "true" === c ? !0 : "false" === c ? !1 : "null" === c ? null : +c + "" === c ? +c : yb.test(c) ? e.parseJSON(c) : c } catch (ba) { } e.data(a, l, c) } else c = b } return c } function n(a) {
for (var g in a) if (("data" !== g || !e.isEmptyObject(a[g])) && "toJSON" !==
g) return !1; return !0
} function A() { return !0 } function H() { return !1 } function D(a, b) { do a = a[b]; while (a && 1 !== a.nodeType); return a } function S(a, b, c) { if (b = b || 0, e.isFunction(b)) return e.grep(a, function (a, g) { return !!b.call(a, g, a) === c }); if (b.nodeType) return e.grep(a, function (a) { return a === b === c }); if ("string" == typeof b) { var g = e.grep(a, function (a) { return 1 === a.nodeType }); if (zb.test(b)) return e.filter(b, g, !c); b = e.filter(b, g) } return e.grep(a, function (a) { return 0 <= e.inArray(a, b) === c }) } function N(a) {
var g = Xa.split("|");
a = a.createDocumentFragment(); if (a.createElement) for (; g.length;)a.createElement(g.pop()); return a
} function M(a, b) { return a.getElementsByTagName(b)[0] || a.appendChild(a.ownerDocument.createElement(b)) } function F(a) { var g = a.getAttributeNode("type"); return a.type = (g && g.specified) + "/" + a.type, a } function J(a) { var g = Ab.exec(a.type); return g ? a.type = g[1] : a.removeAttribute("type"), a } function C(a, b) { for (var g, l = 0; null != (g = a[l]); l++)e._data(g, "globalEval", !b || e._data(b[l], "globalEval")) } function I(a, b) {
if (1 ===
b.nodeType && e.hasData(a)) { var g, l; var c = e._data(a); a = e._data(b, c); var h = c.events; if (h) for (g in delete a.handle, a.events = {}, h) for (c = 0, l = h[g].length; l > c; c++)e.event.add(b, g, h[g][c]); a.data && (a.data = e.extend({}, a.data)) }
} function u(a, l) {
var g, c, h = 0, d = typeof a.getElementsByTagName !== P ? a.getElementsByTagName(l || "*") : typeof a.querySelectorAll !== P ? a.querySelectorAll(l || "*") : b; if (!d) for (d = [], g = a.childNodes || a; null != (c = g[h]); h++)!l || e.nodeName(c, l) ? d.push(c) : e.merge(d, u(c, l)); return l === b || l && e.nodeName(a,
l) ? e.merge([a], d) : d
} function E(a) { Ga.test(a.type) && (a.defaultChecked = a.checked) } function G(a, b) { if (b in a) return b; for (var g = b.charAt(0).toUpperCase() + b.slice(1), l = b, c = Ya.length; c--;)if (b = Ya[c] + g, b in a) return b; return l } function k(a, b) { return a = b || a, "none" === e.css(a, "display") || !e.contains(a.ownerDocument, a) } function x(a, b) {
for (var g, l, c, h = [], d = 0, f = a.length; f > d; d++)l = a[d], l.style && (h[d] = e._data(l, "olddisplay"), g = l.style.display, b ? (h[d] || "none" !== g || (l.style.display = ""), "" === l.style.display && k(l) &&
(h[d] = e._data(l, "olddisplay", W(l.nodeName)))) : h[d] || (c = k(l), (g && "none" !== g || !c) && e._data(l, "olddisplay", c ? g : e.css(l, "display")))); for (d = 0; f > d; d++)l = a[d], l.style && (b && "none" !== l.style.display && "" !== l.style.display || (l.style.display = b ? h[d] || "" : "none")); return a
} function Q(a, b, c) { return (a = Bb.exec(b)) ? Math.max(0, a[1] - (c || 0)) + (a[2] || "px") : b } function y(a, b, c, w, h) {
b = c === (w ? "border" : "content") ? 4 : "width" === b ? 1 : 0; for (var g = 0; 4 > b; b += 2)"margin" === c && (g += e.css(a, c + ea[b], !0, h)), w ? ("content" === c && (g -= e.css(a, "padding" +
ea[b], !0, h)), "margin" !== c && (g -= e.css(a, "border" + ea[b] + "Width", !0, h))) : (g += e.css(a, "padding" + ea[b], !0, h), "padding" !== c && (g += e.css(a, "border" + ea[b] + "Width", !0, h))); return g
} function K(a, b, c) {
var g = !0, l = "width" === b ? a.offsetWidth : a.offsetHeight, v = fa(a), h = e.support.boxSizing && "border-box" === e.css(a, "boxSizing", !1, v); if (0 >= l || null == l) { if (l = la(a, b, v), (0 > l || null == l) && (l = a.style[b]), Ba.test(l)) return l; g = h && (e.support.boxSizingReliable || l === a.style[b]); l = parseFloat(l) || 0 } return l + y(a, b, c || (h ? "border" : "content"),
g, v) + "px"
} function W(a) { var g = z, b = Za[a]; return b || (b = ha(a, g), "none" !== b && b || (ra = (ra || e("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(g.documentElement), g = (ra[0].contentWindow || ra[0].contentDocument).document, g.write("<!doctype html><html><body>"), g.close(), b = ha(a, g), ra.detach()), Za[a] = b), b } function ha(a, b) { a = e(b.createElement(a)).appendTo(b.body); b = e.css(a[0], "display"); return a.remove(), b } function ia(a, b, c, w) {
var g; if (e.isArray(b)) e.each(b,
function (g, b) { c || Cb.test(a) ? w(a, b) : ia(a + "[" + ("object" == typeof b ? g : "") + "]", b, c, w) }); else if (c || "object" !== e.type(b)) w(a, b); else for (g in b) ia(a + "[" + g + "]", b[g], c, w)
} function T(a) { return function (g, b) { "string" != typeof g && (b = g, g = "*"); var l = 0, c = g.toLowerCase().match(da) || []; if (e.isFunction(b)) for (; g = c[l++];)"+" === g[0] ? (g = g.slice(1) || "*", (a[g] = a[g] || []).unshift(b)) : (a[g] = a[g] || []).push(b) } } function ja(a, l, c, w) {
function g(d) {
var ba; return v[d] = !0, e.each(a[d] || [], function (a, e) {
a = e(l, c, w); return "string" !=
typeof a || h || v[a] ? h ? !(ba = a) : b : (l.dataTypes.unshift(a), g(a), !1)
}), ba
} var v = {}, h = a === Ha; return g(l.dataTypes[0]) || !v["*"] && g("*")
} function Y(a, l) { var g, c, h = e.ajaxSettings.flatOptions || {}; for (c in l) l[c] !== b && ((h[c] ? a : g || (g = {}))[c] = l[c]); return g && e.extend(!0, a, g), a } function m() { try { return new a.XMLHttpRequest } catch (g) { } } function r() { return setTimeout(function () { sa = b }), sa = e.now() } function X(a, b) { e.each(b, function (g, b) { for (var l = (ya[g] || []).concat(ya["*"]), c = 0, e = l.length; e > c && !l[c].call(a, g, b); c++); }) }
function O(a, b, c) {
var g, l = 0, v = Ca.length, d = e.Deferred().always(function () { delete f.elem }), f = function () { if (g) return !1; var b = sa || r(); b = Math.max(0, m.startTime + m.duration - b); for (var l = 1 - (b / m.duration || 0), c = 0, e = m.tweens.length; e > c; c++)m.tweens[c].run(l); return d.notifyWith(a, [m, l, b]), 1 > l && e ? b : (d.resolveWith(a, [m]), !1) }, m = d.promise({
elem: a, props: e.extend({}, b), opts: e.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: sa || r(), duration: c.duration, tweens: [], createTween: function (g,
b) { g = e.Tween(a, m.opts, g, b, m.opts.specialEasing[g] || m.opts.easing); return m.tweens.push(g), g }, stop: function (b) { var l = 0, c = b ? m.tweens.length : 0; if (g) return this; for (g = !0; c > l; l++)m.tweens[l].run(1); return b ? d.resolveWith(a, [m, b]) : d.rejectWith(a, [m, b]), this }
}); c = m.props; for (h(c, m.opts.specialEasing); v > l; l++)if (b = Ca[l].call(m, a, c, m.opts)) return b; return X(m, c), e.isFunction(m.opts.start) && m.opts.start.call(a, m), e.fx.timer(e.extend(f, { elem: a, anim: m, queue: m.opts.queue })), m.progress(m.opts.progress).done(m.opts.done,
m.opts.complete).fail(m.opts.fail).always(m.opts.always)
} function h(a, b) { var g, c, l, h, d; for (l in a) if (c = e.camelCase(l), h = b[c], g = a[l], e.isArray(g) && (h = g[1], g = a[l] = g[0]), l !== c && (a[c] = g, delete a[l]), d = e.cssHooks[c], d && "expand" in d) for (l in g = d.expand(g), delete a[c], g) l in a || (a[l] = g[l], b[l] = h); else b[c] = h } function t(a, b, c, e, h) { return new t.prototype.init(a, b, c, e, h) } function B(a, b) { var g = { height: a }, c = 0; for (b = b ? 1 : 0; 4 > c; c += 2 - b) { var l = ea[c]; g["margin" + l] = g["padding" + l] = a } return b && (g.opacity = g.width = a), g }
function U(a) { return e.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1 } var R, P = typeof b, z = a.document, wa = a.location, za = a.jQuery, Ia = a.$, xa = {}, qa = [], $a = qa.concat, Ja = qa.push, ma = qa.slice, ab = qa.indexOf, Db = xa.toString, Aa = xa.hasOwnProperty, Ka = "1.9.1".trim, e = function (a, b) { return new e.fn.init(a, b, Eb) }, Da = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, da = /\S+/g, Fb = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, Gb = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/, bb = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, Hb = /^[\],:{}\s]*$/, Ib = /(?:^|:|,)(?:\s*\[)+/g,
Jb = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, Kb = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, Lb = /^-ms-/, Mb = /-([\da-z])/gi, Nb = function (a, b) { return b.toUpperCase() }, Z = function (a) { (z.addEventListener || "load" === a.type || "complete" === z.readyState) && (cb(), e.ready()) }, cb = function () { z.addEventListener ? (z.removeEventListener("DOMContentLoaded", Z, !1), a.removeEventListener("load", Z, !1)) : (z.detachEvent("onreadystatechange", Z), a.detachEvent("onload", Z)) }; e.fn = e.prototype = {
jquery: "1.9.1", constructor: e,
init: function (a, c, v) {
var g, l; if (!a) return this; if ("string" == typeof a) {
if (g = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && 3 <= a.length ? [null, a, null] : Gb.exec(a), !g || !g[1] && c) return !c || c.jquery ? (c || v).find(a) : this.constructor(c).find(a); if (g[1]) { if (c = c instanceof e ? c[0] : c, e.merge(this, e.parseHTML(g[1], c && c.nodeType ? c.ownerDocument || c : z, !0)), bb.test(g[1]) && e.isPlainObject(c)) for (g in c) e.isFunction(this[g]) ? this[g](c[g]) : this.attr(g, c[g]); return this } if (l = z.getElementById(g[2]), l && l.parentNode) {
if (l.id !==
g[2]) return v.find(a); this.length = 1; this[0] = l
} return this.context = z, this.selector = a, this
} return a.nodeType ? (this.context = this[0] = a, this.length = 1, this) : e.isFunction(a) ? v.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), e.makeArray(a, this))
}, selector: "", length: 0, size: function () { return this.length }, toArray: function () { return ma.call(this) }, get: function (a) { return null == a ? this.toArray() : 0 > a ? this[this.length + a] : this[a] }, pushStack: function (a) {
a = e.merge(this.constructor(), a); return a.prevObject =
this, a.context = this.context, a
}, each: function (a, b) { return e.each(this, a, b) }, ready: function (a) { return e.ready.promise().done(a), this }, slice: function () { return this.pushStack(ma.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, eq: function (a) { var g = this.length; a = +a + (0 > a ? g : 0); return this.pushStack(0 <= a && g > a ? [this[a]] : []) }, map: function (a) { return this.pushStack(e.map(this, function (g, b) { return a.call(g, b, g) })) }, end: function () { return this.prevObject || this.constructor(null) },
push: Ja, sort: [].sort, splice: [].splice
}; e.fn.init.prototype = e.fn; e.extend = e.fn.extend = function () { var a, c, v, h, d = arguments[0] || {}, f = 1, m = arguments.length, k = !1; "boolean" == typeof d && (k = d, d = arguments[1] || {}, f = 2); "object" == typeof d || e.isFunction(d) || (d = {}); for (m === f && (d = this, --f); m > f; f++)if (null != (v = arguments[f])) for (c in v) { var t = d[c]; var r = v[c]; d !== r && (k && r && (e.isPlainObject(r) || (a = e.isArray(r))) ? (a ? (a = !1, h = t && e.isArray(t) ? t : []) : h = t && e.isPlainObject(t) ? t : {}, d[c] = e.extend(k, h, r)) : r !== b && (d[c] = r)) } return d };
e.extend({
noConflict: function (g) { return a.$ === e && (a.$ = Ia), g && a.jQuery === e && (a.jQuery = za), e }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? e.readyWait++ : e.ready(!0) }, ready: function (a) { if (!0 === a ? !--e.readyWait : !e.isReady) { if (!z.body) return setTimeout(e.ready); e.isReady = !0; !0 !== a && 0 < --e.readyWait || (R.resolveWith(z, [e]), e.fn.trigger && e(z).trigger("ready").off("ready")) } }, isFunction: function (a) { return "function" === e.type(a) }, isArray: Array.isArray || function (a) { return "array" === e.type(a) }, isWindow: function (a) {
return null !=
a && a == a.window
}, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a) }, type: function (a) { return null == a ? a + "" : "object" == typeof a || "function" == typeof a ? xa[Db.call(a)] || "object" : typeof a }, isPlainObject: function (a) { if (!a || "object" !== e.type(a) || a.nodeType || e.isWindow(a)) return !1; try { if (a.constructor && !Aa.call(a, "constructor") && !Aa.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (v) { return !1 } for (var g in a); return g === b || Aa.call(a, g) }, isEmptyObject: function (a) {
for (var g in a) return !1;
return !0
}, error: function (a) { throw Error(a); }, parseHTML: function (a, b, c) { if (!a || "string" != typeof a) return null; "boolean" == typeof b && (c = b, b = !1); b = b || z; var g = bb.exec(a); c = !c && []; return g ? [b.createElement(g[1])] : (g = e.buildFragment([a], b, c), c && e(c).remove(), e.merge([], g.childNodes)) }, parseJSON: function (g) {
return a.JSON && a.JSON.parse ? a.JSON.parse(g) : null === g ? g : "string" == typeof g && (g = e.trim(g), g && Hb.test(g.replace(Jb, "@").replace(Kb, "]").replace(Ib, ""))) ? Function("return " + g)() : (e.error("Invalid JSON: " +
g), b)
}, parseXML: function (g) { var c, v; if (!g || "string" != typeof g) return null; try { a.DOMParser ? (v = new DOMParser, c = v.parseFromString(g, "text/xml")) : (c = new ActiveXObject("Microsoft.XMLDOM"), c.async = "false", c.loadXML(g)) } catch (w) { c = b } return c && c.documentElement && !c.getElementsByTagName("parsererror").length || e.error("Invalid XML: " + g), c }, noop: function () { }, globalEval: function (g) { g && e.trim(g) && (a.execScript || function (g) { a.eval.call(a, g) })(g) }, camelCase: function (a) { return a.replace(Lb, "ms-").replace(Mb, Nb) },
nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, b, e) { var g, l = 0, v = a.length, h = c(a); if (e) if (h) for (; v > l && (g = b.apply(a[l], e), !1 !== g); l++); else for (l in a) { if (g = b.apply(a[l], e), !1 === g) break } else if (h) for (; v > l && (g = b.call(a[l], l, a[l]), !1 !== g); l++); else for (l in a) if (g = b.call(a[l], l, a[l]), !1 === g) break; return a }, trim: Ka && !Ka.call("\ufeff\u00a0") ? function (a) { return null == a ? "" : Ka.call(a) } : function (a) { return null == a ? "" : (a + "").replace(Fb, "") }, makeArray: function (a,
b) { b = b || []; return null != a && (c(Object(a)) ? e.merge(b, "string" == typeof a ? [a] : a) : Ja.call(b, a)), b }, inArray: function (a, b, c) { if (b) { if (ab) return ab.call(b, a, c); var g = b.length; for (c = c ? 0 > c ? Math.max(0, g + c) : c : 0; g > c; c++)if (c in b && b[c] === a) return c } return -1 }, merge: function (a, c) { var g = c.length, l = a.length, e = 0; if ("number" == typeof g) for (; g > e; e++)a[l++] = c[e]; else for (; c[e] !== b;)a[l++] = c[e++]; return a.length = l, a }, grep: function (a, b, c) { var g = [], l = 0, e = a.length; for (c = !!c; e > l; l++) { var v = !!b(a[l], l); c !== v && g.push(a[l]) } return g },
map: function (a, b, e) { var g = 0, l = a.length, v = []; if (c(a)) for (; l > g; g++) { var h = b(a[g], g, e); null != h && (v[v.length] = h) } else for (g in a) h = b(a[g], g, e), null != h && (v[v.length] = h); return $a.apply([], v) }, guid: 1, proxy: function (a, c) { var g, l, h; return "string" == typeof c && (h = a[c], c = a, a = h), e.isFunction(a) ? (g = ma.call(arguments, 2), l = function () { return a.apply(c || this, g.concat(ma.call(arguments))) }, l.guid = a.guid = a.guid || e.guid++, l) : b }, access: function (a, c, v, h, d, f, m) {
var g = 0, l = a.length, w = null == v; if ("object" === e.type(v)) for (g in d =
!0, v) e.access(a, c, g, v[g], !0, f, m); else if (h !== b && (d = !0, e.isFunction(h) || (m = !0), w && (m ? (c.call(a, h), c = null) : (w = c, c = function (a, g, b) { return w.call(e(a), b) })), c)) for (; l > g; g++)c(a[g], v, m ? h : h.call(a[g], g, c(a[g], v))); return d ? a : w ? c.call(a) : l ? c(a[0], v) : f
}, now: function () { return (new Date).getTime() }
}); e.ready.promise = function (g) {
if (!R) if (R = e.Deferred(), "complete" === z.readyState) setTimeout(e.ready); else if (z.addEventListener) z.addEventListener("DOMContentLoaded", Z, !1), a.addEventListener("load", Z, !1); else {
z.attachEvent("onreadystatechange",
Z); a.attachEvent("onload", Z); var b = !1; try { b = null == a.frameElement && z.documentElement } catch (v) { } b && b.doScroll && function w() { if (!e.isReady) { try { b.doScroll("left") } catch (ba) { return setTimeout(w, 50) } cb(); e.ready() } }()
} return R.promise(g)
}; e.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (a, b) { xa["[object " + b + "]"] = b.toLowerCase() }); var Eb = e(z); var Wa = {}; e.Callbacks = function (a) {
a = "string" == typeof a ? Wa[a] || d(a) : e.extend({}, a); var g, c, h, f, m, k, t = [], r = !a.once && [], q = function (b) {
c =
a.memory && b; h = !0; m = k || 0; k = 0; f = t.length; for (g = !0; t && f > m; m++)if (!1 === t[m].apply(b[0], b[1]) && a.stopOnFalse) { c = !1; break } g = !1; t && (r ? r.length && q(r.shift()) : c ? t = [] : B.disable())
}, B = {
add: function () { if (t) { var b = t.length; (function Ob(g) { e.each(g, function (g, b) { g = e.type(b); "function" === g ? a.unique && B.has(b) || t.push(b) : b && b.length && "string" !== g && Ob(b) }) })(arguments); g ? f = t.length : c && (k = b, q(c)) } return this }, remove: function () {
return t && e.each(arguments, function (a, b) {
for (var c; -1 < (c = e.inArray(b, t, c));)t.splice(c, 1),
g && (f >= c && f--, m >= c && m--)
}), this
}, has: function (a) { return a ? -1 < e.inArray(a, t) : !(!t || !t.length) }, empty: function () { return t = [], this }, disable: function () { return t = r = c = b, this }, disabled: function () { return !t }, lock: function () { return r = b, c || B.disable(), this }, locked: function () { return !r }, fireWith: function (a, b) { return b = b || [], b = [a, b.slice ? b.slice() : b], !t || h && !r || (g ? r.push(b) : q(b)), this }, fire: function () { return B.fireWith(this, arguments), this }, fired: function () { return !!h }
}; return B
}; e.extend({
Deferred: function (a) {
var b =
[["resolve", "done", e.Callbacks("once memory"), "resolved"], ["reject", "fail", e.Callbacks("once memory"), "rejected"], ["notify", "progress", e.Callbacks("memory")]], g = "pending", c = {
state: function () { return g }, always: function () { return h.done(arguments).fail(arguments), this }, then: function () {
var a = arguments; return e.Deferred(function (g) {
e.each(b, function (b, l) {
var v = l[0], d = e.isFunction(a[b]) && a[b]; h[l[1]](function () {
var a = d && d.apply(this, arguments); a && e.isFunction(a.promise) ? a.promise().done(g.resolve).fail(g.reject).progress(g.notify) :
g[v + "With"](this === c ? g.promise() : this, d ? [a] : arguments)
})
}); a = null
}).promise()
}, promise: function (a) { return null != a ? e.extend(a, c) : c }
}, h = {}; return c.pipe = c.then, e.each(b, function (a, l) { var e = l[2], v = l[3]; c[l[1]] = e.add; v && e.add(function () { g = v }, b[1 ^ a][2].disable, b[2][2].lock); h[l[0]] = function () { return h[l[0] + "With"](this === h ? c : this, arguments), this }; h[l[0] + "With"] = e.fireWith }), c.promise(h), a && a.call(h, h), h
}, when: function (a) {
var b = 0, g = ma.call(arguments), c = g.length, h = 1 !== c || a && e.isFunction(a.promise) ? c : 0, d =
1 === h ? a : e.Deferred(), f = function (a, b, g) { return function (c) { b[a] = this; g[a] = 1 < arguments.length ? ma.call(arguments) : c; g === k ? d.notifyWith(b, g) : --h || d.resolveWith(b, g) } }, m; if (1 < c) { var k = Array(c); var t = Array(c); for (m = Array(c); c > b; b++)g[b] && e.isFunction(g[b].promise) ? g[b].promise().done(f(b, m, g)).fail(d.reject).progress(f(b, t, k)) : --h } return h || d.resolveWith(m, g), d.promise()
}
}); e.support = function () {
var b, c, h, d, f = z.createElement("div"); if (f.setAttribute("className", "t"), f.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",
b = f.getElementsByTagName("*"), c = f.getElementsByTagName("a")[0], !b || !c || !b.length) return {}; var m = z.createElement("select"); var k = m.appendChild(z.createElement("option")); b = f.getElementsByTagName("input")[0]; c.style.cssText = "top:1px;float:left;opacity:.5"; var t = {
getSetAttribute: "t" !== f.className, leadingWhitespace: 3 === f.firstChild.nodeType, tbody: !f.getElementsByTagName("tbody").length, htmlSerialize: !!f.getElementsByTagName("link").length, style: /top/.test(c.getAttribute("style")), hrefNormalized: "/a" ===
c.getAttribute("href"), opacity: /^0.5/.test(c.style.opacity), cssFloat: !!c.style.cssFloat, checkOn: !!b.value, optSelected: k.selected, enctype: !!z.createElement("form").enctype, html5Clone: "<:nav></:nav>" !== z.createElement("nav").cloneNode(!0).outerHTML, boxModel: "CSS1Compat" === z.compatMode, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, boxSizingReliable: !0, pixelPosition: !1
}; b.checked = !0; t.noCloneChecked = b.cloneNode(!0).checked; m.disabled = !0; t.optDisabled =
!k.disabled; try { delete f.test } catch (vc) { t.deleteExpando = !1 } b = z.createElement("input"); b.setAttribute("value", ""); t.input = "" === b.getAttribute("value"); b.value = "t"; b.setAttribute("type", "radio"); t.radioValue = "t" === b.value; b.setAttribute("checked", "t"); b.setAttribute("name", "t"); c = z.createDocumentFragment(); c.appendChild(b); t.appendChecked = b.checked; t.checkClone = c.cloneNode(!0).cloneNode(!0).lastChild.checked; f.attachEvent && (f.attachEvent("onclick", function () { t.noCloneEvent = !1 }), f.cloneNode(!0).click());
for (d in { submit: !0, change: !0, focusin: !0 }) f.setAttribute(c = "on" + d, "t"), t[d + "Bubbles"] = c in a || !1 === f.attributes[c].expando; return f.style.backgroundClip = "content-box", f.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === f.style.backgroundClip, e(function () {
var b, g, c, e = z.getElementsByTagName("body")[0]; e && (b = z.createElement("div"), b.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", e.appendChild(b).appendChild(f), f.innerHTML = "<table><tr><td></td><td>t</td></tr></table>",
c = f.getElementsByTagName("td"), c[0].style.cssText = "padding:0;margin:0;border:0;display:none", h = 0 === c[0].offsetHeight, c[0].style.display = "", c[1].style.display = "none", t.reliableHiddenOffsets = h && 0 === c[0].offsetHeight, f.innerHTML = "", f.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", t.boxSizing = 4 === f.offsetWidth, t.doesNotIncludeMarginInBodyOffset = 1 !== e.offsetTop, a.getComputedStyle &&
(t.pixelPosition = "1%" !== (a.getComputedStyle(f, null) || {}).top, t.boxSizingReliable = "4px" === (a.getComputedStyle(f, null) || { width: "4px" }).width, g = f.appendChild(z.createElement("div")), g.style.cssText = f.style.cssText = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", g.style.marginRight = g.style.width = "0", f.style.width = "1px", t.reliableMarginRight = !parseFloat((a.getComputedStyle(g, null) || {}).marginRight)), typeof f.style.zoom !== P &&
(f.innerHTML = "", f.style.cssText = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === f.offsetWidth, f.style.display = "block", f.innerHTML = "<div></div>", f.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== f.offsetWidth, t.inlineBlockNeedsLayout && (e.style.zoom = 1)), e.removeChild(b), f = null)
}), b = m = c = k = c = b = null, t
}(); var yb = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, xb = /([A-Z])/g;
e.extend({
cache: {}, expando: "jQuery" + ("1.9.1" + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { return a = a.nodeType ? e.cache[a[e.expando]] : a[e.expando], !!a && !n(a) }, data: function (a, b, c) { return f(a, b, c) }, removeData: function (a, b) { return q(a, b) }, _data: function (a, b, c) { return f(a, b, c, !0) }, _removeData: function (a, b) { return q(a, b, !0) }, acceptData: function (a) {
if (a.nodeType && 1 !== a.nodeType && 9 !== a.nodeType) return !1; var b = a.nodeName &&
e.noData[a.nodeName.toLowerCase()]; return !b || !0 !== b && a.getAttribute("classid") === b
}
}); e.fn.extend({
data: function (a, c) {
var g, l = this[0], h = 0, d = null; if (a === b) { if (this.length && (d = e.data(l), 1 === l.nodeType && !e._data(l, "parsedAttrs"))) { for (g = l.attributes; g.length > h; h++) { var f = g[h].name; f.indexOf("data-") || (f = e.camelCase(f.slice(5)), p(l, f, d[f])) } e._data(l, "parsedAttrs", !0) } return d } return "object" == typeof a ? this.each(function () { e.data(this, a) }) : e.access(this, function (g) {
return g === b ? l ? p(l, a, e.data(l, a)) : null :
(this.each(function () { e.data(this, a, g) }), b)
}, null, c, 1 < arguments.length, null, !0)
}, removeData: function (a) { return this.each(function () { e.removeData(this, a) }) }
}); e.extend({
queue: function (a, c, h) { var g; return a ? (c = (c || "fx") + "queue", g = e._data(a, c), h && (!g || e.isArray(h) ? g = e._data(a, c, e.makeArray(h)) : g.push(h)), g || []) : b }, dequeue: function (a, b) {
b = b || "fx"; var g = e.queue(a, b), c = g.length, l = g.shift(), h = e._queueHooks(a, b), d = function () { e.dequeue(a, b) }; "inprogress" === l && (l = g.shift(), c--); (h.cur = l) && ("fx" === b && g.unshift("inprogress"),
delete h.stop, l.call(a, d, h)); !c && h && h.empty.fire()
}, _queueHooks: function (a, b) { var g = b + "queueHooks"; return e._data(a, g) || e._data(a, g, { empty: e.Callbacks("once memory").add(function () { e._removeData(a, b + "queue"); e._removeData(a, g) }) }) }
}); e.fn.extend({
queue: function (a, c) { var g = 2; return "string" != typeof a && (c = a, a = "fx", g--), g > arguments.length ? e.queue(this[0], a) : c === b ? this : this.each(function () { var b = e.queue(this, a, c); e._queueHooks(this, a); "fx" === a && "inprogress" !== b[0] && e.dequeue(this, a) }) }, dequeue: function (a) {
return this.each(function () {
e.dequeue(this,
a)
})
}, delay: function (a, b) { return a = e.fx ? e.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, g) { var c = setTimeout(b, a); g.stop = function () { clearTimeout(c) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { var g, l = 1, h = e.Deferred(), d = this, f = this.length, m = function () { --l || h.resolveWith(d, [d]) }; "string" != typeof a && (c = a, a = b); for (a = a || "fx"; f--;)(g = e._data(d[f], a + "queueHooks")) && g.empty && (l++, g.empty.add(m)); return m(), h.promise(c) }
}); var ta, La = /[\t\r\n]/g, Pb = /\r/g, Qb = /^(?:input|select|textarea|button|object)$/i,
Rb = /^(?:a|area)$/i, eb = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i, Ma = /^(?:checked|selected)$/i, na = e.support.getSetAttribute, Na = e.support.input; e.fn.extend({
attr: function (a, b) { return e.access(this, e.attr, a, b, 1 < arguments.length) }, removeAttr: function (a) { return this.each(function () { e.removeAttr(this, a) }) }, prop: function (a, b) { return e.access(this, e.prop, a, b, 1 < arguments.length) }, removeProp: function (a) {
return a = e.propFix[a] ||
a, this.each(function () { try { this[a] = b, delete this[a] } catch (l) { } })
}, addClass: function (a) { var b, g, c, h, d = 0, f = this.length; var m = "string" == typeof a && a; if (e.isFunction(a)) return this.each(function (b) { e(this).addClass(a.call(this, b, this.className)) }); if (m) for (m = (a || "").match(da) || []; f > d; d++)if (b = this[d], g = 1 === b.nodeType && (b.className ? (" " + b.className + " ").replace(La, " ") : " ")) { for (h = 0; c = m[h++];)0 > g.indexOf(" " + c + " ") && (g += c + " "); b.className = e.trim(g) } return this }, removeClass: function (a) {
var b, g, c, h, d = 0, f =
this.length; var m = 0 === arguments.length || "string" == typeof a && a; if (e.isFunction(a)) return this.each(function (b) { e(this).removeClass(a.call(this, b, this.className)) }); if (m) for (m = (a || "").match(da) || []; f > d; d++)if (b = this[d], g = 1 === b.nodeType && (b.className ? (" " + b.className + " ").replace(La, " ") : "")) { for (h = 0; c = m[h++];)for (; 0 <= g.indexOf(" " + c + " ");)g = g.replace(" " + c + " ", " "); b.className = a ? e.trim(g) : "" } return this
}, toggleClass: function (a, b) {
var g = typeof a, c = "boolean" == typeof b; return e.isFunction(a) ? this.each(function (g) {
e(this).toggleClass(a.call(this,
g, this.className, b), b)
}) : this.each(function () { if ("string" === g) for (var l, h = 0, d = e(this), f = b, v = a.match(da) || []; l = v[h++];)f = c ? f : !d.hasClass(l), d[f ? "addClass" : "removeClass"](l); else (g === P || "boolean" === g) && (this.className && e._data(this, "__className__", this.className), this.className = this.className || !1 === a ? "" : e._data(this, "__className__") || "") })
}, hasClass: function (a) { a = " " + a + " "; for (var b = 0, g = this.length; g > b; b++)if (1 === this[b].nodeType && 0 <= (" " + this[b].className + " ").replace(La, " ").indexOf(a)) return !0; return !1 },
val: function (a) {
var g, c, h, d = this[0]; if (arguments.length) return h = e.isFunction(a), this.each(function (g) { var l, d = e(this); 1 === this.nodeType && (l = h ? a.call(this, g, d.val()) : a, null == l ? l = "" : "number" == typeof l ? l += "" : e.isArray(l) && (l = e.map(l, function (a) { return null == a ? "" : a + "" })), c = e.valHooks[this.type] || e.valHooks[this.nodeName.toLowerCase()], c && "set" in c && c.set(this, l, "value") !== b || (this.value = l)) }); if (d) return c = e.valHooks[d.type] || e.valHooks[d.nodeName.toLowerCase()], c && "get" in c && (g = c.get(d, "value")) !==
b ? g : (g = d.value, "string" == typeof g ? g.replace(Pb, "") : null == g ? "" : g)
}
}); e.extend({
valHooks: {
option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: {
get: function (a) {
for (var b, g = a.options, c = a.selectedIndex, h = "select-one" === a.type || 0 > c, d = h ? null : [], f = h ? c + 1 : g.length, m = 0 > c ? f : h ? c : 0; f > m; m++)if (b = g[m], !(!b.selected && m !== c || (e.support.optDisabled ? b.disabled : null !== b.getAttribute("disabled")) || b.parentNode.disabled && e.nodeName(b.parentNode, "optgroup"))) {
if (a = e(b).val(), h) return a;
d.push(a)
} return d
}, set: function (a, b) { var g = e.makeArray(b); return e(a).find("option").each(function () { this.selected = 0 <= e.inArray(e(this).val(), g) }), g.length || (a.selectedIndex = -1), g }
}
}, attr: function (a, c, h) {
var g, l, d, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f) return typeof a.getAttribute === P ? e.prop(a, c, h) : (l = 1 !== f || !e.isXMLDoc(a), l && (c = c.toLowerCase(), g = e.attrHooks[c] || (eb.test(c) ? Sb : ta)), h === b ? g && l && "get" in g && null !== (d = g.get(a, c)) ? d : (typeof a.getAttribute !== P && (d = a.getAttribute(c)), null == d ? b : d) : null !==
h ? g && l && "set" in g && (d = g.set(a, h, c)) !== b ? d : (a.setAttribute(c, h + ""), h) : (e.removeAttr(a, c), b))
}, removeAttr: function (a, b) { var g = 0, c = b && b.match(da); if (c && 1 === a.nodeType) for (; b = c[g++];) { var l = e.propFix[b] || b; eb.test(b) ? !na && Ma.test(b) ? a[e.camelCase("default-" + b)] = a[l] = !1 : a[l] = !1 : e.attr(a, b, ""); a.removeAttribute(na ? b : l) } }, attrHooks: { type: { set: function (a, b) { if (!e.support.radioValue && "radio" === b && e.nodeName(a, "input")) { var g = a.value; return a.setAttribute("type", b), g && (a.value = g), b } } } }, propFix: {
tabindex: "tabIndex",
readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable"
}, prop: function (a, c, h) { var g, l, d, f = a.nodeType; if (a && 3 !== f && 8 !== f && 2 !== f) return d = 1 !== f || !e.isXMLDoc(a), d && (c = e.propFix[c] || c, l = e.propHooks[c]), h !== b ? l && "set" in l && (g = l.set(a, h, c)) !== b ? g : a[c] = h : l && "get" in l && null !== (g = l.get(a, c)) ? g : a[c] }, propHooks: {
tabIndex: {
get: function (a) {
var g =
a.getAttributeNode("tabindex"); return g && g.specified ? parseInt(g.value, 10) : Qb.test(a.nodeName) || Rb.test(a.nodeName) && a.href ? 0 : b
}
}
}
}); var Sb = {
get: function (a, c) { var g = e.prop(a, c), l = "boolean" == typeof g && a.getAttribute(c); return (a = "boolean" == typeof g ? Na && na ? null != l : Ma.test(c) ? a[e.camelCase("default-" + c)] : !!l : a.getAttributeNode(c)) && !1 !== a.value ? c.toLowerCase() : b }, set: function (a, b, c) {
return !1 === b ? e.removeAttr(a, c) : Na && na || !Ma.test(c) ? a.setAttribute(!na && e.propFix[c] || c, c) : a[e.camelCase("default-" + c)] = a[c] =
!0, c
}
}; Na && na || (e.attrHooks.value = { get: function (a, c) { c = a.getAttributeNode(c); return e.nodeName(a, "input") ? a.defaultValue : c && c.specified ? c.value : b }, set: function (a, c, h) { return e.nodeName(a, "input") ? (a.defaultValue = c, b) : ta && ta.set(a, c, h) } }); na || (ta = e.valHooks.button = {
get: function (a, c) { return (a = a.getAttributeNode(c)) && ("id" === c || "name" === c || "coords" === c ? "" !== a.value : a.specified) ? a.value : b }, set: function (a, c, e) {
var g = a.getAttributeNode(e); return g || a.setAttributeNode(g = a.ownerDocument.createAttribute(e)),
g.value = c += "", "value" === e || c === a.getAttribute(e) ? c : b
}
}, e.attrHooks.contenteditable = { get: ta.get, set: function (a, b, c) { ta.set(a, "" === b ? !1 : b, c) } }, e.each(["width", "height"], function (a, c) { e.attrHooks[c] = e.extend(e.attrHooks[c], { set: function (a, g) { return "" === g ? (a.setAttribute(c, "auto"), g) : b } }) })); e.support.hrefNormalized || (e.each(["href", "src", "width", "height"], function (a, c) { e.attrHooks[c] = e.extend(e.attrHooks[c], { get: function (a) { a = a.getAttribute(c, 2); return null == a ? b : a } }) }), e.each(["href", "src"], function (a,
b) { e.propHooks[b] = { get: function (a) { return a.getAttribute(b, 4) } } })); e.support.style || (e.attrHooks.style = { get: function (a) { return a.style.cssText || b }, set: function (a, b) { return a.style.cssText = b + "" } }); e.support.optSelected || (e.propHooks.selected = e.extend(e.propHooks.selected, { get: function (a) { a = a.parentNode; return a && (a.selectedIndex, a.parentNode && a.parentNode.selectedIndex), null } })); e.support.enctype || (e.propFix.enctype = "encoding"); e.support.checkOn || e.each(["radio", "checkbox"], function () {
e.valHooks[this] =
{ get: function (a) { return null === a.getAttribute("value") ? "on" : a.value } }
}); e.each(["radio", "checkbox"], function () { e.valHooks[this] = e.extend(e.valHooks[this], { set: function (a, c) { return e.isArray(c) ? a.checked = 0 <= e.inArray(e(a).val(), c) : b } }) }); var Oa = /^(?:input|select|textarea)$/i, Tb = /^key/, Ub = /^(?:mouse|contextmenu)|click/, fb = /^(?:focusinfocus|focusoutblur)$/, gb = /^([^.]*)(?:\.(.+)|)$/; e.event = {
global: {}, add: function (a, c, h, d, f) {
var g, l, m, v, k, t; if (l = e._data(a)) {
h.handler && (m = h, h = m.handler, f = m.selector); h.guid ||
(h.guid = e.guid++); (g = l.events) || (g = l.events = {}); (v = l.handle) || (v = l.handle = function (a) { return typeof e === P || a && e.event.triggered === a.type ? b : e.event.dispatch.apply(v.elem, arguments) }, v.elem = a); c = (c || "").match(da) || [""]; for (l = c.length; l--;) {
var w = gb.exec(c[l]) || []; var r = k = w[1]; var q = (w[2] || "").split(".").sort(); w = e.event.special[r] || {}; r = (f ? w.delegateType : w.bindType) || r; w = e.event.special[r] || {}; k = e.extend({
type: r, origType: k, data: d, handler: h, guid: h.guid, selector: f, needsContext: f && e.expr.match.needsContext.test(f),
namespace: q.join(".")
}, m); (t = g[r]) || (t = g[r] = [], t.delegateCount = 0, w.setup && !1 !== w.setup.call(a, d, q, v) || (a.addEventListener ? a.addEventListener(r, v, !1) : a.attachEvent && a.attachEvent("on" + r, v))); w.add && (w.add.call(a, k), k.handler.guid || (k.handler.guid = h.guid)); f ? t.splice(t.delegateCount++, 0, k) : t.push(k); e.event.global[r] = !0
} a = null
}
}, remove: function (a, b, c, h, d) {
var g, l, f, m, v, k, t, w, r = e.hasData(a) && e._data(a); if (r && (v = r.events)) {
b = (b || "").match(da) || [""]; for (m = b.length; m--;)if (l = gb.exec(b[m]) || [], k = w = l[1],
t = (l[2] || "").split(".").sort(), k) { var q = e.event.special[k] || {}; k = (h ? q.delegateType : q.bindType) || k; var ba = v[k] || []; l = l[2] && RegExp("(^|\\.)" + t.join("\\.(?:.*\\.|)") + "(\\.|$)"); for (f = g = ba.length; g--;) { var B = ba[g]; !d && w !== B.origType || c && c.guid !== B.guid || l && !l.test(B.namespace) || h && h !== B.selector && ("**" !== h || !B.selector) || (ba.splice(g, 1), B.selector && ba.delegateCount--, q.remove && q.remove.call(a, B)) } f && !ba.length && (q.teardown && !1 !== q.teardown.call(a, t, r.handle) || e.removeEvent(a, k, r.handle), delete v[k]) } else for (k in v) e.event.remove(a,
k + b[m], c, h, !0); e.isEmptyObject(v) && (delete r.handle, e._removeData(a, "events"))
}
}, trigger: function (c, l, h, d) {
var g, f, m, v, k = [h || z], t = Aa.call(c, "type") ? c.type : c; var w = Aa.call(c, "namespace") ? c.namespace.split(".") : []; if (m = g = h = h || z, 3 !== h.nodeType && 8 !== h.nodeType && !fb.test(t + e.event.triggered) && (0 <= t.indexOf(".") && (w = t.split("."), t = w.shift(), w.sort()), f = 0 > t.indexOf(":") && "on" + t, c = c[e.expando] ? c : new e.Event(t, "object" == typeof c && c), c.isTrigger = !0, c.namespace = w.join("."), c.namespace_re = c.namespace ? RegExp("(^|\\.)" +
w.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, c.result = b, c.target || (c.target = h), l = null == l ? [c] : e.makeArray(l, [c]), v = e.event.special[t] || {}, d || !v.trigger || !1 !== v.trigger.apply(h, l))) {
if (!d && !v.noBubble && !e.isWindow(h)) { var r = v.delegateType || t; for (fb.test(r + t) || (m = m.parentNode); m; m = m.parentNode)k.push(m), g = m; g === (h.ownerDocument || z) && k.push(g.defaultView || g.parentWindow || a) } for (w = 0; (m = k[w++]) && !c.isPropagationStopped();)c.type = 1 < w ? r : v.bindType || t, (g = (e._data(m, "events") || {})[c.type] && e._data(m, "handle")) &&
g.apply(m, l), (g = f && m[f]) && e.acceptData(m) && g.apply && !1 === g.apply(m, l) && c.preventDefault(); if (c.type = t, !(d || c.isDefaultPrevented() || v._default && !1 !== v._default.apply(h.ownerDocument, l) || "click" === t && e.nodeName(h, "a")) && e.acceptData(h) && f && h[t] && !e.isWindow(h)) { (g = h[f]) && (h[f] = null); e.event.triggered = t; try { h[t]() } catch (xc) { } e.event.triggered = b; g && (h[f] = g) } return c.result
}
}, dispatch: function (a) {
a = e.event.fix(a); var c, g, h, d, f = ma.call(arguments); var m = (e._data(this, "events") || {})[a.type] || []; var k = e.event.special[a.type] ||
{}; if (f[0] = a, a.delegateTarget = this, !k.preDispatch || !1 !== k.preDispatch.call(this, a)) {
var t = e.event.handlers.call(this, a, m); for (m = 0; (h = t[m++]) && !a.isPropagationStopped();)for (a.currentTarget = h.elem, d = 0; (g = h.handlers[d++]) && !a.isImmediatePropagationStopped();)a.namespace_re && !a.namespace_re.test(g.namespace) || (a.handleObj = g, a.data = g.data, c = ((e.event.special[g.origType] || {}).handle || g.handler).apply(h.elem, f), c === b || !1 !== (a.result = c) || (a.preventDefault(), a.stopPropagation())); return k.postDispatch && k.postDispatch.call(this,
a), a.result
}
}, handlers: function (a, c) { var g, h = [], l = c.delegateCount, d = a.target; if (l && d.nodeType && (!a.button || "click" !== a.type)) for (; d != this; d = d.parentNode || this)if (1 === d.nodeType && (!0 !== d.disabled || "click" !== a.type)) { var f = []; for (g = 0; l > g; g++) { var m = c[g]; var k = m.selector + " "; f[k] === b && (f[k] = m.needsContext ? 0 <= e(k, this).index(d) : e.find(k, this, null, [d]).length); f[k] && f.push(m) } f.length && h.push({ elem: d, handlers: f }) } return c.length > l && h.push({ elem: this, handlers: c.slice(l) }), h }, fix: function (a) {
if (a[e.expando]) return a;
var b = a.type; var c = a, g = this.fixHooks[b]; g || (this.fixHooks[b] = g = Ub.test(b) ? this.mouseHooks : Tb.test(b) ? this.keyHooks : {}); var h = g.props ? this.props.concat(g.props) : this.props; a = new e.Event(c); for (b = h.length; b--;) { var d = h[b]; a[d] = c[d] } return a.target || (a.target = c.srcElement || z), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, g.filter ? g.filter(a, c) : a
}, props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
fixHooks: {}, keyHooks: { props: ["char", "charCode", "key", "keyCode"], filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: {
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, c) {
var g, e, h, l = c.button, d = c.fromElement; return null == a.pageX && null != c.clientX && (e = a.target.ownerDocument || z, h = e.documentElement, g = e.body, a.pageX = c.clientX + (h && h.scrollLeft || g && g.scrollLeft || 0) - (h &&
h.clientLeft || g && g.clientLeft || 0), a.pageY = c.clientY + (h && h.scrollTop || g && g.scrollTop || 0) - (h && h.clientTop || g && g.clientTop || 0)), !a.relatedTarget && d && (a.relatedTarget = d === a.target ? c.toElement : d), a.which || l === b || (a.which = 1 & l ? 1 : 2 & l ? 3 : 4 & l ? 2 : 0), a
}
}, special: {
load: { noBubble: !0 }, click: { trigger: function () { return e.nodeName(this, "input") && "checkbox" === this.type && this.click ? (this.click(), !1) : b } }, focus: { trigger: function () { if (this !== z.activeElement && this.focus) try { return this.focus(), !1 } catch (g) { } }, delegateType: "focusin" },
blur: { trigger: function () { return this === z.activeElement && this.blur ? (this.blur(), !1) : b }, delegateType: "focusout" }, beforeunload: { postDispatch: function (a) { a.result !== b && (a.originalEvent.returnValue = a.result) } }
}, simulate: function (a, b, c, h) { a = e.extend(new e.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); h ? e.event.trigger(a, null, b) : e.event.dispatch.call(b, a); a.isDefaultPrevented() && c.preventDefault() }
}; e.removeEvent = z.removeEventListener ? function (a, b, c) {
a.removeEventListener && a.removeEventListener(b, c,
!1)
} : function (a, b, c) { b = "on" + b; a.detachEvent && (typeof a[b] === P && (a[b] = null), a.detachEvent(b, c)) }; e.Event = function (a, c) { return this instanceof e.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || !1 === a.returnValue || a.getPreventDefault && a.getPreventDefault() ? A : H) : this.type = a, c && e.extend(this, c), this.timeStamp = a && a.timeStamp || e.now(), this[e.expando] = !0, b) : new e.Event(a, c) }; e.Event.prototype = {
isDefaultPrevented: H, isPropagationStopped: H, isImmediatePropagationStopped: H,
preventDefault: function () { var a = this.originalEvent; this.isDefaultPrevented = A; a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { var a = this.originalEvent; this.isPropagationStopped = A; a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = A; this.stopPropagation() }
}; e.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) {
e.event.special[a] = {
delegateType: b, bindType: b, handle: function (a) {
var c,
g = a.relatedTarget, h = a.handleObj; return (!g || g !== this && !e.contains(this, g)) && (a.type = h.origType, c = h.handler.apply(this, arguments), a.type = b), c
}
}
}); e.support.submitBubbles || (e.event.special.submit = {
setup: function () {
return e.nodeName(this, "form") ? !1 : (e.event.add(this, "click._submit keypress._submit", function (a) { a = a.target; (a = e.nodeName(a, "input") || e.nodeName(a, "button") ? a.form : b) && !e._data(a, "submitBubbles") && (e.event.add(a, "submit._submit", function (a) { a._submit_bubble = !0 }), e._data(a, "submitBubbles", !0)) }),
b)
}, postDispatch: function (a) { a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && e.event.simulate("submit", this.parentNode, a, !0)) }, teardown: function () { return e.nodeName(this, "form") ? !1 : (e.event.remove(this, "._submit"), b) }
}); e.support.changeBubbles || (e.event.special.change = {
setup: function () {
return Oa.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (e.event.add(this, "propertychange._change", function (a) {
"checked" === a.originalEvent.propertyName && (this._just_changed =
!0)
}), e.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1); e.event.simulate("change", this, a, !0) })), !1) : (e.event.add(this, "beforeactivate._change", function (a) { a = a.target; Oa.test(a.nodeName) && !e._data(a, "changeBubbles") && (e.event.add(a, "change._change", function (a) { !this.parentNode || a.isSimulated || a.isTrigger || e.event.simulate("change", this.parentNode, a, !0) }), e._data(a, "changeBubbles", !0)) }), b)
}, handle: function (a) {
var c = a.target; return this !== c || a.isSimulated ||
a.isTrigger || "radio" !== c.type && "checkbox" !== c.type ? a.handleObj.handler.apply(this, arguments) : b
}, teardown: function () { return e.event.remove(this, "._change"), !Oa.test(this.nodeName) }
}); e.support.focusinBubbles || e.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var c = 0, g = function (a) { e.event.simulate(b, a.target, e.event.fix(a), !0) }; e.event.special[b] = { setup: function () { 0 === c++ && z.addEventListener(a, g, !0) }, teardown: function () { 0 === --c && z.removeEventListener(a, g, !0) } } }); e.fn.extend({
on: function (a, c, h,
d, f) { var g, l; if ("object" == typeof a) { "string" != typeof c && (h = h || c, c = b); for (g in a) this.on(g, c, h, a[g], f); return this } if (null == h && null == d ? (d = c, h = c = b) : null == d && ("string" == typeof c ? (d = h, h = b) : (d = h, h = c, c = b)), !1 === d) d = H; else if (!d) return this; return 1 === f && (l = d, d = function (a) { return e().off(a), l.apply(this, arguments) }, d.guid = l.guid || (l.guid = e.guid++)), this.each(function () { e.event.add(this, a, d, h, c) }) }, one: function (a, b, c, e) { return this.on(a, b, c, e, 1) }, off: function (a, c, h) {
var g, d; if (a && a.preventDefault && a.handleObj) return g =
a.handleObj, e(a.delegateTarget).off(g.namespace ? g.origType + "." + g.namespace : g.origType, g.selector, g.handler), this; if ("object" == typeof a) { for (d in a) this.off(d, c, a[d]); return this } return (!1 === c || "function" == typeof c) && (h = c, c = b), !1 === h && (h = H), this.each(function () { e.event.remove(this, a, h, c) })
}, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, delegate: function (a, b, c, e) { return this.on(b, a, c, e) }, undelegate: function (a, b, c) {
return 1 === arguments.length ? this.off(a,
"**") : this.off(b, a || "**", c)
}, trigger: function (a, b) { return this.each(function () { e.event.trigger(a, b, this) }) }, triggerHandler: function (a, c) { var g = this[0]; return g ? e.event.trigger(a, c, g, !0) : b }
}); (function (a, b) {
function c() { var a, b = []; return a = function (c, g) { return b.push(c += " ") > L.cacheLength && delete a[b.shift()], a[c] = g } } function g(a) { return a[C] = !0, a } function h(a) { var b = E.createElement("div"); try { return a(b) } catch (aa) { return !1 } finally { } } function d(a, b, c, g) {
var e, h, d, f, l; if ((b ? b.ownerDocument || b : A) !==
E && ca(b), b = b || E, c = c || [], !a || "string" != typeof a) return c; if (1 !== (f = b.nodeType) && 9 !== f) return []; if (!P && !g) {
if (e = la.exec(a)) if (d = e[1]) if (9 === f) { if (h = b.getElementById(d), !h || !h.parentNode) return c; if (h.id === d) return c.push(h), c } else { if (b.ownerDocument && (h = b.ownerDocument.getElementById(d)) && F(b, h) && h.id === d) return c.push(h), c } else {
if (e[2]) return T.apply(c, S.call(b.getElementsByTagName(a), 0)), c; if ((d = e[3]) && I.getByClassName && b.getElementsByClassName) return T.apply(c, S.call(b.getElementsByClassName(d),
0)), c
} if (I.qsa && !R.test(a)) { if (e = !0, h = C, d = b, l = 9 === f && a, 1 === f && "object" !== b.nodeName.toLowerCase()) { f = t(a); (e = b.getAttribute("id")) ? h = e.replace(pa, "\\$&") : b.setAttribute("id", h); h = "[id='" + h + "'] "; for (d = f.length; d--;)f[d] = h + r(f[d]); d = ea.test(a) && b.parentNode || b; l = f.join(",") } if (l) try { return T.apply(c, S.call(d.querySelectorAll(l), 0)), c } catch (zc) { } finally { e || b.removeAttribute("id") } }
} var m; a: {
a = a.replace(V, "$1"); var k, v; h = t(a); if (!g && 1 === h.length) {
if (m = h[0] = h[0].slice(0), 2 < m.length && "ID" === (k = m[0]).type &&
9 === b.nodeType && !P && L.relative[m[1].type]) { if (b = L.find.ID(k.matches[0].replace(ua, va), b)[0], !b) { m = c; break a } a = a.slice(m.shift().value.length) } for (f = Z.needsContext.test(a) ? 0 : m.length; f-- && (k = m[f], !L.relative[e = k.type]);)if ((v = L.find[e]) && (g = v(k.matches[0].replace(ua, va), ea.test(m[0].type) && b.parentNode || b))) { if (m.splice(f, 1), a = g.length && r(m), !a) { m = (T.apply(c, S.call(g, 0)), c); break a } break }
} m = (ra(a, h)(g, b, P, c, ea.test(a)), c)
} return m
} function f(a, b) {
var c = b && a, g = c && (~b.sourceIndex || -2147483648) - (~a.sourceIndex ||
-2147483648); if (g) return g; if (c) for (; c = c.nextSibling;)if (c === b) return -1; return a ? 1 : -1
} function l(a) { return function (b) { return "input" === b.nodeName.toLowerCase() && b.type === a } } function m(a) { return function (b) { var c = b.nodeName.toLowerCase(); return ("input" === c || "button" === c) && b.type === a } } function k(a) { return g(function (b) { return b = +b, g(function (c, g) { for (var e, h = a([], c.length, b), d = h.length; d--;)c[e = h[d]] && (c[e] = !(g[e] = c[e])) }) }) } function t(a, b) {
var c, g, e, h, f; if (h = ha[a + " "]) return b ? 0 : h.slice(0); h = a; var l =
[]; for (f = L.preFilter; h;) { m && !(c = Ia.exec(h)) || (c && (h = h.slice(c[0].length) || h), l.push(g = [])); var m = !1; (c = xa.exec(h)) && (m = c.shift(), g.push({ value: m, type: c[0].replace(V, " ") }), h = h.slice(m.length)); for (e in L.filter) !(c = Z[e].exec(h)) || f[e] && !(c = f[e](c)) || (m = c.shift(), g.push({ value: m, type: e, matches: c }), h = h.slice(m.length)); if (!m) break } return b ? h.length : h ? d.error(a) : ha(a, l).slice(0)
} function r(a) { for (var b = 0, c = a.length, g = ""; c > b; b++)g += a[b].value; return g } function q(a, b, c) {
var g = b.dir, e = c && "parentNode" ===
g, h = ia++; return b.first ? function (b, c, h) { for (; b = b[g];)if (1 === b.nodeType || e) return a(b, c, h) } : function (b, c, d) { var f, l, m, k = D + " " + h; if (d) for (; b = b[g];) { if ((1 === b.nodeType || e) && a(b, c, d)) return !0 } else for (; b = b[g];)if (1 === b.nodeType || e) if (m = b[C] || (b[C] = {}), (l = m[g]) && l[0] === k) { if (!0 === (f = l[1]) || f === O) return !0 === f } else if (l = m[g] = [k], l[1] = a(b, c, d) || O, !0 === l[1]) return !0 }
} function B(a) { return 1 < a.length ? function (b, c, g) { for (var e = a.length; e--;)if (!a[e](b, c, g)) return !1; return !0 } : a[0] } function x(a, b, c, g, e) {
for (var h,
d = [], f = 0, l = a.length, m = null != b; l > f; f++)(h = a[f]) && (!c || c(h, g, e)) && (d.push(h), m && b.push(f)); return d
} function X(a, b, c, e, h, f) {
return e && !e[C] && (e = X(e)), h && !h[C] && (h = X(h, f)), g(function (g, f, l, m) {
var k, t = [], v = [], r = f.length, q; if (!(q = g)) { q = b || "*"; for (var w = l.nodeType ? [l] : l, B = [], oa = 0, X = w.length; X > oa; oa++)d(q, w[oa], B); q = B } q = !a || !g && b ? q : x(q, t, a, l, m); w = c ? h || (g ? a : r || e) ? [] : f : q; if (c && c(q, w, l, m), e) { var aa = x(w, v); e(aa, [], l, m); for (l = aa.length; l--;)(k = aa[l]) && (w[v[l]] = !(q[v[l]] = k)) } if (g) {
if (h || a) {
if (h) {
aa = []; for (l = w.length; l--;)(k =
w[l]) && aa.push(q[l] = k); h(null, w = [], aa, m)
} for (l = w.length; l--;)(k = w[l]) && -1 < (aa = h ? za.call(g, k) : t[l]) && (g[aa] = !(f[aa] = k))
}
} else w = x(w === f ? w.splice(r, w.length) : w), h ? h(null, f, w, m) : T.apply(f, w)
})
} function n(a) {
var b, c, g = a.length, e = L.relative[a[0].type]; var h = e || L.relative[" "]; for (var d = e ? 1 : 0, f = q(function (a) { return a === b }, h, !0), l = q(function (a) { return -1 < za.call(b, a) }, h, !0), m = [function (a, c, g) { return !e && (g || c !== y) || ((b = c).nodeType ? f(a, c, g) : l(a, c, g)) }]; g > d; d++)if (h = L.relative[a[d].type]) m = [q(B(m), h)]; else {
if (h =
L.filter[a[d].type].apply(null, a[d].matches), h[C]) { for (c = ++d; g > c && !L.relative[a[c].type]; c++); return X(1 < d && B(m), 1 < d && r(a.slice(0, d - 1)).replace(V, "$1"), h, c > d && n(a.slice(d, c)), g > c && n(a = a.slice(c)), g > c && r(a)) } m.push(h)
} return B(m)
} function Q(a, b) {
var c = 0, e = 0 < b.length, h = 0 < a.length, f = function (g, f, l, m, k) {
var t, v, r = [], q = 0, w = "0", B = g && [], oa = null != k, X = y, ba = g || h && L.find.TAG("*", k && f.parentNode || f), aa = D += null == X ? 1 : Math.random() || .1; for (oa && (y = f !== E && f, O = c); null != (k = ba[w]); w++) {
if (h && k) {
for (t = 0; v = a[t++];)if (v(k,
f, l)) { m.push(k); break } oa && (D = aa, O = ++c)
} e && ((k = !v && k) && q--, g && B.push(k))
} if (q += w, e && w !== q) { for (t = 0; v = b[t++];)v(B, r, f, l); if (g) { if (0 < q) for (; w--;)B[w] || r[w] || (r[w] = wa.call(m)); r = x(r) } T.apply(m, r); oa && !g && 0 < r.length && 1 < q + b.length && d.uniqueSort(m) } return oa && (D = aa, y = X), B
}; return e ? g(f) : f
} function G() { } var U, O, p, y, E, z, P, R, u, K, F, J, C = "sizzle" + -new Date, A = a.document, I = {}, D = 0, ia = 0, M = c(), ha = c(), H = c(), N = typeof b, W = [], wa = W.pop, T = W.push, S = W.slice, za = W.indexOf || function (a) {
for (var b = 0, c = this.length; c > b; b++)if (this[b] ===
a) return b; return -1
}; W = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w", "w#"); var Y = "\\[[\\x20\\t\\r\\n\\f]*((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)[\\x20\\t\\r\\n\\f]*(?:([*^$|!~]?=)[\\x20\\t\\r\\n\\f]*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + W + ")|)|)[\\x20\\t\\r\\n\\f]*\\]", ja = ":((?:\\\\.|[\\w-]|[^\\x00-\\xa0])+)(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + Y.replace(3, 8) + ")*)|.*)\\)|)", V = /^[\x20\t\r\n\f]+|((?:^|[^\\])(?:\\.)*)[\x20\t\r\n\f]+$/g, Ia = /^[\x20\t\r\n\f]*,[\x20\t\r\n\f]*/, xa =
/^[\x20\t\r\n\f]*([\x20\t\r\n\f>+~])[\x20\t\r\n\f]*/, da = RegExp(ja), qa = RegExp("^" + W + "$"), Z = {
ID: /^#((?:\\.|[\w-]|[^\x00-\xa0])+)/, CLASS: /^\.((?:\\.|[\w-]|[^\x00-\xa0])+)/, NAME: /^\[name=['"]?((?:\\.|[\w-]|[^\x00-\xa0])+)['"]?\]/, TAG: RegExp("^(" + "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+".replace("w", "w*") + ")"), ATTR: RegExp("^" + Y), PSEUDO: RegExp("^" + ja), CHILD: /^:(only|first|last|nth|nth-last)-(child|of-type)(?:\([\x20\t\r\n\f]*(even|odd|(([+-]|)(\d*)n|)[\x20\t\r\n\f]*(?:([+-]|)[\x20\t\r\n\f]*(\d+)|))[\x20\t\r\n\f]*\)|)/i,
needsContext: /^[\x20\t\r\n\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\([\x20\t\r\n\f]*((?:-\d)?\d*)[\x20\t\r\n\f]*\)|)(?=[^-]|$)/i
}, ea = /[\x20\t\r\n\f]*[+~]/, fa = /^[^{]+\{\s*\[native code/, la = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ma = /^(?:input|select|textarea|button)$/i, na = /^h\d$/i, pa = /'|\\/g, sa = /=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, ua = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, va = function (a, b) {
a = "0x" + b - 65536; return a !== a ? b : 0 > a ? String.fromCharCode(a + 65536) : String.fromCharCode(55296 | a >> 10, 56320 |
1023 & a)
}; try { S.call(A.documentElement.childNodes, 0)[0].nodeType } catch (oa) { S = function (a) { for (var b, c = []; b = this[a++];)c.push(b); return c } } var ta = d.isXML = function (a) { return (a = a && (a.ownerDocument || a).documentElement) ? "HTML" !== a.nodeName : !1 }; var ca = d.setDocument = function (a) {
var c = a ? a.ownerDocument || a : A; return c !== E && 9 === c.nodeType && c.documentElement ? (E = c, z = c.documentElement, P = ta(c), I.tagNameNoComments = h(function (a) { return a.appendChild(c.createComment("")), !a.getElementsByTagName("*").length }), I.attributes =
h(function (a) { a.innerHTML = "<select></select>"; a = typeof a.lastChild.getAttribute("multiple"); return "boolean" !== a && "string" !== a }), I.getByClassName = h(function (a) { return a.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", a.getElementsByClassName && a.getElementsByClassName("e").length ? (a.lastChild.className = "e", 2 === a.getElementsByClassName("e").length) : !1 }), I.getByName = h(function (a) {
a.id = C + 0; a.innerHTML = "<a name='" + C + "'></a><div name='" + C + "'></div>"; z.insertBefore(a, z.firstChild); var b =
c.getElementsByName && c.getElementsByName(C).length === 2 + c.getElementsByName(C + 0).length; return I.getIdNotName = !c.getElementById(C), z.removeChild(a), b
}), L.attrHandle = h(function (a) { return a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute !== N && "#" === a.firstChild.getAttribute("href") }) ? {} : { href: function (a) { return a.getAttribute("href", 2) }, type: function (a) { return a.getAttribute("type") } }, I.getIdNotName ? (L.find.ID = function (a, b) {
if (typeof b.getElementById !== N && !P) return (a = b.getElementById(a)) &&
a.parentNode ? [a] : []
}, L.filter.ID = function (a) { var b = a.replace(ua, va); return function (a) { return a.getAttribute("id") === b } }) : (L.find.ID = function (a, c) { if (typeof c.getElementById !== N && !P) return (c = c.getElementById(a)) ? c.id === a || typeof c.getAttributeNode !== N && c.getAttributeNode("id").value === a ? [c] : b : [] }, L.filter.ID = function (a) { var b = a.replace(ua, va); return function (a) { return (a = typeof a.getAttributeNode !== N && a.getAttributeNode("id")) && a.value === b } }), L.find.TAG = I.tagNameNoComments ? function (a, c) {
return typeof c.getElementsByTagName !==
N ? c.getElementsByTagName(a) : b
} : function (a, b) { var c = [], g = 0; b = b.getElementsByTagName(a); if ("*" === a) { for (; a = b[g++];)1 === a.nodeType && c.push(a); return c } return b }, L.find.NAME = I.getByName && function (a, c) { return typeof c.getElementsByName !== N ? c.getElementsByName(name) : b }, L.find.CLASS = I.getByClassName && function (a, c) { return typeof c.getElementsByClassName === N || P ? b : c.getElementsByClassName(a) }, u = [], R = [":focus"], (I.qsa = fa.test(c.querySelectorAll + "")) && (h(function (a) {
a.innerHTML = "<select><option selected=''></option></select>";
a.querySelectorAll("[selected]").length || R.push("\\[[\\x20\\t\\r\\n\\f]*(?:checked|disabled|ismap|multiple|readonly|selected|value)"); a.querySelectorAll(":checked").length || R.push(":checked")
}), h(function (a) { a.innerHTML = "<input type='hidden' i=''/>"; a.querySelectorAll("[i^='']").length && R.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:\"\"|'')"); a.querySelectorAll(":enabled").length || R.push(":enabled", ":disabled"); a.querySelectorAll("*,:x"); R.push(",.*:") })), (I.matchesSelector = fa.test((K = z.matchesSelector || z.mozMatchesSelector ||
z.webkitMatchesSelector || z.oMatchesSelector || z.msMatchesSelector) + "")) && h(function (a) { I.disconnectedMatch = K.call(a, "div"); K.call(a, "[s!='']:x"); u.push("!=", ja) }), R = RegExp(R.join("|")), u = RegExp(u.join("|")), F = fa.test(z.contains + "") || z.compareDocumentPosition ? function (a, b) { var c = 9 === a.nodeType ? a.documentElement : a; b = b && b.parentNode; return a === b || !(!b || 1 !== b.nodeType || !(c.contains ? c.contains(b) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(b))) } : function (a, b) {
if (b) for (; b = b.parentNode;)if (b ===
a) return !0; return !1
}, J = z.compareDocumentPosition ? function (a, b) { var g; return a === b ? (p = !0, 0) : (g = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition(b)) ? 1 & g || a.parentNode && 11 === a.parentNode.nodeType ? a === c || F(A, a) ? -1 : b === c || F(A, b) ? 1 : 0 : 4 & g ? -1 : 1 : a.compareDocumentPosition ? -1 : 1 } : function (a, b) {
var g = 0, e = a.parentNode, h = b.parentNode, d = [a], l = [b]; if (a === b) return p = !0, 0; if (!e || !h) return a === c ? -1 : b === c ? 1 : e ? -1 : h ? 1 : 0; if (e === h) return f(a, b); for (; a = a.parentNode;)d.unshift(a); for (a = b; a = a.parentNode;)l.unshift(a);
for (; d[g] === l[g];)g++; return g ? f(d[g], l[g]) : d[g] === A ? -1 : l[g] === A ? 1 : 0
}, p = !1, [0, 0].sort(J), I.detectDuplicates = p, E) : E
}; d.matches = function (a, b) { return d(a, null, null, b) }; d.matchesSelector = function (a, b) { if ((a.ownerDocument || a) !== E && ca(a), b = b.replace(sa, "='$1']"), !(!I.matchesSelector || P || u && u.test(b) || R.test(b))) try { var c = K.call(a, b); if (c || I.disconnectedMatch || a.document && 11 !== a.document.nodeType) return c } catch (yc) { } return 0 < d(b, E, null, [a]).length }; d.contains = function (a, b) {
return (a.ownerDocument || a) !== E &&
ca(a), F(a, b)
}; d.attr = function (a, b) { var c; return (a.ownerDocument || a) !== E && ca(a), P || (b = b.toLowerCase()), (c = L.attrHandle[b]) ? c(a) : P || I.attributes ? a.getAttribute(b) : ((c = a.getAttributeNode(b)) || a.getAttribute(b)) && !0 === a[b] ? b : c && c.specified ? c.value : null }; d.error = function (a) { throw Error("Syntax error, unrecognized expression: " + a); }; d.uniqueSort = function (a) { var b, c = [], g = 1, e = 0; if (p = !I.detectDuplicates, a.sort(J), p) { for (; b = a[g]; g++)b === a[g - 1] && (e = c.push(g)); for (; e--;)a.splice(c[e], 1) } return a }; var ka = d.getText =
function (a) { var b, c = "", g = 0; if (b = a.nodeType) if (1 === b || 9 === b || 11 === b) { if ("string" == typeof a.textContent) return a.textContent; for (a = a.firstChild; a; a = a.nextSibling)c += ka(a) } else { if (3 === b || 4 === b) return a.nodeValue } else for (; b = a[g]; g++)c += ka(b); return c }; var L = d.selectors = {
cacheLength: 50, createPseudo: g, match: Z, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: {
ATTR: function (a) {
return a[1] = a[1].replace(ua,
va), a[3] = (a[4] || a[5] || "").replace(ua, va), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
}, CHILD: function (a) { return a[1] = a[1].toLowerCase(), "nth" === a[1].slice(0, 3) ? (a[3] || d.error(a[0]), a[4] = +(a[4] ? a[5] + (a[6] || 1) : 2 * ("even" === a[3] || "odd" === a[3])), a[5] = +(a[7] + a[8] || "odd" === a[3])) : a[3] && d.error(a[0]), a }, PSEUDO: function (a) {
var b, c = !a[5] && a[2]; return Z.CHILD.test(a[0]) ? null : (a[4] ? a[2] = a[4] : c && da.test(c) && (b = t(c, !0)) && (b = c.indexOf(")", c.length - b) - c.length) && (a[0] = a[0].slice(0, b), a[2] = c.slice(0, b)), a.slice(0,
3))
}
}, filter: {
TAG: function (a) { return "*" === a ? function () { return !0 } : (a = a.replace(ua, va).toLowerCase(), function (b) { return b.nodeName && b.nodeName.toLowerCase() === a }) }, CLASS: function (a) { var b = M[a + " "]; return b || (b = RegExp("(^|[\\x20\\t\\r\\n\\f])" + a + "([\\x20\\t\\r\\n\\f]|$)")) && M(a, function (a) { return b.test(a.className || typeof a.getAttribute !== N && a.getAttribute("class") || "") }) }, ATTR: function (a, b, c) {
return function (g) {
g = d.attr(g, a); return null == g ? "!=" === b : b ? (g += "", "=" === b ? g === c : "!=" === b ? g !== c : "^=" === b ? c &&
0 === g.indexOf(c) : "*=" === b ? c && -1 < g.indexOf(c) : "$=" === b ? c && g.slice(-c.length) === c : "~=" === b ? -1 < (" " + g + " ").indexOf(c) : "|=" === b ? g === c || g.slice(0, c.length + 1) === c + "-" : !1) : !0
}
}, CHILD: function (a, b, c, g, e) {
var h = "nth" !== a.slice(0, 3), d = "last" !== a.slice(-4), f = "of-type" === b; return 1 === g && 0 === e ? function (a) { return !!a.parentNode } : function (b, c, l) {
var m; c = h !== d ? "nextSibling" : "previousSibling"; var k = b.parentNode, t = f && b.nodeName.toLowerCase(); l = !l && !f; if (k) {
if (h) {
for (; c;) {
for (m = b; m = m[c];)if (f ? m.nodeName.toLowerCase() ===
t : 1 === m.nodeType) return !1; var v = c = "only" === a && !v && "nextSibling"
} return !0
} if (v = [d ? k.firstChild : k.lastChild], d && l) { l = k[C] || (k[C] = {}); var r = l[a] || []; var q = r[0] === D && r[1]; var w = r[0] === D && r[2]; for (m = q && k.childNodes[q]; m = ++q && m && m[c] || (w = q = 0) || v.pop();)if (1 === m.nodeType && ++w && m === b) { l[a] = [D, q, w]; break } } else if (l && (r = (b[C] || (b[C] = {}))[a]) && r[0] === D) w = r[1]; else for (; (m = ++q && m && m[c] || (w = q = 0) || v.pop()) && ((f ? m.nodeName.toLowerCase() !== t : 1 !== m.nodeType) || !++w || (l && ((m[C] || (m[C] = {}))[a] = [D, w]), m !== b));); return w -=
e, w === g || 0 === w % g && 0 <= w / g
}
}
}, PSEUDO: function (a, b) { var c, e = L.pseudos[a] || L.setFilters[a.toLowerCase()] || d.error("unsupported pseudo: " + a); return e[C] ? e(b) : 1 < e.length ? (c = [a, a, "", b], L.setFilters.hasOwnProperty(a.toLowerCase()) ? g(function (a, c) { for (var g, h = e(a, b), d = h.length; d--;)g = za.call(a, h[d]), a[g] = !(c[g] = h[d]) }) : function (a) { return e(a, 0, c) }) : e }
}, pseudos: {
not: g(function (a) {
var b = [], c = [], e = ra(a.replace(V, "$1")); return e[C] ? g(function (a, b, c, g) {
var h; c = e(a, null, g, []); for (g = a.length; g--;)(h = c[g]) && (a[g] =
!(b[g] = h))
}) : function (a, g, h) { return b[0] = a, e(b, null, h, c), !c.pop() }
}), has: g(function (a) { return function (b) { return 0 < d(a, b).length } }), contains: g(function (a) { return function (b) { return -1 < (b.textContent || b.innerText || ka(b)).indexOf(a) } }), lang: g(function (a) {
return qa.test(a || "") || d.error("unsupported lang: " + a), a = a.replace(ua, va).toLowerCase(), function (b) {
var c; do if (c = P ? b.getAttribute("xml:lang") || b.getAttribute("lang") : b.lang) return c = c.toLowerCase(), c === a || 0 === c.indexOf(a + "-"); while ((b = b.parentNode) &&
1 === b.nodeType); return !1
}
}), target: function (b) { var c = a.location && a.location.hash; return c && c.slice(1) === b.id }, root: function (a) { return a === z }, focus: function (a) { return a === E.activeElement && (!E.hasFocus || E.hasFocus()) && !!(a.type || a.href || ~a.tabIndex) }, enabled: function (a) { return !1 === a.disabled }, disabled: function (a) { return !0 === a.disabled }, checked: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && !!a.checked || "option" === b && !!a.selected }, selected: function (a) {
return a.parentNode && a.parentNode.selectedIndex,
!0 === a.selected
}, empty: function (a) { for (a = a.firstChild; a; a = a.nextSibling)if ("@" < a.nodeName || 3 === a.nodeType || 4 === a.nodeType) return !1; return !0 }, parent: function (a) { return !L.pseudos.empty(a) }, header: function (a) { return na.test(a.nodeName) }, input: function (a) { return ma.test(a.nodeName) }, button: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && "button" === a.type || "button" === b }, text: function (a) {
var b; return "input" === a.nodeName.toLowerCase() && "text" === a.type && (null == (b = a.getAttribute("type")) || b.toLowerCase() ===
a.type)
}, first: k(function () { return [0] }), last: k(function (a, b) { return [b - 1] }), eq: k(function (a, b, c) { return [0 > c ? c + b : c] }), even: k(function (a, b) { for (var c = 0; b > c; c += 2)a.push(c); return a }), odd: k(function (a, b) { for (var c = 1; b > c; c += 2)a.push(c); return a }), lt: k(function (a, b, c) { for (b = 0 > c ? c + b : c; 0 <= --b;)a.push(b); return a }), gt: k(function (a, b, c) { for (c = 0 > c ? c + b : c; b > ++c;)a.push(c); return a })
}
}; for (U in { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) L.pseudos[U] = l(U); for (U in { submit: !0, reset: !0 }) L.pseudos[U] = m(U); var ra =
d.compile = function (a, b) { var c, g = [], e = [], h = H[a + " "]; if (!h) { b || (b = t(a)); for (c = b.length; c--;)h = n(b[c]), h[C] ? g.push(h) : e.push(h); h = H(a, Q(e, g)) } return h }; L.pseudos.nth = L.pseudos.eq; L.filters = G.prototype = L.pseudos; L.setFilters = new G; ca(); d.attr = e.attr; e.find = d; e.expr = d.selectors; e.expr[":"] = e.expr.pseudos; e.unique = d.uniqueSort; e.text = d.getText; e.isXMLDoc = d.isXML; e.contains = d.contains
})(a); var Wb = /Until$/, Xb = /^(?:parents|prev(?:Until|All))/, zb = /^.[^:#\[\.,]*$/, ib = e.expr.match.needsContext, Yb = {
children: !0,
contents: !0, next: !0, prev: !0
}; e.fn.extend({
find: function (a) { var b, c, g = this.length; if ("string" != typeof a) return c = this, this.pushStack(e(a).filter(function () { for (b = 0; g > b; b++)if (e.contains(c[b], this)) return !0 })); var h = []; for (b = 0; g > b; b++)e.find(a, this[b], h); return h = this.pushStack(1 < g ? e.unique(h) : h), h.selector = (this.selector ? this.selector + " " : "") + a, h }, has: function (a) { var b, c = e(a, this), g = c.length; return this.filter(function () { for (b = 0; g > b; b++)if (e.contains(this, c[b])) return !0 }) }, not: function (a) {
return this.pushStack(S(this,
a, !1))
}, filter: function (a) { return this.pushStack(S(this, a, !0)) }, is: function (a) { return !!a && ("string" == typeof a ? ib.test(a) ? 0 <= e(a, this.context).index(this[0]) : 0 < e.filter(a, this).length : 0 < this.filter(a).length) }, closest: function (a, b) {
for (var c, g = 0, h = this.length, d = [], f = ib.test(a) || "string" != typeof a ? e(a, b || this.context) : 0; h > g; g++)for (c = this[g]; c && c.ownerDocument && c !== b && 11 !== c.nodeType;) { if (f ? -1 < f.index(c) : e.find.matchesSelector(c, a)) { d.push(c); break } c = c.parentNode } return this.pushStack(1 < d.length ? e.unique(d) :
d)
}, index: function (a) { return a ? "string" == typeof a ? e.inArray(this[0], e(a)) : e.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (a, b) { a = "string" == typeof a ? e(a, b) : e.makeArray(a && a.nodeType ? [a] : a); a = e.merge(this.get(), a); return this.pushStack(e.unique(a)) }, addBack: function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) }
}); e.fn.andSelf = e.fn.addBack; e.each({
parent: function (a) { return (a = a.parentNode) && 11 !== a.nodeType ? a : null }, parents: function (a) {
return e.dir(a,
"parentNode")
}, parentsUntil: function (a, b, c) { return e.dir(a, "parentNode", c) }, next: function (a) { return D(a, "nextSibling") }, prev: function (a) { return D(a, "previousSibling") }, nextAll: function (a) { return e.dir(a, "nextSibling") }, prevAll: function (a) { return e.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return e.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return e.dir(a, "previousSibling", c) }, siblings: function (a) { return e.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return e.sibling(a.firstChild) },
contents: function (a) { return e.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : e.merge([], a.childNodes) }
}, function (a, b) { e.fn[a] = function (c, g) { var h = e.map(this, b, c); return Wb.test(a) || (g = c), g && "string" == typeof g && (h = e.filter(g, h)), h = 1 < this.length && !Yb[a] ? e.unique(h) : h, 1 < this.length && Xb.test(a) && (h = h.reverse()), this.pushStack(h) } }); e.extend({
filter: function (a, b, c) { return c && (a = ":not(" + a + ")"), 1 === b.length ? e.find.matchesSelector(b[0], a) ? [b[0]] : [] : e.find.matches(a, b) }, dir: function (a, c,
h) { var g = []; for (a = a[c]; a && 9 !== a.nodeType && (h === b || 1 !== a.nodeType || !e(a).is(h));)1 === a.nodeType && g.push(a), a = a[c]; return g }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling)1 === a.nodeType && a !== b && c.push(a); return c }
}); var Xa = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", Zb = / jQuery\d+="(?:null|\d+)"/g, jb = RegExp("<(?:" + Xa + ")[\\s/>]", "i"), Pa = /^\s+/, kb = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
lb = /<([\w:]+)/, mb = /<tbody/i, $b = /<|&#?\w+;/, ac = /<(?:script|style|link)/i, Ga = /^(?:checkbox|radio)$/i, bc = /checked\s*(?:[^=]|=\s*.checked.)/i, nb = /^$|\/(?:java|ecma)script/i, Ab = /^true\/(.*)/, cc = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, V = {
option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], area: [1, "<map>", "</map>"], param: [1, "<object>", "</object>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>",
"</colgroup></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], _default: e.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"]
}, Qa = N(z).appendChild(z.createElement("div")); V.optgroup = V.option; V.tbody = V.tfoot = V.colgroup = V.caption = V.thead; V.th = V.td; e.fn.extend({
text: function (a) { return e.access(this, function (a) { return a === b ? e.text(this) : this.empty().append((this[0] && this[0].ownerDocument || z).createTextNode(a)) }, null, a, arguments.length) }, wrapAll: function (a) {
if (e.isFunction(a)) return this.each(function (b) {
e(this).wrapAll(a.call(this,
b))
}); if (this[0]) { var b = e(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]); b.map(function () { for (var a = this; a.firstChild && 1 === a.firstChild.nodeType;)a = a.firstChild; return a }).append(this) } return this
}, wrapInner: function (a) { return e.isFunction(a) ? this.each(function (b) { e(this).wrapInner(a.call(this, b)) }) : this.each(function () { var b = e(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) {
var b = e.isFunction(a); return this.each(function (c) {
e(this).wrapAll(b ?
a.call(this, c) : a)
})
}, unwrap: function () { return this.parent().each(function () { e.nodeName(this, "body") || e(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || this.insertBefore(a, this.firstChild) }) }, before: function () {
return this.domManip(arguments,
!1, function (a) { this.parentNode && this.parentNode.insertBefore(a, this) })
}, after: function () { return this.domManip(arguments, !1, function (a) { this.parentNode && this.parentNode.insertBefore(a, this.nextSibling) }) }, remove: function (a, b) { for (var c, g = 0; null != (c = this[g]); g++)(!a || 0 < e.filter(a, [c]).length) && (b || 1 !== c.nodeType || e.cleanData(u(c)), c.parentNode && (b && e.contains(c.ownerDocument, c) && C(u(c, "script")), c.parentNode.removeChild(c))); return this }, empty: function () {
for (var a, b = 0; null != (a = this[b]); b++) {
for (1 ===
a.nodeType && e.cleanData(u(a, !1)); a.firstChild;)a.removeChild(a.firstChild); a.options && e.nodeName(a, "select") && (a.options.length = 0)
} return this
}, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return e.clone(this, a, b) }) }, html: function (a) {
return e.access(this, function (a) {
var c = this[0] || {}, g = 0, h = this.length; if (a === b) return 1 === c.nodeType ? c.innerHTML.replace(Zb, "") : b; if (!("string" != typeof a || ac.test(a) || !e.support.htmlSerialize && jb.test(a) || !e.support.leadingWhitespace && Pa.test(a) ||
V[(lb.exec(a) || ["", ""])[1].toLowerCase()])) { a = a.replace(kb, "<$1></$2>"); try { for (; h > g; g++)c = this[g] || {}, 1 === c.nodeType && (e.cleanData(u(c, !1)), c.innerHTML = a); c = 0 } catch (tc) { } } c && this.empty().append(a)
}, null, a, arguments.length)
}, replaceWith: function (a) { return e.isFunction(a) || "string" == typeof a || (a = e(a).not(this).detach()), this.domManip([a], !0, function (a) { var b = this.nextSibling, c = this.parentNode; c && (e(this).remove(), c.insertBefore(a, b)) }) }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a,
c, h) {
a = $a.apply([], a); var g, d, f, m = 0, l = this.length, k = this, t = l - 1, r = a[0], q = e.isFunction(r); if (q || !(1 >= l || "string" != typeof r || e.support.checkClone) && bc.test(r)) return this.each(function (g) { var e = k.eq(g); q && (a[0] = r.call(this, g, c ? e.html() : b)); e.domManip(a, c, h) }); if (l && (f = e.buildFragment(a, this[0].ownerDocument, !1, this), g = f.firstChild, 1 === f.childNodes.length && (f = g), g)) {
c = c && e.nodeName(g, "tr"); var v = e.map(u(f, "script"), F); for (d = v.length; l > m; m++)g = f, m !== t && (g = e.clone(g, !0, !0), d && e.merge(v, u(g, "script"))),
h.call(c && e.nodeName(this[m], "table") ? M(this[m], "tbody") : this[m], g, m); if (d) for (f = v[v.length - 1].ownerDocument, e.map(v, J), m = 0; d > m; m++)g = v[m], nb.test(g.type || "") && !e._data(g, "globalEval") && e.contains(f, g) && (g.src ? e.ajax({ url: g.src, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) : e.globalEval((g.text || g.textContent || g.innerHTML || "").replace(cc, ""))); f = g = null
} return this
}
}); e.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a,
b) { e.fn[a] = function (a) { for (var c = 0, g = [], h = e(a), d = h.length - 1; d >= c; c++)a = c === d ? this : this.clone(!0), e(h[c])[b](a), Ja.apply(g, a.get()); return this.pushStack(g) } }); e.extend({
clone: function (a, b, c) {
var g, h, d, f = e.contains(a.ownerDocument, a); if (e.support.html5Clone || e.isXMLDoc(a) || !jb.test("<" + a.nodeName + ">") ? h = a.cloneNode(!0) : (Qa.innerHTML = a.outerHTML, Qa.removeChild(h = Qa.firstChild)), !(e.support.noCloneEvent && e.support.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || e.isXMLDoc(a))) {
var m = u(h); var l = u(a);
for (d = 0; null != (g = l[d]); ++d)if (m[d]) {
var k = void 0, t, r = g, q = m[d]; if (1 === q.nodeType) {
if (t = q.nodeName.toLowerCase(), !e.support.noCloneEvent && q[e.expando]) { g = e._data(q); for (k in g.events) e.removeEvent(q, k, g.handle); q.removeAttribute(e.expando) } "script" === t && q.text !== r.text ? (F(q).text = r.text, J(q)) : "object" === t ? (q.parentNode && (q.outerHTML = r.outerHTML), e.support.html5Clone && r.innerHTML && !e.trim(q.innerHTML) && (q.innerHTML = r.innerHTML)) : "input" === t && Ga.test(r.type) ? (q.defaultChecked = q.checked = r.checked, q.value !==
r.value && (q.value = r.value)) : "option" === t ? q.defaultSelected = q.selected = r.defaultSelected : ("input" === t || "textarea" === t) && (q.defaultValue = r.defaultValue)
}
}
} if (b) if (c) for (l = l || u(a), m = m || u(h), d = 0; null != (g = l[d]); d++)I(g, m[d]); else I(a, h); return m = u(h, "script"), 0 < m.length && C(m, !f && u(a, "script")), h
}, buildFragment: function (a, b, c, h) {
for (var g, d, f, m, l, k, t, r = a.length, q = N(b), v = [], B = 0; r > B; B++)if (d = a[B], d || 0 === d) if ("object" === e.type(d)) e.merge(v, d.nodeType ? [d] : d); else if ($b.test(d)) {
m = m || q.appendChild(b.createElement("div"));
l = (lb.exec(d) || ["", ""])[1].toLowerCase(); t = V[l] || V._default; m.innerHTML = t[1] + d.replace(kb, "<$1></$2>") + t[2]; for (g = t[0]; g--;)m = m.lastChild; if (!e.support.leadingWhitespace && Pa.test(d) && v.push(b.createTextNode(Pa.exec(d)[0])), !e.support.tbody) for (g = (d = "table" !== l || mb.test(d) ? "<table>" !== t[1] || mb.test(d) ? 0 : m : m.firstChild) && d.childNodes.length; g--;)e.nodeName(k = d.childNodes[g], "tbody") && !k.childNodes.length && d.removeChild(k); e.merge(v, m.childNodes); for (m.textContent = ""; m.firstChild;)m.removeChild(m.firstChild);
m = q.lastChild
} else v.push(b.createTextNode(d)); m && q.removeChild(m); e.support.appendChecked || e.grep(u(v, "input"), E); for (B = 0; d = v[B++];)if ((!h || -1 === e.inArray(d, h)) && (f = e.contains(d.ownerDocument, d), m = u(q.appendChild(d), "script"), f && C(m), c)) for (g = 0; d = m[g++];)nb.test(d.type || "") && c.push(d); return q
}, cleanData: function (a, b) {
for (var c, g, h, d, f = 0, m = e.expando, l = e.cache, k = e.support.deleteExpando, t = e.event.special; null != (c = a[f]); f++)if ((b || e.acceptData(c)) && (h = c[m], d = h && l[h])) {
if (d.events) for (g in d.events) t[g] ?
e.event.remove(c, g) : e.removeEvent(c, g, d.handle); l[h] && (delete l[h], k ? delete c[m] : typeof c.removeAttribute !== P ? c.removeAttribute(m) : c[m] = null, qa.push(h))
}
}
}); var ra, fa, la, Ra = /alpha\([^)]*\)/i, dc = /opacity\s*=\s*([^)]*)/, ec = /^(top|right|bottom|left)$/, fc = /^(none|table(?!-c[ea]).+)/, ob = /^margin/, Bb = RegExp("^(" + Da + ")(.*)$", "i"), Ba = RegExp("^(" + Da + ")(?!px)[a-z%]+$", "i"), gc = RegExp("^([+-])=(" + Da + ")", "i"), Za = { BODY: "block" }, hc = { position: "absolute", visibility: "hidden", display: "block" }, pb = { letterSpacing: 0, fontWeight: 400 },
ea = ["Top", "Right", "Bottom", "Left"], Ya = ["Webkit", "O", "Moz", "ms"]; e.fn.extend({ css: function (a, c) { return e.access(this, function (a, c, g) { var h = {}, d = 0; if (e.isArray(c)) { var f = fa(a); for (g = c.length; g > d; d++)h[c[d]] = e.css(a, c[d], !1, f); return h } return g !== b ? e.style(a, c, g) : e.css(a, c) }, a, c, 1 < arguments.length) }, show: function () { return x(this, !0) }, hide: function () { return x(this) }, toggle: function (a) { var b = "boolean" == typeof a; return this.each(function () { (b ? a : k(this)) ? e(this).show() : e(this).hide() }) } }); e.extend({
cssHooks: {
opacity: {
get: function (a,
b) { if (b) return a = la(a, "opacity"), "" === a ? "1" : a }
}
}, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": e.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, h, d) {
if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
var g, f, m, l = e.camelCase(c), k = a.style; if (c = e.cssProps[l] || (e.cssProps[l] = G(k, l)), m = e.cssHooks[c] || e.cssHooks[l], h === b) return m && "get" in m && (g = m.get(a, !1, d)) !== b ? g : k[c]; if (f = typeof h, "string" === f && (g = gc.exec(h)) &&
(h = (g[1] + 1) * g[2] + parseFloat(e.css(a, c)), f = "number"), !(null == h || "number" === f && isNaN(h) || ("number" !== f || e.cssNumber[l] || (h += "px"), e.support.clearCloneStyle || "" !== h || 0 !== c.indexOf("background") || (k[c] = "inherit"), m && "set" in m && (h = m.set(a, h, d)) === b))) try { k[c] = h } catch (wc) { }
}
}, css: function (a, c, h, d) {
var g, f, m, l = e.camelCase(c); return c = e.cssProps[l] || (e.cssProps[l] = G(a.style, l)), m = e.cssHooks[c] || e.cssHooks[l], m && "get" in m && (f = m.get(a, !0, h)), f === b && (f = la(a, c, d)), "normal" === f && c in pb && (f = pb[c]), "" === h || h ? (g =
parseFloat(f), !0 === h || e.isNumeric(g) ? g || 0 : f) : f
}, swap: function (a, b, c, e) { var g, h = {}; for (g in b) h[g] = a.style[g], a.style[g] = b[g]; c = c.apply(a, e || []); for (g in b) a.style[g] = h[g]; return c }
}); a.getComputedStyle ? (fa = function (b) { return a.getComputedStyle(b, null) }, la = function (a, c, h) {
var g, d, f, m = (h = h || fa(a)) ? h.getPropertyValue(c) || h[c] : b, l = a.style; return h && ("" !== m || e.contains(a.ownerDocument, a) || (m = e.style(a, c)), Ba.test(m) && ob.test(c) && (g = l.width, d = l.minWidth, f = l.maxWidth, l.minWidth = l.maxWidth = l.width = m, m = h.width,
l.width = g, l.minWidth = d, l.maxWidth = f)), m
}) : z.documentElement.currentStyle && (fa = function (a) { return a.currentStyle }, la = function (a, c, h) { var g, e, d; h = (h = h || fa(a)) ? h[c] : b; var f = a.style; return null == h && f && f[c] && (h = f[c]), Ba.test(h) && !ec.test(c) && (g = f.left, e = a.runtimeStyle, d = e && e.left, d && (e.left = a.currentStyle.left), f.left = "fontSize" === c ? "1em" : h, h = f.pixelLeft + "px", f.left = g, d && (e.left = d)), "" === h ? "auto" : h }); e.each(["height", "width"], function (a, c) {
e.cssHooks[c] = {
get: function (a, g, h) {
return g ? 0 === a.offsetWidth &&
fc.test(e.css(a, "display")) ? e.swap(a, hc, function () { return K(a, c, h) }) : K(a, c, h) : b
}, set: function (a, b, g) { var h = g && fa(a); return Q(a, b, g ? y(a, c, g, e.support.boxSizing && "border-box" === e.css(a, "boxSizing", !1, h), h) : 0) }
}
}); e.support.opacity || (e.cssHooks.opacity = {
get: function (a, b) { return dc.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : "" }, set: function (a, b) {
var c = a.style; a = a.currentStyle; var g = e.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", h = a && a.filter || c.filter ||
""; c.zoom = 1; (1 <= b || "" === b) && "" === e.trim(h.replace(Ra, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || a && !a.filter) || (c.filter = Ra.test(h) ? h.replace(Ra, g) : h + " " + g)
}
}); e(function () {
e.support.reliableMarginRight || (e.cssHooks.marginRight = { get: function (a, c) { return c ? e.swap(a, { display: "inline-block" }, la, [a, "marginRight"]) : b } }); !e.support.pixelPosition && e.fn.position && e.each(["top", "left"], function (a, c) {
e.cssHooks[c] = {
get: function (a, g) {
return g ? (g = la(a, c), Ba.test(g) ? e(a).position()[c] + "px" :
g) : b
}
}
})
}); e.expr && e.expr.filters && (e.expr.filters.hidden = function (a) { return 0 >= a.offsetWidth && 0 >= a.offsetHeight || !e.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || e.css(a, "display")) }, e.expr.filters.visible = function (a) { return !e.expr.filters.hidden(a) }); e.each({ margin: "", padding: "", border: "Width" }, function (a, b) {
e.cssHooks[a + b] = { expand: function (c) { var g = 0, h = {}; for (c = "string" == typeof c ? c.split(" ") : [c]; 4 > g; g++)h[a + ea[g] + b] = c[g] || c[g - 2] || c[0]; return h } }; ob.test(a) || (e.cssHooks[a +
b].set = Q)
}); var ic = /%20/g, Cb = /\[\]$/, qb = /\r?\n/g, jc = /^(?:submit|button|image|reset|file)$/i, kc = /^(?:input|select|textarea|keygen)/i; e.fn.extend({
serialize: function () { return e.param(this.serializeArray()) }, serializeArray: function () {
return this.map(function () { var a = e.prop(this, "elements"); return a ? e.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !e(this).is(":disabled") && kc.test(this.nodeName) && !jc.test(a) && (this.checked || !Ga.test(a)) }).map(function (a, b) {
a = e(this).val(); return null ==
a ? null : e.isArray(a) ? e.map(a, function (a) { return { name: b.name, value: a.replace(qb, "\r\n") } }) : { name: b.name, value: a.replace(qb, "\r\n") }
}).get()
}
}); e.param = function (a, c) { var g, h = [], d = function (a, b) { b = e.isFunction(b) ? b() : null == b ? "" : b; h[h.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (c === b && (c = e.ajaxSettings && e.ajaxSettings.traditional), e.isArray(a) || a.jquery && !e.isPlainObject(a)) e.each(a, function () { d(this.name, this.value) }); else for (g in a) ia(g, a[g], c, d); return h.join("&").replace(ic, "+") }; e.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),
function (a, b) { e.fn[b] = function (a, c) { return 0 < arguments.length ? this.on(b, null, a, c) : this.trigger(b) } }); e.fn.hover = function (a, b) { return this.mouseenter(a).mouseleave(b || a) }; var Sa = e.now(), Ta = /\?/, lc = /#.*$/, rb = /([?&])_=[^&]*/, mc = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, nc = /^(?:GET|HEAD)$/, oc = /^\/\//, sb = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, tb = e.fn.load, ub = {}, Ha = {}, vb = "*/".concat("*"); try { var pa = wa.href } catch (g) { pa = z.createElement("a"), pa.href = "", pa = pa.href } var ca = sb.exec(pa.toLowerCase()) || []; e.fn.load =
function (a, c, h) { if ("string" != typeof a && tb) return tb.apply(this, arguments); var g, d, f, m = this, l = a.indexOf(" "); return 0 <= l && (g = a.slice(l, a.length), a = a.slice(0, l)), e.isFunction(c) ? (h = c, c = b) : c && "object" == typeof c && (f = "POST"), 0 < m.length && e.ajax({ url: a, type: f, dataType: "html", data: c }).done(function (a) { d = arguments; m.html(g ? e("<div>").append(e.parseHTML(a)).find(g) : a) }).complete(h && function (a, b) { m.each(h, d || [a.responseText, b, a]) }), this }; e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function (a, b) { e.fn[b] = function (a) { return this.on(b, a) } }); e.each(["get", "post"], function (a, c) { e[c] = function (a, g, h, d) { return e.isFunction(g) && (d = d || h, h = g, g = b), e.ajax({ url: a, type: c, dataType: d, data: g, success: h }) } }); e.extend({
active: 0, lastModified: {}, etag: {}, ajaxSettings: {
url: pa, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ca[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: {
"*": vb, text: "text/plain", html: "text/html",
xml: "application/xml, text/xml", json: "application/json, text/javascript"
}, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": e.parseJSON, "text xml": e.parseXML }, flatOptions: { url: !0, context: !0 }
}, ajaxSetup: function (a, b) { return b ? Y(Y(a, e.ajaxSettings), b) : Y(e.ajaxSettings, a) }, ajaxPrefilter: T(ub), ajaxTransport: T(Ha), ajax: function (a, c) {
function g(a, c, g, h) {
var d, t, v = c; if (2 !== G) {
G = 2; m && clearTimeout(m);
k = b; f = h || ""; p.readyState = 0 < a ? 4 : 0; if (g) { var w = r; h = p; var Q, U, O, y = w.contents, z = w.dataTypes, P = w.responseFields; for (O in P) O in g && (h[P[O]] = g[O]); for (; "*" === z[0];)z.shift(), U === b && (U = w.mimeType || h.getResponseHeader("Content-Type")); if (U) for (O in y) if (y[O] && y[O].test(U)) { z.unshift(O); break } if (z[0] in g) var R = z[0]; else { for (O in g) { if (!z[0] || w.converters[O + " " + z[0]]) { R = O; break } Q || (Q = O) } R = R || Q } w = R ? (R !== z[0] && z.unshift(R), g[R]) : b } if (200 <= a && 300 > a || 304 === a) if (r.ifModified && (t = p.getResponseHeader("Last-Modified"),
t && (e.lastModified[E] = t), t = p.getResponseHeader("etag"), t && (e.etag[E] = t)), 204 === a) { var u = !0; v = "nocontent" } else if (304 === a) u = !0, v = "notmodified"; else {
a: {
g = r; u = w; var K, C; var F = {}; t = 0; v = g.dataTypes.slice(); Q = v[0]; if (g.dataFilter && (u = g.dataFilter(u, g.dataType)), v[1]) for (K in g.converters) F[K.toLowerCase()] = g.converters[K]; for (; d = v[++t];)if ("*" !== d) {
if ("*" !== Q && Q !== d) {
if (K = F[Q + " " + d] || F["* " + d], !K) for (J in F) if (C = J.split(" "), C[1] === d && (K = F[Q + " " + C[0]] || F["* " + C[0]])) {
!0 === K ? K = F[J] : !0 !== F[J] && (d = C[0], v.splice(t--,
0, d)); break
} if (!0 !== K) if (K && g["throws"]) u = K(u); else try { u = K(u) } catch (Vb) { var J = { state: "parsererror", error: K ? Vb : "No conversion from " + Q + " to " + d }; break a }
} Q = d
} J = { state: "success", data: u }
} u = J; v = u.state; d = u.data; F = u.error; u = !F
} else F = v, (a || !v) && (v = "error", 0 > a && (a = 0)); p.status = a; p.statusText = (c || v) + ""; u ? x.resolveWith(q, [d, v, p]) : x.rejectWith(q, [p, v, F]); p.statusCode(n); n = b; l && B.trigger(u ? "ajaxSuccess" : "ajaxError", [p, r, u ? d : F]); X.fireWith(q, [p, v]); l && (B.trigger("ajaxComplete", [p, r]), --e.active || e.event.trigger("ajaxStop"))
}
}
"object" == typeof a && (c = a, a = b); c = c || {}; var h, d, f, m, l, k, t, r = e.ajaxSetup({}, c), q = r.context || r, B = r.context && (q.nodeType || q.jquery) ? e(q) : e.event, x = e.Deferred(), X = e.Callbacks("once memory"), n = r.statusCode || {}, Q = {}, U = {}, G = 0, O = "canceled", p = {
readyState: 0, getResponseHeader: function (a) { var b; if (2 === G) { if (!t) for (t = {}; b = mc.exec(f);)t[b[1].toLowerCase()] = b[2]; b = t[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === G ? f : null }, setRequestHeader: function (a, b) {
var c = a.toLowerCase(); return G ||
(a = U[c] = U[c] || a, Q[a] = b), this
}, overrideMimeType: function (a) { return G || (r.mimeType = a), this }, statusCode: function (a) { var b; if (a) if (2 > G) for (b in a) n[b] = [n[b], a[b]]; else p.always(a[p.status]); return this }, abort: function (a) { a = a || O; return k && k.abort(a), g(0, a), this }
}; if (x.promise(p).complete = X.add, p.success = p.done, p.error = p.fail, r.url = ((a || r.url || pa) + "").replace(lc, "").replace(oc, ca[1] + "//"), r.type = c.method || c.type || r.method || r.type, r.dataTypes = e.trim(r.dataType || "*").toLowerCase().match(da) || [""], null == r.crossDomain &&
(h = sb.exec(r.url.toLowerCase()), r.crossDomain = !(!h || h[1] === ca[1] && h[2] === ca[2] && (h[3] || ("http:" === h[1] ? 80 : 443)) == (ca[3] || ("http:" === ca[1] ? 80 : 443)))), r.data && r.processData && "string" != typeof r.data && (r.data = e.param(r.data, r.traditional)), ja(ub, r, c, p), 2 === G) return p; (l = r.global) && 0 === e.active++ && e.event.trigger("ajaxStart"); r.type = r.type.toUpperCase(); r.hasContent = !nc.test(r.type); var E = r.url; r.hasContent || (r.data && (E = r.url += (Ta.test(E) ? "&" : "?") + r.data, delete r.data), !1 === r.cache && (r.url = rb.test(E) ?
E.replace(rb, "$1_=" + Sa++) : E + (Ta.test(E) ? "&" : "?") + "_=" + Sa++)); r.ifModified && (e.lastModified[E] && p.setRequestHeader("If-Modified-Since", e.lastModified[E]), e.etag[E] && p.setRequestHeader("If-None-Match", e.etag[E])); (r.data && r.hasContent && !1 !== r.contentType || c.contentType) && p.setRequestHeader("Content-Type", r.contentType); p.setRequestHeader("Accept", r.dataTypes[0] && r.accepts[r.dataTypes[0]] ? r.accepts[r.dataTypes[0]] + ("*" !== r.dataTypes[0] ? ", " + vb + "; q=0.01" : "") : r.accepts["*"]); for (d in r.headers) p.setRequestHeader(d,
r.headers[d]); if (r.beforeSend && (!1 === r.beforeSend.call(q, p, r) || 2 === G)) return p.abort(); O = "abort"; for (d in { success: 1, error: 1, complete: 1 }) p[d](r[d]); if (k = ja(Ha, r, c, p)) { p.readyState = 1; l && B.trigger("ajaxSend", [p, r]); r.async && 0 < r.timeout && (m = setTimeout(function () { p.abort("timeout") }, r.timeout)); try { G = 1, k.send(Q, g) } catch (hb) { if (!(2 > G)) throw hb; g(-1, hb) } } else g(-1, "No Transport"); return p
}, getScript: function (a, c) { return e.get(a, b, c, "script") }, getJSON: function (a, b, c) { return e.get(a, b, c, "json") }
}); e.ajaxSetup({
accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" },
contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function (a) { return e.globalEval(a), a } }
}); e.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1); a.crossDomain && (a.type = "GET", a.global = !1) }); e.ajaxTransport("script", function (a) {
if (a.crossDomain) {
var c, g = z.head || e("head")[0] || z.documentElement; return {
send: function (b, h) {
c = z.createElement("script"); c.async = !0; a.scriptCharset && (c.charset = a.scriptCharset); c.src = a.url; c.onload = c.onreadystatechange = function (a, b) {
(b || !c.readyState ||
/loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, c.parentNode && c.parentNode.removeChild(c), c = null, b || h(200, "success"))
}; g.insertBefore(c, g.firstChild)
}, abort: function () { c && c.onload(b, !0) }
}
}
}); var wb = [], Ua = /(=)\?(?=&|$)|\?\?/; e.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = wb.pop() || e.expando + "_" + Sa++; return this[a] = !0, a } }); e.ajaxPrefilter("json jsonp", function (c, h, d) {
var g, f, m, k = !1 !== c.jsonp && (Ua.test(c.url) ? "url" : "string" == typeof c.data && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") &&
Ua.test(c.data) && "data"); return k || "jsonp" === c.dataTypes[0] ? (g = c.jsonpCallback = e.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, k ? c[k] = c[k].replace(Ua, "$1" + g) : !1 !== c.jsonp && (c.url += (Ta.test(c.url) ? "&" : "?") + c.jsonp + "=" + g), c.converters["script json"] = function () { return m || e.error(g + " was not called"), m[0] }, c.dataTypes[0] = "json", f = a[g], a[g] = function () { m = arguments }, d.always(function () { a[g] = f; c[g] && (c.jsonpCallback = h.jsonpCallback, wb.push(g)); m && e.isFunction(f) && f(m[0]); m = f = b }), "script") :
b
}); var ka, pc = 0, Va = a.ActiveXObject && function () { for (var a in ka) ka[a](b, !0) }; e.ajaxSettings.xhr = a.ActiveXObject ? function () { var b; if (!(b = !this.isLocal && m())) a: { try { b = new a.ActiveXObject("Microsoft.XMLHTTP"); break a } catch (l) { } b = void 0 } return b } : m; var Ea = e.ajaxSettings.xhr(); e.support.cors = !!Ea && "withCredentials" in Ea; (Ea = e.support.ajax = !!Ea) && e.ajaxTransport(function (c) {
if (!c.crossDomain || e.support.cors) {
var h; return {
send: function (g, d) {
var f, m, k = c.xhr(); if (c.username ? k.open(c.type, c.url, c.async, c.username,
c.password) : k.open(c.type, c.url, c.async), c.xhrFields) for (m in c.xhrFields) k[m] = c.xhrFields[m]; c.mimeType && k.overrideMimeType && k.overrideMimeType(c.mimeType); c.crossDomain || g["X-Requested-With"] || (g["X-Requested-With"] = "XMLHttpRequest"); try { for (m in g) k.setRequestHeader(m, g[m]) } catch (uc) { } k.send(c.hasContent && c.data || null); h = function (a, g) {
try {
if (h && (g || 4 === k.readyState)) if (h = b, f && (k.onreadystatechange = e.noop, Va && delete ka[f]), g) 4 !== k.readyState && k.abort(); else {
var m = {}; var l = k.status; var t = k.getAllResponseHeaders();
"string" == typeof k.responseText && (m.text = k.responseText); try { var r = k.statusText } catch (db) { r = "" } l || !c.isLocal || c.crossDomain ? 1223 === l && (l = 204) : l = m.text ? 200 : 404
}
} catch (db) { g || d(-1, db) } m && d(l, r, m, t)
}; c.async ? 4 === k.readyState ? setTimeout(h) : (f = ++pc, Va && (ka || (ka = {}, e(a).unload(Va)), ka[f] = h), k.onreadystatechange = h) : h()
}, abort: function () { h && h(b, !0) }
}
}
}); var sa, Fa, qc = /^(?:toggle|show|hide)$/, rc = RegExp("^(?:([+-])=|)(" + Da + ")([a-z%]*)$", "i"), sc = /queueHooks$/, Ca = [function (a, b, c) {
var h, g, d, f, m, l = this, t = a.style,
r = {}, q = [], B = a.nodeType && k(a); c.queue || (f = e._queueHooks(a, "fx"), null == f.unqueued && (f.unqueued = 0, m = f.empty.fire, f.empty.fire = function () { f.unqueued || m() }), f.unqueued++, l.always(function () { l.always(function () { f.unqueued--; e.queue(a, "fx").length || f.empty.fire() }) })); 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [t.overflow, t.overflowX, t.overflowY], "inline" === e.css(a, "display") && "none" === e.css(a, "float") && (e.support.inlineBlockNeedsLayout && "inline" !== W(a.nodeName) ? t.zoom = 1 : t.display = "inline-block"));
c.overflow && (t.overflow = "hidden", e.support.shrinkWrapBlocks || l.always(function () { t.overflow = c.overflow[0]; t.overflowX = c.overflow[1]; t.overflowY = c.overflow[2] })); for (g in b) (d = b[g], qc.exec(d)) && (delete b[g], h = h || "toggle" === d, d !== (B ? "hide" : "show")) && q.push(g); if (b = q.length) for (d = e._data(a, "fxshow") || e._data(a, "fxshow", {}), ("hidden" in d) && (B = d.hidden), h && (d.hidden = !B), B ? e(a).show() : l.done(function () { e(a).hide() }), l.done(function () { var b; e._removeData(a, "fxshow"); for (b in r) e.style(a, b, r[b]) }), g = 0; b >
g; g++) { h = q[g]; var x = l.createTween(h, B ? d[h] : 0); r[h] = d[h] || e.style(a, h); h in d || (d[h] = x.start, B && (x.end = x.start, x.start = "width" === h || "height" === h ? 1 : 0)) }
}], ya = { "*": [function (a, b) { var c, h = this.createTween(a, b), g = rc.exec(b), d = h.cur(), f = +d || 0, m = 1, k = 20; if (g) { if (b = +g[2], c = g[3] || (e.cssNumber[a] ? "" : "px"), "px" !== c && f) { f = e.css(h.elem, a, !0) || b || 1; do m = m || ".5", f /= m, e.style(h.elem, a, f + c); while (m !== (m = h.cur() / d) && 1 !== m && --k) } h.unit = c; h.start = f; h.end = g[1] ? f + (g[1] + 1) * b : b } return h }] }; e.Animation = e.extend(O, {
tweener: function (a,
b) { e.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, h = 0, g = a.length; g > h; h++)c = a[h], ya[c] = ya[c] || [], ya[c].unshift(b) }, prefilter: function (a, b) { b ? Ca.unshift(a) : Ca.push(a) }
}); e.Tween = t; t.prototype = {
constructor: t, init: function (a, b, c, h, d, f) { this.elem = a; this.prop = c; this.easing = d || "swing"; this.options = b; this.start = this.now = this.cur(); this.end = h; this.unit = f || (e.cssNumber[c] ? "" : "px") }, cur: function () { var a = t.propHooks[this.prop]; return a && a.get ? a.get(this) : t.propHooks._default.get(this) }, run: function (a) {
var b,
c = t.propHooks[this.prop]; return this.pos = b = this.options.duration ? e.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : t.propHooks._default.set(this), this
}
}; t.prototype.init.prototype = t.prototype; t.propHooks = {
_default: {
get: function (a) {
var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = e.css(a.elem, a.prop, ""), b && "auto" !==
b ? b : 0) : a.elem[a.prop]
}, set: function (a) { e.fx.step[a.prop] ? e.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[e.cssProps[a.prop]] || e.cssHooks[a.prop]) ? e.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now }
}
}; t.propHooks.scrollTop = t.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }; e.each(["toggle", "show", "hide"], function (a, b) {
var c = e.fn[b]; e.fn[b] = function (a, h, e) {
return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(B(b, !0),
a, h, e)
}
}); e.fn.extend({
fadeTo: function (a, b, c, h) { return this.filter(k).css("opacity", 0).show().end().animate({ opacity: b }, a, c, h) }, animate: function (a, b, c, h) { var g = e.isEmptyObject(a), d = e.speed(b, c, h), f = function () { var b = O(this, e.extend({}, a), d); f.finish = function () { b.stop(!0) }; (g || e._data(this, "finish")) && b.stop(!0) }; return f.finish = f, g || !1 === d.queue ? this.each(f) : this.queue(d.queue, f) }, stop: function (a, c, h) {
var d = function (a) { var b = a.stop; delete a.stop; b(h) }; return "string" != typeof a && (h = c, c = a, a = b), c && !1 !==
a && this.queue(a || "fx", []), this.each(function () { var b = !0, c = null != a && a + "queueHooks", g = e.timers, f = e._data(this); if (c) f[c] && f[c].stop && d(f[c]); else for (c in f) f[c] && f[c].stop && sc.test(c) && d(f[c]); for (c = g.length; c--;)g[c].elem !== this || null != a && g[c].queue !== a || (g[c].anim.stop(h), b = !1, g.splice(c, 1)); !b && h || e.dequeue(this, a) })
}, finish: function (a) {
return !1 !== a && (a = a || "fx"), this.each(function () {
var b = e._data(this), c = b[a + "queue"]; var h = b[a + "queueHooks"]; var d = e.timers, g = c ? c.length : 0; b.finish = !0; e.queue(this,
a, []); h && h.cur && h.cur.finish && h.cur.finish.call(this); for (h = d.length; h--;)d[h].elem === this && d[h].queue === a && (d[h].anim.stop(!0), d.splice(h, 1)); for (h = 0; g > h; h++)c[h] && c[h].finish && c[h].finish.call(this); delete b.finish
})
}
}); e.each({ slideDown: B("show"), slideUp: B("hide"), slideToggle: B("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { e.fn[a] = function (a, c, h) { return this.animate(b, a, c, h) } }); e.speed = function (a, b, c) {
var h = a && "object" == typeof a ? e.extend({},
a) : { complete: c || !c && b || e.isFunction(a) && a, duration: a, easing: c && b || b && !e.isFunction(b) && b }; return h.duration = e.fx.off ? 0 : "number" == typeof h.duration ? h.duration : h.duration in e.fx.speeds ? e.fx.speeds[h.duration] : e.fx.speeds._default, (null == h.queue || !0 === h.queue) && (h.queue = "fx"), h.old = h.complete, h.complete = function () { e.isFunction(h.old) && h.old.call(this); h.queue && e.dequeue(this, h.queue) }, h
}; e.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }; e.timers = []; e.fx = t.prototype.init;
e.fx.tick = function () { var a = e.timers, c = 0; for (sa = e.now(); a.length > c; c++) { var h = a[c]; h() || a[c] !== h || a.splice(c--, 1) } a.length || e.fx.stop(); sa = b }; e.fx.timer = function (a) { a() && e.timers.push(a) && e.fx.start() }; e.fx.interval = 13; e.fx.start = function () { Fa || (Fa = setInterval(e.fx.tick, e.fx.interval)) }; e.fx.stop = function () { clearInterval(Fa); Fa = null }; e.fx.speeds = { slow: 600, fast: 200, _default: 400 }; e.fx.step = {}; e.expr && e.expr.filters && (e.expr.filters.animated = function (a) { return e.grep(e.timers, function (b) { return a === b.elem }).length });
e.fn.offset = function (a) { if (arguments.length) return a === b ? this : this.each(function (b) { e.offset.setOffset(this, a, b) }); var c, h, d = { top: 0, left: 0 }, g = this[0], f = g && g.ownerDocument; if (f) return c = f.documentElement, e.contains(c, g) ? (typeof g.getBoundingClientRect !== P && (d = g.getBoundingClientRect()), h = U(f), { top: d.top + (h.pageYOffset || c.scrollTop) - (c.clientTop || 0), left: d.left + (h.pageXOffset || c.scrollLeft) - (c.clientLeft || 0) }) : d }; e.offset = {
setOffset: function (a, b, c) {
var h = e.css(a, "position"); "static" === h && (a.style.position =
"relative"); var d = e(a), g = d.offset(), f = e.css(a, "top"), m = e.css(a, "left"), k = {}, t = {}, r, l; ("absolute" === h || "fixed" === h) && -1 < e.inArray("auto", [f, m]) ? (t = d.position(), r = t.top, l = t.left) : (r = parseFloat(f) || 0, l = parseFloat(m) || 0); e.isFunction(b) && (b = b.call(a, c, g)); null != b.top && (k.top = b.top - g.top + r); null != b.left && (k.left = b.left - g.left + l); "using" in b ? b.using.call(a, k) : d.css(k)
}
}; e.fn.extend({
position: function () {
if (this[0]) {
var a, b, c = { top: 0, left: 0 }, h = this[0]; return "fixed" === e.css(h, "position") ? b = h.getBoundingClientRect() :
(a = this.offsetParent(), b = this.offset(), e.nodeName(a[0], "html") || (c = a.offset()), c.top += e.css(a[0], "borderTopWidth", !0), c.left += e.css(a[0], "borderLeftWidth", !0)), { top: b.top - c.top - e.css(h, "marginTop", !0), left: b.left - c.left - e.css(h, "marginLeft", !0) }
}
}, offsetParent: function () { return this.map(function () { for (var a = this.offsetParent || z.documentElement; a && !e.nodeName(a, "html") && "static" === e.css(a, "position");)a = a.offsetParent; return a || z.documentElement }) }
}); e.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" },
function (a, c) { var h = /Y/.test(c); e.fn[a] = function (d) { return e.access(this, function (a, d, g) { var f = U(a); return g === b ? f ? c in f ? f[c] : f.document.documentElement[d] : a[d] : (f ? f.scrollTo(h ? e(f).scrollLeft() : g, h ? g : e(f).scrollTop()) : a[d] = g, b) }, a, d, arguments.length, null) } }); e.each({ Height: "height", Width: "width" }, function (a, c) {
e.each({ padding: "inner" + a, content: c, "": "outer" + a }, function (h, d) {
e.fn[d] = function (d, g) {
var f = arguments.length && (h || "boolean" != typeof d), m = h || (!0 === d || !0 === g ? "margin" : "border"); return e.access(this,
function (c, h, d) { var g; return e.isWindow(c) ? c.document.documentElement["client" + a] : 9 === c.nodeType ? (g = c.documentElement, Math.max(c.body["scroll" + a], g["scroll" + a], c.body["offset" + a], g["offset" + a], g["client" + a])) : d === b ? e.css(c, h, m) : e.style(c, h, d, m) }, c, f ? d : b, f, null)
}
})
}); a.jQuery = a.$ = e; "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () { return e })
})(window);/*
jQuery Templates Plugin 1.0.0pre
http://github.com/jquery/jquery-tmpl
Requires jQuery 1.4.2
Copyright 2011, Software Freedom Conservancy, Inc.
Licensed under the MIT license.
http://jquery.org/license
*/
(function (a) {
function b(b, c, d, f) { f = { data: f || 0 === f || !1 === f ? f : c ? c.data : {}, _wrap: c ? c._wrap : null, tmpl: null, parent: c || null, nodes: [], calls: A, nest: H, wrap: D, html: S, update: N }; b && a.extend(f, b, { nodes: [], parent: c }); d && (f.tmpl = d, f._ctnt = f._ctnt || f.tmpl(a, f), f.key = ++E, (k.length ? C : J)[E] = f); return f } function c(b, f, k) {
var q; k = k ? a.map(k, function (a) { return "string" === typeof a ? b.key ? a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, '$1 _tmplitem="' + b.key + '" $2') : a : c(a, b, a._ctnt) }) : b; if (f) return k; k = k.join(""); k.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
function (b, c, f, k) { q = a(f).get(); n(q); c && (q = d(c).concat(q)); k && (q = q.concat(d(k))) }); return q ? q : d(k)
} function d(b) { var c = document.createElement("div"); c.innerHTML = b; return a.makeArray(c.childNodes) } function f(b) {
return new Function("jQuery", "$item", "var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('" + a.trim(b).replace(/([\\'])/g, "\\$1").replace(/[\r\t\n]/g, " ").replace(/\$\{([^\}]*)\}/g, "{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function (b, c, d, f, k, q, x) { b = a.tmpl.tag[d]; if (!b) throw "Unknown template tag: " + d; d = b._default || []; q && !/\w$/.test(k) && (k += q, q = ""); k ? (k = p(k), x = x ? "," + p(x) + ")" : q ? ")" : "", x = q ? -1 < k.indexOf(".") ? k + p(q) : "(" + k + ").call($item" + x : k, q = q ? x : "(typeof(" + k + ")==='function'?(" + k + ").call($item):(" + k + "))") : q = x = d.$1 || "null"; f = p(f); return "');" + b[c ? "close" : "open"].split("$notnull_1").join(k ? "typeof(" + k + ")!=='undefined' && (" + k + ")!=null" : "true").split("$1a").join(q).split("$1").join(x).split("$2").join(f || d.$2 || "") + "__.push('" }) +
"');}return __;")
} function q(b, d) { b._wrap = c(b, !0, a.isArray(d) ? d : [F.test(d) ? d : a(d).html()]).join("") } function p(a) { return a ? a.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null } function n(c) {
function d(c) {
function d(a) { a += f; n = q[a] = q[a] || b(n, J[n.parent.key + f] || n.parent) } var k, x = c, n, h; if (h = c.getAttribute("_tmplitem")) {
for (; x.parentNode && 1 === (x = x.parentNode).nodeType && !(k = x.getAttribute("_tmplitem"));); k !== h && (x = x.parentNode ? 11 === x.nodeType ? 0 : x.getAttribute("_tmplitem") || 0 : 0, (n = J[h]) || (n = C[h], n = b(n, J[x] ||
C[x]), n.key = ++E, J[E] = n), G && d(h)); c.removeAttribute("_tmplitem")
} else G && (n = a.data(c, "tmplItem")) && (d(n.key), J[n.key] = n, x = (x = a.data(c.parentNode, "tmplItem")) ? x.key : 0); if (n) { for (k = n; k && k.key != x;)k.nodes.push(c), k = k.parent; delete n._ctnt; delete n._wrap; a.data(c, "tmplItem", n) }
} var f = "_" + G, k, q = {}, x, n; var p = 0; for (x = c.length; p < x; p++)if (1 === (k = c[p]).nodeType) { var u = k.getElementsByTagName("*"); for (n = u.length - 1; 0 <= n; n--)d(u[n]); d(k) }
} function A(a, b, c, d) {
if (!a) return k.pop(); k.push({
_: a, tmpl: b, item: this, data: c,
options: d
})
} function H(b, c, d) { return a.tmpl(a.template(b), c, d, this) } function D(b, c) { var d = b.options || {}; d.wrapped = c; return a.tmpl(a.template(b.tmpl), b.data, d, b.item) } function S(b, c) { var d = this._wrap; return a.map(a(a.isArray(d) ? d.join("") : d).filter(b || "*"), function (a) { if (c) a = a.innerText || a.textContent; else { var b; (b = a.outerHTML) || (b = document.createElement("div"), b.appendChild(a.cloneNode(!0)), b = b.innerHTML); a = b } return a }) } function N() {
var b = this.nodes; a.tmpl(null, null, null, this).insertBefore(b[0]);
a(b).remove()
} var M = a.fn.domManip, F = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{! /, J = {}, C = {}, I, u = { key: 0, data: {} }, E = 0, G = 0, k = []; a.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (b, c) {
a.fn[b] = function (d) {
var f = []; d = a(d); var k; var q = 1 === this.length && this[0].parentNode; I = J || {}; if (q && 11 === q.nodeType && 1 === q.childNodes.length && 1 === d.length) d[c](this[0]), f = this; else {
var x = 0; for (k = d.length; x < k; x++)G = x, q = (0 < x ? this.clone(!0) : this).get(), a(d[x])[c](q),
f = f.concat(q); G = 0; f = this.pushStack(f, b, d.selector)
} d = I; I = null; a.tmpl.complete(d); return f
}
}); a.fn.extend({
tmpl: function (b, c, d) { return a.tmpl(this[0], b, c, d) }, tmplItem: function () { return a.tmplItem(this[0]) }, template: function (b) { return a.template(b, this[0]) }, domManip: function (b, c, d) {
if (b[0] && a.isArray(b[0])) { for (var f = a.makeArray(arguments), k = b[0], q = k.length, x = 0, n; x < q && !(n = a.data(k[x++], "tmplItem"));); n && G && (f[2] = function (b) { a.tmpl.afterManip(this, b, d) }); M.apply(this, f) } else M.apply(this, arguments);
G = 0; !I && a.tmpl.complete(J); return this
}
}); a.extend({
tmpl: function (d, f, k, n) { var x = !n; if (x) n = u, d = a.template[d] || a.template(null, d), C = {}; else if (!d) return d = n.tmpl, J[n.key] = n, n.nodes = [], n.wrapped && q(n, n.wrapped), a(c(n, null, n.tmpl(a, n))); if (!d) return []; "function" === typeof f && (f = f.call(n || {})); k && k.wrapped && q(k, k.wrapped); f = a.isArray(f) ? a.map(f, function (a) { return a ? b(k, n, d, a) : null }) : [b(k, n, d, f)]; return x ? a(c(n, null, f)) : f }, tmplItem: function (b) {
var c; for (b instanceof a && (b = b[0]); b && 1 === b.nodeType && !(c = a.data(b,
"tmplItem")) && (b = b.parentNode);); return c || u
}, template: function (b, c) { return c ? ("string" === typeof c ? c = f(c) : c instanceof a && (c = c[0] || {}), c.nodeType && (c = a.data(c, "tmpl") || a.data(c, "tmpl", f(c.innerHTML))), "string" === typeof b ? a.template[b] = c : c) : b ? "string" !== typeof b ? a.template(null, b) : a.template[b] || a.template(null, F.test(b) ? b : a(b)) : null }, encode: function (a) { return ("" + a).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;") }
}); a.extend(a.tmpl, {
tag: {
tmpl: {
_default: { $2: "null" },
open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
}, wrap: { _default: { $2: "null" }, open: "$item.calls(__,$1,$2);__=[];", close: "call=$item.calls();__=call._.concat($item.wrap(call,__));" }, each: { _default: { $2: "$index, $value" }, open: "if($notnull_1){$.each($1a,function($2){with(this){", close: "}});}" }, "if": { open: "if(($notnull_1) && $1a){", close: "}" }, "else": { _default: { $1: "true" }, open: "}else if(($notnull_1) && $1a){" }, html: { open: "if($notnull_1){__.push($1a);}" }, "=": { _default: { $1: "$data" }, open: "if($notnull_1){__.push($.encode($1a));}" },
"!": { open: "" }
}, complete: function () { J = {} }, afterManip: function (b, c, d) { var f = 11 === c.nodeType ? a.makeArray(c.childNodes) : 1 === c.nodeType ? [c] : []; d.call(b, c); n(f); G++ }
})
})(jQuery); (function (a, b) {
function c(a, b) {
a = decodeURI(a); b = n[b ? "strict" : "loose"].exec(a); var c = { attr: {}, param: {}, seg: {} }; for (a = 14; a--;)c.attr[q[a]] = b[a] || ""; c.param.query = {}; c.param.fragment = {}; c.attr.query.replace(A, function (a, b, d) { b && (c.param.query[b] = d) }); c.attr.fragment.replace(H, function (a, b, d) { b && (c.param.fragment[b] = d) }); c.seg.path = c.attr.path.replace(/^\/+|\/+$/g, "").split("/"); c.seg.fragment = c.attr.fragment.replace(/^\/+|\/+$/g, "").split("/"); c.attr.base = c.attr.host ? c.attr.protocol + "://" + c.attr.host +
(c.attr.port ? ":" + c.attr.port : "") : ""; return c
} function d(a) { a = a.tagName; return a !== b ? f[a.toLowerCase()] : a } var f = { a: "href", img: "src", form: "action", base: "href", script: "src", iframe: "src", link: "href" }, q = "source protocol authority userInfo user password host port relative path directory file query fragment".split(" "), p = { anchor: "fragment" }, n = { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ },
A = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, H = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; a.fn.url = function (b) { var c = ""; this.length && (c = a(this).attr(d(this[0])) || ""); return a.url({ url: c, strict: b }) }; a.url = function (a) {
var d = "", f = !1; "string" === typeof a ? d = a : (a = a || {}, f = a.strict || f, d = a.url === b ? window.location.toString() : a.url); return {
data: c(d, f), attr: function (a) { a = p[a] || a; return a !== b ? this.data.attr[a] : this.data.attr }, param: function (a) { return a !== b ? this.data.param.query[a] : this.data.param.query }, fparam: function (a) {
return a !==
b ? this.data.param.fragment[a] : this.data.param.fragment
}, segment: function (a) { if (a === b) return this.data.seg.path; a = 0 > a ? this.data.seg.path.length + a : a - 1; return this.data.seg.path[a] }, fsegment: function (a) { if (a === b) return this.data.seg.fragment; a = 0 > a ? this.data.seg.fragment.length + a : a - 1; return this.data.seg.fragment[a] }
}
}
})(jQuery); !function () {
var a = this, b = a._, c = {}, d = Array.prototype, f = Object.prototype, q = d.push, p = d.slice, n = d.concat, A = f.toString, H = f.hasOwnProperty, D = d.forEach, S = d.map, N = d.reduce, M = d.reduceRight, F = d.filter, J = d.every, C = d.some, I = d.indexOf, u = d.lastIndexOf; f = Array.isArray; var E = Object.keys, G = Function.prototype.bind, k = function (a) { return a instanceof k ? a : this instanceof k ? (this._wrapped = a, void 0) : new k(a) }; "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = k), exports._ = k) :
a._ = k; k.VERSION = "1.5.1"; var x = k.each = k.forEach = function (a, b, d) { if (null != a) if (D && a.forEach === D) a.forEach(b, d); else if (a.length === +a.length) for (var h = 0, f = a.length; f > h && b.call(d, a[h], h, a) !== c; h++); else for (h in a) if (k.has(a, h) && b.call(d, a[h], h, a) === c) break }; k.map = k.collect = function (a, b, c) { var h = []; return null == a ? h : S && a.map === S ? a.map(b, c) : (x(a, function (a, d, f) { h.push(b.call(c, a, d, f)) }), h) }; k.reduce = k.foldl = k.inject = function (a, b, c, d) {
var h = 2 < arguments.length; if (null == a && (a = []), N && a.reduce === N) return d &&
(b = k.bind(b, d)), h ? a.reduce(b, c) : a.reduce(b); if (x(a, function (a, f, m) { h ? c = b.call(d, c, a, f, m) : (c = a, h = !0) }), !h) throw new TypeError("Reduce of empty array with no initial value"); return c
}; k.reduceRight = k.foldr = function (a, b, c, d) {
var h = 2 < arguments.length; if (null == a && (a = []), M && a.reduceRight === M) return d && (b = k.bind(b, d)), h ? a.reduceRight(b, c) : a.reduceRight(b); var f = a.length; if (f !== +f) { var m = k.keys(a); f = m.length } if (x(a, function (k, t, r) { t = m ? m[--f] : --f; h ? c = b.call(d, c, a[t], t, r) : (c = a[t], h = !0) }), !h) throw new TypeError("Reduce of empty array with no initial value");
return c
}; k.find = k.detect = function (a, b, c) { var h; return Q(a, function (a, d, f) { return b.call(c, a, d, f) ? (h = a, !0) : void 0 }), h }; k.filter = k.select = function (a, b, c) { var h = []; return null == a ? h : F && a.filter === F ? a.filter(b, c) : (x(a, function (a, d, f) { b.call(c, a, d, f) && h.push(a) }), h) }; k.reject = function (a, b, c) { return k.filter(a, function (a, h, d) { return !b.call(c, a, h, d) }, c) }; k.every = k.all = function (a, b, d) {
b || (b = k.identity); var h = !0; return null == a ? h : J && a.every === J ? a.every(b, d) : (x(a, function (a, f, m) {
return (h = h && b.call(d, a, f, m)) ?
void 0 : c
}), !!h)
}; var Q = k.some = k.any = function (a, b, d) { b || (b = k.identity); var h = !1; return null == a ? h : C && a.some === C ? a.some(b, d) : (x(a, function (a, f, m) { return h || (h = b.call(d, a, f, m)) ? c : void 0 }), !!h) }; k.contains = k.include = function (a, b) { return null == a ? !1 : I && a.indexOf === I ? -1 != a.indexOf(b) : Q(a, function (a) { return a === b }) }; k.invoke = function (a, b) { var c = p.call(arguments, 2), h = k.isFunction(b); return k.map(a, function (a) { return (h ? b : a[b]).apply(a, c) }) }; k.pluck = function (a, b) { return k.map(a, function (a) { return a[b] }) }; k.where =
function (a, b, c) { return k.isEmpty(b) ? c ? void 0 : [] : k[c ? "find" : "filter"](a, function (a) { for (var c in b) if (b[c] !== a[c]) return !1; return !0 }) }; k.findWhere = function (a, b) { return k.where(a, b, !0) }; k.max = function (a, b, c) { if (!b && k.isArray(a) && a[0] === +a[0] && 65535 > a.length) return Math.max.apply(Math, a); if (!b && k.isEmpty(a)) return -1 / 0; var h = { computed: -1 / 0, value: -1 / 0 }; return x(a, function (a, d, f) { d = b ? b.call(c, a, d, f) : a; d > h.computed && (h = { value: a, computed: d }) }), h.value }; k.min = function (a, b, c) {
if (!b && k.isArray(a) && a[0] === +a[0] &&
65535 > a.length) return Math.min.apply(Math, a); if (!b && k.isEmpty(a)) return 1 / 0; var h = { computed: 1 / 0, value: 1 / 0 }; return x(a, function (a, d, f) { d = b ? b.call(c, a, d, f) : a; d < h.computed && (h = { value: a, computed: d }) }), h.value
}; k.shuffle = function (a) { var b, c = 0, h = []; return x(a, function (a) { b = k.random(c++); h[c - 1] = h[b]; h[b] = a }), h }; var y = function (a) { return k.isFunction(a) ? a : function (b) { return b[a] } }; k.sortBy = function (a, b, c) {
var h = y(b); return k.pluck(k.map(a, function (a, b, d) { return { value: a, index: b, criteria: h.call(c, a, b, d) } }).sort(function (a,
b) { var c = a.criteria, h = b.criteria; if (c !== h) { if (c > h || void 0 === c) return 1; if (h > c || void 0 === h) return -1 } return a.index < b.index ? -1 : 1 }), "value")
}; var K = function (a, b, c, d) { var h = {}, f = y(null == b ? k.identity : b); return x(a, function (b, m) { m = f.call(c, b, m, a); d(h, m, b) }), h }; k.groupBy = function (a, b, c) { return K(a, b, c, function (a, b, c) { (k.has(a, b) ? a[b] : a[b] = []).push(c) }) }; k.countBy = function (a, b, c) { return K(a, b, c, function (a, b) { k.has(a, b) || (a[b] = 0); a[b]++ }) }; k.sortedIndex = function (a, b, c, d) {
c = null == c ? k.identity : y(c); b = c.call(d,
b); for (var h = 0, f = a.length; f > h;) { var m = h + f >>> 1; c.call(d, a[m]) < b ? h = m + 1 : f = m } return h
}; k.toArray = function (a) { return a ? k.isArray(a) ? p.call(a) : a.length === +a.length ? k.map(a, k.identity) : k.values(a) : [] }; k.size = function (a) { return null == a ? 0 : a.length === +a.length ? a.length : k.keys(a).length }; k.first = k.head = k.take = function (a, b, c) { return null == a ? void 0 : null == b || c ? a[0] : p.call(a, 0, b) }; k.initial = function (a, b, c) { return p.call(a, 0, a.length - (null == b || c ? 1 : b)) }; k.last = function (a, b, c) {
return null == a ? void 0 : null == b || c ? a[a.length -
1] : p.call(a, Math.max(a.length - b, 0))
}; k.rest = k.tail = k.drop = function (a, b, c) { return p.call(a, null == b || c ? 1 : b) }; k.compact = function (a) { return k.filter(a, k.identity) }; var W = function (a, b, c) { return b && k.every(a, k.isArray) ? n.apply(c, a) : (x(a, function (a) { k.isArray(a) || k.isArguments(a) ? b ? q.apply(c, a) : W(a, b, c) : c.push(a) }), c) }; k.flatten = function (a, b) { return W(a, b, []) }; k.without = function (a) { return k.difference(a, p.call(arguments, 1)) }; k.uniq = k.unique = function (a, b, c, d) {
k.isFunction(b) && (d = c, c = b, b = !1); c = c ? k.map(a, c,
d) : a; var h = [], f = []; return x(c, function (c, d) { (b ? d && f[f.length - 1] === c : k.contains(f, c)) || (f.push(c), h.push(a[d])) }), h
}; k.union = function () { return k.uniq(k.flatten(arguments, !0)) }; k.intersection = function (a) { var b = p.call(arguments, 1); return k.filter(k.uniq(a), function (a) { return k.every(b, function (b) { return 0 <= k.indexOf(b, a) }) }) }; k.difference = function (a) { var b = n.apply(d, p.call(arguments, 1)); return k.filter(a, function (a) { return !k.contains(b, a) }) }; k.zip = function () {
for (var a = k.max(k.pluck(arguments, "length").concat(0)),
b = Array(a), c = 0; a > c; c++)b[c] = k.pluck(arguments, "" + c); return b
}; k.object = function (a, b) { if (null == a) return {}; for (var c = {}, d = 0, h = a.length; h > d; d++)b ? c[a[d]] = b[d] : c[a[d][0]] = a[d][1]; return c }; k.indexOf = function (a, b, c) { if (null == a) return -1; var d = 0, h = a.length; if (c) { if ("number" != typeof c) return d = k.sortedIndex(a, b), a[d] === b ? d : -1; d = 0 > c ? Math.max(0, h + c) : c } if (I && a.indexOf === I) return a.indexOf(b, c); for (; h > d; d++)if (a[d] === b) return d; return -1 }; k.lastIndexOf = function (a, b, c) {
if (null == a) return -1; var d = null != c; if (u && a.lastIndexOf ===
u) return d ? a.lastIndexOf(b, c) : a.lastIndexOf(b); for (c = d ? c : a.length; c--;)if (a[c] === b) return c; return -1
}; k.range = function (a, b, c) { 1 >= arguments.length && (b = a || 0, a = 0); c = arguments[2] || 1; for (var d = Math.max(Math.ceil((b - a) / c), 0), h = 0, f = Array(d); d > h;)f[h++] = a, a += c; return f }; var ha = function () { }; k.bind = function (a, b) {
var c, d; if (G && a.bind === G) return G.apply(a, p.call(arguments, 1)); if (!k.isFunction(a)) throw new TypeError; return c = p.call(arguments, 2), d = function () {
if (!(this instanceof d)) return a.apply(b, c.concat(p.call(arguments)));
ha.prototype = a.prototype; var h = new ha; ha.prototype = null; var f = a.apply(h, c.concat(p.call(arguments))); return Object(f) === f ? f : h
}
}; k.partial = function (a) { var b = p.call(arguments, 1); return function () { return a.apply(this, b.concat(p.call(arguments))) } }; k.bindAll = function (a) { var b = p.call(arguments, 1); if (0 === b.length) throw Error("bindAll must be passed function names"); return x(b, function (b) { a[b] = k.bind(a[b], a) }), a }; k.memoize = function (a, b) {
var c = {}; return b || (b = k.identity), function () {
var d = b.apply(this, arguments);
return k.has(c, d) ? c[d] : c[d] = a.apply(this, arguments)
}
}; k.delay = function (a, b) { var c = p.call(arguments, 2); return setTimeout(function () { return a.apply(null, c) }, b) }; k.defer = function (a) { return k.delay.apply(k, [a, 1].concat(p.call(arguments, 1))) }; k.throttle = function (a, b, c) {
var d, h, f, m = null, k = 0; c || (c = {}); var r = function () { k = !1 === c.leading ? 0 : new Date; m = null; f = a.apply(d, h) }; return function () {
var q = new Date; k || !1 !== c.leading || (k = q); var t = b - (q - k); return d = this, h = arguments, 0 >= t ? (clearTimeout(m), m = null, k = q, f = a.apply(d,
h)) : m || !1 === c.trailing || (m = setTimeout(r, t)), f
}
}; k.debounce = function (a, b, c) { var d, h = null; return function () { var f = this, m = arguments, k = c && !h; return clearTimeout(h), h = setTimeout(function () { h = null; c || (d = a.apply(f, m)) }, b), k && (d = a.apply(f, m)), d } }; k.once = function (a) { var b, c = !1; return function () { return c ? b : (c = !0, b = a.apply(this, arguments), a = null, b) } }; k.wrap = function (a, b) { return function () { var c = [a]; return q.apply(c, arguments), b.apply(this, c) } }; k.compose = function () {
var a = arguments; return function () {
for (var b =
arguments, c = a.length - 1; 0 <= c; c--)b = [a[c].apply(this, b)]; return b[0]
}
}; k.after = function (a, b) { return function () { return 1 > --a ? b.apply(this, arguments) : void 0 } }; k.keys = E || function (a) { if (a !== Object(a)) throw new TypeError("Invalid object"); var b = [], c; for (c in a) k.has(a, c) && b.push(c); return b }; k.values = function (a) { var b = [], c; for (c in a) k.has(a, c) && b.push(a[c]); return b }; k.pairs = function (a) { var b = [], c; for (c in a) k.has(a, c) && b.push([c, a[c]]); return b }; k.invert = function (a) {
var b = {}, c; for (c in a) k.has(a, c) && (b[a[c]] =
c); return b
}; k.functions = k.methods = function (a) { var b = [], c; for (c in a) k.isFunction(a[c]) && b.push(c); return b.sort() }; k.extend = function (a) { return x(p.call(arguments, 1), function (b) { if (b) for (var c in b) a[c] = b[c] }), a }; k.pick = function (a) { var b = {}, c = n.apply(d, p.call(arguments, 1)); return x(c, function (c) { c in a && (b[c] = a[c]) }), b }; k.omit = function (a) { var b = {}, c = n.apply(d, p.call(arguments, 1)), h; for (h in a) k.contains(c, h) || (b[h] = a[h]); return b }; k.defaults = function (a) {
return x(p.call(arguments, 1), function (b) {
if (b) for (var c in b) void 0 ===
a[c] && (a[c] = b[c])
}), a
}; k.clone = function (a) { return k.isObject(a) ? k.isArray(a) ? a.slice() : k.extend({}, a) : a }; k.tap = function (a, b) { return b(a), a }; var ia = function (a, b, c, d) {
if (a === b) return 0 !== a || 1 / a == 1 / b; if (null == a || null == b) return a === b; a instanceof k && (a = a._wrapped); b instanceof k && (b = b._wrapped); var h = A.call(a); if (h != A.call(b)) return !1; switch (h) {
case "[object String]": return a == String(b); case "[object Number]": return a != +a ? b != +b : 0 == a ? 1 / a == 1 / b : a == +b; case "[object Date]": case "[object Boolean]": return +a ==
+b; case "[object RegExp]": return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase
}if ("object" != typeof a || "object" != typeof b) return !1; for (var f = c.length; f--;)if (c[f] == a) return d[f] == b; f = a.constructor; var m = b.constructor; if (f !== m && !(k.isFunction(f) && f instanceof f && k.isFunction(m) && m instanceof m)) return !1; c.push(a); d.push(b); f = 0; m = !0; if ("[object Array]" == h) { if (f = a.length, m = f == b.length) for (; f-- && (m = ia(a[f], b[f], c, d));); } else {
for (var r in a) if (k.has(a, r) &&
(f++, !(m = k.has(b, r) && ia(a[r], b[r], c, d)))) break; if (m) { for (r in b) if (k.has(b, r) && !f--) break; m = !f }
} return c.pop(), d.pop(), m
}; k.isEqual = function (a, b) { return ia(a, b, [], []) }; k.isEmpty = function (a) { if (null == a) return !0; if (k.isArray(a) || k.isString(a)) return 0 === a.length; for (var b in a) if (k.has(a, b)) return !1; return !0 }; k.isElement = function (a) { return !(!a || 1 !== a.nodeType) }; k.isArray = f || function (a) { return "[object Array]" == A.call(a) }; k.isObject = function (a) { return a === Object(a) }; x("Arguments Function String Number Date RegExp".split(" "),
function (a) { k["is" + a] = function (b) { return A.call(b) == "[object " + a + "]" } }); k.isArguments(arguments) || (k.isArguments = function (a) { return !(!a || !k.has(a, "callee")) }); "function" != typeof /./ && (k.isFunction = function (a) { return "function" == typeof a }); k.isFinite = function (a) { return isFinite(a) && !isNaN(parseFloat(a)) }; k.isNaN = function (a) { return k.isNumber(a) && a != +a }; k.isBoolean = function (a) { return !0 === a || !1 === a || "[object Boolean]" == A.call(a) }; k.isNull = function (a) { return null === a }; k.isUndefined = function (a) {
return void 0 ===
a
}; k.has = function (a, b) { return H.call(a, b) }; k.noConflict = function () { return a._ = b, this }; k.identity = function (a) { return a }; k.times = function (a, b, c) { for (var d = Array(Math.max(0, a)), f = 0; a > f; f++)d[f] = b.call(c, f); return d }; k.random = function (a, b) { return null == b && (b = a, a = 0), a + Math.floor(Math.random() * (b - a + 1)) }; var T = { escape: { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "/": "&#x2F;" } }; T.unescape = k.invert(T.escape); var ja = {
escape: new RegExp("[" + k.keys(T.escape).join("") + "]", "g"), unescape: new RegExp("(" +
k.keys(T.unescape).join("|") + ")", "g")
}; k.each(["escape", "unescape"], function (a) { k[a] = function (b) { return null == b ? "" : ("" + b).replace(ja[a], function (b) { return T[a][b] }) } }); k.result = function (a, b) { if (null != a) return b = a[b], k.isFunction(b) ? b.call(a) : b }; k.mixin = function (a) { x(k.functions(a), function (b) { var c = k[b] = a[b]; k.prototype[b] = function () { var a = [this._wrapped]; return q.apply(a, arguments), O.call(this, c.apply(k, a)) } }) }; var Y = 0; k.uniqueId = function (a) { var b = ++Y + ""; return a ? a + b : b }; k.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g
}; var m = /(.)^/, r = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\t": "t", "\u2028": "u2028", "\u2029": "u2029" }, X = /\\|'|\r|\n|\t|\u2028|\u2029/g; k.template = function (a, b, c) {
c = k.defaults({}, c, k.templateSettings); var d = new RegExp([(c.escape || m).source, (c.interpolate || m).source, (c.evaluate || m).source].join("|") + "|$", "g"), f = 0, h = "__p+='"; a.replace(d, function (b, c, d, m, k) {
return h += a.slice(f, k).replace(X, function (a) { return "\\" + r[a] }), c && (h += "'+\n((__t=(" + c + "))==null?'':_.escape(__t))+\n'"),
d && (h += "'+\n((__t=(" + d + "))==null?'':__t)+\n'"), m && (h += "';\n" + m + "\n__p+='"), f = k + b.length, b
}); h += "';\n"; c.variable || (h = "with(obj||{}){\n" + h + "}\n"); h = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + h + "return __p;\n"; try { var q = new Function(c.variable || "obj", "_", h) } catch (wa) { throw wa.source = h, wa; } if (b) return q(b, k); b = function (a) { return q.call(this, a, k) }; return b.source = "function(" + (c.variable || "obj") + "){\n" + h + "}", b
}; k.chain = function (a) { return k(a).chain() }; var O =
function (a) { return this._chain ? k(a).chain() : a }; k.mixin(k); x("pop push reverse shift sort splice unshift".split(" "), function (a) { var b = d[a]; k.prototype[a] = function () { var c = this._wrapped; return b.apply(c, arguments), "shift" != a && "splice" != a || 0 !== c.length || delete c[0], O.call(this, c) } }); x(["concat", "join", "slice"], function (a) { var b = d[a]; k.prototype[a] = function () { return O.call(this, b.apply(this._wrapped, arguments)) } }); k.extend(k.prototype, { chain: function () { return this._chain = !0, this }, value: function () { return this._wrapped } })
}.call(this); (function () {
var a = this, b = a.Backbone, c = [], d = c.push, f = c.slice, q = c.splice; var p = "undefined" !== typeof exports ? exports : a.Backbone = {}; p.VERSION = "1.0.0"; var n = a._; n || "undefined" === typeof require || (n = require("underscore")); p.$ = a.jQuery || a.Zepto || a.ender || a.$; p.noConflict = function () { a.Backbone = b; return this }; p.emulateHTTP = !1; p.emulateJSON = !1; var A = p.Events = {
on: function (a, b, c) {
if (!D(this, "on", a, [b, c]) || !b) return this; this._events || (this._events = {}); (this._events[a] || (this._events[a] = [])).push({
callback: b, context: c,
ctx: c || this
}); return this
}, once: function (a, b, c) { if (!D(this, "once", a, [b, c]) || !b) return this; var d = this, f = n.once(function () { d.off(a, f); b.apply(this, arguments) }); f._callback = b; return this.on(a, f, c) }, off: function (a, b, c) {
var d, f, m, k; if (!this._events || !D(this, "off", a, [b, c])) return this; if (!a && !b && !c) return this._events = {}, this; var r = a ? [a] : n.keys(this._events); var q = 0; for (m = r.length; q < m; q++)if (a = r[q], f = this._events[a]) {
this._events[a] = d = []; if (b || c) {
var x = 0; for (k = f.length; x < k; x++) {
var p = f[x]; (b && b !== p.callback &&
b !== p.callback._callback || c && c !== p.context) && d.push(p)
}
} d.length || delete this._events[a]
} return this
}, trigger: function (a) { if (!this._events) return this; var b = f.call(arguments, 1); if (!D(this, "trigger", a, b)) return this; var c = this._events[a], d = this._events.all; c && S(c, b); d && S(d, arguments); return this }, stopListening: function (a, b, c) {
var d = this._listeners; if (!d) return this; var f = !b && !c; "object" === typeof b && (c = this); a && ((d = {})[a._listenerId] = a); for (var m in d) d[m].off(b, c, this), f && delete this._listeners[m];
return this
}
}, H = /\s+/, D = function (a, b, c, d) { if (!c) return !0; if ("object" === typeof c) { for (var f in c) a[b].apply(a, [f, c[f]].concat(d)); return !1 } if (H.test(c)) { c = c.split(H); f = 0; for (var m = c.length; f < m; f++)a[b].apply(a, [c[f]].concat(d)); return !1 } return !0 }, S = function (a, b) {
var c, d = -1, f = a.length, m = b[0], k = b[1], r = b[2]; switch (b.length) {
case 0: for (; ++d < f;)(c = a[d]).callback.call(c.ctx); break; case 1: for (; ++d < f;)(c = a[d]).callback.call(c.ctx, m); break; case 2: for (; ++d < f;)(c = a[d]).callback.call(c.ctx, m, k); break; case 3: for (; ++d <
f;)(c = a[d]).callback.call(c.ctx, m, k, r); break; default: for (; ++d < f;)(c = a[d]).callback.apply(c.ctx, b)
}
}; n.each({ listenTo: "on", listenToOnce: "once" }, function (a, b) { A[b] = function (b, c, d) { var f = this._listeners || (this._listeners = {}), h = b._listenerId || (b._listenerId = n.uniqueId("l")); f[h] = b; "object" === typeof c && (d = this); b[a](c, d, this); return this } }); A.bind = A.on; A.unbind = A.off; n.extend(p, A); var N = p.Model = function (a, b) {
var c, d = a || {}; b || (b = {}); this.cid = n.uniqueId("c"); this.attributes = {}; n.extend(this, n.pick(b, M));
b.parse && (d = this.parse(d, b) || {}); if (c = n.result(this, "defaults")) d = n.defaults({}, d, c); this.set(d, b); this.changed = {}; this.initialize.apply(this, arguments)
}, M = ["url", "urlRoot", "collection"]; n.extend(N.prototype, A, {
changed: null, validationError: null, idAttribute: "id", initialize: function () { }, toJSON: function (a) { return n.clone(this.attributes) }, sync: function () { return p.sync.apply(this, arguments) }, get: function (a) { return this.attributes[a] }, escape: function (a) { return n.escape(this.get(a)) }, has: function (a) {
return null !=
this.get(a)
}, set: function (a, b, c) {
var d; if (null == a) return this; if ("object" === typeof a) { var f = a; c = b } else (f = {})[a] = b; c || (c = {}); if (!this._validate(f, c)) return !1; var m = c.unset; var k = c.silent; a = []; var q = this._changing; this._changing = !0; q || (this._previousAttributes = n.clone(this.attributes), this.changed = {}); var r = this.attributes; var x = this._previousAttributes; this.idAttribute in f && (this.id = f[this.idAttribute]); for (d in f) b = f[d], n.isEqual(r[d], b) || a.push(d), n.isEqual(x[d], b) ? delete this.changed[d] : this.changed[d] =
b, m ? delete r[d] : r[d] = b; if (!k) for (a.length && (this._pending = !0), b = 0, d = a.length; b < d; b++)this.trigger("change:" + a[b], this, r[a[b]], c); if (q) return this; if (!k) for (; this._pending;)this._pending = !1, this.trigger("change", this, c); this._changing = this._pending = !1; return this
}, unset: function (a, b) { return this.set(a, void 0, n.extend({}, b, { unset: !0 })) }, clear: function (a) { var b = {}, c; for (c in this.attributes) b[c] = void 0; return this.set(b, n.extend({}, a, { unset: !0 })) }, hasChanged: function (a) {
return null == a ? !n.isEmpty(this.changed) :
n.has(this.changed, a)
}, changedAttributes: function (a) { if (!a) return this.hasChanged() ? n.clone(this.changed) : !1; var b, c = !1, d = this._changing ? this._previousAttributes : this.attributes, f; for (f in a) n.isEqual(d[f], b = a[f]) || ((c || (c = {}))[f] = b); return c }, previous: function (a) { return null != a && this._previousAttributes ? this._previousAttributes[a] : null }, previousAttributes: function () { return n.clone(this._previousAttributes) }, fetch: function (a) {
a = a ? n.clone(a) : {}; void 0 === a.parse && (a.parse = !0); var b = this, c = a.success;
a.success = function (d) { if (!b.set(b.parse(d, a), a)) return !1; c && c(b, d, a); b.trigger("sync", b, d, a) }; Y(this, a); return this.sync("read", this, a)
}, save: function (a, b, c) {
var d = this.attributes; if (null == a || "object" === typeof a) { var f = a; c = b } else (f = {})[a] = b; if (!(!f || c && c.wait || this.set(f, c))) return !1; c = n.extend({ validate: !0 }, c); if (!this._validate(f, c)) return !1; f && c.wait && (this.attributes = n.extend({}, d, f)); void 0 === c.parse && (c.parse = !0); var m = this, k = c.success; c.success = function (a) {
m.attributes = d; var b = m.parse(a, c);
c.wait && (b = n.extend(f || {}, b)); if (n.isObject(b) && !m.set(b, c)) return !1; k && k(m, a, c); m.trigger("sync", m, a, c)
}; Y(this, c); a = this.isNew() ? "create" : c.patch ? "patch" : "update"; "patch" === a && (c.attrs = f); a = this.sync(a, this, c); f && c.wait && (this.attributes = d); return a
}, destroy: function (a) {
a = a ? n.clone(a) : {}; var b = this, c = a.success, d = function () { b.trigger("destroy", b, b.collection, a) }; a.success = function (f) { (a.wait || b.isNew()) && d(); c && c(b, f, a); b.isNew() || b.trigger("sync", b, f, a) }; if (this.isNew()) return a.success(), !1; Y(this,
a); var f = this.sync("delete", this, a); a.wait || d(); return f
}, url: function () { var a = n.result(this, "urlRoot") || n.result(this.collection, "url") || ja(); return this.isNew() ? a : a + ("/" === a.charAt(a.length - 1) ? "" : "/") + encodeURIComponent(this.id) }, parse: function (a, b) { return a }, clone: function () { return new this.constructor(this.attributes) }, isNew: function () { return null == this.id }, isValid: function (a) { return this._validate({}, n.extend(a || {}, { validate: !0 })) }, _validate: function (a, b) {
if (!b.validate || !this.validate) return !0;
a = n.extend({}, this.attributes, a); a = this.validationError = this.validate(a, b) || null; if (!a) return !0; this.trigger("invalid", this, a, n.extend(b || {}, { validationError: a })); return !1
}
}); n.each("keys values pairs invert pick omit".split(" "), function (a) { N.prototype[a] = function () { var b = f.call(arguments); b.unshift(this.attributes); return n[a].apply(n, b) } }); var F = p.Collection = function (a, b) {
b || (b = {}); b.url && (this.url = b.url); b.model && (this.model = b.model); void 0 !== b.comparator && (this.comparator = b.comparator); this._reset();
this.initialize.apply(this, arguments); a && this.reset(a, n.extend({ silent: !0 }, b))
}, J = { add: !0, remove: !0, merge: !0 }, C = { add: !0, merge: !1, remove: !1 }; n.extend(F.prototype, A, {
model: N, initialize: function () { }, toJSON: function (a) { return this.map(function (b) { return b.toJSON(a) }) }, sync: function () { return p.sync.apply(this, arguments) }, add: function (a, b) { return this.set(a, n.defaults(b || {}, C)) }, remove: function (a, b) {
a = n.isArray(a) ? a.slice() : [a]; b || (b = {}); var c, d; var f = 0; for (c = a.length; f < c; f++)if (d = this.get(a[f])) {
delete this._byId[d.id];
delete this._byId[d.cid]; var k = this.indexOf(d); this.models.splice(k, 1); this.length--; b.silent || (b.index = k, d.trigger("remove", d, this, b)); this._removeReference(d)
} return this
}, set: function (a, b) {
b = n.defaults(b || {}, J); b.parse && (a = this.parse(a, b)); n.isArray(a) || (a = a ? [a] : []); var c, f, h, k, m = b.at, r = this.comparator && null == m && !1 !== b.sort, x = n.isString(this.comparator) ? this.comparator : null, p = [], G = [], E = {}; var u = 0; for (c = a.length; u < c; u++)if (f = this._prepareModel(a[u], b)) (h = this.get(f)) ? (b.remove && (E[h.cid] = !0), b.merge &&
(h.set(f.attributes, b), r && !k && h.hasChanged(x) && (k = !0))) : b.add && (p.push(f), f.on("all", this._onModelEvent, this), this._byId[f.cid] = f, null != f.id && (this._byId[f.id] = f)); if (b.remove) { u = 0; for (c = this.length; u < c; ++u)E[(f = this.models[u]).cid] || G.push(f); G.length && this.remove(G, b) } p.length && (r && (k = !0), this.length += p.length, null != m ? q.apply(this.models, [m, 0].concat(p)) : d.apply(this.models, p)); k && this.sort({ silent: !0 }); if (b.silent) return this; u = 0; for (c = p.length; u < c; u++)(f = p[u]).trigger("add", f, this, b); k && this.trigger("sort",
this, b); return this
}, reset: function (a, b) { b || (b = {}); for (var c = 0, d = this.models.length; c < d; c++)this._removeReference(this.models[c]); b.previousModels = this.models; this._reset(); this.add(a, n.extend({ silent: !0 }, b)); b.silent || this.trigger("reset", this, b); return this }, push: function (a, b) { a = this._prepareModel(a, b); this.add(a, n.extend({ at: this.length }, b)); return a }, pop: function (a) { var b = this.at(this.length - 1); this.remove(b, a); return b }, unshift: function (a, b) {
a = this._prepareModel(a, b); this.add(a, n.extend({ at: 0 },
b)); return a
}, shift: function (a) { var b = this.at(0); this.remove(b, a); return b }, slice: function (a, b) { return this.models.slice(a, b) }, get: function (a) { if (null != a) return this._byId[null != a.id ? a.id : a.cid || a] }, at: function (a) { return this.models[a] }, where: function (a, b) { return n.isEmpty(a) ? b ? void 0 : [] : this[b ? "find" : "filter"](function (b) { for (var c in a) if (a[c] !== b.get(c)) return !1; return !0 }) }, findWhere: function (a) { return this.where(a, !0) }, sort: function (a) {
if (!this.comparator) throw Error("Cannot sort a set without a comparator");
a || (a = {}); n.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(n.bind(this.comparator, this)); a.silent || this.trigger("sort", this, a); return this
}, sortedIndex: function (a, b, c) { b || (b = this.comparator); var d = n.isFunction(b) ? b : function (a) { return a.get(b) }; return n.sortedIndex(this.models, a, d, c) }, pluck: function (a) { return n.invoke(this.models, "get", a) }, fetch: function (a) {
a = a ? n.clone(a) : {}; void 0 === a.parse && (a.parse = !0); var b = a.success, c = this;
a.success = function (d) { c[a.reset ? "reset" : "set"](d, a); b && b(c, d, a); c.trigger("sync", c, d, a) }; Y(this, a); return this.sync("read", this, a)
}, create: function (a, b) { b = b ? n.clone(b) : {}; if (!(a = this._prepareModel(a, b))) return !1; b.wait || this.add(a, b); var c = this, d = b.success; b.success = function (f) { b.wait && c.add(a, b); d && d(a, f, b) }; a.save(null, b); return a }, parse: function (a, b) { return a }, clone: function () { return new this.constructor(this.models) }, _reset: function () { this.length = 0; this.models = []; this._byId = {} }, _prepareModel: function (a,
b) { if (a instanceof N) return a.collection || (a.collection = this), a; b || (b = {}); b.collection = this; var c = new this.model(a, b); return c._validate(a, b) ? c : (this.trigger("invalid", this, a, b), !1) }, _removeReference: function (a) { this === a.collection && delete a.collection; a.off("all", this._onModelEvent, this) }, _onModelEvent: function (a, b, c, d) {
if ("add" !== a && "remove" !== a || c === this) "destroy" === a && this.remove(b, d), b && a === "change:" + b.idAttribute && (delete this._byId[b.previous(b.idAttribute)], null != b.id && (this._byId[b.id] = b)),
this.trigger.apply(this, arguments)
}
}); n.each("forEach each map collect reduce foldl inject reduceRight foldr find detect filter select reject every all some any include contains invoke max min toArray size first head take initial rest tail drop last without indexOf shuffle lastIndexOf isEmpty chain".split(" "), function (a) { F.prototype[a] = function () { var b = f.call(arguments); b.unshift(this.models); return n[a].apply(n, b) } }); n.each(["groupBy", "countBy", "sortBy"], function (a) {
F.prototype[a] = function (b, c) {
var d =
n.isFunction(b) ? b : function (a) { return a.get(b) }; return n[a](this.models, d, c)
}
}); c = p.View = function (a) { this.cid = n.uniqueId("view"); this._configure(a || {}); this._ensureElement(); this.initialize.apply(this, arguments); this.delegateEvents() }; var I = /^(\S+)\s*(.*)$/, u = "model collection el id attributes className tagName events".split(" "); n.extend(c.prototype, A, {
tagName: "div", $: function (a) { return this.$el.find(a) }, initialize: function () { }, render: function () { return this }, remove: function () {
this.$el.remove(); this.stopListening();
return this
}, setElement: function (a, b) { this.$el && this.undelegateEvents(); this.$el = a instanceof p.$ ? a : p.$(a); this.el = this.$el[0]; !1 !== b && this.delegateEvents(); return this }, delegateEvents: function (a) { if (!a && !(a = n.result(this, "events"))) return this; this.undelegateEvents(); for (var b in a) { var c = a[b]; n.isFunction(c) || (c = this[a[b]]); if (c) { var d = b.match(I), f = d[1]; d = d[2]; c = n.bind(c, this); f += ".delegateEvents" + this.cid; if ("" === d) this.$el.on(f, c); else this.$el.on(f, d, c) } } return this }, undelegateEvents: function () {
this.$el.off(".delegateEvents" +
this.cid); return this
}, _configure: function (a) { this.options && (a = n.extend({}, n.result(this, "options"), a)); n.extend(this, n.pick(a, u)); this.options = a }, _ensureElement: function () { if (this.el) this.setElement(n.result(this, "el"), !1); else { var a = n.extend({}, n.result(this, "attributes")); this.id && (a.id = n.result(this, "id")); this.className && (a["class"] = n.result(this, "className")); a = p.$("<" + n.result(this, "tagName") + ">").attr(a); this.setElement(a, !1) } }
}); p.sync = function (a, b, c) {
var d = E[a]; n.defaults(c || (c = {}), {
emulateHTTP: p.emulateHTTP,
emulateJSON: p.emulateJSON
}); var f = { type: d, dataType: "json" }; c.url || (f.url = n.result(b, "url") || ja()); null != c.data || !b || "create" !== a && "update" !== a && "patch" !== a || (f.contentType = "application/json", f.data = JSON.stringify(c.attrs || b.toJSON(c))); c.emulateJSON && (f.contentType = "application/x-www-form-urlencoded", f.data = f.data ? { model: f.data } : {}); if (c.emulateHTTP && ("PUT" === d || "DELETE" === d || "PATCH" === d)) {
f.type = "POST"; c.emulateJSON && (f.data._method = d); var k = c.beforeSend; c.beforeSend = function (a) {
a.setRequestHeader("X-HTTP-Method-Override",
d); if (k) return k.apply(this, arguments)
}
} "GET" === f.type || c.emulateJSON || (f.processData = !1); "PATCH" !== f.type || !window.ActiveXObject || window.external && window.external.msActiveXFilteringEnabled || (f.xhr = function () { return new ActiveXObject("Microsoft.XMLHTTP") }); a = c.xhr = p.ajax(n.extend(f, c)); b.trigger("request", b, a, c); return a
}; var E = { create: "POST", update: "PUT", patch: "PATCH", "delete": "DELETE", read: "GET" }; p.ajax = function () { return p.$.ajax.apply(p.$, arguments) }; var G = p.Router = function (a) {
a || (a = {}); a.routes &&
(this.routes = a.routes); this._bindRoutes(); this.initialize.apply(this, arguments)
}, k = /\((.*?)\)/g, x = /(\(\?)?:\w+/g, Q = /\*\w+/g, y = /[\-{}\[\]+?.,\\\^$|#\s]/g; n.extend(G.prototype, A, {
initialize: function () { }, route: function (a, b, c) { n.isRegExp(a) || (a = this._routeToRegExp(a)); n.isFunction(b) && (c = b, b = ""); c || (c = this[b]); var d = this; p.history.route(a, function (f) { f = d._extractParameters(a, f); c && c.apply(d, f); d.trigger.apply(d, ["route:" + b].concat(f)); d.trigger("route", b, f); p.history.trigger("route", d, b, f) }); return this },
navigate: function (a, b) { p.history.navigate(a, b); return this }, _bindRoutes: function () { if (this.routes) { this.routes = n.result(this, "routes"); for (var a, b = n.keys(this.routes); null != (a = b.pop());)this.route(a, this.routes[a]) } }, _routeToRegExp: function (a) { a = a.replace(y, "\\$&").replace(k, "(?:$1)?").replace(x, function (a, b) { return b ? a : "([^/]+)" }).replace(Q, "(.*?)"); return new RegExp("^" + a + "$") }, _extractParameters: function (a, b) { a = a.exec(b).slice(1); return n.map(a, function (a) { return a ? decodeURIComponent(a) : null }) }
});
var K = p.History = function () { this.handlers = []; n.bindAll(this, "checkUrl"); "undefined" !== typeof window && (this.location = window.location, this.history = window.history) }, W = /^[#\/]|\s+$/g, ha = /^\/+|\/+$/g, ia = /msie [\w.]+/, T = /\/$/; K.started = !1; n.extend(K.prototype, A, {
interval: 50, getHash: function (a) { return (a = (a || this).location.href.match(/#(.*)$/)) ? a[1] : "" }, getFragment: function (a, b) {
null == a && (this._hasPushState || !this._wantsHashChange || b ? (a = this.location.pathname, b = this.root.replace(T, ""), a.indexOf(b) || (a = a.substr(b.length))) :
a = this.getHash()); return a.replace(W, "")
}, start: function (a) {
if (K.started) throw Error("Backbone.history has already been started"); K.started = !0; this.options = n.extend({}, { root: "/" }, this.options, a); this.root = this.options.root; this._wantsHashChange = !1 !== this.options.hashChange; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); a = this.getFragment(); var b = document.documentMode; b = ia.exec(navigator.userAgent.toLowerCase()) && (!b ||
7 >= b); this.root = ("/" + this.root + "/").replace(ha, "/"); b && this._wantsHashChange && (this.iframe = p.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow, this.navigate(a)); if (this._hasPushState) p.$(window).on("popstate", this.checkUrl); else if (this._wantsHashChange && "onhashchange" in window && !b) p.$(window).on("hashchange", this.checkUrl); else this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)); this.fragment = a; a = this.location; b = a.pathname.replace(/[^\/]$/,
"$&/") === this.root; if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !b) return this.fragment = this.getFragment(null, !0), this.location.replace(this.root + this.location.search + "#" + this.fragment), !0; this._wantsPushState && this._hasPushState && b && a.hash && (this.fragment = this.getHash().replace(W, ""), this.history.replaceState({}, document.title, this.root + this.fragment + a.search)); if (!this.options.silent) return this.loadUrl()
}, stop: function () {
p.$(window).off("popstate", this.checkUrl).off("hashchange",
this.checkUrl); clearInterval(this._checkUrlInterval); K.started = !1
}, route: function (a, b) { this.handlers.unshift({ route: a, callback: b }) }, checkUrl: function (a) { a = this.getFragment(); a === this.fragment && this.iframe && (a = this.getFragment(this.getHash(this.iframe))); if (a === this.fragment) return !1; this.iframe && this.navigate(a); this.loadUrl() || this.loadUrl(this.getHash()) }, loadUrl: function (a) { var b = this.fragment = this.getFragment(a); return n.any(this.handlers, function (a) { if (a.route.test(b)) return a.callback(b), !0 }) },
navigate: function (a, b) {
if (!K.started) return !1; b && !0 !== b || (b = { trigger: b }); a = this.getFragment(a || ""); if (this.fragment !== a) {
this.fragment = a; var c = this.root + a; if (this._hasPushState) this.history[b.replace ? "replaceState" : "pushState"]({}, document.title, c); else if (this._wantsHashChange) this._updateHash(this.location, a, b.replace), this.iframe && a !== this.getFragment(this.getHash(this.iframe)) && (b.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, a, b.replace)); else return this.location.assign(c);
b.trigger && this.loadUrl(a)
}
}, _updateHash: function (a, b, c) { c ? (c = a.href.replace(/(javascript:|#).*$/, ""), a.replace(c + "#" + b)) : a.hash = "#" + b }
}); p.history = new K; N.extend = F.extend = G.extend = c.extend = K.extend = function (a, b) { var c = this; var d = a && n.has(a, "constructor") ? a.constructor : function () { return c.apply(this, arguments) }; n.extend(d, c, b); b = function () { this.constructor = d }; b.prototype = c.prototype; d.prototype = new b; a && n.extend(d.prototype, a); d.__super__ = c.prototype; return d }; var ja = function () {
throw Error('A "url" property or function must be specified');
}, Y = function (a, b) { var c = b.error; b.error = function (d) { c && c(a, d, b); a.trigger("error", a, d, b) } }
}).call(this); (function () {
var a = function (a, b) { for (var c = b.exec(a), d = [], p; null != c;)p = c.index, 0 != p && (a.substring(0, p), d.push(a.substring(0, p)), a = a.slice(p)), d.push(c[0]), a = a.slice(c[0].length), c = b.exec(a); "" == !a && d.push(a); return d }, b = function (a, b) { for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]) }; EJS = function (a) {
a = "string" == typeof a ? { view: a } : a; this.set_options(a); if (a.precompiled) this.template = {}, this.template.process = a.precompiled, EJS.update(this.name, this); else {
if (a.element) {
if ("string" == typeof a.element) {
var b =
a.element; a.element = document.getElementById(a.element); if (null == a.element) throw b + "does not exist!";
} this.text = a.element.value ? a.element.value : a.element.innerHTML; this.name = a.element.id; this.type = "["
} else if (a.url) {
a.url = EJS.endExt(a.url, this.extMatch); this.name = this.name ? this.name : a.url; b = a.url; var c = EJS.get(this.name, this.cache); if (c) return c; if (c == EJS.INVALID_PATH) return null; try { this.text = EJS.request(b + (this.cache ? "" : "?" + Math.random())) } catch (q) { } if (null == this.text) throw {
type: "EJS", message: "There is no template at " +
b
};
} c = new EJS.Compiler(this.text, this.type); c.compile(a, this.name); EJS.update(this.name, this); this.template = c
}
}; EJS.prototype = {
render: function (a, b) { a = a || {}; this._extra_helpers = b; b = new EJS.Helpers(a, b || {}); return this.template.process.call(a, a, b) }, update: function (a, b) {
"string" == typeof a && (a = document.getElementById(a)); if (null == b) return _template = this, function (b) { EJS.prototype.update.call(_template, a, b) }; "string" == typeof b ? (params = {}, params.url = b, _template = this, params.onComplete = function (b) {
b = eval(b.responseText);
EJS.prototype.update.call(_template, a, b)
}, EJS.ajax_request(params)) : a.innerHTML = this.render(b)
}, out: function () { return this.template.out }, set_options: function (a) { this.type = a.type || EJS.type; this.cache = null != a.cache ? a.cache : EJS.cache; this.text = a.text || null; this.name = a.name || null; this.ext = a.ext || EJS.ext; this.extMatch = new RegExp(this.ext.replace(/\./, ".")) }
}; EJS.endExt = function (a, b) { if (!a) return null; b.lastIndex = 0; return a + (b.test(a) ? "" : this.ext) }; EJS.Scanner = function (a, d, f) {
b(this, {
left_delimiter: d + "%",
right_delimiter: "%" + f, double_left: d + "%%", double_right: "%%" + f, left_equal: d + "%=", left_comment: d + "%#"
}); this.SplitRegexp = "[" == d ? /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/ : new RegExp("(" + this.double_left + ")|(%%" + this.double_right + ")|(" + this.left_equal + ")|(" + this.left_comment + ")|(" + this.left_delimiter + ")|(" + this.right_delimiter + "\n)|(" + this.right_delimiter + ")|(\n)"); this.source = a; this.stag = null; this.lines = 0
}; EJS.Scanner.to_text = function (a) {
return null == a || void 0 === a ? "" : a instanceof Date ? a.toDateString() :
a.toString ? a.toString() : ""
}; EJS.Scanner.prototype = { scan: function (b) { scanline = this.scanline; regex = this.SplitRegexp; if ("" == !this.source) for (var c = a(this.source, /\n/), f = 0; f < c.length; f++)this.scanline(c[f], regex, b) }, scanline: function (b, d, f) { this.lines++; b = a(b, d); for (d = 0; d < b.length; d++) { var c = b[d]; if (null != c) try { f(c, this) } catch (p) { throw { type: "EJS.Scanner", line: this.lines }; } } } }; EJS.Buffer = function (a, b) { this.line = []; this.script = ""; this.pre_cmd = a; this.post_cmd = b; for (b = 0; b < this.pre_cmd.length; b++)this.push(a[b]) };
EJS.Buffer.prototype = { push: function (a) { this.line.push(a) }, cr: function () { this.script += this.line.join("; "); this.line = []; this.script += "\n" }, close: function () { if (0 < this.line.length) { for (var a = 0; a < this.post_cmd.length; a++)this.push(pre_cmd[a]); this.script += this.line.join("; "); line = null } } }; EJS.Compiler = function (a, b) {
this.pre_cmd = ["var ___ViewO = [];"]; this.post_cmd = []; this.source = " "; null != a && ("string" == typeof a ? (a = a.replace(/\r\n/g, "\n"), this.source = a = a.replace(/\r/g, "\n")) : a.innerHTML && (this.source =
a.innerHTML), "string" != typeof this.source && (this.source = "")); b = b || "<"; a = ">"; switch (b) { case "[": a = "]"; break; case "<": break; default: throw b + " is not a supported deliminator"; }this.scanner = new EJS.Scanner(this.source, b, a); this.out = ""
}; EJS.Compiler.prototype = {
compile: function (a, b) {
a = a || {}; this.out = ""; var c = new EJS.Buffer(this.pre_cmd, this.post_cmd), d = "", p = function (a) { a = a.replace(/\\/g, "\\\\"); a = a.replace(/\n/g, "\\n"); return a = a.replace(/"/g, '\\"') }; this.scanner.scan(function (a, b) {
if (null == b.stag) switch (a) {
case "\n": d +=
"\n"; c.push('___ViewO.push("' + p(d) + '");'); c.cr(); d = ""; break; case b.left_delimiter: case b.left_equal: case b.left_comment: b.stag = a; 0 < d.length && c.push('___ViewO.push("' + p(d) + '")'); d = ""; break; case b.double_left: d += b.left_delimiter; break; default: d += a
} else switch (a) {
case b.right_delimiter: switch (b.stag) { case b.left_delimiter: "\n" == d[d.length - 1] ? (d = d.substr(0, d.length - 1), c.push(d), c.cr()) : c.push(d); break; case b.left_equal: c.push("___ViewO.push((EJS.Scanner.to_text(" + d + ")))") }b.stag = null; d = ""; break; case b.double_right: d +=
b.right_delimiter; break; default: d += a
}
}); 0 < d.length && c.push('___ViewO.push("' + p(d) + '")'); c.close(); this.out = c.script + ";"; b = "/*" + b + "*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {" + this.out + " return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};"; try { eval(b) } catch (A) {
if ("undefined" != typeof JSLINT) {
JSLINT(this.out); for (var n = 0; n < JSLINT.errors.length; n++)if (b = JSLINT.errors[n], "Unnecessary semicolon." != b.reason) throw b.line++, n = Error(), n.lineNumber = b.line,
n.message = b.reason, a.view && (n.fileName = a.view), n;
} else throw A;
}
}
}; EJS.config = function (a) { EJS.cache = null != a.cache ? a.cache : EJS.cache; EJS.type = null != a.type ? a.type : EJS.type; EJS.ext = null != a.ext ? a.ext : EJS.ext; var b = EJS.templates_directory || {}; EJS.templates_directory = b; EJS.get = function (a, c) { return 0 == c ? null : b[a] ? b[a] : null }; EJS.update = function (a, c) { null != a && (b[a] = c) }; EJS.INVALID_PATH = -1 }; EJS.config({ cache: !0, type: "<", ext: ".ejs" }); EJS.Helpers = function (a, d) { this._data = a; this._extras = d; b(this, d) }; EJS.Helpers.prototype =
{ view: function (a, b, f) { f || (f = this._extras); b || (b = this._data); return (new EJS(a)).render(b, f) }, to_text: function (a, b) { return null == a || void 0 === a ? b || "" : a instanceof Date ? a.toDateString() : a.toString ? a.toString().replace(/\n/g, "<br />").replace(/''/g, "'") : "" } }; EJS.newRequest = function () { for (var a = [function () { return new ActiveXObject("Msxml2.XMLHTTP") }, function () { return new XMLHttpRequest }, function () { return new ActiveXObject("Microsoft.XMLHTTP") }], b = 0; b < a.length; b++)try { var f = a[b](); if (null != f) return f } catch (q) { } };
EJS.request = function (a) { var b = new EJS.newRequest; b.open("GET", a, !1); try { b.send(null) } catch (f) { return null } return 404 == b.status || 2 == b.status || 0 == b.status && "" == b.responseText ? null : b.responseText }; EJS.ajax_request = function (a) { a.method = a.method ? a.method : "GET"; var b = new EJS.newRequest; b.onreadystatechange = function () { if (4 == b.readyState) a.onComplete(b) }; b.open(a.method, a.url); b.send(null) }
})(); if (!wood) var wood = {};
if (!Wood) {
var Wood = { Model: {}, Modules: { Client: {}, Controller: { Base: {}, Login: {} } }, Controller: {}, Collection: {}, View: { Common: {}, Nfc: {}, Title: {}, Ranking: {}, Aoc: { Check: {}, List: {} } }, UrlPrefix: {}, Debug: {}, Test: {} }, wood_client = {}; Wood.isWiiU = "undefined" !== typeof wiiuSystemSetting; var NINJA_BASE = "https://ninja.wup.shop.nintendo.net/ninja/", SAMURAI_ORIGINBASE = "https://samurai.wup.shop.nintendo.net/samurai/"; Wood.getHostName = function () { return location.hostname }; Wood.setupUrlPrefix = function () {
Wood.UrlPrefix.NINJA = NINJA_BASE;
Wood.UrlPrefix.SAMURAI_ORIGIN = SAMURAI_ORIGINBASE; var a = Wood.getHostName(); 0 <= a.indexOf("geisha") ? Wood.UrlPrefix.SAMURAI = "https://" + a.replace("geisha", "samurai") + "/samurai/" : Wood.UrlPrefix.SAMURAI = SAMURAI_ORIGINBASE; if (!Wood.isWiiU) { if (a = localStorage.getItem("samurai_base")) Wood.UrlPrefix.SAMURAI_ORIGIN = a, Wood.UrlPrefix.SAMURAI = a; if (a = localStorage.getItem("ninja_base")) Wood.UrlPrefix.NINJA = a }
}; Wood.setupUrlPrefix(); Wood.isSWLoaded = function () { return "StopWatch" in window }; Wood.hasSW = function () { if (Wood.isSWLoaded()) return !!wood.stop_watch };
Wood.initializeSW = function (a) { Wood.isSWLoaded() && (wood.stop_watch = new StopWatch(a), wood.stop_watch.start()) }; Wood.lap = function (a) { Wood.isSWLoaded() && (Wood.hasSW() || Wood.initializeSW("unknown"), wood.stop_watch.lap(a)) }; Wood.finalizeSW = function () { if (Wood.isSWLoaded()) { if (!Wood.hasSW()) throw "wood.stop_watch not initialized."; wood.stop_watch.finish(); wood.stop_watch.reportText().split("\n").forEach(function (a, b) { Wood.log(a) }); wood.stop_watch = null } }; Wood.log = function (a) {
if (Wood.isWiiU && "undefined" !== typeof wiiuDebug) for (; a;)wiiuDebug.print(a.substr(0,
200)), a = a.substr(200); else console.log(a)
}
} window.jQuery && jQuery.extend({ print: function (a) { "undefined" !== typeof wiiuDebug ? wiiuDebug.print(a) : "undefined" !== typeof console && console.log(a) } }); (function () {
Wood.Storage = function (a) { this.storage = a }; Wood.Storage.Types = { string: { encode: function (a) { return a ? "" + a : "" }, decode: function (a) { return a ? "" + a : a } }, number: { encode: function (a) { if (!_.isNumber(a)) throw a + " is not number"; return "" + a }, decode: function (a) { return parseInt(a, 10) } }, "boolean": { encode: function (a) { return a ? "true" : "false" }, decode: function (a) { return "true" === a } }, json: { encode: function (a) { return JSON.stringify(a) }, decode: function (a) { return JSON.parse(a) } } }; Wood.Storage.validateAccessorEntry =
function (a) { return _.isString(a.name) && _.isString(a.key) && _.include(_.keys(Wood.Storage.Types), a.type) ? !0 : !1 }; Wood.Storage.injectAccessors = function (a, b) {
_.each(b, function (b) {
if (!Wood.Storage.validateAccessorEntry(b)) throw "invalid accessor entry: " + JSON.stringify(b); var c = Wood.Storage.Types[b.type]; a["set" + b.name] = function (a) { this.storage.setItem(b.key, c.encode(a)) }; a["get" + b.name] = function () { return c.decode(this.storage.getItem(b.key)) }; a["remove" + b.name] = function () { this.storage.removeItem(b.key) };
"boolean" === b.type && (a["is" + b.name] = function () { return !!c.decode(this.storage.getItem(b.key)) }, a["has" + b.name] = function () { return !!this.storage.getItem(b.key) })
})
}; Wood.Storage.create = function (a) { if (!_.isArray(a.accessors)) throw "accessors not specified"; if (!a.storage) throw "storage not specified"; var b = new Wood.Storage(a.storage); _.isFunction(a.writer) && (b.storageWrite = a.writer); Wood.Storage.injectAccessors(b, a.accessors); return b }
})(); (function () { var a = [{ name: "LangSelectable", key: "_lang_selectable_v1", type: "boolean" }, { name: "WishlistLastModified", key: "_wish_modified_v1", type: "number" }, { name: "MovieType", key: "movie_type", type: "string" }]; Wood.LocalStorage = { getRawInstance: function () { return "undefined" !== typeof wiiuSystemSetting ? wiiuLocalStorage : window.localStorage }, build: function (b) { return Wood.Storage.create({ storage: b, accessors: a }) } } })(); (function () { var a = []; Wood.SessionStorage = { getRawInstance: function () { return "undefined" !== typeof wiiuSystemSetting ? wiiuSessionStorage : window.sessionStorage }, build: function (b) { return Wood.Storage.create({ storage: b, accessors: a }) } } })(); (function () {
Wood.Util = {
each: function (a, b) { if (void 0 !== a && null !== a) if ("array" === $.type(a) || "object" === $.type(a)) if ("object" === $.type(a) && isNaN(parseInt(Object.keys(a), 10))) b(0, a); else for (var c in a) a.hasOwnProperty(c) && b(c, a[c]); else b(0, a) }, arrayDiff: function (a, b) { if (!a || !b) return !1; var c = []; a.forEach(function (a) { 0 > $.inArray(a, b) && c.push(a) }); b.forEach(function (b) { 0 > $.inArray(b, a) && c.push(b) }); return c }, isUndefined: function (a) { return void 0 === a || null === a }, isDefined: function (a) {
return void 0 !== a &&
null !== a
}, encodeValues: function (a) { var b = a.split("?"); a = b[0]; b = b[1]; if (!b) return a; var c = []; $.each(b.split("&"), function (a, b) { a = b.split("="); c.push(a[0] + "=" + encodeURIComponent(a[1])) }); return a + "?" + c.join("&") }, convertSecondToFormat: function (a) { var b = []; b[0] = Math.floor(a / 3600); b[1] = Math.floor(a / 60 % 60); 10 > b[1] && (b[1] = "0" + b[1]); b[2] = a % 60; 10 > b[2] && (b[2] = "0" + b[2]); return b.join(":") }, createPromise: function (a) { var b = jQuery.Deferred(); _.defer(function () { a(b) }); return b.promise() }, isWupNsuid: function (a) {
return a ?
"5" === a.toString().charAt(0) ? !1 : !0 : !0
}, createPlaceHolderUrl: function (a) { return "image/placeholder/place_icon_" + (Wood.Util.isWupNsuid(a) ? "wii_u" : "3ds") + ".png" }, createIconClass: function (a) { return "p-icon-" + (Wood.Util.isWupNsuid(a) ? "wup-M" : "ctr-M") }, formatTime: function (a) { var b = []; a = parseInt(a, 10); b[0] = Math.floor(a / 3600); b[1] = Math.floor(a / 60 % 60); 10 > b[1] && (b[1] = "0" + b[1]); b[2] = a % 60; 10 > b[2] && (b[2] = "0" + b[2]); return b.join(":") }
}
})(); (function () {
Wood.DomUtil = {
hookLabelSoundEffectEvent: function (a) { a.find('.se:not([data-sound-assigned="true"])').each(function () { var a = $(this).data("se-label"); $(this).on("click", function () { wood.client.playSound(a); return !0 }).on("touchstart", function () { wood.client.playSound("SE_WAVE_DRC_TOUCH_TRG"); return !0 }).attr("data-sound-assigned", !0) }) }, hookSoundEffectEvent: function (a) {
this.hookLabelSoundEffectEvent(a); $([['input[type="submit"]', "touchstart", ["SE_WAVE_DRC_TOUCH_TRG"]], ['input[type="submit"]',
"click", ["SE_WAVE_OK"]], ['input[type="reset"]', "touchstart", ["SE_WAVE_DRC_TOUCH_TRG"]], ['input[type="reset"]', "click", ["SE_WAVE_RESET"]], ['input[type="checkbox"]', "click", ["SE_WAVE_CHECKBOX_CHECK", "SE_WAVE_CHECKBOX_UNCHECK"]], ['input[type="radio"]', "click", ["SE_WAVE_DRC_TOUCH_TRG", "SE_WAVE_RADIOBUTTON_CHECK"]]]).each(function () {
var b = this[1], c = this[2]; a.find(this[0]).each(function () {
var a = $(this); a.data("sound-assigned") || a.on(b, function () {
if ("checkbox" === a.attr("type")) {
var b = a.prop("checked") ? 0 :
1; wood.client.playSound(c[b])
} else c.forEach(function (a) { wood.client.playSound(a) })
}).attr("data-sound-assigned", !0)
})
})
}, applyLocalizedText: function (a, b) { $("entry", b).each(function () { var b = '[data-message="' + $(this).attr("key") + '"]'; $(b, a).html($(this).text()) }) }, localizeText: function (a) { a = a || this.$el; a.find("[data-message]").each(function () { var a = $(this); a.html(wood.client.getText(a.attr("data-message"))) }) }, showBody: function () { $("body").removeClass("display_cover") }, hideBody: function () { $("body").addClass("display_cover") },
createSizeHTML: function (a, b, c) { var d = null; a = this.getSizeWithUnit(a); a.size = this.replaceRadixPoint(a.size, b, c); switch (a.unit) { case "GB": d = $("#str_gb").html(); break; case "MB": d = $("#str_mb").html(); break; case "KB": d = $("#str_kb").html() }return a.size + " " + d }, getSizeWithUnit: function (a) {
var b = parseInt(a, 10); 10239948 >= b ? (b = Math.floor(b / 10.24), a = "KB", 100 > b && (b = 100)) : 10485707571 >= b ? (b = Math.floor(b / 10485.76), a = "MB") : (b = Math.floor(b / 1.073741824E7), a = "GB"); b += 5; 999999 < b && (b = 999999); b /= 10; b = Math.floor(b / 10) + "." +
Math.floor(b % 10); return { size: b, unit: a }
}, replaceRadixPoint: function (a, b, c) { a = a.toString(); _.contains(["JP_ja", "US_en", "US_es", "EU_en", "EU_pt"], { JPN: "JP_", USA: "US_", EUR: "EU_", AUS: "EU_" }[c] + b) || (a = a.replace(".", ",")); return a }, applyTextOverflow: function (a) { var b = a.html(), c = a.clone(); c.css({ display: "none", position: "absolute", overflow: "visible", width: a.width(), height: "auto" }); for (a.after(c); 0 < b.length && c.height() > a.height();)b = b.substr(0, b.length - 1), c.html(b + "..."); a.html(c.html()); c.remove() }, formatDate: function (a) {
a =
a.split("-"); return 3 === a.length ? $("#str_release_ymd").html().replace("%{yyyy}", a[0]).replace("%{mm}", a[1]).replace("%{dd}", a[2]) : 2 === a.length ? $("#str_release_ym").html().replace("%{yyyy}", a[0]).replace("%{mm}", a[1]) : $("#str_release_y").html().replace("%{yyyy}", a[0])
}, animateToTop: function (a) { a ? $("html,body").animate({ scrollTop: a }, 0) : $("html,body").animate({ scrollTop: $("html,body").offset().top }, 0) }, lazyload: function (a) {
$(a).on("error", function () {
void 0 !== $(this).data("placeholder") && $(this).attr("src",
$(this).data("placeholder"))
}); $(a).each(function () { if (void 0 === $(this).data("loaded") || "placeholder" === $(this).data("loaded")) { var a = this; setTimeout(function () { var b = $(a).attr("src"), d = "placeholder"; void 0 !== $(a).data("original") && "" !== $(a).data("original") && (d = $(a).data("original"), $(a).attr("src", d), $(a).data("placeholder", b)); $(a).data("loaded", d) }, 0) } })
}, getTaxTextWithPriceObject: function (a) { var b = a.getAmount(); return a.isFree() ? b : this.getTaxText(b) }, getTaxText: function (a) {
var b = a, c; if (c = a) a =
(a = (a || "").match(/\d/g)) ? !/[1-9]/.test(a.join("")) : !1, c = !a; c && wood.client.isTaxIncludedMessageRequired() && (b = "AU" === wood.client.country ? b + (" " + $("#str_tax_included_au").html()) : b + (" " + $("#str_tax_included").html())); return b
}
}
})(); (function () { Wood.ErrorCode = { WISHLIST_FULL: 1073190, CLOSE_APPLICATION: 1119E3, RETRIABLE: 1119001, UNDER_MAINTENANCE: 1119002, SERVICE_FINISHED: 1119003, INVALID_TEMPLATE: 1119100, FOR_BROWSER_LOCKED: 1990503 } })(); (function () { Wood.ErrorViewer = { show: function (a, b) { Wood.log("[Wood.ErrorViewer] errorCode:" + a); Wood.log("[Wood.ErrorViewer] errorMessage:" + b); Wood.isWiiU ? (a = "string" === typeof a ? parseInt(a, 10) : a, Wood.Analytics.sendError(a), b ? wiiuErrorViewer.openByCodeAndMessage(a, b) : wiiuErrorViewer.openByCode(a)) : (Wood.Analytics.sendError(a), b ? Wood.ErrorViewer.showAlert(a + "\n\n" + b) : Wood.ErrorViewer.showAlert(a)) }, showAlert: function (a) { window.alert(a) } } })(); (function () {
Wood.SystemConfig = { PREFIX_SAMURAI: 110, PREFIX_NINJA: 107, PREFIX_CCIF: 126, PREFIX_OTHER: 111, ERROR_CODE_CLOSE_APPLICATION: 1119E3, ERROR_CODE_RETRIABLE: 1119001, ERROR_CODE_UNDER_MAINTENANCE: 1119002, ERROR_CODE_SERVICE_FINISHED: 1119003, ERROR_CODE_BROWSWER_LOCKED: 1990503, EXCLUSION_PLATFORM_IDS: "20,21,22,23,24,25,26,43,63,83", SESSION_UPDATE_INTERVAL: 36E5 }; Wood.SystemConfig.getExclusionPlatformIds = function () {
return _.map(Wood.SystemConfig.EXCLUSION_PLATFORM_IDS.split(","), function (a) {
return parseInt(a,
10)
})
}
})(); (function () {
var a = Wood.Error = function (a, b, c, d) { this.type = b; this.displayable = a; this.dialog_type = c; this.handler = d }; a.Type = { GENERIC: 1, SPECIFIC: 2 }; a.DialogType = { CONFIRM: 1, ALERT: 2 }; var b = function () { location.href = "index.html#top"; throw Error("error top_redirector stopper"); }, c = new a(!0, a.Type.GENERIC, a.DialogType.ALERT), d = new a(!0, a.Type.GENERIC, a.DialogType.ALERT, b), f = new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT), q = new a(!1, a.Type.SPECIFIC, a.DialogType.ALERT), p = {
3011: c, 3021: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT,
b), 3025: f, 3026: f, 3027: f, 3028: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3051: d, 3052: d, 3053: d, 3054: d, 3055: d, 3056: d, 3057: d, 3058: d, 3100: f, 3101: f, 3102: f, 3103: f, 3104: f, 3105: f, 3106: f, 3107: f, 3108: f, 3109: f, 3110: f, 3111: f, 3112: f, 3113: f, 3114: f, 3115: f, 3116: f, 3117: f, 3118: f, 3120: f, 3121: q, 3122: q, 3123: new a(!1, a.Type.GENERIC, a.DialogType.ALERT), 3124: new a(!1, a.Type.SPECIFIC, a.DialogType.CONFIRM), 3125: c, 3150: d, 3151: d, 3152: f, 3153: f, 3154: q, 3155: q, 3160: q, 3161: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3162: q,
3170: c, 3171: q, 3180: c, 3190: new a(!1, a.Type.SPECIFIC, a.DialogType.CONFIRM), 3191: d, 3200: new a(!1, a.Type.GENERIC, a.DialogType.ALERT), 3210: f, 3230: f, 3231: f, 3232: f, 3233: f, 3234: f, 3235: q, 3236: q, 3237: f, 3238: f, 3239: f, 3240: f, 3241: q, 3242: f, 3243: f, 3250: f, 3251: f, 3252: f, 3260: f, 3261: f, 3262: f, 3263: f, 3264: f, 3265: f, 3266: f, 3267: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3268: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3271: f, 3278: f, 3279: f, 3301: new a(!1, a.Type.SPECIFIC, a.DialogType.ALERT, b), 5997: d, 6542: f, 6561: f,
6568: f, 6591: c, 6635: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 6644: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 6804: f, 6805: f, 6810: c, 6811: f, 6812: f, 6813: f, 6814: c, 6815: f, 6830: c, 6831: c, 6834: f, 6835: f, 6836: f, 6837: f, 6838: f, 6941: f, 6942: f, 6943: f, 6989: f, 7401: f, 7402: c, 7403: f, 7499: f, 7501: f, 7503: f, 7506: c, 7507: f, 7509: d, 7510: d, 7511: f, 7514: f, 7515: c, 7516: f, 7519: f, 7530: q, 7532: c, 7534: c, 7535: d, 7536: f, 7537: c, 9001: f, 9003: f, 9006: c, 9007: f, 9009: d, 9010: d, 9011: f, 9014: f, 9015: c, 9019: f, 9030: f, 9032: c, 9034: c, 9035: d, 9036: f,
9037: c, 9600: c, 9601: c, 9610: c, 9611: c, 9612: c, 9613: c, 9614: c, 9615: c, 9620: c, 9621: c, 9630: c, 9631: c, 9632: c, 9640: c, 9641: c, 9642: c
}; a.dispatch = function (a) { return p[a] }; a.Result = { ERROR_NOT_PROCESSED: 0, ERROR_MESSAGE_SHOWN: 1 }
})(); (function () { Wood.KeyMap = { BUTTON_A: 13, BUTTON_B: 27, BUTTON_X: 88, BUTTON_Y: 89, BUTTON_L: 76, BUTTON_R: 82, BUTTON_PLUS: 80, BUTTON_MINUS: 77 } })(); (function () { function a(a, c) { return function (b) { if (b.keyCode === a) return c.call(b, b) } } Wood.KeyEvent = { A: function (b) { return a(Wood.KeyMap.BUTTON_A, b) }, B: function (b) { return a(Wood.KeyMap.BUTTON_B, b) }, X: function (b) { return a(Wood.KeyMap.BUTTON_X, b) }, Y: function (b) { return a(Wood.KeyMap.BUTTON_Y, b) }, L: function (b) { return a(Wood.KeyMap.BUTTON_L, b) }, R: function (b) { return a(Wood.KeyMap.BUTTON_R, b) }, PLUS: function (b) { return a(Wood.KeyMap.BUTTON_PLUS, b) }, MINUS: function (b) { return a(Wood.KeyMap.BUTTON_MINUS, b) } } })(); (function () {
Wood.Request = function (a) { this.location = a; this._param = this.parseParam() }; Wood.Request.prototype = {
param: function (a) { return this._param[a] }, params: function () { return this._param }, getPathname: function () { return this.location.pathname }, getHash: function () { return this.location.hash }, getSearch: function () { return this.location.search }, getFilename: function () { return this.location.pathname.replace(/.*\//, "") }, isAppJump: function () { return "appJump" === this.param("seq") }, isFromPurchaseComplete: function () {
return "privJump" ===
this.param("seq")
}, parseParam: function () { var a = {}, b = (this.location || location).href.split("?"); if (1 < b.length) { b = b[b.length - 1].split("&"); for (var c = 0, d = b.length; c < d; c++) { var f = b[c].split("="); a[decodeURIComponent(f[0])] = decodeURIComponent(f[1]) } } else return !1; return a }
}
})(); (function () {
Wood.StarRating = function (a, b) { this.number = a; this.path_prefix = b ? b : "image/shelf01_01/img_relating_" }; Wood.StarRating.prototype = {
getNumber: function () { return this.number }, getImagePath: function () {
var a = this.number; return 4.75 <= a ? this.path_prefix + "05.png" : 4.25 <= a ? this.path_prefix + "04h.png" : 3.75 <= a ? this.path_prefix + "04.png" : 3.25 <= a ? this.path_prefix + "03h.png" : 2.75 <= a ? this.path_prefix + "03.png" : 2.25 <= a ? this.path_prefix + "02h.png" : 1.75 <= a ? this.path_prefix + "02.png" : 1.25 <= a ? this.path_prefix + "01h.png" :
this.path_prefix + "01.png"
}
}; Wood.StarRating.PathPrefix = { DATA01_SMALL: "image/data01_01/img_data01_01_evaluation_small_", DATA01_LARGE: "image/data01_01/img_data01_01_evaluation_large_" }; Wood.StarRating.NO_RATING_IMAGE_PATH = "image/shelf01_01/img_relating_00.png"
})(); (function () {
Wood.URL = function (a, b, c) { this.base_url = a; this.setQueryStrings(b); this.fragment = c }; Wood.URL.create = function (a, b, c) { return (new Wood.URL(a, b, c)).toString() }; Wood.URL.prototype = {
setQueryString: function (a, b) { this.query_strings[a] = b }, setQueryStrings: function (a) { this.query_strings = a || {} }, addQuery: function (a) { $.extend(this.query_strings, a) }, toString: function () {
return this.base_url + ($.isEmptyObject(this.query_strings) ? "" : "?") + $.map(this.query_strings, function (a, b) {
return encodeURIComponent(b) +
"=" + encodeURIComponent(a)
}).join("&") + (this.fragment ? "#" + this.fragment : "")
}
}
})(); (function () {
Wood.UserAgent = function (a) { this.user_agent_string = "string" === typeof a ? a : navigator.userAgent }; Wood.UserAgent.LATEST_VERSION = "1.5"; Wood.UserAgent.parseUserAgentString = function (a) { return new Wood.UserAgent(a) }; Wood.UserAgent.prototype = {
getWoodVersion: function () { var a = this.user_agent_string.match(/wood\/([\d\.]+)\.[^\d]/); return null !== a && 2 === a.length ? a[1] : 0 }, isWood: function () { return /wood\//.test(this.user_agent_string) }, isLatestVersion: function () { return this.getWoodVersion() === Wood.UserAgent.LATEST_VERSION },
isLatestVersionOrLater: function () { var a = parseFloat(this.getWoodVersion()), b = parseFloat(Wood.UserAgent.LATEST_VERSION); return a >= b }, toString: function () { return this.user_agent_string }
}
})(); (function () {
var a = { PARTNER: [0, 4], RESERVED: [4, 2], CATEGORY: [6, 2], PLATFORM: [8, 1], UNIQUE: [9, 5], VARIATION: [14, 2] }; Wood.TitleId = function (a) { this.title_id = a; this.id = this.getStructuredId(a) }; Wood.TitleId.prototype = {
getStructuredId: function (b) { if (!_.isString(b) || 16 !== b.length) throw Error("\u30bf\u30a4\u30c8\u30ebID\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093: " + b); var c = {}; _.each(a, function (a, f) { c[f.toLowerCase()] = b.substr(a[0], a[1]) }); return c }, getPartnerID: function () { return this.id.partner }, getCategoryID: function () { return this.id.category },
getPlatformID: function () { return this.id.platform }, getUniqueID: function () { return this.id.unique }, getVariation: function () { return this.id.variation }, getUniqueTitleName: function () { var a = this.id; return a.partner + a.reserved + a.category + a.platform + a.unique }, isSameTitleAs: function (a) { a = a instanceof Wood.TitleId ? a : new Wood.TitleId(a); return this.getUniqueTitleName() === a.getUniqueTitleName() }
}
})(); (function () {
Wood.Pagenation = function (a, b, c) { this.total_count = a; this.per_page = b; this.current_page = c }; Wood.Pagenation.prototype = {
getTotalCount: function () { return this.total_count }, setTotalCount: function (a) { this.total_count = a }, getPerPage: function () { return this.per_page }, getCurrentPage: function () { return this.current_page }, getOffset: function () { return (this.current_page - 1) * this.per_page }, setCurrentPage: function (a) { this.current_page = a }, getTotalPage: function () {
var a = this.getTotalCount(), b = this.getPerPage(),
c = parseInt(a / b, 10); 0 < a - b * c && c++; return c
}, getNextPage: function () { return this.getTotalPage() > this.getCurrentPage() ? this.getCurrentPage() + 1 : null }, getPrevPage: function () { return 1 === this.getTotalPage() || 1 === this.getCurrentPage() ? null : this.getCurrentPage() - 1 }, getSlicedIndexes: function () { if (0 === this.getTotalCount()) return []; var a = [], b = (this.getCurrentPage() - 1) * this.getPerPage(), c = b + this.getPerPage() - 1, d = this.getTotalCount() - 1; for (c > d && (c = d); b <= c; b++)a.push(b); return a }, getNaviPages: function () {
var a = this.getTotalPage(),
b = 5 > a ? a : 5, c = Math.floor(b / 2), d = this.getCurrentPage(), f = d - c; c = d + c; 7 === a ? (f = 1, c = 7) : (0 >= f && (f = 1, c = b), c > a && (c = a, f = a - b + 1), 4 > d && 6 <= a && c++, d > a - 3 && 6 <= a && f--); return _.range(f, c + 1)
}
}
})(); (function () {
Wood.Price = function (a, b, c, d, f, q) { this.id = parseInt(a, 10); this.raw_value = parseFloat(b, 10); this.amount = c; this.currency = d; this.discount_type = f; this.description = q; this.raw_value_text = b }; Wood.Price.DiscountType = { NONE: 1, NORMAL: 2, CONDITIONAL: 3, COUPON: 4 }; Wood.Price.prototype = {
getId: function () { return this.id }, getRawValue: function () { return this.raw_value }, getRawValueText: function () { return this.raw_value_text }, getAmount: function () { return this.amount }, getCurrency: function () { return this.currency }, getDiscountType: function () { return this.discount_type },
getDescription: function () { return this.description && "" !== this.description ? this.description : null }, isNotAtDiscount: function () { return this.discount_type === Wood.Price.DiscountType.NONE }, isAtNormalDiscount: function () { return this.discount_type === Wood.Price.DiscountType.NORMAL }, isAtConditionalDiscount: function () { return this.discount_type === Wood.Price.DiscountType.CONDITIONAL }, isAtCouponDiscount: function () { return this.discount_type === Wood.Price.DiscountType.COUPON }, isFree: function () { return 0 === this.raw_value }
};
_.defaults(Wood.Price, {
getDecimalPoint: function (a) { return 0 <= a.indexOf(".") ? a.length - 1 - a.indexOf(".") : 0 }, getPaddingInt: function (a, b) { a = a.replace(".", ""); for (var c = 0; c < b; c++)a += "0"; return parseInt(a, 10) }, addDot: function (a, b) { var c = this.priceAbs(a), d = c; if (0 < b) if (c.length <= b) { d = "0."; for (var f = 0; f < b - c.length; f++)d += "0"; d += c } else b = c.length - b, d = c.substring(0, b) + "." + c.substring(b); this.isNegative(a) && (d = "-" + d); return d }, isPositive: function (a) { return null !== a && null !== a.match(/^[0-9]+[\.]?[0-9]*$/) ? !0 : !1 },
isNegative: function (a) { return null === a || null === a.match(/^-[0-9]+[\.]?[0-9]*$/) || this.isZero(a) ? !1 : !0 }, isZero: function (a) { return null !== a ? null !== a.match(/^[\-]?[0]+[\.]?[0]*$/) : !1 }, priceAbs: function (a) { return this.isZero(a) ? a : this.isPositive(a) ? a : this.isNegative(a) ? a.slice(1) : null }, priceAdd: function (a, b) {
var c = this.priceAbs(a), d = this.priceAbs(b); if (null === c || null === d) return null; a = this.isNegative(a); var f = this.isNegative(b), q = this.getDecimalPoint(c), p = this.getDecimalPoint(d); b = Math.max(q, p); c = this.getPaddingInt(c.replace(".",
""), b - q); d = this.getPaddingInt(d.replace(".", ""), b - p); d = String((a ? -1 : 1) * c + (f ? -1 : 1) * d); return d = this.addDot(d, b)
}, priceSub: function (a, b) { var c; this.isNegative(b) ? c = b.slice(1) : this.isPositive(b) && (c = "-" + b); return void 0 !== c ? this.priceAdd(a, c) : null }
})
})(); (function () {
Wood.Rating = function (a, b) { this.system_id = parseInt(a, 10); this.rating_age = parseInt(b, 10) }; Wood.Rating.ActionType = { DEFAULT: 1, PURCHACE: 2, REDOWNLOAD: 3, REDEEM: 4 }; Wood.Rating.System = { CERO: 201, ESRB: 202, COB: 208, IARC_OFLC_AGCB: 308, OFLC_NZ: 209, IARC_OFLC_NZ: 309 }; Wood.Rating.prototype = {
isDisplayAllowed: function (a, b, c) {
if (Wood.Util.isUndefined(this.rating_age)) return !0; var d = this.system_id === Wood.Rating.System.COB || this.system_id === Wood.Rating.System.IARC_OFLC_AGCB, f = this.system_id === Wood.Rating.System.OFLC_NZ ||
this.system_id === Wood.Rating.System.IARC_OFLC_NZ; if (this.requiresAgeFilter(a, b)) { if (this.system_id === Wood.Rating.System.CERO && 18 === this.rating_age || this.system_id === Wood.Rating.System.ESRB && 17 === this.rating_age || this.system_id === Wood.Rating.System.ESRB && 18 === this.rating_age || d && 18 === this.rating_age) return c >= this.rating_age; if (f && 15 === this.rating_age) return 18 <= c } return !0
}, requiresAgeFilter: function (a, b) {
var c = !1; switch (a) {
case Wood.Rating.ActionType.DEFAULT: c = _.contains(["JPN", "AUS", "USA"], b); break;
case Wood.Rating.ActionType.PURCHACE: c = "USA" !== b && _.contains(["JPN", "AUS"], b); break; case Wood.Rating.ActionType.REDOWNLOAD: case Wood.Rating.ActionType.REDEEM: c = !_.contains(["JPN", "USA"], b) && "AUS" === b
}return c
}
}
})(); (function () {
_.templateSettings = { interpolate: /\{\{=(.+?)\}\}/g, evaluate: /\{\{(.+?)\}\}/g, escape: /\{\{-(.+?)\}\}/g }; Wood.Template = function () {
function a(a) { function b() { if (wood.client && wood.client.showError) { wood.client.showError(Wood.ErrorCode.INVALID_TEMPLATE); if (wood.client.errorShutdown) wood.client.errorShutdown() } else { Wood.log("<Wood.Template> fallback without client") } } try { var c = new EJS({ url: "template/" + a + ".html", ext: ".html" }) } catch (p) { Wood.log("<Wood.Template> load failed. :" + p.message), b() } if (!c || !c.text || !/<script/i.test(c.text)) { Wood.log("<Wood.Template> invalid"), b(); return "" } return c.text } function b(a) {
a = Wood.LocalStorage.getRawInstance().getItem(a);
return JSON.parse(a)
} function c(c, f) { var d = b("tmpl_" + c); (d = _.isObject(d) ? d.template : null) || (d = a(c)); return f && (c = $(d).filter(f), d = c.text(), /jquery/.test(c.attr("type"))) ? c : _.template(d) } return {
get: function (a, b) { var d = c(a, b); return function (a) { return _.isFunction(d) ? d(a) : d.tmpl(a) } }, set: function (c, f) {
var d = "tmpl_" + c; f = f ? f.toString() : "1"; var p = b(d); if (!_.isObject(p) || p.version !== f || !/^<script/.test(p.template)) if (c = a(c)) f = { version: f, template: c }, wood.client.getLocalStorage().setItem(d, JSON.stringify(f)),
wood.client.setFSFlushRequired()
}
}
}(); Wood.Template.Version = { MYMENU: 10.5, SHELF: 2.4, TITLE: 2.6, COMMON: 1.1, REDEEM: 1.3, NEWS: 1.1 }
})(); (function () {
Wood.Modules.Client.ErrorHandler = function () { this.reload_at_ajax_incomplete = this.ajax_aborted = this.shutdown_on_ajax_failure = !1 }; Wood.Modules.Client.ErrorHandler.prototype = {
setReloadAtAjaxIncomplete: function () { this.reload_at_ajax_incomplete = !0 }, _handleIncompleteError: function (a, b) {
Wood.log("[handleAjaxError] before complete error: readyState=" + a.readyState + " url=" + b.url() + " text=" + a.responseText + " statusText=" + a.statusText); if (this.shutdown_on_ajax_failure) Wood.log("[handleAjaxError] shutdown_on_ajax_failure"),
this.showError(Wood.ErrorCode.CLOSE_APPLICATION), this.errorShutdown(); else throw this.ajax_aborted || this.showError(Wood.ErrorCode.RETRIABLE), this.isWiiU() && (this.enableHomeButton(), this.disableUserOperation()), Wood.log("[handleAjaxError] redirect to top"), this.ajax_aborted = !0, a.abort(), this.isFirstBoot() ? (Wood.log("[handleAjaxError] first boot error"), this.showError(Wood.ErrorCode.CLOSE_APPLICATION), this.errorShutdown()) : this.reload_at_ajax_incomplete ? (Wood.log("[handleAjaxError] reload"), this.enableUserOperation(),
_.delay(function () { location.reload() }, 3E3)) : (Wood.log("[handleAjaxError] redirectToTop"), _.defer(_.bind(this.redirectToTop, this))), Wood.log("[handleAjaxError] stopper exception thorown"), Error("Exception to stop the script in this page.");
}, _handleCompleteError: function (a, b) {
if (!Wood.Util.isUndefined(a.responseText)) {
var c = a.responseText ? JSON.parse(a.responseText) : null; if (Wood.Util.isUndefined(c) || Wood.Util.isUndefined(c.error)) Wood.log("cannot handle error: url=" + b.url() + " statusText=" + a.statusText +
" text=" + a.responseText); else return this.enableUserOperation(), this.enableHomeButton(), this.showErrorDialog(b.getErrorPrefix(), c.error.code, c.error.message)
}
}, handleAjaxError: function (a, b) {
Wood.log("handleAjaxError(new) called:"); Wood.log(" - xhr.readyState: " + a.readyState); Wood.log(" - xhr.statusText: " + a.statusText); Wood.log(" - model.url(): " + b.url()); Wood.log(" - model.attributes: " + JSON.stringify(b.attributes)); this.endStartUp(); this.hideLoadingIcon(); this.stopNfcSound(); if (0 === a.readyState &&
"abort" === a.statusText) Wood.log("request was aborted by user: url=" + b.url() + " statusText=" + a.statusText); else { if (4 > a.readyState) return this._handleIncompleteError(a, b); if (503 === a.status) this.showError(Wood.ErrorCode.UNDER_MAINTENANCE), this.errorShutdown(); else return this._handleCompleteError(a, b) }
}, _showErrorMessage: function (a, b, c) { "" !== c && void 0 !== c ? this.showError(a + b, c) : this.showError(a + b) }, _performCallback: function (a, b) { if (void 0 !== b) return b(Wood.Error.Result.ERROR_MESSAGE_SHOWN); if (a.handler) return a.handler.call(Wood.Error.Result.ERROR_MESSAGE_SHOWN) },
_showDefinedError: function (a, b, c, d, f) {
if (b.dialog_type === Wood.Error.CONFIRM) return f(Wood.Error.Result.ERROR_NOT_PROCESSED); if (b.displayable) { if ("" !== c && void 0 !== c) return this._showErrorMessage(a, c, d), this._performCallback(b, f); Wood.log("[ERROR] error code is not defined."); this.showError(Wood.ErrorCode.CLOSE_APPLICATION); this.isWiiU() && this.errorShutdown() } else if ("" !== d && void 0 !== d) { if (void 0 !== f) return f(Wood.Error.Result.ERROR_NOT_PROCESSED); if (b.handler) return b.handler.call() } else Wood.log("[ERROR] error message is not defined."),
this.showError(Wood.ErrorCode.CLOSE_APPLICATION), this.isWiiU() && this.errorShutdown()
}, _showInvalidSessionError: function (a, b, c) { c = $("#dialog_msg_invalid_session").text(); "" !== c ? this.showError(a + b, c) : this.showError(Wood.ErrorCode.RETRIABLE) }, showErrorDialog: function (a, b, c, d) {
Wood.log("[showErrorDialog] prefix=" + a + ", code=" + b + ", msg=" + c); a = Wood.Util.isDefined(a) ? a : Wood.SystemConfig.PREFIX_OTHER; Wood.Util.isDefined(b) && 7 === b.length && (a = ""); var f = Wood.Error.dispatch(b); if (f) return this._showDefinedError(a,
f, b, c, d); Wood.log("[ERROR] error code is not defined.(error code not display)"); "3010" === b ? this._showInvalidSessionError(a, b, c) : "" !== b && void 0 !== b && "" !== c && void 0 !== c ? this.showError(a + b, c) : "" !== b && void 0 !== b && a !== Wood.SystemConfig.PREFIX_SAMURAI && a !== Wood.SystemConfig.PREFIX_NINJA ? this.showError(a + b) : this.showError(Wood.ErrorCode.CLOSE_APPLICATION); this.isWiiU() ? this.errorShutdown() : "3010" !== b && this.redirectToTop()
}, showError: function () { this.hideLoadingDialog(); Wood.ErrorViewer.show.apply(null, arguments) },
shutdownIfError: function (a) { if (void 0 !== a && this.isWiiU() && a.error) { var b = a.error.code; _.contains([1114701, 1114702], b) || (this.enableHomeButton(), this.enableUserOperation(), this.showError(a.error.code), _.contains([1050606, 1114640, 1114550, 1114641, 1114693], b) || (_.contains([1114692], b) ? this.historyBack() : this.errorShutdown())) } }
}
})(); (function () {
Wood.Modules.Client.PurchaseInfo = function () { }; Wood.Modules.Client.PurchaseInfo.prototype = {
setRedeemableCard: function (a) { this.getSessionStorage().setItem(Wood.Client.StorageKey.TEMP_REDEEMABLE_CARD, a.toJSON()) }, getRedeemableCard: function () { var a = this.getSessionStorage().getItem(Wood.Client.StorageKey.TEMP_REDEEMABLE_CARD); if (Wood.Util.isUndefined(a)) return null; var b = new Wood.Model.RedeemableCard; b.set(JSON.parse(a)); return b }, clearRedeemableCard: function () { this.getSessionStorage().removeItem(Wood.Client.StorageKey.TEMP_REDEEMABLE_CARD) },
setRedeemNumber: function (a, b) { var c = this.getSessionStorage(); c.setItem(Wood.Client.StorageKey.REDEEM_TITLE_ID, a); c.setItem(Wood.Client.StorageKey.REDEEM_NUMBER, b) }, initCardInfo: function () { var a = this.getSessionStorage(); _.each("addbal_cc addbal_cc_str ccard_registration cc_pass cc_type postal_code request_id application_id credit_card_update".split(" "), function (b) { a.removeItem(b) }) }, initPurchaseInfo: function () {
var a = this.getSessionStorage(), b = "aoc_name_ aoc_size_unit_ aoc_size_str_ aoc_free_flg_ aoc!_price_ aoc_price_str_ aoc_tax_str_ aoc_taxin_price_str_ aoc_redl_flg_ _nsig_aoc_taxin_price_".split(" ");
_.each("buying_title_id buying_type buying_section buying_coupon_instance_code buying_aoc buying_ticket buying_shortfall get_common_info get_title_info get_aoc_info get_ticket_info get_demo_info buying_seq_rating buying_seq_attention buying_seq_size buying_seq_balance buying_seq_purchase money_referrer addr_referrer title_name title_icon rating_flg rating_age rating_sys notes_flg title_size_unit title_size_str title_dl_media title_display_size_str title_release_date title_pre_order_flg title_in_app_purchase titile_owned_coupon_flg title_lowest_price title_display_size_unit title_free_flg size_over_flg title_dl_items title_redl_flg current_balance current_balance_str post_balance post_balance_str title_price_str title_discount_price_id title_regular_price_id title_tax title_tax_str title_taxin_price title_taxin_price_str pin_code_checked_money withdrawal_agreed auto_billing_contract_id auto_billing_title_id coupon_code".split(" "),
function (b) { a.removeItem(b) }); if (null !== a.getItem("aoc_id_list")) { var c = a.getItem("aoc_id_list").split(","); _.each(c, function (c) { _.each(b, function (b) { a.removeItem(b + c) }) }) } _.each("aoc_id_list aocs_free_flg aocs_dl_media aocs_total_size aocs_total_size_str aocs_total_size_unit aocs_price_str aocs_price_id aocs_tax aocs_tax_str aocs_taxin_price aocs_taxin_price_str aoc_dl_items aoc_same_variation_items aoc_update_flg aocs_all_redl_flg buying_aoc_id_list ticket_id ticket_name ticket_free_flg ticket_price_str ticket_price_id ticket_discount_price_id ticket_discount_price_id ticket_tax ticket_tax_str ticket_taxin_price ticket_taxin_price_str demo_id demo_name demo_icon demo_dl_items size_over_flg demo_dl_media demo_size_str demo_size_unit demo_display_size_str demo_display_size_unit aocs_discount_id".split(" "),
function (b) { a.removeItem(b) })
}
}
})(); (function () {
Wood.Modules.Client.Boot = function () { this.need_flush_fs = this.is_in_boot = !1 }; Wood.Modules.Client.Boot.prototype = {
endStartUp: function () { Wood.log("(wood.client) endStartUp(false)"); this.isWiiU() && wiiuBrowser.endStartUp && wiiuBrowser.endStartUp(!1) }, endStartUpWithBGM: function () { Wood.log("(wood.client) endStartUp(true)"); this.isWiiU() && wiiuBrowser.endStartUp && wiiuBrowser.endStartUp(!0) }, isInBoot: function () { return this.is_in_boot }, setInBoot: function () { this.is_in_boot = !0 }, finishBoot: function () {
this.is_in_boot =
!1
}, setFSFlushRequired: function () { this.need_flush_fs = !0 }, cancelFSFlush: function () { this.need_flush_fs = !1 }, isFSFlushRequired: function () { return this.need_flush_fs }, setNinjaSession: function (a) { this.getSessionStorage().setItem(Wood.Client.StorageKey.NINJA_SESSION, a.toJSON()) }, getNinjaSession: function () { var a = this.getSessionStorage().getItem(Wood.Client.StorageKey.NINJA_SESSION); if (!a) return null; var b = new Wood.Model.NinjaSession; b.loadJSON(a); return b }, canSetEShopInitialized: function () {
return this.isWiiU() &&
wiiuSystemSetting.setEShopInitialized
}, setEShopInitialized: function (a) { a = wiiuSystemSetting.setEShopInitialized(a); this.shutdownIfError(a) }, isFirstBoot: function () {
if (this.isWiiU() && wiiuSystemSetting.getEShopInitialized) { var a = wiiuSystemSetting.getEShopInitialized(); this.shutdownIfError(a); if (a.initialized) return Wood.log("(wood.client) isFirstBoot: res.initialized"), !1 } (a = "true" === this.getLocalStorage().getItem(Wood.Client.StorageKey.FIRST_BOOT)) && this.canSetEShopInitialized() && this.setEShopInitialized(!0);
return !a
}, finishFirstBoot: function () { this.canSetEShopInitialized() ? this.setEShopInitialized(!0) : (this.getLocalStorage().setItem(Wood.Client.StorageKey.FIRST_BOOT, "true"), this.writeLocalStorage()) }, updateParentalControls: function () {
var a = this.getNinjaSession().getParentalControl(), b = {}; _.each(a, function (a) { "WUP" === a.device && (b[a.type] = a.value) }); if (this.isWiiU()) {
a = this.getParentalControlForGamePlay(); var c = this.getParentalControlForEShop(); "AU" !== this.country && "NZ" !== this.country || "13" !== a.age || (a.age =
"14")
} else a = { isLocked: !1, age: "18" }, c = !0; a.age = parseInt(a.age, 10); b && b.game_rating_age === a.age && !!b.game_rating_lock === a.isLocked && !!b.shopping === c || (new Wood.Model.ParentalControlPut({ game_rating_lock: a.isLocked ? 1 : 0, game_rating_age: a.age, shopping: c ? 1 : 0 })).fetch()
}, redirectToStartPage: function (a) { a = Wood.StartPageDispatcher.dispatch(a); this.endStartUp(); this.redirectReplaceTo(a) }, redirectToInitialSequence: function (a) {
var b = new Wood.URL("initial_sequence.html", { country: this.country, language: this.language }),
c = $.url().param(); _.each(c, function (a, c) { b.setQueryString(c, a) }); a.isShopAccountInitialized() && b.setQueryString("shop_ac_init", 1); this.isFirstBoot() || b.setQueryString("lang_select_only", 1); this.redirectReplaceTo(b.toString())
}
}
})(); (function () {
Wood.Modules.Client.AOC = function () { this.data_titles = {}; this.installed_items = {}; this.owned_contents_cache = {} }; Wood.Modules.Client.AOC.prototype = {
getAocPurchaseStatus: function (a, b, c) {
var d = Wood.PurchaseStatus.STATUS, f = b.getContentIndexes(); if (c.isOnSale()) {
var q = this.getOwnedContents(a).getContentsByVariation(b.getVariation()); q = _.chain(q).map(function (a) { return a.content_indexes.content_index }).flatten().uniq().value(); q = _.filter(q, function (a) { return _.contains(f, a) }).length; a = q === f.length ?
this.hasDataTitle(a, b) ? d.PURCHASED : d.REDOWNLOADABLE : 0 < q ? b.allowedOverlap() ? c.isFree() ? d.DOWNLOADABLE : d.OK : d.DUPLICATED : c.isFree() ? d.DOWNLOADABLE : d.OK
} else a = d.INVALID; return new Wood.PurchaseStatus(a)
}, hasDataTitle: function (a, b) {
var c = this, d = b.getContentIndexes(); a = this.getDataTitleVersions(a).getVersions(); var f = []; _.each(a, function (a) { a = c.getAocInstalledItem(a.title_id); a.variation === b.getVariation() && f.push(a.content_index) }); f = _.chain(f).flatten().uniq().value(); return _.filter(f, function (a) {
return _.contains(d,
parseInt(a, 10))
}).length === d.length
}, getOwnedContents: function (a) { var b = this.owned_contents_cache[a]; b ? a = b : (a = new Wood.Model.OwnedContents({ title_id: a }), a.fetch({ async: !1 })); return a }, setOwnedContents: function (a, b) { this.owned_contents_cache[b] = a }, getDataTitleVersions: function (a) { var b = this.data_titles[a]; b || (b = new Wood.Model.DataTitleVersionList({ country: this.country, language: this.language, aoc_ns_uid: a }), b.fetch(), this.data_titles[a] = b); return b }, setDataTitleVersions: function (a, b) {
this.data_titles[b] =
a
}, getAocInstalledItem: function (a) { var b = {}; if (this.isWiiU()) { var c = this.installed_items[a]; if (c) b = c; else { c = wiiuDevice.getAocContentIndexList(a); this.shutdownIfError(c); var d = a.slice(-2); b.title_id = a; b.variation = d; b.content_index = c.indexes; this.installed_items[a] = b } } return b }
}
})(); (function () { Wood.Modules.Client.EC = function () { }; var a = { downloadMedia: "USB", installSize: "65535", storageSize: "9493802" }; Wood.Modules.Client.EC.prototype = { getTitleInstallInfo: function (b) { return this.isWiiU() ? (b = wiiuEC.getTitleInstallInfo(b.getId(), b.getVersion().toString()), this.shutdownIfError(b), b) : a } } })(); (function () {
var a = { NONE: 0, CANCEL_PROHIBIT: 1, NETWORK_ERROR: 2, UNDER_MAINTENANCE_ERROR: 3, DEVICE_POLLING_START: 10, DEVICE_DETECT_CARD: 11, DEVICE_TOUCH_AGAIN: 12, DEVICE_TOUCH_DIFF_CARD: 13, PAYMENT_RESPONSE: 20, BALANCE_INQUIRY_RESPONSE: 21, RESULT_CHECK_RESPONSE: 22, HISTORY_INQUIRY_RESPONSE: 23 }, b = _.invert(a); Wood.Modules.Client.Nfc = function () { this.nfc = _.extend({}, Backbone.Events) }; Wood.Modules.Client.Nfc.prototype = {
startNfcPolling: function (a, b) {
Wood.log("wood.client#startNfcPolling request_type:" + a + ", request_info:" +
b); var c = null; this.isWiiU() && (c = wiiuNfc.startPolling(a, b), this.shutdownIfError(c), this.watchProcess()); return c
}, startPayment: function (a) { return this.startNfcPolling(1, a) }, startBalanceInquiry: function (a) { return this.startNfcPolling(3, a) }, startHistoryInquiry: function (a) { return this.startNfcPolling(5, a) }, startResultCheck: function (a) { return this.startNfcPolling(9, a) }, cancelNfc: function () { Wood.log("wood.client#cancelNfc"); return this.isWiiU() ? wiiuNfc.cancel() : !0 }, watchProcess: function () {
var b = this, d =
function () { var c = 50, q = wiiuNfc.getMessage(); switch (q) { case a.DEVICE_POLLING_START: case a.DEVICE_DETECT_CARD: case a.DEVICE_TOUCH_DIFF_CARD: case a.CANCEL_PROHIBIT: b.nfcTrigger(q); break; case a.DEVICE_TOUCH_AGAIN: c = 1500; b.nfcTrigger(q); break; case a.PAYMENT_RESPONSE: case a.BALANCE_INQUIRY_RESPONSE: case a.RESULT_CHECK_RESPONSE: case a.HISTORY_INQUIRY_RESPONSE: c = wiiuNfc.getResponse(q); b.nfcTrigger(q, c); return; case a.UNDER_MAINTENANCE_ERROR: case a.NETWORK_ERROR: b.nfcTrigger(q); return }_.delay(d, c) }; d()
}, nfcTrigger: function (a,
d) { a = "update:" + b[a]; Wood.log(a); Wood.log(d ? JSON.stringify(d, null, " ") : ""); this.nfc.trigger(a, d) }, stopNfcSound: function () { Wood.log("wood.client#stopNfcSound"); this.isWiiU() && wiiuSound.stopNfcSound(2) }
}
})(); (function () { Wood.Modules.Client.NNA = function () { }; Wood.Modules.Client.NNA.prototype = { isMailAddressValidated: function () { return this.isWiiU() ? wiiuNNA.isMailAddressValidated() : "true" === this.getLocalStorage().getItem("_isMailAddressValidated") } } })(); (function () {
Wood.Modules.Client.UI = function () { this.user_operation_enabled = this.power_button_enabled = this.home_button_enabled = !0 }; Wood.Modules.Client.UI.prototype = {
enableHomeButton: function (a) { Wood.log("(wood.client) enableHomeButton"); !this.isWiiU() || !a && this.home_button_enabled || (wiiuBrowser.lockHomeButtonMenu(!1), this.home_button_enabled = !0) }, disableHomeButton: function (a) {
Wood.log("(wood.client) disableHomeButton"); this.isWiiU() && (a || this.home_button_enabled) && (wiiuBrowser.lockHomeButtonMenu(!0),
this.home_button_enabled = !1)
}, enablePowerButton: function (a) { Wood.log("(wood.client) enablePowerButton"); !this.isWiiU() || !a && this.power_button_enabled || (wiiuBrowser.lockPowerButton(!1), this.power_button_enabled = !0) }, disablePowerButton: function (a) { Wood.log("(wood.client) disablePowerButton"); this.isWiiU() && (a || this.power_button_enabled) && (wiiuBrowser.lockPowerButton(!0), this.power_button_enabled = !1) }, enableUserOperation: function (a) {
Wood.log("(wood.client) enableUserOperation"); !this.isWiiU() || !a && this.user_operation_enabled ||
(wiiuBrowser.lockUserOperation(!1), this.user_operation_enabled = !0)
}, disableUserOperation: function (a) { Wood.log("(wood.client) disableUserOperation"); this.isWiiU() && (a || this.user_operation_enabled) && (wiiuBrowser.lockUserOperation(!0), this.user_operation_enabled = !1) }, showLoadingIcon: function () { this.isWiiU() && wiiuBrowser.showLoadingIcon(!0) }, hideLoadingIcon: function () { this.isWiiU() && wiiuBrowser.showLoadingIcon(!1) }, prohibitLoadingIcon: function () { this.isWiiU() && wiiuBrowser.prohibitLoadingIcon(!0) }, allowLoadingIcon: function () {
this.isWiiU() &&
wiiuBrowser.prohibitLoadingIcon(!1)
}, showLoadingDialog: function (a) { this.isWiiU() && this.isDefinedShowLoadingDialog() && wiiuDialog.showLoading(a) }, hideLoadingDialog: function () { this.isWiiU() && this.isDefinedHideLoadingDialog() && wiiuDialog.hideLoading() }, isDefinedShowLoadingDialog: function () { return "undefined" !== typeof wiiuDialog && _.isFunction(wiiuDialog.showLoading) }, isDefinedHideLoadingDialog: function () { return "undefined" !== typeof wiiuDialog && _.isFunction(wiiuDialog.hideLoading) }, curtainClose: function () {
this.isWiiU() &&
"undefined" !== typeof wiiuCurtain && wiiuCurtain.close()
}, alert: function (a, b) { this.hideLoadingDialog(); this.isWiiU() ? Wood.Util.isDefined(b) ? wiiuDialog.alert(a, b) : wiiuDialog.alert(a, "OK") : (Wood.Util.isDefined(b) && (a = a + "\n\nButton: " + b), window.alert(a)) }, confirm: function (a, b, c) {
this.hideLoadingDialog(); if (this.isWiiU()) return Wood.Util.isDefined(b) && Wood.Util.isDefined(c) ? wiiuDialog.confirm(a, b, c) : wiiuDialog.confirm(a, "Cancel", "OK"); Wood.Util.isDefined(b) && Wood.Util.isDefined(c) && (a = a + "\n\nLeft Button: " +
b); return window.confirm(a)
}
}
})(); (function () {
Wood.Modules.Client.RegionalInfo = function () { }; Wood.Modules.Client.RegionalInfo.prototype = {
hasCountryInfo: function () { var a = this.getSessionStorage(); return "max_cash_str max_cash loyalty_system_available prepaid_card_available credit_card_available nfc_available coupon_available my_coupon_available legal_payment_message_required legal_business_message_required time_based_restrictions tax_excluded_country".split(" ").some(function (b) { return Wood.Util.isDefined(a.getItem(b)) }) }, isLoyaltySystemAvailable: function () {
var a =
this.getSessionStorage().getItem("loyalty_system_available"); return a && "true" === a
}, isInquiryAvailable: function () { return !_.contains(["EUR", "AUS"], this.getRegion()) }, isAddressAvailable: function () { return _.contains(["US", "CA"], this.country) }, storeCountryInfo: function (a) {
if (!this.hasCountryInfo()) {
a ? Wood.log("<storeCountryInfo> country cache found") : (Wood.log("<storeCountryInfo> country cache not found"), a = new Wood.Model.CountryInfo({ country: this.country, language: this.language }), a.fetch()); var b = this.getSessionStorage(),
c = a.getMaxCacheSpec(); b.setItem("max_cash_str", c.amount.toString()); b.setItem("max_cash", c.raw_value.toString()); b.setItem("loyalty_system_available", a.isLoyaltySystemAvailable().toString()); b.setItem("prepaid_card_available", a.isPrepaiedCardAvailable().toString()); b.setItem("credit_card_available", a.isCreditCardAvailable().toString()); b.setItem("nfc_available", a.isNfcAvailable().toString()); b.setItem("coupon_available", a.isCouponAvailable().toString()); b.setItem("my_coupon_available", a.isMyCouponAvailable().toString());
b.setItem("legal_payment_message_required", a.isLegalPaymentMessageRequired().toString()); b.setItem("legal_business_message_required", a.isLegalBusinessMessageRequired().toString()); b.setItem("tax_excluded_country", a.isTaxExcluded().toString()); b.setItem("time_based_restrictions", JSON.stringify(a.getTimeBasedRestrictions()))
}
}, isLegalPaymentMessageRequired: function () { return "true" === this.getSessionStorage().getItem("legal_payment_message_required") }, isLegalBusinessMessageRequired: function () {
return "true" ===
this.getSessionStorage().getItem("legal_business_message_required")
}, isTaxIncludedMessageRequired: function () { var a = ["NZ", "RU", "TR"]; return "false" === this.getSessionStorage().getItem("tax_excluded_country") && !_.contains(a, this.country) && "JP" !== this.country }, isNfcAvailable: function () { return "true" === this.getSessionStorage().getItem("nfc_available") }, isCouponAvailable: function () { return "true" === this.getSessionStorage().getItem("coupon_available") }, isMyCouponAvailable: function () { return "true" === this.getSessionStorage().getItem("my_coupon_available") }
}
})(); (function () {
function a(a, c) { this.client = a; this.storage_key = c } Wood.Modules.Client.Read = function () { }; Wood.Modules.Client.Read.prototype = { createReadStore: function (b) { return new a(this, b) } }; a.prototype = {
read: function (a) { var b = this.getReadItems(); a = _.union(b, a); _.isEqual(b, a) || (this.client.getLocalStorage().setItem(this.storage_key, a.join(",")), this.client.writeLocalStorage()) }, isRead: function (a) { return -1 !== this.getReadItems().indexOf(a) }, getReadItems: function () {
var a = this.client.getLocalStorage().getItem(this.storage_key);
return Wood.Util.isDefined(a) ? _.map(a.split(","), function (a) { return a.toString() }) : []
}, hasUnReadItems: function (a) { var b = this.getReadItems(); return !_.every(_.map(a, function (a) { return _.contains(b, a) })) }
}
})(); (function () { Wood.Modules.Client.News = function () { this.newsReadStore = this.createReadStore("news") }; Wood.Modules.Client.News.prototype = { readNews: function (a) { this.newsReadStore.read(a) }, isNewsRead: function (a) { return this.newsReadStore.isRead(a) }, getReadNews: function () { return this.newsReadStore.getReadItems() }, hasUnReadNews: function (a) { a = _.map(a, function (a) { return a.id.toString() }); return this.newsReadStore.hasUnReadItems(a) } } })(); (function () {
Wood.Modules.Client.OwnedCoupon = function () { this.ownedCouponReadStore = this.createReadStore("read_owned_coupon") }; Wood.Modules.Client.OwnedCoupon.prototype = {
readOwnedCoupon: function (a) { this.ownedCouponReadStore.read(a); a = this.getSessionStorage().getItem("cache_owned_coupon") || ""; this.storeUnreadOwnedCoupon(a.split(",")) }, isOwnedCouponRead: function (a) { return this.ownedCouponReadStore.isRead(a) }, getReadOwnedCoupon: function () { return this.ownedCouponReadStore.getReadItems() }, storeOwnedCoupon: function (a) {
this.getSessionStorage().setItem("cache_owned_coupon",
a.join(","))
}, storeUnreadOwnedCoupon: function (a) { a = this.ownedCouponReadStore.hasUnReadItems(a); this.getSessionStorage().setItem("has_unread_owned_coupon", a + "") }, hasUnReadOwnedCoupon: function () { return "true" === this.getSessionStorage().getItem("has_unread_owned_coupon") }
}
})(); (function () {
Wood.Modules.Client.ParentalControl = function () { }; Wood.Modules.Client.ParentalControl.prototype = {
getParentalControlForEShop: function () { if (this.isWiiU()) { var a = wiiuSystemSetting.getParentalControlForEShop(); this.shutdownIfError(a); return a.isLocked } return !0 }, getParentalControlForGamePlay: function () { if (this.isWiiU()) { var a = wiiuSystemSetting.getParentalControlForGamePlay(); this.shutdownIfError(a); return a } return { isLocked: !0, age: "18" } }, isPincodeCheckedForEshop: function () { return "true" === this.getSessionStorage().getItem("pin_code_checked_for_eshop") },
isPincodeChecked: function () { return "true" === this.getSessionStorage().getItem("pin_code_checked") }, getAge: function () { return parseInt(this.getSessionStorage().getItem("age"), 10) }, isLockedForEShop: function () { var a = this.getParentalControlForEShop(); return this.isPincodeCheckedForEshop() ? !1 : a }, isLockedForGamePlay: function (a) {
if (Wood.Util.isUndefined(a)) return !1; var b = this.getParentalControlForGamePlay(), c = b.isLocked; b = parseInt(b.age, 10); "AU" !== this.country && "NZ" !== this.country || 13 !== b || (b = 14); parseInt(a,
10) <= b && (c = !1); return this.isPincodeChecked() ? !1 : c
}, isRequiredNfcUnderCheck: function () { var a = "JP" === this.country, b = 18 <= this.getAge(); return a && !b }
}
})(); (function () {
Wood.Modules.Client.Storage = function () { this.ls = Wood.LocalStorage.build(this.isWiiU() ? wiiuLocalStorage : window.localStorage); this.ss = Wood.SessionStorage.build(this.isWiiU() ? wiiuSessionStorage : window.sessionStorage) }; Wood.Modules.Client.Storage.prototype = {
getSessionStorage: function () { return Wood.SessionStorage.getRawInstance() }, getLocalStorage: function () { return Wood.LocalStorage.getRawInstance() }, writeLocalStorage: function (a) {
!a && this.isInBoot() ? (Wood.log("writeLocalStorage in Boot, delayed"),
this.setFSFlushRequired()) : this.isWiiU() && (Wood.log("writeLocalStorage performed"), this.criticalAction(function () { this.getLocalStorage().write(); this.cancelFSFlush() }))
}
}
})(); (function () {
Wood.Modules.Client.UserData = function () { }; Wood.Modules.Client.UserData.prototype = {
getDeviceOrderList: function () {
var a = this.getLocalStorage(), b = a.getItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST); a = a.getItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST_RVC); if (Wood.Util.isDefined(b) && Wood.Util.isDefined(a)) var c = new Wood.Model.DeviceOrderList({ title_ids: b, rvc_title_ids: a }); else c = new Wood.Model.DeviceOrderList, c.fetch({ async: !1, success: function () { wood.client.updateDeviceOrderList(c); Wood.log("getDeviceOrderList: DeviceOrderList updated") } });
return c
}, getDeviceOrderListModified: function () { return this.getLocalStorage().getItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST_MODIFIED) }, updateDeviceOrderList: function (a) { var b = this.getLocalStorage(); b.setItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST, a.getTitleIdString()); b.setItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST_RVC, a.getRVCTitleIdString()); b.setItem(Wood.Client.StorageKey.DEVICE_ORDER_LIST_MODIFIED, (new Date).getTime().toString()); this.writeLocalStorage() }, storeBalance: function () {
var a =
this.getSessionStorage(), b = a.getItem(Wood.Client.StorageKey.BALANCE_AMOUNT), c = a.getItem(Wood.Client.StorageKey.BALANCE_RAW); if (Wood.Util.isDefined(b) || Wood.Util.isDefined(c)) return !1; b = new Wood.Model.Balance({ country: this.country, language: this.language }); b.fetch({ async: !1 }); if (!b.getAmount()) return Wood.log("balance_info is empty. server error?"), !1; c = b.getAmount(); "MX" === this.country && (c = c.replace("MX$", "MX$ ")); a.setItem(Wood.Client.StorageKey.BALANCE_AMOUNT, c); a.setItem(Wood.Client.StorageKey.BALANCE_RAW,
b.getRawValue()); return !0
}, getBalanceAmount: function () { return this.getSessionStorage().getItem(Wood.Client.StorageKey.BALANCE_AMOUNT) }
}
})(); (function () {
Wood.Modules.Client.SystemSetting = function () { this.resourceKey = this.region = this.language = this.country = null }; Wood.Modules.Client.SystemSetting.prototype = {
verifyIVSSent: function () {
var a = this.getUserAgent(); if (this.isWiiU() && !a.isLatestVersionOrLater()) Wood.log("[ERROR] not latest version of wood:" + a.getWoodVersion()); else {
a = this.getSessionStorage(); var b = a.getItem(Wood.Client.StorageKey.IVS_SENT); if (Wood.Util.isDefined(b)) return Wood.log("verifyIVSSent: IVS OK (sessionStorage cache)"), !0;
if (Wood.isWiiU) { b = wiiuEC.getSendIvsState(); if (b.status && "success" === b.status) return Wood.log("verifyIVSSent: IVS status success"), a.setItem(Wood.Client.StorageKey.IVS_SENT, "1"), !0; if ((a = b.error) && a.code) if (Wood.log("verifyIVSSent: IVS error:" + a.message), this.isWiiU()) this.showError(a.code, a.message), this.errorShutdown(); else return !1; Wood.log("verifyIVSSent: maybe sending. " + b.status) }
}
}, loadSystemSetting: function () {
if (this.isWiiU()) {
this.language = this.getLocalStorage().getItem("lang"); var a = wiiuSystemSetting.getCountry();
this.shutdownIfError(a); this.country = a.code
} else a = this.getLocalStorage().getItem("lang"), Wood.Util.isUndefined(a) ? this.language = "ja" : this.language = a, a = this.getSessionStorage().getItem("country"), this.country = null === a || 0 === a.length ? "JP" : a; if (this.country && this.language) return this.region = this.getRegion(), this.resourceKey = this.getResourceKey(), this.getSessionStorage().setItem(Wood.Client.StorageKey.RESOURCE_KEY, this.resourceKey), !0; Wood.log("client has no country, language info.")
}, getRegion: function () {
if ("AU" ===
this.country || "NZ" === this.country) return "AUS"; if (this.isWiiU()) { var a = wiiuSystemSetting.getRegion(); this.shutdownIfError(a); return a.code } return "JP" === this.country ? "JPN" : "US" === this.country || "CA" === this.country || "MX" === this.country || "BR" === this.country ? "USA" : "EUR"
}, getResourceKey: function () { if (!this.region) throw Error("region not stored yet"); switch (this.region) { case "USA": return this.language + "_US"; case "AUS": return "en_AU"; default: return this.language } }, saveSystemSetting: function () {
this.getLocalStorage().setItem(Wood.Client.StorageKey.LANGUAGE,
this.language); this.writeLocalStorage()
}
}
})(); (function () {
Wood.Modules.Client.LocalizedText = function () { this.localized_message = null }; Wood.Modules.Client.LocalizedText.prototype = {
clearLocalizedText: function () { this.getSessionStorage().removeItem(Wood.Client.StorageKey.LOCALIZED_TEXT) }, prepareLocalizedText: function (a) {
var b = this.getSessionStorage(), c = new Wood.Model.LocalizedMessage({ resource_key: this.getResourceKey() }), d = b.getItem(Wood.Client.StorageKey.LOCALIZED_TEXT); !d || a && a.force ? (c.fetch(), b.setItem(Wood.Client.StorageKey.LOCALIZED_TEXT, c.toJSON())) :
c.loadJSON(d); this.localized_message = c
}, getText: function (a) { if (!this.localized_message) throw Error("localized text not prepared"); return this.localized_message.getText(a) }
}
})(); (function () { Wood.Modules.Client.Dictionary = function () { }; Wood.Modules.Client.Dictionary.prototype = { isDictionarySet: function () { var a = this.getSessionStorage().getItem(Wood.Client.StorageKey.DICTIONARY_FLAG); return a && "true" === a ? !0 : !1 }, setDictionaryFlag: function (a) { return this.getSessionStorage().setItem(Wood.Client.StorageKey.DICTIONARY_FLAG, "true") } } })(); (function () {
Wood.Modules.Client.Redirector = function () { }; Wood.Modules.Client.Redirector.prototype = {
redirectTo: function (a, b, c) { a = b || c ? Wood.URL.create(a, b, c) : a; Wood.log("redirect to " + a); location.href = a; throw Error("wooc.client#redirectTo stopper"); }, redirectToTop: function () { "#top" === this.getHash() ? (Wood.log("[redirectToTop] already on top"), this.enableUserOperation()) : (Wood.log("[redirectToTop] to index.html#top"), this.redirectTo("index.html#top")) }, redirectReplaceTo: function (a, b, c) {
a = b || c ? Wood.URL.create(a,
b, c) : a; Wood.log("redirect replace to " + a); location.replace(a); throw Error("wooc.client#redirectReplaceTo stopper");
}
}
})(); (function () {
Wood.Modules.Client.Session = function () { }; Wood.Modules.Client.Session.prototype = {
updateUserSession: function (a) {
var b = this.isWiiU() ? parseInt(wiiuSystemSetting.getUTC().epochMilliSeconds, 10) : (new Date).getTime(), c = this.getSessionStorage(), d = Number(c.getItem(Wood.Client.StorageKey.SESSION_UPDATED)); if ((d && 0 !== d ? b - d : b) < Wood.SystemConfig.SESSION_UPDATE_INTERVAL) return !1; d = !0; a && a.hasOwnProperty("async") && (d = a.async); (new Wood.Model.Balance({ country: this.country, language: this.language })).fetch({
async: d,
success: function () { c.setItem(Wood.Client.StorageKey.SESSION_UPDATED, b.toString()) }
}); return !0
}
}
})(); (function () {
function a(a) { return !!(a && a.isWiiU && a.isWiiU()) } Wood.Modules.Client.Jumper = function () { }; Wood.Modules.Client.Jumper.prototype = {
shutdown: function (b) { if (!a(this)) return !1; if ("1" === this.getSessionStorage().getItem(Wood.Client.StorageKey.FROM_OTHER_APP)) Wood.log("shutdown: returnToCaller"), wiiuBrowser.returnToCaller(); else { if (b && b.back_to_home_menu) return this.jumpToHBM(); Wood.log("shutdown: closeApplication"); wiiuBrowser.closeApplication() } }, errorShutdown: function () { this.shutdown({ back_to_home_menu: !0 }) },
jumpToHBM: function () { Wood.log("shutdown: jumpToHomeButtonMenu"); wiiuBrowser.jumpToHomeButtonMenu ? wiiuBrowser.jumpToHomeButtonMenu() : wiiuBrowser.closeApplication() }, jumpToUpdate: function () { a(this); Wood.log("wiiuBrowser.jumpToUpdate()"); wiiuBrowser.jumpToUpdate() }
}
})(); (function () {
Wood.Client = function () { var a = this; _.each(Wood.Client.Modules, function (b) { b.call(a) }) }; Wood.Client.create = function () { return new Wood.Client }; Wood.Client.prototype = {
isWiiU: function () { return Wood.isWiiU }, isDrc: function () { return this.isWiiU() ? wiiuDevice.isDrc() : !0 }, tryWiiU: function (a) { return this.isWiiU() ? a.call() : !1 }, getAB: function () { return this.isWiiU() ? ["A", "B"][wiiuNNA.principalId % 2] : "" }, getHash: function () { return location.hash }, debug_print: Wood.log, historyBack: function () {
if (!this.isWiiU()) throw history.back(),
Error("wooc.client#historyBack stopper"); wiiuBrowser.canHistoryBack() ? history.back() : this.redirectToTop(); throw Error("wooc.client#historyBack stopper");
}, getUserAgent: function (a) { return new Wood.UserAgent(a) }, criticalAction: function (a) { if (!this.isWiiU()) return a.apply(this); wiiuBrowser.lockHomeButtonMenu(!0); wiiuBrowser.lockPowerButton(!0); a.apply(this); wiiuBrowser.lockHomeButtonMenu(!1); wiiuBrowser.lockPowerButton(!1) }, playSound: function (a, c) {
this.isWiiU() ? (c = c || Wood.Client.SoundDevice.DRC, wiiuSound.playSoundByName(a,
c)) : Wood.log("(wood.client) playSound: " + a)
}
}; Wood.Client.StorageKey = {
SESSION_UPDATED: "keep_alive_modified", IVS_SENT: "ivs_sent", BALANCE_AMOUNT: "balance", BALANCE_RAW: "balance_raw", DEVICE_ORDER_LIST: "device_order_list", DEVICE_ORDER_LIST_RVC: "device_order_list_rvc", DEVICE_ORDER_LIST_MODIFIED: "device_order_list_modified", DICTIONARY_FLAG: "dictionary_flg", TEMP_REDEEMABLE_CARD: "temp_redeemable_card", LOCALIZED_TEXT: "localized_text", RESOURCE_KEY: "resource_key", REDEEM_TITLE_ID: "redeem_title_id", REDEEM_NUMBER: "redeem_num",
NINJA_SESSION: "ninja_session", FIRST_BOOT: "first_boot", LANGUAGE: "lang", FROM_OTHER_APP: "from_other_app", VOTABLE_LIST: "votable_list", VOTABLE_DATA: "votable_data", AOC_EDITING: "aoc_editing"
}; Wood.Client.SoundDevice = { DRC: 1, TV: 2, BOTH: 3 }; var a = Wood.Modules.Client; Wood.Client.Modules = [a.ErrorHandler, a.PurchaseInfo, a.Boot, a.AOC, a.EC, a.Nfc, a.NNA, a.UI, a.RegionalInfo, a.Read, a.News, a.OwnedCoupon, a.ParentalControl, a.Storage, a.UserData, a.SystemSetting, a.LocalizedText, a.Dictionary, a.Redirector, a.Session, a.Jumper];
_.each(Wood.Client.Modules, function (a) { _.extend(Wood.Client.prototype, a.prototype) })
})(); (function () { var a; Wood.ModelStore = function () { this.pool = []; this.size = 10 }; Wood.ModelStore.getInstance = function () { return a = a || new Wood.ModelStore }; Wood.ModelStore.prototype = { add: function (a, c) { this.pool.push({ key: a, attr: c }); this.shift() }, get: function (a) { var b = function (b) { return b.key === a }, d = _.find(this.pool, b), f = null; _.isObject(d) && (f = d.attr, this.pool = _.reject(this.pool, b), this.pool.push(d), this.shift()); return f }, shift: function () { if (this.pool.length > this.size) return this.pool.shift() } } })(); (function () {
Wood.PurchaseStatus = function (a) { this.status = a }; var a = Wood.PurchaseStatus.STATUS = { PURCHASED: 1, REDOWNLOADABLE: 2, DUPLICATED: 3, OK: 4, INVALID: 5, DOWNLOADABLE: 6 }; Wood.PurchaseStatus.prototype = {
getText: function () { switch (this.status) { case a.PURCHASED: return $("#str_purchased").html(); case a.REDOWNLOADABLE: return $("#str_reDL").html(); case a.DUPLICATED: return $("#str_nobuy_d").html(); case a.OK: return $("#str_buy").html(); case a.INVALID: return $("#str_undefined").html(); case a.DOWNLOADABLE: return $("#str_DL").html() } },
isOkOrDownloadable: function () { return _.contains([a.OK, a.DOWNLOADABLE, a.REDOWNLOADABLE], this.status) }, isPurchased: function () { return this.status === a.PURCHASED }, isDuplicated: function () { return this.status === a.DUPLICATED }, isOk: function () { return this.status === a.OK }, isInvalid: function () { return this.status === a.INVALID }, isDownloadable: function () { return this.status === a.DOWNLOADABLE }
}
})(); (function () {
var a = ["title", "movie", "both"], b = { "0005000010185100": "0005000010101F00", "0005000010185200": "0005000010101C00", "0005000010185300": "000500001012BC00", "0005000010185400": "0005000010143400", "0005000010185500": "0005000010112D00", "0005000010185600": "0005000010116300" }; Wood.StartPageDispatcher = {
alertNoData: function () { wood.client.endStartUp(); wood.client.alert($("#dialog_msg_nodata").text(), wood.client.getText("common01_01_006")) }, isDemoNsUid: function (a) { return "3" === String(a).split("")[3] }, convertToNormalTitleId: function (a) {
a =
String(a); 0 === a.indexOf("00050002") && (a = "000500001" + a.substring(9, 14) + "00"); 0 === a.indexOf("00040002") && (a = "00040000" + a.substring(8, 14) + "00"); return 0 !== a.indexOf("00050000") && 0 !== a.indexOf("00040000") ? null : a
}, convertToMainTitleId: function (a, d) { return "0005000010183A00" !== d && _.has(b, a) ? b[a] : a }, getNsUid: function (a) {
var b = null, c = null; if (void 0 !== a.dst_nsuid) c = new Wood.Model.TitlePublicStatus({ country: wood.client.country, language: wood.client.language, id: a.dst_nsuid }), c.fetch(), b = c.getNsUid(); else if (void 0 !==
a.dst_title_id) { b = Wood.StartPageDispatcher.convertToNormalTitleId(a.dst_title_id); if (!b) { Wood.log("systemapp title_id specified. exit script."); return } b = Wood.StartPageDispatcher.convertToMainTitleId(b, a.src_title_id); c = new Wood.Model.TitlePublicStatus({ country: wood.client.country, language: wood.client.language, id: b }); c.fetch(); b = c.getNsUid() } else void 0 !== a.dst_unique_id && (b = "000500001" + a.dst_unique_id + "00", c = new Wood.Model.TitlePublicStatus({
country: wood.client.country, language: wood.client.language,
id: b
}), c.fetch(), b = c.getNsUid()); b && Wood.StartPageDispatcher.isDemoNsUid(b) && (Wood.StartPageDispatcher.alertNoData(), wood.client.redirectReplaceTo("./#top")); b && c && (a = "true" === a.allow_unsearchable, c.isPublic() || c.isUnseachable() && a || (b = null)); return b
}, getNsUidFromItemCode: function (a) { a = new Wood.Model.AocItemNsuid({ country: wood.client.country, item_code: a }); a.fetch(); return a.getNsuid() }, createAocURL: function (a) {
var b = Wood.StartPageDispatcher.getNsUid(a); if (!b) return Wood.StartPageDispatcher.alertNoData(),
"./#top"; var c = a.dst_aoc_nsuid; a = a.dst_item_code; return c || a ? c || !a || (c = this.getNsUidFromItemCode(a), c) ? Wood.URL.create("./aoc_detail.html", { seq: "appJump", title_id: b, aoc_id: c }) : Wood.URL.create("./#title", { title: b }) : (Wood.StartPageDispatcher.alertNoData(), "./#top")
}, createAocsURL: function (a) {
var b = Wood.StartPageDispatcher.getNsUid(a); if (null === b) return Wood.StartPageDispatcher.alertNoData(), "./#top"; b = new Wood.URL("./data03_01.html", { seq: "appJump", title: b }); var c = a.search_word; a = a.sort; c && b.setQueryString("search_word",
c); a && b.setQueryString("sort", a); return b.toString()
}, createTicketsURL: function (a) { a = Wood.StartPageDispatcher.getNsUid(a); return _.isNull(a) ? (Wood.StartPageDispatcher.alertNoData(), "./#top") : _.isUndefined(a) ? "./#top" : Wood.URL.create("./data04_01.html", { seq: "appJump", title: a }) }, createRedeemURL: function (a) { return Wood.URL.create("./#redeem", { seq: "appJump", card_number: a.card_number || "" }) }, createTitleDetailURL: function (a) {
a = Wood.StartPageDispatcher.getNsUid(a); return _.isNull(a) ? (Wood.StartPageDispatcher.alertNoData(),
"./#top") : _.isUndefined(a) ? "./#top" : Wood.URL.create("./#title", { seq: "appJump", title: a })
}, createSearchURL: function (b) { var c = _.contains(a, b.type) ? b.type : _.first(a), f = null; _.isString(b.freeword) && (f = b.freeword); b = { seq: "appJump", searchType: c }; f && (b.freeword = f); return Wood.URL.create("./#shelf", b) }, createNfcRecoverURL: function (a) { return Wood.URL.create("./money07_01.html", { seq: "appJump" }) }, dispatch: function (a) {
switch (a.scene) {
case "top": return "./#top"; case "aoc": return this.createAocURL(a); case "aocs": return this.createAocsURL(a);
case "tickets": return this.createTicketsURL(a); case "redeem": return this.createRedeemURL(a); case "detail": return this.createTitleDetailURL(a); case "search": return this.createSearchURL(a); case "recover_nfc": return this.createNfcRecoverURL(a); default: return "./#top"
}
}
}; Wood.StartPageDispatcher.URL_TOP = "./#top"
})(); (function () { Wood.IndexBeacon = { boot01_01: function () { Wood.Analytics.saveAppJumpAttr($.url().param()) }, boot01_02: function () { }, boot01_03: function () { }, boot01_04: function () { }, boot01_05: function () { }, boot01_06: function () { }, boot01_07: function () { } } })(); (function () { Wood.ScreenSwitcher = function (a) { this.ids = a ? a : [] }; Wood.ScreenSwitcher.prototype = { getIds: function () { return this.ids }, change: function (a) { $.each(this.getIds(), function (b, c) { c === a ? $("#" + c).show() : $("#" + c).hide() }) } } })(); (function (a) {
a.fn.crypt = function (b) {
function c(a) { var b = "", c = 0; do { var d = a.source.charCodeAt(c++); var f = a.source.charCodeAt(c++); var q = a.source.charCodeAt(c++); var n = d >> 2; d = (d & 3) << 4 | f >> 4; var k = (f & 15) << 2 | q >> 6; var x = q & 63; isNaN(f) ? k = x = 64 : isNaN(q) && (x = 64); b += a.b64Str.charAt(n) + a.b64Str.charAt(d) + a.b64Str.charAt(k) + a.b64Str.charAt(x) } while (c < a.source.length); return b } function d(a) {
var b = "", c = 0; var d = new RegExp("[^A-Za-z0-9" + a.b64Str.substr(-3) + "]", "g"); a.source = a.source.replace(d, ""); do {
var f = a.b64Str.indexOf(a.source.charAt(c++));
var q = a.b64Str.indexOf(a.source.charAt(c++)); d = a.b64Str.indexOf(a.source.charAt(c++)); var n = a.b64Str.indexOf(a.source.charAt(c++)); f = f << 2 | q >> 4; q = (q & 15) << 4 | d >> 2; var k = (d & 3) << 6 | n; b += String.fromCharCode(f); 64 != d && (b += String.fromCharCode(q)); 64 != n && (b += String.fromCharCode(k))
} while (c < a.source.length); return b
} function f(a) {
function b(a, b, c, d, f, n) { a = q(q(b, a), q(d, n)); return q(a << f | a >>> 32 - f, c) } function c(a, c, d, f, q, n, p) { return b(c & d | ~c & f, a, c, q, n, p) } function d(a, c, d, f, q, n, p) { return b(c & f | d & ~f, a, c, q, n, p) } function f(a,
c, d, f, q, n, p) { return b(d ^ (c | ~f), a, c, q, n, p) } return function (b) { for (var c = a.hexcase ? "0123456789ABCDEF" : "0123456789abcdef", d = "", f = 0; f < 4 * b.length; f++)d += c.charAt(b[f >> 2] >> f % 4 * 8 + 4 & 15) + c.charAt(b[f >> 2] >> f % 4 * 8 & 15); return d }(function (a, n) {
a[n >> 5] |= 128 << n % 32; a[(n + 64 >>> 9 << 4) + 14] = n; n = 1732584193; for (var k = -271733879, p = -1732584194, u = 271733878, y = 0; y < a.length; y += 16) {
var C = n, F = k, E = p, J = u; n = c(n, k, p, u, a[y + 0], 7, -680876936); u = c(u, n, k, p, a[y + 1], 12, -389564586); p = c(p, u, n, k, a[y + 2], 17, 606105819); k = c(k, p, u, n, a[y + 3], 22, -1044525330);
n = c(n, k, p, u, a[y + 4], 7, -176418897); u = c(u, n, k, p, a[y + 5], 12, 1200080426); p = c(p, u, n, k, a[y + 6], 17, -1473231341); k = c(k, p, u, n, a[y + 7], 22, -45705983); n = c(n, k, p, u, a[y + 8], 7, 1770035416); u = c(u, n, k, p, a[y + 9], 12, -1958414417); p = c(p, u, n, k, a[y + 10], 17, -42063); k = c(k, p, u, n, a[y + 11], 22, -1990404162); n = c(n, k, p, u, a[y + 12], 7, 1804603682); u = c(u, n, k, p, a[y + 13], 12, -40341101); p = c(p, u, n, k, a[y + 14], 17, -1502002290); k = c(k, p, u, n, a[y + 15], 22, 1236535329); n = d(n, k, p, u, a[y + 1], 5, -165796510); u = d(u, n, k, p, a[y + 6], 9, -1069501632); p = d(p, u, n, k, a[y + 11], 14, 643717713);
k = d(k, p, u, n, a[y + 0], 20, -373897302); n = d(n, k, p, u, a[y + 5], 5, -701558691); u = d(u, n, k, p, a[y + 10], 9, 38016083); p = d(p, u, n, k, a[y + 15], 14, -660478335); k = d(k, p, u, n, a[y + 4], 20, -405537848); n = d(n, k, p, u, a[y + 9], 5, 568446438); u = d(u, n, k, p, a[y + 14], 9, -1019803690); p = d(p, u, n, k, a[y + 3], 14, -187363961); k = d(k, p, u, n, a[y + 8], 20, 1163531501); n = d(n, k, p, u, a[y + 13], 5, -1444681467); u = d(u, n, k, p, a[y + 2], 9, -51403784); p = d(p, u, n, k, a[y + 7], 14, 1735328473); k = d(k, p, u, n, a[y + 12], 20, -1926607734); n = b(k ^ p ^ u, n, k, a[y + 5], 4, -378558); u = b(n ^ k ^ p, u, n, a[y + 8], 11, -2022574463);
p = b(u ^ n ^ k, p, u, a[y + 11], 16, 1839030562); k = b(p ^ u ^ n, k, p, a[y + 14], 23, -35309556); n = b(k ^ p ^ u, n, k, a[y + 1], 4, -1530992060); u = b(n ^ k ^ p, u, n, a[y + 4], 11, 1272893353); p = b(u ^ n ^ k, p, u, a[y + 7], 16, -155497632); k = b(p ^ u ^ n, k, p, a[y + 10], 23, -1094730640); n = b(k ^ p ^ u, n, k, a[y + 13], 4, 681279174); u = b(n ^ k ^ p, u, n, a[y + 0], 11, -358537222); p = b(u ^ n ^ k, p, u, a[y + 3], 16, -722521979); k = b(p ^ u ^ n, k, p, a[y + 6], 23, 76029189); n = b(k ^ p ^ u, n, k, a[y + 9], 4, -640364487); u = b(n ^ k ^ p, u, n, a[y + 12], 11, -421815835); p = b(u ^ n ^ k, p, u, a[y + 15], 16, 530742520); k = b(p ^ u ^ n, k, p, a[y + 2], 23, -995338651);
n = f(n, k, p, u, a[y + 0], 6, -198630844); u = f(u, n, k, p, a[y + 7], 10, 1126891415); p = f(p, u, n, k, a[y + 14], 15, -1416354905); k = f(k, p, u, n, a[y + 5], 21, -57434055); n = f(n, k, p, u, a[y + 12], 6, 1700485571); u = f(u, n, k, p, a[y + 3], 10, -1894986606); p = f(p, u, n, k, a[y + 10], 15, -1051523); k = f(k, p, u, n, a[y + 1], 21, -2054922799); n = f(n, k, p, u, a[y + 8], 6, 1873313359); u = f(u, n, k, p, a[y + 15], 10, -30611744); p = f(p, u, n, k, a[y + 6], 15, -1560198380); k = f(k, p, u, n, a[y + 13], 21, 1309151649); n = f(n, k, p, u, a[y + 4], 6, -145523070); u = f(u, n, k, p, a[y + 11], 10, -1120210379); p = f(p, u, n, k, a[y + 2], 15,
718787259); k = f(k, p, u, n, a[y + 9], 21, -343485551); n = q(n, C); k = q(k, F); p = q(p, E); u = q(u, J)
} return [n, k, p, u]
}(function (b) { for (var c = [], d = (1 << a.chrsz) - 1, f = 0; f < b.length * a.chrsz; f += a.chrsz)c[f >> 5] |= (b.charCodeAt(f / a.chrsz) & d) << f % 32; return c }(a.source), a.source.length * a.chrsz))
} function q(a, b) { var c = (a & 65535) + (b & 65535); return (a >> 16) + (b >> 16) + (c >> 16) << 16 | c & 65535 } function p(a) {
return function (b) {
for (var c = a.hexcase ? "0123456789ABCDEF" : "0123456789abcdef", d = "", f = 0; f < 4 * b.length; f++)d += c.charAt(b[f >> 2] >> 8 * (3 - f % 4) + 4 & 15) +
c.charAt(b[f >> 2] >> 8 * (3 - f % 4) & 15); return d
}(function (a, b) {
a[b >> 5] |= 128 << 24 - b % 32; a[(b + 64 >> 9 << 4) + 15] = b; b = Array(80); for (var c = 1732584193, d = -271733879, f = -1732584194, n = 271733878, k = -1009589776, p = 0; p < a.length; p += 16) {
for (var F = c, y = d, C = f, A = n, J = k, D = 0; 80 > D; D++) {
if (16 > D) b[D] = a[p + D]; else { var H = b[D - 3] ^ b[D - 8] ^ b[D - 14] ^ b[D - 16]; b[D] = H << 1 | H >>> 31 } H = c << 5 | c >>> 27; var N = 20 > D ? d & f | ~d & n : 40 > D ? d ^ f ^ n : 60 > D ? d & f | d & n | f & n : d ^ f ^ n; H = q(q(H, N), q(q(k, b[D]), 20 > D ? 1518500249 : 40 > D ? 1859775393 : 60 > D ? -1894007588 : -899497514)); k = n; n = f; f = d << 30 | d >>> 2;
d = c; c = H
} c = q(c, F); d = q(d, y); f = q(f, C); n = q(n, A); k = q(k, J)
} return [c, d, f, n, k]
}(function (b) { for (var c = [], d = (1 << a.chrsz) - 1, f = 0; f < b.length * a.chrsz; f += a.chrsz)c[f >> 5] |= (b.charCodeAt(f / a.chrsz) & d) << 32 - a.chrsz - f % 32; return c }(a.source), a.source.length * a.chrsz))
} function n(a) {
var b = Array(2), c = Array(4), d = "", f; a.source = escape(a.source); for (f = 0; 4 > f; f++)c[f] = H(a.strKey.slice(4 * f, 4 * (f + 1))); for (f = 0; f < a.source.length; f += 8) {
b[0] = H(a.source.slice(f, f + 4)); b[1] = H(a.source.slice(f + 4, f + 8)); for (var q = b, n = q[0], k = q[1], p = 0; 84941944608 !=
p;)n += (k << 4 ^ k >>> 5) + k ^ p + c[p & 3], p += 2654435769, k += (n << 4 ^ n >>> 5) + n ^ p + c[p >>> 11 & 3]; q[0] = n; q[1] = k; d += D(b[0]) + D(b[1])
} return S(d)
} function A(a) {
var b = Array(2), c = Array(4), d = "", f; for (f = 0; 4 > f; f++)c[f] = H(a.strKey.slice(4 * f, 4 * (f + 1))); ciphertext = N(a.source); for (f = 0; f < ciphertext.length; f += 8) { b[0] = H(ciphertext.slice(f, f + 4)); b[1] = H(ciphertext.slice(f + 4, f + 8)); a = b; for (var q = a[0], n = a[1], k = 84941944608; 0 != k;)n -= (q << 4 ^ q >>> 5) + q ^ k + c[k >>> 11 & 3], k -= 2654435769, q -= (n << 4 ^ n >>> 5) + n ^ k + c[k & 3]; a[0] = q; a[1] = n; d += D(b[0]) + D(b[1]) } d = d.replace(/\0+$/,
""); return unescape(d)
} function H(a) { for (var b = 0, c = 0; 4 > c; c++)b |= a.charCodeAt(c) << 8 * c; return isNaN(b) ? 0 : b } function D(a) { return String.fromCharCode(a & 255, a >> 8 & 255, a >> 16 & 255, a >> 24 & 255) } function S(a) { return a.replace(/[\0\t\n\v\f\r\xa0'"!]/g, function (a) { return "!" + a.charCodeAt(0) + "!" }) } function N(a) { return a.replace(/!\d\d?\d?!/g, function (a) { return String.fromCharCode(a.slice(1, -1)) }) } var M = {
b64Str: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", strKey: "123", method: "md5", source: "", chrsz: 8,
hexcase: 0
}; "undefined" == typeof b.urlsafe ? (M.b64Str += "+/=", b.urlsafe = !1) : M.b64Str = b.urlsafe ? M.b64Str + "-_=" : M.b64Str + "+/="; b = a.extend(M, b); if (!b.source) if (M = a(this), M.html()) b.source = M.html(); else if (M.val()) b.source = M.val(); else return alert("Please provide source text"), !1; if ("md5" == b.method) return f(b); if ("sha1" == b.method) return p(b); if ("b64enc" == b.method) return c(b); if ("b64dec" == b.method) return d(b); if ("xteaenc" == b.method) return n(b); if ("xteadec" == b.method) return A(b); if ("xteab64enc" == b.method) return M =
n(b), b.method = "b64enc", b.source = M, c(b); if ("xteab64dec" == b.method) return M = d(b), b.method = "xteadec", b.source = M, A(b)
}
})(jQuery); (function (a) {
var b = a.Wood || {}; a.Wood = b; b.AnalyticsUtil = function () {
var b = "undefined" !== typeof wiiuSystemSetting ? !0 : !1, d = a.localStorage, f = a.sessionStorage; return {
isWiiU: b, isReferrerTop: function () { var a = !1, b = $.url(), c = b.fparam("beacon") || b.param("beacon"); c = c ? /directory/.test(c) : !1; "appJump" !== b.param("seq") && c && (a = !0); return a }, getHashedPID: function () {
if (!b) return d.getItem("pid") || "00000000000000000000000000000000"; var a = parseInt(wiiuNNA.principalId, 10); a = isNaN(a) ? "0" : a.toString(16); a = ["00000000",
a].join(""); a = a.substr(a.length - 8); a = [wiiuNNA.principalIdHashKey, a].join(""); return jQuery().crypt({ method: "md5", source: a })
}, getRegionType: function () { var a = this.getRegion(); return "JPN" === a ? "jp" : "USA" === a ? "us" : "EUR" === a ? "eu" : "unknown" }, getDefaultCurrency: function () { var a = this.getRegion(); return "JPN" === a ? "JPY" : "USA" === a ? "USD" : "EUR" === a ? "EUR" : "JPY" }, getGender: function () { return b ? wiiuNNA.gender : d.getItem("gender") || "unknown" }, getAge: function () {
if (!b) return parseInt(d.getItem("age"), 10) || 30; var a = new Date;
a = 1E4 * a.getFullYear() + 100 * (a.getMonth() + 1) + a.getDate(); var c = new Date(wiiuNNA.birthday); c = 1E4 * c.getFullYear() + 100 * (c.getMonth() + 1) + c.getDate(); return Math.floor((a - c) / 1E4)
}, getRegion: function () { if (b) { var a = wiiuSystemSetting.getRegion(); return a.error ? "unknown" : a.code } a = this.getCountry(); return "JP" === a ? "JPN" : "US" === a || "CA" === a || "MX" === a || "BR" === a ? "USA" : "EUR" }, getCountry: function () { if (b) { var a = wiiuSystemSetting.getCountry(); return a.error ? "unknown" : a.code } return f.getItem("country") || "unknown" }, getLanguage: function () {
if (b) {
var a =
wiiuSystemSetting.getLanguage(); return a.error ? "unknown" : a.code
} return d.getItem("lang") || "unknown"
}
}
}()
})(window); (function (a) {
function b() { this.dataLayer = a.dataLayer || []; a.dataLayer = this.dataLayer; this.sessionStorage = d.isWiiU ? wiiuSessionStorage : a.sessionStorage; this._isSent = null; this.setAccountInfo() } var c = a.Wood, d = c.AnalyticsUtil; b.prototype = {
_send: function () {
this._isSent || (setTimeout(function () {
var a = window; a.dataLayer = a.dataLayer || []; a.dataLayer.push({ "gtm.start": (new Date).getTime(), event: "gtm.js" }); a = document.getElementsByTagName("script")[0]; var b = document.createElement("script"); b.async = !0; b.src = "//www.googletagmanager.com/gtm.js?id=GTM-TNPGB6";
a.parentNode.insertBefore(b, a)
}, 1), this._isSent = !0)
}, _addAttr: function (a) { this.dataLayer.push(a) }, _addEvent: function (a, b) { this._addAttr($.extend({ event: a }, b)) }, _addEventOrAttr: function (a, b) { this._isSent ? this._addEvent(a, b) : this._addAttr(b) }, setAccountInfo: function () { this._addAppJumpEvent(); this._addEventOrAttr("login", { regionCd: d.getRegionType(), uId: d.getHashedPID(), upc01: d.getAge(), upc02: d.getGender(), uCountry: d.getCountry(), uLanguage: d.getLanguage() }); this._send() }, sendVirtualPV: function (a, b) {
this._addEvent("virtualPV",
$.extend({ virtualPage: a }, b))
}, addTitleViewAttr: function (a) { this._addAttr({ ecommerce: { detail: { products: [{ id: a }] } } }); return this }, addFromAttr: function (a) { this._addAttr({ from: a }); return this }, addDirectoryAttr: function (a) { a && this.addFromAttr("id_" + a.id); return this }, addShelfAttr: function (a, b) { if (a) { var c = a.alias, d = a.name; this._addAttr({ shelf: c ? "ALIAS:" + c : "NAME:" + d, directory_index: a.index }) } this.addFromAttr({ OwnedCoupon: "owned_coupon", Search: "search" }[b] || (a ? "id_" + a.id : "feature")); return this }, saveAppJumpAttr: function (a) {
a =
a || {}; var b = a.scene, c = a.src_title_id; a = a.launcher_type; var d = null; b && (c && !a && (a = "(Not specified)"), "top" !== b && (d = "app_jump")); this.sessionStorage.setItem("analytics_appjump", JSON.stringify({ from: d, srcTitleId: c, launcherType: a }))
}, _addAppJumpEvent: function () {
var a = this.sessionStorage.getItem("analytics_appjump"); if (!a) return this; this.sessionStorage.removeItem("analytics_appjump"); a = JSON.parse(a); "caffeine_killer" === a.launcherType && this._addEvent("kntf", { launcher_type: "caffeine_killer", src_title_id: a.srcTitleId });
return this
}, sendMoviePlay: function (a) { this._addEvent("play_movie", { playMovieID: a }) }, sendPurchaseAttr: function (a) { a = this._createEcommerceAttr("Purchase", a); this._addAttr(a); this.sendVirtualPV("VP_PurchaseCompletion") }, sendPurchaseConfirmAttr: function (a) { var b = [{ id: a }], c = this; a = function (a) { var d = { ecommerce: {} }; d.ecommerce[a] = { products: b }; c._addAttr(d) }; a("add"); this.sendVirtualPV("VP_Purchase_AddCart"); a("checkout"); this.sendVirtualPV("VP_PurchaseConfirmation") }, _createEcommerceAttr: function (a, b) {
var c =
b.couponCode ? "CODE_" + b.couponCode : b.couponInstanceCode ? "OWNED_COUPON_" + b.couponInstanceCode : "DID_NOT_USE_COUPON"; var f = "eu" === d.getRegionType(); return { currency: b.currency || null, ecommerce: { purchase: { actionField: { id: "" + b.trans_id, affiliation: a, revenue: b.price }, products: [{ id: b.id, coupon: c, dimension2: f && b.businessType || null, price: b.price, quantity: "1" }] } } }
}, sendError: function (a) { this._addEvent("event_error", { errorCode: a }) }
}; c.Analytics = new b
})(window); (function () {
Wood.Model.Base = Backbone.Model.extend({
defaults: function () { return this.constructor.DEFAULT_PARAM }, initialize: function (a) { this.setParam(a); this.setup() }, store: Wood.ModelStore.getInstance(), setup: function () { this.storageCache && this.storageCache.autosave && this.listenTo(this, "sync", this.saveStorageCache) }, setParam: function (a) { _.extend(this, a) }, initByProperty: function (a) { this.set(a) }, initByPropertyOrQuery: function (a) {
_.every(_.map(this.queryParamKeys, function (b) { return _.has(a, b) })) ? this.setParam(a) :
this.initByProperty(a)
}, getAttributes: function () { var a = $.extend({}, this.attributes), b = this.defaults(); _.each(b, function (b, d) { delete a[d] }); return a }, storageCache: null, _assertCacheInfo: function () { if (!this.storageCache) throw Error("storageCache not defined"); return this.storageCache }, saveStorageCache: function () { var a = this._assertCacheInfo(), b = a.storage.getRawInstance(); b.setItem(a.keyname, JSON.stringify(this.getAttributes())); a.flush_on_save && _.isFunction(b.write) && b.write() }, hasStorageCache: function () {
var a =
this._assertCacheInfo(); return !!a.storage.getRawInstance().getItem(a.keyname)
}, loadStorageCache: function () { var a = this._assertCacheInfo(), b = a.storage.getRawInstance(); a = JSON.parse(b.getItem(a.keyname)); this.set(a); _.isFunction(this.afterLoad) && this.afterLoad() }, removeStorageCache: function () { var a = this._assertCacheInfo(); a.storage.getRawInstance().removeItem(a.keyname) }, loadOrFetch: function (a) { this.storageCache && this.hasStorageCache() ? this.loadStorageCache() : this.fetch(a) }, getBaseAjaxParam: function () {
var a =
this; return {
beforeSend: function (b, c) { $(window).on("beforeunload", function () { 4 !== b.readyState && (Wood.log("[Ajax Warning] request cancelled by user operation. text=" + b.statusText + " url=" + a.url()), b.abort()) }) }, error: function (b, c, d) {
if ((d = c.responseText ? JSON.parse(c.responseText) : null) && d.error) { var f = d.error.code; var q = d.error.message; for (var p = b.getIgnoreErrors(), n = p.length, A = 0; A < n; A++)if (p[A] === f) return b.hasDeferred() && b.getDeferred().resolve(), !1 } wood.client.handleAjaxError(c, a); d && d.error && (a.set("error_code",
f), a.set("error_message", q)); _.isFunction(a.afterError) && a.afterError.call(a)
}
}
}, ignoreError: function (a) { this.ignore_errors || (this.ignore_errors = []); this.ignore_errors.push(a) }, getIgnoreErrors: function () { return this.ignore_errors || [] }, getErrorPrefix: function () { var a = this.url().split("://")[1].split(/(\.|\-|cdn)/)[0]; return "samurai" === a ? Wood.SystemConfig.PREFIX_SAMURAI : "ninja" === a ? Wood.SystemConfig.PREFIX_NINJA : null }, fetchJSON: function (a) {
a.data || (a.data = {}); a.data._type = "json"; if (this.hasDeferred()) {
var b =
function (a, b) { return _.isFunction(a) ? _.compose(b, a) : b }; a.success = b(a.success, this.getDeferred().resolve); a.error = b(a.error, this.getDeferred().reject); a.async = !0
} b = function () { }; if (this.canUseStore()) { var c = this.getCacheKey(a); b = this.store.get(c); if (null !== b) { this.set(this.parse(b, a)); this.hasDeferred() && this.getDeferred().resolve(); return } var d = this; b = function (a) { d.store.add(c, a) } } Backbone.Model.prototype.fetch.call(this, a).done(b)
}, getPromise: function (a) {
this.set({ deferred: $.Deferred() }); this.storageCache &&
this.hasStorageCache() ? (this.loadStorageCache(), this.getDeferred().resolve()) : this.fetch(a); return this.getDeferred().promise()
}, getSafe: function (a) { var b = null; a = a.split("."); for (var c = a.length, d = 0; d < c; d++) { null === b && (b = this.attributes); if (Wood.Util.isUndefined(b[a[d]])) { b = null; break } b = b[a[d]] } return b }, isError: function () { return Wood.Util.isDefined(this.getErrorCode()) }, getErrorCode: function () { return this.get("error_code") }, getErrorMessage: function () { return this.get("error_message") }, getDeferred: function () { return this.get("deferred") },
hasDeferred: function () { return Wood.Util.isDefined(this.getDeferred()) }, getCacheKey: function (a) { return this.url() + "@" + JSON.stringify(a) }, canUseStore: function () { return !!this.use_store }
}, { DEFAULT_PARAM: { error_code: null, error_message: null, deferred: null }, createGetters: function (a, b) { _.each(b, function (b, d) { a.prototype[d] = function () { return this.getSafe(b) } }) } })
})(); (function () { Wood.Model.MoneyType = Wood.Model.Base.extend({ getAmount: function () { return this.get("amount") }, getCurrency: function () { return this.get("currency") }, getRawValue: function () { return this.get("raw_value") }, isFree: function () { return 0 === parseFloat(this.getRawValue(), 10) } }) })(); (function () {
Wood.Model.IdArray = Wood.Model.Base.extend({
initialize: function () { this.ids = []; this.setup() }, getIds: function () { return this.ids }, loadIds: function (a) { var b = []; if (Wood.Util.isUndefined(a) || !a.length) return a; a.forEach(function (a) { a && a.id && b.push(a.id.toString()) }); this.ids = b }, addId: function (a) { this.ids.push(a.toString()) }, removeId: function (a) { this.ids = this.ids.filter(function (b) { return b !== a.toString() }) }, contains: function (a) {
var b = this.ids.length; if (0 === b) return !1; for (var c = 0; c < b; c++)if (this.ids[c] ===
a) return !0; return !1
}, isEmpty: function () { return 0 === this.ids.length }, toCSV: function () { return this.ids.join(",") }, loadCSV: function (a) { this.ids = a.split(",") }
})
})(); (function () {
Wood.Model.CountryInfo = Wood.Model.Base.extend({
url: function () { return Wood.UrlPrefix.NINJA + "ws/country/" + this.country }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", data: { lang: this.lang }, async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.country_detail }, getISOCode: function () { return this.get("iso_code") }, getName: function () { return this.get("name") }, getDefaultLanguageCode: function () { return this.get("default_language_code") },
isLanguageSelectable: function () { return this.get("language_selectable") }, getMaxCacheSpec: function () { return this.get("max_cash") }, isLoyaltySystemAvailable: function () { return this.get("loyalty_system_available") }, isLegalPaymentMessageRequired: function () { return this.get("legal_payment_message_required") }, isLegalBusinessMessageRequired: function () { return this.get("legal_business_message_required") }, isTaxExcluded: function () { return this.get("tax_excluded_country") }, isPrepaiedCardAvailable: function () { return this.get("prepaid_card_available") },
isCreditCardAvailable: function () { return this.get("credit_card_available") }, isNfcAvailable: function () { return this.get("nfc_available") }, isCouponAvailable: function () { return this.get("coupon_available") }, isMyCouponAvailable: function () { return this.get("my_coupon_available") }, getTimeBasedRestrictions: function () { var a = this.get("time_based_restrictions"); return Wood.Util.isUndefined(a) ? [] : a.time_based_restriction }
})
})(); (function () { Wood.Model.Balance = Wood.Model.MoneyType.extend({ url: function () { return Wood.UrlPrefix.NINJA + "ws/my/balance/current" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", data: { lang: this.language }, async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.balance } }) })(); (function () { Wood.Model.OrderList = Wood.Model.IdArray.extend({ url: function () { return Wood.UrlPrefix.NINJA + "ws/my/owned_titles" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { a = a.owned_titles.owned_title; this.loadIds(a); return a } }) })(); (function () {
function a(a, b, f) { return !!a } function b(a) { return parseInt(a, 10) } Wood.Model.DeviceOrderList = Wood.Model.Base.extend({
initialize: function (c) { c = c || {}; _.isString(c.title_ids) && _.isString(c.rvc_title_ids) ? (this.title_ids = c.title_ids.split(",").filter(a).map(b), this.rvc_title_ids = c.rvc_title_ids.split(",").filter(a).map(b)) : (this.title_ids = c.title_ids, this.rvc_title_ids = c.rvc_title_ids); this.setup() }, url: function () { return Wood.UrlPrefix.NINJA + "ws/my/shared_title_ids" }, fetch: function (a) {
var b =
this.getBaseAjaxParam(); $.extend(b, { type: "GET", async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b)
}, parse: function (a) { var b = this; b.title_ids = []; b.rvc_title_ids = []; a.owned_titles && a.owned_titles.owned_title && Wood.Util.each(a.owned_titles.owned_title, function (a, c) { b.title_ids.push(c.id) }); a.owned_wii_titles && a.owned_wii_titles.owned_title && Wood.Util.each(a.owned_wii_titles.owned_title, function (a, c) { b.rvc_title_ids.push(c.id) }); return a }, contains: function (a) {
for (var b = this.title_ids.concat(this.rvc_title_ids),
c = b.length, q = 0; q < c; q++)if (b[q] === a) return !0; return !1
}, getTitleIds: function () { return this.title_ids }, getRVCTitleIds: function () { return this.rvc_title_ids }, getAllIds: function () { return this.title_ids.concat(this.rvc_title_ids) }, getTitleIdString: function () { return this.title_ids.join(",") }, getRVCTitleIdString: function () { return this.rvc_title_ids.join(",") }
})
})(); (function () {
var a = { BOTH: "4,5", CAFE: "5", CTR: "4" }; Wood.Model.WishList = Wood.Model.IdArray.extend({
defaults: function () { return _.defaults({ device: a.BOTH }, Wood.Model.IdArray.prototype.defaults()) }, storageCache: { keyname: "_wishlist_v2", storage: Wood.LocalStorage, flush_on_save: !0, autosave: !1 }, url: function () { return Wood.UrlPrefix.NINJA + "ws/my/wishlist" }, fetch: function (a) {
var b = this.getBaseAjaxParam(), d = { sort: "registered", "device[]": this.getDevice() }; $.extend(b, { type: "GET", async: !1, data: d, xhrFields: { withCredentials: !0 } });
$.extend(b, a); this.fetchJSON(b)
}, add: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { url: this.url() + "/!put", type: "POST", async: !1, xhrFields: { withCredentials: !0 }, data: { id: a } }); Backbone.Model.prototype.fetch.call(this, b); this.addId(a); return this.isError() && parseInt(this.getErrorPrefix() + this.getErrorCode(), 10) === Wood.ErrorCode.WISHLIST_FULL ? !1 : !0 }, remove: function (a) {
var b = this.getBaseAjaxParam(); $.extend(b, { url: this.url() + "/" + a + "/!delete", type: "POST", async: !1, xhrFields: { withCredentials: !0 } });
$.ajax(b); var d = this; _.each(this.attributes, function (b, c) { b && a === b.id && delete d.attributes[c] }); this.removeId(a); var f = this.attributes; Wood.Util.each(this.getAttributes(), function (b, c) { if (c.id === a) return delete f[b], !1 }); this.attributes = f
}, parse: function (a) { if (a.wishlist) { var b = a.wishlist.wished_title; this.loadIds(b) } return b }, afterLoad: function () { this.loadIds(_.values(this.attributes)) }, isFull: function () { return 200 <= this.getIds().length }, getTitlesData: function () {
var a = []; if (0 === this.ids.length) return a;
var c = this.getAttributes(); Wood.Util.each(c, function (b, c) { a.push(c) }); return a
}, getDevice: function () { return this.attributes.device }
}, { DeviceCode: a })
})(); (function () { Wood.Model.Dictionary = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.SAMURAI + "ws/" + this.country + "/dictionary" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", data: { lang: this.language }, async: !0, xhrFields: { withCredentials: !1 } }); $.extend(b, a); this.fetchJSON(b) }, getItems: function () { return this.get("items") } }) })(); (function () {
Wood.Model.LocalizedMessage = Wood.Model.Base.extend({
url: function () { return "./message/messages-" + this.resource_key + ".xml" }, initialize: function (a) { _.extend(this, a); this.fetched = !1; this.parsed = {}; this.setup() }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { url: this.url(), type: "GET", contentType: "application/xml", dataType: "xml", async: !1 }); $.extend(b, a); Backbone.Model.prototype.fetch.call(this, b) }, parse: function (a) {
var b = {}; $(a).find("entry").each(function () {
var a = $(this).attr("key"),
d = $(this).text(); b[a] = d
}); this.fetched = !0; return this.parsed = b
}, getText: function (a) { this.fetched || this.fetch(); var b = this.get(a); return b ? b : (Wood.log("[warn] text not found for label: " + a), "") }, toJSON: function () { return JSON.stringify(this.parsed) }, loadJSON: function (a) { this.set(JSON.parse(a)); this.fetched = !0 }
})
})(); (function () {
Wood.Model.NinjaSession = Wood.Model.Base.extend({
url: function () { return Wood.UrlPrefix.NINJA + "ws/my/session/!open" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "POST", data: { lang: this.language, country: this.country, ver: 1 }, async: !1, xhrFields: { withCredentials: !0 }, headers: { "X-Nintendo-ServiceToken": this.service_token } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.session_config }, getPrincipalId: function () { return this.get("pid") }, getAccountId: function () { return this.get("account_id") },
getCountry: function () { return this.get("country") }, getSavedLanguage: function () { return this.get("saved_lang") }, isShopAccountInitialized: function () { return this.get("shop_account_initialized") }, getOwnedTitlesModified: function () { return this.get("owned_titles_modified") }, getSharedTitlesModified: function () { return this.get("shared_titles_last_modified") }, getOwnedWiiTitlesLastModified: function () { return this.get("owned_wii_titles_last_modified") }, getWishlistLastModified: function () { return this.get("wishlist_last_modified") },
getParentalControl: function () { return this.getSafe("parental_controls.parental_control") }, getAge: function () { return this.get("age") }, getId: function () { return this.get("id") }, getMii: function () { return this.get("mii") }, toJSON: function () { return JSON.stringify(this.getAttributes()) }, loadJSON: function (a) { return this.set(JSON.parse(a)) }
})
})(); (function () {
Wood.Model.PseudoNinjaSession = Wood.Model.Base.extend({
url: function () { return Wood.UrlPrefix.NINJA + "debug/my/session/!open" }, initialize: function (a) { _.extend(this, a); this.opened = !1; this.setup() }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "POST", async: !1, data: { lang: this.language, country: this.country, pid: this.pid }, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { a && a.session_config && (this.opened = !0); return a.session_config }, isOpened: function () { return this.opened },
getPrincipalId: function () { return this.get("pid") }, getAccountId: function () { return this.get("account_id") }, getCountry: function () { return this.get("country") }, getSavedLanguage: function () { return this.get("saved_lang") }, isShopAccountInitialized: function () { return this.get("shop_account_initialized") }, getOwnedTitlesModified: function () { return this.get("owned_titles_modified") }, getSharedTitlesModified: function () { return this.get("shared_titles_last_modified") }, getOwnedWiiTitlesLastModified: function () { return this.get("owned_wii_titles_last_modified") },
getAge: function () { return this.get("age") }, getId: function () { return this.get("id") }, toJSON: function () { return JSON.stringify(this.getAttributes()) }, loadJSON: function (a) { return this.set(JSON.parse(a)) }
})
})(); (function () { Wood.Model.DebugServiceToken = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.NINJA + "debug/api/service_token" }, initialize: function (a) { this.param = a; this.token = null; this.setup() }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", data: this.param, dataType: "text", async: !1 }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return this.token = a }, getToken: function () { return this.token } }) })(); (function () {
Wood.Model.TitlePublicStatus = Wood.Model.Base.extend({
url: function () { return Wood.UrlPrefix.NINJA + "ws/" + this.country + "/title/public_status" }, fetch: function (a) { var b = this.getBaseAjaxParam(); var c = this.id.toString(); c = 0 === c.indexOf("0005") || 0 === c.indexOf("0004") ? { title_id: c } : { ns_uid: c }; this.language && (c.lang = this.language); $.extend(b, { type: "GET", data: c, async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.title_public_status }, getPublicStatus: function () { return this.get("public_status") },
isPublic: function () { return "PUBLIC" === this.getPublicStatus() }, isUnseachable: function () { return "UNSEARCHABLE" === this.getPublicStatus() }, getType: function () { return this.get("type") }, getNsUid: function () { return this.get("ns_uid") }, getTitleId: function () { return this.get("title_id") }
})
})(); (function () { Wood.Model.AocItemNsuid = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.NINJA + "ws/" + this.country + "/aoc/" + this.item_code + "/ns_uid" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "GET", async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.aoc }, getNsuid: function () { return this.get("id") } }) })(); (function () {
Wood.Model.VotableList = Wood.Model.Base.extend({
LIMIT: 25, OFFSET: 0, PLAY_TIME: "60", is_upload_agreed: !1, has_votable_titles: !1, url: function () { return this.is_upload_agreed ? Wood.UrlPrefix.NINJA + "ws/my/votable_titles" : Wood.UrlPrefix.NINJA + "ws/my/instant_votable_titles" }, fetch: function (a) { var b = this.getBaseAjaxParam(), c = this.getRequestData(); a && _.isNumber(a.offset) && (c.offset = a.offset); $.extend(b, { type: "GET", async: !1, data: c, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, put: function (a) {
var b =
this.getBaseAjaxParam(); $.extend(b, { url: this.url() + "/!put", type: "POST", async: !1, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b)
}, isUploadAgreed: function () { if (wood.client.isWiiU()) { var a = wiiuSystemSetting.getSpotPassUploadConsoleInfoState(); wood.client.shutdownIfError(a); return a.enable } return !0 }, hasVotableTitles: function () { return wood.client.isWiiU() ? (this.data || this.setupData(), this.has_votable_titles) : !0 }, getRequestData: function () { this.data || this.setupData(); return this.data }, setupData: function () {
this.limit =
this.limit || this.LIMIT; var a = { lang: this.language, offset: this.offset || this.OFFSET, limit: this.limit }; if (this.is_upload_agreed = this.isUploadAgreed()) wood.client.isWiiU() && this.updateCandidates(); else { var b = [], c = this.getCandidates(); c && c.IDs && 0 < c.IDs.length && (this.has_votable_titles = !0, b = c.IDs); a["titleIds[]"] = b.join(",") } this.data = a
}, getCandidates: function () { return wiiuPDM.getTitlesFilteredByPlayTime(this.PLAY_TIME) }, updateCandidates: function () {
var a = this.getCandidates().IDs; 0 < a.length ? (this.has_votable_titles =
!0, a = a.join(","), this.put({ data: { "titleIds[]": a }, success: function () { Wood.log("SUCCESS :played titles saved!") } })) : this.has_votable_titles = !1
}, getContents: function () { return this.get("contents") }, saveList: function (a) { var b = this, c = this.getRequestData(), d = function (b) { wood.client.getSessionStorage().setItem(Wood.Client.StorageKey.VOTABLE_DATA, JSON.stringify(b)); a(b) }; !this.has_votable_titles || !this.is_upload_agreed && "" === c["titleIds[]"] ? d({ content: null }) : this.fetch({ async: !0, cache: !1, success: function (a) { d(b.getContents()) } }) },
loadList: function () { var a = wood.client.getSessionStorage().getItem(Wood.Client.StorageKey.VOTABLE_DATA); return JSON.parse(a) }, getTotal: function () { var a = this.attributes.contents; return a && a.total ? parseInt(this.attributes.contents.total, 10) : 0 }
})
})(); (function () {
Wood.View.Base = Backbone.View.extend({
initialize: function () { this.setup() }, setup: function () { _.defaults(this, this.options); this.assignedViews = {} }, presenter: function () { return null }, render: function () { _.isFunction(this.template) && this.$el.html(this.template(this.presenter())); _.each(this.assignedViews, function (a, b) { a.setElement(this.$(b)).render() }, this); this.afterRender(); return this }, afterRender: function () { this.localizeText(); this.hookSE() }, assign: function (a, b) { this.assignedViews[a] = b }, localizeText: Wood.DomUtil.localizeText,
hookSE: function (a) { a = a || this.$el; Wood.DomUtil.hookSoundEffectEvent(a) }, getRatingStarInfo: function (a) { var b = !1, c = null, d = null; if (a.star_rating_info) { var f = a.star_rating_info.score; f && (b = !0, c = (new Wood.StarRating(f)).getImagePath(), a.star_rating_info.votes && (d = a.star_rating_info.votes)) } return { has_rating: b, rating_img_path: c, rating_votes: d } }
})
})(); (function () {
var a = { DEFAULT: 1, TOP: 2, MENU: 3, BALANCE: 4, SEARCH: 5, PURCHASE: 6, PURCHASED: 7, CLOSE: 8, AOC_SEARCH: 9 }, b = { DEFAULT: "x,y,+,-", TOP: "y,+,-,exit", MENU: "x,+,-", BALANCE: "x,y", SEARCH: "x,y,+", PURCHASE: "x", PURCHASED: "x,exit", CLOSE: "", AOC_SEARCH: "x" }, c = { x: ["X", "#top_link_01 > div"], y: ["Y", "#top_link_02:not(.off):not(.on) > div"], "+": ["PLUS", "#top_link_03 > div"], "-": ["MINUS", "#top_link_04 > div"], exit: ["A", "#top_link_06 > div"] }, d = _.throttle(function (a, b, c) { return a.apply(c, b) }, 1E3, { trailing: !1 }); Wood.View.MenuBar =
Backbone.View.extend({
initialize: function () { this.$body = $("body"); this.$el = this.options.$wrap.find("#sel_menu_bar"); this.$window = $(window); this.initial_back_event = this.initial_type = this.top_event = this.mymenu_event = this.close_event = this.back_event = this.type = null }, setup: function (a) {
this.resetAllButtonEvent(); this.render(a); var b = wood.client.getNinjaSession(); (b = b ? b.getMii() : null) && b.icon_url && this.$("#top_link_02 img").attr("src", b.icon_url); this.setTouchEvents(); this.setButtonEvents(a); Wood.DomUtil.hookLabelSoundEffectEvent(this.$el);
wood.client.storeBalance(); this.$("#balance").text(wood.client.getSessionStorage().getItem(Wood.Client.StorageKey.BALANCE_AMOUNT)); b = this.$("#ft_navi .menu span"); wood.client.hasUnReadOwnedCoupon() ? b.addClass("attention-mark") : b.removeClass("attention-mark"); this.type = a; return this
}, template: _.template('{{ if (type === TYPE.CLOSE) { }}<ul id="ft_navi_popup"><li id="top_link_07" class="close"><div data-href="">{{= t7 }}</div></li></ul>{{ } else { }}<ul id="ft_navi"><li id="top_link_01"{{ if (type === TYPE.TOP) { }} class="top on"><div>{{ } else { }} class="top"><div data-href="{{= top_link }}" class="se" data-se-label="SE_WAVE_OK_SUB">{{ } }}<span>{{= t1 }}</span></div></li><li id="top_link_02"{{ if (type === TYPE.MENU) { }} class="menu on"><div>{{ } else if (_.contains([TYPE.BALANCE, TYPE.PURCHASE, TYPE.PURCHASED, TYPE.AOC_SEARCH], type)) { }} class="menu off"><div>{{ } else { }} class="menu"><div data-href="">{{ } }}<img src="image/img_unknown_MiiIcon.png" width="70" height="70"/><br/><span>{{= t2 }}</span></div></li><li id="top_link_03"{{ if (type === TYPE.BALANCE) { }} class="balance on"><div>{{ } else if (_.contains([TYPE.PURCHASE, TYPE.PURCHASED, TYPE.AOC_SEARCH], type)) { }} class="balance off"><div>{{ } else { }} class="balance"><div data-href="money01_01.html" class="se" data-se-label="SE_WAVE_OK_SUB">{{ } }}<span>{{= t3 }}</span><span id="balance"></span></div></li><li id="top_link_04"{{ if (type === TYPE.SEARCH) { }} class="search on"><div>{{ } else if (_.contains([TYPE.PURCHASE, TYPE.PURCHASED, TYPE.AOC_SEARCH, TYPE.BALANCE], type)) { }} class="search off"><div>{{ } else { }} class="search"><div data-href="always02_01.html" class="se" data-se-label="SE_WAVE_OK_SUB">{{ } }}<span>{{= t4 }}</span></div></li>{{ if (_.contains([TYPE.TOP, TYPE.PURCHASED], type)) { }}<li id="top_link_06" class="exit"><div data-href=""><span>{{= t6 }}</span></div></li>{{ } else { }}<li id="top_link_05" class="back"><div data-href=""><span>{{= t5 }}</span></div></li>{{ } }}</ul>{{ } }}'),
isIndex: function () { return !!$(".js-top").length }, render: function (b) { var c = this.top_link = this.isIndex() ? "#top" : "./#top"; this.$el.html(this.template({ TYPE: a, type: b, top_link: c, t1: wood.client.getText("common01_01_038"), t2: wood.client.getText("common01_01_002"), t3: wood.client.getText("common01_01_020"), t4: wood.client.getText("common01_01_003"), t5: wood.client.getText("common01_01_001"), t6: wood.client.getText("common01_01_010"), t7: wood.client.getText("common01_01_008") })) }, setTouchEvents: function () {
var a =
this.$el.find("[data-href]"), b = this, c = "#top" === location.hash; a.each(function (a, f) {
var n = $(f), p = n.parent(); n.on("click", function (a) { a.preventDefault(); p.hasClass("back") || p.hasClass("menu") || p.hasClass("close") || d(function () { p.addClass("on"); if (!p.hasClass("top") || !_.isFunction(b.top_event) || b.top_event()) { var a = n.data("href"); a && _.delay(function () { b.isIndex() && !c && a === b.top_link && b.fixScrollTemporary(); location.href = a }, 30) } }) }).on("touchstart", function (a) { p.addClass("on"); wood.client.playSound("SE_WAVE_HWKEY_MENU_TRG") }).on("touchend",
function (a) { p.removeClass("on") })
})
}, setButtonEvents: function (c) { var d = this; c = _.invert(a)[c]; if (c = b[c]) c = c.split(","), _.each(c, function (a) { d.hookButtonEvent(a) }) }, hookButtonEvent: function (a) {
var b = c[a], d = b[0], f = this.$(b[1]); if ("exit" === a) b = function (a) { wood.client.playSound("SE_WAVE_EXIT"); wood.client.isWiiU() && (a.preventDefault(), wood.client.shutdown()) }, f.on("keydown", Wood.KeyEvent[d](b)).on("click", b); else {
var A = this, H = this.initial_type === Wood.View.MenuBar.Type.TOP; this.$body.on("keydown", Wood.KeyEvent[d](function () {
wood.client.playSound("SE_WAVE_HWKEY_MENU_TRG");
if ("x" !== a || !_.isFunction(A.top_event) || A.top_event()) if (H && "x" === a) wood.client.playSound("SE_WAVE_OK_SUB"), f.parent().addClass("on"), _.delay(function () { A.back_event() }, 30); else { var b = f.data("href"); b ? (b === A.top_link && A.fixScrollTemporary(), f.parent().addClass("on"), wood.client.playSound("SE_WAVE_OK_SUB"), _.defer(function () { wood.client.redirectTo(b) })) : f.trigger("click") }
}))
}
}, unhookButtonEvent: function () { this.$body.off("keydown") }, fixScrollTemporary: function () {
this.options.$wrap.css({
position: "fixed",
top: "-" + this.$window.scrollTop() + "px"
}); var a = _.bind(this.allowScroll, this); _.delay(a, 1E3)
}, allowScroll: function () { this.options.$wrap.css({ position: "static", top: 0 }) }, triggerBack: function () { this.trigger("back", { scroll_top: this.$window.scrollTop() }) }, removeClassBackButton: function () { this.$("#top_link_05, #top_link_07").removeClass("on") }, hookBackEvent: function (a) {
var b = this, f = function (c) {
c.preventDefault(); wood.client.playSound("SE_WAVE_HWKEY_MENU_TRG"); wood.client.playSound("SE_WAVE_BACK"); var d = b.$("#top_link_05, #top_link_07").addClass("on");
_.delay(function () { b.fixScrollTemporary(); b.triggerBack(); !1 === a() && d.removeClass("on") }, 30)
}; this.$body.on("keydown", Wood.KeyEvent.B(function (a) { d(f, [a]) })); this.$("#top_link_05 > div").on("click", function (c) { c.preventDefault(); d(function () { wood.client.playSound("SE_WAVE_BACK"); b.fixScrollTemporary(); b.triggerBack(); a() }) }); this.$("#top_link_07 > div").on("click", function (b) { b.preventDefault(); d(function () { wood.client.playSound("SE_WAVE_BACK"); a() }) }); if (this.initial_type === Wood.View.MenuBar.Type.TOP) this.$(c.x[1]).on("click",
function (b) { b.preventDefault(); a() }); this.back_event = a; this.close_event = null
}, hookCloseEvent: function (a) {
var b = this, c = function (c) { c.preventDefault(); wood.client.playSound("SE_WAVE_HWKEY_MENU_TRG"); wood.client.playSound("SE_WAVE_CANCEL"); b.$("#top_link_07").addClass("on"); _.delay(function () { a() }, 30) }; this.$body.on("keydown", Wood.KeyEvent.B(function (a) { d(c, [a]) })); this.$("#top_link_07 > div").on("click", function (b) { b.preventDefault(); d(function () { wood.client.playSound("SE_WAVE_CANCEL"); a() }) }); this.close_event =
a; this.back_event = null
}, hookMymenuEvent: function (a) { var b = this.$(c.y[1]); b.on("click", function (c) { c.preventDefault(); d(function () { b.parent().addClass("on"); wood.client.playSound("SE_WAVE_OK_SUB"); _.delay(a, 30) }) }); this.mymenu_event = a }, hookTopEvent: function (a) { this.top_event = a }, resetAllButtonEvent: function () { this.$body.off("keydown") }, saveInitialState: function () { this.initial_type || (this.initial_type = this.type, this.initial_back_event = this.back_event) }, selectMenu: function (a) {
this.saveInitialState();
this.type = Wood.View.MenuBar.Type.MENU; this.hookBackEvent(a); this.rebuild(); this.$(c.y[1]).off()
}, rebuild: function () { this.setup(this.type); this.back_event && this.hookBackEvent(this.back_event); this.close_event && this.hookCloseEvent(this.close_event); this.mymenu_event && this.hookMymenuEvent(this.mymenu_event) }, revert: function () { this.type = this.initial_type; this.hookBackEvent(this.initial_back_event); this.rebuild() }
}); Wood.View.MenuBar.Type = a
})(); (function () {
Wood.View.Common.Pagination = Wood.View.Base.extend({
per_page: 25, store_history: !0, events: { "click .evt_pager_num": "onClickPageNumber", "click .evt_pager_next, .evt_pager_prev": "onClickNext", "click a": "onClickAnchor" }, initialize: function (a, b) { this.template = Wood.Template.get("common", "#pagination"); this.setup(); this.pagenation = new Wood.Pagenation(1, this.per_page, 1) }, setTotalCount: function (a) { this.pagenation.setTotalCount(a) }, presenter: function () {
var a = this.pagenation, b = a.getCurrentPage(), c =
a.getNaviPages(); return { pages: _.map(c, function (a) { return { page: a, is_self: a === b } }), total_page: a.getTotalPage(), current_page: b, prev_page: a.getPrevPage(), next_page: a.getNextPage() }
}, onClickPageNumber: function (a) { $(".pagenation li[class=current]").removeClass("current").addClass("page"); $(a.currentTarget).parent().removeClass("page").addClass("current") }, onClickNext: function (a) { $(a.currentTarget).parent().removeClass("on").addClass("selected") }, onClickAnchor: function (a) {
this.store_history || (a.preventDefault(),
wood.client.redirectReplaceTo(a.currentTarget.href))
}
})
})(); (function () {
Wood.View.Common.PushToWishlist = Wood.View.Base.extend({
className: "el-wish", options: { short_label: !1, selector_add: "#str_wishlist", selector_add_short: "#str_wishlist_short", selector_done: "#str_wishlist_done" }, initialize: function () {
this.template = Wood.Template.get("common", "#template_wishlist"); var a = this.options; a.controller && a.controller.$wrap && (this.$el = a.controller.$wrap.find("." + this.className)); this.is_single = _.isString(a.ns_uid); this.ids = a.ns_uid; this.text_add = $(a.short_label ? a.selector_add_short :
a.selector_add).html(); this.text_done = $(a.selector_done).html(); this.render()
}, render: function () { var a = this; this.$el.children().remove(); var b = new Wood.Model.WishList; b.loadOrFetch(); if (a.is_single) { var c = b.contains(a.ids); a.appendTemplate(a.ids, c) } else _.each(a.ids, function (c) { var d = b.contains(c.toString()); a.appendTemplate(c, d) }); a.$el.find("a").on("click", function (b) { a.eventRegister(b, a) }); return this }, appendTemplate: function (a, b) {
(this.is_single ? this.$el : $("#el-wish-" + a)).append(this.template({
is_registered: b,
str_wishlist: this.text_add, str_wishlist_done: this.text_done, data_title_id: a
}))
}, confirmListOverflow: function () { var a = wood.client.confirm($("#dialog_msg_wish").text(), $("#dialog_later").text(), $("#dialog_watch").text()); a && wood.client.redirectTo("wish01_01.html"); return a }, eventRegister: function (a, b) {
a.preventDefault(); a = $(a.currentTarget); wood.client.playSound("SE_WAVE_CHECKBUTTON_CHECK"); wood.client.disableUserOperation(!0); var c = new Wood.Model.WishList; c.fetch(); if (c.isFull()) c.saveStorageCache(),
this.confirmListOverflow(), wood.client.enableUserOperation(); else { wood.client.disableHomeButton(!0); var d = a.data("title-id"); c.add(d) ? (c.fetch(), c.saveStorageCache(), wood.client.enableUserOperation(!0), wood.client.enableHomeButton(!0), a.remove(), b.appendTemplate(d, !0), wood.client.playSound("SE_WAVE_OK"), Wood.log("RegisterWishList: status success")) : (this.confirmListOverflow(), wood.client.enableUserOperation(), wood.client.enableHomeButton()) }
}
})
})(); (function () {
Wood.View.Mymenu = Wood.View.Base.extend({
id: "mymenu", max_icons: 5, initialize: function () { this.template = Wood.Template.get("mymenu", "#main"); this.setup() }, presenter: function () { var a = wood.client.getNinjaSession(); return { data: { mii: a ? a.getMii() || {} : {}, wish: this.getWishList(), is_address_available: wood.client.isAddressAvailable(), is_lang_selectable: wood.client.ls.isLangSelectable(), is_owned_coupon_available: wood.client.isMyCouponAvailable(), is_club_available: wood.client.isLoyaltySystemAvailable() } } },
afterRender: function () { Wood.DomUtil.lazyload(this.$(".wishlist li img")); this.localizeText(); this.hookSE(); this.hookEvent(); this.getVotableList(); this.renderOwnedCoupon(); this.hideCCardButton(); this.$balance = this.$(".amount").text(wood.client.getBalanceAmount()) }, getWishList: function () {
var a = this, b = this.options.controller, c = b.parseParam(), d = new Wood.Model.WishList; d.loadOrFetch(); if (d.isEmpty()) return Wood.log("mymenu:getWishList: empty"), null; var f = []; _.some(d.getAttributes(), function (d, p) {
p = d.id;
if (!p) return !1; var n = d.platform.id; if (_.contains(Wood.SystemConfig.getExclusionPlatformIds(), n)) return !1; d = d.icon_url; /^title\?/.test(Backbone.history.fragment) && p.toString() === c.title ? n = "#closeMymenu" : (n = ($(".js-top").length ? "" : "./") + "#title", n = new Wood.URL(n, { title: p }), b.appendDirectlinkBeaconParam(n, "mymenu", "wish01"), n = n.toString()); if (f.length >= a.max_icons) return !0; f.push({ id: p, icon: d, url: n })
}); return f
}, hookEvent: function () {
var a = this; if (!this.options.controller.isMymenuOpen) this.$("a:not(#evt_show_all, #js-help)").on("click",
function (a) { a.preventDefault(); wood.client.redirectTo($(a.currentTarget).attr("href")) }); this.$("#evt_show_all").on("click", function (b) { b.preventDefault(); $(this).hide(); a.$(".setting > ul").show() }); this.$(".help a").on("click", function (b) { b.preventDefault(); a.openHelp() }); this.$(".wishlist a[href=#closeMymenu]").on("click", function (b) { b.preventDefault(); a.options.controller.closeMymenu() })
}, getVotableList: function () {
var a = this, b = new Wood.Model.VotableList({ language: wood.client.language, limit: this.max_icons });
if (b.isUploadAgreed()) { var c = b.loadList(); c ? this.renderVotableList(c.content) : b.saveList(function (b) { a.renderVotableList(b.content) }) } else this.renderVotableList(null)
}, renderOwnedCoupon: function () { var a = this.$(".show-owned-coupon-list"); wood.client.hasUnReadOwnedCoupon() ? a.addClass("attention-mark") : a.removeClass("attention-mark") }, renderVotableList: function (a) { a = new Wood.View.Mymenu.VotableList({ list: a, controller: this.options.controller }); this.$(".recommend").empty().append(a.render().$el.children()) },
hideCCardButton: function () { "false" === wood.client.getSessionStorage().getItem("credit_card_available") && this.$(".ccard").hide() }, openHelp: function () { var a = this; this.$el.hide(); this.help ? this.help.$el.show() : (this.help = new Wood.View.Mymenu.Help, this.$el.parent().append(this.help.render().el)); var b = a.options.controller.menuBar; b.setup(Wood.View.MenuBar.Type.CLOSE); b.hookCloseEvent(function () { a.closeHelp(); a.sendMymenuBeacon() }); this.sendHelpBeacon() }, closeHelp: function () {
var a = this; this.help.$el.hide();
this.$el.show(); var b = this.options.controller.menuBar; b.setup(Wood.View.MenuBar.Type.MENU); b.hookBackEvent(function () { a.options.controller.isMymenuOpen ? a.options.controller.closeMymenu() : wood.client.historyBack() })
}, reset: function () { this.help && "block" === this.help.$el.css("display") && this.closeHelp(); this.$el.off() }, reopen: function () { this.$el.off(); this.render(); this.$el.show() }, sendHelpBeacon: function () { }, sendMymenuBeacon: function () { }
})
})(); (function () {
Wood.View.Mymenu.VotableList = Wood.View.Base.extend({
max_icons: 5, initialize: function () { this.template = Wood.Template.get("mymenu", "#recommend"); this.setup() }, presenter: function () { var a = this.list, b = this.controller; _.each(a, function (a) { var c = new Wood.URL("reco01_02.html", { title: a.title.id }); b.appendDirectlinkBeaconParam(c, "mymenu", "reco01"); a.url = c.toString() }); return { data: { votable: a } } }, afterRender: function () { Wood.DomUtil.lazyload(this.$("li img")); this.localizeText(); this.hookSE(); this.hookEvent() },
hookEvent: function () { this.$("li a").on("click", function (a) { a.preventDefault(); a = $(this); var b = parseInt(a.data("age"), 10); wood.client.getAge() < b && "USA" !== wood.client.getRegion() ? wood.client.alert($("#mymenu_msg_age").text(), $("#mymenu_msg_ok").text()) : wood.client.redirectTo(a.attr("href")) }) }
})
})(); (function () { Wood.View.Mymenu.Help = Wood.View.Base.extend({ initialize: function () { this.template = Wood.Template.get("mymenu", "#help"); this.setup() }, presenter: function () { return { is_inquiry_available: wood.client.isInquiryAvailable() } } }) })(); (function () {
Wood.Modules.Controller.Base.Boot = function () { }; Wood.Modules.Controller.Base.Boot.prototype = {
handleBoot: function (a, b) { a && !a.isInBoot() ? this.lightBoot(a, b) : (this._prepareClient(), a = wood.client, this.boot(a, b)) }, boot: function (a, b) {
var c = [a, b], d = a.getUserAgent(); Wood.log("<boot> : getUserAgent = " + d.toString()); !a.isWiiU() || d.isWood() && d.isLatestVersionOrLater() || (a.showError(Wood.ErrorCode.CLOSE_APPLICATION), a.shutdown()); a.isInBoot() || (Wood.log("<boot> : setBGM"), this.setBGM(a)); $.ajaxSetup({ timeout: 55E3 });
a.verifyIVSSent(); Wood.DomUtil.hookSoundEffectEvent($("body")); a.storeBalance(); $('<div style="display:none;"><span id="dialog_msg_invalid_session" data-message="error01_01"></span></div>').appendTo("body"); a.prepareLocalizedText(); this.localizeText(); this.$wrap.show(); this.storeUserData(a.isInBoot(), b.isAppJump()); this.setDictionary(); a.enableUserOperation(!0); a.isInBoot() ? a.endStartUpWithBGM() : a.endStartUp(); this.setPageShowEvent(this, c)
}, setPageShowEvent: function (a, b) {
var c = b[0]; $(window).on("pageshow",
function (d) { c.isWiiU() && (window.wiiu.videoplayer.end(), wiiuBrowser.lockPowerButton(!1)); a.setBGM(c); a.callOnPageShow(a, b); d.originalEvent && d.originalEvent.persisted && (Wood.log("[pageshow] from back"), c.enableUserOperation(!0), c.enableHomeButton(!0), a.callOnPageShowCache(a, b)) })
}, callOnPageShow: function (a, b) { a &&_.isFunction(a.onPageShow) && a.onPageShow.apply(a, b) }, callOnPageShowCache: function (a, b) {
_.isFunction(a.onPageShowCacheDynamic) ? a.onPageShowCacheDynamic.apply(a, b) : (a.rebuildMenuBar(), a.mymenu &&
(a.mymenu.reset(), a.mymenu.render()), _.isFunction(a.onPageShowCache) && a.onPageShowCache.apply(a, b))
}, lightBoot: function (a, b) { Wood.DomUtil.hookSoundEffectEvent($("body")); a.prepareLocalizedText(); this.localizeText() }
}
})(); (function () {
Wood.Modules.Controller.Base.Beacon = function () { }; Wood.Modules.Controller.Base.Beacon.prototype = {
appendBeaconParam: function (a, b) { a.addQuery({ beacon: JSON.stringify(b) }) }, getBeaconParam: function (a) { var b = this.parseParam().beacon; return b ? (b = b.replace(/^(.*)#([^}]*?)$/, "$1"), JSON.parse(b)[a]) : null }, appendDirectoryBeaconParam: function (a, b, c, d, f) { this.appendBeaconParam(a, { directory: { id: b, index: c, alias: d, name: f } }) }, getDirectoryBeaconParam: function () { return this.getBeaconParam("directory") }, appendDirectlinkBeaconParam: function (a,
b, c) { this.appendBeaconParam(a, { directlink: { scene: b, from: c } }) }, getDirectlinkBeaconParam: function () { return this.getBeaconParam("directlink") }
}
})(); (function () {
Wood.Modules.Controller.Base.Client = function () { }; Wood.Modules.Controller.Base.Client.prototype = {
setCache: function (a) { this.cache = a }, _prepareClient: function () { wood.client && wood.client.isWiiU || (wood.client = new Wood.Client); wood.client.loadSystemSetting(); var a = null; this.cache && this.cache.country === wood.client.country && this.cache.language === wood.client.language && (Wood.log("<_prepareClient> country cache hit"), a = this.cache.country_info); wood.client.storeCountryInfo(a); wood.client.updateUserSession() },
setBGM: function (a) { switch (this.BGM || "main") { case "main": a.playSound("BGM_WAVE_MAIN", 3); break; case "setting": a.playSound("BGM_WAVE_SETTING", 3); break; case "boot": a.playSound("BGM_WAVE_BOOT_0", 3); break; default: a.playSound("BGM_WAVE_MAIN", 3) } }
}
})(); (function () {
Wood.Modules.Controller.Base.Dictionary = function () { }; Wood.Modules.Controller.Base.Dictionary.prototype = {
setDictionary: function () {
if (wood.client.isWiiU() && !wiiuKeyboard.setUserDictionary) Wood.log("setUserDictionary not supported"); else if (wood.client.isDictionarySet()) Wood.log("user dictionary already set"); else {
var a = new Wood.Model.Dictionary({ country: wood.client.country, language: wood.client.language }); a.bind("change", function () {
if (wood.client.isWiiU()) {
var b = wiiuKeyboard.setUserDictionary(JSON.stringify({ items: a.getItems() }));
b && !b.error ? Wood.log("fetch and store user dictionary") : Wood.log("setUserDictionary failed:" + b.error.code)
} else Wood.log("(PC) set dictionary flag true"); wood.client.setDictionaryFlag()
}, a); a.fetch()
}
}
}
})(); (function () {
Wood.Modules.Controller.Base.UserData = function () { }; Wood.Modules.Controller.Base.UserData.prototype = {
storeUserData: function (a, b) {
var c = !1; if (Wood.Util.isUndefined(wood.client.getDeviceOrderList())) {
Wood.log("storeUserData: try to update DeviceOrderList..."); var d = new Wood.Model.DeviceOrderList; d.fetch({
async: !b, success: function () {
a ? setTimeout(function () { wood.client.updateDeviceOrderList(d); Wood.log("storeUserData: DeviceOrderList updated (delayed)") }, 4E3) : (wood.client.updateDeviceOrderList(d),
Wood.log("storeUserData: DeviceOrderList updated"))
}
})
} b = new Wood.Model.WishList; b.hasStorageCache() || (Wood.log("storeUserData: update WishList"), b.fetch(), b.saveStorageCache(), c = !0); wood.client.ls.hasLangSelectable() || (Wood.log("storeUserData: update LangSelectable"), c = new Wood.Model.CountryInfo({ country: wood.client.country, language: wood.client.language }), c.fetch(), wood.client.ls.setLangSelectable(c.isLanguageSelectable()), c = !0); c && wood.client.isWiiU() && wood.client.criticalAction(function () { wood.client.getLocalStorage().write() })
}
}
})(); (function () { Wood.Modules.Controller.Base.MenuBar = function () { }; Wood.Modules.Controller.Base.MenuBar.prototype = { setupMenu: function (a) { var b = this; this.menuBar = new Wood.View.MenuBar({ $wrap: this.$wrap }); this.menuBar.setup(a); this.menuBar.hookMymenuEvent(function () { b.openMymenu() }) }, rebuildMenuBar: function () { this.menuBar && this.menuBar.rebuild() }, showMenuBar: function () { this.menuBar && this.menuBar.$el.show() }, hideMenuBar: function () { this.menuBar && this.menuBar.$el.hide() } } })(); (function () {
Wood.Modules.Controller.Base.Mymenu = function () { }; Wood.Modules.Controller.Base.Mymenu.prototype = {
openMymenu: function () {
var a = this, b = $("#wrap, #wrapper").filter(":visible"); if (this.isMymenuOpen) { if (b.find("#mymenu").length) return } else this.last_scroll = this.$body.scrollTop(), this.isMymenuOpen = !0; "main" !== this.BGM && wood.client.playSound("BGM_WAVE_MAIN", 3); this.$content = b.find("#sb_cont"); this.$content.length || (this.$content = b.children().first()); this.$content.hide(); this.mymenu = this.renderView(Wood.View.Mymenu);
b.append(this.mymenu.render().el); Wood.DomUtil.animateToTop(); this.menuBar.selectMenu(function () { a.closeMymenu() })
}, closeMymenu: function () { this.isMymenuOpen = !1; if (this.mymenu) "main" !== this.BGM && this.setBGM(wood.client), this.$content.show(), this.mymenu.$el.hide(), this.mymenu.remove(), this.menuBar.revert(), this.menuBar.allowScroll(), Wood.DomUtil.animateToTop(this.last_scroll); else { var a = this.$body.find("#mymenu"); a.length && a.remove() } }
}
})(); (function () {
Wood.Modules.Controller.Base.Limit = function () { }; Wood.Modules.Controller.Base.Limit.prototype = {
limitAge: function (a, b) { if (a.hasRating() && !a.getRating(a.getRatingSystemId(), a.getRatingAge()).isDisplayAllowed(b, wood.client.getRegion(), wood.client.getAge())) throw wood.client.alert($("#dialog_msg_age").text(), $("#dialog_msg_ok").text()), wood.client.historyBack(), Error("limitAge redirect stopper"); }, limitParentalControl: function (a) {
if (a.hasRating() && wood.client.isLockedForGamePlay(a.getRatingAge())) throw a =
$.url(), wood.client.redirectReplaceTo("legal01_01.html?seq=" + encodeURIComponent(a.attr("file") + "?" + a.attr("query")) + "#gameplay"), Error("limitParentalControl redirect stopper");
}
}
})(); (function () {
Wood.Modules.Controller.Base.Util = function () { }; Wood.Modules.Controller.Base.Util.prototype = {
parseParam: Wood.Request.prototype.parseParam, createAppJumpBackEvent: function (a, b) { var c = b.isAppJump(); return function () { c ? a.redirectTo("data01_03.html", { cancel: "historyback" }) : a.historyBack() } }, updateRedeemNumSession: function (a, b) { var c = b.param("redeem_num"); b = b.param("redeem_title_id"); c && b && a.setRedeemNumber(b, c) }, reload: function () { location.reload() }, reloadWithoutHash: function () {
location.href =
location.pathname + location.search
}
}
})(); (function () {
Wood.Controller.ROUTES = { "": "runRoot" }; Wood.Controller.Base = Backbone.Router.extend({
routes: $.extend({}, Wood.Controller.ROUTES), models: {}, called_runroot: !1, initialize: function () { var a = this; _.each(Wood.Controller.Base.Modules, function (b) { b.call(a) }); this.$body = $("body"); this.$wrap = $("#wrap, #wrapper") }, runRoot: function () {
this.called_runroot = !0; var a = wood.client, c = this.getRequest(); a = [a, c]; this.handleBoot.apply(this, a); a = wood.client; a = [a, c]; _.isFunction(this.preparePage) && this.preparePage.apply(this,
a); _.isFunction(this.run) && this.run.apply(this, a); _.isFunction(this.afterRun) && this.afterRun.apply(this, a)
}, showPage: function () { this.$wrap.show(); this.$body.removeClass("display_cover") }, renderView: function (a, c) { a = this.generateView(a, $.extend({ controller: this }, c)); Wood.DomUtil.hookSoundEffectEvent($(a.el)); return a }, localizeText: function () { $("[data-message]").each(function () { var a = $(this); a.html(wood.client.getText(a.attr("data-message"))) }) }, generateModel: function (a, c) {
return this.generateObject(Wood.Model,
a, c)
}, generateView: function (a, c) { return _.isFunction(a) ? new a(c) : this.generateObject(Wood.View, a.toString(), c) }, generateObject: function (a, c, d) { var b = a; _.each(c.split("."), function (a) { b = b[a]; if (!b) throw Error("(Wood.Controller.Base#generateObject) Error:" + c + " does not exists."); }); return new b(d) }, getRequest: function () { return new Wood.Request(location) }
}); var a = Wood.Modules.Controller.Base; Wood.Controller.Base.Modules = [a.Boot, a.Beacon, a.Client, a.Dictionary, a.UserData, a.MenuBar, a.Mymenu, a.Limit, a.Util];
_.each(Wood.Controller.Base.Modules, function (a) { _.extend(Wood.Controller.Base.prototype, a.prototype) })
})(); (function () { Wood.Model.Directory = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.SAMURAI + "ws/" + wood.client.country + "/directories" }, use_store: !0, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, a); b.type = "GET"; b.data = { lang: wood.client.language, pattern: wood.client.getAB() }; this.fetchJSON(b) }, parse: function (a) { return a.directories }, getCatalogId: function () { return this.get("catalog_id") }, getDirectories: function () { return this.get("directory") } }) })(); (function () { Wood.Model.News = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.SAMURAI + "ws/" + wood.client.country + "/news" }, use_store: !0, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, a); b.type = "GET"; b.data = { lang: wood.client.language }; this.fetchJSON(b) }, parse: function (a) { return a.news }, getNews: function () { return this.get("news_entry") } }) })(); (function () { Wood.Model.CouponBase = Wood.Model.Base.extend({ getDiscountPrice: function () { var a = this.getSafe("target_list.titles.title"); return a && a[0] }, parseDatetime: function (a) { if (!a) return null; var b = a.split("T"); a = b[0].split("-"); b = b[1].split(":"); return { date: a, time: b } }, getStartDateTime: function () { return this.parseDatetime(this.getSafe("start_datetime.localdatetime.datetime")) }, getEndDateTime: function () { return this.parseDatetime(this.getSafe("end_datetime.localdatetime.datetime")) } }) })(); (function () { Wood.Model.OwnedCoupon = Wood.Model.CouponBase.extend({ isTargetTypeAll: function () { return "AllTitle" === this.getTargetType() } }); Wood.Model.Base.createGetters(Wood.Model.OwnedCoupon, { isUseAtOnce: "use_at_once_flag", getDiscountInfo: "discount_info.amount", getImage: "image", getId: "id", getInstanceCode: "instance_code", getDescription: "description", getTargetType: "target_type", getName: "name" }) })(); (function () {
Wood.Model.OwnedCoupons = Wood.Model.Base.extend({
url: function () { return Wood.UrlPrefix.NINJA + "ws/my/owned_coupons" }, use_store: !0, fetch: function (a) { var b = this.getBaseAjaxParam(), c = {}; this.ns_uid && (c.ns_uid = this.ns_uid); $.extend(b, { type: "GET", async: !1, data: c, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a.coupons }, getCoupons: function () { var a = this.get("coupons"); return _.map(a, function (a) { return (new Wood.Model.OwnedCoupon).set(a) }) }, getInstanceCodes: function () {
var a =
this.get("coupons"); return _.map(a, function (a) { return a.instance_code })
}, getLength: function () { var a = this.get("coupons"); return a && a.length || 0 }, cacheCoupon: function () { var a = wood.client.getSessionStorage(), b = this.get("coupons"); return _.each(b, function (b) { a.setItem("_owned_coupon_" + b.id, JSON.stringify(b)) }) }, cacheCouponId: function () { var a = wood.client.getSessionStorage(), b = this.get("coupons"); return _.each(b, function (b) { a.setItem("_coupon_id_" + b.instance_code, b.id + "") }) }
}, {
getCachedCoupon: function (a) {
return (a =
wood.client.getSessionStorage().getItem("_owned_coupon_" + a)) ? (new Wood.Model.OwnedCoupon).set(JSON.parse(a)) : null
}
})
})(); (function () { Wood.Model.ParentalControlPut = Wood.Model.Base.extend({ url: function () { return Wood.UrlPrefix.NINJA + "ws/my/parental_control/!put" }, fetch: function (a) { var b = this.getBaseAjaxParam(); $.extend(b, { type: "POST", async: !1, data: { game_rating_age: this.game_rating_age, shopping: this.shopping, game_rating_lock: this.game_rating_lock }, xhrFields: { withCredentials: !0 } }); $.extend(b, a); this.fetchJSON(b) }, parse: function (a) { return a } }) })(); (function () {
Wood.View.Directory = Backbone.View.extend({
el: "#el-top", initialize: function () { var a = this, b = this.model; this.controller = this.options.controller; var c = [b.directory.getPromise()]; b.owned_coupon && c.push(b.owned_coupon.getPromise()); $.when.apply(null, c).done(function () { a.render() }) }, render: function () {
var a = this; this.$el.empty(); var b = this.model.owned_coupon; b && (0 < b.getLength() ? (this.renderOwnedCoupon(), b = this.model.owned_coupon.getInstanceCodes(), wood.client.storeOwnedCoupon(b), wood.client.storeUnreadOwnedCoupon(b)) :
wood.client.storeUnreadOwnedCoupon([]), this.controller.menuBar.rebuild()); Wood.Util.each(this.model.directory.getDirectories(), function (b, d) { if ("single" === d.type) a.renderSingle(d); else if ("partition" === d.type) a.renderPartition(d); else if ("reference" === d.type) switch (d.reference_type) { case "aocs": a.renderAocs(d); break; case "tickets": a.renderTickets(d) } else a.renderDirectory(d) }); Wood.DomUtil.lazyload("img.lazy"); Wood.DomUtil.hookSoundEffectEvent(this.$el); this.$el.attr("data-isloaded", !0)
}, renderOwnedCoupon: function () {
$("#template_owned_coupon").tmpl({}).appendTo(this.el);
Wood.DomUtil.localizeText(this.$el)
}, renderSingle: function (a) {
if (!Wood.Util.isUndefined(a)) {
if (Wood.Util.isDefined(a.contents.content[0].title)) { var b = new Wood.URL("#title", { title: a.contents.content[0].title.id }); var c = Wood.Util.isDefined(a.name) ? a.name : "" } else if (Wood.Util.isDefined(a.contents.content[0].movie)) b = new Wood.URL("data02_01.html", { movie: a.contents.content[0].movie.id }), c = Wood.Util.isDefined(a.name) ? a.name.replace(/<br>/ig, "") : ""; else return; this.controller.appendDirectoryBeaconParam(b,
a.id, a.index, a.alias, a.name); $("#template_top_content").tmpl({ is_title: "" !== c, str_title: c, url_detail: b.toString(), url_banner: a.banner_url, param_banner_w: a.banner_width, param_banner_h: a.banner_height }).appendTo(this.el)
}
}, renderAocs: function (a) {
if (a.contents && a.contents.content[0] && a.contents.content[0].title) {
var b = new Wood.URL("data03_01.html", { title: a.contents.content[0].title.id }); this.controller.appendDirectoryBeaconParam(b, a.id, a.index, a.alias, a.name); $("#template_top_content").tmpl({
is_title: a.name &&
"" !== a.name, str_title: a.name, url_detail: b.toString(), url_banner: a.banner_url, param_banner_w: a.banner_width, param_banner_h: a.banner_height
}).appendTo(this.el)
}
}, renderTickets: function (a) {
if (a.contents && a.contents.content[0] && a.contents.content[0].title) {
var b = new Wood.URL("data04_01.html", { title: a.contents.content[0].title.id }); this.controller.appendDirectoryBeaconParam(b, a.id, a.index, a.alias, a.name); $("#template_top_content").tmpl({
is_title: a.name && "" !== a.name, str_title: a.name, url_detail: b.toString(),
url_banner: a.banner_url, param_banner_w: a.banner_width, param_banner_h: a.banner_height
}).appendTo(this.el)
}
}, renderPartition: function (a) { Wood.Util.isUndefined(a) || $("#template_partition").tmpl({ url_partition: a.banner_url, param_partitionr_w: a.banner_width, param_partition_h: a.banner_height }).appendTo(this.el) }, renderDirectory: function (a) {
if (!Wood.Util.isUndefined(a)) {
var b = {}; a.alias ? b.alias = a.alias : b.directory = a.id; b = new Wood.URL("#shelf", b); this.controller.appendDirectoryBeaconParam(b, a.id, a.index,
a.alias, a.name); $("#template_top_content").tmpl({ is_title: a.name && "" !== a.name, str_title: a.name, url_banner: a.banner_url, param_banner_w: a.banner_width, param_banner_h: a.banner_height, url_detail: b.toString() }).appendTo(this.el)
}
}
})
})(); (function () { Wood.View.NewsTop = Backbone.View.extend({ el: "#top_unread_news", initialize: function () { this.model.bind("change", this.render, this); this.options.controller.cache_mode ? this.render() : this.model.fetch() }, render: function () { wood.client.hasUnReadNews(this.model.getNews()) ? $(this.el).attr("class", "top-news-on") : $(this.el).attr("class", "top-news-off"); return this } }) })(); (function () {
Wood.View.KeywordSearch = Backbone.View.extend({
el: "#sel_keyword", initialize: function () { this.render() }, render: function () { null !== wood.client.getSessionStorage().getItem("freeword") && $(this.el).val(wood.client.getSessionStorage().getItem("freeword")); this.hookEvent() }, enableKeyword: function () { $(this.el).prop("disabled", !1) }, hookEvent: function () {
var a = this; $(window).load(function () { a.enableKeyword() }); $(a.el).change(function () {
if ("" !== $(a.el).val()) {
var b = wood.client.getSessionStorage(); b.removeItem("searchType");
b.removeItem("platform[]"); b.removeItem("genre[]"); b.removeItem("publisher[]"); b.removeItem("price_min"); b.removeItem("price_max"); b.removeItem("device[]"); b.setItem("freeword", $(a.el).val()); b = encodeURIComponent($(a.el).val()); wood.client.redirectTo("#shelf?searchType=both&freeword=" + b)
}
})
}, setKeyword: function () { var a = wood.client.getSessionStorage().getItem("freeword"); null !== a ? $(this.el).val(a) : $(this.el).val("") }
})
})(); (function () {
Wood.Controller.Top01_01 = Wood.Controller.Base.extend({
run: function (a, b) {
this.setupMenu(Wood.View.MenuBar.Type.TOP); this.models.news = null; this.cache_mode = !1; this.cache ? (this.models.news = this.cache.news, this.cache_mode = !0) : this.models.news = this.generateModel("News"); this.models.directory = this.generateModel("Directory"); a.isMyCouponAvailable() && (this.models.owned_coupons = this.generateModel("OwnedCoupons")); this.renderView("Directory", { model: { directory: this.models.directory, owned_coupon: this.models.owned_coupons } });
this.news_view = this.renderView("NewsTop", { model: this.models.news }); this.keyword_search_view = this.renderView("KeywordSearch"); a.isInBoot() && (Wood.log("reset in-boot flag"), a.finishBoot())
}, afterRun: function (a, b) { }, preparePage: function (a, b) { Wood.Analytics.addFromAttr("(top-page)").sendVirtualPV("VP_Top"); a.initPurchaseInfo(); a.initCardInfo(); a.enableUserOperation() }, isLoaded: function () { return $("#el-top").data("isloaded") }, onPageShow: function (a, b) { a.curtainClose(); a.hideLoadingIcon() }, onPageShowCache: function (a,
b) { this.isLoaded() ? (this.keyword_search_view.setKeyword(), $("#sel_keyword").blur(), this.news_view.render()) : (a.disableUserOperation(), Wood.DomUtil.hideBody(), this.reload()) }
})
})(); (function () {
Wood.Modules.Controller.Login.Login = function () { this.in_redirect = !1 }; Wood.Modules.Controller.Login.Login.prototype = {
pseudoLogin: function () { var a = new Wood.Model.PseudoNinjaSession({ country: wood.client.country, language: wood.client.language, pid: this.getPrincipalId() }); a.fetch(); if (a.isOpened()) return Wood.log("[Login] PSEUDO login succeeded."), a; Wood.log("[Login] pseudo login failed."); return null }, login: function () {
var a = this, b = new Wood.Model.NinjaSession({
country: wood.client.country, language: wood.client.language,
service_token: this.getServiceToken()
}); Wood.log("principal id: " + this.getPrincipalId()); Wood.log("service token: " + this.getServiceToken()); var c = b.getPromise({ async: !0, error: function (b, c) { Wood.log("[Login] failed. "); a.handleLoginError(c) }, beforeSend: function () { }, success: function (a) { Wood.log("[Login] server process succeeded.") } }), d = new Wood.Model.News, f = Wood.Util.createPromise(function (b) { wood.client.prepareLocalizedText(); a.localizeText(); b.resolve() }), q = new Wood.Model.CountryInfo({
country: wood.client.country,
language: wood.client.language
}), p = Wood.Util.createPromise(function (a) { Wood.IndexBeacon.boot01_01(); a.resolve() }); $.when(c, f, p, q.getPromise({ async: !0, beforeSend: function () { }, success: function () { } }), d.getPromise({ async: !0, beforeSend: function () { }, success: function () { } })).done(function () {
Wood.log("<login> all promises done"); a.handleLoginSuccess(b); a.cache = { news: d, country: wood.client.country, language: wood.client.language, country_info: q }; wood.client.updateParentalControls(); var c = Wood.StartPageDispatcher.dispatch($.url().param());
c === Wood.StartPageDispatcher.URL_TOP ? a.navigate("top", { trigger: !0 }) : (wood.client.endStartUp(), a.in_redirect = !0, wood.client.redirectReplaceTo(c))
}).fail(function () { "resolved" !== p.state() && Wood.IndexBeacon.boot01_01(); Wood.log("<login> some promises fail"); a.in_redirect ? Wood.log("<login> igonore failure in initseq redirect.") : (wood.client.showError(Wood.ErrorCode.CLOSE_APPLICATION), wood.client.errorShutdown()) })
}
}
})(); (function () {
Wood.Modules.Controller.Login.LoginSuccess = function () { }; Wood.Modules.Controller.Login.LoginSuccess.prototype = {
handleLoginSuccess: function (a) {
wood.client.setNinjaSession(a); this.verifyWishlistCache(a); if (a.isShopAccountInitialized() && wood.client.isWiiU()) { var b = wiiuNNA.refreshVirtualAccount(); wood.client.shutdownIfError(b); Wood.log("SUCCESS :refreshACP") } this.storeAge(a); this.syncTicket(); wood.client.isFirstBoot() && (this.in_redirect = !0, this.writeLocalStorage(), wood.client.redirectToInitialSequence(a));
this.storeOrderList(a); a.getSavedLanguage() ? (this.updateLanguage(a), this.writeLocalStorage()) : (this.in_redirect = !0, this.writeLocalStorage(), wood.client.redirectToInitialSequence(a))
}, verifyWishlistCache: function (a) { Wood.log("wishlist last modified: " + a.getWishlistLastModified()); if (a = a.getWishlistLastModified()) { var b = wood.client.ls.getWishlistLastModified(); if (!b || b < a) (new Wood.Model.WishList).removeStorageCache(), wood.client.ls.setWishlistLastModified(a), wood.client.setFSFlushRequired(), Wood.log(" - wishlist last modified updated (cache cleared)") } },
storeAge: function (a) { a = a.getAge(); _.isNumber(a) ? wood.client.getSessionStorage().setItem("age", "" + a) : wood.client.isWiiU() && wood.client.errorShutdown() }, syncTicket: function () { if (wood.client.isWiiU()) { Wood.log("start ticket sync (async)"); var a = wiiuEC.startTicketSync(); wood.client.shutdownIfError(a) } }, storeOrderList: function (a) {
var b = Number(a.getOwnedTitlesModified()), c = Number(a.getSharedTitlesModified()); a = Number(a.getOwnedWiiTitlesLastModified()); var d = wood.client.getLocalStorage(); if (b || c || a) {
var f =
Number(d.getItem("device_order_list_modified")); if (f < b || f < c || f < a) d.removeItem("order_list_modified"), d.removeItem("order_list"), d.removeItem("device_order_list_modified"), d.removeItem("device_order_list"), d.removeItem("device_order_list_rvc"), wood.client.writeLocalStorage(), Wood.log("order_list/device_order_list cleared (too old)")
}
}, updateLanguage: function (a) {
var b = a.getSavedLanguage(), c = wood.client.getLocalStorage(); b ? (Wood.log("saved_lang: " + b), c.getItem("lang") !== b && (c.setItem("lang", b), wood.client.writeLocalStorage()),
wood.client.language !== b && (wood.client.language = b, wood.client.region = wood.client.getRegion(), wood.client.prepareLocalizedText({ force: !0 })), wood.client.isWiiU() && (wiiuKeyboard.setLanguage(b), wiiuBrowser.setMessageLanguage(b))) : (Wood.log("[Login] language has not been set yet, and wiiu's language is not availabe."), this.in_redirect = !0, wood.client.redirectToInitialSequence(a))
}, writeLocalStorage: function () { wood.client.isFSFlushRequired() && (Wood.log("FS flush required. writeLocalStorage."), wood.client.writeLocalStorage(!0)) }
}
})(); (function () {
Wood.Modules.Controller.Login.LoginError = function () { }; Wood.Modules.Controller.Login.LoginError.prototype = {
handleLoginError: function (a) {
a && (a.status || a.responseText) || (Wood.log("[Login] empty response"), wood.client.showError(Wood.ErrorCode.CLOSE_APPLICATION), wood.client.errorShutdown()); 410 === a.status && (Wood.log("[Login] server process FAILED.Service was closed. (HTTP 410)"), wood.client.showError(Wood.ErrorCode.SERVICE_FINISHED), wood.client.errorShutdown()); 4 > a.readyState && (Wood.log("[Login] disconnected."),
wood.client.showError(Wood.ErrorCode.CLOSE_APPLICATION), wood.client.errorShutdown()); Wood.log("error: " + a.responseText); a = JSON.parse(a.responseText); var b = a.error.code; a = a.error.message; if (!this.isReleaseRom() && this.isNNASError(b)) { Wood.log("NNAS ERROR: " + b); var c = this.pseudoLogin(); if (c) return this.handleLoginSuccess(c) } Wood.log("[Login] server process FAILED.code=[" + b + "], message=[" + a + "]"); wood.client.enableHomeButton(); wood.client.showErrorDialog(Wood.SystemConfig.PREFIX_NINJA, b, a, function () {
Wood.log("login error: " +
b); "3051" === b && wood.client.isWiiU() && wood.client.errorShutdown(); wood.client.isWiiU() && wood.client.errorShutdown()
})
}, isReleaseRom: function () { return "undefined" === typeof wiiuDebug && "undefined" !== typeof wiiuNNA }, isNNASError: function (a) { a = parseInt(a, 10); return 3130 === a || 3057 === a || 3058 === a || 9500 <= a && 9599 >= a ? !0 : !1 }
}
})(); (function () {
Wood.Modules.Controller.Login.SetupWUP = function () { var a = Wood.geishaSkipNup(); Wood.log("skip_nup:" + a); this.skip_nup_assert = a }; Wood.Modules.Controller.Login.SetupWUP.prototype = {
setupWUP: function () { this.storePrincipalId(); this.setCountryAndLanguage(); this.skip_nup_assert || this.assertNUP(); this.updateDeviceCountry(); this.storeServiceToken(); this.sendIVS(); this.storeVinoFlag(); this.saveTemplates() }, storePrincipalId: function () {
var a = wood.client.getLocalStorage(); Wood.log("verify pid..."); var b =
String(wiiuNNA.principalId), c = a.getItem("pid"); null === c ? a.setItem("pid", b) : c !== b && (Wood.log("[WARN] PID was changed. This NNA is different from the past one."), a.clear()); this.setPrincipalId(b)
}, setCountryAndLanguage: function () {
var a = wood.client.getLocalStorage().getItem("lang"); a ? (wood.client.language = a, Wood.log("language (from local storage): " + wood.client.language)) : (a = wiiuSystemSetting.getLanguage(), wood.client.shutdownIfError(a), wood.client.language = a.code, Wood.log("language (from system setting): " +
wood.client.language)); a = wiiuSystemSetting.getCountry(); wood.client.shutdownIfError(a); wood.client.country = a.code; Wood.log("country: " + wood.client.country); wood.client.region = wood.client.getRegion()
}, setSkipNUPFlag: function () { this.skip_nup_assert && wood.client.getSessionStorage().setItem("skip_nup_assert", "1") }, assertNUP: function () {
var a = wiiuEC.needsSystemUpdateUsingCache ? wiiuEC.needsSystemUpdateUsingCache() : wiiuEC.needsSystemUpdate(); wood.client.shutdownIfError(a); a.update && (wood.client.prepareLocalizedText(),
this.localizeText(), Wood.log("System Update is needed."), wood.client.confirm($("#dialog_msg_update").text(), $("#dialog_cancel").text(), $("#dialog_update").text()) ? wood.client.jumpToUpdate() : wood.client.shutdown())
}, updateDeviceCountry: function () { var a = wiiuEC.getDeviceCountry(); wood.client.shutdownIfError(a); a.country !== wood.client.country && (Wood.log("DeviceAccount Country: " + a.country + ", NNA Country: " + wood.client.country), a = wiiuEC.setDeviceCountry(wood.client.country), wood.client.shutdownIfError(a)) },
storeServiceToken: function () { var a = wiiuNNA.getServiceToken(); wood.client.shutdownIfError(a); this.setServiceToken(a.ServiceToken) }, sendIVS: function () { var a = wiiuEC.sendIvsAsync(); wood.client.shutdownIfError(a); Wood.log("sendIvsAsync success") }, storeVinoFlag: function () {
var a = $.url().param("src_title_id"); Wood.log("storeVinoFlag: " + a); a && _.any({ jp: "000500301001300A", us: "000500301001310A", eu: "000500301001320A" }, function (b) {
if ((new Wood.TitleId(b)).isSameTitleAs(a)) return wood.client.getSessionStorage().setItem(Wood.Client.StorageKey.FROM_OTHER_APP,
"1"), !0
})
}
}
})(); (function () {
Wood.Modules.Controller.Login.SetupPC = function () { }; Wood.Modules.Controller.Login.SetupPC.prototype = {
setupPC: function () {
wood.client.language = $.url().param("__lang"); wood.client.country = $.url().param("__country"); wood.client.region = wood.client.getRegion(); var a = $.url().param("__user_id"), b = $.url().param("__password"), c = $.url().param("__serial_number"), d = $.url().param("__device_id"), f = $.url().param("__nnas_env"), q = $.url().param("__nnas_ver"); _.isString(wood.client.language) && _.isString(wood.client.country) &&
_.isString(a) && _.isString(b) && _.isString(c) && _.isString(d) && _.isString(f) && _.isString(q) || (wood.client.language = "ja", wood.client.country = "JP", a = "shoptest1jp", b = "password1234", d = c = "1234567890", f = "library-dev", q = "v1"); wood.client.getSessionStorage().setItem("country", wood.client.country); a = new Wood.Model.DebugServiceToken({ user_id: a, password: b, country: wood.client.country, env: f, ver: q, serial_number: c, device_id: d }); a.fetch(); (a = a.getToken()) ? this.setServiceToken(a) : (wood.client.alert("\u30b5\u30fc\u30d3\u30b9\u30c8\u30fc\u30af\u30f3\u306e\u53d6\u5f97\u306b\u5931\u6557\u3057\u307e\u3057\u305f"),
Wood.log("failed to get service_token.")); this.saveTemplates()
}
}
})(); (function () {
Wood.Modules.Controller.Login.Util = function () { }; Wood.Modules.Controller.Login.Util.prototype = {
setServiceToken: function (a) { this.service_token = a }, getServiceToken: function () { return this.service_token }, setPrincipalId: function (a) { this.principal_id = a }, getPrincipalId: function () { return this.principal_id }, saveTemplates: function () {
Wood.Template.set("mymenu", Wood.Template.Version.MYMENU); Wood.Template.set("shelf", Wood.Template.Version.SHELF); Wood.Template.set("title", Wood.Template.Version.TITLE);
Wood.Template.set("common", Wood.Template.Version.COMMON); Wood.Template.set("redeem", Wood.Template.Version.REDEEM); Wood.Template.set("news", Wood.Template.Version.NEWS)
}
}
})(); (function () {
Wood.Controller.Login = Wood.Controller.Base.extend({
routes: _.defaults({ "": "start" }, Wood.Controller.ROUTES), initialize: function () { this.constructor.__super__.initialize.call(this); var a = this; _.each(Wood.Controller.Login.Modules, function (b) { b.call(a) }) }, start: function () {
wood.client = Wood.Client.create(); wood.client.setInBoot(); wood.client.getNinjaSession() ? (Wood.log("ninja session found: navigate to top"), this.navigate("top", { trigger: !0 })) : (wood.client.isWiiU() ? (this.setSkipNUPFlag(), this.setupWUP()) :
this.setupPC(), this.login())
}
}); var a = Wood.Modules.Controller.Login; Wood.Controller.Login.Modules = [a.Login, a.LoginSuccess, a.LoginError, a.SetupWUP, a.SetupPC, a.Util]; _.each(Wood.Controller.Login.Modules, function (a) { _.extend(Wood.Controller.Login.prototype, a.prototype) })
})(); (function () {
Wood.Controller.Index = Wood.Controller.Base.extend({
scenes: {}, change_scene_count: 0, last_scene: null, current_scene: null, last_scroll: { top: 0, shelf: 0, title: 0, news: 0 }, routes: _.defaults({ "": "login", top: "goToTop", "shelf?:param": "goToShelf", "title?:param": "goToTitle", "redeem(?:param)": "goToRedeem", "news(?:param)": "goToNews" }, Wood.Controller.ROUTES), login: function () { this.scenes.login = this.scenes.login || new Wood.Controller.Login; this.scenes.login.start() }, goToTop: function () {
var a = !this.scenes.top;
this.changeScene({ name: "top", controller: Wood.Controller.Top01_01, wrap: "#wrapper.js-top" }); this.scenes.top.keyword_search_view.enableKeyword(); a && this.scenes.top.setBGM(wood.client)
}, goToShelf: function (a) { this.changeScene({ name: "shelf", controller: Wood.Controller.Shelf01_01, wrap: '<div id="wrapper" class="js-shelf">' }) }, goToTitle: function (a) { this.changeScene({ name: "title", controller: Wood.Controller.Data01_01, wrap: '<div id="wrapper" class="js-title">' }) }, goToRedeem: function () {
this.changeScene({
name: "redeem",
controller: Wood.Controller.Top03_01, wrap: '<div id="wrapper" class="js-redeem">'
})
}, goToNews: function (a) { this.changeScene({ name: "news", controller: Wood.Controller.Top02_01, wrap: '<div id="wrapper" class="js-news">' }) }, changeScene: function (a) {
this.change_scene_count++; 50 < this.change_scene_count && (Wood.DomUtil.hideBody(), this.change_scene_count = 0, this.reload()); var b = "top" === a.name, c = this.scenes[a.name]; if (c) c.$wrap.off().empty(), c.$wrap.html(c.template), this.localizeText(); else {
this.$topWrap = this.$topWrap ||
$("#wrapper.js-top"); if (!b) { var d = wood.client, f = this.getRequest(); this.handleBoot(d, f) } c = new a.controller; this.scenes[a.name] = c; c.$wrap = $(a.wrap); b ? c.template = c.$wrap.html() : (b = Wood.Template.get(a.name, "#main"), c.template = b(), this.$topWrap.after(c.$wrap), c.$wrap.html(c.template), this.localizeText())
} _.each(c.routes, function (a, b) { c.route(b, a) }); this.$window = this.$window || $(window); b = this.$window.scrollTop(); c.setCache(this.scenes.login ? this.scenes.login.cache : null); c.runRoot(); this.current_scene ||
this.rebindPageShowEvent(); this.current_scene = c; this.showScene(c); this.restoreScroll(a.name, b)
}, showScene: function (a) { this.$topWrap.hide(); _.each(this.scenes, function (a) { a.$wrap.hide() }); a.$wrap.show() }, rebindPageShowEvent: function () { var a = [wood.client, {}]; this.$window.unbind("pageshow"); this.setPageShowEvent(this, a) }, onPageShow: function (a, b) { this.callOnPageShow(this.current_scene, [a, b]) }, onPageShowCacheDynamic: function (a, b) { this.callOnPageShowCache(this.current_scene, [a, b]) }, restoreScroll: function (a,
b) { var c = this, d = this.last_scroll[a]; this.is_history_back ? Wood.DomUtil.animateToTop(d) : this.last_scroll[this.last_scene] = b; this.last_scene = a; this.is_history_back = !1; this.scenes[a].menuBar.on("back", function (a) { c.is_history_back = !0; c.last_scroll[c.last_scene] = a.scroll_top }) }
})
})();