Created
October 21, 2017 12:46
-
-
Save oczkers/b0f45b18730297b5d3d97ffdc5e65ea2 to your computer and use it in GitHub Desktop.
fut_js1
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isAndroidStockBrowser() { | |
| var t = navigator.userAgent, | |
| i = t.indexOf("Android") > -1 && t.indexOf("Mozilla/5.0") > -1 && t.indexOf("AppleWebKit") > -1, | |
| s = new RegExp(/AppleWebKit\/([\d.]+)/), | |
| o = null === s.exec(t) ? null : parseFloat(s.exec(t)[1]); | |
| return i && null !== o && o < 537 | |
| } | |
| function isSupportedBrowser() { | |
| return !isAndroidStockBrowser() && function testWebGl(t) { | |
| try { | |
| return !(!window.WebGLRenderingContext || !t.getContext("webgl") && !t.getContext("experimental-webgl")) | |
| } catch (t) { | |
| return !1 | |
| } | |
| }(document.createElement("canvas")) | |
| } | |
| function FUTObject() { | |
| this.className = this.constructor.name || "", Object.defineProperty(this, "className", { | |
| writable: !1 | |
| }) | |
| } | |
| function FUTHashTable(t) { | |
| this._collection = {}, Object.defineProperty(this, "_collection", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this.length = 0, Object.defineProperty(this, "length", { | |
| get: function get() { | |
| return Object.keys(this._collection).length | |
| } | |
| }); | |
| var i; | |
| for (i in t) t.hasOwnProperty(i) && (this._collection[i] = t[i]) | |
| } | |
| function FUTIterator(t) { | |
| FUTObject.call(this), this._collection = t, this._index = 0, this.length = 0, Object.defineProperty(this, "length", { | |
| get: function() { | |
| return this._collection.length | |
| } | |
| }), this.startOfList = !0, Object.defineProperty(this, "startOfList", { | |
| get: function() { | |
| return 0 === this._index | |
| } | |
| }), this.endOfList = !1, Object.defineProperty(this, "endOfList", { | |
| get: function() { | |
| return 0 === this._collection.length || this._index === this._collection.length - 1 | |
| } | |
| }) | |
| } | |
| function FUTObservable() { | |
| FUTObject.call(this), this._observers = [] | |
| } | |
| function FUTStorageAlternative() { | |
| FUTObject.call(this), this._localStorage = {}, this.length = 0, Object.defineProperty(this, "length", { | |
| get: function() { | |
| return Object.keys(this._localStorage).length | |
| } | |
| }) | |
| } | |
| function FUTNotificationDispatcher() { | |
| FUTObject.call(this), this._observers = new FUTHashTable({}) | |
| } | |
| function FUIResponder() { | |
| FUTObject.call(this); | |
| var t = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "_touchID", { | |
| get: t.get.bind(t), | |
| set: t.set.bind(t), | |
| enumerable: !1 | |
| }); | |
| var i = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "_touchOriginX", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i), | |
| enumerable: !1 | |
| }); | |
| var s = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "_touchOriginY", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s), | |
| enumerable: !1 | |
| }); | |
| var o = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "_hasMoved", { | |
| get: o.get.bind(o), | |
| set: o.set.bind(o), | |
| enumerable: !1 | |
| }); | |
| var l = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "moveDistanceThreshold", { | |
| get: l.get.bind(l), | |
| set: l.set.bind(l), | |
| enumerable: !0 | |
| }); | |
| var u = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "allowLegacyPropagation", { | |
| get: u.get.bind(u), | |
| set: u.set.bind(u), | |
| enumerable: !0 | |
| }), Object.defineProperty(this, "_eventElement", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), Object.defineProperty(this, "_eventListeners", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), Object.defineProperty(this, "_scrollPositions", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), Object.defineProperty(this, "_eventDelegates", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._eventDelegates = [], this._eventElement = null, this._eventElementClientRect = null, this._eventListeners = [], this._touchID = -1, this._touchOriginX = 0, this._touchOriginY = 0, this._scrollPositions = [], this._hasMoved = !1, this.moveDistanceThreshold = 8, this.allowLegacyPropagation = !1 | |
| } | |
| function FUTTouchHandler() { | |
| var t = !0; | |
| Object.defineProperty(this, "endTouchOnLeave", { | |
| get: function() { | |
| return t | |
| }, | |
| set: function(i) { | |
| utils.JS.isBoolean(i) && (t = i) | |
| } | |
| }); | |
| var i = !0; | |
| Object.defineProperty(this, "bubbleEvent", { | |
| get: function() { | |
| return i | |
| }, | |
| set: function(t) { | |
| utils.JS.isBoolean(t) && (i = t) | |
| } | |
| }), this._element = null, this._touchID = -1, this._originalX = 0, this._originalY = 0, this._scrollPositions = [], this.endTouchOnLeave = !0, this.bubbleEvent = !0, this.preventDefault = !1, this._hasMoved = !1; | |
| var s = !0; | |
| Object.defineProperty(this, "moveDistanceThreshold", { | |
| get: function() { | |
| return s | |
| }, | |
| set: function(t) { | |
| utils.JS.isNumber(t) && (s = t) | |
| } | |
| }), this.moveDistanceThreshold = 8, this._listeners = [], this.touchstart = new FUTObservable, Object.defineProperty(this, "touchstart", { | |
| writable: !1 | |
| }), this.touchmove = new FUTObservable, Object.defineProperty(this, "touchmove", { | |
| writable: !1 | |
| }), this.touchend = new FUTObservable, Object.defineProperty(this, "touchend", { | |
| writable: !1 | |
| }), | |
| this.tap = new FUTObservable, Object.defineProperty(this, "tap", { | |
| writable: !1 | |
| }) | |
| } | |
| function FUTHttpRequest() { | |
| FUTObservable.call(this), this._url = "", Object.defineProperty(this, "_url", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._contentType = enums.HTTPContentType.JSON, Object.defineProperty(this, "_contentType", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._requestType = enums.HTTPRequestMethod.GET, Object.defineProperty(this, "_requestType", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._mimeOverride = "", Object.defineProperty(this, "_mimeOverride", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._urlVariables = "", Object.defineProperty(this, "_urlVariables", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._requestHeaders = [], Object.defineProperty(this, "_requestHeaders", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._requestBody = null, this._timeout = 2e4, Object.defineProperty(this, "_requestHeaders", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._cache = !0, this._http = new XMLHttpRequest, Object.defineProperty(this, "_http", { | |
| writable: !1, | |
| enumerable: !1 | |
| }) | |
| } | |
| function FUTUtasHttpRequest(t) { | |
| FUTHttpRequest.call(this), this._delegate = t, Object.defineProperty(this, "_delegate", { | |
| writable: !1, | |
| enumerable: !1 | |
| }), this._doReauth = !0, Object.defineProperty(this, "_doReauth", { | |
| writable: !0, | |
| enumerable: !1 | |
| }) | |
| } | |
| function ItemRepository() { | |
| FUTHashTable.call(this, {}), this.endOfList = !1, Object.defineProperty(this, "endOfList", { | |
| writable: !0 | |
| }) | |
| } | |
| function ClubRepository() { | |
| this._players = new ItemRepository, this._staff = new ItemRepository, this._consumables = new ItemRepository, this._badges = new ItemRepository, this._balls = new ItemRepository, this._kits = new ItemRepository, this._stadiums = new ItemRepository, this._activeItems = new FUTHashTable({}) | |
| } | |
| function FUIView() { | |
| FUIResponder.call(this); | |
| var t = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "_interactionState", { | |
| get: t.get.bind(t), | |
| set: t.set.bind(t) | |
| }), this._interactionState = !1, this._subviews = [], Object.defineProperty(this, "_subviews", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._superview = null, Object.defineProperty(this, "_superview", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._defaultDisplay = "", Object.defineProperty(this, "_defaultDisplay", { | |
| writable: !0, | |
| enumerable: !1 | |
| }) | |
| } | |
| function FUITargetActionView() { | |
| FUIView.call(this), this._targets = new FUTHashTable({}) | |
| } | |
| function FUIControl() { | |
| FUITargetActionView.call(this) | |
| } | |
| function FUIButton() { | |
| FUIControl.call(this) | |
| } | |
| function FUIViewController() { | |
| FUIResponder.call(this); | |
| var t = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "isLoading", { | |
| get: t.get.bind(t), | |
| set: t.set.bind(t) | |
| }); | |
| var i = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "hasLoaded", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i) | |
| }), this._view = null, this._parentViewController = null, this._childViewControllers = [], this.isLoading = !1, this.hasLoaded = !1, this.initialized = !1 | |
| } | |
| function EADPIdentityManager() { | |
| FUTObject.call(this), this.connectHost = "https://accounts.ea.com", this.portalHost = "https://signin.ea.com", this.proxyHost = "https://gateway.ea.com", this.redirect_uri = "", this.mobile_client_scope = "basic.identity+offline+signin", this.locale = "", this.device_id = "", this.mobile_client_id = "", this.mobile_client_secret = "", this.error = { | |
| REFRESH_TOKEN: "NEED_LOGIN_AGAIN", | |
| LOCAL_STORAGE: "BROWSER_DOES_NOT_SUPPORT", | |
| SERVER: "SERVER_ERROR" | |
| }, this.exchangeAccessTokenSuccessCallback = null, this.exchangeAccessTokenFailCallback = null | |
| } | |
| function eadpAuthSuccess(code) { | |
| eadp && eadp.identity && eadp.identity.exchangeAccessToken(code, eadp.identity.exchangeAccessTokenSuccessCallback, eadp.identity.exchangeAccessTokenFailCallback) | |
| } | |
| function EADPIdentityManager_Web() { | |
| EADPIdentityManager.call(this) | |
| } | |
| function FUINavigationController(t, toolbar) { | |
| FUIViewController.call(this); | |
| var i = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "isToolbarVisible", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i) | |
| }); | |
| var s = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "isNavVisible", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s) | |
| }), this._navigationBar = t || new views.NavigationBar, this._toolbar = toolbar || new views.Toolbar, this._backButton = new views.buttons.NavigationButton, this._rootController = null, this._currentController = null, this._currentView = null, this.isNavVisible = !1, | |
| this.isToolbarVisible = !1, this._isTransitioning = !1 | |
| } | |
| function FUISplitViewController() { | |
| FUIViewController.call(this), this._leftController = null, this._rightController = null | |
| } | |
| function UTPopupDTO(title, message, t) { | |
| this.title = title, this.message = message, this.buttonLabels = t | |
| } | |
| function UTKeyboardEventController() { | |
| FUTObject.call(this), this._eventDelegates = new FUTHashTable({}), this._keyupHandler = this._eHandleKeyUpEvent.bind(this) | |
| } | |
| function LeagueRepository(t) { | |
| this._leagues = new FUTHashTable({}), Object.defineProperty(this, "_leagues", { | |
| writable: !1, | |
| enumerable: !1 | |
| }), utils.JS.isValid(t) && this.add(t) | |
| } | |
| function NationRepository(t) { | |
| this._nations = new FUTHashTable({}), Object.defineProperty(this, "_nations", { | |
| writable: !1, | |
| enumerable: !1 | |
| }), utils.JS.isValid(t) && this.add(t) | |
| } | |
| function TeamRepository(t) { | |
| this._teams = new FUTHashTable({}), Object.defineProperty(this, "_teams", { | |
| writable: !1, | |
| enumerable: !1 | |
| }), utils.JS.isValid(t) && this.add(t) | |
| } | |
| if (!isSupportedBrowser()) throw new Error("Browser not supported"); | |
| ! function() { | |
| function _name() { | |
| var match, name; | |
| return this === Function || this === Function.prototype.constructor ? name = "Function" : this !== Function.prototype && (name = (match = ("" + this).match(t)) && match[1]), name || "" | |
| } | |
| var t = /^\s*function\s+([^\(\s]*)\s*/, | |
| i = !("name" in Function.prototype && "name" in function x() {}), | |
| s = "function" == typeof Object.defineProperty && function() { | |
| var result; | |
| try { | |
| Object.defineProperty(Function.prototype, "_xyz", { | |
| get: function() { | |
| return "blah" | |
| }, | |
| configurable: !0 | |
| }), result = "blah" === Function.prototype._xyz, delete Function.prototype._xyz | |
| } catch (t) { | |
| result = !1 | |
| } | |
| return result | |
| }(), | |
| o = "function" == typeof Object.prototype.__defineGetter__ && function() { | |
| var result; | |
| try { | |
| Function.prototype.__defineGetter__("_abc", function() { | |
| return "foo" | |
| }), result = "foo" === Function.prototype._abc, delete Function.prototype._abc | |
| } catch (t) { | |
| result = !1 | |
| } | |
| return result | |
| }(); | |
| Function.prototype._name = _name, i && (s ? Object.defineProperty(Function.prototype, "name", { | |
| get: function() { | |
| var name = _name.call(this); | |
| return this !== Function.prototype && Object.defineProperty(this, "name", { | |
| value: name, | |
| configurable: !0 | |
| }), name | |
| }, | |
| configurable: !0 | |
| }) : o && Function.prototype.__defineGetter__("name", function() { | |
| var name = _name.call(this); | |
| return this !== Function.prototype && this.__defineGetter__("name", function() { | |
| return name | |
| }), name | |
| })) | |
| }(), | |
| function() { | |
| function DOMKit() {} | |
| DOMKit.prototype.addClass = function addClass(t, i) { | |
| "" !== i && i.split(" ").forEach(function _addClass(className) { | |
| if (t instanceof HTMLCollection) | |
| for (var i = t.length; i-- > 0;) t.item(i).classList.add(className); | |
| else t.classList.add(className) | |
| }, this) | |
| }, DOMKit.prototype.removeClass = function removeClass(t, i) { | |
| "" !== i && i.split(" ").forEach(function _removeClass(className) { | |
| if (t instanceof HTMLCollection) | |
| for (var i = t.length; i-- > 0;) t.item(i).classList.remove(className); | |
| else t.classList.remove(className) | |
| }, this) | |
| }, DOMKit.prototype.toggleClass = function toggleClass(t, i, s) { | |
| utils.JS.isBoolean(s) || (s = !this.hasClass(t, i)), s ? this.addClass(t, i) : this.removeClass(t, i) | |
| }, DOMKit.prototype.hasClass = function hasClass(t, i) { | |
| return "" !== i && t.classList.contains(i) | |
| }, DOMKit.prototype.remove = function remove(t) { | |
| function _remove(t) { | |
| t.parentNode && t.parentNode.removeChild(t) | |
| } | |
| if (t instanceof HTMLCollection) | |
| for (var i = t.length; i-- > 0;) _remove(t.item(i)); | |
| else _remove(t) | |
| }, DOMKit.prototype.insertBefore = function insertBefore(t, i) { | |
| i.parentNode && i.parentNode.insertBefore(t, i) | |
| }, DOMKit.prototype.insertAfter = function insertAfter(t, i) { | |
| i.parentNode && i.parentNode.insertBefore(t, i.nextSibling) | |
| }, DOMKit.prototype.toggleDisplayStyle = function toggleDisplayStyle(t, i) { | |
| t.style.display = i ? "" : "none" | |
| }, DOMKit.prototype.HTMLCollectionToArray = function HTMLCollectionToArray(t) { | |
| return Array.prototype.slice.call(t) | |
| }, window.DOMKit || (window.DOMKit = new DOMKit) | |
| }(), | |
| function(window, undefined) { | |
| function isArraylike(t) { | |
| var length = t.length, | |
| type = I.type(t); | |
| return !I.isWindow(t) && (!(1 !== t.nodeType || !length) || ("array" === type || "function" !== type && (0 === length || "number" == typeof length && length > 0 && length - 1 in t))) | |
| } | |
| function createOptions(options) { | |
| var object = V[options] = {}; | |
| return I.each(options.match(A) || [], function(t, i) { | |
| object[i] = !0 | |
| }), object | |
| } | |
| function internalData(t, name, data, i) { | |
| if (I.acceptData(t)) { | |
| var s, o, l = I.expando, | |
| u = t.nodeType, | |
| h = u ? I.cache : t, | |
| id = u ? t[l] : t[l] && l; | |
| if (id && h[id] && (i || h[id].data) || data !== undefined || "string" != typeof name) return id || (id = u ? t[l] = p.pop() || I.guid++ : l), h[id] || (h[id] = u ? {} : { | |
| toJSON: I.noop | |
| }), "object" != typeof name && "function" != typeof name || (i ? h[id] = I.extend(h[id], name) : h[id].data = I.extend(h[id].data, name)), o = h[id], i || (o.data || (o.data = {}), o = o.data), data !== undefined && (o[I.camelCase(name)] = data), "string" == typeof name ? null == (s = o[name]) && (s = o[I.camelCase(name)]) : s = o, s | |
| } | |
| } | |
| function internalRemoveData(t, name, i) { | |
| if (I.acceptData(t)) { | |
| var s, o, l = t.nodeType, | |
| u = l ? I.cache : t, | |
| id = l ? t[I.expando] : I.expando; | |
| if (u[id]) { | |
| if (name && (s = i ? u[id] : u[id].data)) { | |
| o = (name = I.isArray(name) ? name.concat(I.map(name, I.camelCase)) : name in s ? [name] : (name = I.camelCase(name)) in s ? [name] : name.split(" ")).length; | |
| for (; o--;) delete s[name[o]]; | |
| if (i ? !isEmptyDataObject(s) : !I.isEmptyObject(s)) return | |
| }(i || (delete u[id].data, isEmptyDataObject(u[id]))) && (l ? I.cleanData([t], !0) : I.support.deleteExpando || u != u.window ? delete u[id] : u[id] = null) | |
| } | |
| } | |
| } | |
| function dataAttr(t, key, data) { | |
| if (data === undefined && 1 === t.nodeType) { | |
| var name = "data-" + key.replace(G, "-$1").toLowerCase(); | |
| if ("string" == typeof(data = t.getAttribute(name))) { | |
| try { | |
| data = "true" === data || "false" !== data && ("null" === data ? null : +data + "" === data ? +data : $.test(data) ? I.parseJSON(data) : data) | |
| } catch (t) {} | |
| I.data(t, key, data) | |
| } else data = undefined | |
| } | |
| return data | |
| } | |
| function isEmptyDataObject(t) { | |
| var name; | |
| for (name in t) | |
| if (("data" !== name || !I.isEmptyObject(t[name])) && "toJSON" !== name) return !1; | |
| return !0 | |
| } | |
| function returnTrue() { | |
| return !0 | |
| } | |
| function returnFalse() { | |
| return !1 | |
| } | |
| function safeActiveElement() { | |
| try { | |
| return document.activeElement | |
| } catch (t) {} | |
| } | |
| function sibling(t, dir) { | |
| do { | |
| t = t[dir] | |
| } while (t && 1 !== t.nodeType); | |
| return t | |
| } | |
| function winnow(elements, qualifier, t) { | |
| if (I.isFunction(qualifier)) return I.grep(elements, function(i, s) { | |
| return !!qualifier.call(i, s, i) !== t | |
| }); | |
| if (qualifier.nodeType) return I.grep(elements, function(i) { | |
| return i === qualifier !== t | |
| }); | |
| if ("string" == typeof qualifier) { | |
| if (ae.test(qualifier)) return I.filter(qualifier, elements, t); | |
| qualifier = I.filter(qualifier, elements) | |
| } | |
| return I.grep(elements, function(i) { | |
| return I.inArray(i, qualifier) >= 0 !== t | |
| }) | |
| } | |
| function createSafeFragment(document) { | |
| var list = ue.split("|"), | |
| t = document.createDocumentFragment(); | |
| if (t.createElement) | |
| for (; list.length;) t.createElement(list.pop()); | |
| return t | |
| } | |
| function manipulationTarget(t, content) { | |
| return I.nodeName(t, "table") && I.nodeName(1 === content.nodeType ? content : content.firstChild, "tr") ? t.getElementsByTagName("tbody")[0] || t.appendChild(t.ownerDocument.createElement("tbody")) : t | |
| } | |
| function disableScript(t) { | |
| return t.type = (null !== I.find.attr(t, "type")) + "/" + t.type, t | |
| } | |
| function restoreScript(t) { | |
| var match = Ce.exec(t.type); | |
| return match ? t.type = match[1] : t.removeAttribute("type"), t | |
| } | |
| function setGlobalEval(t, i) { | |
| for (var s, o = 0; null != (s = t[o]); o++) I._data(s, "globalEval", !i || I._data(i[o], "globalEval")) | |
| } | |
| function cloneCopyEvent(src, t) { | |
| if (1 === t.nodeType && I.hasData(src)) { | |
| var type, i, s, o = I._data(src), | |
| l = I._data(t, o), | |
| u = o.events; | |
| if (u) { | |
| delete l.handle, l.events = {}; | |
| for (type in u) | |
| for (i = 0, s = u[type].length; i < s; i++) I.event.add(t, type, u[type][i]) | |
| } | |
| l.data && (l.data = I.extend({}, l.data)) | |
| } | |
| } | |
| function fixCloneNodeIssues(src, t) { | |
| var nodeName, e, data; | |
| if (1 === t.nodeType) { | |
| if (nodeName = t.nodeName.toLowerCase(), !I.support.noCloneEvent && t[I.expando]) { | |
| data = I._data(t); | |
| for (e in data.events) I.removeEvent(t, e, data.handle); | |
| t.removeAttribute(I.expando) | |
| } | |
| "script" === nodeName && t.text !== src.text ? (disableScript(t).text = src.text, restoreScript(t)) : "object" === nodeName ? (t.parentNode && (t.outerHTML = src.outerHTML), I.support.html5Clone && src.innerHTML && !I.trim(t.innerHTML) && (t.innerHTML = src.innerHTML)) : "input" === nodeName && ye.test(src.type) ? (t.defaultChecked = t.checked = src.checked, t.value !== src.value && (t.value = src.value)) : "option" === nodeName ? t.defaultSelected = t.selected = src.defaultSelected : "input" !== nodeName && "textarea" !== nodeName || (t.defaultValue = src.defaultValue) | |
| } | |
| } | |
| function getAll(context, tag) { | |
| var t, i, o = 0, | |
| l = typeof context.getElementsByTagName !== s ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== s ? context.querySelectorAll(tag || "*") : undefined; | |
| if (!l) | |
| for (l = [], t = context.childNodes || context; null != (i = t[o]); o++) !tag || I.nodeName(i, tag) ? l.push(i) : I.merge(l, getAll(i, tag)); | |
| return tag === undefined || tag && I.nodeName(context, tag) ? I.merge([context], l) : l | |
| } | |
| function fixDefaultChecked(t) { | |
| ye.test(t.type) && (t.defaultChecked = t.checked) | |
| } | |
| function vendorPropName(style, name) { | |
| if (name in style) return name; | |
| for (var t = name.charAt(0).toUpperCase() + name.slice(1), i = name, s = xe.length; s--;) | |
| if ((name = xe[s] + t) in style) return name; | |
| return i | |
| } | |
| function isHidden(t, i) { | |
| return t = i || t, "none" === I.css(t, "display") || !I.contains(t.ownerDocument, t) | |
| } | |
| function showHide(elements, show) { | |
| for (var display, t, hidden, values = [], index = 0, length = elements.length; index < length; index++)(t = elements[index]).style && (values[index] = I._data(t, "olddisplay"), display = t.style.display, show ? (values[index] || "none" !== display || (t.style.display = ""), "" === t.style.display && isHidden(t) && (values[index] = I._data(t, "olddisplay", css_defaultDisplay(t.nodeName)))) : values[index] || (hidden = isHidden(t), (display && "none" !== display || !hidden) && I._data(t, "olddisplay", hidden ? display : I.css(t, "display")))); | |
| for (index = 0; index < length; index++)(t = elements[index]).style && (show && "none" !== t.style.display && "" !== t.style.display || (t.style.display = show ? values[index] || "" : "none")); | |
| return elements | |
| } | |
| function setPositiveNumber(t, value, i) { | |
| var matches = Be.exec(value); | |
| return matches ? Math.max(0, matches[1] - (i || 0)) + (matches[2] || "px") : value | |
| } | |
| function augmentWidthOrHeight(t, name, i, s, o) { | |
| for (var l = i === (s ? "border" : "content") ? 4 : "width" === name ? 1 : 0, u = 0; l < 4; l += 2) "margin" === i && (u += I.css(t, i + Ve[l], !0, o)), s ? ("content" === i && (u -= I.css(t, "padding" + Ve[l], !0, o)), "margin" !== i && (u -= I.css(t, "border" + Ve[l] + "Width", !0, o))) : (u += I.css(t, "padding" + Ve[l], !0, o), "padding" !== i && (u += I.css(t, "border" + Ve[l] + "Width", !0, o))); | |
| return u | |
| } | |
| function getWidthOrHeight(t, name, i) { | |
| var s = !0, | |
| o = "width" === name ? t.offsetWidth : t.offsetHeight, | |
| l = Le(t), | |
| u = I.support.boxSizing && "border-box" === I.css(t, "boxSizing", !1, l); | |
| if (o <= 0 || null == o) { | |
| if (((o = Ae(t, name, l)) < 0 || null == o) && (o = t.style[name]), Me.test(o)) return o; | |
| s = u && (I.support.boxSizingReliable || o === t.style[name]), o = parseFloat(o) || 0 | |
| } | |
| return o + augmentWidthOrHeight(t, name, i || (u ? "border" : "content"), s, l) + "px" | |
| } | |
| function css_defaultDisplay(nodeName) { | |
| var t = document, | |
| display = Fe[nodeName]; | |
| return display || ("none" !== (display = actualDisplay(nodeName, t)) && display || ((t = ((we = (we || I("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(t.documentElement))[0].contentWindow || we[0].contentDocument).document).write("<!doctype html><html><body>"), t.close(), display = actualDisplay(nodeName, t), we.detach()), Fe[nodeName] = display), display | |
| } | |
| function actualDisplay(name, t) { | |
| var i = I(t.createElement(name)).appendTo(t.body), | |
| display = I.css(i[0], "display"); | |
| return i.remove(), display | |
| } | |
| function buildParams(prefix, t, i, add) { | |
| var name; | |
| if (I.isArray(t)) I.each(t, function(t, s) { | |
| i || Ge.test(prefix) ? add(prefix, s) : buildParams(prefix + "[" + ("object" == typeof s ? t : "") + "]", s, i, add) | |
| }); | |
| else if (i || "object" !== I.type(t)) add(prefix, t); | |
| else | |
| for (name in t) buildParams(prefix + "[" + name + "]", t[name], i, add) | |
| } | |
| function addToPrefiltersOrTransports(t) { | |
| return function(i, s) { | |
| "string" != typeof i && (s = i, i = "*"); | |
| var o, l = 0, | |
| u = i.toLowerCase().match(A) || []; | |
| if (I.isFunction(s)) | |
| for (; o = u[l++];) "+" === o[0] ? (o = o.slice(1) || "*", (t[o] = t[o] || []).unshift(s)) : (t[o] = t[o] || []).push(s) | |
| } | |
| } | |
| function inspectPrefiltersOrTransports(t, options, i, s) { | |
| function inspect(u) { | |
| var selected; | |
| return o[u] = !0, I.each(t[u] || [], function(t, u) { | |
| var h = u(options, i, s); | |
| return "string" != typeof h || l || o[h] ? l ? !(selected = h) : void 0 : (options.dataTypes.unshift(h), inspect(h), !1) | |
| }), selected | |
| } | |
| var o = {}, | |
| l = t === at; | |
| return inspect(options.dataTypes[0]) || !o["*"] && inspect("*") | |
| } | |
| function ajaxExtend(target, src) { | |
| var t, key, i = I.ajaxSettings.flatOptions || {}; | |
| for (key in src) src[key] !== undefined && ((i[key] ? target : t || (t = {}))[key] = src[key]); | |
| return t && I.extend(!0, target, t), | |
| target | |
| } | |
| function ajaxHandleResponses(t, i, s) { | |
| for (var o, l, u, type, h = t.contents, p = t.dataTypes; | |
| "*" === p[0];) p.shift(), l === undefined && (l = t.mimeType || i.getResponseHeader("Content-Type")); | |
| if (l) | |
| for (type in h) | |
| if (h[type] && h[type].test(l)) { | |
| p.unshift(type); | |
| break | |
| } | |
| if (p[0] in s) u = p[0]; | |
| else { | |
| for (type in s) { | |
| if (!p[0] || t.converters[type + " " + p[0]]) { | |
| u = type; | |
| break | |
| } | |
| o || (o = type) | |
| } | |
| u = u || o | |
| } | |
| if (u) return u !== p[0] && p.unshift(u), s[u] | |
| } | |
| function ajaxConvert(t, response, i, s) { | |
| var o, l, u, h, p, m = {}, | |
| _ = t.dataTypes.slice(); | |
| if (_[1]) | |
| for (u in t.converters) m[u.toLowerCase()] = t.converters[u]; | |
| for (l = _.shift(); l;) | |
| if (t.responseFields[l] && (i[t.responseFields[l]] = response), !p && s && t.dataFilter && (response = t.dataFilter(response, t.dataType)), p = l, l = _.shift()) | |
| if ("*" === l) l = p; | |
| else if ("*" !== p && p !== l) { | |
| if (!(u = m[p + " " + l] || m["* " + l])) | |
| for (o in m) | |
| if ((h = o.split(" "))[1] === l && (u = m[p + " " + h[0]] || m["* " + h[0]])) { | |
| !0 === u ? u = m[o] : !0 !== m[o] && (l = h[0], _.unshift(h[1])); | |
| break | |
| } | |
| if (!0 !== u) | |
| if (u && t.throws) response = u(response); | |
| else try { | |
| response = u(response) | |
| } catch (t) { | |
| return { | |
| state: "parsererror", | |
| error: u ? t : "No conversion from " + p + " to " + l | |
| } | |
| } | |
| } | |
| return { | |
| state: "success", | |
| data: response | |
| } | |
| } | |
| function createStandardXHR() { | |
| try { | |
| return new window.XMLHttpRequest | |
| } catch (t) {} | |
| } | |
| function createActiveXHR() { | |
| try { | |
| return new window.ActiveXObject("Microsoft.XMLHTTP") | |
| } catch (t) {} | |
| } | |
| function createFxNow() { | |
| return setTimeout(function() { | |
| _t = undefined | |
| }, 0), _t = I.now() | |
| } | |
| function createTween(value, t, animation) { | |
| for (var i, s = (vt[t] || []).concat(vt["*"]), index = 0, length = s.length; index < length; index++) | |
| if (i = s[index].call(animation, t, value)) return i | |
| } | |
| function Animation(t, properties, options) { | |
| var result, i, index = 0, | |
| length = Tt.length, | |
| s = I.Deferred().always(function() { | |
| delete o.elem | |
| }), | |
| o = function() { | |
| if (i) return !1; | |
| for (var currentTime = _t || createFxNow(), o = Math.max(0, animation.startTime + animation.duration - currentTime), l = 1 - (o / animation.duration || 0), index = 0, length = animation.tweens.length; index < length; index++) animation.tweens[index].run(l); | |
| return s.notifyWith(t, [animation, l, o]), l < 1 && length ? o : (s.resolveWith(t, [animation]), !1) | |
| }, | |
| animation = s.promise({ | |
| elem: t, | |
| props: I.extend({}, properties), | |
| opts: I.extend(!0, { | |
| specialEasing: {} | |
| }, options), | |
| originalProperties: properties, | |
| originalOptions: options, | |
| startTime: _t || createFxNow(), | |
| duration: options.duration, | |
| tweens: [], | |
| createTween: function(i, end) { | |
| var s = I.Tween(t, animation.opts, i, end, animation.opts.specialEasing[i] || animation.opts.easing); | |
| return animation.tweens.push(s), s | |
| }, | |
| stop: function(o) { | |
| var index = 0, | |
| length = o ? animation.tweens.length : 0; | |
| if (i) return this; | |
| for (i = !0; index < length; index++) animation.tweens[index].run(1); | |
| return o ? s.resolveWith(t, [animation, o]) : s.rejectWith(t, [animation, o]), this | |
| } | |
| }), | |
| l = animation.props; | |
| for (propFilter(l, animation.opts.specialEasing); index < length; index++) | |
| if (result = Tt[index].call(animation, t, l, animation.opts)) return result; | |
| return I.map(l, createTween, animation), I.isFunction(animation.opts.start) && animation.opts.start.call(t, animation), I.fx.timer(I.extend(o, { | |
| elem: t, | |
| anim: animation, | |
| queue: animation.opts.queue | |
| })), animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always) | |
| } | |
| function propFilter(t, i) { | |
| var index, name, s, value, o; | |
| for (index in t) | |
| if (name = I.camelCase(index), s = i[name], value = t[index], I.isArray(value) && (s = value[1], value = t[index] = value[0]), index !== name && (t[name] = value, delete t[index]), (o = I.cssHooks[name]) && "expand" in o) { | |
| value = o.expand(value), delete t[name]; | |
| for (index in value) index in t || (t[index] = value[index], i[index] = s) | |
| } else i[name] = s | |
| } | |
| function Tween(t, options, i, end, s) { | |
| return new Tween.prototype.init(t, options, i, end, s) | |
| } | |
| function genFx(type, t) { | |
| var which, i = { | |
| height: type | |
| }, | |
| s = 0; | |
| for (t = t ? 1 : 0; s < 4; s += 2 - t) i["margin" + (which = Ve[s])] = i["padding" + which] = type; | |
| return t && (i.opacity = i.width = type), i | |
| } | |
| function getWindow(t) { | |
| return I.isWindow(t) ? t : 9 === t.nodeType && (t.defaultView || t.parentWindow) | |
| } | |
| var t, i, s = typeof undefined, | |
| location = window.location, | |
| document = window.document, | |
| o = document.documentElement, | |
| l = window.jQuery, | |
| u = window.$, | |
| h = {}, | |
| p = [], | |
| m = p.concat, | |
| _ = p.push, | |
| g = p.slice, | |
| S = p.indexOf, | |
| T = h.toString, | |
| v = h.hasOwnProperty, | |
| C = "1.10.1".trim, | |
| I = function(selector, context) { | |
| return new I.fn.init(selector, context, i) | |
| }, | |
| L = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, | |
| A = /\S+/g, | |
| R = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, | |
| P = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, | |
| D = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, | |
| N = /^[\],:{}\s]*$/, | |
| O = /(?:^|:|,)(?:\s*\[)+/g, | |
| B = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, | |
| M = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, | |
| U = /^-ms-/, | |
| F = /-([\da-z])/gi, | |
| k = function(all, t) { | |
| return t.toUpperCase() | |
| }, | |
| q = function(event) { | |
| (document.addEventListener || "load" === event.type || "complete" === document.readyState) && (detach(), I.ready()) | |
| }, | |
| detach = function() { | |
| document.addEventListener ? (document.removeEventListener("DOMContentLoaded", q, !1), window.removeEventListener("load", q, !1)) : (document.detachEvent("onreadystatechange", q), window.detachEvent("onload", q)) | |
| }; | |
| I.fn = I.prototype = { | |
| jquery: "1.10.1", | |
| constructor: I, | |
| init: function(selector, context, t) { | |
| var match, i; | |
| if (!selector) return this; | |
| if ("string" == typeof selector) { | |
| if (!(match = "<" === selector.charAt(0) && ">" === selector.charAt(selector.length - 1) && selector.length >= 3 ? [null, selector, null] : P.exec(selector)) || !match[1] && context) return !context || context.jquery ? (context || t).find(selector) : this.constructor(context).find(selector); | |
| if (match[1]) { | |
| if (context = context instanceof I ? context[0] : context, I.merge(this, I.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, !0)), D.test(match[1]) && I.isPlainObject(context)) | |
| for (match in context) I.isFunction(this[match]) ? this[match](context[match]) : this.attr(match, context[match]); | |
| return this | |
| } | |
| if ((i = document.getElementById(match[2])) && i.parentNode) { | |
| if (i.id !== match[2]) return t.find(selector); | |
| this.length = 1, this[0] = i | |
| } | |
| return this.context = document, this.selector = selector, this | |
| } | |
| return selector.nodeType ? (this.context = this[0] = selector, this.length = 1, this) : I.isFunction(selector) ? t.ready(selector) : (selector.selector !== undefined && (this.selector = selector.selector, this.context = selector.context), I.makeArray(selector, this)) | |
| }, | |
| selector: "", | |
| length: 0, | |
| toArray: function() { | |
| return g.call(this) | |
| }, | |
| get: function(t) { | |
| return null == t ? this.toArray() : t < 0 ? this[this.length + t] : this[t] | |
| }, | |
| pushStack: function(t) { | |
| var i = I.merge(this.constructor(), t); | |
| return i.prevObject = this, i.context = this.context, i | |
| }, | |
| each: function(t, i) { | |
| return I.each(this, t, i) | |
| }, | |
| ready: function(t) { | |
| return I.ready.promise().done(t), this | |
| }, | |
| slice: function() { | |
| return this.pushStack(g.apply(this, arguments)) | |
| }, | |
| first: function() { | |
| return this.eq(0) | |
| }, | |
| last: function() { | |
| return this.eq(-1) | |
| }, | |
| eq: function(t) { | |
| var i = this.length, | |
| s = +t + (t < 0 ? i : 0); | |
| return this.pushStack(s >= 0 && s < i ? [this[s]] : []) | |
| }, | |
| map: function(t) { | |
| return this.pushStack(I.map(this, function(i, s) { | |
| return t.call(i, s, i) | |
| })) | |
| }, | |
| end: function() { | |
| return this.prevObject || this.constructor(null) | |
| }, | |
| push: _, | |
| sort: [].sort, | |
| splice: [].splice | |
| }, I.fn.init.prototype = I.fn, I.extend = I.fn.extend = function() { | |
| var src, t, i, name, options, clone, target = arguments[0] || {}, | |
| s = 1, | |
| length = arguments.length, | |
| o = !1; | |
| for ("boolean" == typeof target && (o = target, target = arguments[1] || {}, s = 2), "object" == typeof target || I.isFunction(target) || (target = {}), length === s && (target = this, --s); s < length; s++) | |
| if (null != (options = arguments[s])) | |
| for (name in options) src = target[name], target !== (i = options[name]) && (o && i && (I.isPlainObject(i) || (t = I.isArray(i))) ? (t ? (t = !1, clone = src && I.isArray(src) ? src : []) : clone = src && I.isPlainObject(src) ? src : {}, target[name] = I.extend(o, clone, i)) : i !== undefined && (target[name] = i)); | |
| return target | |
| }, I.extend({ | |
| expando: "jQuery" + ("1.10.1" + Math.random()).replace(/\D/g, ""), | |
| noConflict: function(t) { | |
| return window.$ === I && (window.$ = u), t && window.jQuery === I && (window.jQuery = l), I | |
| }, | |
| isReady: !1, | |
| readyWait: 1, | |
| holdReady: function(t) { | |
| t ? I.readyWait++ : I.ready(!0) | |
| }, | |
| ready: function(i) { | |
| if (!0 === i ? !--I.readyWait : !I.isReady) { | |
| if (!document.body) return setTimeout(I.ready); | |
| I.isReady = !0, !0 !== i && --I.readyWait > 0 || (t.resolveWith(document, [I]), | |
| I.fn.trigger && I(document).trigger("ready").off("ready")) | |
| } | |
| }, | |
| isFunction: function(t) { | |
| return "function" === I.type(t) | |
| }, | |
| isArray: Array.isArray || function(t) { | |
| return "array" === I.type(t) | |
| }, | |
| isWindow: function(t) { | |
| return null != t && t == t.window | |
| }, | |
| isNumeric: function(t) { | |
| return !isNaN(parseFloat(t)) && isFinite(t) | |
| }, | |
| type: function(t) { | |
| return null == t ? String(t) : "object" == typeof t || "function" == typeof t ? h[T.call(t)] || "object" : typeof t | |
| }, | |
| isPlainObject: function(t) { | |
| var key; | |
| if (!t || "object" !== I.type(t) || t.nodeType || I.isWindow(t)) return !1; | |
| try { | |
| if (t.constructor && !v.call(t, "constructor") && !v.call(t.constructor.prototype, "isPrototypeOf")) return !1 | |
| } catch (t) { | |
| return !1 | |
| } | |
| if (I.support.ownLast) | |
| for (key in t) return v.call(t, key); | |
| for (key in t); | |
| return key === undefined || v.call(t, key) | |
| }, | |
| isEmptyObject: function(t) { | |
| var name; | |
| for (name in t) return !1; | |
| return !0 | |
| }, | |
| error: function(t) { | |
| throw new Error(t) | |
| }, | |
| parseHTML: function(data, context, t) { | |
| if (!data || "string" != typeof data) return null; | |
| "boolean" == typeof context && (t = context, context = !1), context = context || document; | |
| var i = D.exec(data), | |
| scripts = !t && []; | |
| return i ? [context.createElement(i[1])] : (i = I.buildFragment([data], context, scripts), scripts && I(scripts).remove(), I.merge([], i.childNodes)) | |
| }, | |
| parseJSON: function(data) { | |
| return window.JSON && window.JSON.parse ? window.JSON.parse(data) : null === data ? data : "string" == typeof data && (data = I.trim(data)) && N.test(data.replace(B, "@").replace(M, "]").replace(O, "")) ? new Function("return " + data)() : void I.error("Invalid JSON: " + data) | |
| }, | |
| parseXML: function(data) { | |
| var t, i; | |
| if (!data || "string" != typeof data) return null; | |
| try { | |
| window.DOMParser ? (i = new DOMParser, t = i.parseFromString(data, "text/xml")) : ((t = new ActiveXObject("Microsoft.XMLDOM")).async = "false", t.loadXML(data)) | |
| } catch (i) { | |
| t = undefined | |
| } | |
| return t && t.documentElement && !t.getElementsByTagName("parsererror").length || I.error("Invalid XML: " + data), t | |
| }, | |
| noop: function() {}, | |
| globalEval: function(data) { | |
| data && I.trim(data) && (window.execScript || function(data) { | |
| window.eval.call(window, data) | |
| })(data) | |
| }, | |
| camelCase: function(t) { | |
| return t.replace(U, "ms-").replace(F, k) | |
| }, | |
| nodeName: function(t, name) { | |
| return t.nodeName && t.nodeName.toLowerCase() === name.toLowerCase() | |
| }, | |
| each: function(t, i, s) { | |
| var o = 0, | |
| length = t.length, | |
| isArray = isArraylike(t); | |
| if (s) { | |
| if (isArray) | |
| for (; o < length && !1 !== i.apply(t[o], s); o++); | |
| else | |
| for (o in t) | |
| if (!1 === i.apply(t[o], s)) break | |
| } else if (isArray) | |
| for (; o < length && !1 !== i.call(t[o], o, t[o]); o++); | |
| else | |
| for (o in t) | |
| if (!1 === i.call(t[o], o, t[o])) break; | |
| return t | |
| }, | |
| trim: C && !C.call("\ufeff ") ? function(text) { | |
| return null == text ? "" : C.call(text) | |
| } : function(text) { | |
| return null == text ? "" : (text + "").replace(R, "") | |
| }, | |
| makeArray: function(t, i) { | |
| var s = i || []; | |
| return null != t && (isArraylike(Object(t)) ? I.merge(s, "string" == typeof t ? [t] : t) : _.call(s, t)), s | |
| }, | |
| inArray: function(t, i, s) { | |
| var o; | |
| if (i) { | |
| if (S) return S.call(i, t, s); | |
| for (o = i.length, s = s ? s < 0 ? Math.max(0, o + s) : s : 0; s < o; s++) | |
| if (s in i && i[s] === t) return s | |
| } | |
| return -1 | |
| }, | |
| merge: function(t, i) { | |
| var s = i.length, | |
| o = t.length, | |
| l = 0; | |
| if ("number" == typeof s) | |
| for (; l < s; l++) t[o++] = i[l]; | |
| else | |
| for (; i[l] !== undefined;) t[o++] = i[l++]; | |
| return t.length = o, t | |
| }, | |
| grep: function(t, i, s) { | |
| var o = [], | |
| l = 0, | |
| length = t.length; | |
| for (s = !!s; l < length; l++) s !== !!i(t[l], l) && o.push(t[l]); | |
| return o | |
| }, | |
| map: function(t, i, s) { | |
| var value, o = 0, | |
| length = t.length, | |
| l = []; | |
| if (isArraylike(t)) | |
| for (; o < length; o++) null != (value = i(t[o], o, s)) && (l[l.length] = value); | |
| else | |
| for (o in t) null != (value = i(t[o], o, s)) && (l[l.length] = value); | |
| return m.apply([], l) | |
| }, | |
| guid: 1, | |
| proxy: function(t, context) { | |
| var i, s, o; | |
| return "string" == typeof context && (o = t[context], context = t, t = o), I.isFunction(t) ? (i = g.call(arguments, 2), s = function() { | |
| return t.apply(context || this, i.concat(g.call(arguments))) | |
| }, s.guid = t.guid = t.guid || I.guid++, s) : undefined | |
| }, | |
| access: function(t, i, key, value, s, o, raw) { | |
| var l = 0, | |
| length = t.length, | |
| u = null == key; | |
| if ("object" === I.type(key)) { | |
| s = !0; | |
| for (l in key) I.access(t, i, l, key[l], !0, o, raw) | |
| } else if (value !== undefined && (s = !0, I.isFunction(value) || (raw = !0), u && (raw ? (i.call(t, value), i = null) : (u = i, i = function(t, key, value) { | |
| return u.call(I(t), value) | |
| })), i)) | |
| for (; l < length; l++) i(t[l], key, raw ? value : value.call(t[l], l, i(t[l], key))); | |
| return s ? t : u ? i.call(t) : length ? i(t[0], key) : o | |
| }, | |
| now: function() { | |
| return (new Date).getTime() | |
| }, | |
| swap: function(t, options, i, s) { | |
| var o, name, l = {}; | |
| for (name in options) l[name] = t.style[name], t.style[name] = options[name]; | |
| o = i.apply(t, s || []); | |
| for (name in options) t.style[name] = l[name]; | |
| return o | |
| } | |
| }), I.ready.promise = function(i) { | |
| if (!t) | |
| if (t = I.Deferred(), "complete" === document.readyState) setTimeout(I.ready); | |
| else if (document.addEventListener) document.addEventListener("DOMContentLoaded", q, !1), window.addEventListener("load", q, !1); | |
| else { | |
| document.attachEvent("onreadystatechange", q), window.attachEvent("onload", q); | |
| var top = !1; | |
| try { | |
| top = null == window.frameElement && document.documentElement | |
| } catch (t) {} | |
| top && top.doScroll && function doScrollCheck() { | |
| if (!I.isReady) { | |
| try { | |
| top.doScroll("left") | |
| } catch (t) { | |
| return setTimeout(doScrollCheck, 50) | |
| } | |
| detach(), I.ready() | |
| } | |
| }() | |
| } | |
| return t.promise(i) | |
| }, I.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(t, name) { | |
| h["[object " + name + "]"] = name.toLowerCase() | |
| }), i = I(document), | |
| function(window, undefined) { | |
| function Sizzle(selector, context, t, seed) { | |
| var match, s, o, nodeType, l, u, h, p, _, T; | |
| if ((context ? context.ownerDocument || context : v) !== document && m(context), context = context || document, t = t || [], !selector || "string" != typeof selector) return t; | |
| if (1 !== (nodeType = context.nodeType) && 9 !== nodeType) return []; | |
| if (g && !seed) { | |
| if (match = X.exec(selector)) | |
| if (o = match[1]) { | |
| if (9 === nodeType) { | |
| if (!(s = context.getElementById(o)) || !s.parentNode) return t; | |
| if (s.id === o) return t.push(s), t | |
| } else if (context.ownerDocument && (s = context.ownerDocument.getElementById(o)) && contains(context, s) && s.id === o) return t.push(s), t | |
| } else { | |
| if (match[2]) return push.apply(t, context.getElementsByTagName(selector)), t; | |
| if ((o = match[3]) && i.getElementsByClassName && context.getElementsByClassName) return push.apply(t, context.getElementsByClassName(o)), t | |
| } | |
| if (i.qsa && (!S || !S.test(selector))) { | |
| if (p = h = expando, _ = context, T = 9 === nodeType && selector, 1 === nodeType && "object" !== context.nodeName.toLowerCase()) { | |
| for (u = tokenize(selector), (h = context.getAttribute("id")) ? p = h.replace(te, "\\$&") : context.setAttribute("id", p), p = "[id='" + p + "'] ", l = u.length; l--;) u[l] = p + toSelector(u[l]); | |
| _ = H.test(selector) && context.parentNode || context, T = u.join(",") | |
| } | |
| if (T) try { | |
| return push.apply(t, _.querySelectorAll(T)), t | |
| } catch (t) {} finally { | |
| h || context.removeAttribute("id") | |
| } | |
| } | |
| } | |
| return select(selector.replace(V, "$1"), context, t, seed) | |
| } | |
| function isNative(t) { | |
| return J.test(t + "") | |
| } | |
| function createCache() { | |
| function cache(key, value) { | |
| return keys.push(key += " ") > o.cacheLength && delete cache[keys.shift()], cache[key] = value | |
| } | |
| var keys = []; | |
| return cache | |
| } | |
| function markFunction(t) { | |
| return t[expando] = !0, t | |
| } | |
| function assert(t) { | |
| var i = document.createElement("div"); | |
| try { | |
| return !!t(i) | |
| } catch (t) { | |
| return !1 | |
| } finally { | |
| i.parentNode && i.parentNode.removeChild(i), i = null | |
| } | |
| } | |
| function addHandle(t, i, test) { | |
| for (var s, l = (t = t.split("|")).length, u = test ? null : i; l--;)(s = o.attrHandle[t[l]]) && s !== i || (o.attrHandle[t[l]] = u) | |
| } | |
| function boolHandler(t, name) { | |
| var i = t.getAttributeNode(name); | |
| return i && i.specified ? i.value : !0 === t[name] ? name.toLowerCase() : null | |
| } | |
| function interpolationHandler(t, name) { | |
| return t.getAttribute(name, "type" === name.toLowerCase() ? 1 : 2) | |
| } | |
| function valueHandler(t) { | |
| if ("input" === t.nodeName.toLowerCase()) return t.defaultValue | |
| } | |
| function siblingCheck(a, b) { | |
| var t = b && a, | |
| i = t && 1 === a.nodeType && 1 === b.nodeType && (~b.sourceIndex || N) - (~a.sourceIndex || N); | |
| if (i) return i; | |
| if (t) | |
| for (; t = t.nextSibling;) | |
| if (t === b) return -1; | |
| return a ? 1 : -1 | |
| } | |
| function createPositionalPseudo(t) { | |
| return markFunction(function(i) { | |
| return i = +i, markFunction(function(seed, matches) { | |
| for (var s, o = t([], seed.length, i), l = o.length; l--;) seed[s = o[l]] && (seed[s] = !(matches[s] = seed[s])) | |
| }) | |
| }) | |
| } | |
| function tokenize(selector, t) { | |
| var i, match, s, type, l, u, h, p = A[selector + " "]; | |
| if (p) return t ? 0 : p.slice(0); | |
| for (l = selector, u = [], h = o.preFilter; l;) { | |
| i && !(match = $.exec(l)) || (match && (l = l.slice(match[0].length) || l), u.push(s = [])), i = !1, (match = G.exec(l)) && (i = match.shift(), s.push({ | |
| value: i, | |
| type: match[0].replace(V, " ") | |
| }), l = l.slice(i.length)); | |
| for (type in o.filter) !(match = W[type].exec(l)) || h[type] && !(match = h[type](match)) || (i = match.shift(), s.push({ | |
| value: i, | |
| type: type, | |
| matches: match | |
| }), | |
| l = l.slice(i.length)); | |
| if (!i) break | |
| } | |
| return t ? l.length : l ? Sizzle.error(selector) : A(selector, u).slice(0) | |
| } | |
| function toSelector(t) { | |
| for (var i = 0, s = t.length, selector = ""; i < s; i++) selector += t[i].value; | |
| return selector | |
| } | |
| function addCombinator(t, i, o) { | |
| var dir = i.dir, | |
| l = o && "parentNode" === dir, | |
| u = done++; | |
| return i.first ? function(i, context, s) { | |
| for (; i = i[dir];) | |
| if (1 === i.nodeType || l) return t(i, context, s) | |
| } : function(i, context, o) { | |
| var data, h, p, m = C + " " + u; | |
| if (o) { | |
| for (; i = i[dir];) | |
| if ((1 === i.nodeType || l) && t(i, context, o)) return !0 | |
| } else | |
| for (; i = i[dir];) | |
| if (1 === i.nodeType || l) | |
| if (p = i[expando] || (i[expando] = {}), (h = p[dir]) && h[0] === m) { | |
| if (!0 === (data = h[1]) || data === s) return !0 === data | |
| } else if (h = p[dir] = [m], h[1] = t(i, context, o) || s, !0 === h[1]) return !0 | |
| } | |
| } | |
| function elementMatcher(t) { | |
| return t.length > 1 ? function(i, context, s) { | |
| for (var o = t.length; o--;) | |
| if (!t[o](i, context, s)) return !1; | |
| return !0 | |
| } : t[0] | |
| } | |
| function condense(t, map, filter, context, i) { | |
| for (var s, o = [], l = 0, u = t.length, h = null != map; l < u; l++)(s = t[l]) && (filter && !filter(s, context, i) || (o.push(s), h && map.push(l))); | |
| return o | |
| } | |
| function setMatcher(t, selector, i, s, o, l) { | |
| return s && !s[expando] && (s = setMatcher(s)), o && !o[expando] && (o = setMatcher(o, l)), markFunction(function(seed, l, context, u) { | |
| var h, p, m, _ = [], | |
| g = [], | |
| S = l.length, | |
| T = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), | |
| v = !t || !seed && selector ? T : condense(T, _, t, context, u), | |
| C = i ? o || (seed ? t : S || s) ? [] : l : v; | |
| if (i && i(v, C, context, u), s) | |
| for (h = condense(C, g), s(h, [], context, u), p = h.length; p--;)(m = h[p]) && (C[g[p]] = !(v[g[p]] = m)); | |
| if (seed) { | |
| if (o || t) { | |
| if (o) { | |
| for (h = [], p = C.length; p--;)(m = C[p]) && h.push(v[p] = m); | |
| o(null, C = [], h, u) | |
| } | |
| for (p = C.length; p--;)(m = C[p]) && (h = o ? indexOf.call(seed, m) : _[p]) > -1 && (seed[h] = !(l[h] = m)) | |
| } | |
| } else C = condense(C === l ? C.splice(S, C.length) : C), o ? o(null, l, C, u) : push.apply(l, C) | |
| }) | |
| } | |
| function matcherFromTokens(t) { | |
| for (var i, s, l, u = t.length, p = o.relative[t[0].type], m = p || o.relative[" "], _ = p ? 1 : 0, g = addCombinator(function(t) { | |
| return t === i | |
| }, m, !0), S = addCombinator(function(t) { | |
| return indexOf.call(i, t) > -1 | |
| }, m, !0), T = [function(t, context, s) { | |
| return !p && (s || context !== h) || ((i = context).nodeType ? g(t, context, s) : S(t, context, s)) | |
| }]; _ < u; _++) | |
| if (s = o.relative[t[_].type]) T = [addCombinator(elementMatcher(T), s)]; | |
| else { | |
| if ((s = o.filter[t[_].type].apply(null, t[_].matches))[expando]) { | |
| for (l = ++_; l < u && !o.relative[t[l].type]; l++); | |
| return setMatcher(_ > 1 && elementMatcher(T), _ > 1 && toSelector(t.slice(0, _ - 1).concat({ | |
| value: " " === t[_ - 2].type ? "*" : "" | |
| })).replace(V, "$1"), s, _ < l && matcherFromTokens(t.slice(_, l)), l < u && matcherFromTokens(t = t.slice(l)), l < u && toSelector(t)) | |
| } | |
| T.push(s) | |
| } | |
| return elementMatcher(T) | |
| } | |
| function matcherFromGroupMatchers(t, i) { | |
| var l = 0, | |
| u = i.length > 0, | |
| p = t.length > 0, | |
| m = function(seed, context, m, _, g) { | |
| var S, T, v, I = [], | |
| L = 0, | |
| A = "0", | |
| R = seed && [], | |
| P = null != g, | |
| D = h, | |
| N = seed || p && o.find.TAG("*", g && context.parentNode || context), | |
| O = C += null == D ? 1 : Math.random() || .1; | |
| for (P && (h = context !== document && context, s = l); null != (S = N[A]); A++) { | |
| if (p && S) { | |
| for (T = 0; v = t[T++];) | |
| if (v(S, context, m)) { | |
| _.push(S); | |
| break | |
| } | |
| P && (C = O, s = ++l) | |
| } | |
| u && ((S = !v && S) && L--, seed && R.push(S)) | |
| } | |
| if (L += A, u && A !== L) { | |
| for (T = 0; v = i[T++];) v(R, I, context, m); | |
| if (seed) { | |
| if (L > 0) | |
| for (; A--;) R[A] || I[A] || (I[A] = pop.call(_)); | |
| I = condense(I) | |
| } | |
| push.apply(_, I), P && !seed && I.length > 0 && L + i.length > 1 && Sizzle.uniqueSort(_) | |
| } | |
| return P && (C = O, h = D), R | |
| }; | |
| return u ? markFunction(m) : m | |
| } | |
| function multipleContexts(selector, t, i) { | |
| for (var s = 0, o = t.length; s < o; s++) Sizzle(selector, t[s], i); | |
| return i | |
| } | |
| function select(selector, context, t, seed) { | |
| var s, l, u, type, find, match = tokenize(selector); | |
| if (!seed && 1 === match.length) { | |
| if ((l = match[0] = match[0].slice(0)).length > 2 && "ID" === (u = l[0]).type && i.getById && 9 === context.nodeType && g && o.relative[l[1].type]) { | |
| if (!(context = (o.find.ID(u.matches[0].replace(ie, se), context) || [])[0])) return t; | |
| selector = selector.slice(l.shift().value.length) | |
| } | |
| for (s = W.needsContext.test(selector) ? 0 : l.length; s-- && (u = l[s], !o.relative[type = u.type]);) | |
| if ((find = o.find[type]) && (seed = find(u.matches[0].replace(ie, se), H.test(l[0].type) && context.parentNode || context))) { | |
| if (l.splice(s, 1), !(selector = seed.length && toSelector(l))) return push.apply(t, seed), t; | |
| break | |
| } | |
| } | |
| return compile(selector, match)(seed, context, !g, t, H.test(selector)), t | |
| } | |
| function setFilters() {} | |
| var t, i, s, o, l, u, compile, h, p, m, document, _, g, S, T, matches, contains, expando = "sizzle" + -new Date, | |
| v = window.document, | |
| C = 0, | |
| done = 0, | |
| L = createCache(), | |
| A = createCache(), | |
| R = createCache(), | |
| P = !1, | |
| D = function() { | |
| return 0 | |
| }, | |
| N = 1 << 31, | |
| O = {}.hasOwnProperty, | |
| B = [], | |
| pop = B.pop, | |
| M = B.push, | |
| push = B.push, | |
| slice = B.slice, | |
| indexOf = B.indexOf || function(t) { | |
| for (var i = 0, s = this.length; i < s; i++) | |
| if (this[i] === t) return i; | |
| return -1 | |
| }, | |
| U = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", | |
| F = "[\\x20\\t\\r\\n\\f]", | |
| k = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", | |
| identifier = k.replace("w", "w#"), | |
| attributes = "\\[" + F + "*(" + k + ")" + F + "*(?:([*^$|!~]?=)" + F + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + F + "*\\]", | |
| q = ":(" + k + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)", | |
| V = new RegExp("^" + F + "+|((?:^|[^\\\\])(?:\\\\.)*)" + F + "+$", "g"), | |
| $ = new RegExp("^" + F + "*," + F + "*"), | |
| G = new RegExp("^" + F + "*([>+~]|" + F + ")" + F + "*"), | |
| H = new RegExp(F + "*[+~]"), | |
| j = new RegExp("=" + F + "*([^\\]'\"]*)" + F + "*\\]", "g"), | |
| Y = new RegExp(q), | |
| K = new RegExp("^" + identifier + "$"), | |
| W = { | |
| ID: new RegExp("^#(" + k + ")"), | |
| CLASS: new RegExp("^\\.(" + k + ")"), | |
| TAG: new RegExp("^(" + k.replace("w", "w*") + ")"), | |
| ATTR: new RegExp("^" + attributes), | |
| PSEUDO: new RegExp("^" + q), | |
| CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + F + "*(even|odd|(([+-]|)(\\d*)n|)" + F + "*(?:([+-]|)" + F + "*(\\d+)|))" + F + "*\\)|)", "i"), | |
| bool: new RegExp("^(?:" + U + ")$", "i"), | |
| needsContext: new RegExp("^" + F + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + F + "*((?:-\\d)?\\d*)" + F + "*\\)|)(?=[^-]|$)", "i") | |
| }, | |
| J = /^[^{]+\{\s*\[native \w/, | |
| X = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, | |
| Z = /^(?:input|select|textarea|button)$/i, | |
| ee = /^h\d$/i, | |
| te = /'|\\/g, | |
| ie = new RegExp("\\\\([\\da-f]{1,6}" + F + "?|(" + F + ")|.)", "ig"), | |
| se = function(t, i, s) { | |
| var high = "0x" + i - 65536; | |
| return high !== high || s ? i : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, 1023 & high | 56320) | |
| }; | |
| try { | |
| push.apply(B = slice.call(v.childNodes), v.childNodes); | |
| B[v.childNodes.length].nodeType | |
| } catch (t) { | |
| push = { | |
| apply: B.length ? function(target, t) { | |
| M.apply(target, slice.call(t)) | |
| } : function(target, t) { | |
| for (var i = target.length, s = 0; target[i++] = t[s++];); | |
| target.length = i - 1 | |
| } | |
| } | |
| } | |
| u = Sizzle.isXML = function(t) { | |
| var documentElement = t && (t.ownerDocument || t).documentElement; | |
| return !!documentElement && "HTML" !== documentElement.nodeName | |
| }, i = Sizzle.support = {}, m = Sizzle.setDocument = function(t) { | |
| var s = t ? t.ownerDocument || t : v, | |
| parent = s.parentWindow; | |
| return s !== document && 9 === s.nodeType && s.documentElement ? (document = s, _ = s.documentElement, g = !u(s), parent && parent.frameElement && parent.attachEvent("onbeforeunload", function() { | |
| m() | |
| }), i.attributes = assert(function(t) { | |
| return t.innerHTML = "<a href='#'></a>", addHandle("type|href|height|width", interpolationHandler, "#" === t.firstChild.getAttribute("href")), addHandle(U, boolHandler, null == t.getAttribute("disabled")), t.className = "i", !t.getAttribute("className") | |
| }), i.input = assert(function(t) { | |
| return t.innerHTML = "<input>", t.firstChild.setAttribute("value", ""), "" === t.firstChild.getAttribute("value") | |
| }), addHandle("value", valueHandler, i.attributes && i.input), i.getElementsByTagName = assert(function(t) { | |
| return t.appendChild(s.createComment("")), !t.getElementsByTagName("*").length | |
| }), i.getElementsByClassName = assert(function(t) { | |
| return t.innerHTML = "<div class='a'></div><div class='a i'></div>", t.firstChild.className = "i", 2 === t.getElementsByClassName("i").length | |
| }), i.getById = assert(function(t) { | |
| return _.appendChild(t).id = expando, !s.getElementsByName || !s.getElementsByName(expando).length | |
| }), i.getById ? (o.find.ID = function(id, context) { | |
| if (void 0 !== context.getElementById && g) { | |
| var t = context.getElementById(id); | |
| return t && t.parentNode ? [t] : [] | |
| } | |
| }, o.filter.ID = function(id) { | |
| var t = id.replace(ie, se); | |
| return function(i) { | |
| return i.getAttribute("id") === t | |
| } | |
| }) : (delete o.find.ID, o.filter.ID = function(id) { | |
| var t = id.replace(ie, se); | |
| return function(i) { | |
| var s = void 0 !== i.getAttributeNode && i.getAttributeNode("id"); | |
| return s && s.value === t | |
| } | |
| }), o.find.TAG = i.getElementsByTagName ? function(tag, context) { | |
| if (void 0 !== context.getElementsByTagName) return context.getElementsByTagName(tag) | |
| } : function(tag, context) { | |
| var t, i = [], | |
| s = 0, | |
| o = context.getElementsByTagName(tag); | |
| if ("*" === tag) { | |
| for (; t = o[s++];) 1 === t.nodeType && i.push(t); | |
| return i | |
| } | |
| return o | |
| }, o.find.CLASS = i.getElementsByClassName && function(className, context) { | |
| if (void 0 !== context.getElementsByClassName && g) return context.getElementsByClassName(className) | |
| }, T = [], S = [], (i.qsa = isNative(s.querySelectorAll)) && (assert(function(t) { | |
| t.innerHTML = "<select><option selected=''></option></select>", t.querySelectorAll("[selected]").length || S.push("\\[" + F + "*(?:value|" + U + ")"), t.querySelectorAll(":checked").length || S.push(":checked") | |
| }), assert(function(t) { | |
| var input = s.createElement("input"); | |
| input.setAttribute("type", "hidden"), t.appendChild(input).setAttribute("t", ""), t.querySelectorAll("[t^='']").length && S.push("[*^$]=" + F + "*(?:''|\"\")"), t.querySelectorAll(":enabled").length || S.push(":enabled", ":disabled"), t.querySelectorAll("*,:x"), S.push(",.*:") | |
| })), (i.matchesSelector = isNative(matches = _.webkitMatchesSelector || _.mozMatchesSelector || _.oMatchesSelector || _.msMatchesSelector)) && assert(function(t) { | |
| i.disconnectedMatch = matches.call(t, "div"), matches.call(t, "[s!='']:x"), T.push("!=", q) | |
| }), S = S.length && new RegExp(S.join("|")), T = T.length && new RegExp(T.join("|")), contains = isNative(_.contains) || _.compareDocumentPosition ? function(a, b) { | |
| var t = 9 === a.nodeType ? a.documentElement : a, | |
| i = b && b.parentNode; | |
| return a === i || !(!i || 1 !== i.nodeType || !(t.contains ? t.contains(i) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(i))) | |
| } : function(a, b) { | |
| if (b) | |
| for (; b = b.parentNode;) | |
| if (b === a) return !0; | |
| return !1 | |
| }, i.sortDetached = assert(function(t) { | |
| return 1 & t.compareDocumentPosition(s.createElement("div")) | |
| }), D = _.compareDocumentPosition ? function(a, b) { | |
| if (a === b) return P = !0, 0; | |
| var t = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition(b); | |
| return t ? 1 & t || !i.sortDetached && b.compareDocumentPosition(a) === t ? a === s || contains(v, a) ? -1 : b === s || contains(v, b) ? 1 : p ? indexOf.call(p, a) - indexOf.call(p, b) : 0 : 4 & t ? -1 : 1 : a.compareDocumentPosition ? -1 : 1 | |
| } : function(a, b) { | |
| var t, i = 0, | |
| o = a.parentNode, | |
| l = b.parentNode, | |
| u = [a], | |
| h = [b]; | |
| if (a === b) return P = !0, 0; | |
| if (!o || !l) return a === s ? -1 : b === s ? 1 : o ? -1 : l ? 1 : p ? indexOf.call(p, a) - indexOf.call(p, b) : 0; | |
| if (o === l) return siblingCheck(a, b); | |
| for (t = a; t = t.parentNode;) u.unshift(t); | |
| for (t = b; t = t.parentNode;) h.unshift(t); | |
| for (; u[i] === h[i];) i++; | |
| return i ? siblingCheck(u[i], h[i]) : u[i] === v ? -1 : h[i] === v ? 1 : 0 | |
| }, s) : document | |
| }, Sizzle.matches = function(t, elements) { | |
| return Sizzle(t, null, null, elements) | |
| }, Sizzle.matchesSelector = function(t, s) { | |
| if ((t.ownerDocument || t) !== document && m(t), s = s.replace(j, "='$1']"), i.matchesSelector && g && (!T || !T.test(s)) && (!S || !S.test(s))) try { | |
| var o = matches.call(t, s); | |
| if (o || i.disconnectedMatch || t.document && 11 !== t.document.nodeType) return o | |
| } catch (t) {} | |
| return Sizzle(s, document, null, [t]).length > 0 | |
| }, Sizzle.contains = function(context, t) { | |
| return (context.ownerDocument || context) !== document && m(context), contains(context, t) | |
| }, Sizzle.attr = function(t, name) { | |
| (t.ownerDocument || t) !== document && m(t); | |
| var s = o.attrHandle[name.toLowerCase()], | |
| l = s && O.call(o.attrHandle, name.toLowerCase()) ? s(t, name, !g) : void 0; | |
| return void 0 === l ? i.attributes || !g ? t.getAttribute(name) : (l = t.getAttributeNode(name)) && l.specified ? l.value : null : l | |
| }, Sizzle.error = function(t) { | |
| throw new Error("Syntax error, unrecognized expression: " + t) | |
| }, Sizzle.uniqueSort = function(t) { | |
| var s, o = [], | |
| l = 0, | |
| u = 0; | |
| if (P = !i.detectDuplicates, p = !i.sortStable && t.slice(0), t.sort(D), P) { | |
| for (; s = t[u++];) s === t[u] && (l = o.push(u)); | |
| for (; l--;) t.splice(o[l], 1) | |
| } | |
| return t | |
| }, l = Sizzle.getText = function(t) { | |
| var i, s = "", | |
| o = 0, | |
| nodeType = t.nodeType; | |
| if (nodeType) { | |
| if (1 === nodeType || 9 === nodeType || 11 === nodeType) { | |
| if ("string" == typeof t.textContent) return t.textContent; | |
| for (t = t.firstChild; t; t = t.nextSibling) s += l(t) | |
| } else if (3 === nodeType || 4 === nodeType) return t.nodeValue | |
| } else | |
| for (; i = t[o]; o++) s += l(i); | |
| return s | |
| }, o = Sizzle.selectors = { | |
| cacheLength: 50, | |
| createPseudo: markFunction, | |
| match: W, | |
| attrHandle: {}, | |
| find: {}, | |
| relative: { | |
| ">": { | |
| dir: "parentNode", | |
| first: !0 | |
| }, | |
| " ": { | |
| dir: "parentNode" | |
| }, | |
| "+": { | |
| dir: "previousSibling", | |
| first: !0 | |
| }, | |
| "~": { | |
| dir: "previousSibling" | |
| } | |
| }, | |
| preFilter: { | |
| ATTR: function(match) { | |
| return match[1] = match[1].replace(ie, se), match[3] = (match[4] || match[5] || "").replace(ie, se), "~=" === match[2] && (match[3] = " " + match[3] + " "), match.slice(0, 4) | |
| }, | |
| CHILD: function(match) { | |
| return match[1] = match[1].toLowerCase(), "nth" === match[1].slice(0, 3) ? (match[3] || Sizzle.error(match[0]), match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * ("even" === match[3] || "odd" === match[3])), match[5] = +(match[7] + match[8] || "odd" === match[3])) : match[3] && Sizzle.error(match[0]), match | |
| }, | |
| PSEUDO: function(match) { | |
| var t, i = !match[5] && match[2]; | |
| return W.CHILD.test(match[0]) ? null : (match[3] && void 0 !== match[4] ? match[2] = match[4] : i && Y.test(i) && (t = tokenize(i, !0)) && (t = i.indexOf(")", i.length - t) - i.length) && (match[0] = match[0].slice(0, t), match[2] = i.slice(0, t)), match.slice(0, 3)) | |
| } | |
| }, | |
| filter: { | |
| TAG: function(t) { | |
| var nodeName = t.replace(ie, se).toLowerCase(); | |
| return "*" === t ? function() { | |
| return !0 | |
| } : function(t) { | |
| return t.nodeName && t.nodeName.toLowerCase() === nodeName | |
| } | |
| }, | |
| CLASS: function(className) { | |
| var pattern = L[className + " "]; | |
| return pattern || (pattern = new RegExp("(^|" + F + ")" + className + "(" + F + "|$)")) && L(className, function(t) { | |
| return pattern.test("string" == typeof t.className && t.className || void 0 !== t.getAttribute && t.getAttribute("class") || "") | |
| }) | |
| }, | |
| ATTR: function(name, operator, t) { | |
| return function(i) { | |
| var result = Sizzle.attr(i, name); | |
| return null == result ? "!=" === operator : !operator || (result += "", "=" === operator ? result === t : "!=" === operator ? result !== t : "^=" === operator ? t && 0 === result.indexOf(t) : "*=" === operator ? t && result.indexOf(t) > -1 : "$=" === operator ? t && result.slice(-t.length) === t : "~=" === operator ? (" " + result + " ").indexOf(t) > -1 : "|=" === operator && (result === t || result.slice(0, t.length + 1) === t + "-")) | |
| } | |
| }, | |
| CHILD: function(type, t, i, s, o) { | |
| var l = "nth" !== type.slice(0, 3), | |
| forward = "last" !== type.slice(-4), | |
| u = "of-type" === t; | |
| return 1 === s && 0 === o ? function(t) { | |
| return !!t.parentNode | |
| } : function(t, context, i) { | |
| var h, p, m, _, g, start, dir = l !== forward ? "nextSibling" : "previousSibling", | |
| parent = t.parentNode, | |
| name = u && t.nodeName.toLowerCase(), | |
| S = !i && !u; | |
| if (parent) { | |
| if (l) { | |
| for (; dir;) { | |
| for (m = t; m = m[dir];) | |
| if (u ? m.nodeName.toLowerCase() === name : 1 === m.nodeType) return !1; | |
| start = dir = "only" === type && !start && "nextSibling" | |
| } | |
| return !0 | |
| } | |
| if (start = [forward ? parent.firstChild : parent.lastChild], forward && S) { | |
| for (g = (h = (p = parent[expando] || (parent[expando] = {}))[type] || [])[0] === C && h[1], _ = h[0] === C && h[2], m = g && parent.childNodes[g]; m = ++g && m && m[dir] || (_ = g = 0) || start.pop();) | |
| if (1 === m.nodeType && ++_ && m === t) { | |
| p[type] = [C, g, _]; | |
| break | |
| } | |
| } else if (S && (h = (t[expando] || (t[expando] = {}))[type]) && h[0] === C) _ = h[1]; | |
| else | |
| for (; | |
| (m = ++g && m && m[dir] || (_ = g = 0) || start.pop()) && ((u ? m.nodeName.toLowerCase() !== name : 1 !== m.nodeType) || !++_ || (S && ((m[expando] || (m[expando] = {}))[type] = [C, _]), m !== t));); | |
| return (_ -= o) === s || _ % s == 0 && _ / s >= 0 | |
| } | |
| } | |
| }, | |
| PSEUDO: function(t, i) { | |
| var s, l = o.pseudos[t] || o.setFilters[t.toLowerCase()] || Sizzle.error("unsupported pseudo: " + t); | |
| return l[expando] ? l(i) : l.length > 1 ? (s = [t, t, "", i], o.setFilters.hasOwnProperty(t.toLowerCase()) ? markFunction(function(seed, matches) { | |
| for (var t, s = l(seed, i), o = s.length; o--;) seed[t = indexOf.call(seed, s[o])] = !(matches[t] = s[o]) | |
| }) : function(t) { | |
| return l(t, 0, s) | |
| }) : l | |
| } | |
| }, | |
| pseudos: { | |
| not: markFunction(function(selector) { | |
| var input = [], | |
| t = [], | |
| i = compile(selector.replace(V, "$1")); | |
| return i[expando] ? markFunction(function(seed, matches, context, t) { | |
| for (var s, o = i(seed, null, t, []), l = seed.length; l--;)(s = o[l]) && (seed[l] = !(matches[l] = s)) | |
| }) : function(s, context, o) { | |
| return input[0] = s, i(input, null, o, t), !t.pop() | |
| } | |
| }), | |
| has: markFunction(function(selector) { | |
| return function(t) { | |
| return Sizzle(selector, t).length > 0 | |
| } | |
| }), | |
| contains: markFunction(function(text) { | |
| return function(t) { | |
| return (t.textContent || t.innerText || l(t)).indexOf(text) > -1 | |
| } | |
| }), | |
| lang: markFunction(function(lang) { | |
| return K.test(lang || "") || Sizzle.error("unsupported lang: " + lang), lang = lang.replace(ie, se).toLowerCase(), | |
| function(t) { | |
| var i; | |
| do { | |
| if (i = g ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (i = i.toLowerCase()) === lang || 0 === i.indexOf(lang + "-") | |
| } while ((t = t.parentNode) && 1 === t.nodeType); | |
| return !1 | |
| } | |
| }), | |
| target: function(t) { | |
| var hash = window.location && window.location.hash; | |
| return hash && hash.slice(1) === t.id | |
| }, | |
| root: function(t) { | |
| return t === _ | |
| }, | |
| focus: function(t) { | |
| return t === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(t.type || t.href || ~t.tabIndex) | |
| }, | |
| enabled: function(t) { | |
| return !1 === t.disabled | |
| }, | |
| disabled: function(t) { | |
| return !0 === t.disabled | |
| }, | |
| checked: function(t) { | |
| var nodeName = t.nodeName.toLowerCase(); | |
| return "input" === nodeName && !!t.checked || "option" === nodeName && !!t.selected | |
| }, | |
| selected: function(t) { | |
| if (t.parentNode) t.parentNode.selectedIndex; | |
| return !0 === t.selected | |
| }, | |
| empty: function(t) { | |
| for (t = t.firstChild; t; t = t.nextSibling) | |
| if (t.nodeName > "@" || 3 === t.nodeType || 4 === t.nodeType) return !1; | |
| return !0 | |
| }, | |
| parent: function(t) { | |
| return !o.pseudos.empty(t) | |
| }, | |
| header: function(t) { | |
| return ee.test(t.nodeName) | |
| }, | |
| input: function(t) { | |
| return Z.test(t.nodeName) | |
| }, | |
| button: function(t) { | |
| var name = t.nodeName.toLowerCase(); | |
| return "input" === name && "button" === t.type || "button" === name | |
| }, | |
| text: function(t) { | |
| var i; | |
| return "input" === t.nodeName.toLowerCase() && "text" === t.type && (null == (i = t.getAttribute("type")) || i.toLowerCase() === t.type) | |
| }, | |
| first: createPositionalPseudo(function() { | |
| return [0] | |
| }), | |
| last: createPositionalPseudo(function(t, length) { | |
| return [length - 1] | |
| }), | |
| eq: createPositionalPseudo(function(t, length, i) { | |
| return [i < 0 ? i + length : i] | |
| }), | |
| even: createPositionalPseudo(function(t, length) { | |
| for (var i = 0; i < length; i += 2) t.push(i); | |
| return t | |
| }), | |
| odd: createPositionalPseudo(function(t, length) { | |
| for (var i = 1; i < length; i += 2) t.push(i); | |
| return t | |
| }), | |
| lt: createPositionalPseudo(function(t, length, i) { | |
| for (var s = i < 0 ? i + length : i; --s >= 0;) t.push(s); | |
| return t | |
| }), | |
| gt: createPositionalPseudo(function(t, length, i) { | |
| for (var s = i < 0 ? i + length : i; ++s < length;) t.push(s); | |
| return t | |
| }) | |
| } | |
| }; | |
| for (t in { | |
| radio: !0, | |
| checkbox: !0, | |
| file: !0, | |
| password: !0, | |
| image: !0 | |
| }) o.pseudos[t] = function createInputPseudo(type) { | |
| return function(t) { | |
| return "input" === t.nodeName.toLowerCase() && t.type === type | |
| } | |
| }(t); | |
| for (t in { | |
| submit: !0, | |
| reset: !0 | |
| }) o.pseudos[t] = function createButtonPseudo(type) { | |
| return function(t) { | |
| var name = t.nodeName.toLowerCase(); | |
| return ("input" === name || "button" === name) && t.type === type | |
| } | |
| }(t); | |
| compile = Sizzle.compile = function(selector, group) { | |
| var t, i = [], | |
| s = [], | |
| o = R[selector + " "]; | |
| if (!o) { | |
| for (group || (group = tokenize(selector)), t = group.length; t--;)(o = matcherFromTokens(group[t]))[expando] ? i.push(o) : s.push(o); | |
| o = R(selector, matcherFromGroupMatchers(s, i)) | |
| } | |
| return o | |
| }, o.pseudos.nth = o.pseudos.eq, setFilters.prototype = o.filters = o.pseudos, o.setFilters = new setFilters, i.sortStable = expando.split("").sort(D).join("") === expando, m(), [0, 0].sort(D), i.detectDuplicates = P, I.find = Sizzle, I.expr = Sizzle.selectors, I.expr[":"] = I.expr.pseudos, I.unique = Sizzle.uniqueSort, I.text = Sizzle.getText, I.isXMLDoc = Sizzle.isXML, I.contains = Sizzle.contains | |
| }(window); | |
| var V = {}; | |
| I.Callbacks = function(options) { | |
| var t, memory, i, s, o, l, list = [], | |
| stack = !(options = "string" == typeof options ? V[options] || createOptions(options) : I.extend({}, options)).once && [], | |
| u = function(data) { | |
| for (memory = options.memory && data, i = !0, o = l || 0, l = 0, s = list.length, t = !0; list && o < s; o++) | |
| if (!1 === list[o].apply(data[0], data[1]) && options.stopOnFalse) { | |
| memory = !1; | |
| break | |
| } | |
| t = !1, list && (stack ? stack.length && u(stack.shift()) : memory ? list = [] : self.disable()) | |
| }, | |
| self = { | |
| add: function() { | |
| if (list) { | |
| var start = list.length; | |
| ! function add(t) { | |
| I.each(t, function(t, i) { | |
| var type = I.type(i); | |
| "function" === type ? options.unique && self.has(i) || list.push(i) : i && i.length && "string" !== type && add(i) | |
| }) | |
| }(arguments), t ? s = list.length : memory && (l = start, u(memory)) | |
| } | |
| return this | |
| }, | |
| remove: function() { | |
| return list && I.each(arguments, function(i, l) { | |
| for (var index; | |
| (index = I.inArray(l, list, index)) > -1;) list.splice(index, 1), t && (index <= s && s--, index <= o && o--) | |
| }), this | |
| }, | |
| has: function(t) { | |
| return t ? I.inArray(t, list) > -1 : !(!list || !list.length) | |
| }, | |
| empty: function() { | |
| return list = [], s = 0, this | |
| }, | |
| disable: function() { | |
| return list = stack = memory = undefined, this | |
| }, | |
| disabled: function() { | |
| return !list | |
| }, | |
| lock: function() { | |
| return stack = undefined, memory || self.disable(), this | |
| }, | |
| locked: function() { | |
| return !stack | |
| }, | |
| fireWith: function(context, s) { | |
| return s = s || [], s = [context, s.slice ? s.slice() : s], !list || i && !stack || (t ? stack.push(s) : u(s)), this | |
| }, | |
| fire: function() { | |
| return self.fireWith(this, arguments), this | |
| }, | |
| fired: function() { | |
| return !!i | |
| } | |
| }; | |
| return self | |
| }, I.extend({ | |
| Deferred: function(t) { | |
| var i = [ | |
| ["resolve", "done", I.Callbacks("once memory"), "resolved"], | |
| ["reject", "fail", I.Callbacks("once memory"), "rejected"], | |
| ["notify", "progress", I.Callbacks("memory")] | |
| ], | |
| state = "pending", | |
| s = { | |
| state: function() { | |
| return state | |
| }, | |
| always: function() { | |
| return o.done(arguments).fail(arguments), this | |
| }, | |
| then: function() { | |
| var t = arguments; | |
| return I.Deferred(function(l) { | |
| I.each(i, function(i, u) { | |
| var action = u[0], | |
| h = I.isFunction(t[i]) && t[i]; | |
| o[u[1]](function() { | |
| var t = h && h.apply(this, arguments); | |
| t && I.isFunction(t.promise) ? t.promise().done(l.resolve).fail(l.reject).progress(l.notify) : l[action + "With"](this === s ? l.promise() : this, h ? [t] : arguments) | |
| }) | |
| }), t = null | |
| }).promise() | |
| }, | |
| promise: function(t) { | |
| return null != t ? I.extend(t, s) : s | |
| } | |
| }, | |
| o = {}; | |
| return s.pipe = s.then, I.each(i, function(t, l) { | |
| var list = l[2], | |
| u = l[3]; | |
| s[l[1]] = list.add, u && list.add(function() { | |
| state = u | |
| }, i[1 ^ t][2].disable, i[2][2].lock), o[l[0]] = function() { | |
| return o[l[0] + "With"](this === o ? s : this, arguments), this | |
| }, o[l[0] + "With"] = list.fireWith | |
| }), s.promise(o), t && t.call(o, o), o | |
| }, | |
| when: function(t) { | |
| var i, s, o, l = 0, | |
| u = g.call(arguments), | |
| length = u.length, | |
| h = 1 !== length || t && I.isFunction(t.promise) ? length : 0, | |
| p = 1 === h ? t : I.Deferred(), | |
| m = function(t, s, values) { | |
| return function(value) { | |
| s[t] = this, values[t] = arguments.length > 1 ? g.call(arguments) : value, values === i ? p.notifyWith(s, values) : --h || p.resolveWith(s, values) | |
| } | |
| }; | |
| if (length > 1) | |
| for (i = new Array(length), s = new Array(length), o = new Array(length); l < length; l++) u[l] && I.isFunction(u[l].promise) ? u[l].promise().done(m(l, o, u)).fail(p.reject).progress(m(l, s, i)) : --h; | |
| return h || p.resolveWith(o, u), p.promise() | |
| } | |
| }), I.support = function(t) { | |
| var all, a, input, select, i, o, l, isSupported, u, h = document.createElement("div"); | |
| if (h.setAttribute("className", "t"), h.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", all = h.getElementsByTagName("*") || [], !(a = h.getElementsByTagName("a")[0]) || !a.style || !all.length) return t; | |
| o = (select = document.createElement("select")).appendChild(document.createElement("option")), input = h.getElementsByTagName("input")[0], a.style.cssText = "top:1px;float:left;opacity:.5", t.getSetAttribute = "t" !== h.className, t.leadingWhitespace = 3 === h.firstChild.nodeType, t.tbody = !h.getElementsByTagName("tbody").length, t.htmlSerialize = !!h.getElementsByTagName("link").length, t.style = /top/.test(a.getAttribute("style")), t.hrefNormalized = "/a" === a.getAttribute("href"), t.opacity = /^0.5/.test(a.style.opacity), t.cssFloat = !!a.style.cssFloat, t.checkOn = !!input.value, t.optSelected = o.selected, t.enctype = !!document.createElement("form").enctype, t.html5Clone = "<:nav></:nav>" !== document.createElement("nav").cloneNode(!0).outerHTML, t.inlineBlockNeedsLayout = !1, t.shrinkWrapBlocks = !1, t.pixelPosition = !1, t.deleteExpando = !0, t.noCloneEvent = !0, t.reliableMarginRight = !0, t.boxSizingReliable = !0, input.checked = !0, t.noCloneChecked = input.cloneNode(!0).checked, select.disabled = !0, t.optDisabled = !o.disabled; | |
| try { | |
| delete h.test | |
| } catch (i) { | |
| t.deleteExpando = !1 | |
| }(input = document.createElement("input")).setAttribute("value", ""), t.input = "" === input.getAttribute("value"), input.value = "t", input.setAttribute("type", "radio"), t.radioValue = "t" === input.value, input.setAttribute("checked", "t"), input.setAttribute("name", "t"), (i = document.createDocumentFragment()).appendChild(input), t.appendChecked = input.checked, t.checkClone = i.cloneNode(!0).cloneNode(!0).lastChild.checked, h.attachEvent && (h.attachEvent("onclick", function() { | |
| t.noCloneEvent = !1 | |
| }), h.cloneNode(!0).click()); | |
| for (u in { | |
| submit: !0, | |
| change: !0, | |
| focusin: !0 | |
| }) h.setAttribute(l = "on" + u, "t"), t[u + "Bubbles"] = l in window || !1 === h.attributes[l].expando; | |
| h.style.backgroundClip = "content-box", h.cloneNode(!0).style.backgroundClip = "", t.clearCloneStyle = "content-box" === h.style.backgroundClip; | |
| for (u in I(t)) break; | |
| return t.ownLast = "0" !== u, I(function() { | |
| var i, o, l, u = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", | |
| body = document.getElementsByTagName("body")[0]; | |
| body && ((i = document.createElement("div")).style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", body.appendChild(i).appendChild(h), h.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", (l = h.getElementsByTagName("td"))[0].style.cssText = "padding:0;margin:0;border:0;display:none", isSupported = 0 === l[0].offsetHeight, l[0].style.display = "", l[1].style.display = "none", t.reliableHiddenOffsets = isSupported && 0 === l[0].offsetHeight, h.innerHTML = "", h.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%;", I.swap(body, null != body.style.zoom ? { | |
| zoom: 1 | |
| } : {}, function() { | |
| t.boxSizing = 4 === h.offsetWidth | |
| }), window.getComputedStyle && (t.pixelPosition = "1%" !== (window.getComputedStyle(h, null) || {}).top, t.boxSizingReliable = "4px" === (window.getComputedStyle(h, null) || { | |
| width: "4px" | |
| }).width, (o = h.appendChild(document.createElement("div"))).style.cssText = h.style.cssText = u, o.style.marginRight = o.style.width = "0", h.style.width = "1px", t.reliableMarginRight = !parseFloat((window.getComputedStyle(o, null) || {}).marginRight)), typeof h.style.zoom !== s && (h.innerHTML = "", h.style.cssText = u + "width:1px;padding:1px;display:inline;zoom:1", t.inlineBlockNeedsLayout = 3 === h.offsetWidth, h.style.display = "block", h.innerHTML = "<div></div>", h.firstChild.style.width = "5px", t.shrinkWrapBlocks = 3 !== h.offsetWidth, t.inlineBlockNeedsLayout && (body.style.zoom = 1)), body.removeChild(i), i = h = l = o = null) | |
| }), all = select = i = o = a = input = null, t | |
| }({}); | |
| var $ = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, | |
| G = /([A-Z])/g; | |
| I.extend({ | |
| cache: {}, | |
| noData: { | |
| applet: !0, | |
| embed: !0, | |
| object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" | |
| }, | |
| hasData: function(t) { | |
| return !!(t = t.nodeType ? I.cache[t[I.expando]] : t[I.expando]) && !isEmptyDataObject(t) | |
| }, | |
| data: function(t, name, data) { | |
| return internalData(t, name, data) | |
| }, | |
| removeData: function(t, name) { | |
| return internalRemoveData(t, name) | |
| }, | |
| _data: function(t, name, data) { | |
| return internalData(t, name, data, !0) | |
| }, | |
| _removeData: function(t, name) { | |
| return internalRemoveData(t, name, !0) | |
| }, | |
| acceptData: function(t) { | |
| if (t.nodeType && 1 !== t.nodeType && 9 !== t.nodeType) return !1; | |
| var i = t.nodeName && I.noData[t.nodeName.toLowerCase()]; | |
| return !i || !0 !== i && t.getAttribute("classid") === i | |
| } | |
| }), I.fn.extend({ | |
| data: function(key, value) { | |
| var t, name, data = null, | |
| i = 0, | |
| s = this[0]; | |
| if (key === undefined) { | |
| if (this.length && (data = I.data(s), 1 === s.nodeType && !I._data(s, "parsedAttrs"))) { | |
| for (t = s.attributes; i < t.length; i++) 0 === (name = t[i].name).indexOf("data-") && dataAttr(s, name = I.camelCase(name.slice(5)), data[name]); | |
| I._data(s, "parsedAttrs", !0) | |
| } | |
| return data | |
| } | |
| return "object" == typeof key ? this.each(function() { | |
| I.data(this, key) | |
| }) : arguments.length > 1 ? this.each(function() { | |
| I.data(this, key, value) | |
| }) : s ? dataAttr(s, key, I.data(s, key)) : null | |
| }, | |
| removeData: function(key) { | |
| return this.each(function() { | |
| I.removeData(this, key) | |
| }) | |
| } | |
| }), I.extend({ | |
| queue: function(t, type, data) { | |
| var i; | |
| if (t) return type = (type || "fx") + "queue", i = I._data(t, type), data && (!i || I.isArray(data) ? i = I._data(t, type, I.makeArray(data)) : i.push(data)), i || [] | |
| }, | |
| dequeue: function(t, type) { | |
| type = type || "fx"; | |
| var i = I.queue(t, type), | |
| s = i.length, | |
| o = i.shift(), | |
| l = I._queueHooks(t, type); | |
| "inprogress" === o && (o = i.shift(), s--), o && ("fx" === type && i.unshift("inprogress"), delete l.stop, o.call(t, function() { | |
| I.dequeue(t, type) | |
| }, l)), !s && l && l.empty.fire() | |
| }, | |
| _queueHooks: function(t, type) { | |
| var key = type + "queueHooks"; | |
| return I._data(t, key) || I._data(t, key, { | |
| empty: I.Callbacks("once memory").add(function() { | |
| I._removeData(t, type + "queue"), I._removeData(t, key) | |
| }) | |
| }) | |
| } | |
| }), I.fn.extend({ | |
| queue: function(type, data) { | |
| var t = 2; | |
| return "string" != typeof type && (data = type, type = "fx", t--), arguments.length < t ? I.queue(this[0], type) : data === undefined ? this : this.each(function() { | |
| var t = I.queue(this, type, data); | |
| I._queueHooks(this, type), "fx" === type && "inprogress" !== t[0] && I.dequeue(this, type) | |
| }) | |
| }, | |
| dequeue: function(type) { | |
| return this.each(function() { | |
| I.dequeue(this, type) | |
| }) | |
| }, | |
| delay: function(time, type) { | |
| return time = I.fx ? I.fx.speeds[time] || time : time, type = type || "fx", this.queue(type, function(next, t) { | |
| var timeout = setTimeout(next, time); | |
| t.stop = function() { | |
| clearTimeout(timeout) | |
| } | |
| }) | |
| }, | |
| clearQueue: function(type) { | |
| return this.queue(type || "fx", []) | |
| }, | |
| promise: function(type, t) { | |
| var i, count = 1, | |
| defer = I.Deferred(), | |
| elements = this, | |
| s = this.length, | |
| resolve = function() { | |
| --count || defer.resolveWith(elements, [elements]) | |
| }; | |
| for ("string" != typeof type && (t = type, type = undefined), type = type || "fx"; s--;)(i = I._data(elements[s], type + "queueHooks")) && i.empty && (count++, i.empty.add(resolve)); | |
| return resolve(), defer.promise(t) | |
| } | |
| }); | |
| var H, j, Y = /[\t\r\n\f]/g, | |
| K = /\r/g, | |
| W = /^(?:input|select|textarea|button|object)$/i, | |
| J = /^(?:a|area)$/i, | |
| X = /^(?:checked|selected)$/i, | |
| Z = I.support.getSetAttribute, | |
| ee = I.support.input; | |
| I.fn.extend({ | |
| attr: function(name, value) { | |
| return I.access(this, I.attr, name, value, arguments.length > 1) | |
| }, | |
| removeAttr: function(name) { | |
| return this.each(function() { | |
| I.removeAttr(this, name) | |
| }) | |
| }, | |
| prop: function(name, value) { | |
| return I.access(this, I.prop, name, value, arguments.length > 1) | |
| }, | |
| removeProp: function(name) { | |
| return name = I.propFix[name] || name, this.each(function() { | |
| try { | |
| this[name] = undefined, delete this[name] | |
| } catch (t) {} | |
| }) | |
| }, | |
| addClass: function(value) { | |
| var t, i, s, o, l, u = 0, | |
| h = this.length, | |
| p = "string" == typeof value && value; | |
| if (I.isFunction(value)) return this.each(function(t) { | |
| I(this).addClass(value.call(this, t, this.className)) | |
| }); | |
| if (p) | |
| for (t = (value || "").match(A) || []; u < h; u++) | |
| if (i = this[u], s = 1 === i.nodeType && (i.className ? (" " + i.className + " ").replace(Y, " ") : " ")) { | |
| for (l = 0; o = t[l++];) s.indexOf(" " + o + " ") < 0 && (s += o + " "); | |
| i.className = I.trim(s) | |
| } | |
| return this | |
| }, | |
| removeClass: function(value) { | |
| var t, i, s, o, l, u = 0, | |
| h = this.length, | |
| p = 0 === arguments.length || "string" == typeof value && value; | |
| if (I.isFunction(value)) return this.each(function(t) { | |
| I(this).removeClass(value.call(this, t, this.className)) | |
| }); | |
| if (p) | |
| for (t = (value || "").match(A) || []; u < h; u++) | |
| if (i = this[u], s = 1 === i.nodeType && (i.className ? (" " + i.className + " ").replace(Y, " ") : "")) { | |
| for (l = 0; o = t[l++];) | |
| for (; s.indexOf(" " + o + " ") >= 0;) s = s.replace(" " + o + " ", " "); | |
| i.className = value ? I.trim(s) : "" | |
| } | |
| return this | |
| }, | |
| toggleClass: function(value, t) { | |
| var type = typeof value, | |
| i = "boolean" == typeof t; | |
| return I.isFunction(value) ? this.each(function(i) { | |
| I(this).toggleClass(value.call(this, i, this.className, t), t) | |
| }) : this.each(function() { | |
| if ("string" === type) | |
| for (var className, o = 0, self = I(this), state = t, l = value.match(A) || []; className = l[o++];) self[(state = i ? state : !self.hasClass(className)) ? "addClass" : "removeClass"](className); | |
| else type !== s && "boolean" !== type || (this.className && I._data(this, "__className__", this.className), this.className = this.className || !1 === value ? "" : I._data(this, "__className__") || "") | |
| }) | |
| }, | |
| hasClass: function(selector) { | |
| for (var className = " " + selector + " ", t = 0, i = this.length; t < i; t++) | |
| if (1 === this[t].nodeType && (" " + this[t].className + " ").replace(Y, " ").indexOf(className) >= 0) return !0; | |
| return !1 | |
| }, | |
| val: function(value) { | |
| var t, i, s, o = this[0]; { | |
| if (arguments.length) return s = I.isFunction(value), this.each(function(t) { | |
| var o; | |
| 1 === this.nodeType && (null == (o = s ? value.call(this, t, I(this).val()) : value) ? o = "" : "number" == typeof o ? o += "" : I.isArray(o) && (o = I.map(o, function(value) { | |
| return null == value ? "" : value + "" | |
| })), (i = I.valHooks[this.type] || I.valHooks[this.nodeName.toLowerCase()]) && "set" in i && i.set(this, o, "value") !== undefined || (this.value = o)) | |
| }); | |
| if (o) return (i = I.valHooks[o.type] || I.valHooks[o.nodeName.toLowerCase()]) && "get" in i && (t = i.get(o, "value")) !== undefined ? t : "string" == typeof(t = o.value) ? t.replace(K, "") : null == t ? "" : t | |
| } | |
| } | |
| }), I.extend({ | |
| valHooks: { | |
| option: { | |
| get: function(t) { | |
| var i = I.find.attr(t, "value"); | |
| return null != i ? i : t.text | |
| } | |
| }, | |
| select: { | |
| get: function(t) { | |
| for (var value, i, options = t.options, index = t.selectedIndex, s = "select-one" === t.type || index < 0, values = s ? null : [], max = s ? index + 1 : options.length, o = index < 0 ? max : s ? index : 0; o < max; o++) | |
| if (((i = options[o]).selected || o === index) && (I.support.optDisabled ? !i.disabled : null === i.getAttribute("disabled")) && (!i.parentNode.disabled || !I.nodeName(i.parentNode, "optgroup"))) { | |
| if (value = I(i).val(), s) return value; | |
| values.push(value) | |
| } | |
| return values | |
| }, | |
| set: function(t, value) { | |
| for (var i, s, options = t.options, values = I.makeArray(value), o = options.length; o--;)((s = options[o]).selected = I.inArray(I(s).val(), values) >= 0) && (i = !0); | |
| return i || (t.selectedIndex = -1), values | |
| } | |
| } | |
| }, | |
| attr: function(t, name, value) { | |
| var i, o, l = t.nodeType; | |
| if (t && 3 !== l && 8 !== l && 2 !== l) return typeof t.getAttribute === s ? I.prop(t, name, value) : (1 === l && I.isXMLDoc(t) || (name = name.toLowerCase(), i = I.attrHooks[name] || (I.expr.match.bool.test(name) ? j : H)), value === undefined ? i && "get" in i && null !== (o = i.get(t, name)) ? o : null == (o = I.find.attr(t, name)) ? undefined : o : null !== value ? i && "set" in i && (o = i.set(t, value, name)) !== undefined ? o : (t.setAttribute(name, value + ""), value) : void I.removeAttr(t, name)) | |
| }, | |
| removeAttr: function(t, value) { | |
| var name, i, s = 0, | |
| o = value && value.match(A); | |
| if (o && 1 === t.nodeType) | |
| for (; name = o[s++];) i = I.propFix[name] || name, I.expr.match.bool.test(name) ? ee && Z || !X.test(name) ? t[i] = !1 : t[I.camelCase("default-" + name)] = t[i] = !1 : I.attr(t, name, ""), t.removeAttribute(Z ? name : i) | |
| }, | |
| attrHooks: { | |
| type: { | |
| set: function(t, value) { | |
| if (!I.support.radioValue && "radio" === value && I.nodeName(t, "input")) { | |
| var i = t.value; | |
| return t.setAttribute("type", value), i && (t.value = i), value | |
| } | |
| } | |
| } | |
| }, | |
| propFix: { | |
| for: "htmlFor", | |
| class: "className" | |
| }, | |
| prop: function(t, name, value) { | |
| var i, s, o = t.nodeType; | |
| if (t && 3 !== o && 8 !== o && 2 !== o) return (1 !== o || !I.isXMLDoc(t)) && (name = I.propFix[name] || name, s = I.propHooks[name]), value !== undefined ? s && "set" in s && (i = s.set(t, value, name)) !== undefined ? i : t[name] = value : s && "get" in s && null !== (i = s.get(t, name)) ? i : t[name] | |
| }, | |
| propHooks: { | |
| tabIndex: { | |
| get: function(t) { | |
| var i = I.find.attr(t, "tabindex"); | |
| return i ? parseInt(i, 10) : W.test(t.nodeName) || J.test(t.nodeName) && t.href ? 0 : -1 | |
| } | |
| } | |
| } | |
| }), j = { | |
| set: function(t, value, name) { | |
| return !1 === value ? I.removeAttr(t, name) : ee && Z || !X.test(name) ? t.setAttribute(!Z && I.propFix[name] || name, name) : t[I.camelCase("default-" + name)] = t[name] = !0, name | |
| } | |
| }, I.each(I.expr.match.bool.source.match(/\w+/g), function(t, name) { | |
| var i = I.expr.attrHandle[name] || I.find.attr; | |
| I.expr.attrHandle[name] = ee && Z || !X.test(name) ? function(t, name, s) { | |
| var o = I.expr.attrHandle[name], | |
| l = s ? undefined : (I.expr.attrHandle[name] = undefined) != i(t, name, s) ? name.toLowerCase() : null; | |
| return I.expr.attrHandle[name] = o, l | |
| } : function(t, name, i) { | |
| return i ? undefined : t[I.camelCase("default-" + name)] ? name.toLowerCase() : null | |
| } | |
| }), ee && Z || (I.attrHooks.value = { | |
| set: function(t, value, name) { | |
| if (!I.nodeName(t, "input")) return H && H.set(t, value, name); | |
| t.defaultValue = value | |
| } | |
| }), Z || (H = { | |
| set: function(t, value, name) { | |
| var i = t.getAttributeNode(name); | |
| return i || t.setAttributeNode(i = t.ownerDocument.createAttribute(name)), i.value = value += "", "value" === name || value === t.getAttribute(name) ? value : undefined | |
| } | |
| }, I.expr.attrHandle.id = I.expr.attrHandle.name = I.expr.attrHandle.coords = function(t, name, i) { | |
| var s; | |
| return i ? undefined : (s = t.getAttributeNode(name)) && "" !== s.value ? s.value : null | |
| }, I.valHooks.button = { | |
| get: function(t, name) { | |
| var i = t.getAttributeNode(name); | |
| return i && i.specified ? i.value : undefined | |
| }, | |
| set: H.set | |
| }, I.attrHooks.contenteditable = { | |
| set: function(t, value, name) { | |
| H.set(t, "" !== value && value, name) | |
| } | |
| }, I.each(["width", "height"], function(t, name) { | |
| I.attrHooks[name] = { | |
| set: function(t, value) { | |
| if ("" === value) return t.setAttribute(name, "auto"), value | |
| } | |
| } | |
| })), I.support.hrefNormalized || I.each(["href", "src"], function(t, name) { | |
| I.propHooks[name] = { | |
| get: function(t) { | |
| return t.getAttribute(name, 4) | |
| } | |
| } | |
| }), I.support.style || (I.attrHooks.style = { | |
| get: function(t) { | |
| return t.style.cssText || undefined | |
| }, | |
| set: function(t, value) { | |
| return t.style.cssText = value + "" | |
| } | |
| }), I.support.optSelected || (I.propHooks.selected = { | |
| get: function(t) { | |
| var parent = t.parentNode; | |
| if (parent) { | |
| parent.selectedIndex; | |
| parent.parentNode && parent.parentNode.selectedIndex | |
| } | |
| return null | |
| } | |
| }), I.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() { | |
| I.propFix[this.toLowerCase()] = this | |
| }), I.support.enctype || (I.propFix.enctype = "encoding"), I.each(["radio", "checkbox"], function() { | |
| I.valHooks[this] = { | |
| set: function(t, value) { | |
| if (I.isArray(value)) return t.checked = I.inArray(I(t).val(), value) >= 0 | |
| } | |
| }, I.support.checkOn || (I.valHooks[this].get = function(t) { | |
| return null === t.getAttribute("value") ? "on" : t.value | |
| }) | |
| }); | |
| var te = /^(?:input|select|textarea)$/i, | |
| ie = /^key/, | |
| se = /^(?:mouse|contextmenu)|click/, | |
| ne = /^(?:focusinfocus|focusoutblur)$/, | |
| oe = /^([^.]*)(?:\.(.+)|)$/; | |
| I.event = { | |
| global: {}, | |
| add: function(t, types, i, data, selector) { | |
| var o, l, u, h, p, m, _, g, type, namespaces, S, T = I._data(t); | |
| if (T) { | |
| for (i.handler && (i = (h = i).handler, selector = h.selector), i.guid || (i.guid = I.guid++), (l = T.events) || (l = T.events = {}), (m = T.handle) || ((m = T.handle = function(e) { | |
| return typeof I === s || e && I.event.triggered === e.type ? undefined : I.event.dispatch.apply(m.elem, arguments) | |
| }).elem = t), u = (types = (types || "").match(A) || [""]).length; u--;) type = S = (o = oe.exec(types[u]) || [])[1], namespaces = (o[2] || "").split(".").sort(), type && (p = I.event.special[type] || {}, type = (selector ? p.delegateType : p.bindType) || type, p = I.event.special[type] || {}, _ = I.extend({ | |
| type: type, | |
| origType: S, | |
| data: data, | |
| handler: i, | |
| guid: i.guid, | |
| selector: selector, | |
| needsContext: selector && I.expr.match.needsContext.test(selector), | |
| namespace: namespaces.join(".") | |
| }, h), (g = l[type]) || ((g = l[type] = []).delegateCount = 0, p.setup && !1 !== p.setup.call(t, data, namespaces, m) || (t.addEventListener ? t.addEventListener(type, m, !1) : t.attachEvent && t.attachEvent("on" + type, m))), p.add && (p.add.call(t, _), _.handler.guid || (_.handler.guid = i.guid)), selector ? g.splice(g.delegateCount++, 0, _) : g.push(_), I.event.global[type] = !0); | |
| t = null | |
| } | |
| }, | |
| remove: function(t, types, i, selector, s) { | |
| var o, l, u, h, p, m, _, g, type, namespaces, S, T = I.hasData(t) && I._data(t); | |
| if (T && (m = T.events)) { | |
| for (p = (types = (types || "").match(A) || [""]).length; p--;) | |
| if (u = oe.exec(types[p]) || [], type = S = u[1], namespaces = (u[2] || "").split(".").sort(), type) { | |
| for (_ = I.event.special[type] || {}, g = m[type = (selector ? _.delegateType : _.bindType) || type] || [], u = u[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"), h = o = g.length; o--;) l = g[o], !s && S !== l.origType || i && i.guid !== l.guid || u && !u.test(l.namespace) || selector && selector !== l.selector && ("**" !== selector || !l.selector) || (g.splice(o, 1), l.selector && g.delegateCount--, _.remove && _.remove.call(t, l)); | |
| h && !g.length && (_.teardown && !1 !== _.teardown.call(t, namespaces, T.handle) || I.removeEvent(t, type, T.handle), delete m[type]) | |
| } else | |
| for (type in m) I.event.remove(t, type + types[p], i, selector, !0); | |
| I.isEmptyObject(m) && (delete T.handle, I._removeData(t, "events")) | |
| } | |
| }, | |
| trigger: function(event, data, t, i) { | |
| var s, o, l, u, h, p, m, _ = [t || document], | |
| type = v.call(event, "type") ? event.type : event, | |
| namespaces = v.call(event, "namespace") ? event.namespace.split(".") : []; | |
| if (l = p = t = t || document, 3 !== t.nodeType && 8 !== t.nodeType && !ne.test(type + I.event.triggered) && (type.indexOf(".") >= 0 && (type = (namespaces = type.split(".")).shift(), namespaces.sort()), o = type.indexOf(":") < 0 && "on" + type, event = event[I.expando] ? event : new I.Event(type, "object" == typeof event && event), event.isTrigger = i ? 2 : 3, event.namespace = namespaces.join("."), event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, event.result = undefined, event.target || (event.target = t), data = null == data ? [event] : I.makeArray(data, [event]), h = I.event.special[type] || {}, i || !h.trigger || !1 !== h.trigger.apply(t, data))) { | |
| if (!i && !h.noBubble && !I.isWindow(t)) { | |
| for (u = h.delegateType || type, ne.test(u + type) || (l = l.parentNode); l; l = l.parentNode) _.push(l), p = l; | |
| p === (t.ownerDocument || document) && _.push(p.defaultView || p.parentWindow || window) | |
| } | |
| for (m = 0; | |
| (l = _[m++]) && !event.isPropagationStopped();) event.type = m > 1 ? u : h.bindType || type, (s = (I._data(l, "events") || {})[event.type] && I._data(l, "handle")) && s.apply(l, data), (s = o && l[o]) && I.acceptData(l) && s.apply && !1 === s.apply(l, data) && event.preventDefault(); | |
| if (event.type = type, !i && !event.isDefaultPrevented() && (!h._default || !1 === h._default.apply(_.pop(), data)) && I.acceptData(t) && o && t[type] && !I.isWindow(t)) { | |
| (p = t[o]) && (t[o] = null), I.event.triggered = type; | |
| try { | |
| t[type]() | |
| } catch (t) {} | |
| I.event.triggered = undefined, p && (t[o] = p) | |
| } | |
| return event.result | |
| } | |
| }, | |
| dispatch: function(event) { | |
| event = I.event.fix(event); | |
| var t, i, s, o, l, u = [], | |
| h = g.call(arguments), | |
| p = (I._data(this, "events") || {})[event.type] || [], | |
| m = I.event.special[event.type] || {}; | |
| if (h[0] = event, event.delegateTarget = this, !m.preDispatch || !1 !== m.preDispatch.call(this, event)) { | |
| for (u = I.event.handlers.call(this, event, p), t = 0; | |
| (o = u[t++]) && !event.isPropagationStopped();) | |
| for (event.currentTarget = o.elem, l = 0; | |
| (s = o.handlers[l++]) && !event.isImmediatePropagationStopped();) event.namespace_re && !event.namespace_re.test(s.namespace) || (event.handleObj = s, event.data = s.data, (i = ((I.event.special[s.origType] || {}).handle || s.handler).apply(o.elem, h)) !== undefined && !1 === (event.result = i) && (event.preventDefault(), event.stopPropagation())); | |
| return m.postDispatch && m.postDispatch.call(this, event), event.result | |
| } | |
| }, | |
| handlers: function(event, t) { | |
| var i, s, matches, o, l = [], | |
| u = t.delegateCount, | |
| h = event.target; | |
| if (u && h.nodeType && (!event.button || "click" !== event.type)) | |
| for (; h != this; h = h.parentNode || this) | |
| if (1 === h.nodeType && (!0 !== h.disabled || "click" !== event.type)) { | |
| for (matches = [], o = 0; o < u; o++) matches[i = (s = t[o]).selector + " "] === undefined && (matches[i] = s.needsContext ? I(i, this).index(h) >= 0 : I.find(i, this, null, [h]).length), matches[i] && matches.push(s); | |
| matches.length && l.push({ | |
| elem: h, | |
| handlers: matches | |
| }) | |
| } | |
| return u < t.length && l.push({ | |
| elem: this, | |
| handlers: t.slice(u) | |
| }), l | |
| }, | |
| fix: function(event) { | |
| if (event[I.expando]) return event; | |
| var t, i, s, type = event.type, | |
| o = event, | |
| l = this.fixHooks[type]; | |
| for (l || (this.fixHooks[type] = l = se.test(type) ? this.mouseHooks : ie.test(type) ? this.keyHooks : {}), s = l.props ? this.props.concat(l.props) : this.props, event = new I.Event(o), t = s.length; t--;) event[i = s[t]] = o[i]; | |
| return event.target || (event.target = o.srcElement || document), 3 === event.target.nodeType && (event.target = event.target.parentNode), event.metaKey = !!event.metaKey, l.filter ? l.filter(event, o) : event | |
| }, | |
| props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), | |
| fixHooks: {}, | |
| keyHooks: { | |
| props: "char charCode key keyCode".split(" "), | |
| filter: function(event, t) { | |
| return null == event.which && (event.which = null != t.charCode ? t.charCode : t.keyCode), event | |
| } | |
| }, | |
| mouseHooks: { | |
| props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), | |
| filter: function(event, t) { | |
| var body, i, s, button = t.button, | |
| fromElement = t.fromElement; | |
| return null == event.pageX && null != t.clientX && (s = (i = event.target.ownerDocument || document).documentElement, body = i.body, event.pageX = t.clientX + (s && s.scrollLeft || body && body.scrollLeft || 0) - (s && s.clientLeft || body && body.clientLeft || 0), event.pageY = t.clientY + (s && s.scrollTop || body && body.scrollTop || 0) - (s && s.clientTop || body && body.clientTop || 0)), !event.relatedTarget && fromElement && (event.relatedTarget = fromElement === event.target ? t.toElement : fromElement), event.which || button === undefined || (event.which = 1 & button ? 1 : 2 & button ? 3 : 4 & button ? 2 : 0), event | |
| } | |
| }, | |
| special: { | |
| load: { | |
| noBubble: !0 | |
| }, | |
| focus: { | |
| trigger: function() { | |
| if (this !== safeActiveElement() && this.focus) try { | |
| return this.focus(), !1 | |
| } catch (t) {} | |
| }, | |
| delegateType: "focusin" | |
| }, | |
| blur: { | |
| trigger: function() { | |
| if (this === safeActiveElement() && this.blur) return this.blur(), !1 | |
| }, | |
| delegateType: "focusout" | |
| }, | |
| click: { | |
| trigger: function() { | |
| if (I.nodeName(this, "input") && "checkbox" === this.type && this.click) return this.click(), !1 | |
| }, | |
| _default: function(event) { | |
| return I.nodeName(event.target, "a") | |
| } | |
| }, | |
| beforeunload: { | |
| postDispatch: function(event) { | |
| event.result !== undefined && (event.originalEvent.returnValue = event.result) | |
| } | |
| } | |
| }, | |
| simulate: function(type, t, event, i) { | |
| var e = I.extend(new I.Event, event, { | |
| type: type, | |
| isSimulated: !0, | |
| originalEvent: {} | |
| }); | |
| i ? I.event.trigger(e, null, t) : I.event.dispatch.call(t, e), e.isDefaultPrevented() && event.preventDefault() | |
| } | |
| }, I.removeEvent = document.removeEventListener ? function(t, type, i) { | |
| t.removeEventListener && t.removeEventListener(type, i, !1) | |
| } : function(t, type, i) { | |
| var name = "on" + type; | |
| t.detachEvent && (typeof t[name] === s && (t[name] = null), t.detachEvent(name, i)) | |
| }, I.Event = function(src, t) { | |
| if (!(this instanceof I.Event)) return new I.Event(src, t); | |
| src && src.type ? (this.originalEvent = src, this.type = src.type, this.isDefaultPrevented = src.defaultPrevented || !1 === src.returnValue || src.getPreventDefault && src.getPreventDefault() ? returnTrue : returnFalse) : this.type = src, t && I.extend(this, t), this.timeStamp = src && src.timeStamp || I.now(), this[I.expando] = !0 | |
| }, I.Event.prototype = { | |
| isDefaultPrevented: returnFalse, | |
| isPropagationStopped: returnFalse, | |
| isImmediatePropagationStopped: returnFalse, | |
| preventDefault: function() { | |
| var e = this.originalEvent; | |
| this.isDefaultPrevented = returnTrue, e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) | |
| }, | |
| stopPropagation: function() { | |
| var e = this.originalEvent; | |
| this.isPropagationStopped = returnTrue, e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0) | |
| }, | |
| stopImmediatePropagation: function() { | |
| this.isImmediatePropagationStopped = returnTrue, this.stopPropagation() | |
| } | |
| }, I.each({ | |
| mouseenter: "mouseover", | |
| mouseleave: "mouseout" | |
| }, function(t, i) { | |
| I.event.special[t] = { | |
| delegateType: i, | |
| bindType: i, | |
| handle: function(event) { | |
| var t, target = this, | |
| s = event.relatedTarget, | |
| o = event.handleObj; | |
| return s && (s === target || I.contains(target, s)) || (event.type = o.origType, t = o.handler.apply(this, arguments), event.type = i), t | |
| } | |
| } | |
| }), I.support.submitBubbles || (I.event.special.submit = { | |
| setup: function() { | |
| if (I.nodeName(this, "form")) return !1; | |
| I.event.add(this, "click._submit keypress._submit", function(e) { | |
| var t = e.target, | |
| form = I.nodeName(t, "input") || I.nodeName(t, "button") ? t.form : undefined; | |
| form && !I._data(form, "submitBubbles") && (I.event.add(form, "submit._submit", function(event) { | |
| event._submit_bubble = !0 | |
| }), I._data(form, "submitBubbles", !0)) | |
| }) | |
| }, | |
| postDispatch: function(event) { | |
| event._submit_bubble && (delete event._submit_bubble, this.parentNode && !event.isTrigger && I.event.simulate("submit", this.parentNode, event, !0)) | |
| }, | |
| teardown: function() { | |
| if (I.nodeName(this, "form")) return !1; | |
| I.event.remove(this, "._submit") | |
| } | |
| }), I.support.changeBubbles || (I.event.special.change = { | |
| setup: function() { | |
| if (te.test(this.nodeName)) return "checkbox" !== this.type && "radio" !== this.type || (I.event.add(this, "propertychange._change", function(event) { | |
| "checked" === event.originalEvent.propertyName && (this._just_changed = !0) | |
| }), I.event.add(this, "click._change", function(event) { | |
| this._just_changed && !event.isTrigger && (this._just_changed = !1), I.event.simulate("change", this, event, !0) | |
| })), !1; | |
| I.event.add(this, "beforeactivate._change", function(e) { | |
| var t = e.target; | |
| te.test(t.nodeName) && !I._data(t, "changeBubbles") && (I.event.add(t, "change._change", function(event) { | |
| !this.parentNode || event.isSimulated || event.isTrigger || I.event.simulate("change", this.parentNode, event, !0) | |
| }), I._data(t, "changeBubbles", !0)) | |
| }) | |
| }, | |
| handle: function(event) { | |
| var t = event.target; | |
| if (this !== t || event.isSimulated || event.isTrigger || "radio" !== t.type && "checkbox" !== t.type) return event.handleObj.handler.apply(this, arguments) | |
| }, | |
| teardown: function() { | |
| return I.event.remove(this, "._change"), !te.test(this.nodeName) | |
| } | |
| }), I.support.focusinBubbles || I.each({ | |
| focus: "focusin", | |
| blur: "focusout" | |
| }, function(t, i) { | |
| var s = 0, | |
| o = function(event) { | |
| I.event.simulate(i, event.target, I.event.fix(event), !0) | |
| }; | |
| I.event.special[i] = { | |
| setup: function() { | |
| 0 == s++ && document.addEventListener(t, o, !0) | |
| }, | |
| teardown: function() { | |
| 0 == --s && document.removeEventListener(t, o, !0) | |
| } | |
| } | |
| }), I.fn.extend({ | |
| on: function(types, selector, data, t, i) { | |
| var type, s; | |
| if ("object" == typeof types) { | |
| "string" != typeof selector && (data = data || selector, selector = undefined); | |
| for (type in types) this.on(type, selector, data, types[type], i); | |
| return this | |
| } | |
| if (null == data && null == t ? (t = selector, data = selector = undefined) : null == t && ("string" == typeof selector ? (t = data, data = undefined) : (t = data, data = selector, selector = undefined)), !1 === t) t = returnFalse; | |
| else if (!t) return this; | |
| return 1 === i && (s = t, (t = function(event) { | |
| return I().off(event), s.apply(this, arguments) | |
| }).guid = s.guid || (s.guid = I.guid++)), this.each(function() { | |
| I.event.add(this, types, t, data, selector) | |
| }) | |
| }, | |
| one: function(types, selector, data, t) { | |
| return this.on(types, selector, data, t, 1) | |
| }, | |
| off: function(types, selector, t) { | |
| var i, type; | |
| if (types && types.preventDefault && types.handleObj) return i = types.handleObj, I(types.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this; | |
| if ("object" == typeof types) { | |
| for (type in types) this.off(type, selector, types[type]); | |
| return this | |
| } | |
| return !1 !== selector && "function" != typeof selector || (t = selector, selector = undefined), !1 === t && (t = returnFalse), this.each(function() { | |
| I.event.remove(this, types, t, selector) | |
| }) | |
| }, | |
| trigger: function(type, data) { | |
| return this.each(function() { | |
| I.event.trigger(type, data, this) | |
| }) | |
| }, | |
| triggerHandler: function(type, data) { | |
| var t = this[0]; | |
| if (t) return I.event.trigger(type, data, t, !0) | |
| } | |
| }); | |
| var ae = /^.[^:#\[\.,]*$/, | |
| re = /^(?:parents|prev(?:Until|All))/, | |
| le = I.expr.match.needsContext, | |
| ce = { | |
| children: !0, | |
| contents: !0, | |
| next: !0, | |
| prev: !0 | |
| }; | |
| I.fn.extend({ | |
| find: function(selector) { | |
| var t, i = [], | |
| self = this, | |
| s = self.length; | |
| if ("string" != typeof selector) return this.pushStack(I(selector).filter(function() { | |
| for (t = 0; t < s; t++) | |
| if (I.contains(self[t], this)) return !0 | |
| })); | |
| for (t = 0; t < s; t++) I.find(selector, self[t], i); | |
| return i = this.pushStack(s > 1 ? I.unique(i) : i), i.selector = this.selector ? this.selector + " " + selector : selector, i | |
| }, | |
| has: function(target) { | |
| var t, i = I(target, this), | |
| s = i.length; | |
| return this.filter(function() { | |
| for (t = 0; t < s; t++) | |
| if (I.contains(this, i[t])) return !0 | |
| }) | |
| }, | |
| not: function(selector) { | |
| return this.pushStack(winnow(this, selector || [], !0)) | |
| }, | |
| filter: function(selector) { | |
| return this.pushStack(winnow(this, selector || [], !1)) | |
| }, | |
| is: function(selector) { | |
| return !!winnow(this, "string" == typeof selector && le.test(selector) ? I(selector) : selector || [], !1).length | |
| }, | |
| closest: function(t, context) { | |
| for (var i, s = 0, o = this.length, l = [], u = le.test(t) || "string" != typeof t ? I(t, context || this.context) : 0; s < o; s++) | |
| for (i = this[s]; i && i !== context; i = i.parentNode) | |
| if (i.nodeType < 11 && (u ? u.index(i) > -1 : 1 === i.nodeType && I.find.matchesSelector(i, t))) { | |
| i = l.push(i); | |
| break | |
| } | |
| return this.pushStack(l.length > 1 ? I.unique(l) : l) | |
| }, | |
| index: function(t) { | |
| return t ? "string" == typeof t ? I.inArray(this[0], I(t)) : I.inArray(t.jquery ? t[0] : t, this) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 | |
| }, | |
| add: function(selector, context) { | |
| var set = "string" == typeof selector ? I(selector, context) : I.makeArray(selector && selector.nodeType ? [selector] : selector), | |
| all = I.merge(this.get(), set); | |
| return this.pushStack(I.unique(all)) | |
| }, | |
| addBack: function(selector) { | |
| return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector)) | |
| } | |
| }), I.each({ | |
| parent: function(t) { | |
| var parent = t.parentNode; | |
| return parent && 11 !== parent.nodeType ? parent : null | |
| }, | |
| parents: function(t) { | |
| return I.dir(t, "parentNode") | |
| }, | |
| parentsUntil: function(t, i, s) { | |
| return I.dir(t, "parentNode", s) | |
| }, | |
| next: function(t) { | |
| return sibling(t, "nextSibling") | |
| }, | |
| prev: function(t) { | |
| return sibling(t, "previousSibling") | |
| }, | |
| nextAll: function(t) { | |
| return I.dir(t, "nextSibling") | |
| }, | |
| prevAll: function(t) { | |
| return I.dir(t, "previousSibling") | |
| }, | |
| nextUntil: function(t, i, s) { | |
| return I.dir(t, "nextSibling", s) | |
| }, | |
| prevUntil: function(t, i, s) { | |
| return I.dir(t, "previousSibling", s) | |
| }, | |
| siblings: function(t) { | |
| return I.sibling((t.parentNode || {}).firstChild, t) | |
| }, | |
| children: function(t) { | |
| return I.sibling(t.firstChild) | |
| }, | |
| contents: function(t) { | |
| return I.nodeName(t, "iframe") ? t.contentDocument || t.contentWindow.document : I.merge([], t.childNodes) | |
| } | |
| }, function(name, t) { | |
| I.fn[name] = function(i, selector) { | |
| var s = I.map(this, t, i); | |
| return "Until" !== name.slice(-5) && (selector = i), selector && "string" == typeof selector && (s = I.filter(selector, s)), this.length > 1 && (ce[name] || (s = I.unique(s)), re.test(name) && (s = s.reverse())), this.pushStack(s) | |
| } | |
| }), I.extend({ | |
| filter: function(t, i, s) { | |
| var o = i[0]; | |
| return s && (t = ":not(" + t + ")"), 1 === i.length && 1 === o.nodeType ? I.find.matchesSelector(o, t) ? [o] : [] : I.find.matches(t, I.grep(i, function(t) { | |
| return 1 === t.nodeType | |
| })) | |
| }, | |
| dir: function(t, dir, i) { | |
| for (var s = [], o = t[dir]; o && 9 !== o.nodeType && (i === undefined || 1 !== o.nodeType || !I(o).is(i));) 1 === o.nodeType && s.push(o), o = o[dir]; | |
| return s | |
| }, | |
| sibling: function(n, t) { | |
| for (var r = []; n; n = n.nextSibling) 1 === n.nodeType && n !== t && r.push(n); | |
| return r | |
| } | |
| }); | |
| var ue = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", | |
| de = / jQuery\d+="(?:null|\d+)"/g, | |
| he = new RegExp("<(?:" + ue + ")[\\s/>]", "i"), | |
| pe = /^\s+/, | |
| me = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, | |
| _e = /<([\w:]+)/, | |
| ge = /<tbody/i, | |
| Se = /<|&#?\w+;/, | |
| fe = /<(?:script|style|link)/i, | |
| ye = /^(?:checkbox|radio)$/i, | |
| Te = /checked\s*(?:[^=]|=\s*.checked.)/i, | |
| ve = /^$|\/(?:java|ecma)script/i, | |
| Ce = /^true\/(.*)/, | |
| Ee = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, | |
| be = { | |
| 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: I.support.htmlSerialize ? [0, "", ""] : [1, "X<div>", "</div>"] | |
| }, | |
| Ie = createSafeFragment(document).appendChild(document.createElement("div")); | |
| be.optgroup = be.option, be.tbody = be.tfoot = be.colgroup = be.caption = be.thead, be.th = be.td, I.fn.extend({ | |
| text: function(value) { | |
| return I.access(this, function(value) { | |
| return value === undefined ? I.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value)) | |
| }, null, value, arguments.length) | |
| }, | |
| append: function() { | |
| return this.domManip(arguments, function(t) { | |
| 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || manipulationTarget(this, t).appendChild(t) | |
| }) | |
| }, | |
| prepend: function() { | |
| return this.domManip(arguments, function(t) { | |
| if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { | |
| var target = manipulationTarget(this, t); | |
| target.insertBefore(t, target.firstChild) | |
| } | |
| }) | |
| }, | |
| before: function() { | |
| return this.domManip(arguments, function(t) { | |
| this.parentNode && this.parentNode.insertBefore(t, this) | |
| }) | |
| }, | |
| after: function() { | |
| return this.domManip(arguments, function(t) { | |
| this.parentNode && this.parentNode.insertBefore(t, this.nextSibling) | |
| }) | |
| }, | |
| remove: function(selector, t) { | |
| for (var i, s = selector ? I.filter(selector, this) : this, o = 0; null != (i = s[o]); o++) t || 1 !== i.nodeType || I.cleanData(getAll(i)), i.parentNode && (t && I.contains(i.ownerDocument, i) && setGlobalEval(getAll(i, "script")), i.parentNode.removeChild(i)); | |
| return this | |
| }, | |
| empty: function() { | |
| for (var t, i = 0; null != (t = this[i]); i++) { | |
| for (1 === t.nodeType && I.cleanData(getAll(t, !1)); t.firstChild;) t.removeChild(t.firstChild); | |
| t.options && I.nodeName(t, "select") && (t.options.length = 0) | |
| } | |
| return this | |
| }, | |
| clone: function(t, i) { | |
| return t = null != t && t, i = null == i ? t : i, this.map(function() { | |
| return I.clone(this, t, i) | |
| }) | |
| }, | |
| html: function(value) { | |
| return I.access(this, function(value) { | |
| var t = this[0] || {}, | |
| i = 0, | |
| s = this.length; | |
| if (value === undefined) return 1 === t.nodeType ? t.innerHTML.replace(de, "") : undefined; | |
| if ("string" == typeof value && !fe.test(value) && (I.support.htmlSerialize || !he.test(value)) && (I.support.leadingWhitespace || !pe.test(value)) && !be[(_e.exec(value) || ["", ""])[1].toLowerCase()]) { | |
| value = value.replace(me, "<$1></$2>"); | |
| try { | |
| for (; i < s; i++) 1 === (t = this[i] || {}).nodeType && (I.cleanData(getAll(t, !1)), t.innerHTML = value); | |
| t = 0 | |
| } catch (t) {} | |
| } | |
| t && this.empty().append(value) | |
| }, null, value, arguments.length) | |
| }, | |
| replaceWith: function() { | |
| var t = I.map(this, function(t) { | |
| return [t.nextSibling, t.parentNode] | |
| }), | |
| i = 0; | |
| return this.domManip(arguments, function(s) { | |
| var next = t[i++], | |
| parent = t[i++]; | |
| parent && (next && next.parentNode !== parent && (next = this.nextSibling), I(this).remove(), parent.insertBefore(s, next)) | |
| }, !0), i ? this : this.remove() | |
| }, | |
| detach: function(selector) { | |
| return this.remove(selector, !0) | |
| }, | |
| domManip: function(t, i, s) { | |
| t = m.apply([], t); | |
| var o, l, u, scripts, h, p, _ = 0, | |
| g = this.length, | |
| set = this, | |
| S = g - 1, | |
| value = t[0], | |
| T = I.isFunction(value); | |
| if (T || !(g <= 1 || "string" != typeof value || I.support.checkClone) && Te.test(value)) return this.each(function(index) { | |
| var self = set.eq(index); | |
| T && (t[0] = value.call(this, index, self.html())), self.domManip(t, i, s) | |
| }); | |
| if (g && (p = I.buildFragment(t, this[0].ownerDocument, !1, !s && this), o = p.firstChild, 1 === p.childNodes.length && (p = o), o)) { | |
| for (u = (scripts = I.map(getAll(p, "script"), disableScript)).length; _ < g; _++) l = p, _ !== S && (l = I.clone(l, !0, !0), u && I.merge(scripts, getAll(l, "script"))), i.call(this[_], l, _); | |
| if (u) | |
| for (h = scripts[scripts.length - 1].ownerDocument, I.map(scripts, restoreScript), _ = 0; _ < u; _++) l = scripts[_], ve.test(l.type || "") && !I._data(l, "globalEval") && I.contains(h, l) && (l.src ? I._evalUrl(l.src) : I.globalEval((l.text || l.textContent || l.innerHTML || "").replace(Ee, ""))); | |
| p = o = null | |
| } | |
| return this | |
| } | |
| }), I.each({ | |
| appendTo: "append", | |
| prependTo: "prepend", | |
| insertBefore: "before", | |
| insertAfter: "after", | |
| replaceAll: "replaceWith" | |
| }, function(name, t) { | |
| I.fn[name] = function(selector) { | |
| for (var i, s = 0, o = [], l = I(selector), u = l.length - 1; s <= u; s++) i = s === u ? this : this.clone(!0), I(l[s])[t](i), _.apply(o, i.get()); | |
| return this.pushStack(o) | |
| } | |
| }), I.extend({ | |
| clone: function(t, i, s) { | |
| var o, l, clone, u, h, p = I.contains(t.ownerDocument, t); | |
| if (I.support.html5Clone || I.isXMLDoc(t) || !he.test("<" + t.nodeName + ">") ? clone = t.cloneNode(!0) : (Ie.innerHTML = t.outerHTML, Ie.removeChild(clone = Ie.firstChild)), !(I.support.noCloneEvent && I.support.noCloneChecked || 1 !== t.nodeType && 11 !== t.nodeType || I.isXMLDoc(t))) | |
| for (o = getAll(clone), h = getAll(t), u = 0; null != (l = h[u]); ++u) o[u] && fixCloneNodeIssues(l, o[u]); | |
| if (i) | |
| if (s) | |
| for (h = h || getAll(t), o = o || getAll(clone), u = 0; null != (l = h[u]); u++) cloneCopyEvent(l, o[u]); | |
| else cloneCopyEvent(t, clone); | |
| return (o = getAll(clone, "script")).length > 0 && setGlobalEval(o, !p && getAll(t, "script")), o = h = l = null, clone | |
| }, | |
| buildFragment: function(t, context, scripts, selection) { | |
| for (var i, s, contains, o, tag, l, wrap, u = t.length, h = createSafeFragment(context), p = [], m = 0; m < u; m++) | |
| if ((s = t[m]) || 0 === s) | |
| if ("object" === I.type(s)) I.merge(p, s.nodeType ? [s] : s); | |
| else if (Se.test(s)) { | |
| for (o = o || h.appendChild(context.createElement("div")), tag = (_e.exec(s) || ["", ""])[1].toLowerCase(), wrap = be[tag] || be._default, o.innerHTML = wrap[1] + s.replace(me, "<$1></$2>") + wrap[2], i = wrap[0]; i--;) o = o.lastChild; | |
| if (!I.support.leadingWhitespace && pe.test(s) && p.push(context.createTextNode(pe.exec(s)[0])), !I.support.tbody) | |
| for (i = (s = "table" !== tag || ge.test(s) ? "<table>" !== wrap[1] || ge.test(s) ? 0 : o : o.firstChild) && s.childNodes.length; i--;) I.nodeName(l = s.childNodes[i], "tbody") && !l.childNodes.length && s.removeChild(l); | |
| for (I.merge(p, o.childNodes), o.textContent = ""; o.firstChild;) o.removeChild(o.firstChild); | |
| o = h.lastChild | |
| } else p.push(context.createTextNode(s)); | |
| for (o && h.removeChild(o), I.support.appendChecked || I.grep(getAll(p, "input"), fixDefaultChecked), m = 0; s = p[m++];) | |
| if ((!selection || -1 === I.inArray(s, selection)) && (contains = I.contains(s.ownerDocument, s), o = getAll(h.appendChild(s), "script"), contains && setGlobalEval(o), scripts)) | |
| for (i = 0; s = o[i++];) ve.test(s.type || "") && scripts.push(s); | |
| return o = null, h | |
| }, | |
| cleanData: function(t, i) { | |
| for (var o, type, id, data, l = 0, u = I.expando, h = I.cache, m = I.support.deleteExpando, _ = I.event.special; null != (o = t[l]); l++) | |
| if ((i || I.acceptData(o)) && (id = o[u], data = id && h[id])) { | |
| if (data.events) | |
| for (type in data.events) _[type] ? I.event.remove(o, type) : I.removeEvent(o, type, data.handle); | |
| h[id] && (delete h[id], m ? delete o[u] : typeof o.removeAttribute !== s ? o.removeAttribute(u) : o[u] = null, p.push(id)) | |
| } | |
| }, | |
| _evalUrl: function(url) { | |
| return I.ajax({ | |
| url: url, | |
| type: "GET", | |
| dataType: "script", | |
| async: !1, | |
| global: !1, | |
| throws: !0 | |
| }) | |
| } | |
| }), I.fn.extend({ | |
| wrapAll: function(t) { | |
| if (I.isFunction(t)) return this.each(function(i) { | |
| I(this).wrapAll(t.call(this, i)) | |
| }); | |
| if (this[0]) { | |
| var wrap = I(t, this[0].ownerDocument).eq(0).clone(!0); | |
| this[0].parentNode && wrap.insertBefore(this[0]), wrap.map(function() { | |
| for (var t = this; t.firstChild && 1 === t.firstChild.nodeType;) t = t.firstChild; | |
| return t | |
| }).append(this) | |
| } | |
| return this | |
| }, | |
| wrapInner: function(t) { | |
| return I.isFunction(t) ? this.each(function(i) { | |
| I(this).wrapInner(t.call(this, i)) | |
| }) : this.each(function() { | |
| var self = I(this), | |
| i = self.contents(); | |
| i.length ? i.wrapAll(t) : self.append(t) | |
| }) | |
| }, | |
| wrap: function(t) { | |
| var i = I.isFunction(t); | |
| return this.each(function(s) { | |
| I(this).wrapAll(i ? t.call(this, s) : t) | |
| }) | |
| }, | |
| unwrap: function() { | |
| return this.parent().each(function() { | |
| I.nodeName(this, "body") || I(this).replaceWith(this.childNodes) | |
| }).end() | |
| } | |
| }); | |
| var we, Le, Ae, Re = /alpha\([^)]*\)/i, | |
| Pe = /opacity\s*=\s*([^)]*)/, | |
| De = /^(top|right|bottom|left)$/, | |
| Ne = /^(none|table(?!-c[ea]).+)/, | |
| Oe = /^margin/, | |
| Be = new RegExp("^(" + L + ")(.*)$", "i"), | |
| Me = new RegExp("^(" + L + ")(?!px)[a-z%]+$", "i"), | |
| Ue = new RegExp("^([+-])=(" + L + ")", "i"), | |
| Fe = { | |
| BODY: "block" | |
| }, | |
| ke = { | |
| position: "absolute", | |
| visibility: "hidden", | |
| display: "block" | |
| }, | |
| qe = { | |
| letterSpacing: 0, | |
| fontWeight: 400 | |
| }, | |
| Ve = ["Top", "Right", "Bottom", "Left"], | |
| xe = ["Webkit", "O", "Moz", "ms"]; | |
| I.fn.extend({ | |
| css: function(name, value) { | |
| return I.access(this, function(t, name, value) { | |
| var i, s, map = {}, | |
| o = 0; | |
| if (I.isArray(name)) { | |
| for (s = Le(t), i = name.length; o < i; o++) map[name[o]] = I.css(t, name[o], !1, s); | |
| return map | |
| } | |
| return value !== undefined ? I.style(t, name, value) : I.css(t, name) | |
| }, name, value, arguments.length > 1) | |
| }, | |
| show: function() { | |
| return showHide(this, !0) | |
| }, | |
| hide: function() { | |
| return showHide(this) | |
| }, | |
| toggle: function(state) { | |
| var t = "boolean" == typeof state; | |
| return this.each(function() { | |
| (t ? state : isHidden(this)) ? I(this).show(): I(this).hide() | |
| }) | |
| } | |
| }), I.extend({ | |
| cssHooks: { | |
| opacity: { | |
| get: function(t, i) { | |
| if (i) { | |
| var s = Ae(t, "opacity"); | |
| return "" === s ? "1" : s | |
| } | |
| } | |
| } | |
| }, | |
| cssNumber: { | |
| columnCount: !0, | |
| fillOpacity: !0, | |
| fontWeight: !0, | |
| lineHeight: !0, | |
| opacity: !0, | |
| orphans: !0, | |
| widows: !0, | |
| zIndex: !0, | |
| zoom: !0 | |
| }, | |
| cssProps: { | |
| float: I.support.cssFloat ? "cssFloat" : "styleFloat" | |
| }, | |
| style: function(t, name, value, i) { | |
| if (t && 3 !== t.nodeType && 8 !== t.nodeType && t.style) { | |
| var s, type, o, l = I.camelCase(name), | |
| style = t.style; | |
| if (name = I.cssProps[l] || (I.cssProps[l] = vendorPropName(style, l)), o = I.cssHooks[name] || I.cssHooks[l], value === undefined) return o && "get" in o && (s = o.get(t, !1, i)) !== undefined ? s : style[name]; | |
| if (!("string" == (type = typeof value) && (s = Ue.exec(value)) && (value = (s[1] + 1) * s[2] + parseFloat(I.css(t, name)), type = "number"), null == value || "number" === type && isNaN(value) || ("number" !== type || I.cssNumber[l] || (value += "px"), I.support.clearCloneStyle || "" !== value || 0 !== name.indexOf("background") || (style[name] = "inherit"), o && "set" in o && (value = o.set(t, value, i)) === undefined))) try { | |
| style[name] = value | |
| } catch (t) {} | |
| } | |
| }, | |
| css: function(t, name, i, s) { | |
| var o, l, u, h = I.camelCase(name); | |
| return name = I.cssProps[h] || (I.cssProps[h] = vendorPropName(t.style, h)), (u = I.cssHooks[name] || I.cssHooks[h]) && "get" in u && (l = u.get(t, !0, i)), l === undefined && (l = Ae(t, name, s)), "normal" === l && name in qe && (l = qe[name]), "" === i || i ? (o = parseFloat(l), !0 === i || I.isNumeric(o) ? o || 0 : l) : l | |
| } | |
| }), window.getComputedStyle ? (Le = function(t) { | |
| return window.getComputedStyle(t, null) | |
| }, Ae = function(t, name, i) { | |
| var width, minWidth, maxWidth, s = i || Le(t), | |
| o = s ? s.getPropertyValue(name) || s[name] : undefined, | |
| style = t.style; | |
| return s && ("" !== o || I.contains(t.ownerDocument, t) || (o = I.style(t, name)), Me.test(o) && Oe.test(name) && (width = style.width, minWidth = style.minWidth, maxWidth = style.maxWidth, style.minWidth = style.maxWidth = style.width = o, o = s.width, style.width = width, style.minWidth = minWidth, style.maxWidth = maxWidth)), o | |
| }) : document.documentElement.currentStyle && (Le = function(t) { | |
| return t.currentStyle | |
| }, Ae = function(t, name, i) { | |
| var left, s, o, l = i || Le(t), | |
| u = l ? l[name] : undefined, | |
| style = t.style; | |
| return null == u && style && style[name] && (u = style[name]), Me.test(u) && !De.test(name) && (left = style.left, (o = (s = t.runtimeStyle) && s.left) && (s.left = t.currentStyle.left), style.left = "fontSize" === name ? "1em" : u, u = style.pixelLeft + "px", style.left = left, o && (s.left = o)), "" === u ? "auto" : u | |
| }), I.each(["height", "width"], function(t, name) { | |
| I.cssHooks[name] = { | |
| get: function(t, i, s) { | |
| if (i) return 0 === t.offsetWidth && Ne.test(I.css(t, "display")) ? I.swap(t, ke, function() { | |
| return getWidthOrHeight(t, name, s) | |
| }) : getWidthOrHeight(t, name, s) | |
| }, | |
| set: function(t, value, i) { | |
| var s = i && Le(t); | |
| return setPositiveNumber(0, value, i ? augmentWidthOrHeight(t, name, i, I.support.boxSizing && "border-box" === I.css(t, "boxSizing", !1, s), s) : 0) | |
| } | |
| } | |
| }), I.support.opacity || (I.cssHooks.opacity = { | |
| get: function(t, i) { | |
| return Pe.test((i && t.currentStyle ? t.currentStyle.filter : t.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : i ? "1" : "" | |
| }, | |
| set: function(t, value) { | |
| var style = t.style, | |
| currentStyle = t.currentStyle, | |
| opacity = I.isNumeric(value) ? "alpha(opacity=" + 100 * value + ")" : "", | |
| filter = currentStyle && currentStyle.filter || style.filter || ""; | |
| style.zoom = 1, (value >= 1 || "" === value) && "" === I.trim(filter.replace(Re, "")) && style.removeAttribute && (style.removeAttribute("filter"), "" === value || currentStyle && !currentStyle.filter) || (style.filter = Re.test(filter) ? filter.replace(Re, opacity) : filter + " " + opacity) | |
| } | |
| }), I(function() { | |
| I.support.reliableMarginRight || (I.cssHooks.marginRight = { | |
| get: function(t, i) { | |
| if (i) return I.swap(t, { | |
| display: "inline-block" | |
| }, Ae, [t, "marginRight"]) | |
| } | |
| }), !I.support.pixelPosition && I.fn.position && I.each(["top", "left"], function(t, i) { | |
| I.cssHooks[i] = { | |
| get: function(t, s) { | |
| if (s) return s = Ae(t, i), Me.test(s) ? I(t).position()[i] + "px" : s | |
| } | |
| } | |
| }) | |
| }), I.expr && I.expr.filters && (I.expr.filters.hidden = function(t) { | |
| return t.offsetWidth <= 0 && t.offsetHeight <= 0 || !I.support.reliableHiddenOffsets && "none" === (t.style && t.style.display || I.css(t, "display")) | |
| }, I.expr.filters.visible = function(t) { | |
| return !I.expr.filters.hidden(t) | |
| }), I.each({ | |
| margin: "", | |
| padding: "", | |
| border: "Width" | |
| }, function(prefix, suffix) { | |
| I.cssHooks[prefix + suffix] = { | |
| expand: function(value) { | |
| for (var t = 0, i = {}, s = "string" == typeof value ? value.split(" ") : [value]; t < 4; t++) i[prefix + Ve[t] + suffix] = s[t] || s[t - 2] || s[0]; | |
| return i | |
| } | |
| }, Oe.test(prefix) || (I.cssHooks[prefix + suffix].set = setPositiveNumber) | |
| }); | |
| var $e = /%20/g, | |
| Ge = /\[\]$/, | |
| He = /\r?\n/g, | |
| je = /^(?:submit|button|image|reset|file)$/i, | |
| ze = /^(?:input|select|textarea|keygen)/i; | |
| I.fn.extend({ | |
| serialize: function() { | |
| return I.param(this.serializeArray()) | |
| }, | |
| serializeArray: function() { | |
| return this.map(function() { | |
| var elements = I.prop(this, "elements"); | |
| return elements ? I.makeArray(elements) : this | |
| }).filter(function() { | |
| var type = this.type; | |
| return this.name && !I(this).is(":disabled") && ze.test(this.nodeName) && !je.test(type) && (this.checked || !ye.test(type)) | |
| }).map(function(t, i) { | |
| var s = I(this).val(); | |
| return null == s ? null : I.isArray(s) ? I.map(s, function(t) { | |
| return { | |
| name: i.name, | |
| value: t.replace(He, "\r\n") | |
| } | |
| }) : { | |
| name: i.name, | |
| value: s.replace(He, "\r\n") | |
| } | |
| }).get() | |
| } | |
| }), I.param = function(a, t) { | |
| var prefix, i = [], | |
| add = function(key, value) { | |
| value = I.isFunction(value) ? value() : null == value ? "" : value, i[i.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value) | |
| }; | |
| if (t === undefined && (t = I.ajaxSettings && I.ajaxSettings.traditional), I.isArray(a) || a.jquery && !I.isPlainObject(a)) I.each(a, function() { | |
| add(this.name, this.value) | |
| }); | |
| else | |
| for (prefix in a) buildParams(prefix, a[prefix], t, add); | |
| return i.join("&").replace($e, "+") | |
| }, I.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(t, name) { | |
| I.fn[name] = function(data, t) { | |
| return arguments.length > 0 ? this.on(name, null, data, t) : this.trigger(name) | |
| } | |
| }), I.fn.extend({ | |
| hover: function(t, i) { | |
| return this.mouseenter(t).mouseleave(i || t) | |
| }, | |
| bind: function(types, data, t) { | |
| return this.on(types, null, data, t) | |
| }, | |
| unbind: function(types, t) { | |
| return this.off(types, null, t) | |
| }, | |
| delegate: function(selector, types, data, t) { | |
| return this.on(types, selector, data, t) | |
| }, | |
| undelegate: function(selector, types, t) { | |
| return 1 === arguments.length ? this.off(selector, "**") : this.off(types, selector || "**", t) | |
| } | |
| }); | |
| var Ye, Ke, We = I.now(), | |
| Je = /\?/, | |
| Qe = /#.*$/, | |
| Xe = /([?&])_=[^&]*/, | |
| Ze = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, | |
| et = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, | |
| tt = /^(?:GET|HEAD)$/, | |
| it = /^\/\//, | |
| st = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, | |
| nt = I.fn.load, | |
| ot = {}, | |
| at = {}, | |
| rt = "*/".concat("*"); | |
| try { | |
| Ke = location.href | |
| } catch (t) { | |
| (Ke = document.createElement("a")).href = "", Ke = Ke.href | |
| } | |
| Ye = st.exec(Ke.toLowerCase()) || [], I.fn.load = function(url, t, i) { | |
| if ("string" != typeof url && nt) return nt.apply(this, arguments); | |
| var selector, response, type, self = this, | |
| s = url.indexOf(" "); | |
| return s >= 0 && (selector = url.slice(s, url.length), url = url.slice(0, s)), I.isFunction(t) ? (i = t, t = undefined) : t && "object" == typeof t && (type = "POST"), self.length > 0 && I.ajax({ | |
| url: url, | |
| type: type, | |
| dataType: "html", | |
| data: t | |
| }).done(function(responseText) { | |
| response = arguments, self.html(selector ? I("<div>").append(I.parseHTML(responseText)).find(selector) : responseText) | |
| }).complete(i && function(t, status) { | |
| self.each(i, response || [t.responseText, status, t]) | |
| }), this | |
| }, I.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(t, type) { | |
| I.fn[type] = function(t) { | |
| return this.on(type, t) | |
| } | |
| }), I.extend({ | |
| active: 0, | |
| lastModified: {}, | |
| etag: {}, | |
| ajaxSettings: { | |
| url: Ke, | |
| type: "GET", | |
| isLocal: et.test(Ye[1]), | |
| global: !0, | |
| processData: !0, | |
| async: !0, | |
| contentType: "application/x-www-form-urlencoded; charset=UTF-8", | |
| accepts: { | |
| "*": rt, | |
| 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", | |
| json: "responseJSON" | |
| }, | |
| converters: { | |
| "* text": String, | |
| "text html": !0, | |
| "text json": I.parseJSON, | |
| "text xml": I.parseXML | |
| }, | |
| flatOptions: { | |
| url: !0, | |
| context: !0 | |
| } | |
| }, | |
| ajaxSetup: function(target, t) { | |
| return t ? ajaxExtend(ajaxExtend(target, I.ajaxSettings), t) : ajaxExtend(I.ajaxSettings, target) | |
| }, | |
| ajaxPrefilter: addToPrefiltersOrTransports(ot), | |
| ajaxTransport: addToPrefiltersOrTransports(at), | |
| ajax: function(url, options) { | |
| function done(status, t, i, headers) { | |
| var p, C, error, response, L, statusText = t; | |
| 2 !== state && (state = 2, l && clearTimeout(l), h = undefined, o = headers || "", P.readyState = status > 0 ? 4 : 0, p = status >= 200 && status < 300 || 304 === status, i && (response = ajaxHandleResponses(m, P, i)), response = ajaxConvert(m, response, P, p), p ? (m.ifModified && ((L = P.getResponseHeader("Last-Modified")) && (I.lastModified[s] = L), (L = P.getResponseHeader("etag")) && (I.etag[s] = L)), 204 === status || "HEAD" === m.type ? statusText = "nocontent" : 304 === status ? statusText = "notmodified" : (statusText = response.state, C = response.data, p = !(error = response.error))) : (error = statusText, !status && statusText || (statusText = "error", status < 0 && (status = 0))), P.status = status, P.statusText = (t || statusText) + "", p ? S.resolveWith(_, [C, statusText, P]) : S.rejectWith(_, [P, statusText, error]), P.statusCode(v), v = undefined, u && g.trigger(p ? "ajaxSuccess" : "ajaxError", [P, m, p ? C : error]), T.fireWith(_, [P, statusText]), u && (g.trigger("ajaxComplete", [P, m]), --I.active || I.event.trigger("ajaxStop"))) | |
| } | |
| "object" == typeof url && (options = url, url = undefined), options = options || {}; | |
| var t, i, s, o, l, u, h, p, m = I.ajaxSetup({}, options), | |
| _ = m.context || m, | |
| g = m.context && (_.nodeType || _.jquery) ? I(_) : I.event, | |
| S = I.Deferred(), | |
| T = I.Callbacks("once memory"), | |
| v = m.statusCode || {}, | |
| C = {}, | |
| L = {}, | |
| state = 0, | |
| R = "canceled", | |
| P = { | |
| readyState: 0, | |
| getResponseHeader: function(key) { | |
| var match; | |
| if (2 === state) { | |
| if (!p) | |
| for (p = {}; match = Ze.exec(o);) p[match[1].toLowerCase()] = match[2]; | |
| match = p[key.toLowerCase()] | |
| } | |
| return null == match ? null : match | |
| }, | |
| getAllResponseHeaders: function() { | |
| return 2 === state ? o : null | |
| }, | |
| setRequestHeader: function(name, value) { | |
| var t = name.toLowerCase(); | |
| return state || (name = L[t] = L[t] || name, C[name] = value), this | |
| }, | |
| overrideMimeType: function(type) { | |
| return state || (m.mimeType = type), this | |
| }, | |
| statusCode: function(map) { | |
| var code; | |
| if (map) | |
| if (state < 2) | |
| for (code in map) v[code] = [v[code], map[code]]; | |
| else P.always(map[P.status]); | |
| return this | |
| }, | |
| abort: function(statusText) { | |
| var t = statusText || R; | |
| return h && h.abort(t), done(0, t), this | |
| } | |
| }; | |
| if (S.promise(P).complete = T.add, P.success = P.done, P.error = P.fail, m.url = ((url || m.url || Ke) + "").replace(Qe, "").replace(it, Ye[1] + "//"), m.type = options.method || options.type || m.method || m.type, m.dataTypes = I.trim(m.dataType || "*").toLowerCase().match(A) || [""], null == m.crossDomain && (t = st.exec(m.url.toLowerCase()), m.crossDomain = !(!t || t[1] === Ye[1] && t[2] === Ye[2] && (t[3] || ("http:" === t[1] ? "80" : "443")) === (Ye[3] || ("http:" === Ye[1] ? "80" : "443")))), m.data && m.processData && "string" != typeof m.data && (m.data = I.param(m.data, m.traditional)), inspectPrefiltersOrTransports(ot, m, options, P), 2 === state) return P; | |
| (u = m.global) && 0 == I.active++ && I.event.trigger("ajaxStart"), m.type = m.type.toUpperCase(), m.hasContent = !tt.test(m.type), s = m.url, m.hasContent || (m.data && (s = m.url += (Je.test(s) ? "&" : "?") + m.data, delete m.data), !1 === m.cache && (m.url = Xe.test(s) ? s.replace(Xe, "$1_=" + We++) : s + (Je.test(s) ? "&" : "?") + "_=" + We++)), m.ifModified && (I.lastModified[s] && P.setRequestHeader("If-Modified-Since", I.lastModified[s]), I.etag[s] && P.setRequestHeader("If-None-Match", I.etag[s])), (m.data && m.hasContent && !1 !== m.contentType || options.contentType) && P.setRequestHeader("Content-Type", m.contentType), P.setRequestHeader("Accept", m.dataTypes[0] && m.accepts[m.dataTypes[0]] ? m.accepts[m.dataTypes[0]] + ("*" !== m.dataTypes[0] ? ", " + rt + "; q=0.01" : "") : m.accepts["*"]); | |
| for (i in m.headers) P.setRequestHeader(i, m.headers[i]); | |
| if (m.beforeSend && (!1 === m.beforeSend.call(_, P, m) || 2 === state)) return P.abort(); | |
| R = "abort"; | |
| for (i in { | |
| success: 1, | |
| error: 1, | |
| complete: 1 | |
| }) P[i](m[i]); | |
| if (h = inspectPrefiltersOrTransports(at, m, options, P)) { | |
| P.readyState = 1, u && g.trigger("ajaxSend", [P, m]), m.async && m.timeout > 0 && (l = setTimeout(function() { | |
| P.abort("timeout") | |
| }, m.timeout)); | |
| try { | |
| state = 1, h.send(C, done) | |
| } catch (t) { | |
| if (!(state < 2)) throw t; | |
| done(-1, t) | |
| } | |
| } else done(-1, "No Transport"); | |
| return P | |
| }, | |
| getJSON: function(url, data, t) { | |
| return I.get(url, data, t, "json") | |
| }, | |
| getScript: function(url, t) { | |
| return I.get(url, undefined, t, "script") | |
| } | |
| }), I.each(["get", "post"], function(t, method) { | |
| I[method] = function(url, data, t, type) { | |
| return I.isFunction(data) && (type = type || t, t = data, data = undefined), I.ajax({ | |
| url: url, | |
| type: method, | |
| dataType: type, | |
| data: data, | |
| success: t | |
| }) | |
| } | |
| }), I.ajaxSetup({ | |
| accepts: { | |
| script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" | |
| }, | |
| contents: { | |
| script: /(?:java|ecma)script/ | |
| }, | |
| converters: { | |
| "text script": function(text) { | |
| return I.globalEval(text), text | |
| } | |
| } | |
| }), I.ajaxPrefilter("script", function(t) { | |
| t.cache === undefined && (t.cache = !1), t.crossDomain && (t.type = "GET", t.global = !1) | |
| }), I.ajaxTransport("script", function(t) { | |
| if (t.crossDomain) { | |
| var i, head = document.head || I("head")[0] || document.documentElement; | |
| return { | |
| send: function(s, o) { | |
| (i = document.createElement("script")).async = !0, t.scriptCharset && (i.charset = t.scriptCharset), i.src = t.url, i.onload = i.onreadystatechange = function(t, s) { | |
| (s || !i.readyState || /loaded|complete/.test(i.readyState)) && (i.onload = i.onreadystatechange = null, i.parentNode && i.parentNode.removeChild(i), i = null, s || o(200, "success")) | |
| }, head.insertBefore(i, head.firstChild) | |
| }, | |
| abort: function() { | |
| i && i.onload(undefined, !0) | |
| } | |
| } | |
| } | |
| }); | |
| var lt = [], | |
| ct = /(=)\?(?=&|$)|\?\?/; | |
| I.ajaxSetup({ | |
| jsonp: "callback", | |
| jsonpCallback: function() { | |
| var t = lt.pop() || I.expando + "_" + We++; | |
| return this[t] = !0, t | |
| } | |
| }), I.ajaxPrefilter("json jsonp", function(t, i, s) { | |
| var o, l, u, h = !1 !== t.jsonp && (ct.test(t.url) ? "url" : "string" == typeof t.data && !(t.contentType || "").indexOf("application/x-www-form-urlencoded") && ct.test(t.data) && "data"); | |
| if (h || "jsonp" === t.dataTypes[0]) return o = t.jsonpCallback = I.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, h ? t[h] = t[h].replace(ct, "$1" + o) : !1 !== t.jsonp && (t.url += (Je.test(t.url) ? "&" : "?") + t.jsonp + "=" + o), t.converters["script json"] = function() { | |
| return u || I.error(o + " was not called"), u[0] | |
| }, t.dataTypes[0] = "json", l = window[o], window[o] = function() { | |
| u = arguments | |
| }, s.always(function() { | |
| window[o] = l, t[o] && (t.jsonpCallback = i.jsonpCallback, lt.push(o)), u && I.isFunction(l) && l(u[0]), u = l = undefined | |
| }), "script" | |
| }); | |
| var ut, dt, ht = 0, | |
| pt = window.ActiveXObject && function() { | |
| var key; | |
| for (key in ut) ut[key](undefined, !0) | |
| }; | |
| I.ajaxSettings.xhr = window.ActiveXObject ? function() { | |
| return !this.isLocal && createStandardXHR() || createActiveXHR() | |
| } : createStandardXHR, dt = I.ajaxSettings.xhr(), I.support.cors = !!dt && "withCredentials" in dt, (dt = I.support.ajax = !!dt) && I.ajaxTransport(function(t) { | |
| if (!t.crossDomain || I.support.cors) { | |
| var i; | |
| return { | |
| send: function(headers, complete) { | |
| var s, o, l = t.xhr(); | |
| if (t.username ? l.open(t.type, t.url, t.async, t.username, t.password) : l.open(t.type, t.url, t.async), t.xhrFields) | |
| for (o in t.xhrFields) l[o] = t.xhrFields[o]; | |
| t.mimeType && l.overrideMimeType && l.overrideMimeType(t.mimeType), t.crossDomain || headers["X-Requested-With"] || (headers["X-Requested-With"] = "XMLHttpRequest"); | |
| try { | |
| for (o in headers) l.setRequestHeader(o, headers[o]) | |
| } catch (t) {} | |
| l.send(t.hasContent && t.data || null), i = function(o, u) { | |
| var status, h, statusText, p; | |
| try { | |
| if (i && (u || 4 === l.readyState)) | |
| if (i = undefined, s && (l.onreadystatechange = I.noop, pt && delete ut[s]), u) 4 !== l.readyState && l.abort(); | |
| else { | |
| p = {}, status = l.status, h = l.getAllResponseHeaders(), "string" == typeof l.responseText && (p.text = l.responseText); | |
| try { | |
| statusText = l.statusText | |
| } catch (t) { | |
| statusText = "" | |
| } | |
| status || !t.isLocal || t.crossDomain ? 1223 === status && (status = 204) : status = p.text ? 200 : 404 | |
| } | |
| } catch (t) { | |
| u || complete(-1, t) | |
| } | |
| p && complete(status, statusText, p, h) | |
| }, t.async ? 4 === l.readyState ? setTimeout(i) : (s = ++ht, pt && (ut || (ut = {}, I(window).unload(pt)), ut[s] = i), l.onreadystatechange = i) : i() | |
| }, | |
| abort: function() { | |
| i && i(undefined, !0) | |
| } | |
| } | |
| } | |
| }); | |
| var _t, gt, St = /^(?:toggle|show|hide)$/, | |
| ft = new RegExp("^(?:([+-])=|)(" + L + ")([a-z%]*)$", "i"), | |
| yt = /queueHooks$/, | |
| Tt = [function defaultPrefilter(t, i, s) { | |
| var o, value, toggle, l, u, h, p = this, | |
| m = {}, | |
| style = t.style, | |
| hidden = t.nodeType && isHidden(t), | |
| _ = I._data(t, "fxshow"); | |
| s.queue || (null == (u = I._queueHooks(t, "fx")).unqueued && (u.unqueued = 0, h = u.empty.fire, u.empty.fire = function() { | |
| u.unqueued || h() | |
| }), u.unqueued++, p.always(function() { | |
| p.always(function() { | |
| u.unqueued--, I.queue(t, "fx").length || u.empty.fire() | |
| }) | |
| })), 1 === t.nodeType && ("height" in i || "width" in i) && (s.overflow = [style.overflow, style.overflowX, style.overflowY], "inline" === I.css(t, "display") && "none" === I.css(t, "float") && (I.support.inlineBlockNeedsLayout && "inline" !== css_defaultDisplay(t.nodeName) ? style.zoom = 1 : style.display = "inline-block")), s.overflow && (style.overflow = "hidden", I.support.shrinkWrapBlocks || p.always(function() { | |
| style.overflow = s.overflow[0], style.overflowX = s.overflow[1], style.overflowY = s.overflow[2] | |
| })); | |
| for (o in i) | |
| if (value = i[o], St.exec(value)) { | |
| if (delete i[o], toggle = toggle || "toggle" === value, value === (hidden ? "hide" : "show")) continue; | |
| m[o] = _ && _[o] || I.style(t, o) | |
| } | |
| if (!I.isEmptyObject(m)) { | |
| _ ? "hidden" in _ && (hidden = _.hidden) : _ = I._data(t, "fxshow", {}), toggle && (_.hidden = !hidden), hidden ? I(t).show() : p.done(function() { | |
| I(t).hide() | |
| }), p.done(function() { | |
| var i; | |
| I._removeData(t, "fxshow"); | |
| for (i in m) I.style(t, i, m[i]) | |
| }); | |
| for (o in m) l = createTween(hidden ? _[o] : 0, o, p), o in _ || (_[o] = l.start, hidden && (l.end = l.start, l.start = "width" === o || "height" === o ? 1 : 0)) | |
| } | |
| }], | |
| vt = { | |
| "*": [function(t, value) { | |
| var i = this.createTween(t, value), | |
| target = i.cur(), | |
| s = ft.exec(value), | |
| o = s && s[3] || (I.cssNumber[t] ? "" : "px"), | |
| start = (I.cssNumber[t] || "px" !== o && +target) && ft.exec(I.css(i.elem, t)), | |
| scale = 1, | |
| l = 20; | |
| if (start && start[3] !== o) { | |
| o = o || start[3], s = s || [], start = +target || 1; | |
| do { | |
| start /= scale = scale || ".5", I.style(i.elem, t, start + o) | |
| } while (scale !== (scale = i.cur() / target) && 1 !== scale && --l) | |
| } | |
| return s && (start = i.start = +start || +target || 0, i.unit = o, i.end = s[1] ? start + (s[1] + 1) * s[2] : +s[2]), i | |
| }] | |
| }; | |
| I.Animation = I.extend(Animation, { | |
| tweener: function(t, i) { | |
| I.isFunction(t) ? (i = t, t = ["*"]) : t = t.split(" "); | |
| for (var s, index = 0, length = t.length; index < length; index++) s = t[index], vt[s] = vt[s] || [], vt[s].unshift(i) | |
| }, | |
| prefilter: function(t, i) { | |
| i ? Tt.unshift(t) : Tt.push(t) | |
| } | |
| }), I.Tween = Tween, Tween.prototype = { | |
| constructor: Tween, | |
| init: function(t, options, i, end, s, o) { | |
| this.elem = t, this.prop = i, this.easing = s || "swing", this.options = options, this.start = this.now = this.cur(), this.end = end, this.unit = o || (I.cssNumber[i] ? "" : "px") | |
| }, | |
| cur: function() { | |
| var t = Tween.propHooks[this.prop]; | |
| return t && t.get ? t.get(this) : Tween.propHooks._default.get(this) | |
| }, | |
| run: function(t) { | |
| var i, s = Tween.propHooks[this.prop]; | |
| return this.options.duration ? this.pos = i = I.easing[this.easing](t, this.options.duration * t, 0, 1, this.options.duration) : this.pos = i = t, this.now = (this.end - this.start) * i + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), s && s.set ? s.set(this) : Tween.propHooks._default.set(this), this | |
| } | |
| }, Tween.prototype.init.prototype = Tween.prototype, Tween.propHooks = { | |
| _default: { | |
| get: function(t) { | |
| var result; | |
| return null == t.elem[t.prop] || t.elem.style && null != t.elem.style[t.prop] ? (result = I.css(t.elem, t.prop, "")) && "auto" !== result ? result : 0 : t.elem[t.prop] | |
| }, | |
| set: function(t) { | |
| I.fx.step[t.prop] ? I.fx.step[t.prop](t) : t.elem.style && (null != t.elem.style[I.cssProps[t.prop]] || I.cssHooks[t.prop]) ? I.style(t.elem, t.prop, t.now + t.unit) : t.elem[t.prop] = t.now | |
| } | |
| } | |
| }, Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { | |
| set: function(t) { | |
| t.elem.nodeType && t.elem.parentNode && (t.elem[t.prop] = t.now) | |
| } | |
| }, I.each(["toggle", "show", "hide"], function(t, name) { | |
| var i = I.fn[name]; | |
| I.fn[name] = function(speed, t, s) { | |
| return null == speed || "boolean" == typeof speed ? i.apply(this, arguments) : this.animate(genFx(name, !0), speed, t, s) | |
| } | |
| }), I.fn.extend({ | |
| fadeTo: function(speed, t, i, s) { | |
| return this.filter(isHidden).css("opacity", 0).show().end().animate({ | |
| opacity: t | |
| }, speed, i, s) | |
| }, | |
| animate: function(t, speed, i, s) { | |
| var empty = I.isEmptyObject(t), | |
| o = I.speed(speed, i, s), | |
| l = function() { | |
| var i = Animation(this, I.extend({}, t), o); | |
| (empty || I._data(this, "finish")) && i.stop(!0) | |
| }; | |
| return l.finish = l, empty || !1 === o.queue ? this.each(l) : this.queue(o.queue, l) | |
| }, | |
| stop: function(type, t, i) { | |
| var s = function(t) { | |
| var stop = t.stop; | |
| delete t.stop, stop(i) | |
| }; | |
| return "string" != typeof type && (i = t, t = type, type = undefined), t && !1 !== type && this.queue(type || "fx", []), this.each(function() { | |
| var t = !0, | |
| index = null != type && type + "queueHooks", | |
| o = I.timers, | |
| data = I._data(this); | |
| if (index) data[index] && data[index].stop && s(data[index]); | |
| else | |
| for (index in data) data[index] && data[index].stop && yt.test(index) && s(data[index]); | |
| for (index = o.length; index--;) o[index].elem !== this || null != type && o[index].queue !== type || (o[index].anim.stop(i), t = !1, o.splice(index, 1)); | |
| !t && i || I.dequeue(this, type) | |
| }) | |
| }, | |
| finish: function(type) { | |
| return !1 !== type && (type = type || "fx"), this.each(function() { | |
| var index, data = I._data(this), | |
| t = data[type + "queue"], | |
| i = data[type + "queueHooks"], | |
| s = I.timers, | |
| length = t ? t.length : 0; | |
| for (data.finish = !0, I.queue(this, type, []), i && i.stop && i.stop.call(this, !0), index = s.length; index--;) s[index].elem === this && s[index].queue === type && (s[index].anim.stop(!0), s.splice(index, 1)); | |
| for (index = 0; index < length; index++) t[index] && t[index].finish && t[index].finish.call(this); | |
| delete data.finish | |
| }) | |
| } | |
| }), I.each({ | |
| slideDown: genFx("show"), | |
| slideUp: genFx("hide"), | |
| slideToggle: genFx("toggle"), | |
| fadeIn: { | |
| opacity: "show" | |
| }, | |
| fadeOut: { | |
| opacity: "hide" | |
| }, | |
| fadeToggle: { | |
| opacity: "toggle" | |
| } | |
| }, function(name, t) { | |
| I.fn[name] = function(speed, i, s) { | |
| return this.animate(t, speed, i, s) | |
| } | |
| }), I.speed = function(speed, t, i) { | |
| var s = speed && "object" == typeof speed ? I.extend({}, speed) : { | |
| complete: i || !i && t || I.isFunction(speed) && speed, | |
| duration: speed, | |
| easing: i && t || t && !I.isFunction(t) && t | |
| }; | |
| return s.duration = I.fx.off ? 0 : "number" == typeof s.duration ? s.duration : s.duration in I.fx.speeds ? I.fx.speeds[s.duration] : I.fx.speeds._default, null != s.queue && !0 !== s.queue || (s.queue = "fx"), s.old = s.complete, s.complete = function() { | |
| I.isFunction(s.old) && s.old.call(this), s.queue && I.dequeue(this, s.queue) | |
| }, s | |
| }, I.easing = { | |
| linear: function(t) { | |
| return t | |
| }, | |
| swing: function(t) { | |
| return .5 - Math.cos(t * Math.PI) / 2 | |
| } | |
| }, I.timers = [], I.fx = Tween.prototype.init, I.fx.tick = function() { | |
| var t, i = I.timers, | |
| s = 0; | |
| for (_t = I.now(); s < i.length; s++)(t = i[s])() || i[s] !== t || i.splice(s--, 1); | |
| i.length || I.fx.stop(), _t = undefined | |
| }, I.fx.timer = function(t) { | |
| t() && I.timers.push(t) && I.fx.start() | |
| }, I.fx.interval = 13, I.fx.start = function() { | |
| gt || (gt = setInterval(I.fx.tick, I.fx.interval)) | |
| }, I.fx.stop = function() { | |
| clearInterval(gt), gt = null | |
| }, I.fx.speeds = { | |
| slow: 600, | |
| fast: 200, | |
| _default: 400 | |
| }, I.fx.step = {}, I.expr && I.expr.filters && (I.expr.filters.animated = function(t) { | |
| return I.grep(I.timers, function(i) { | |
| return t === i.elem | |
| }).length | |
| }), I.fn.offset = function(options) { | |
| if (arguments.length) return options === undefined ? this : this.each(function(t) { | |
| I.offset.setOffset(this, options, t) | |
| }); | |
| var t, i, o = { | |
| top: 0, | |
| left: 0 | |
| }, | |
| l = this[0], | |
| u = l && l.ownerDocument; | |
| if (u) return t = u.documentElement, I.contains(t, l) ? (typeof l.getBoundingClientRect !== s && (o = l.getBoundingClientRect()), i = getWindow(u), { | |
| top: o.top + (i.pageYOffset || t.scrollTop) - (t.clientTop || 0), | |
| left: o.left + (i.pageXOffset || t.scrollLeft) - (t.clientLeft || 0) | |
| }) : o | |
| }, I.offset = { | |
| setOffset: function(t, options, i) { | |
| var position = I.css(t, "position"); | |
| "static" === position && (t.style.position = "relative"); | |
| var s, o, l = I(t), | |
| u = l.offset(), | |
| h = I.css(t, "top"), | |
| p = I.css(t, "left"), | |
| m = {}, | |
| _ = {}; | |
| ("absolute" === position || "fixed" === position) && I.inArray("auto", [h, p]) > -1 ? (s = (_ = l.position()).top, o = _.left) : (s = parseFloat(h) || 0, o = parseFloat(p) || 0), I.isFunction(options) && (options = options.call(t, i, u)), null != options.top && (m.top = options.top - u.top + s), null != options.left && (m.left = options.left - u.left + o), "using" in options ? options.using.call(t, m) : l.css(m) | |
| } | |
| }, I.fn.extend({ | |
| position: function() { | |
| if (this[0]) { | |
| var offsetParent, offset, t = { | |
| top: 0, | |
| left: 0 | |
| }, | |
| i = this[0]; | |
| return "fixed" === I.css(i, "position") ? offset = i.getBoundingClientRect() : (offsetParent = this.offsetParent(), offset = this.offset(), I.nodeName(offsetParent[0], "html") || (t = offsetParent.offset()), t.top += I.css(offsetParent[0], "borderTopWidth", !0), t.left += I.css(offsetParent[0], "borderLeftWidth", !0)), { | |
| top: offset.top - t.top - I.css(i, "marginTop", !0), | |
| left: offset.left - t.left - I.css(i, "marginLeft", !0) | |
| } | |
| } | |
| }, | |
| offsetParent: function() { | |
| return this.map(function() { | |
| for (var offsetParent = this.offsetParent || o; offsetParent && !I.nodeName(offsetParent, "html") && "static" === I.css(offsetParent, "position");) offsetParent = offsetParent.offsetParent; | |
| return offsetParent || o | |
| }) | |
| } | |
| }), I.each({ | |
| scrollLeft: "pageXOffset", | |
| scrollTop: "pageYOffset" | |
| }, function(method, t) { | |
| var top = /Y/.test(t); | |
| I.fn[method] = function(i) { | |
| return I.access(this, function(i, method, s) { | |
| var o = getWindow(i); | |
| if (s === undefined) return o ? t in o ? o[t] : o.document.documentElement[method] : i[method]; | |
| o ? o.scrollTo(top ? I(o).scrollLeft() : s, top ? s : I(o).scrollTop()) : i[method] = s | |
| }, method, i, arguments.length, null) | |
| } | |
| }), I.each({ | |
| Height: "height", | |
| Width: "width" | |
| }, function(name, type) { | |
| I.each({ | |
| padding: "inner" + name, | |
| content: type, | |
| "": "outer" + name | |
| }, function(t, i) { | |
| I.fn[i] = function(margin, value) { | |
| var i = arguments.length && (t || "boolean" != typeof margin), | |
| s = t || (!0 === margin || !0 === value ? "margin" : "border"); | |
| return I.access(this, function(t, type, value) { | |
| var i; | |
| return I.isWindow(t) ? t.document.documentElement["client" + name] : 9 === t.nodeType ? (i = t.documentElement, Math.max(t.body["scroll" + name], i["scroll" + name], t.body["offset" + name], i["offset" + name], i["client" + name])) : value === undefined ? I.css(t, type, s) : I.style(t, type, value, s) | |
| }, type, i ? margin : undefined, i, null) | |
| } | |
| }) | |
| }), I.fn.size = function() { | |
| return this.length | |
| }, I.fn.andSelf = I.fn.addBack, "object" == typeof module && module && "object" == typeof module.exports ? module.exports = I : (window.jQuery = window.$ = I, "function" == typeof define && define.hasOwnProperty("amd") && define("jquery", [], function() { | |
| return I | |
| })) | |
| }(window), | |
| function() { | |
| function J(a) { | |
| i.set(a) | |
| } | |
| function Ja(a) { | |
| if (100 != a.get(kt) && La(ne(a, Q)) % 1e4 >= 100 * oe(a, kt)) throw "abort" | |
| } | |
| function Ma(a) { | |
| if (B(ne(a, At))) throw "abort" | |
| } | |
| function Oa() { | |
| var a = N.location.protocol; | |
| if ("http:" != a && "https:" != a) throw "abort" | |
| } | |
| function Pa(a) { | |
| try { | |
| D.navigator.sendBeacon ? J(42) : D.XMLHttpRequest && "withCredentials" in new D.XMLHttpRequest && J(40) | |
| } catch (t) {} | |
| a.set(lt, o(a), !0), a.set(Ee, oe(a, Ee) + 1); | |
| var b = []; | |
| ie.map(function(c, d) { | |
| if (d.F) { | |
| var e = a.get(c); | |
| void 0 != e && e != d.defaultValue && ("boolean" == typeof e && (e *= 1), b.push(d.F + "=" + T("" + e))) | |
| } | |
| }), b.push("z=" + ee()), a.set(Te, b.join("&"), !0) | |
| } | |
| function Sa(a) { | |
| var b = ne(a, xt) || V() + "/collect", | |
| c = ne(a, Ce); | |
| if (!c && a.get(ve) && (c = "beacon"), c) { | |
| var d = ne(a, Te), | |
| e = (e = a.get(ye)) || S; | |
| "image" == c ? H(b, d, e) : "xhr" == c && j(b, d, e) || "beacon" == c && x(b, d, e) || G(b, d, e) | |
| } else G(b, ne(a, Te), a.get(ye)); | |
| b = a.get(At), c = (b = K(b)).hitcount, b.hitcount = c ? c + 1 : 1, b = a.get(At), delete K(b).pending_experiments, a.set(ye, S, !0) | |
| } | |
| function Hc(a) { | |
| (D.gaData = D.gaData || {}).expId && a.set(Ze, (D.gaData = D.gaData || {}).expId), (D.gaData = D.gaData || {}).expVar && a.set(et, (D.gaData = D.gaData || {}).expVar); | |
| var b, c = a.get(At); | |
| if (c = K(c).pending_experiments) { | |
| var d = []; | |
| for (b in c) c.hasOwnProperty(b) && c[b] && d.push(encodeURIComponent(b) + "." + encodeURIComponent(c[b])); | |
| b = d.join("!") | |
| } else b = void 0; | |
| b && a.set(tt, b, !0) | |
| } | |
| function cd() { | |
| if (D.navigator && "preview" == D.navigator.loadPurpose) throw "abort" | |
| } | |
| function yd(a) { | |
| var b = D.gaDevIds; | |
| h(b) && 0 != b.length && a.set("&did", b.join(","), !0) | |
| } | |
| function vb(a) { | |
| if (!a.get(At)) throw "abort" | |
| } | |
| function Ta(a) { | |
| var b = oe(a, ot); | |
| if (500 <= b && J(15), "transaction" != (c = ne(a, fe)) && "item" != c) { | |
| var c = oe(a, rt), | |
| d = (new Date).getTime(), | |
| e = oe(a, at); | |
| if (0 == e && a.set(at, d), 0 < (e = Math.round(2 * (d - e) / 1e3)) && (c = Math.min(c + e, 20), a.set(at, d)), 0 >= c) throw "abort"; | |
| a.set(rt, --c) | |
| } | |
| a.set(ot, ++b) | |
| } | |
| function X(a, b, c, d) { | |
| b[a] = function() { | |
| try { | |
| return d && J(d), c.apply(this, arguments) | |
| } catch (t) { | |
| throw Y("exc", a, t && t.name), t | |
| } | |
| } | |
| } | |
| function fc() { | |
| var a, b, c; | |
| if ((c = (c = D.navigator) ? c.plugins : null) && c.length) | |
| for (var d = 0; d < c.length && !b; d++) { | |
| var e = c[d]; - 1 < e.name.indexOf("Shockwave Flash") && (b = e.description) | |
| } | |
| if (!b) try { | |
| b = (a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")).GetVariable("$version") | |
| } catch (t) {} | |
| if (!b) try { | |
| b = "WIN 6,0,21,0", (a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6")).AllowScriptAccess = "always", b = a.GetVariable("$version") | |
| } catch (t) {} | |
| if (!b) try { | |
| b = (a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version") | |
| } catch (t) {} | |
| return b && (a = b.match(/[\d]+/g)) && 3 <= a.length && (b = a[0] + "." + a[1] + " r" + a[2]), b || void 0 | |
| } | |
| function Xc(a, b, c) { | |
| "none" == b && (b = ""); | |
| var d = [], | |
| e = M(a); | |
| a = "__utma" == a ? 6 : 2; | |
| for (var t = 0; t < e.length; t++) { | |
| var i = ("" + e[t]).split("."); | |
| i.length >= a && d.push({ | |
| hash: i[0], | |
| R: e[t], | |
| O: i | |
| }) | |
| } | |
| if (0 != d.length) return 1 == d.length ? d[0] : Zc(b, d) || Zc(c, d) || Zc(null, d) || d[0] | |
| } | |
| function Zc(a, b) { | |
| var c, d; | |
| null == a ? c = d = 1 : (c = La(a), d = La(m(a, ".") ? a.substring(1) : "." + a)); | |
| for (var e = 0; e < b.length; e++) | |
| if (b[e].hash == c || b[e].hash == d) return b[e] | |
| } | |
| function Ic(a, b) { | |
| for (var c = new Date, e = (d = D.navigator).plugins || [], c = [a, d.userAgent, c.getTimezoneOffset(), c.getYear(), c.getDate(), c.getHours(), c.getMinutes() + b], d = 0; d < e.length; ++d) c.push(e[d].description); | |
| return La(c.join(".")) | |
| } | |
| function sd(a, b) { | |
| if (b == N.location.hostname) return !1; | |
| for (var c = 0; c < a.length; c++) | |
| if (a[c] instanceof RegExp) { | |
| if (a[c].test(b)) return !0 | |
| } else if (0 <= b.indexOf(a[c])) return !0; | |
| return !1 | |
| } | |
| function ud(a) { | |
| return 0 <= a.indexOf(".") || 0 <= a.indexOf(":") | |
| } | |
| function La(a) { | |
| var c, d, b = 1; | |
| if (a) | |
| for (b = 0, d = a.length - 1; 0 <= d; d--) c = a.charCodeAt(d), b = (b << 6 & 268435455) + c + (c << 14), c = 266338304 & b, b = 0 != c ? b ^ c >> 21 : b; | |
| return b | |
| } | |
| var t = function(a) { | |
| this.w = a || [] | |
| }; | |
| t.prototype.set = function(a) { | |
| this.w[a] = !0 | |
| }, t.prototype.encode = function() { | |
| for (var a = [], b = 0; b < this.w.length; b++) this.w[b] && (a[Math.floor(b / 6)] ^= 1 << b % 6); | |
| for (b = 0; b < a.length; b++) a[b] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(a[b] || 0); | |
| return a.join("") + "~" | |
| }; | |
| var i = new t, | |
| s = function(a, b) { | |
| var c = new t(l(a)); | |
| c.set(b), a.set(ct, c.w) | |
| }, | |
| o = function(a) { | |
| a = l(a), a = new t(a); | |
| for (var b = i.w.slice(), c = 0; c < a.w.length; c++) b[c] = b[c] || a.w[c]; | |
| return new t(b).encode() | |
| }, | |
| l = function(a) { | |
| return a = a.get(ct), h(a) || (a = []), a | |
| }, | |
| u = function(a) { | |
| return "function" == typeof a | |
| }, | |
| h = function(a) { | |
| return "[object Array]" == Object.prototype.toString.call(Object(a)) | |
| }, | |
| p = function(a) { | |
| return void 0 != a && -1 < (a.constructor + "").indexOf("String") | |
| }, | |
| m = function(a, b) { | |
| return 0 == a.indexOf(b) | |
| }, | |
| _ = function(a) { | |
| return a ? a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, "") : "" | |
| }, | |
| g = function(a) { | |
| var b = N.createElement("img"); | |
| return b.width = 1, b.height = 1, b.src = a, b | |
| }, | |
| S = function() {}, | |
| T = function(a) { | |
| return encodeURIComponent instanceof Function ? encodeURIComponent(a) : (J(28), a) | |
| }, | |
| v = function(a, b, c, d) { | |
| try { | |
| a.addEventListener ? a.addEventListener(b, c, !!d) : a.attachEvent && a.attachEvent("on" + b, c) | |
| } catch (t) { | |
| J(27) | |
| } | |
| }, | |
| f = /^[\w\-:/.?=&%!]+$/, | |
| C = function(a, b, c) { | |
| a && (c ? (c = "", b && f.test(b) && (c = ' id="' + b + '"'), f.test(a) && N.write("<script" + c + ' src="' + a + '"><\/script>')) : (c = N.createElement("script"), c.type = "text/javascript", c.async = !0, c.src = a, b && (c.id = b), (a = N.getElementsByTagName("script")[0]).parentNode.insertBefore(c, a))) | |
| }, | |
| I = function() { | |
| return "https:" == N.location.protocol | |
| }, | |
| E = function(a, b) { | |
| var c = a.match("(?:&|#|\\?)" + T(b).replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1") + "=([^&#]*)"); | |
| return c && 2 == c.length ? c[1] : "" | |
| }, | |
| L = function() { | |
| var a = "" + N.location.hostname; | |
| return 0 == a.indexOf("www.") ? a.substring(4) : a | |
| }, | |
| A = function(a) { | |
| var b = N.referrer; | |
| if (/^https?:\/\//i.test(b)) { | |
| if (a) return b; | |
| a = "//" + N.location.hostname; | |
| var c = b.indexOf(a); | |
| if (!(5 != c && 6 != c || "/" != (a = b.charAt(c + a.length)) && "?" != a && "" != a && ":" != a)) return; | |
| return b | |
| } | |
| }, | |
| R = function(a, b) { | |
| if (1 == b.length && null != b[0] && "object" == typeof b[0]) return b[0]; | |
| for (var c = {}, d = Math.min(a.length + 1, b.length), e = 0; e < d; e++) { | |
| if ("object" == typeof b[e]) { | |
| for (var t in b[e]) b[e].hasOwnProperty(t) && (c[t] = b[e][t]); | |
| break | |
| } | |
| e < a.length && (c[a[e]] = b[e]) | |
| } | |
| return c | |
| }, | |
| P = function() { | |
| this.keys = [], this.values = {}, this.m = {} | |
| }; | |
| P.prototype.set = function(a, b, c) { | |
| this.keys.push(a), c ? this.m[":" + a] = b : this.values[":" + a] = b | |
| }, P.prototype.get = function(a) { | |
| return this.m.hasOwnProperty(":" + a) ? this.m[":" + a] : this.values[":" + a] | |
| }, P.prototype.map = function(a) { | |
| for (var b = 0; b < this.keys.length; b++) { | |
| var c = this.keys[b], | |
| d = this.get(c); | |
| d && a(c, d) | |
| } | |
| }; | |
| var D = window, | |
| N = document, | |
| O = window, | |
| B = function(a) { | |
| var b = O._gaUserPrefs; | |
| if (b && b.ioo && b.ioo() || a && !0 === O["ga-disable-" + a]) return !0; | |
| try { | |
| var c = O.external; | |
| if (c && c._gaUserPrefs && "oo" == c._gaUserPrefs) return !0 | |
| } catch (t) {} | |
| return !1 | |
| }, | |
| M = function(a) { | |
| var b = [], | |
| c = N.cookie.split(";"); | |
| a = new RegExp("^\\s*" + a + "=\\s*(.*?)\\s*$"); | |
| for (var d = 0; d < c.length; d++) { | |
| var e = c[d].match(a); | |
| e && b.push(e[1]) | |
| } | |
| return b | |
| }, | |
| U = function(a, b, c, d, e, t) { | |
| if (!(e = !B(e) && !(q.test(N.location.hostname) || "/" == c && k.test(d)))) return !1; | |
| if (b && 1200 < b.length && (b = b.substring(0, 1200), J(24)), c = a + "=" + b + "; path=" + c + "; ", t && (c += "expires=" + new Date((new Date).getTime() + t).toGMTString() + "; "), d && "none" != d && (c += "domain=" + d + ";"), d = N.cookie, N.cookie = c, !(d = d != N.cookie)) e: { | |
| for (a = M(a), d = 0; d < a.length; d++) | |
| if (b == a[d]) { | |
| d = !0; | |
| break e | |
| } | |
| d = !1 | |
| } | |
| return d | |
| }, | |
| F = function(a) { | |
| return T(a).replace(/\(/g, "%28").replace(/\)/g, "%29") | |
| }, | |
| k = /^(www\.)?google(\.com?)?(\.[a-z]{2})?$/, | |
| q = /(^|\.)doubleclick\.net$/i, | |
| V = function() { | |
| return (me || I() ? "https:" : "http:") + "//www.google-analytics.com" | |
| }, | |
| $ = function(a) { | |
| this.name = "len", this.message = a + "-8192" | |
| }, | |
| G = function(a, b, c) { | |
| if (c = c || S, 2036 >= b.length) H(a, b, c); | |
| else { | |
| if (!(8192 >= b.length)) throw Y("len", b.length), new $(b.length); | |
| x(a, b, c) || j(a, b, c) || H(a, b, c) | |
| } | |
| }, | |
| H = function(a, b, c) { | |
| var d = g(a + "?" + b); | |
| d.onload = d.onerror = function() { | |
| d.onload = null, d.onerror = null, c() | |
| } | |
| }, | |
| j = function(a, b, c) { | |
| var d = D.XMLHttpRequest; | |
| if (!d) return !1; | |
| var e = new d; | |
| return "withCredentials" in e && (e.open("POST", a, !0), e.withCredentials = !0, e.setRequestHeader("Content-Type", "text/plain"), e.onreadystatechange = function() { | |
| 4 == e.readyState && (c(), e = null) | |
| }, e.send(b), !0) | |
| }, | |
| x = function(a, b, c) { | |
| return !!D.navigator.sendBeacon && (!!D.navigator.sendBeacon(a, b) && (c(), !0)) | |
| }, | |
| Y = function(a, b, c) { | |
| 1 <= 100 * Math.random() || B("?") || (a = ["t=error", "_e=" + a, "_v=j47", "sr=1"], b && a.push("_f=" + b), c && a.push("_m=" + T(c.substring(0, 100))), a.push("aip=1"), a.push("z=" + Z()), H(V() + "/collect", a.join("&"), S)) | |
| }, | |
| K = function(a) { | |
| var b = D.gaData = D.gaData || {}; | |
| return b[a] = b[a] || {} | |
| }, | |
| W = function() { | |
| this.M = [] | |
| }; | |
| W.prototype.add = function(a) { | |
| this.M.push(a) | |
| }, W.prototype.D = function(a) { | |
| try { | |
| for (var b = 0; b < this.M.length; b++) { | |
| var c = a.get(this.M[b]); | |
| c && u(c) && c.call(D, a) | |
| } | |
| } catch (t) {}(b = a.get(ye)) != S && u(b) && (a.set(ye, S, !0), setTimeout(b, 10)) | |
| }; | |
| var Z = function() { | |
| return Math.round(2147483647 * Math.random()) | |
| }, | |
| ee = function() { | |
| try { | |
| var a = new Uint32Array(1); | |
| return D.crypto.getRandomValues(a), 2147483647 & a[0] | |
| } catch (t) { | |
| return Z() | |
| } | |
| }, | |
| te = function() { | |
| this.data = new P | |
| }, | |
| ie = new P, | |
| se = []; | |
| te.prototype.get = function(a) { | |
| var b = le(a), | |
| c = this.data.get(a); | |
| return b && void 0 == c && (c = u(b.defaultValue) ? b.defaultValue() : b.defaultValue), b && b.Z ? b.Z(this, a, c) : c | |
| }; | |
| var ne = function(a, b) { | |
| var c = a.get(b); | |
| return void 0 == c ? "" : "" + c | |
| }, | |
| oe = function(a, b) { | |
| var c = a.get(b); | |
| return void 0 == c || "" === c ? 0 : 1 * c | |
| }; | |
| te.prototype.set = function(a, b, c) { | |
| if (a) | |
| if ("object" == typeof a) | |
| for (var d in a) a.hasOwnProperty(d) && ae(this, d, a[d], c); | |
| else ae(this, a, b, c) | |
| }; | |
| var ae = function(a, b, c, d) { | |
| if (void 0 != c) switch (b) { | |
| case At: | |
| Ii.test(c) | |
| } | |
| var e = le(b); | |
| e && e.o ? e.o(a, b, c, d) : a.data.set(b, c, d) | |
| }, | |
| re = function(a, b, c, d, e) { | |
| this.name = a, this.F = b, this.Z = d, this.o = e, this.defaultValue = c | |
| }, | |
| le = function(a) { | |
| var b = ie.get(a); | |
| if (!b) | |
| for (var c = 0; c < se.length; c++) { | |
| var d = se[c], | |
| e = d[0].exec(a); | |
| if (e) { | |
| b = d[1](e), ie.set(b.name, b); | |
| break | |
| } | |
| } | |
| return b | |
| }, | |
| ce = function(a) { | |
| var b; | |
| return ie.map(function(c, d) { | |
| d.F == a && (b = d) | |
| }), b && b.name | |
| }, | |
| ue = function(a, b, c, d, e) { | |
| return a = new re(a, b, c, d, e), ie.set(a.name, a), a.name | |
| }, | |
| de = function(a, b) { | |
| se.push([new RegExp("^" + a + "$"), b]) | |
| }, | |
| he = function(a, b, c) { | |
| return ue(a, b, c, void 0, db) | |
| }, | |
| db = function() {}, | |
| pe = p(window.GoogleAnalyticsObject) && _(window.GoogleAnalyticsObject) || "ga", | |
| me = !1, | |
| _e = he("apiVersion", "v"), | |
| ge = he("clientVersion", "_v"); | |
| ue("anonymizeIp", "aip"); | |
| var Se = ue("adSenseId", "a"), | |
| fe = ue("hitType", "t"), | |
| ye = ue("hitCallback"), | |
| Te = ue("hitPayload"); | |
| ue("nonInteraction", "ni"), ue("currencyCode", "cu"), ue("dataSource", "ds"); | |
| var ve = ue("useBeacon", void 0, !1), | |
| Ce = ue("transport"); | |
| ue("sessionControl", "sc", ""), ue("sessionGroup", "sg"), ue("queueTime", "qt"); | |
| var Ee = ue("_s", "_s"); | |
| ue("screenName", "cd"); | |
| var be = ue("location", "dl", ""), | |
| Ie = ue("referrer", "dr"), | |
| we = ue("page", "dp", ""); | |
| ue("hostname", "dh"); | |
| var Le = ue("language", "ul"), | |
| Ae = ue("encoding", "de"); | |
| ue("title", "dt", function() { | |
| return N.title || void 0 | |
| }), de("contentGroup([0-9]+)", function(a) { | |
| return new re(a[0], "cg" + a[1]) | |
| }); | |
| var Re = ue("screenColors", "sd"), | |
| Pe = ue("screenResolution", "sr"), | |
| De = ue("viewportSize", "vp"), | |
| Ne = ue("javaEnabled", "je"), | |
| Oe = ue("flashVersion", "fl"); | |
| ue("campaignId", "ci"), ue("campaignName", "cn"), ue("campaignSource", "cs"), ue("campaignMedium", "cm"), ue("campaignKeyword", "ck"), ue("campaignContent", "cc"); | |
| var Be = ue("eventCategory", "ec"), | |
| Me = ue("eventAction", "ea"), | |
| Ue = ue("eventLabel", "el"), | |
| Fe = ue("eventValue", "ev"), | |
| ke = ue("socialNetwork", "sn"), | |
| qe = ue("socialAction", "sa"), | |
| Ve = ue("socialTarget", "st"), | |
| xe = ue("l1", "plt"), | |
| $e = ue("l2", "pdt"), | |
| Ge = ue("l3", "dns"), | |
| He = ue("l4", "rrt"), | |
| je = ue("l5", "srt"), | |
| ze = ue("l6", "tcp"), | |
| Ye = ue("l7", "dit"), | |
| Ke = ue("l8", "clt"), | |
| We = ue("timingCategory", "utc"), | |
| Je = ue("timingVar", "utv"), | |
| Qe = ue("timingLabel", "utl"), | |
| Xe = ue("timingValue", "utt"); | |
| ue("appName", "an"), ue("appVersion", "av", ""), ue("appId", "aid", ""), ue("appInstallerId", "aiid", ""), ue("exDescription", "exd"), ue("exFatal", "exf"); | |
| var Ze = ue("expId", "xid"), | |
| et = ue("expVar", "xvar"), | |
| tt = ue("exp", "exp"), | |
| it = ue("_utma", "_utma"), | |
| st = ue("_utmz", "_utmz"), | |
| nt = ue("_utmht", "_utmht"), | |
| ot = ue("_hc", void 0, 0), | |
| at = ue("_ti", void 0, 0), | |
| rt = ue("_to", void 0, 20); | |
| de("dimension([0-9]+)", function(a) { | |
| return new re(a[0], "cd" + a[1]) | |
| }), de("metric([0-9]+)", function(a) { | |
| return new re(a[0], "cm" + a[1]) | |
| }), ue("linkerParam", void 0, void 0, function Bc(a) { | |
| var b = Ic(a = a.get(Q), 0); | |
| return "_ga=1." + T(b + "." + a) | |
| }, db); | |
| var lt = ue("usage", "_u"), | |
| ct = ue("_um"); | |
| ue("forceSSL", void 0, void 0, function() { | |
| return me | |
| }, function(a, b, c) { | |
| J(34), me = !!c | |
| }); | |
| var ut = ue("_j1", "jid"); | |
| de("\\&(.*)", function(a) { | |
| var b = new re(a[0], a[1]), | |
| c = ce(a[0].substring(1)); | |
| return c && (b.Z = function(a) { | |
| return a.get(c) | |
| }, b.o = function(a, b, t, i) { | |
| a.set(c, t, i) | |
| }, b.F = void 0), b | |
| }); | |
| var dt = he("_oot"), | |
| ht = ue("previewTask"), | |
| pt = ue("checkProtocolTask"), | |
| _t = ue("validationTask"), | |
| gt = ue("checkStorageTask"), | |
| St = ue("historyImportTask"), | |
| ft = ue("samplerTask"), | |
| yt = ue("_rlt"), | |
| Tt = ue("buildHitTask"), | |
| vt = ue("sendHitTask"), | |
| Ct = ue("ceTask"), | |
| Et = ue("devIdTask"), | |
| bt = ue("timingTask"), | |
| It = ue("displayFeaturesTask"), | |
| wt = he("name"), | |
| Q = he("clientId", "cid"), | |
| n = he("clientIdTime"), | |
| Lt = ue("userId", "uid"), | |
| At = he("trackingId", "tid"), | |
| Rt = he("cookieName", void 0, "_ga"), | |
| Pt = he("cookieDomain"), | |
| Dt = he("cookiePath", void 0, "/"), | |
| Nt = he("cookieExpires", void 0, 63072e3), | |
| Ot = he("legacyCookieDomain"), | |
| Bt = he("legacyHistoryImport", void 0, !0), | |
| Mt = he("storage", void 0, "cookie"), | |
| Ut = he("allowLinker", void 0, !1), | |
| Ft = he("allowAnchor", void 0, !0), | |
| kt = he("sampleRate", "sf", 100), | |
| qt = he("siteSpeedSampleRate", void 0, 1), | |
| Vt = he("alwaysSendReferrer", void 0, !1), | |
| xt = ue("transportUrl"), | |
| $t = ue("_r", "_r"), | |
| Gt = function(a) { | |
| this.V = a, this.fa = void 0, this.$ = !1, this.oa = void 0, this.ea = 1 | |
| }, | |
| Ht = function(a, b) { | |
| var c; | |
| if (a.fa && a.$) return 0; | |
| if (a.$ = !0, b) { | |
| if (a.oa && oe(b, a.oa)) return oe(b, a.oa); | |
| if (0 == b.get(qt)) return 0 | |
| } | |
| return 0 == a.V ? 0 : (void 0 === c && (c = ee()), 0 == c % a.V ? Math.floor(c / a.V) % a.ea + 1 : 0) | |
| }, | |
| jt = function(a) { | |
| var b = Math.min(oe(a, qt), 100); | |
| return !(La(ne(a, Q)) % 100 >= b) | |
| }, | |
| zt = function(a) { | |
| var b = {}; | |
| if (Yt(b) || Kt(b)) { | |
| var c = b[xe]; | |
| void 0 == c || 1 / 0 == c || isNaN(c) || (0 < c ? (Wt(b, Ge), Wt(b, ze), Wt(b, je), Wt(b, $e), Wt(b, He), Wt(b, Ye), Wt(b, Ke), a(b)) : v(D, "load", function() { | |
| zt(a) | |
| }, !1)) | |
| } | |
| }, | |
| Yt = function(a) { | |
| var b = D.performance || D.webkitPerformance; | |
| if (!(b = b && b.timing)) return !1; | |
| var c = b.navigationStart; | |
| return 0 != c && (a[xe] = b.loadEventStart - c, a[Ge] = b.domainLookupEnd - b.domainLookupStart, a[ze] = b.connectEnd - b.connectStart, a[je] = b.responseStart - b.requestStart, a[$e] = b.responseEnd - b.responseStart, a[He] = b.fetchStart - c, a[Ye] = b.domInteractive - c, a[Ke] = b.domContentLoadedEventStart - c, !0) | |
| }, | |
| Kt = function(a) { | |
| if (D.top != D) return !1; | |
| var b = D.external, | |
| c = b && b.onloadT; | |
| return b && !b.isValidLoadTime && (c = void 0), 2147483648 < c && (c = void 0), 0 < c && b.setPageReadyTime(), void 0 != c && (a[xe] = c, !0) | |
| }, | |
| Wt = function(a, b) { | |
| var c = a[b]; | |
| (isNaN(c) || 1 / 0 == c || 0 > c) && (a[b] = void 0) | |
| }, | |
| Jt = function(a) { | |
| return function(b) { | |
| if ("pageview" == b.get(fe) && !a.I) { | |
| a.I = !0; | |
| var c = jt(b); | |
| b = 0 < E(b.get(be), "gclid").length, (c || b) && zt(function(b) { | |
| a.send(c ? "timing" : "adtiming", b) | |
| }) | |
| } | |
| } | |
| }, | |
| Qt = !1, | |
| Xt = function(a) { | |
| if ("cookie" == ne(a, Mt)) { | |
| var b = ne(a, Rt), | |
| c = ti(a), | |
| d = ni(ne(a, Dt)), | |
| e = si(ne(a, Pt)), | |
| t = 1e3 * oe(a, Nt), | |
| i = ne(a, At); | |
| if ("auto" != e) U(b, c, d, e, i, t) && (Qt = !0); | |
| else { | |
| J(32); | |
| var s; | |
| if (c = [], 4 != (e = L().split(".")).length || (s = e[e.length - 1], parseInt(s, 10) != s)) { | |
| for (s = e.length - 2; 0 <= s; s--) c.push(e.slice(s).join(".")); | |
| c.push("none"), s = c | |
| } else s = ["none"]; | |
| for (var o = 0; o < s.length; o++) | |
| if (e = s[o], a.data.set(Pt, e), c = ti(a), U(b, c, d, e, i, t)) return void(Qt = !0); | |
| a.data.set(Pt, "auto") | |
| } | |
| } | |
| }, | |
| Zt = function(a) { | |
| if ("cookie" == ne(a, Mt) && !Qt && (Xt(a), !Qt)) throw "abort" | |
| }, | |
| ei = function(a) { | |
| if (a.get(Bt)) { | |
| var b = ne(a, Pt), | |
| c = ne(a, Ot) || L(), | |
| d = Xc("__utma", c, b); | |
| d && (J(19), a.set(nt, (new Date).getTime(), !0), a.set(it, d.R), (b = Xc("__utmz", c, b)) && d.hash == b.hash && a.set(st, b.R)) | |
| } | |
| }, | |
| ti = function(a) { | |
| var b = F(ne(a, Q)), | |
| c = si(ne(a, Pt)).split(".").length; | |
| return 1 < (a = oi(ne(a, Dt))) && (c += "-" + a), ["GA1", c, b].join(".") | |
| }, | |
| ii = function(a, b, c) { | |
| for (var t, d = [], e = [], i = 0; i < a.length; i++) { | |
| var s = a[i]; | |
| s.H[c] == b ? d.push(s) : void 0 == t || s.H[c] < t ? (e = [s], t = s.H[c]) : s.H[c] == t && e.push(s) | |
| } | |
| return 0 < d.length ? d : e | |
| }, | |
| si = function(a) { | |
| return 0 == a.indexOf(".") ? a.substr(1) : a | |
| }, | |
| ni = function(a) { | |
| return a ? (1 < a.length && a.lastIndexOf("/") == a.length - 1 && (a = a.substr(0, a.length - 1)), 0 != a.indexOf("/") && (a = "/" + a), a) : "/" | |
| }, | |
| oi = function(a) { | |
| return "/" == (a = ni(a)) ? 1 : a.split("/").length | |
| }, | |
| ai = new RegExp(/^https?:\/\/([^\/:]+)/), | |
| ri = /(.*)([?&#])(?:_ga=[^&#]*)(?:&?)(.*)/, | |
| li = function(a) { | |
| J(48), this.target = a, this.T = !1 | |
| }; | |
| li.prototype.ca = function(a, b) { | |
| if (a.tagName) { | |
| if ("a" == a.tagName.toLowerCase()) return void(a.href && (a.href = ci(this, a.href, b))); | |
| if ("form" == a.tagName.toLowerCase()) return ui(this, a) | |
| } | |
| if ("string" == typeof a) return ci(this, a, b) | |
| }; | |
| var ci = function(a, b, c) { | |
| (d = ri.exec(b)) && 3 <= d.length && (b = d[1] + (d[3] ? d[2] + d[3] : "")), a = a.target.get("linkerParam"); | |
| var e = b.indexOf("?"), | |
| d = b.indexOf("#"); | |
| return c ? b += (-1 == d ? "#" : "&") + a : (c = -1 == e ? "?" : "&", b = -1 == d ? b + (c + a) : b.substring(0, d) + c + a + b.substring(d)), b = b.replace(/&+_ga=/, "&_ga=") | |
| }, | |
| ui = function(a, b) { | |
| if (b && b.action) { | |
| var c = a.target.get("linkerParam").split("=")[1]; | |
| if ("get" == b.method.toLowerCase()) { | |
| for (var d = b.childNodes || [], e = 0; e < d.length; e++) | |
| if ("_ga" == d[e].name) return void d[e].setAttribute("value", c); | |
| (d = N.createElement("input")).setAttribute("type", "hidden"), d.setAttribute("name", "_ga"), d.setAttribute("value", c), b.appendChild(d) | |
| } else "post" == b.method.toLowerCase() && (b.action = ci(a, b.action)) | |
| } | |
| }; | |
| li.prototype.S = function(a, b, c) { | |
| function d(c) { | |
| try { | |
| var d; | |
| e: { | |
| var t = (c = c || D.event).target || c.srcElement; | |
| for (c = 100; t && 0 < c;) { | |
| if (t.href && t.nodeName.match(/^a(?:rea)?$/i)) { | |
| d = t; | |
| break e | |
| } | |
| t = t.parentNode, c-- | |
| } | |
| d = {} | |
| }("http:" == d.protocol || "https:" == d.protocol) && sd(a, d.hostname || "") && d.href && (d.href = ci(e, d.href, b)) | |
| } catch (t) { | |
| J(26) | |
| } | |
| } | |
| var e = this; | |
| this.T || (this.T = !0, v(N, "mousedown", d, !1), v(N, "keyup", d, !1)), c && v(N, "submit", function(b) { | |
| if (b = b || D.event, (b = b.target || b.srcElement) && b.action) { | |
| var c = b.action.match(ai); | |
| c && sd(a, c[1]) && ui(e, b) | |
| } | |
| }) | |
| }; | |
| var di, hi = /^(GTM|OPT)-[A-Z0-9]+$/, | |
| pi = /;_gaexp=[^;]*/g, | |
| r = /;((__utma=)|([^;=]+=GAX?\d+\.))[^;]*/g, | |
| mi = function(a) { | |
| function b(a, b) { | |
| b && (c += "&" + a + "=" + T(b)) | |
| } | |
| var c = "https://www.google-analytics.com/gtm/js?id=" + T(a.id); | |
| return "dataLayer" != a.B && b("l", a.B), b("t", a.target), b("cid", a.ja), b("cidt", a.ka), b("gac", a.la), b("aip", a.ia), a.na && b("m", "sync"), b("cycle", a.G), c | |
| }, | |
| _i = function(a, b, c) { | |
| this.U = ut, this.aa = b, (b = c) || (b = (b = ne(a, wt)) && "t0" != b ? Ti.test(b) ? "_gat_" + F(ne(a, At)) : "_gat_" + F(b) : "_gat"), this.Y = b, Ht(new Gt(100), a) && (J(30), this.pa = !0) | |
| }, | |
| gi = function(a, b) { | |
| var c = b.get(Tt); | |
| b.set(Tt, function(b) { | |
| Si(a, b); | |
| var d = c(b); | |
| return fi(a, b), d | |
| }); | |
| var d = b.get(vt); | |
| b.set(vt, function(b) { | |
| var c = d(b); | |
| return yi(a, b), c | |
| }) | |
| }, | |
| Si = function(a, b) { | |
| b.get(a.U) || ("1" == M(a.Y)[0] ? b.set(a.U, "", !0) : b.set(a.U, "" + Z(), !0)) | |
| }, | |
| fi = function(a, b) { | |
| if (b.get(a.U)) { | |
| var c = 6e5; | |
| a.pa && (c /= 10), U(a.Y, "1", b.get(Dt), b.get(Pt), b.get(At), c) | |
| } | |
| }, | |
| yi = function(a, b) { | |
| if (b.get(a.U)) { | |
| var c = new P, | |
| d = function(a) { | |
| le(a).F && c.set(le(a).F, b.get(a)) | |
| }; | |
| d(_e), d(ge), d(At), d(Q), d(Lt), d(a.U), c.set(le(lt).F, o(b)); | |
| var e = a.aa; | |
| c.map(function(a, b) { | |
| e += T(a) + "=", e += T("" + b) + "&" | |
| }), e += "z=" + Z(), g(e), b.set(a.U, "", !0) | |
| } | |
| }, | |
| Ti = /^gtm\d+$/, | |
| vi = function(a, b) { | |
| var c = a.b; | |
| if (!c.get("dcLoaded")) { | |
| s(c, 29); | |
| var d; | |
| (b = b || {})[Rt] && (d = F(b[Rt])), d = new _i(c, "https://stats.g.doubleclick.net/r/collect?t=dc&aip=1&_r=3&", d), gi(d, c), c.set("dcLoaded", !0) | |
| } | |
| }, | |
| Ci = function(a) { | |
| if (!a.get("dcLoaded") && "cookie" == a.get(Mt)) { | |
| s(a, 51); | |
| var b = new _i(a); | |
| Si(b, a), fi(b, a), a.get(b.U) && (a.set($t, 1, !0), a.set(xt, V() + "/r/collect", !0)) | |
| } | |
| }, | |
| Ei = function() { | |
| var a = D.gaGlobal = D.gaGlobal || {}; | |
| return a.hid = a.hid || Z() | |
| }, | |
| bi = function(a, b, c) { | |
| if (!di) { | |
| var d; | |
| d = N.location.hash; | |
| var e = D.name, | |
| t = /^#?gaso=([^&]*)/; | |
| (e = (d = (d = d && d.match(t) || e && e.match(t)) ? d[1] : M("GASO")[0] || "") && d.match(/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i)) && (U("GASO", "" + d, c, b, a, 0), window._udo || (window._udo = b), window._utcp || (window._utcp = c), a = e[1], C("https://www.google.com/analytics/web/inpage/pub/inpage.js?" + (a ? "prefix=" + a + "&" : "") + Z(), "_gasojs")), di = !0 | |
| } | |
| }, | |
| Ii = /^(UA|YT|MO|GP)-(\d+)-(\d+)$/, | |
| wi = function(a) { | |
| function b(a, b) { | |
| d.b.data.set(a, b) | |
| } | |
| function c(a, c) { | |
| b(a, c), d.filters.add(a) | |
| } | |
| var d = this; | |
| this.b = new te, this.filters = new W, b(wt, a[wt]), b(At, _(a[At])), b(Rt, a[Rt]), b(Pt, a[Pt] || L()), b(Dt, a[Dt]), b(Nt, a[Nt]), b(Ot, a[Ot]), b(Bt, a[Bt]), b(Ut, a[Ut]), b(Ft, a[Ft]), b(kt, a[kt]), b(qt, a[qt]), b(Vt, a[Vt]), b(Mt, a[Mt]), b(Lt, a[Lt]), b(n, a[n]), b(_e, 1), b(ge, "j47"), c(dt, Ma), c(ht, cd), c(pt, Oa), c(_t, vb), c(gt, Zt), c(St, ei), c(ft, Ja), c(yt, Ta), c(Ct, Hc), c(Et, yd), c(It, Ci), c(Tt, Pa), c(vt, Sa), c(bt, Jt(this)), Li(this.b, a[Q]), Ai(this.b), this.b.set(Se, Ei()), bi(this.b.get(At), this.b.get(Pt), this.b.get(Dt)) | |
| }, | |
| Li = function(a, b) { | |
| if ("cookie" == ne(a, Mt)) { | |
| Qt = !1; | |
| var c; | |
| e: { | |
| var d = M(ne(a, Rt)); | |
| if (d && !(1 > d.length)) { | |
| c = []; | |
| for (var e = 0; e < d.length; e++) { | |
| var t, i = (t = d[e].split(".")).shift(); | |
| ("GA1" == i || "1" == i) && 1 < t.length ? (1 == (i = t.shift().split("-")).length && (i[1] = "1"), i[0] *= 1, i[1] *= 1, t = { | |
| H: i, | |
| s: t.join(".") | |
| }) : t = void 0, t && c.push(t) | |
| } | |
| if (1 == c.length) { | |
| J(13), c = c[0].s; | |
| break e | |
| } | |
| if (0 != c.length) { | |
| if (J(14), d = si(ne(a, Pt)).split(".").length, 1 == (c = ii(c, d, 0)).length) { | |
| c = c[0].s; | |
| break e | |
| } | |
| d = oi(ne(a, Dt)), c = (c = ii(c, d, 1))[0] && c[0].s; | |
| break e | |
| } | |
| J(12) | |
| } | |
| c = void 0 | |
| } | |
| c || (c = ne(a, Pt), d = ne(a, Ot) || L(), void 0 != (c = Xc("__utma", d, c)) ? (J(10), c = c.O[1] + "." + c.O[2]) : c = void 0), c && (a.data.set(Q, c), Qt = !0) | |
| } | |
| if (c = a.get(Ft), (e = E(N.location[c ? "href" : "search"], "_ga")) && (a.get(Ut) ? -1 == (c = e.indexOf(".")) ? J(22) : (d = e.substring(c + 1), "1" != e.substring(0, c) ? J(22) : -1 == (c = d.indexOf(".")) ? J(22) : (e = d.substring(0, c), c = d.substring(c + 1), e != Ic(c, 0) && e != Ic(c, -1) && e != Ic(c, -2) ? J(23) : (J(11), a.data.set(Q, c)))) : J(21)), b && (J(9), a.data.set(Q, T(b))), !a.get(Q)) | |
| if (c = (c = D.gaGlobal && D.gaGlobal.vid) && -1 != c.search(/^(?:utma\.)?\d+\.\d+$/) ? c : void 0) J(17), a.data.set(Q, c); | |
| else { | |
| for (J(8), d = (c = D.navigator.userAgent + (N.cookie ? N.cookie : "") + (N.referrer ? N.referrer : "")).length, e = D.history.length; 0 < e;) c += e-- ^ d++; | |
| a.data.set(Q, [Z() ^ 2147483647 & La(c), Math.round((new Date).getTime() / 1e3)].join(".")) | |
| } | |
| Xt(a) | |
| }, | |
| Ai = function(a) { | |
| var b = D.navigator, | |
| c = D.screen, | |
| d = N.location; | |
| if (a.set(Ie, A(a.get(Vt))), d) { | |
| var e = d.pathname || ""; | |
| "/" != e.charAt(0) && (J(31), e = "/" + e), a.set(be, d.protocol + "//" + d.hostname + e + d.search) | |
| } | |
| c && a.set(Pe, c.width + "x" + c.height), c && a.set(Re, c.colorDepth + "-bit"); | |
| var c = N.documentElement, | |
| t = (e = N.body) && e.clientWidth && e.clientHeight, | |
| i = []; | |
| if (c && c.clientWidth && c.clientHeight && ("CSS1Compat" === N.compatMode || !t) ? i = [c.clientWidth, c.clientHeight] : t && (i = [e.clientWidth, e.clientHeight]), c = 0 >= i[0] || 0 >= i[1] ? "" : i.join("x"), a.set(De, c), a.set(Oe, fc()), a.set(Ae, N.characterSet || N.charset), a.set(Ne, b && "function" == typeof b.javaEnabled && b.javaEnabled() || !1), a.set(Le, (b && (b.language || b.browserLanguage) || "").toLowerCase()), d && a.get(Ft) && (b = N.location.hash)) { | |
| for (b = b.split(/[?&#]+/), d = [], c = 0; c < b.length; ++c)(m(b[c], "utm_id") || m(b[c], "utm_campaign") || m(b[c], "utm_source") || m(b[c], "utm_medium") || m(b[c], "utm_term") || m(b[c], "utm_content") || m(b[c], "gclid") || m(b[c], "dclid") || m(b[c], "gclsrc")) && d.push(b[c]); | |
| 0 < d.length && (b = "#" + d.join("&"), a.set(be, a.get(be) + b)) | |
| } | |
| }; | |
| wi.prototype.get = function(a) { | |
| return this.b.get(a) | |
| }, wi.prototype.set = function(a, b) { | |
| this.b.set(a, b) | |
| }; | |
| var Ri = { | |
| pageview: [we], | |
| event: [Be, Me, Ue, Fe], | |
| social: [ke, qe, Ve], | |
| timing: [We, Je, Xe, Qe] | |
| }; | |
| wi.prototype.send = function(a) { | |
| if (!(1 > arguments.length)) { | |
| var b, c; | |
| "string" == typeof arguments[0] ? (b = arguments[0], c = [].slice.call(arguments, 1)) : (b = arguments[0] && arguments[0][fe], c = arguments), b && (c = R(Ri[b] || [], c), c[fe] = b, this.b.set(c, void 0, !0), this.filters.D(this.b), this.b.data.m = {}) | |
| } | |
| }, wi.prototype.ma = function(a, b) { | |
| var c = this; | |
| Fi(a, c, b) || (ki(a, function() { | |
| Fi(a, c, b) | |
| }), y(String(c.get(wt)), a, void 0, b, !0)) | |
| }; | |
| var Pi, Di, Ni, Oi, Bi = function(a) { | |
| return "prerender" != N.visibilityState && (a(), !0) | |
| }, | |
| z = function(a) { | |
| if (!Bi(a)) { | |
| J(16); | |
| var b = !1, | |
| c = function() { | |
| if (!b && Bi(a)) { | |
| b = !0; | |
| var d = c, | |
| e = N; | |
| e.removeEventListener ? e.removeEventListener("visibilitychange", d, !1) : e.detachEvent && e.detachEvent("onvisibilitychange", d) | |
| } | |
| }; | |
| v(N, "visibilitychange", c) | |
| } | |
| }, | |
| Mi = /^(?:(\w+)\.)?(?:(\w+):)?(\w+)$/, | |
| Ui = function(a) { | |
| if (u(a[0])) this.u = a[0]; | |
| else { | |
| var b = Mi.exec(a[0]); | |
| if (null != b && 4 == b.length && (this.c = b[1] || "t0", this.K = b[2] || "", this.C = b[3], this.a = [].slice.call(a, 1), this.K || (this.A = "create" == this.C, this.i = "require" == this.C, this.g = "provide" == this.C, this.ba = "remove" == this.C), this.i && (3 <= this.a.length ? (this.X = this.a[1], this.W = this.a[2]) : this.a[1] && (p(this.a[1]) ? this.X = this.a[1] : this.W = this.a[1]))), b = a[1], a = a[2], !this.C) throw "abort"; | |
| if (this.i && (!p(b) || "" == b)) throw "abort"; | |
| if (this.g && (!p(b) || "" == b || !u(a))) throw "abort"; | |
| if (ud(this.c) || ud(this.K)) throw "abort"; | |
| if (this.g && "t0" != this.c) throw "abort" | |
| } | |
| }; | |
| Pi = new P, Ni = new P, Oi = new P, Di = { | |
| ec: 45, | |
| ecommerce: 46, | |
| linkid: 47 | |
| }; | |
| var Fi = function(a, b, c) { | |
| b == Gi || b.get(wt); | |
| var d = Pi.get(a); | |
| return !!u(d) && (b.plugins_ = b.plugins_ || new P, !!b.plugins_.get(a) || (b.plugins_.set(a, new d(b, c || {})), !0)) | |
| }, | |
| y = function(a, b, c, d, e) { | |
| if (!u(Pi.get(b)) && !Ni.get(b)) { | |
| if (Di.hasOwnProperty(b) && J(Di[b]), hi.test(b)) { | |
| if (J(52), !(a = Gi.j(a))) return !0; | |
| d = { | |
| id: b, | |
| B: (c = d || {}).dataLayer || "dataLayer", | |
| ia: !!a.get("anonymizeIp"), | |
| na: e, | |
| G: !1 | |
| }, a.get(">m") == b && (d.G = !0); | |
| var t = String(a.get("name")); | |
| "t0" != t && (d.target = t), B(String(a.get("trackingId"))) || (d.ja = String(a.get(Q)), d.ka = Number(a.get(n)), a = c.palindrome ? r : pi, a = (a = N.cookie.replace(/^|(; +)/g, ";").match(a)) ? a.sort().join("").substring(1) : void 0, d.la = a), a = d.B, c = (new Date).getTime(), D[a] = D[a] || [], c = { | |
| "gtm.start": c | |
| }, e || (c.event = "gtm.js"), D[a].push(c), c = mi(d) | |
| }!c && Di.hasOwnProperty(b) ? (J(39), c = b + ".js") : J(43), c && (c && 0 <= c.indexOf("/") || (c = (me || I() ? "https:" : "http:") + "//www.google-analytics.com/plugins/ua/" + c), d = xi(c), a = d.protocol, c = N.location.protocol, ("https:" == a || a == c || ("http:" != a ? 0 : "http:" == c)) && Vi(d) && (C(d.url, void 0, e), Ni.set(b, !0))) | |
| } | |
| }, | |
| ki = function(a, b) { | |
| var c = Oi.get(a) || []; | |
| c.push(b), Oi.set(a, c) | |
| }, | |
| qi = function(a, b) { | |
| Pi.set(a, b); | |
| for (var c = Oi.get(a) || [], d = 0; d < c.length; d++) c[d](); | |
| Oi.set(a, []) | |
| }, | |
| Vi = function(a) { | |
| var b = xi(N.location.href); | |
| return !!m(a.url, "https://www.google-analytics.com/gtm/js?id=") || !(a.query || 0 <= a.url.indexOf("?") || 0 <= a.path.indexOf("://")) && (a.host == b.host && a.port == b.port || (b = "http:" == a.protocol ? 80 : 443, !("www.google-analytics.com" != a.host || (a.port || b) != b || !m(a.path, "/plugins/")))) | |
| }, | |
| xi = function(a) { | |
| function b(a) { | |
| var b = (a.hostname || "").split(":")[0].toLowerCase(), | |
| c = (a.protocol || "").toLowerCase(), | |
| c = 1 * a.port || ("http:" == c ? 80 : "https:" == c ? 443 : ""); | |
| return a = a.pathname || "", m(a, "/") || (a = "/" + a), [b, "" + c, a] | |
| } | |
| var c = N.createElement("a"); | |
| c.href = N.location.href; | |
| var d = (c.protocol || "").toLowerCase(), | |
| e = b(c), | |
| t = c.search || "", | |
| i = d + "//" + e[0] + (e[1] ? ":" + e[1] : ""); | |
| return m(a, "//") ? a = d + a : m(a, "/") ? a = i + a : !a || m(a, "?") ? a = i + e[2] + (a || t) : 0 > a.split("/")[0].indexOf(":") && (a = i + e[2].substring(0, e[2].lastIndexOf("/")) + "/" + a), c.href = a, d = b(c), { | |
| protocol: (c.protocol || "").toLowerCase(), | |
| host: d[0], | |
| port: d[1], | |
| path: d[2], | |
| query: c.search || "", | |
| url: a || "" | |
| } | |
| }, | |
| $i = { | |
| ga: function() { | |
| $i.f = [] | |
| } | |
| }; | |
| $i.ga(), $i.D = function(a) { | |
| var b = $i.J.apply($i, arguments), | |
| b = $i.f.concat(b); | |
| for ($i.f = []; 0 < b.length && !$i.v(b[0]) && (b.shift(), !(0 < $i.f.length));); | |
| $i.f = $i.f.concat(b) | |
| }, $i.J = function(a) { | |
| for (var b = [], c = 0; c < arguments.length; c++) try { | |
| var d = new Ui(arguments[c]); | |
| d.g ? qi(d.a[0], d.a[1]) : (d.i && (d.ha = y(d.c, d.a[0], d.X, d.W)), b.push(d)) | |
| } catch (t) {} | |
| return b | |
| }, $i.v = function(a) { | |
| try { | |
| if (a.u) a.u.call(D, Gi.j("t0")); | |
| else { | |
| var b = a.c == pe ? Gi : Gi.j(a.c); | |
| if (a.A) "t0" != a.c || Gi.create.apply(Gi, a.a); | |
| else if (a.ba) Gi.remove(a.c); | |
| else if (b) | |
| if (a.i) { | |
| if (a.ha && (a.ha = y(a.c, a.a[0], a.X, a.W)), !Fi(a.a[0], b, a.W)) return !0 | |
| } else if (a.K) { | |
| var c = a.C, | |
| d = a.a, | |
| e = b.plugins_.get(a.K); | |
| e[c].apply(e, d) | |
| } else b[a.C].apply(b, a.a) | |
| } | |
| } catch (t) {} | |
| }; | |
| var Gi = function(a) { | |
| J(1), $i.D.apply($i, [arguments]) | |
| }; | |
| Gi.h = {}, Gi.P = [], Gi.L = 0, Gi.answer = 42; | |
| var Hi = [At, Pt, wt]; | |
| Gi.create = function(a) { | |
| var b = R(Hi, [].slice.call(arguments)); | |
| b[wt] || (b[wt] = "t0"); | |
| var c = "" + b[wt]; | |
| return Gi.h[c] ? Gi.h[c] : (b = new wi(b), Gi.h[c] = b, Gi.P.push(b), b) | |
| }, | |
| Gi.remove = function(a) { | |
| for (var b = 0; b < Gi.P.length; b++) | |
| if (Gi.P[b].get(wt) == a) { | |
| Gi.P.splice(b, 1), Gi.h[a] = null; | |
| break | |
| } | |
| }, Gi.j = function(a) { | |
| return Gi.h[a] | |
| }, Gi.getAll = function() { | |
| return Gi.P.slice(0) | |
| }, Gi.N = function() { | |
| "ga" != pe && J(49); | |
| var a = D[pe]; | |
| if (!a || 42 != a.answer) { | |
| if (Gi.L = a && a.l, Gi.loaded = !0, X("create", b = D[pe] = Gi, b.create), X("remove", b, b.remove), X("getByName", b, b.j, 5), X("getAll", b, b.getAll, 6), b = wi.prototype, X("get", b, b.get, 7), X("set", b, b.set, 4), X("send", b, b.send), X("requireSync", b, b.ma), b = te.prototype, X("get", b, b.get), X("set", b, b.set), !I() && !me) { | |
| e: { | |
| for (var b = N.getElementsByTagName("script"), c = 0; c < b.length && 100 > c; c++) { | |
| var d = b[c].src; | |
| if (d && 0 == d.indexOf("https://www.google-analytics.com/analytics")) { | |
| J(33), b = !0; | |
| break e | |
| } | |
| } | |
| b = !1 | |
| } | |
| b && (me = !0) | |
| } | |
| I() || me || !Ht(new Gt(1e4)) || (J(36), me = !0), (D.gaplugins = D.gaplugins || {}).Linker = li, b = li.prototype, qi("linker", li), X("decorate", b, b.ca, 20), X("autoLink", b, b.S, 25), qi("displayfeatures", vi), qi("adfeatures", vi), a = a && a.q, h(a) ? $i.D.apply(Gi, a) : J(50) | |
| } | |
| }, Gi.da = function() { | |
| for (var a = Gi.getAll(), b = 0; b < a.length; b++) a[b].get(wt) | |
| }; | |
| var ji = Gi.N, | |
| zi = D[pe]; | |
| zi && zi.r ? ji() : z(ji), z(function() { | |
| $i.D(["provide", "render", S]) | |
| }) | |
| }(window), | |
| function(t) { | |
| t.fn.circliful = function(options, i) { | |
| var s = t.extend({ | |
| startdegree: 0, | |
| fgcolor: "#556b2f", | |
| bgcolor: "#eee", | |
| fill: !1, | |
| width: 15, | |
| dimension: 200, | |
| fontsize: 15, | |
| percent: 50, | |
| animationstep: 1, | |
| iconsize: "20px", | |
| iconcolor: "#999", | |
| border: "default", | |
| complete: null, | |
| bordersize: 10 | |
| }, options); | |
| return this.each(function() { | |
| function addCircleText(i, s, lineHeight) { | |
| t("<span></span>").appendTo(i).addClass(s).html(text).prepend(icon).css({ | |
| "line-height": lineHeight + "px", | |
| "font-size": o.fontsize + "px" | |
| }) | |
| } | |
| function addInfoText(i, s) { | |
| t("<span></span>").appendTo(i).addClass("circle-info-half").css("line-height", o.dimension * s + "px").text(info) | |
| } | |
| function animate(i) { | |
| context.clearRect(0, 0, canvas.width, canvas.height), context.beginPath(), context.arc(x, y, m, g, _, !1), context.lineWidth = o.width + 1, context.strokeStyle = o.bgcolor, context.stroke(), fill && (context.fillStyle = o.fill, context.fill()), context.beginPath(), context.arc(x, y, m, -C + L, v * i - C + L, !1), "outline" == o.border ? context.lineWidth = o.width + o.bordersize : "inline" == o.border && (context.lineWidth = o.width - o.bordersize), context.strokeStyle = o.fgcolor, context.stroke(), S < l && (S += T, requestAnimationFrame(function() { | |
| animate(Math.min(S, l) / 100) | |
| }, u)), S == l && I && void 0 !== options && t.isFunction(options.complete) && (options.complete(), I = !1) | |
| } | |
| var text, info, i = ["fgcolor", "bgcolor", "fill", "width", "dimension", "fontsize", "animationstep", "endPercent", "icon", "iconcolor", "iconsize", "border", "startdegree", "bordersize"], | |
| o = { | |
| fgcolor: "", | |
| bgcolor: "", | |
| fill: "", | |
| width: "", | |
| dimension: "", | |
| fontsize: "", | |
| animationstep: 0, | |
| endPercent: "", | |
| icon: "", | |
| iconcolor: "", | |
| iconsize: "", | |
| border: "", | |
| startdegree: "", | |
| bordersize: "", | |
| percent: "" | |
| }, | |
| icon = "", | |
| l = 0, | |
| u = t(this), | |
| fill = !1; | |
| if (u.addClass("circliful"), function checkDataAttributes(l) { | |
| t.each(i, function(index, i) { | |
| void 0 != l.data(i) ? o[i] = l.data(i) : o[i] = t(s).attr(i), "fill" == i && void 0 != l.data("fill") && (fill = !0) | |
| }) | |
| }(u), void 0 != u.data("text") && (text = u.data("text"), void 0 != u.data("icon") && (icon = t("<i></i>").addClass("fa " + t(this).data("icon")).css({ | |
| color: o.iconcolor, | |
| "font-size": o.iconsize | |
| })), void 0 != u.data("type") && "half" == t(this).data("type") ? addCircleText(u, "circle-text-half", o.dimension / 1.45) : addCircleText(u, "circle-text", o.dimension)), void 0 != t(this).data("total") && void 0 != t(this).data("part")) { | |
| var total = t(this).data("total") / 100; | |
| (t(this).data("part") / total / 100).toFixed(3), l = (t(this).data("part") / total).toFixed(3) | |
| } else void 0 != t(this).data("percent") ? (t(this).data("percent") / 100, l = t(this).data("percent")) : s.percent / 100; | |
| void 0 != t(this).data("info") && (info = t(this).data("info"), void 0 != t(this).data("type") && "half" == t(this).data("type") ? addInfoText(u, .9) : addInfoText(u, 1.25)), t(this).width(o.dimension + "px"); | |
| var size = o.dimension, | |
| canvas = t("<canvas></canvas>").attr({ | |
| width: size, | |
| height: size | |
| }).appendTo(t(this)).get(0), | |
| context = canvas.getContext("2d"), | |
| h = window.devicePixelRatio; | |
| if (h) { | |
| var p = t(canvas); | |
| p.css("width", size), p.css("height", size), p.attr("width", size * h), | |
| p.attr("height", size * h), context.scale(h, h) | |
| } | |
| t(canvas).parent(); | |
| var x = size / 2, | |
| y = size / 2, | |
| m = (o.percent, Math.PI, size / 2.5), | |
| _ = 2.3 * Math.PI, | |
| g = 0, | |
| S = 0 === o.animationstep ? l : 0, | |
| T = Math.max(o.animationstep, 0), | |
| v = 2 * Math.PI, | |
| C = Math.PI / 2, | |
| I = !0, | |
| L = o.startdegree / 180 * Math.PI; | |
| void 0 != t(this).data("type") && "half" == t(this).data("type") && (_ = 2 * Math.PI, g = 3.13, v = Math.PI, C = Math.PI / .996), void 0 != t(this).data("type") && "angle" == t(this).data("type") && (_ = 2.25 * Math.PI, g = 2.4, v = 1.53 + Math.PI, C = .73 + Math.PI / .996), animate(S / 100) | |
| }) | |
| } | |
| }(jQuery), | |
| function(t) { | |
| "use strict"; | |
| "function" == typeof define && define.amd ? define(["jquery"], t) : t(jQuery) | |
| }(function(t) { | |
| "use strict"; | |
| var i = window.Slick || {}; | |
| (i = function() { | |
| var i = 0; | |
| return function Slick(s, o) { | |
| var l, u = this; | |
| u.defaults = { | |
| accessibility: !0, | |
| adaptiveHeight: !1, | |
| appendArrows: t(s), | |
| appendDots: t(s), | |
| arrows: !0, | |
| asNavFor: null, | |
| prevArrow: '<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous</button>', | |
| nextArrow: '<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next</button>', | |
| autoplay: !1, | |
| autoplaySpeed: 3e3, | |
| centerMode: !1, | |
| centerPadding: "50px", | |
| cssEase: "ease", | |
| customPaging: function(i, s) { | |
| return t('<button type="button" data-role="none" role="button" tabindex="0" />').text(s + 1) | |
| }, | |
| dots: !1, | |
| dotsClass: "slick-dots", | |
| draggable: !0, | |
| easing: "linear", | |
| edgeFriction: .35, | |
| fade: !1, | |
| focusOnSelect: !1, | |
| infinite: !0, | |
| initialSlide: 0, | |
| lazyLoad: "ondemand", | |
| mobileFirst: !1, | |
| pauseOnHover: !0, | |
| pauseOnFocus: !0, | |
| pauseOnDotsHover: !1, | |
| respondTo: "window", | |
| responsive: null, | |
| rows: 1, | |
| rtl: !1, | |
| slide: "", | |
| slidesPerRow: 1, | |
| slidesToShow: 1, | |
| slidesToScroll: 1, | |
| speed: 500, | |
| swipe: !0, | |
| swipeToSlide: !1, | |
| touchMove: !0, | |
| touchThreshold: 5, | |
| useCSS: !0, | |
| useTransform: !0, | |
| variableWidth: !1, | |
| vertical: !1, | |
| verticalSwiping: !1, | |
| waitForAnimate: !0, | |
| zIndex: 1e3 | |
| }, u.initials = { | |
| animating: !1, | |
| dragging: !1, | |
| autoPlayTimer: null, | |
| currentDirection: 0, | |
| currentLeft: null, | |
| currentSlide: 0, | |
| direction: 1, | |
| $dots: null, | |
| listWidth: null, | |
| listHeight: null, | |
| loadIndex: 0, | |
| $nextArrow: null, | |
| $prevArrow: null, | |
| slideCount: null, | |
| slideWidth: null, | |
| $slideTrack: null, | |
| $slides: null, | |
| sliding: !1, | |
| slideOffset: 0, | |
| swipeLeft: null, | |
| $list: null, | |
| touchObject: {}, | |
| transformsEnabled: !1, | |
| unslicked: !1 | |
| }, t.extend(u, u.initials), u.activeBreakpoint = null, u.animType = null, u.animProp = null, u.breakpoints = [], u.breakpointSettings = [], u.cssTransitions = !1, u.focussed = !1, u.interrupted = !1, u.hidden = "hidden", u.paused = !0, u.positionProp = null, u.respondTo = null, u.rowCount = 1, u.shouldClick = !0, u.$slider = t(s), u.$slidesCache = null, u.transformType = null, u.transitionType = null, u.visibilityChange = "visibilitychange", u.windowWidth = 0, u.windowTimer = null, l = t(s).data("slick") || {}, u.options = t.extend({}, u.defaults, o, l), u.currentSlide = u.options.initialSlide, u.originalSettings = u.options, void 0 !== document.mozHidden ? (u.hidden = "mozHidden", u.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (u.hidden = "webkitHidden", u.visibilityChange = "webkitvisibilitychange"), u.autoPlay = t.proxy(u.autoPlay, u), u.autoPlayClear = t.proxy(u.autoPlayClear, u), u.autoPlayIterator = t.proxy(u.autoPlayIterator, u), u.changeSlide = t.proxy(u.changeSlide, u), u.clickHandler = t.proxy(u.clickHandler, u), u.selectHandler = t.proxy(u.selectHandler, u), u.setPosition = t.proxy(u.setPosition, u), u.swipeHandler = t.proxy(u.swipeHandler, u), u.dragHandler = t.proxy(u.dragHandler, u), u.keyHandler = t.proxy(u.keyHandler, u), u.instanceUid = i++, u.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, u.registerBreakpoints(), u.init(!0) | |
| } | |
| }()).prototype.activateADA = function() { | |
| this.$slideTrack.find(".slick-active").attr({ | |
| "aria-hidden": "false" | |
| }).find("a, input, button, select").attr({ | |
| tabindex: "0" | |
| }) | |
| }, i.prototype.addSlide = i.prototype.slickAdd = function(i, index, s) { | |
| var o = this; | |
| if ("boolean" == typeof index) s = index, index = null; | |
| else if (index < 0 || index >= o.slideCount) return !1; | |
| o.unload(), "number" == typeof index ? 0 === index && 0 === o.$slides.length ? t(i).appendTo(o.$slideTrack) : s ? t(i).insertBefore(o.$slides.eq(index)) : t(i).insertAfter(o.$slides.eq(index)) : !0 === s ? t(i).prependTo(o.$slideTrack) : t(i).appendTo(o.$slideTrack), o.$slides = o.$slideTrack.children(this.options.slide), | |
| o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slides.each(function(index, i) { | |
| t(i).attr("data-slick-index", index) | |
| }), o.$slidesCache = o.$slides, o.reinit() | |
| }, i.prototype.animateHeight = function() { | |
| var t = this; | |
| if (1 === t.options.slidesToShow && !0 === t.options.adaptiveHeight && !1 === t.options.vertical) { | |
| var i = t.$slides.eq(t.currentSlide).outerHeight(!0); | |
| t.$list.animate({ | |
| height: i | |
| }, t.options.speed) | |
| } | |
| }, i.prototype.animateSlide = function(i, s) { | |
| var o = {}, | |
| l = this; | |
| l.animateHeight(), !0 === l.options.rtl && !1 === l.options.vertical && (i = -i), !1 === l.transformsEnabled ? !1 === l.options.vertical ? l.$slideTrack.animate({ | |
| left: i | |
| }, l.options.speed, l.options.easing, s) : l.$slideTrack.animate({ | |
| top: i | |
| }, l.options.speed, l.options.easing, s) : !1 === l.cssTransitions ? (!0 === l.options.rtl && (l.currentLeft = -l.currentLeft), t({ | |
| animStart: l.currentLeft | |
| }).animate({ | |
| animStart: i | |
| }, { | |
| duration: l.options.speed, | |
| easing: l.options.easing, | |
| step: function(now) { | |
| now = Math.ceil(now), !1 === l.options.vertical ? (o[l.animType] = "translate(" + now + "px, 0px)", l.$slideTrack.css(o)) : (o[l.animType] = "translate(0px," + now + "px)", l.$slideTrack.css(o)) | |
| }, | |
| complete: function() { | |
| s && s.call() | |
| } | |
| })) : (l.applyTransition(), i = Math.ceil(i), !1 === l.options.vertical ? o[l.animType] = "translate3d(" + i + "px, 0px, 0px)" : o[l.animType] = "translate3d(0px," + i + "px, 0px)", l.$slideTrack.css(o), s && setTimeout(function() { | |
| l.disableTransition(), s.call() | |
| }, l.options.speed)) | |
| }, i.prototype.getNavTarget = function() { | |
| var i = this, | |
| s = i.options.asNavFor; | |
| return s && null !== s && (s = t(s).not(i.$slider)), s | |
| }, i.prototype.asNavFor = function(index) { | |
| var i = this.getNavTarget(); | |
| null !== i && "object" == typeof i && i.each(function() { | |
| var target = t(this).slick("getSlick"); | |
| target.unslicked || target.slideHandler(index, !0) | |
| }) | |
| }, i.prototype.applyTransition = function(t) { | |
| var i = this, | |
| transition = {}; | |
| !1 === i.options.fade ? transition[i.transitionType] = i.transformType + " " + i.options.speed + "ms " + i.options.cssEase : transition[i.transitionType] = "opacity " + i.options.speed + "ms " + i.options.cssEase, !1 === i.options.fade ? i.$slideTrack.css(transition) : i.$slides.eq(t).css(transition) | |
| }, i.prototype.autoPlay = function() { | |
| var t = this; | |
| t.autoPlayClear(), t.slideCount > t.options.slidesToShow && (t.autoPlayTimer = setInterval(t.autoPlayIterator, t.options.autoplaySpeed)) | |
| }, i.prototype.autoPlayClear = function() { | |
| var t = this; | |
| t.autoPlayTimer && clearInterval(t.autoPlayTimer) | |
| }, i.prototype.autoPlayIterator = function() { | |
| var t = this, | |
| i = t.currentSlide + t.options.slidesToScroll; | |
| t.paused || t.interrupted || t.focussed || (!1 === t.options.infinite && (1 === t.direction && t.currentSlide + 1 === t.slideCount - 1 ? t.direction = 0 : 0 === t.direction && (i = t.currentSlide - t.options.slidesToScroll, t.currentSlide - 1 == 0 && (t.direction = 1))), t.slideHandler(i)) | |
| }, i.prototype.buildArrows = function() { | |
| var i = this; | |
| !0 === i.options.arrows && (i.$prevArrow = t(i.options.prevArrow).addClass("slick-arrow"), i.$nextArrow = t(i.options.nextArrow).addClass("slick-arrow"), i.slideCount > i.options.slidesToShow ? (i.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), i.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), i.htmlExpr.test(i.options.prevArrow) && i.$prevArrow.prependTo(i.options.appendArrows), i.htmlExpr.test(i.options.nextArrow) && i.$nextArrow.appendTo(i.options.appendArrows), !0 !== i.options.infinite && i.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : i.$prevArrow.add(i.$nextArrow).addClass("slick-hidden").attr({ | |
| "aria-disabled": "true", | |
| tabindex: "-1" | |
| })) | |
| }, i.prototype.buildDots = function() { | |
| var i, s, o = this; | |
| if (!0 === o.options.dots && o.slideCount > o.options.slidesToShow) { | |
| for (o.$slider.addClass("slick-dotted"), s = t("<ul />").addClass(o.options.dotsClass), i = 0; i <= o.getDotCount(); i += 1) s.append(t("<li />").append(o.options.customPaging.call(this, o, i))); | |
| o.$dots = s.appendTo(o.options.appendDots), o.$dots.find("li").first().addClass("slick-active").attr("aria-hidden", "false") | |
| } | |
| }, i.prototype.buildOut = function() { | |
| var i = this; | |
| i.$slides = i.$slider.children(i.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), i.slideCount = i.$slides.length, | |
| i.$slides.each(function(index, i) { | |
| t(i).attr("data-slick-index", index).data("originalStyling", t(i).attr("style") || "") | |
| }), i.$slider.addClass("slick-slider"), i.$slideTrack = 0 === i.slideCount ? t('<div class="slick-track"/>').appendTo(i.$slider) : i.$slides.wrapAll('<div class="slick-track"/>').parent(), i.$list = i.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent(), i.$slideTrack.css("opacity", 0), !0 !== i.options.centerMode && !0 !== i.options.swipeToSlide || (i.options.slidesToScroll = 1), t("img[data-lazy]", i.$slider).not("[src]").addClass("slick-loading"), i.setupInfinite(), i.buildArrows(), i.buildDots(), i.updateDots(), i.setSlideClasses("number" == typeof i.currentSlide ? i.currentSlide : 0), !0 === i.options.draggable && i.$list.addClass("draggable") | |
| }, i.prototype.buildRows = function() { | |
| var a, b, c, t, i, s, o, l = this; | |
| if (t = document.createDocumentFragment(), s = l.$slider.children(), l.options.rows > 1) { | |
| for (o = l.options.slidesPerRow * l.options.rows, i = Math.ceil(s.length / o), a = 0; a < i; a++) { | |
| var u = document.createElement("div"); | |
| for (b = 0; b < l.options.rows; b++) { | |
| var h = document.createElement("div"); | |
| for (c = 0; c < l.options.slidesPerRow; c++) { | |
| var target = a * o + (b * l.options.slidesPerRow + c); | |
| s.get(target) && h.appendChild(s.get(target)) | |
| } | |
| u.appendChild(h) | |
| } | |
| t.appendChild(u) | |
| } | |
| l.$slider.empty().append(t), l.$slider.children().children().children().css({ | |
| width: 100 / l.options.slidesPerRow + "%", | |
| display: "inline-block" | |
| }) | |
| } | |
| }, i.prototype.checkResponsive = function(i, s) { | |
| var o, l, u, h = this, | |
| p = !1, | |
| m = h.$slider.width(), | |
| _ = window.innerWidth || t(window).width(); | |
| if ("window" === h.respondTo ? u = _ : "slider" === h.respondTo ? u = m : "min" === h.respondTo && (u = Math.min(_, m)), h.options.responsive && h.options.responsive.length && null !== h.options.responsive) { | |
| l = null; | |
| for (o in h.breakpoints) h.breakpoints.hasOwnProperty(o) && (!1 === h.originalSettings.mobileFirst ? u < h.breakpoints[o] && (l = h.breakpoints[o]) : u > h.breakpoints[o] && (l = h.breakpoints[o])); | |
| null !== l ? null !== h.activeBreakpoint ? (l !== h.activeBreakpoint || s) && (h.activeBreakpoint = l, "unslick" === h.breakpointSettings[l] ? h.unslick(l) : (h.options = t.extend({}, h.originalSettings, h.breakpointSettings[l]), !0 === i && (h.currentSlide = h.options.initialSlide), h.refresh(i)), p = l) : (h.activeBreakpoint = l, "unslick" === h.breakpointSettings[l] ? h.unslick(l) : (h.options = t.extend({}, h.originalSettings, h.breakpointSettings[l]), !0 === i && (h.currentSlide = h.options.initialSlide), h.refresh(i)), p = l) : null !== h.activeBreakpoint && (h.activeBreakpoint = null, h.options = h.originalSettings, !0 === i && (h.currentSlide = h.options.initialSlide), h.refresh(i), p = l), i || !1 === p || h.$slider.trigger("breakpoint", [h, p]) | |
| } | |
| }, i.prototype.changeSlide = function(event, i) { | |
| var s, o, l, u = this, | |
| h = t(event.currentTarget); | |
| switch (h.is("a") && event.preventDefault(), h.is("li") || (h = h.closest("li")), l = u.slideCount % u.options.slidesToScroll != 0, s = l ? 0 : (u.slideCount - u.currentSlide) % u.options.slidesToScroll, event.data.message) { | |
| case "previous": | |
| o = 0 === s ? u.options.slidesToScroll : u.options.slidesToShow - s, u.slideCount > u.options.slidesToShow && u.slideHandler(u.currentSlide - o, !1, i); | |
| break; | |
| case "next": | |
| o = 0 === s ? u.options.slidesToScroll : s, u.slideCount > u.options.slidesToShow && u.slideHandler(u.currentSlide + o, !1, i); | |
| break; | |
| case "index": | |
| var index = 0 === event.data.index ? 0 : event.data.index || h.index() * u.options.slidesToScroll; | |
| u.slideHandler(u.checkNavigable(index), !1, i), h.children().trigger("focus"); | |
| break; | |
| default: | |
| return | |
| } | |
| }, i.prototype.checkNavigable = function(index) { | |
| var t, i; | |
| if (t = this.getNavigableIndexes(), i = 0, index > t[t.length - 1]) index = t[t.length - 1]; | |
| else | |
| for (var n in t) { | |
| if (index < t[n]) { | |
| index = i; | |
| break | |
| } | |
| i = t[n] | |
| } | |
| return index | |
| }, i.prototype.cleanUpEvents = function() { | |
| var i = this; | |
| i.options.dots && null !== i.$dots && t("li", i.$dots).off("click.slick tap", i.changeSlide).off("mouseenter.slick", t.proxy(i.interrupt, i, !0)).off("mouseleave.slick", t.proxy(i.interrupt, i, !1)), i.$slider.off("focus.slick blur.slick"), !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow && i.$prevArrow.off("click.slick tap", i.changeSlide), i.$nextArrow && i.$nextArrow.off("click.slick tap", i.changeSlide)), | |
| i.$list.off("touchstart.slick mousedown.slick", i.swipeHandler), i.$list.off("touchmove.slick mousemove.slick", i.swipeHandler), i.$list.off("touchend.slick mouseup.slick", i.swipeHandler), i.$list.off("touchcancel.slick mouseleave.slick", i.swipeHandler), i.$list.off("click.slick tap", i.clickHandler), t(document).off(i.visibilityChange, i.visibility), i.cleanUpSlideEvents(), !0 === i.options.accessibility && i.$list.off("keydown.slick", i.keyHandler), !0 === i.options.focusOnSelect && t(i.$slideTrack).children().off("click.slick tap", i.selectHandler), t(window).off("orientationchange.slick.slick-" + i.instanceUid, i.orientationChange), t(window).off("resize.slick.slick-" + i.instanceUid, i.resize), t("[draggable!=true]", i.$slideTrack).off("dragstart", i.preventDefault), t(window).off("load.slick.slick-" + i.instanceUid, i.setPosition), t(document).off("ready.slick.slick-" + i.instanceUid, i.setPosition) | |
| }, i.prototype.cleanUpSlideEvents = function() { | |
| var i = this; | |
| i.$list.off("mouseenter.slick", t.proxy(i.interrupt, i, !0)), i.$list.off("mouseleave.slick", t.proxy(i.interrupt, i, !1)) | |
| }, i.prototype.cleanUpRows = function() { | |
| var t, i = this; | |
| i.options.rows > 1 && ((t = i.$slides.children().children()).removeAttr("style"), i.$slider.empty().append(t)) | |
| }, i.prototype.clickHandler = function(event) { | |
| !1 === this.shouldClick && (event.stopImmediatePropagation(), event.stopPropagation(), event.preventDefault()) | |
| }, i.prototype.destroy = function(refresh) { | |
| var i = this; | |
| i.autoPlayClear(), i.touchObject = {}, i.cleanUpEvents(), t(".slick-cloned", i.$slider).detach(), i.$dots && i.$dots.remove(), i.$prevArrow && i.$prevArrow.length && (i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.prevArrow) && i.$prevArrow.remove()), i.$nextArrow && i.$nextArrow.length && (i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.nextArrow) && i.$nextArrow.remove()), i.$slides && (i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function() { | |
| t(this).attr("style", t(this).data("originalStyling")) | |
| }), i.$slideTrack.children(this.options.slide).detach(), i.$slideTrack.detach(), i.$list.detach(), i.$slider.append(i.$slides)), i.cleanUpRows(), i.$slider.removeClass("slick-slider"), i.$slider.removeClass("slick-initialized"), i.$slider.removeClass("slick-dotted"), i.unslicked = !0, refresh || i.$slider.trigger("destroy", [i]) | |
| }, i.prototype.disableTransition = function(t) { | |
| var i = this, | |
| transition = {}; | |
| transition[i.transitionType] = "", !1 === i.options.fade ? i.$slideTrack.css(transition) : i.$slides.eq(t).css(transition) | |
| }, i.prototype.fadeSlide = function(t, i) { | |
| var s = this; | |
| !1 === s.cssTransitions ? (s.$slides.eq(t).css({ | |
| zIndex: s.options.zIndex | |
| }), s.$slides.eq(t).animate({ | |
| opacity: 1 | |
| }, s.options.speed, s.options.easing, i)) : (s.applyTransition(t), s.$slides.eq(t).css({ | |
| opacity: 1, | |
| zIndex: s.options.zIndex | |
| }), i && setTimeout(function() { | |
| s.disableTransition(t), i.call() | |
| }, s.options.speed)) | |
| }, i.prototype.fadeSlideOut = function(t) { | |
| var i = this; | |
| !1 === i.cssTransitions ? i.$slides.eq(t).animate({ | |
| opacity: 0, | |
| zIndex: i.options.zIndex - 2 | |
| }, i.options.speed, i.options.easing) : (i.applyTransition(t), i.$slides.eq(t).css({ | |
| opacity: 0, | |
| zIndex: i.options.zIndex - 2 | |
| })) | |
| }, i.prototype.filterSlides = i.prototype.slickFilter = function(filter) { | |
| var t = this; | |
| null !== filter && (t.$slidesCache = t.$slides, t.unload(), t.$slideTrack.children(this.options.slide).detach(), t.$slidesCache.filter(filter).appendTo(t.$slideTrack), t.reinit()) | |
| }, i.prototype.focusHandler = function() { | |
| var i = this; | |
| i.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*:not(.slick-arrow)", function(event) { | |
| event.stopImmediatePropagation(); | |
| var s = t(this); | |
| setTimeout(function() { | |
| i.options.pauseOnFocus && (i.focussed = s.is(":focus"), i.autoPlay()) | |
| }, 0) | |
| }) | |
| }, i.prototype.getCurrent = i.prototype.slickCurrentSlide = function() { | |
| return this.currentSlide | |
| }, i.prototype.getDotCount = function() { | |
| var t = this, | |
| i = 0, | |
| s = 0, | |
| o = 0; | |
| if (!0 === t.options.infinite) | |
| for (; i < t.slideCount;) ++o, i = s + t.options.slidesToScroll, s += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; | |
| else if (!0 === t.options.centerMode) o = t.slideCount; | |
| else if (t.options.asNavFor) | |
| for (; i < t.slideCount;) ++o, i = s + t.options.slidesToScroll, s += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; | |
| else o = 1 + Math.ceil((t.slideCount - t.options.slidesToShow) / t.options.slidesToScroll); | |
| return o - 1 | |
| }, i.prototype.getLeft = function(t) { | |
| var i, s, o, l = this, | |
| u = 0; | |
| return l.slideOffset = 0, s = l.$slides.first().outerHeight(!0), !0 === l.options.infinite ? (l.slideCount > l.options.slidesToShow && (l.slideOffset = l.slideWidth * l.options.slidesToShow * -1, u = s * l.options.slidesToShow * -1), l.slideCount % l.options.slidesToScroll != 0 && t + l.options.slidesToScroll > l.slideCount && l.slideCount > l.options.slidesToShow && (t > l.slideCount ? (l.slideOffset = (l.options.slidesToShow - (t - l.slideCount)) * l.slideWidth * -1, u = (l.options.slidesToShow - (t - l.slideCount)) * s * -1) : (l.slideOffset = l.slideCount % l.options.slidesToScroll * l.slideWidth * -1, u = l.slideCount % l.options.slidesToScroll * s * -1))) : t + l.options.slidesToShow > l.slideCount && (l.slideOffset = (t + l.options.slidesToShow - l.slideCount) * l.slideWidth, u = (t + l.options.slidesToShow - l.slideCount) * s), l.slideCount <= l.options.slidesToShow && (l.slideOffset = 0, u = 0), !0 === l.options.centerMode && l.slideCount <= l.options.slidesToShow ? l.slideOffset = l.slideWidth * Math.floor(l.options.slidesToShow) / 2 - l.slideWidth * l.slideCount / 2 : !0 === l.options.centerMode && !0 === l.options.infinite ? l.slideOffset += l.slideWidth * Math.floor(l.options.slidesToShow / 2) - l.slideWidth : !0 === l.options.centerMode && (l.slideOffset = 0, l.slideOffset += l.slideWidth * Math.floor(l.options.slidesToShow / 2)), i = !1 === l.options.vertical ? t * l.slideWidth * -1 + l.slideOffset : t * s * -1 + u, !0 === l.options.variableWidth && (o = l.slideCount <= l.options.slidesToShow || !1 === l.options.infinite ? l.$slideTrack.children(".slick-slide").eq(t) : l.$slideTrack.children(".slick-slide").eq(t + l.options.slidesToShow), i = !0 === l.options.rtl ? o[0] ? -1 * (l.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, !0 === l.options.centerMode && (o = l.slideCount <= l.options.slidesToShow || !1 === l.options.infinite ? l.$slideTrack.children(".slick-slide").eq(t) : l.$slideTrack.children(".slick-slide").eq(t + l.options.slidesToShow + 1), i = !0 === l.options.rtl ? o[0] ? -1 * (l.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, i += (l.$list.width() - o.outerWidth()) / 2)), i | |
| }, i.prototype.getOption = i.prototype.slickGetOption = function(t) { | |
| return this.options[t] | |
| }, i.prototype.getNavigableIndexes = function() { | |
| var max, t = this, | |
| i = 0, | |
| s = 0, | |
| o = []; | |
| for (!1 === t.options.infinite ? max = t.slideCount : (i = -1 * t.options.slidesToScroll, s = -1 * t.options.slidesToScroll, max = 2 * t.slideCount); i < max;) o.push(i), i = s + t.options.slidesToScroll, s += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; | |
| return o | |
| }, i.prototype.getSlick = function() { | |
| return this | |
| }, i.prototype.getSlideCount = function() { | |
| var i, s, o = this; | |
| return s = !0 === o.options.centerMode ? o.slideWidth * Math.floor(o.options.slidesToShow / 2) : 0, !0 === o.options.swipeToSlide ? (o.$slideTrack.find(".slick-slide").each(function(index, l) { | |
| if (l.offsetLeft - s + t(l).outerWidth() / 2 > -1 * o.swipeLeft) return i = l, !1 | |
| }), Math.abs(t(i).attr("data-slick-index") - o.currentSlide) || 1) : o.options.slidesToScroll | |
| }, i.prototype.goTo = i.prototype.slickGoTo = function(t, i) { | |
| this.changeSlide({ | |
| data: { | |
| message: "index", | |
| index: parseInt(t, 10) | |
| } | |
| }, i) | |
| }, i.prototype.init = function(i) { | |
| var s = this; | |
| t(s.$slider).hasClass("slick-initialized") || (t(s.$slider).addClass("slick-initialized"), s.buildRows(), s.buildOut(), s.setProps(), s.startLoad(), s.loadSlider(), s.initializeEvents(), s.updateArrows(), s.updateDots(), s.checkResponsive(!0), s.focusHandler()), i && s.$slider.trigger("init", [s]), !0 === s.options.accessibility && s.initADA(), s.options.autoplay && (s.paused = !1, s.autoPlay()) | |
| }, i.prototype.initADA = function() { | |
| var i = this; | |
| i.$slides.add(i.$slideTrack.find(".slick-cloned")).attr({ | |
| "aria-hidden": "true", | |
| tabindex: "-1" | |
| }).find("a, input, button, select").attr({ | |
| tabindex: "-1" | |
| }), i.$slideTrack.attr("role", "listbox"), i.$slides.not(i.$slideTrack.find(".slick-cloned")).each(function(s) { | |
| t(this).attr("role", "option"); | |
| var o = i.options.centerMode ? s : Math.floor(s / i.options.slidesToShow); | |
| !0 === i.options.dots && t(this).attr("aria-describedby", "slick-slide" + i.instanceUid + o) | |
| }), null !== i.$dots && i.$dots.attr("role", "tablist").find("li").each(function(s) { | |
| t(this).attr({ | |
| role: "presentation", | |
| "aria-selected": "false", | |
| "aria-controls": "navigation" + i.instanceUid + s, | |
| id: "slick-slide" + i.instanceUid + s | |
| }) | |
| }).first().attr("aria-selected", "true").end().find("button").attr("role", "button").end().closest("div").attr("role", "toolbar"), i.activateADA() | |
| }, i.prototype.initArrowEvents = function() { | |
| var t = this; | |
| !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.off("click.slick tap").on("click.slick tap", { | |
| message: "previous" | |
| }, t.changeSlide), t.$nextArrow.off("click.slick tap").on("click.slick tap", { | |
| message: "next" | |
| }, t.changeSlide)) | |
| }, i.prototype.initDotEvents = function() { | |
| var i = this; | |
| !0 === i.options.dots && i.slideCount > i.options.slidesToShow && t("li", i.$dots).on("click.slick tap", { | |
| message: "index" | |
| }, i.changeSlide), !0 === i.options.dots && !0 === i.options.pauseOnDotsHover && t("li", i.$dots).on("mouseenter.slick", t.proxy(i.interrupt, i, !0)).on("mouseleave.slick", t.proxy(i.interrupt, i, !1)) | |
| }, i.prototype.initSlideEvents = function() { | |
| var i = this; | |
| i.options.pauseOnHover && (i.$list.on("mouseenter.slick", t.proxy(i.interrupt, i, !0)), i.$list.on("mouseleave.slick", t.proxy(i.interrupt, i, !1))) | |
| }, i.prototype.initializeEvents = function() { | |
| var i = this; | |
| i.initArrowEvents(), i.initDotEvents(), i.initSlideEvents(), i.$list.on("touchstart.slick mousedown.slick", { | |
| action: "start" | |
| }, i.swipeHandler), i.$list.on("touchmove.slick mousemove.slick", { | |
| action: "move" | |
| }, i.swipeHandler), i.$list.on("touchend.slick mouseup.slick", { | |
| action: "end" | |
| }, i.swipeHandler), i.$list.on("touchcancel.slick mouseleave.slick", { | |
| action: "end" | |
| }, i.swipeHandler), i.$list.on("click.slick tap", i.clickHandler), t(document).on(i.visibilityChange, t.proxy(i.visibility, i)), !0 === i.options.accessibility && i.$list.on("keydown.slick", i.keyHandler), !0 === i.options.focusOnSelect && t(i.$slideTrack).children().on("click.slick tap", i.selectHandler), t(window).on("orientationchange.slick.slick-" + i.instanceUid, t.proxy(i.orientationChange, i)), t(window).on("resize.slick.slick-" + i.instanceUid, t.proxy(i.resize, i)), t("[draggable!=true]", i.$slideTrack).on("dragstart", i.preventDefault), t(window).on("load.slick.slick-" + i.instanceUid, i.setPosition), t(document).on("ready.slick.slick-" + i.instanceUid, i.setPosition) | |
| }, i.prototype.initUI = function() { | |
| var t = this; | |
| !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.show(), t.$nextArrow.show()), !0 === t.options.dots && t.slideCount > t.options.slidesToShow && t.$dots.show() | |
| }, i.prototype.keyHandler = function(event) { | |
| var t = this; | |
| event.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === event.keyCode && !0 === t.options.accessibility ? t.changeSlide({ | |
| data: { | |
| message: !0 === t.options.rtl ? "next" : "previous" | |
| } | |
| }) : 39 === event.keyCode && !0 === t.options.accessibility && t.changeSlide({ | |
| data: { | |
| message: !0 === t.options.rtl ? "previous" : "next" | |
| } | |
| })) | |
| }, i.prototype.lazyLoad = function() { | |
| function loadImages(i) { | |
| t("img[data-lazy]", i).each(function() { | |
| var i = t(this), | |
| s = t(this).attr("data-lazy"), | |
| o = document.createElement("img"); | |
| o.onload = function() { | |
| i.animate({ | |
| opacity: 0 | |
| }, 100, function() { | |
| i.attr("src", s).animate({ | |
| opacity: 1 | |
| }, 200, function() { | |
| i.removeAttr("data-lazy").removeClass("slick-loading") | |
| }), l.$slider.trigger("lazyLoaded", [l, i, s]) | |
| }) | |
| }, o.onerror = function() { | |
| i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), l.$slider.trigger("lazyLoadError", [l, i, s]) | |
| }, o.src = s | |
| }) | |
| } | |
| var i, s, o, l = this; | |
| if (!0 === l.options.centerMode ? !0 === l.options.infinite ? o = (s = l.currentSlide + (l.options.slidesToShow / 2 + 1)) + l.options.slidesToShow + 2 : (s = Math.max(0, l.currentSlide - (l.options.slidesToShow / 2 + 1)), | |
| o = l.options.slidesToShow / 2 + 1 + 2 + l.currentSlide) : (s = l.options.infinite ? l.options.slidesToShow + l.currentSlide : l.currentSlide, o = Math.ceil(s + l.options.slidesToShow), !0 === l.options.fade && (s > 0 && s--, o <= l.slideCount && o++)), i = l.$slider.find(".slick-slide").slice(s, o), "anticipated" === l.options.lazyLoad) | |
| for (var u = s - 1, h = o, p = l.$slider.find(".slick-slide"), m = 0; m < l.options.slidesToScroll; m++) u < 0 && (u = l.slideCount - 1), i = (i = i.add(p.eq(u))).add(p.eq(h)), u--, h++; | |
| loadImages(i), l.slideCount <= l.options.slidesToShow ? loadImages(l.$slider.find(".slick-slide")) : l.currentSlide >= l.slideCount - l.options.slidesToShow ? loadImages(l.$slider.find(".slick-cloned").slice(0, l.options.slidesToShow)) : 0 === l.currentSlide && loadImages(l.$slider.find(".slick-cloned").slice(-1 * l.options.slidesToShow)) | |
| }, i.prototype.loadSlider = function() { | |
| var t = this; | |
| t.setPosition(), t.$slideTrack.css({ | |
| opacity: 1 | |
| }), t.$slider.removeClass("slick-loading"), t.initUI(), "progressive" === t.options.lazyLoad && t.progressiveLazyLoad() | |
| }, i.prototype.next = i.prototype.slickNext = function() { | |
| this.changeSlide({ | |
| data: { | |
| message: "next" | |
| } | |
| }) | |
| }, i.prototype.orientationChange = function() { | |
| var t = this; | |
| t.checkResponsive(), t.setPosition() | |
| }, i.prototype.pause = i.prototype.slickPause = function() { | |
| var t = this; | |
| t.autoPlayClear(), t.paused = !0 | |
| }, i.prototype.play = i.prototype.slickPlay = function() { | |
| var t = this; | |
| t.autoPlay(), t.options.autoplay = !0, t.paused = !1, t.focussed = !1, t.interrupted = !1 | |
| }, i.prototype.postSlide = function(index) { | |
| var t = this; | |
| t.unslicked || (t.$slider.trigger("afterChange", [t, index]), t.animating = !1, t.setPosition(), t.swipeLeft = null, t.options.autoplay && t.autoPlay(), !0 === t.options.accessibility && t.initADA()) | |
| }, i.prototype.prev = i.prototype.slickPrev = function() { | |
| this.changeSlide({ | |
| data: { | |
| message: "previous" | |
| } | |
| }) | |
| }, i.prototype.preventDefault = function(event) { | |
| event.preventDefault() | |
| }, i.prototype.progressiveLazyLoad = function(i) { | |
| i = i || 1; | |
| var s, o, l, u = this, | |
| h = t("img[data-lazy]", u.$slider); | |
| h.length ? (s = h.first(), o = s.attr("data-lazy"), (l = document.createElement("img")).onload = function() { | |
| s.attr("src", o).removeAttr("data-lazy").removeClass("slick-loading"), !0 === u.options.adaptiveHeight && u.setPosition(), u.$slider.trigger("lazyLoaded", [u, s, o]), u.progressiveLazyLoad() | |
| }, l.onerror = function() { | |
| i < 3 ? setTimeout(function() { | |
| u.progressiveLazyLoad(i + 1) | |
| }, 500) : (s.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), u.$slider.trigger("lazyLoadError", [u, s, o]), u.progressiveLazyLoad()) | |
| }, l.src = o) : u.$slider.trigger("allImagesLoaded", [u]) | |
| }, i.prototype.refresh = function(i) { | |
| var s, o, l = this; | |
| o = l.slideCount - l.options.slidesToShow, !l.options.infinite && l.currentSlide > o && (l.currentSlide = o), l.slideCount <= l.options.slidesToShow && (l.currentSlide = 0), s = l.currentSlide, l.destroy(!0), t.extend(l, l.initials, { | |
| currentSlide: s | |
| }), l.init(), i || l.changeSlide({ | |
| data: { | |
| message: "index", | |
| index: s | |
| } | |
| }, !1) | |
| }, i.prototype.registerBreakpoints = function() { | |
| var i, s, o, l = this, | |
| u = l.options.responsive || null; | |
| if ("array" === t.type(u) && u.length) { | |
| l.respondTo = l.options.respondTo || "window"; | |
| for (i in u) | |
| if (o = l.breakpoints.length - 1, s = u[i].breakpoint, u.hasOwnProperty(i)) { | |
| for (; o >= 0;) l.breakpoints[o] && l.breakpoints[o] === s && l.breakpoints.splice(o, 1), o--; | |
| l.breakpoints.push(s), l.breakpointSettings[s] = u[i].settings | |
| } | |
| l.breakpoints.sort(function(a, b) { | |
| return l.options.mobileFirst ? a - b : b - a | |
| }) | |
| } | |
| }, i.prototype.reinit = function() { | |
| var i = this; | |
| i.$slides = i.$slideTrack.children(i.options.slide).addClass("slick-slide"), i.slideCount = i.$slides.length, i.currentSlide >= i.slideCount && 0 !== i.currentSlide && (i.currentSlide = i.currentSlide - i.options.slidesToScroll), i.slideCount <= i.options.slidesToShow && (i.currentSlide = 0), i.registerBreakpoints(), i.setProps(), i.setupInfinite(), i.buildArrows(), i.updateArrows(), i.initArrowEvents(), i.buildDots(), i.updateDots(), i.initDotEvents(), i.cleanUpSlideEvents(), i.initSlideEvents(), i.checkResponsive(!1, !0), !0 === i.options.focusOnSelect && t(i.$slideTrack).children().on("click.slick tap", i.selectHandler), i.setSlideClasses("number" == typeof i.currentSlide ? i.currentSlide : 0), i.setPosition(), i.focusHandler(), i.paused = !i.options.autoplay, | |
| i.autoPlay(), i.$slider.trigger("reInit", [i]) | |
| }, i.prototype.resize = function() { | |
| var i = this; | |
| t(window).width() !== i.windowWidth && (clearTimeout(i.windowDelay), i.windowDelay = window.setTimeout(function() { | |
| i.windowWidth = t(window).width(), i.checkResponsive(), i.unslicked || i.setPosition() | |
| }, 50)) | |
| }, i.prototype.removeSlide = i.prototype.slickRemove = function(index, t, i) { | |
| var s = this; | |
| if (index = "boolean" == typeof index ? !0 === (t = index) ? 0 : s.slideCount - 1 : !0 === t ? --index : index, s.slideCount < 1 || index < 0 || index > s.slideCount - 1) return !1; | |
| s.unload(), !0 === i ? s.$slideTrack.children().remove() : s.$slideTrack.children(this.options.slide).eq(index).remove(), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slidesCache = s.$slides, s.reinit() | |
| }, i.prototype.setCSS = function(position) { | |
| var x, y, t = this, | |
| i = {}; | |
| !0 === t.options.rtl && (position = -position), x = "left" == t.positionProp ? Math.ceil(position) + "px" : "0px", y = "top" == t.positionProp ? Math.ceil(position) + "px" : "0px", i[t.positionProp] = position, !1 === t.transformsEnabled ? t.$slideTrack.css(i) : (i = {}, !1 === t.cssTransitions ? (i[t.animType] = "translate(" + x + ", " + y + ")", t.$slideTrack.css(i)) : (i[t.animType] = "translate3d(" + x + ", " + y + ", 0px)", t.$slideTrack.css(i))) | |
| }, i.prototype.setDimensions = function() { | |
| var t = this; | |
| !1 === t.options.vertical ? !0 === t.options.centerMode && t.$list.css({ | |
| padding: "0px " + t.options.centerPadding | |
| }) : (t.$list.height(t.$slides.first().outerHeight(!0) * t.options.slidesToShow), !0 === t.options.centerMode && t.$list.css({ | |
| padding: t.options.centerPadding + " 0px" | |
| })), t.listWidth = t.$list.width(), t.listHeight = t.$list.height(), !1 === t.options.vertical && !1 === t.options.variableWidth ? (t.slideWidth = Math.ceil(t.listWidth / t.options.slidesToShow), t.$slideTrack.width(Math.ceil(t.slideWidth * t.$slideTrack.children(".slick-slide").length))) : !0 === t.options.variableWidth ? t.$slideTrack.width(5e3 * t.slideCount) : (t.slideWidth = Math.ceil(t.listWidth), t.$slideTrack.height(Math.ceil(t.$slides.first().outerHeight(!0) * t.$slideTrack.children(".slick-slide").length))); | |
| var offset = t.$slides.first().outerWidth(!0) - t.$slides.first().width(); | |
| !1 === t.options.variableWidth && t.$slideTrack.children(".slick-slide").width(t.slideWidth - offset) | |
| }, i.prototype.setFade = function() { | |
| var i, s = this; | |
| s.$slides.each(function(index, o) { | |
| i = s.slideWidth * index * -1, !0 === s.options.rtl ? t(o).css({ | |
| position: "relative", | |
| right: i, | |
| top: 0, | |
| zIndex: s.options.zIndex - 2, | |
| opacity: 0 | |
| }) : t(o).css({ | |
| position: "relative", | |
| left: i, | |
| top: 0, | |
| zIndex: s.options.zIndex - 2, | |
| opacity: 0 | |
| }) | |
| }), s.$slides.eq(s.currentSlide).css({ | |
| zIndex: s.options.zIndex - 1, | |
| opacity: 1 | |
| }) | |
| }, i.prototype.setHeight = function() { | |
| var t = this; | |
| if (1 === t.options.slidesToShow && !0 === t.options.adaptiveHeight && !1 === t.options.vertical) { | |
| var i = t.$slides.eq(t.currentSlide).outerHeight(!0); | |
| t.$list.css("height", i) | |
| } | |
| }, i.prototype.setOption = i.prototype.slickSetOption = function() { | |
| var i, item, s, value, type, o = this, | |
| refresh = !1; | |
| if ("object" === t.type(arguments[0]) ? (s = arguments[0], refresh = arguments[1], type = "multiple") : "string" === t.type(arguments[0]) && (s = arguments[0], value = arguments[1], refresh = arguments[2], "responsive" === arguments[0] && "array" === t.type(arguments[1]) ? type = "responsive" : void 0 !== arguments[1] && (type = "single")), "single" === type) o.options[s] = value; | |
| else if ("multiple" === type) t.each(s, function(t, i) { | |
| o.options[t] = i | |
| }); | |
| else if ("responsive" === type) | |
| for (item in value) | |
| if ("array" !== t.type(o.options.responsive)) o.options.responsive = [value[item]]; | |
| else { | |
| for (i = o.options.responsive.length - 1; i >= 0;) o.options.responsive[i].breakpoint === value[item].breakpoint && o.options.responsive.splice(i, 1), i--; | |
| o.options.responsive.push(value[item]) | |
| } | |
| refresh && (o.unload(), o.reinit()) | |
| }, i.prototype.setPosition = function() { | |
| var t = this; | |
| t.setDimensions(), t.setHeight(), !1 === t.options.fade ? t.setCSS(t.getLeft(t.currentSlide)) : t.setFade(), t.$slider.trigger("setPosition", [t]) | |
| }, i.prototype.setProps = function() { | |
| var t = this, | |
| i = document.body.style; | |
| t.positionProp = !0 === t.options.vertical ? "top" : "left", | |
| "top" === t.positionProp ? t.$slider.addClass("slick-vertical") : t.$slider.removeClass("slick-vertical"), void 0 === i.WebkitTransition && void 0 === i.MozTransition && void 0 === i.msTransition || !0 === t.options.useCSS && (t.cssTransitions = !0), t.options.fade && ("number" == typeof t.options.zIndex ? t.options.zIndex < 3 && (t.options.zIndex = 3) : t.options.zIndex = t.defaults.zIndex), void 0 !== i.OTransform && (t.animType = "OTransform", t.transformType = "-o-transform", t.transitionType = "OTransition", void 0 === i.perspectiveProperty && void 0 === i.webkitPerspective && (t.animType = !1)), void 0 !== i.MozTransform && (t.animType = "MozTransform", t.transformType = "-moz-transform", t.transitionType = "MozTransition", void 0 === i.perspectiveProperty && void 0 === i.MozPerspective && (t.animType = !1)), void 0 !== i.webkitTransform && (t.animType = "webkitTransform", t.transformType = "-webkit-transform", t.transitionType = "webkitTransition", void 0 === i.perspectiveProperty && void 0 === i.webkitPerspective && (t.animType = !1)), void 0 !== i.msTransform && (t.animType = "msTransform", t.transformType = "-ms-transform", t.transitionType = "msTransition", void 0 === i.msTransform && (t.animType = !1)), void 0 !== i.transform && !1 !== t.animType && (t.animType = "transform", t.transformType = "transform", t.transitionType = "transition"), t.transformsEnabled = t.options.useTransform && null !== t.animType && !1 !== t.animType | |
| }, i.prototype.setSlideClasses = function(index) { | |
| var t, i, s, o, l = this; | |
| i = l.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), l.$slides.eq(index).addClass("slick-current"), !0 === l.options.centerMode ? (t = Math.floor(l.options.slidesToShow / 2), !0 === l.options.infinite && (index >= t && index <= l.slideCount - 1 - t ? l.$slides.slice(index - t, index + t + 1).addClass("slick-active").attr("aria-hidden", "false") : (s = l.options.slidesToShow + index, i.slice(s - t + 1, s + t + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === index ? i.eq(i.length - 1 - l.options.slidesToShow).addClass("slick-center") : index === l.slideCount - 1 && i.eq(l.options.slidesToShow).addClass("slick-center")), l.$slides.eq(index).addClass("slick-center")) : index >= 0 && index <= l.slideCount - l.options.slidesToShow ? l.$slides.slice(index, index + l.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : i.length <= l.options.slidesToShow ? i.addClass("slick-active").attr("aria-hidden", "false") : (o = l.slideCount % l.options.slidesToShow, s = !0 === l.options.infinite ? l.options.slidesToShow + index : index, l.options.slidesToShow == l.options.slidesToScroll && l.slideCount - index < l.options.slidesToShow ? i.slice(s - (l.options.slidesToShow - o), s + o).addClass("slick-active").attr("aria-hidden", "false") : i.slice(s, s + l.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")), "ondemand" !== l.options.lazyLoad && "anticipated" !== l.options.lazyLoad || l.lazyLoad() | |
| }, i.prototype.setupInfinite = function() { | |
| var i, s, o, l = this; | |
| if (!0 === l.options.fade && (l.options.centerMode = !1), !0 === l.options.infinite && !1 === l.options.fade && (s = null, l.slideCount > l.options.slidesToShow)) { | |
| for (o = !0 === l.options.centerMode ? l.options.slidesToShow + 1 : l.options.slidesToShow, i = l.slideCount; i > l.slideCount - o; i -= 1) s = i - 1, t(l.$slides[s]).clone(!0).attr("id", "").attr("data-slick-index", s - l.slideCount).prependTo(l.$slideTrack).addClass("slick-cloned"); | |
| for (i = 0; i < o; i += 1) s = i, t(l.$slides[s]).clone(!0).attr("id", "").attr("data-slick-index", s + l.slideCount).appendTo(l.$slideTrack).addClass("slick-cloned"); | |
| l.$slideTrack.find(".slick-cloned").find("[id]").each(function() { | |
| t(this).attr("id", "") | |
| }) | |
| } | |
| }, i.prototype.interrupt = function(toggle) { | |
| var t = this; | |
| toggle || t.autoPlay(), t.interrupted = toggle | |
| }, i.prototype.selectHandler = function(event) { | |
| var i = this, | |
| targetElement = t(event.target).is(".slick-slide") ? t(event.target) : t(event.target).parents(".slick-slide"), | |
| index = parseInt(targetElement.attr("data-slick-index"), 10); | |
| if (index || (index = 0), i.slideCount <= i.options.slidesToShow) return i.setSlideClasses(index), void i.asNavFor(index); | |
| i.slideHandler(index) | |
| }, i.prototype.slideHandler = function(index, t, i) { | |
| var s, o, l, u, h, p = null, | |
| m = this; | |
| if (t = t || !1, | |
| (!0 !== m.animating || !0 !== m.options.waitForAnimate) && !(!0 === m.options.fade && m.currentSlide === index || m.slideCount <= m.options.slidesToShow)) | |
| if (!1 === t && m.asNavFor(index), s = index, p = m.getLeft(s), u = m.getLeft(m.currentSlide), m.currentLeft = null === m.swipeLeft ? u : m.swipeLeft, !1 === m.options.infinite && !1 === m.options.centerMode && (index < 0 || index > m.getDotCount() * m.options.slidesToScroll)) !1 === m.options.fade && (s = m.currentSlide, !0 !== i ? m.animateSlide(u, function() { | |
| m.postSlide(s) | |
| }) : m.postSlide(s)); | |
| else if (!1 === m.options.infinite && !0 === m.options.centerMode && (index < 0 || index > m.slideCount - m.options.slidesToScroll)) !1 === m.options.fade && (s = m.currentSlide, !0 !== i ? m.animateSlide(u, function() { | |
| m.postSlide(s) | |
| }) : m.postSlide(s)); | |
| else { | |
| if (m.options.autoplay && clearInterval(m.autoPlayTimer), o = s < 0 ? m.slideCount % m.options.slidesToScroll != 0 ? m.slideCount - m.slideCount % m.options.slidesToScroll : m.slideCount + s : s >= m.slideCount ? m.slideCount % m.options.slidesToScroll != 0 ? 0 : s - m.slideCount : s, m.animating = !0, m.$slider.trigger("beforeChange", [m, m.currentSlide, o]), l = m.currentSlide, m.currentSlide = o, m.setSlideClasses(m.currentSlide), m.options.asNavFor && (h = (h = m.getNavTarget()).slick("getSlick")).slideCount <= h.options.slidesToShow && h.setSlideClasses(m.currentSlide), m.updateDots(), m.updateArrows(), !0 === m.options.fade) return !0 !== i ? (m.fadeSlideOut(l), m.fadeSlide(o, function() { | |
| m.postSlide(o) | |
| })) : m.postSlide(o), void m.animateHeight(); | |
| !0 !== i ? m.animateSlide(p, function() { | |
| m.postSlide(o) | |
| }) : m.postSlide(o) | |
| } | |
| }, i.prototype.startLoad = function() { | |
| var t = this; | |
| !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.hide(), t.$nextArrow.hide()), !0 === t.options.dots && t.slideCount > t.options.slidesToShow && t.$dots.hide(), t.$slider.addClass("slick-loading") | |
| }, i.prototype.swipeDirection = function() { | |
| var t, i, r, s, o = this; | |
| return t = o.touchObject.startX - o.touchObject.curX, i = o.touchObject.startY - o.touchObject.curY, r = Math.atan2(i, t), (s = Math.round(180 * r / Math.PI)) < 0 && (s = 360 - Math.abs(s)), s <= 45 && s >= 0 ? !1 === o.options.rtl ? "left" : "right" : s <= 360 && s >= 315 ? !1 === o.options.rtl ? "left" : "right" : s >= 135 && s <= 225 ? !1 === o.options.rtl ? "right" : "left" : !0 === o.options.verticalSwiping ? s >= 35 && s <= 135 ? "down" : "up" : "vertical" | |
| }, i.prototype.swipeEnd = function(event) { | |
| var t, direction, i = this; | |
| if (i.dragging = !1, i.interrupted = !1, i.shouldClick = !(i.touchObject.swipeLength > 10), void 0 === i.touchObject.curX) return !1; | |
| if (!0 === i.touchObject.edgeHit && i.$slider.trigger("edge", [i, i.swipeDirection()]), i.touchObject.swipeLength >= i.touchObject.minSwipe) { | |
| switch (direction = i.swipeDirection()) { | |
| case "left": | |
| case "down": | |
| t = i.options.swipeToSlide ? i.checkNavigable(i.currentSlide + i.getSlideCount()) : i.currentSlide + i.getSlideCount(), i.currentDirection = 0; | |
| break; | |
| case "right": | |
| case "up": | |
| t = i.options.swipeToSlide ? i.checkNavigable(i.currentSlide - i.getSlideCount()) : i.currentSlide - i.getSlideCount(), i.currentDirection = 1 | |
| } | |
| "vertical" != direction && (i.slideHandler(t), i.touchObject = {}, i.$slider.trigger("swipe", [i, direction])) | |
| } else i.touchObject.startX !== i.touchObject.curX && (i.slideHandler(i.currentSlide), i.touchObject = {}) | |
| }, i.prototype.swipeHandler = function(event) { | |
| var t = this; | |
| if (!(!1 === t.options.swipe || "ontouchend" in document && !1 === t.options.swipe || !1 === t.options.draggable && -1 !== event.type.indexOf("mouse"))) switch (t.touchObject.fingerCount = event.originalEvent && void 0 !== event.originalEvent.touches ? event.originalEvent.touches.length : 1, t.touchObject.minSwipe = t.listWidth / t.options.touchThreshold, !0 === t.options.verticalSwiping && (t.touchObject.minSwipe = t.listHeight / t.options.touchThreshold), event.data.action) { | |
| case "start": | |
| t.swipeStart(event); | |
| break; | |
| case "move": | |
| t.swipeMove(event); | |
| break; | |
| case "end": | |
| t.swipeEnd(event) | |
| } | |
| }, i.prototype.swipeMove = function(event) { | |
| var t, i, s, o, touches, l = this; | |
| return touches = void 0 !== event.originalEvent ? event.originalEvent.touches : null, !(!l.dragging || touches && 1 !== touches.length) && (t = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== touches ? touches[0].pageX : event.clientX, l.touchObject.curY = void 0 !== touches ? touches[0].pageY : event.clientY, | |
| l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), !0 === l.options.verticalSwiping && (l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2)))), "vertical" !== (i = l.swipeDirection()) ? (void 0 !== event.originalEvent && l.touchObject.swipeLength > 4 && event.preventDefault(), o = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (o = l.touchObject.curY > l.touchObject.startY ? 1 : -1), s = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === i || l.currentSlide >= l.getDotCount() && "left" === i) && (s = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = t + s * o : l.swipeLeft = t + s * (l.$list.height() / l.listWidth) * o, !0 === l.options.verticalSwiping && (l.swipeLeft = t + s * o), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft))) : void 0) | |
| }, i.prototype.swipeStart = function(event) { | |
| var touches, t = this; | |
| if (t.interrupted = !0, 1 !== t.touchObject.fingerCount || t.slideCount <= t.options.slidesToShow) return t.touchObject = {}, !1; | |
| void 0 !== event.originalEvent && void 0 !== event.originalEvent.touches && (touches = event.originalEvent.touches[0]), t.touchObject.startX = t.touchObject.curX = void 0 !== touches ? touches.pageX : event.clientX, t.touchObject.startY = t.touchObject.curY = void 0 !== touches ? touches.pageY : event.clientY, t.dragging = !0 | |
| }, i.prototype.unfilterSlides = i.prototype.slickUnfilter = function() { | |
| var t = this; | |
| null !== t.$slidesCache && (t.unload(), t.$slideTrack.children(this.options.slide).detach(), t.$slidesCache.appendTo(t.$slideTrack), t.reinit()) | |
| }, i.prototype.unload = function() { | |
| var i = this; | |
| t(".slick-cloned", i.$slider).remove(), i.$dots && i.$dots.remove(), i.$prevArrow && i.htmlExpr.test(i.options.prevArrow) && i.$prevArrow.remove(), i.$nextArrow && i.htmlExpr.test(i.options.nextArrow) && i.$nextArrow.remove(), i.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") | |
| }, i.prototype.unslick = function(t) { | |
| var i = this; | |
| i.$slider.trigger("unslick", [i, t]), i.destroy() | |
| }, i.prototype.updateArrows = function() { | |
| var t = this; | |
| Math.floor(t.options.slidesToShow / 2), !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && !t.options.infinite && (t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), t.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === t.currentSlide ? (t.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : t.currentSlide >= t.slideCount - t.options.slidesToShow && !1 === t.options.centerMode ? (t.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : t.currentSlide >= t.slideCount - 1 && !0 === t.options.centerMode && (t.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))) | |
| }, i.prototype.updateDots = function() { | |
| var t = this; | |
| null !== t.$dots && (t.$dots.find("li").removeClass("slick-active").attr("aria-hidden", "true"), t.$dots.find("li").eq(Math.floor(t.currentSlide / t.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden", "false")) | |
| }, i.prototype.visibility = function() { | |
| var t = this; | |
| t.options.autoplay && (document[t.hidden] ? t.interrupted = !0 : t.interrupted = !1) | |
| }, t.fn.slick = function() { | |
| var t, s, o = this, | |
| l = arguments[0], | |
| u = Array.prototype.slice.call(arguments, 1), | |
| h = o.length; | |
| for (t = 0; t < h; t++) | |
| if ("object" == typeof l || void 0 === l ? o[t].slick = new i(o[t], l) : s = o[t].slick[l].apply(o[t].slick, u), void 0 !== s) return s; | |
| return o | |
| } | |
| }), window.matchMedia || (window.matchMedia = function() { | |
| "use strict"; | |
| var styleMedia = window.styleMedia || window.media; | |
| if (!styleMedia) { | |
| var style = document.createElement("style"), | |
| t = document.getElementsByTagName("script")[0], | |
| info = null; | |
| style.type = "text/css", style.id = "matchmediajs-test", | |
| t.parentNode.insertBefore(style, t), info = "getComputedStyle" in window && window.getComputedStyle(style, null) || style.currentStyle, styleMedia = { | |
| matchMedium: function(media) { | |
| var text = "@media " + media + "{ #matchmediajs-test { width: 1px; } }"; | |
| return style.styleSheet ? style.styleSheet.cssText = text : style.textContent = text, "1px" === info.width | |
| } | |
| } | |
| } | |
| return function(media) { | |
| return { | |
| matches: styleMedia.matchMedium(media || "all"), | |
| media: media || "all" | |
| } | |
| } | |
| }()), | |
| function($) { | |
| var escapeable = /["\\\x00-\x1f\x7f-\x9f]/g, | |
| meta = { | |
| "\b": "\\b", | |
| "\t": "\\t", | |
| "\n": "\\n", | |
| "\f": "\\f", | |
| "\r": "\\r", | |
| '"': '\\"', | |
| "\\": "\\\\" | |
| }; | |
| $.toJSON = "object" == typeof JSON && JSON.stringify ? JSON.stringify : function(t) { | |
| if (null === t) return "null"; | |
| var type = typeof t; | |
| if ("undefined" !== type) { | |
| if ("number" === type || "boolean" === type) return "" + t; | |
| if ("string" === type) return $.quoteString(t); | |
| if ("object" === type) { | |
| if ("function" == typeof t.toJSON) return $.toJSON(t.toJSON()); | |
| if (t.constructor === Date) { | |
| var i = t.getUTCMonth() + 1, | |
| s = t.getUTCDate(), | |
| o = t.getUTCFullYear(), | |
| l = t.getUTCHours(), | |
| u = t.getUTCMinutes(), | |
| h = t.getUTCSeconds(), | |
| p = t.getUTCMilliseconds(); | |
| return i < 10 && (i = "0" + i), s < 10 && (s = "0" + s), l < 10 && (l = "0" + l), u < 10 && (u = "0" + u), h < 10 && (h = "0" + h), p < 100 && (p = "0" + p), p < 10 && (p = "0" + p), '"' + o + "-" + i + "-" + s + "T" + l + ":" + u + ":" + h + "." + p + 'Z"' | |
| } | |
| if (t.constructor === Array) { | |
| for (var m = [], _ = 0; _ < t.length; _++) m.push($.toJSON(t[_]) || "null"); | |
| return "[" + m.join(",") + "]" | |
| } | |
| var name, g, S = []; | |
| for (var T in t) { | |
| if ("number" == (type = typeof T)) name = '"' + T + '"'; | |
| else { | |
| if ("string" !== type) continue; | |
| name = $.quoteString(T) | |
| } | |
| "function" !== (type = typeof t[T]) && "undefined" !== type && (g = $.toJSON(t[T]), S.push(name + ":" + g)) | |
| } | |
| return "{" + S.join(",") + "}" | |
| } | |
| } | |
| }, $.evalJSON = "object" == typeof JSON && JSON.parse ? JSON.parse : function(src) { | |
| return eval("(" + src + ")") | |
| }, $.secureEvalJSON = "object" == typeof JSON && JSON.parse ? JSON.parse : function(src) { | |
| var filtered = src.replace(/\\["\\\/bfnrtu]/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""); | |
| if (/^[\],:{}\s]*$/.test(filtered)) return eval("(" + src + ")"); | |
| throw new SyntaxError("Error parsing JSON, source is not valid.") | |
| }, $.quoteString = function(t) { | |
| return t.match(escapeable) ? '"' + t.replace(escapeable, function(a) { | |
| var c = meta[a]; | |
| return "string" == typeof c ? c : (c = a.charCodeAt(), "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16)) | |
| }) + '"' : '"' + t + '"' | |
| } | |
| }(jQuery), | |
| function() { | |
| function GAPlugin() {} | |
| var t = window.PhoneGap || window.Cordova || window.cordova; | |
| GAPlugin.prototype.trackEvent = function(i, s, category, o, l, u) { | |
| return t.exec(i, s, "GAPlugin", "trackEvent", [category, o, l, u]) | |
| }, GAPlugin.prototype.trackPage = function(i, s, o) { | |
| return t.exec(i, s, "GAPlugin", "trackPage", [o]) | |
| }, window.plugins || (window.plugins = {}), window.plugins.gaPlugin || (window.plugins.gaPlugin = new GAPlugin) | |
| }(), | |
| function() { | |
| function Utilities() {} | |
| var t = window.PhoneGap || window.Cordova || window.cordova; | |
| Utilities.prototype.getFreeDiskSpace = function(i, s) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "Utilities", "getFreeDiskSpace", []) | |
| }, Utilities.prototype.getAppVersion = function(i, s) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "Utilities", "getAppVersion", []) | |
| }, Utilities.prototype.getPNToken = function(t, i) { | |
| "function" == typeof t && "function" == typeof i && t() | |
| }, Utilities.prototype.getDeepLink = function(i, s) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "Utilities", "getDeepLink", []) | |
| }, Utilities.prototype.registerNimble = function(i, s, o) { | |
| "function" == typeof s && "function" == typeof o && t.exec(s, o, "Utilities", "registerNimble", [i]) | |
| }, Utilities.prototype.showStoreAppPage = function(i, s) { | |
| if ("function" == typeof i && "function" == typeof s) { | |
| var id = getAppId(); | |
| t.exec(i, s, "Utilities", "showStoreAppPage", [id]) | |
| } | |
| }, Utilities.prototype.showStatusBar = function(t, i) { | |
| "function" == typeof t && "function" == typeof i && t() | |
| }, Utilities.prototype.setStatusBarStyle = function(t, i, style) { | |
| "function" == typeof t && "function" == typeof i && t() | |
| }, window.plugins || (window.plugins = {}), window.plugins.utilities = new Utilities | |
| }(), | |
| function() { | |
| function PluginResourceCache() {} | |
| var t = window.PhoneGap || window.Cordova || window.cordova; | |
| PluginResourceCache.prototype.isResourceAvailable = function(t, i, s, o) { | |
| this.getCachedResource(function(i, path) { | |
| t("" !== path) | |
| }, i, s, o) | |
| }, PluginResourceCache.prototype.getCachedResource = function(i, s, o, l) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "PluginResourceCache", "getCachedResource", [{ | |
| resourcePath: o, | |
| baseUrl: l | |
| }]) | |
| }, PluginResourceCache.prototype.cacheResource = function(i, s, o, l) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "PluginResourceCache", "cacheResource", [{ | |
| resourcePath: o, | |
| baseUrl: l | |
| }]) | |
| }, PluginResourceCache.prototype.clearCache = function(i, s) { | |
| "function" == typeof i && "function" == typeof s && t.exec(i, s, "PluginResourceCache", "clearCache", []) | |
| }; | |
| window.plugins || (window.plugins = {}), window.plugins.resCache = new PluginResourceCache, PluginResourceCache.UNKNOWN_ERROR = 0 | |
| }(); | |
| var SPLASH_SCREEN_HIDE_DELAY = 50, | |
| RESUME_REFRESH_THRESHOLD = 60, | |
| DEVICE_PIXEL_RATIO = Math.round(window.devicePixelRatio) || 1, | |
| CLIENT_VERSION = 1, | |
| PREV_GAME_NAME = "fifa17", | |
| GAME_NAME = "fifa18", | |
| STORAGE_LOCALE_KEY = "loc", | |
| ALEX_HUNTER_MIN_ID = 22800, | |
| ALEX_HUNTER_MAX_ID = 22811, | |
| ALEX_HUNTER_PLACEHOLDER_ASSET_ID = 26501, | |
| DANNY_WILLIAMS_MIN_ID = 22880, | |
| DANNY_WILLIAMS_MAX_ID = 22899, | |
| DANNY_WILLIAMS_PLACEHOLDER_ASSET_ID = 26503, | |
| AUCTION_MIN_BUY = 200, | |
| AUCTION_MIN_BID = 150, | |
| AUCTION_MAX_BID = 15e6, | |
| PLAYSTYLE_CHEMISTRY_THRESHOLD = 4, | |
| MONTH_NAMES = ["date.january", "date.february", "date.march", "date.april", "date.may", "date.june", "date.july", "date.august", "date.september", "date.october", "date.november", "date.december"], | |
| TOP_NINE_NATIONS = [52, 54, 14, 18, 21, 34, 27, 38, 45], | |
| SEARCHABLE_POSITIONS = [0, 2, 3, 5, 7, 8, 10, 12, 14, 16, 18, 20, 21, 22, 23, 25, 27], | |
| PLAYER_ATTRIB_LOOKUP = ["pace", "shooting", "passing", "dribbling", "defending", "heading"], | |
| GK_ATTRIB_LOOKUP = ["gkDiving", "gkHandling", "gkKicking", "gkReflexes", "gkOneOnOne", "gkPositioning"], | |
| HEALTH_ATTRIB_LOOKUP = ["physioArm", "physioBack", "physioFoot", "physioHead", "physioHip", "physioLeg", "physioShoudler", "fitness", "managerTalk", "physioAll"], | |
| ZONE_DEFENDER_VALUE = "defense", | |
| ZONE_MIDFIELDER_VALUE = "midfield", | |
| ZONE_ATTACKER_VALUE = "attacker", | |
| ZONE_NO_GK_VALUE = "noGK", | |
| PLAYER_ZONE_LOOKUP = [{ | |
| id: -1, | |
| label: "roles.defaultRole", | |
| value: "any" | |
| }, { | |
| id: 130, | |
| label: "search.positions.zone130", | |
| value: ZONE_DEFENDER_VALUE | |
| }, { | |
| id: 131, | |
| label: "search.positions.zone131", | |
| value: ZONE_MIDFIELDER_VALUE | |
| }, { | |
| id: 132, | |
| label: "search.positions.zone132", | |
| value: ZONE_ATTACKER_VALUE | |
| }, { | |
| id: 133, | |
| label: "roles.defaultRole", | |
| value: ZONE_NO_GK_VALUE | |
| }], | |
| POSITION_ZONE_LOOKUP = [{ | |
| value: ZONE_DEFENDER_VALUE, | |
| minPosId: 1, | |
| maxPosId: 8 | |
| }, { | |
| value: ZONE_MIDFIELDER_VALUE, | |
| minPosId: 9, | |
| maxPosId: 19 | |
| }, { | |
| value: ZONE_ATTACKER_VALUE, | |
| minPosId: 20, | |
| maxPosId: 27 | |
| }, { | |
| value: ZONE_NO_GK_VALUE, | |
| minPosId: 1, | |
| maxPosId: 27 | |
| }], | |
| STRING_EQUALITY_LOOKUP = [{ | |
| equivalent: "a", | |
| characters: "àáâãäåāăą" | |
| }, { | |
| equivalent: "ae", | |
| characters: "æ" | |
| }, { | |
| equivalent: "c", | |
| characters: "çćĉċč" | |
| }, { | |
| equivalent: "d", | |
| characters: "ďđ" | |
| }, { | |
| equivalent: "e", | |
| characters: "èéêëēĕėęě" | |
| }, { | |
| equivalent: "g", | |
| characters: "ĝğġģ" | |
| }, { | |
| equivalent: "h", | |
| characters: "ĥ" | |
| }, { | |
| equivalent: "i", | |
| characters: "ìíîïĩīĭįı" | |
| }, { | |
| equivalent: "j", | |
| characters: "ĵ" | |
| }, { | |
| equivalent: "k", | |
| characters: "ķ" | |
| }, { | |
| equivalent: "l", | |
| characters: "ĺļľŀł" | |
| }, { | |
| equivalent: "n", | |
| characters: "ñńņňʼn" | |
| }, { | |
| equivalent: "o", | |
| characters: "òóôõöōŏőø" | |
| }, { | |
| equivalent: "r", | |
| characters: "ŕŗř" | |
| }, { | |
| equivalent: "s", | |
| characters: "śŝşš" | |
| }, { | |
| equivalent: "t", | |
| characters: "ţťŧ" | |
| }, { | |
| equivalent: "u", | |
| characters: "ùúûüũūŭůűų" | |
| }, { | |
| equivalent: "y", | |
| characters: "ýŷ" | |
| }, { | |
| equivalent: "z", | |
| characters: "źżž" | |
| }], | |
| DEFAULT_PLAYSTYLE_ID = 250, | |
| DEFAULT_FORMATION = "f442", | |
| MAX_NEW_ITEMS = 5, | |
| MIN_SQUAD_NAME_LENGTH = 3, | |
| MAX_SQUAD_NAME_LENGTH = 15, | |
| MAX_ITEMS_REQUEST = 90, | |
| NamespaceManager = {}; | |
| NamespaceManager.Register = function(t) { | |
| function registerObjs(t, parent) { | |
| var name = t.shift(); | |
| parent && name && (parent[name] || (parent[name] = {}), registerObjs(t, parent[name])) | |
| } | |
| registerObjs(t.split("."), window) | |
| }, NamespaceManager.Register("utils"), utils.JS = {}, utils.JS.isValid = function(value) { | |
| return void 0 !== value && null !== value | |
| }, utils.JS.isEmpty = function(value) { | |
| return void 0 === value || null === value || utils.JS.isString(value) && "" === value.trim() | |
| }, utils.JS.isString = function(value) { | |
| return "string" == typeof value | |
| }, utils.JS.isNumber = function(value) { | |
| return "number" == typeof value && isFinite(value) | |
| }, utils.JS.isBoolean = function(value) { | |
| return "boolean" == typeof value | |
| }, utils.JS.isObject = function(value) { | |
| return "object" == typeof value && null !== value && !Array.isArray(value) | |
| }, utils.JS.isFunction = function(t) { | |
| return "[object Function]" === Object.prototype.toString.call(t) | |
| }, utils.JS.getDefinitionByName = function(className) { | |
| var t, i, s = className.split("."), | |
| o = window || this, | |
| l = s.length; | |
| for (i = 0; i < l; ++i) o = o[s[i]], i === l - 1 && (t = o); | |
| return t | |
| }, utils.JS.parseNumber = function parseNumber(t, locale) { | |
| var i = 1.1.toLocaleString(locale), | |
| s = new RegExp("[^-+0-9$" + i.charAt(1) + "]", "g"); | |
| return parseFloat(t.replace(s, "").replace(i.charAt(1), ".")) | |
| }, utils.JS.formatTimeForServer = function(timeStamp) { | |
| return timeStamp.split(/[+ .]/)[0].replace(/[\- :]/g, "") + "Z" | |
| }, utils.JS.parseDateString = function(t) { | |
| var i = t.split(/[\- T : . + Z]/), | |
| s = -1 !== t.indexOf("+"), | |
| o = parseInt(i[0], 10), | |
| l = parseInt(i[1], 10) - 1, | |
| u = parseInt(i[2], 10), | |
| h = parseInt(i[3], 10), | |
| p = parseInt(i[4], 10), | |
| m = parseInt(i[5], 10), | |
| _ = i[6], | |
| g = 0; | |
| if (4 === _.length) { | |
| var S = _.substring(0, 2), | |
| T = parseInt(S, 10), | |
| v = _.substring(2); | |
| g = 1e3 * (3600 * T + 60 * parseInt(v, 10)), s || (g = -g) | |
| } | |
| return new Date(Date.UTC(o, l, u, h, p, m) + g) | |
| }, utils.JS.inherits = function inherits(t, i) { | |
| t.prototype = Object.create(i.prototype), Object.defineProperty(t.prototype, "constructor", { | |
| value: t, | |
| writable: !1, | |
| enumerable: !1 | |
| }), t.superClass_ = i.prototype | |
| }, utils.JS.find = function find(t, i) { | |
| if (!utils.JS.isValid(t) || "function" != typeof i) return utils.Debug.Assert(utils.JS.isValid(t), "Array find method called without a valid array."), utils.Debug.Assert("function" == typeof i, "Array find method called without a valid callback function."), null; | |
| var s; | |
| for (s = 0; s < t.length; s++) | |
| if (i(t[s], s, t)) return t[s]; | |
| return null | |
| }, utils.JS.getSortedKeys = function getSortedKeys(t) { | |
| var keys = [], | |
| key = null; | |
| for (key in t) t.hasOwnProperty(key) && keys.push(key); | |
| return keys.sort(function(a, b) { | |
| return t[b] - t[a] | |
| }) | |
| }, utils.JS.sortCompare = function sortCompare(a, b, reverse) { | |
| return a < b ? reverse ? 1 : -1 : a > b ? reverse ? -1 : 1 : 0 | |
| }, utils.JS.getRandomArrayValues = function getRandomArrayValues(t, i) { | |
| return t.sort(function(a, b) { | |
| return .5 - Math.random() | |
| }).slice(0, i) | |
| }, utils.JS.createEvent = function createEvent(type) { | |
| var event; | |
| try { | |
| event = new Event(type) | |
| } catch (t) { | |
| (event = document.createEvent("Event")).initEvent(type, !1, !1) | |
| } | |
| return event | |
| }, NamespaceManager.Register("utils"), utils.FUTData = {}, utils.FUTData.mapSkuToCurrentYear = function mapSkuToCurrentYear(t) { | |
| switch (t) { | |
| case enums.SKU.XBX: | |
| case enums.SKU.PREV_XBX: | |
| return enums.SKU.XBX; | |
| case enums.SKU.XBO: | |
| case enums.SKU.PREV_XBO: | |
| return enums.SKU.XBO; | |
| case enums.SKU.PS3: | |
| case enums.SKU.PREV_PS3: | |
| return enums.SKU.PS3; | |
| case enums.SKU.PS4: | |
| case enums.SKU.PREV_PS4: | |
| return enums.SKU.PS4; | |
| case enums.SKU.PC: | |
| case enums.SKU.PREV_PC: | |
| return enums.SKU.PC; | |
| case enums.SKU.SWI: | |
| case enums.SKU.PREV_SWI: | |
| return enums.SKU.SWI | |
| } | |
| return enums.SKU.NONE | |
| }, utils.FUTData.mapSkuToPreviousYear = function mapSkuToPreviousYear(t) { | |
| switch (t) { | |
| case enums.SKU.XBX: | |
| case enums.SKU.PREV_XBX: | |
| return enums.SKU.PREV_XBX; | |
| case enums.SKU.XBO: | |
| case enums.SKU.PREV_XBO: | |
| return enums.SKU.PREV_XBO; | |
| case enums.SKU.PS3: | |
| case enums.SKU.PREV_PS3: | |
| return enums.SKU.PREV_PS3; | |
| case enums.SKU.PS4: | |
| case enums.SKU.PREV_PS4: | |
| return enums.SKU.PREV_PS4; | |
| case enums.SKU.PC: | |
| case enums.SKU.PREV_PC: | |
| return enums.SKU.PREV_PC; | |
| case enums.SKU.SWI: | |
| case enums.SKU.PREV_SWI: | |
| return enums.SKU.PREV_SWI | |
| } | |
| return enums.SKU.NONE | |
| }, utils.FUTData.mapSkuToPlatform = function mapSkuToPlatform(t) { | |
| switch (t) { | |
| case enums.SKU.XBX: | |
| case enums.SKU.PREV_XBX: | |
| return enums.Platform.XBX; | |
| case enums.SKU.XBO: | |
| case enums.SKU.PREV_XBO: | |
| return enums.Platform.XBO; | |
| case enums.SKU.PS3: | |
| case enums.SKU.PREV_PS3: | |
| return enums.Platform.PS3; | |
| case enums.SKU.PS4: | |
| case enums.SKU.PREV_PS4: | |
| return enums.Platform.PS4; | |
| case enums.SKU.PC: | |
| case enums.SKU.PREV_PC: | |
| return enums.Platform.PC; | |
| case enums.SKU.SWI: | |
| case enums.SKU.PREV_SWI: | |
| return enums.Platform.SWI | |
| } | |
| return enums.Platform.NONE | |
| }, utils.FUTData.mapNationIdToOnboardingCountryId = function mapNationIdToOnboardingCountryId(id) { | |
| switch (id) { | |
| case enums.Country.ENGLAND: | |
| return 1; | |
| case enums.Country.BRAZIL: | |
| return 2; | |
| case enums.Country.FRANCE: | |
| return 3; | |
| case enums.Country.ARGENTINA: | |
| return 4; | |
| case enums.Country.GERMANY: | |
| return 5; | |
| case enums.Country.ITALY: | |
| return 6; | |
| case enums.Country.SPAIN: | |
| return 7; | |
| case enums.Country.PORTUGAL: | |
| return 8; | |
| case enums.Country.NETHERLANDS: | |
| return 9 | |
| } | |
| return 0 | |
| }, utils.FUTData.mapOnboardingCountryIdToNationId = function mapOnboardingCountryIdToNationId(id) { | |
| switch (id) { | |
| case 1: | |
| return enums.Country.ENGLAND; | |
| case 2: | |
| return enums.Country.BRAZIL; | |
| case 3: | |
| return enums.Country.FRANCE; | |
| case 4: | |
| return enums.Country.ARGENTINA; | |
| case 5: | |
| return enums.Country.GERMANY; | |
| case 6: | |
| return enums.Country.ITALY; | |
| case 7: | |
| return enums.Country.SPAIN; | |
| case 8: | |
| return enums.Country.PORTUGAL; | |
| case 9: | |
| return enums.Country.NETHERLANDS | |
| } | |
| return 0 | |
| }, NamespaceManager.Register("enums"), enums.AuctionBidState = { | |
| BUYNOW: "buyNow", | |
| HIGHEST: "highest", | |
| NONE: "none", | |
| OUTBID: "outbid" | |
| }, Object.freeze(enums.AuctionBidState), enums.AuctionTradeState = { | |
| ACTIVE: "active", | |
| CLOSED: "closed", | |
| EXPIRED: "expired", | |
| INACTIVE: "inactive", | |
| INVALID: "invalid" | |
| }, Object.freeze(enums.AuctionTradeState), NamespaceManager.Register("enums"), enums.SessionProtocol = { | |
| HTTP: "http", | |
| HTTPS: "https" | |
| }, Object.freeze(enums.SessionProtocol), enums.AuthEnvironment = { | |
| NONE: 0, | |
| UTAS: 1, | |
| PAS: 2 | |
| }, Object.freeze(enums.AuthEnvironment), enums.AuthenticationState = { | |
| STATE_UNAUTHENTICATED: "UNAUTHENTICATED", | |
| STATE_AUTHENTICATING: "AUTHENTICATING", | |
| STATE_AUTHENTICATED: "AUTHENTICATED", | |
| STATE_AUTHENTICATION_FAILED: "AUTHENTICATION_FAILED" | |
| }, Object.freeze(enums.AuthenticationState), enums.UserState = { | |
| NONE: "", | |
| RETURNING_USER_EXPIRED: "RETURNING_USER_EXPIRED" | |
| }, Object.freeze(enums.UserState), enums.FUTAuthState = { | |
| NO_DATA: 0, | |
| SERVER_DOWN: 1, | |
| CONCURRENT_SESSION: 2, | |
| NEW_TRIAL_USER: 3, | |
| ACCOUNT_LOCKED: 4, | |
| NO_SECURITY_QUESTION: 5, | |
| COMPLETE: 6 | |
| }, Object.freeze(enums.FUTAuthState), enums.Platform = { | |
| NONE: "", | |
| XBX: "XBX", | |
| XBO: "XBO", | |
| PS3: "PS3", | |
| PS4: "PS4", | |
| PC: "PC", | |
| SWI: "SWI" | |
| }, Object.freeze(enums.Platform), enums.SKU = { | |
| NONE: "", | |
| XBX: "FFA18XBX", | |
| XBO: "FFA18XBO", | |
| PS3: "FFA18PS3", | |
| PS4: "FFA18PS4", | |
| PC: "FFA18PCC", | |
| SWI: "FFA18SWI", | |
| PREV_XBX: "FFA17XBX", | |
| PREV_XBO: "FFA17XBO", | |
| PREV_PS3: "FFA17PS3", | |
| PREV_PS4: "FFA17PS4", | |
| PREV_PC: "FFA17PCC", | |
| PREV_SWI: "FFA18SWI" | |
| }, enums.SKU.FUT = "FUT18WEB", Object.freeze(enums.SKU), NamespaceManager.Register("enums"), enums.Event = { | |
| CLICK: "click", | |
| MOUSEDOWN: "mousedown", | |
| MOUSEMOVE: "mousemove", | |
| MOUSEUP: "mouseup", | |
| MOUSELEAVE: "mouseleave", | |
| MOUSEENTER: "mouseenter", | |
| MOUSECANCEL: "mousecancel", | |
| TOUCHSTART: "touchstart", | |
| TOUCHEND: "touchend", | |
| TOUCHMOVE: "touchmove", | |
| TOUCHCANCEL: "touchcancel", | |
| TOUCHLEAVE: "touchleave", | |
| FOCUS: "focus", | |
| BLUR: "blur", | |
| CHANGE: "change", | |
| INPUT: "input", | |
| CUT: "cut", | |
| PASTE: "paste", | |
| TAP: "tap", | |
| ANIMATIONSTART: "animationstart webkitAnimationStart", | |
| ANIMATIONEND: "animationend webkitAnimationEnd", | |
| TRANSITIONEND: "transitionend webkitTransitionEnd", | |
| RESIZE: "resize", | |
| LOAD: "load", | |
| ERROR: "error", | |
| KEYDOWN: "keydown", | |
| KEYUP: "keyup" | |
| }, Object.freeze(enums.Event), enums.UIItemNavigationEvent = { | |
| NEXT: "next", | |
| PREV: "prev" | |
| }, Object.freeze(enums.UIItemNavigationEvent), enums.UIPaginationEvent = { | |
| NEXT: "paginationnext", | |
| PREVIOUS: "paginationprev" | |
| }, Object.freeze(enums.UIPaginationEvent), enums.UIListEvent = { | |
| ROW_ACTION: "rowaction", | |
| ROW_SELECT: "rowselect" | |
| }, Object.freeze(enums.UIListEvent), enums.UIPackEvent = { | |
| OPEN: "open", | |
| BUY_COINS: "buyCoins", | |
| BUY_POINTS: "buyPoints" | |
| }, Object.freeze(enums.UIPackEvent), enums.UIItemActionEvent = { | |
| BIO: "itemBio", | |
| REDEEM: "itemRedeem", | |
| APPLY_CONSUMABLE: "itemApplyConsumable", | |
| ACTIVATE: "itemActivate", | |
| SEND_TO_CLUB: "itemSendToClub", | |
| SEND_TO_TRANSFERS: "itemSendToTransfers", | |
| SEND_TO_SQUAD: "itemSendToSquad", | |
| DISCARD: "itemDiscard", | |
| REMOVE_FROM_SQUAD: "itemRemoveFromSquad", | |
| ADD_SWAP: "itemAddSwap", | |
| LIST_ON_MARKET: "itemListOnMarket", | |
| COMPARE: "itemCompare", | |
| SEARCH_ON_MARKET: "itemSearchOnMarket" | |
| }, Object.freeze(enums.UIItemActionEvent), enums.UISquadPitchEvent = { | |
| DRAG_START: "squadDragStart", | |
| DRAG_END: "squadDragEnd", | |
| ITEM_SWAP: "squadItemSwap", | |
| SLOT_SELECT: "squadSlotSelect" | |
| }, Object.freeze(enums.UISquadPitchEvent), NamespaceManager.Register("enums"), enums.FOSService = {}, enums.FOSService.EASFC = "SERVICE_EASFC", enums.FOSService.FUT = "SERVICE_FUT", NamespaceManager.Register("enums"), enums.Product = { | |
| WEB: "Web", | |
| COMPANION: "Companion" | |
| }, Object.freeze(enums.Product), enums.Year = { | |
| YEAR_2009: 1, | |
| YEAR_2010: 2, | |
| YEAR_2011: 3, | |
| YEAR_2012: 4, | |
| YEAR_2013: 5, | |
| YEAR_2014: 6, | |
| YEAR_2015: 7, | |
| YEAR_2016: 8, | |
| YEAR_2017: 9, | |
| YEAR_2018: 10, | |
| ASSET: 10 | |
| }, Object.freeze(enums.Year), enums.Country = { | |
| BELGIUM: 7, | |
| ENGLAND: 14, | |
| FRANCE: 18, | |
| GERMANY: 21, | |
| ITALY: 27, | |
| NETHERLANDS: 34, | |
| PORTUGAL: 38, | |
| SPAIN: 45, | |
| ARGENTINA: 52, | |
| BRAZIL: 54 | |
| }, Object.freeze(enums.Country), enums.Currency = { | |
| COINS: "COINS", | |
| POINTS: "POINTS", | |
| DRAFT_TOKEN: "DRAFT_TOKEN" | |
| }, Object.freeze(enums.Currency), enums.FUTItemPile = { | |
| ANY: 0, | |
| TRANSFER: 5, | |
| PURCHASED: 6, | |
| CLUB: 7, | |
| INBOX: 8, | |
| GIFT: 9 | |
| }, Object.freeze(enums.FUTItemPile), enums.PlaceholderAssetId = { | |
| PLAYER: 0, | |
| KIT: 0, | |
| TEAM: 0, | |
| STAFF: 0, | |
| BALL: 0, | |
| FLAG: 0, | |
| STADIUM: 0 | |
| }, Object.freeze(enums.PlaceholderAssetId), enums.PlaceholderAssetKey = { | |
| PLAYERS: "players", | |
| KITS: "kits", | |
| CREST: "badges", | |
| CREST_LIGHT: "light", | |
| CREST_DARK: "dark", | |
| STAFF: "staff", | |
| BALLS: "balls" | |
| }, Object.freeze(enums.PlaceholderAssetKey), enums.GettingStartedTypes = { | |
| ACCESS_TRIAL: "ACCESS_TRIAL", | |
| FREE_TRIAL: "FREE_TRIAL", | |
| FUT: "FUT", | |
| FIFA: "FIFA", | |
| PLATFORM_SWITCH: "PLATFORM_SWITCH" | |
| }, Object.freeze(enums.GettingStartedTypes), enums.PlayerBioDisplayGroup = { | |
| INFO: 0, | |
| ATTRIBUTES: 1, | |
| LEGENDS: 2 | |
| }, Object.freeze(enums.PlayerBioDisplayGroup), enums.ItemSearchFeature = { | |
| CLUB: "club", | |
| CONCEPT: "dream", | |
| MARKET: "market" | |
| }, Object.freeze(enums.ItemSearchFeature), enums.SearchSort = { | |
| ASCENDING: "asc", | |
| DESCENDING: "desc" | |
| }, Object.freeze(enums.SearchSort), enums.SearchBucket = { | |
| PLAYER: 0, | |
| STAFF: 1, | |
| CLUB: 2, | |
| CONSUMABLE: 3 | |
| }, Object.freeze(enums.SearchBucket), enums.SearchType = { | |
| ANY: "any", | |
| BALL: "ball", | |
| CLUB_INFO: "clubInfo", | |
| CONSUMABLES_DEVELOPMENT: "development", | |
| CONSUMABLES_TRAINING: "training", | |
| PLAYER: "player", | |
| STADIUM: "stadium", | |
| STAFF: "staff" | |
| }, Object.freeze(enums.SearchType), enums.SearchCategory = { | |
| ANY: "any", | |
| PLAYER_GK: "playerGK", | |
| PLAYER_NO_GK: "noGK", | |
| MANAGER: "manager", | |
| COACH_FITNESS: "fitnessCoach", | |
| COACH_GK: "GKCoach", | |
| COACH_HEAD: "headCoach", | |
| PHYSIO: "physio", | |
| BADGE: "badge", | |
| KIT: "kit", | |
| PLAYER_TRAINING: "playerTraining", | |
| GK_TRAINING: "GKTraining", | |
| POSITION: "position", | |
| CONTRACT: "contract", | |
| FITNESS: "fitness", | |
| HEALING: "healing", | |
| STADIUM: "stadium", | |
| BALL: "ball", | |
| PLAYSTYLE: "playStyle", | |
| MANAGER_LEAGUE: "managerLeagueModifier", | |
| DEFID: "definitionId", | |
| MASKED_DEFID: "maskedDefId" | |
| }, Object.freeze(enums.SearchCategory), enums.SearchLevel = { | |
| ANY: "any", | |
| BRONZE: "bronze", | |
| SILVER: "silver", | |
| GOLD: "gold", | |
| SPECIAL: "SP" | |
| }, Object.freeze(enums.SearchLevel), enums.LoyaltyRewardType = { | |
| PACKS: 1, | |
| COINS: 2, | |
| ITEMS: 4, | |
| DRAFT_TOKENS: 7 | |
| }, Object.freeze(enums.LoyaltyRewardType), enums.AwardType = { | |
| COIN: "coin", | |
| PACK: "pack", | |
| ITEM: "item" | |
| }, Object.freeze(enums.AwardType), enums.TeamStarRanges = { | |
| RATING_0_0: 0, | |
| RATING_0_5: 59, | |
| RATING_1_0: 62, | |
| RATING_1_5: 64, | |
| RATING_2_0: 66, | |
| RATING_2_5: 68, | |
| RATING_3_0: 70, | |
| RATING_3_5: 74, | |
| RATING_4_0: 78, | |
| RATING_4_5: 82, | |
| RATING_5_0: 99 | |
| }, Object.freeze(enums.TeamStarRanges), enums.PlayerPositions = { | |
| GK: "GK", | |
| RWB: "RWB", | |
| RB: "RB", | |
| LWB: "LWB", | |
| LB: "LB", | |
| CDM: "CDM", | |
| CM: "CM", | |
| RM: "RM", | |
| LM: "LM", | |
| CAM: "CAM", | |
| RF: "RF", | |
| CF: "CF", | |
| LF: "LF", | |
| RW: "RW", | |
| LW: "LW", | |
| ST: "ST" | |
| }, Object.freeze(enums.PlayerPositions), enums.PlayerPositionsAsInts = { | |
| GK: 0, | |
| SW: 1, | |
| RWB: 2, | |
| RB: 3, | |
| RCB: 4, | |
| CB: 5, | |
| LCB: 6, | |
| LB: 7, | |
| LWB: 8, | |
| RDM: 9, | |
| CDM: 10, | |
| LDM: 11, | |
| RM: 12, | |
| RCM: 13, | |
| CM: 14, | |
| LCM: 15, | |
| LM: 16, | |
| RAM: 17, | |
| CAM: 18, | |
| LAM: 19, | |
| RF: 20, | |
| CF: 21, | |
| LF: 22, | |
| RW: 23, | |
| RS: 24, | |
| ST: 25, | |
| LS: 26, | |
| LW: 27 | |
| }, Object.freeze(enums.PlayerPositionsAsInts), enums.PlayerZonesAsInts = { | |
| DEFENSE: 130, | |
| MIDFIELD: 131, | |
| ATTACKER: 132 | |
| }, Object.freeze(enums.PlayerZonesAsInts), enums.PlayerStats = { | |
| PACE: 0, | |
| SHOOTING: 1, | |
| PASSING: 2, | |
| DRIBBLING: 3, | |
| DEFEND: 4, | |
| HEADING: 5, | |
| ALL: 6 | |
| }, Object.freeze(enums.PlayerStats), enums.GKStats = { | |
| DIVING: 0, | |
| HANDLING: 1, | |
| KICKING: 2, | |
| REFLEX: 3, | |
| SPEED: 4, | |
| POSITION: 5, | |
| ALL: 6 | |
| }, Object.freeze(enums.GKStats), enums.ItemRareType = { | |
| NONE: 0, | |
| RARE: 1, | |
| LOCK: 2, | |
| TOTW: 3, | |
| PURPLE: 4, | |
| TOTY: 5, | |
| RB: 6, | |
| GREEN: 7, | |
| ORANGE: 8, | |
| PINK: 9, | |
| TEAL: 10, | |
| TOTS: 11, | |
| LEGEND: 12, | |
| WC: 13, | |
| UNICEF: 14, | |
| OLDIMOTM: 15, | |
| FUTTY: 16, | |
| STORYMODE: 17, | |
| CHAMPION: 18, | |
| CMOTM: 19, | |
| IMOTM: 20, | |
| OTW: 21, | |
| HALLOWEEN: 22, | |
| MOVEMBER: 23, | |
| SBC: 24, | |
| SBCP: 25, | |
| PROMOA: 26, | |
| PROMOB: 27, | |
| AWARD: 28, | |
| UNITED: 31, | |
| RTRC: 33, | |
| RTRS: 34, | |
| RTRW: 35, | |
| MARQUEE: 36, | |
| EUMOTM: 38 | |
| }, Object.freeze(enums.ItemRareType), enums.ItemRatingTier = { | |
| NONE: 0, | |
| BRONZE: 1, | |
| SILVER: 2, | |
| GOLD: 3 | |
| }, Object.freeze(enums.ItemRatingTier), enums.KitActivationSlot = { | |
| HOME: 101, | |
| AWAY: 102 | |
| }, | |
| Object.freeze(enums.KitActivationSlot), enums.ItemCardAssetId = { | |
| TRAINING_PLAYER: 1, | |
| TRAINING_GK: 3, | |
| CONTRACT_PLAYER: 7, | |
| CONTRACT_MANAGER: 8, | |
| HEALING: 9, | |
| FITNESS: 10, | |
| MANAGER_LEAGUE: 32, | |
| POSITION_MODIFIER: 34, | |
| PLAYSTYLE_PLAYER: 50, | |
| PLAYSTYLE_GK: 51 | |
| }, Object.freeze(enums.ItemCardAssetId), enums.ItemType = { | |
| NONE: "none", | |
| BADGE: "custom", | |
| BALL: "ball", | |
| CONTRACT: "contract", | |
| FITNESS_COACH: "fitnessCoach", | |
| GK_COACH: "gkCoach", | |
| HEAD_COACH: "headCoach", | |
| HEALTH: "health", | |
| KIT: "kit", | |
| MANAGER: "manager", | |
| MISC: "misc", | |
| PHYSIO: "physio", | |
| PLAYER: "player", | |
| STADIUM: "stadium", | |
| TRAINING: "training" | |
| }, Object.freeze(enums.ItemType), enums.ItemSubType = { | |
| NONE: 0, | |
| PLAYER: 2, | |
| MANAGER: 4, | |
| HEAD_COACH: 5, | |
| GK_COACH: 6, | |
| PHYSIO: 7, | |
| FITNESS_COACH: 8, | |
| TRAINING_GK_DIVING: 51, | |
| TRAINING_GK_HANDLING: 52, | |
| TRAINING_GK_KICKING: 53, | |
| TRAINING_GK_SPEED: 54, | |
| TRAINING_GK_POSITION: 55, | |
| TRAINING_GK_REFLEX: 56, | |
| TRAINING_GK_ALL: 57, | |
| TRAINING_PLAYER_PACE: 61, | |
| TRAINING_PLAYER_SHOOTING: 62, | |
| TRAINING_PLAYER_PASSING: 63, | |
| TRAINING_PLAYER_DRIBBLING: 64, | |
| TRAINING_PLAYER_HEADING: 65, | |
| TRAINING_PLAYER_DEFEND: 66, | |
| TRAINING_PLAYER_ALL: 67, | |
| TRAINING_PLAYER_FORMATION_3412: 71, | |
| TRAINING_PLAYER_FORMATION_3421: 72, | |
| TRAINING_PLAYER_FORMATION_343: 73, | |
| TRAINING_PLAYER_FORMATION_352: 74, | |
| TRAINING_PLAYER_FORMATION_41212: 75, | |
| TRAINING_PLAYER_FORMATION_4231: 76, | |
| TRAINING_PLAYER_FORMATION_4222: 77, | |
| TRAINING_PLAYER_FORMATION_4312: 78, | |
| TRAINING_PLAYER_FORMATION_4321: 79, | |
| TRAINING_PLAYER_FORMATION_433: 80, | |
| TRAINING_PLAYER_FORMATION_4411: 81, | |
| TRAINING_PLAYER_FORMATION_442: 82, | |
| TRAINING_PLAYER_FORMATION_451: 83, | |
| TRAINING_PLAYER_FORMATION_5212: 84, | |
| TRAINING_PLAYER_FORMATION_5221: 85, | |
| TRAINING_PLAYER_FORMATION_532: 86, | |
| TRAINING_PLAYER_POS_LWB_LB: 91, | |
| TRAINING_PLAYER_POS_LB_LWB: 92, | |
| TRAINING_PLAYER_POS_RWB_RB: 93, | |
| TRAINING_PLAYER_POS_RB_RWB: 94, | |
| TRAINING_PLAYER_POS_LM_LW: 95, | |
| TRAINING_PLAYER_POS_RM_RW: 96, | |
| TRAINING_PLAYER_POS_LW_LM: 97, | |
| TRAINING_PLAYER_POS_RW_RM: 98, | |
| TRAINING_PLAYER_POS_LW_LF: 99, | |
| TRAINING_PLAYER_POS_RW_RF: 100, | |
| TRAINING_PLAYER_POS_LF_LW: 101, | |
| TRAINING_PLAYER_POS_RF_RW: 102, | |
| TRAINING_PLAYER_POS_CM_CAM: 103, | |
| TRAINING_PLAYER_POS_CAM_CM: 104, | |
| TRAINING_PLAYER_POS_CDM_CM: 105, | |
| TRAINING_PLAYER_POS_CM_CDM: 106, | |
| TRAINING_PLAYER_POS_CAM_CF: 107, | |
| TRAINING_PLAYER_POS_CF_CAM: 108, | |
| TRAINING_PLAYER_POS_CF_ST: 109, | |
| TRAINING_PLAYER_POS_ST_CF: 110, | |
| TRAINING_MANAGER_FORMATION_3412: 121, | |
| TRAINING_MANAGER_FORMATION_3421: 122, | |
| TRAINING_MANAGER_FORMATION_343: 123, | |
| TRAINING_MANAGER_FORMATION_352: 124, | |
| TRAINING_MANAGER_FORMATION_41212: 125, | |
| TRAINING_MANAGER_FORMATION_4231: 126, | |
| TRAINING_MANAGER_FORMATION_4222: 127, | |
| TRAINING_MANAGER_FORMATION_4312: 128, | |
| TRAINING_MANAGER_FORMATION_4321: 129, | |
| TRAINING_MANAGER_FORMATION_433: 130, | |
| TRAINING_MANAGER_FORMATION_4411: 131, | |
| TRAINING_MANAGER_FORMATION_442: 132, | |
| TRAINING_MANAGER_FORMATION_451: 133, | |
| TRAINING_MANAGER_FORMATION_5212: 134, | |
| TRAINING_MANAGER_FORMATION_5221: 135, | |
| TRAINING_MANAGER_FORMATION_532: 136, | |
| CONTRACT_PLAYER: 201, | |
| CONTRACT_MANAGER: 202, | |
| HEALING_HEAD: 211, | |
| HEALING_SHOULDER: 212, | |
| HEALING_ARM: 213, | |
| HEALING_BACK: 214, | |
| HEALING_HIP: 215, | |
| HEALING_LEG: 216, | |
| HEALING_FOOT: 217, | |
| HEALING_ALL: 218, | |
| FITNESS_PLAYER: 219, | |
| FITNESS_TEAM: 220, | |
| MORALE_PLAYER: 221, | |
| MORALE_TEAM: 222, | |
| FREE_COINS: 231, | |
| STADIUM_UPGRADE: 232, | |
| FREE_PACK: 233, | |
| WC_PACK: 235, | |
| DRAFT_TOKEN: 236, | |
| TRAINING_PLAYERSTYLE_GENERAL_1: 250, | |
| TRAINING_PLAYERSTYLE_GENERAL_2: 251, | |
| TRAINING_PLAYERSTYLE_GENERAL_3: 252, | |
| TRAINING_PLAYERSTYLE_GENERAL_4: 253, | |
| TRAINING_PLAYERSTYLE_GENERAL_5: 254, | |
| TRAINING_PLAYERSTYLE_GENERAL_6: 255, | |
| TRAINING_PLAYERSTYLE_GENERAL_7: 256, | |
| TRAINING_PLAYERSTYLE_GENERAL_8: 257, | |
| TRAINING_PLAYERSTYLE_GENERAL_9: 258, | |
| TRAINING_PLAYERSTYLE_GENERAL_10: 259, | |
| TRAINING_PLAYERSTYLE_GENERAL_11: 260, | |
| TRAINING_PLAYERSTYLE_GENERAL_12: 261, | |
| TRAINING_PLAYERSTYLE_GENERAL_13: 262, | |
| TRAINING_PLAYERSTYLE_GENERAL_14: 263, | |
| TRAINING_PLAYERSTYLE_GENERAL_15: 264, | |
| TRAINING_PLAYERSTYLE_GENERAL_16: 265, | |
| TRAINING_PLAYERSTYLE_GENERAL_17: 266, | |
| TRAINING_PLAYERSTYLE_GENERAL_18: 267, | |
| TRAINING_PLAYERSTYLE_GENERAL_19: 268, | |
| TRAINING_PLAYERSTYLE_GOALKEEPER_1: 269, | |
| TRAINING_PLAYERSTYLE_GOALKEEPER_2: 270, | |
| TRAINING_PLAYERSTYLE_GOALKEEPER_3: 271, | |
| TRAINING_PLAYERSTYLE_GOALKEEPER_4: 272, | |
| TRAINING_PLAYERSTYLE_GOALKEEPER_5: 273, | |
| MANAGERLEAGUE_DENMARK: 300, | |
| MANAGERLEAGUE_ARGENTINA: 340 | |
| }, Object.freeze(enums.ItemSubType), | |
| enums.ItemState = { | |
| FREE: "free", | |
| INGAME: "ingame", | |
| FORSALE: "forSale", | |
| OFFERED: "offered", | |
| ACTIVE: "active", | |
| INVALID: "invalid", | |
| ACTIVE_BADGE: "activeBadge", | |
| ACTIVE_HOME_KIT: "activeHomeKit", | |
| ACTIVE_AWAY_KIT: "activeAwayKit", | |
| ACTIVE_BALL: "activeBall", | |
| ACTIVE_STADIUM: "activeStadium" | |
| }, Object.freeze(enums.ItemState), enums.PlayerInjury = { | |
| NONE: "none", | |
| HEAD: "head", | |
| SHOULDER: "shoulder", | |
| ARM: "arm", | |
| BACK: "back", | |
| HIP: "hip", | |
| LEG: "leg", | |
| FOOT: "foot" | |
| }, Object.freeze(enums.PlayerInjury), enums.ItemMask = { | |
| DATABASE: 16777215, | |
| REVISION: 251658240, | |
| FULL_REVISION: 4278190080, | |
| YEAR: 4026531840 | |
| }, Object.freeze(enums.ItemMask), enums.UserSquadId = { | |
| ACTIVE: "active", | |
| GENERATIONS: "generations" | |
| }, Object.freeze(enums.UserSquadId), enums.SquadType = { | |
| REGULAR: "REGULAR_SQUAD", | |
| DREAM: "DREAM_SQUAD", | |
| DRAFT: "DRAFT_SQUAD", | |
| GENERATIONS: "GENERATIONS_SQUAD" | |
| }, Object.freeze(enums.SquadType), enums.PlayerZone = { | |
| ATTACKERS: "ATTACKERS", | |
| DEFENDERS: "DEFENDERS", | |
| MIDFIELDERS: "MIDFIELDERS", | |
| GOALKEEPERS: "GOALKEEPERS" | |
| }, Object.freeze(enums.PlayerZone), enums.SquadPositionZones = { | |
| 0: enums.PlayerZone.GOALKEEPERS, | |
| 1: enums.PlayerZone.DEFENDERS, | |
| 2: enums.PlayerZone.DEFENDERS, | |
| 3: enums.PlayerZone.DEFENDERS, | |
| 4: enums.PlayerZone.DEFENDERS, | |
| 5: enums.PlayerZone.DEFENDERS, | |
| 6: enums.PlayerZone.DEFENDERS, | |
| 7: enums.PlayerZone.DEFENDERS, | |
| 8: enums.PlayerZone.DEFENDERS, | |
| 9: enums.PlayerZone.MIDFIELDERS, | |
| 10: enums.PlayerZone.MIDFIELDERS, | |
| 11: enums.PlayerZone.MIDFIELDERS, | |
| 12: enums.PlayerZone.MIDFIELDERS, | |
| 13: enums.PlayerZone.MIDFIELDERS, | |
| 14: enums.PlayerZone.MIDFIELDERS, | |
| 15: enums.PlayerZone.MIDFIELDERS, | |
| 16: enums.PlayerZone.MIDFIELDERS, | |
| 17: enums.PlayerZone.MIDFIELDERS, | |
| 18: enums.PlayerZone.MIDFIELDERS, | |
| 19: enums.PlayerZone.ATTACKERS, | |
| 20: enums.PlayerZone.ATTACKERS, | |
| 21: enums.PlayerZone.ATTACKERS, | |
| 22: enums.PlayerZone.ATTACKERS, | |
| 23: enums.PlayerZone.ATTACKERS, | |
| 24: enums.PlayerZone.ATTACKERS, | |
| 25: enums.PlayerZone.ATTACKERS, | |
| 26: enums.PlayerZone.ATTACKERS, | |
| 27: enums.PlayerZone.ATTACKERS | |
| }, Object.freeze(enums.SquadPositionZones), enums.SquadPitchThemes = { | |
| NONE: "", | |
| WINTER: "winterTheme" | |
| }, Object.freeze(enums.SquadPitchThemes), enums.SquadPitchTypes = { | |
| REGULAR: "", | |
| CONCEPT: "dreamPitch" | |
| }, Object.freeze(enums.SquadPitchTypes), enums.SquadPitchModes = { | |
| REGULAR: "", | |
| GENERATIONS: "generations", | |
| SBC: "sbc" | |
| }, Object.freeze(enums.SquadPitchModes), enums.OnboardingStateType = { | |
| HOME_KIT: 1, | |
| AWAY_KIT: 2, | |
| BADGE: 3, | |
| NATION: 4 | |
| }, Object.freeze(enums.OnboardingStateType), NamespaceManager.Register("enums"), enums.Language = { | |
| ENGLISH: "en", | |
| FRENCH: "fr", | |
| GERMAN: "de", | |
| SPANISH: "es", | |
| ITALIAN: "it", | |
| DUTCH: "nl", | |
| POLISH: "pl", | |
| RUSSIAN: "ru", | |
| PORTUGUESE: "pt" | |
| }, Object.freeze(enums.Language), enums.Locale = { | |
| USA: "en_US", | |
| CANADA: "en_CA", | |
| GREAT_BRITAIN: "en_GB", | |
| AUSTRALIA: "en_AU", | |
| FRANCE: "fr_FR", | |
| GERMANY: "de_DE", | |
| SPAIN: "es_ES", | |
| MEXICO: "es_MX", | |
| ITALY: "it_IT", | |
| NETHERLANDS: "nl_NL", | |
| POLAND: "pl_PL", | |
| RUSSIA: "ru_RU", | |
| BRAZIL: "pt_BR" | |
| }, Object.freeze(enums.Locale), enums.URLLocale = { | |
| USA: "US", | |
| CANADA: "CA", | |
| GREAT_BRITAIN: "GB", | |
| UK: "UK", | |
| AUSTRALIA: "AU", | |
| FRANCE: "FR", | |
| GERMANY: "DE", | |
| SPAIN: "ES", | |
| MEXICO: "MX", | |
| ITALY: "IT", | |
| NETHERLANDS: "NL", | |
| POLAND: "PL", | |
| RUSSIA: "RU", | |
| BRAZIL: "BR" | |
| }, Object.freeze(enums.URLLocale), enums.ServerLocale = { | |
| USA: "en-US", | |
| GREAT_BRITAIN: "en-GB", | |
| AUSTRALIA: "en-AU", | |
| FRANCE: "fr-FR", | |
| GERMANY: "de-DE", | |
| SPAIN: "es-ES", | |
| MEXICO: "es-MX", | |
| ITALY: "it-IT", | |
| NETHERLANDS: "nl-NL", | |
| POLAND: "pl-PL", | |
| RUSSIA: "ru-RU", | |
| BRAZIL: "pt-BR" | |
| }, Object.freeze(enums.ServerLocale), enums.BaseURLHALString = { | |
| PRIVACY_POLICY: "link.privacy_policy_base.url", | |
| USER_AGREEMENT: "link.terms_of_service_base.url", | |
| ITEM_DATABASE: "link.itemdatabase.url" | |
| }, Object.freeze(enums.BaseURLHALString), enums.Localization = {}, enums.Localization.BLANK_STR = "---", enums.Localization.STATS_LABELS_PLAYER = ["cards.cardfront.paceAbbr", "cards.cardfront.shootingAbbr", "cards.cardfront.passingAbbr", "cards.cardfront.dribblingAbbr", "cards.cardfront.defendingAbbr", "cards.cardfront.headingAbbr"], enums.Localization.STATS_LABELS_GK = ["cards.cardfront.divingAbbr", "cards.cardfront.handlingAbbr", "cards.cardfront.kickAbbr", "cards.cardfront.reflexAbbr", "cards.cardfront.speedAbbr", "cards.cardfront.positionAbbr"], NamespaceManager.Register("enums"), enums.HTTPRequestMethod = { | |
| POST: "POST", | |
| GET: "GET", | |
| PUT: "PUT", | |
| DELETE: "DELETE" | |
| }, | |
| enums.HTTPContentType = { | |
| XML: "text/xml", | |
| JSON: "application/json", | |
| TEXT_PLAIN: "text/plain", | |
| FORM_DATA: "application/x-www-form-urlencoded" | |
| }, enums.HTTPStatusCode = { | |
| UNKNOWN: 0, | |
| OK: 200, | |
| NO_CONTENT: 204, | |
| BAD_REQUEST: 400, | |
| UNAUTHORIZED: 401, | |
| FORBIDDEN: 403, | |
| NOT_FOUND: 404, | |
| CONFLICT: 409, | |
| UNSUPPORTED_TYPE: 415, | |
| RATE_LIMIT: 429, | |
| FUN_CAPTCHA_REQUIRED: 458, | |
| CAPTCHA_REQUIRED: 459, | |
| UT_BAD_REQUEST: 460, | |
| PERMISSION_DENIED: 461, | |
| STATE_INVALID: 462, | |
| NO_BID_TOKENS: 463, | |
| NO_USER: 465, | |
| NAME_EXISTS: 466, | |
| PROFANITY: 467, | |
| LOGGED_IN_ON_CONSOLE_LEGACY: 468, | |
| DELETING_LAST_SQUAD: 469, | |
| NOT_ENOUGH_CREDIT: 470, | |
| ITEM_EXISTS: 471, | |
| DUPLICATE_ITEM_TYPE: 472, | |
| DESTINATION_FULL: 473, | |
| LOGGED_IN_ON_CONSOLE: 474, | |
| NO_CARD_EXISTS: 475, | |
| CARD_IN_TRADE: 476, | |
| INVALID_DECK: 477, | |
| NO_TRADE_EXISTS: 478, | |
| INVALID_OWNER: 479, | |
| SERVICE_IS_DISABLED: 480, | |
| ACCOUNT_LOCKED: 481, | |
| INVALID_COOKIE: 482, | |
| ALREADY_ANSWERED_PHISHING_QUESTION: 483, | |
| NO_REMAINING_ATTEMPTS: 485, | |
| PLAYER_HAS_RED_CARD: 486, | |
| REMOVE_WATCH_FAILURE: 487, | |
| SWAP_ITEM_WITH_ITSELF: 488, | |
| USER_IS_HIGHEST_BIDDER: 489, | |
| DID_CREATE_EXCEEDED: 489, | |
| DID_LOGIN_EXCEEDED: 490, | |
| LOCKED_TRANSFER_MARKET: 494, | |
| SOME_ITEMS_NOT_FREE: 495, | |
| SERVER_ERROR: 500, | |
| SERVICE_UNAVAILABLE_ERROR: 503, | |
| UNRECOVERABLE_ERROR: 1e4, | |
| NO_INTERNET_CONNECTION: 10666, | |
| NETWORK_ERROR: 10667, | |
| REQUEST_TIME_OUT: 10668, | |
| FIFA_POINTS_FAILED: 10670, | |
| ACCOUNT_BANNED: 2e4, | |
| UPDATE_REQUIRED: 20001, | |
| INVALID_CREDENTIALS: 20002 | |
| }, enums.NetworkError = enums.HTTPStatusCode, enums.NetworkErrorReason = { | |
| MULTIPLE_SESSION: "multiple session", | |
| WRONG_CREDENTIALS: "Wrong credentials", | |
| INVALID_CREDENTIALS: "invalid credentials", | |
| BANNED: "BANNED", | |
| CLIENT_VERSION_EXPIRED: "client version expired", | |
| CLIENT_VERSION_UNKNOWN: "unknown client version", | |
| SESSION_THROTTLED: "throttled" | |
| }, enums.NetworkErrorLevel = { | |
| UNIMPORTANT: 0, | |
| IMPORTANT: 1, | |
| CRITICAL: 2 | |
| }, NamespaceManager.Register("enums"), enums.AppNotification = { | |
| ITEM_ACTIVATE: "NOTIF_ItemActivate", | |
| ITEM_APPLY: "NOTIF_ItemApply", | |
| ITEM_BID: "NOTIF_ItemBid", | |
| ITEM_CLEARSOLD: "NOTIF_ItemClearSold", | |
| ITEM_DISCARD: "NOTIF_ItemDiscard", | |
| ITEM_LIST: "NOTIF_ItemList", | |
| ITEM_MOVE: "NOTIF_ItemMove", | |
| ITEM_REDEEM: "NOTIF_ItemRedeem", | |
| ITEM_UNWATCH: "NOTIF_ItemUnwatch", | |
| ITEM_WATCH: "NOTIF_ItemWatch", | |
| SQUAD_CREATE: "NOTIF_SquadCreate", | |
| SQUAD_DELETE: "NOTIF_SquadDelete", | |
| SQUAD_SAVE: "NOTIF_SquadSave", | |
| STORE_PACK_COUNT_CHANGE: "NOTIF_StorePackCountChange", | |
| UI_NOTIFICATION: "NOTIF_UINotification" | |
| }, Object.freeze(enums.AppNotification), NamespaceManager.Register("enums"), enums.Objectives = {}, enums.Objectives.Type = { | |
| INVALID: "INVALID", | |
| BEGINNER: "BEGINNER", | |
| DAILY: "DAILY", | |
| WEEKLY: "WEEKLY" | |
| }, Object.freeze(enums.Objectives.Type), enums.Objectives.State = { | |
| INVALID: "INVALID", | |
| IN_PROGRESS: "IN_PROGRESS", | |
| COMPLETED: "COMPLETED", | |
| REDEEMED: "REDEEMED", | |
| LOCKED: "LOCKED", | |
| EXPIRED: "EXPIRED" | |
| }, Object.freeze(enums.Objectives.State), enums.Objectives.GoToLink = { | |
| NONE: "", | |
| CHANGE_CLUB_NAME: "GotoChangeClubName", | |
| OFFLINE_SEASONS: "GotoOfflineSeasons", | |
| ONLINE_SEASONS: "GotoOnlineSeasons", | |
| OFFLINE_TOTW: "GotoOfflineTotw", | |
| SQUAD_BATTLE: "GotoSquadBattle", | |
| AUCTION_SEARCH: "GotoAuctionSearch", | |
| SBC_SQUAD: "GotoSbcSquad", | |
| SQUAD: "GotoSquad", | |
| DRAFT_ONLINE: "GotoDraftOnline", | |
| DRAFT_OFFLINE: "GotoDraftOffline" | |
| }, Object.freeze(enums.Objectives.GoToLink), NamespaceManager.Register("enums"), enums.PIN = {}, enums.PIN.CONFIG = { | |
| ENABLED: "e", | |
| BATCH_ENABLED: "b", | |
| BATCH_FREQUENCY: "bf", | |
| BATCH_SIZE: "bs", | |
| RETRY_TIMES: "r", | |
| RETRY_FREQUENCY: "rf" | |
| }, Object.freeze(enums.PIN.CONFIG), enums.PIN.STATE = { | |
| DYNAMIC_DISABLED: -1, | |
| DISABLED: 0, | |
| ENABLED: 1 | |
| }, Object.freeze(enums.PIN.STATE), enums.PIN.EVENT = { | |
| BOOT_START: "boot_start", | |
| BOOT_END: "boot_end", | |
| CONNECTION: "connection", | |
| ERROR: "error", | |
| LOGIN: "login", | |
| LOGOUT: "logout", | |
| MESSAGE: "message", | |
| MILESTONE: "milestone", | |
| PAGE_VIEW: "page_view", | |
| SETTINGS: "settings" | |
| }, Object.freeze(enums.PIN.EVENT), enums.PIN.BOOT_START_EVT_STATUS = { | |
| SUCCESS: "success", | |
| SOURCE_UPDATE: "source_update" | |
| }, Object.freeze(enums.PIN.BOOT_START_EVT_STATUS), enums.PIN.BOOT_START_EVT_SOURCE = { | |
| NORMAL: "normal", | |
| OPT_IN_TEL: "opt_in_tel", | |
| UPGRADE: "upgrade" | |
| }, Object.freeze(enums.PIN.BOOT_START_EVT_SOURCE), enums.PIN.BOOT_END_EVT_REASON = { | |
| NORMAL: "normal", | |
| OPT_OUT_TEL: "opt_out_tel" | |
| }, Object.freeze(enums.PIN.BOOT_END_EVT_REASON), enums.PIN.ERROR_EVT_ERRID = { | |
| CONNECTION: "disconnect", | |
| SERVER: "server_error" | |
| }, Object.freeze(enums.PIN.ERROR_EVT_ERRID), enums.PIN.LOGIN_EVT_STATUS = { | |
| SUCCESS: "success", | |
| FAIL: "error" | |
| }, Object.freeze(enums.PIN.LOGIN_EVT_STATUS), enums.PIN.LOGOUT_EVT_END_REASON = { | |
| NORMAL: "normal", | |
| ERROR: "error" | |
| }, Object.freeze(enums.PIN.LOGOUT_EVT_END_REASON), enums.PIN.MESSAGE_EVT_TYPE = { | |
| FET: "in-game", | |
| PN: "pn" | |
| }, Object.freeze(enums.PIN.MESSAGE_EVT_TYPE), enums.PIN.MILESTONE_EVT_ID = { | |
| COUNTRY: "FUTONBOARDING_FLOW_COUNTRY", | |
| EXPLORESQUAD: "FUTONBOARDING_FLOW_EXPLORESQUAD", | |
| LOANSELECT: "FUTONBOARDING_FLOW_LOANSELECT", | |
| LOANEXPLORE: "FUTONBOARDING_FLOW_LOANEXPLORE", | |
| HOMEKIT: "FUTONBOARDING_FLOW_HOMEKIT", | |
| AWAYKIT: "FUTONBOARDING_FLOW_AWAYKIT", | |
| BADGE: "FUTONBOARDING_FLOW_BADGE", | |
| SUMMARY: "FUTONBOARDING_FLOW_SUMMARY", | |
| DAILY_OBJECTIVE: "fut_daily_quest_" | |
| }, Object.freeze(enums.PIN.MILESTONE_EVT_ID), enums.PIN.MILESTONE_EVT_TYPE = { | |
| ONBOARDING: "onboarding", | |
| OBJECTIVES: "quest" | |
| }, Object.freeze(enums.PIN.MILESTONE_EVT_TYPE), enums.PIN.SETTINGS_EVT_STATUS = { | |
| OPT_IN: "accepted", | |
| OPT_OUT: "declined" | |
| }, Object.freeze(enums.PIN.SETTINGS_EVT_STATUS), NamespaceManager.Register("enums"), enums.Purchase = {}, enums.Purchase.DisplayGroup = { | |
| BRONZE: "bronze", | |
| SILVER: "silver", | |
| GOLD: "gold", | |
| SPECIAL: "special", | |
| MYPACKS: "mypacks" | |
| }, enums.Purchase.DisplayGroupId = { | |
| BRONZE: 1, | |
| SILVER: 2, | |
| GOLD: 3, | |
| SPECIAL: 4, | |
| MYPACKS: 5 | |
| }, enums.Purchase.DealType = { | |
| REGULAR: "REGULAR", | |
| DEAL: "DEAL", | |
| PROMO: "PROMO", | |
| BESTDEAL: "BESTDEAL" | |
| }, enums.Purchase.SaleType = { | |
| NONE: "NONE", | |
| QUANTITY: "QUANTITY", | |
| TIME: "TIME", | |
| TIME_QUANTITY: "TIME_QUANTITY" | |
| }, enums.Purchase.PackState = { | |
| ACTIVE: "active", | |
| HIDDEN: "hidden" | |
| }, enums.Purchase.PackTier = { | |
| BRONZE: 1, | |
| SILVER: 2, | |
| GOLD: 3, | |
| SPECIAL: 4, | |
| LOAN: 5, | |
| STARTER: 6, | |
| LEGENDS: 8, | |
| STORY: 9, | |
| SBC: 10, | |
| CHAMPION: 11 | |
| }, enums.Purchase.PackType = { | |
| ALL: "ALL", | |
| CARDPACK: "CARDPACK", | |
| DRAFTENTRY: "DRAFTENTRY" | |
| }, enums.Purchase.State = { | |
| INVALID: "INVALID", | |
| NOTRANSACTION: "NOTRANSACTION", | |
| TRANSACTIONCREATED: "TRANSACTIONCREATED", | |
| TRANSACTIONCANCEL: "TRANSACTIONCANCEL", | |
| TRANSACTIONCOMPLETE: "TRANSACTIONCOMPLETE", | |
| PURCHASESTARTED: "PURCHASESTARTED", | |
| PURCHASECOMPLETE: "PURCHASECOMPLETE", | |
| PURCHASECONSUMABLECOUNT: "PURCHASECONSUMABLECOUNT", | |
| PURCHASECONSUME: "PURCHASECONSUME" | |
| }, NamespaceManager.Register("enums"), enums.SBC = {}, enums.SBC.SET_TAGS = { | |
| TAGGED_BY_PRODUCTION: "taggedByProduction", | |
| TAGGED_BY_USER: "taggedByUser" | |
| }, Object.freeze(enums.SBC.SET_TAGS), enums.SBC.CATEGORY_TYPE = { | |
| SERVER: 0, | |
| CUSTOM_ALL: 1, | |
| CUSTOM_FAVOURITE: 2 | |
| }, Object.freeze(enums.SBC.CATEGORY_TYPE), enums.SBC.CHALLENGE_STATUS = { | |
| NOT_STARTED: "NOT_STARTED", | |
| IN_PROGRESS: "IN_PROGRESS", | |
| COMPLETED: "COMPLETED" | |
| }, Object.freeze(enums.SBC.CHALLENGE_STATUS), enums.SBC.CHALLENGE_TYPE = { | |
| OPEN: "OPEN_CHALLENGE", | |
| BRICK: "BRICK_CHALLENGE", | |
| CUSTOM_BRICK: "CUSTOM_BRICK_CHALLENGE" | |
| }, Object.freeze(enums.SBC.CHALLENGE_TYPE), enums.SBC.PLAYER_TYPE = { | |
| DEFAULT: "DEFAULT", | |
| BRICK: "BRICK", | |
| CUSTOM_BRICK: "CUSTOM_BRICK" | |
| }, Object.freeze(enums.SBC.PLAYER_TYPE), enums.SBC.ELG_OPERATION = { | |
| AND: "AND", | |
| OR: "OR" | |
| }, Object.freeze(enums.SBC.ELG_OPERATION), enums.SBC.ELG_KEY = { | |
| FUT_ELGRULE_TEAM_STAR_RATING: 0, | |
| FUT_ELGRULE_TEAM_CHEMISTRY: 1, | |
| FUT_ELGRULE_PLAYER_COUNT: 2, | |
| FUT_ELGRULE_PLAYER_QUALITY: 3, | |
| FUT_ELGRULE_SAME_NATION_COUNT: 4, | |
| FUT_ELGRULE_SAME_LEAGUE_COUNT: 5, | |
| FUT_ELGRULE_SAME_CLUB_COUNT: 6, | |
| FUT_ELGRULE_NATION_COUNT: 7, | |
| FUT_ELGRULE_LEAGUE_COUNT: 8, | |
| FUT_ELGRULE_CLUB_COUNT: 9, | |
| FUT_ELGRULE_NATION_ID: 10, | |
| FUT_ELGRULE_LEAGUE_ID: 11, | |
| FUT_ELGRULE_CLUB_ID: 12, | |
| FUT_ELGRULE_SCOPE: 13, | |
| FUT_ELGRULE_APPLY_TO: 14, | |
| FUT_ELGRULE_LEGEND_COUNT: 15, | |
| FUT_ELGRULE_NUM_TROPHY_REQUIRED: 16, | |
| FUT_ELGRULE_PLAYER_LEVEL: 17, | |
| FUT_ELGRULE_PLAYER_RARITY: 18, | |
| FUT_ELGRULE_TEAM_RATING: 19, | |
| FUT_ELGRULE_PLAYER_COUNT_COMBINED: 21 | |
| }, Object.freeze(enums.SBC.ELG_KEY), enums.SBC.ELG_SCOPE = { | |
| FUT_ELGRULE_SCOPE_GREATER: 0, | |
| FUT_ELGRULE_SCOPE_LOWER: 1, | |
| FUT_ELGRULE_SCOPE_EXACT: 2 | |
| }, Object.freeze(enums.SBC.ELG_SCOPE), enums.SBC.ELG_QUALITY_TYPES = { | |
| BRONZE: 1, | |
| SILVER: 2, | |
| GOLD: 3 | |
| }, Object.freeze(enums.SBC.ELG_QUALITY_TYPES), NamespaceManager.Register("enums"), enums.KeyCode = { | |
| RETURN: 13 | |
| }, Object.freeze(enums.KeyCode), enums.KeyboardKey = { | |
| ARROW_DOWN: "ArrowDown", | |
| ARROW_LEFT: "ArrowLeft", | |
| ARROW_RIGHT: "ArrowRight", | |
| ARROW_UP: "ArrowUp", | |
| ENTER: "Enter", | |
| ESCAPE: "Escape", | |
| MS_ESCAPE: "Esc", | |
| F7: "F7", | |
| F8: "F8", | |
| F9: "F9" | |
| }, | |
| Object.freeze(enums.KeyboardKey), enums.DeviceOrientation = { | |
| PORTRAIT_DOWN: 180, | |
| LANDSCAPE_LEFT: -90, | |
| LANDSCAPE_RIGHT: 90, | |
| PORTRAIT: 0 | |
| }, Object.freeze(enums.DeviceOrientation), enums.UIDialogTypes = { | |
| MESSAGE: "ui-dialog-type-message", | |
| ALERT: "ui-dialog-type-alert", | |
| ROTATE: "ui-dialog-type-rotate" | |
| }, Object.freeze(enums.DeviceOrientation), enums.UIShieldStyles = { | |
| TRANSPARENT: "ui-shield-style-transparent", | |
| OPAQUE: "ui-shield-style-opaque" | |
| }, Object.freeze(enums.UIShieldStyles), enums.UIDialogOptions = { | |
| YES: 0, | |
| NO: 1, | |
| OK: 2, | |
| CANCEL: 3, | |
| RETRY: 4, | |
| SIGN_OUT: 5, | |
| TAKE_ME: 6 | |
| }, Object.freeze(enums.UIDialogOptions), enums.UIAnimation = { | |
| FADE_IN: "fade-in", | |
| FADE_OUT: "fade-out", | |
| SLIDE_OUT_LEFT: "slide-out-left", | |
| SLIDE_OUT_RIGHT: "slide-out-right", | |
| SLIDE_IN_LEFT: "slide-in-left", | |
| SLIDE_IN_RIGHT: "slide-in-right", | |
| SLIDE_IN_LEFT_FADE_OUT: "scroll-right-fade-in-fade-out", | |
| BLINK: "alarm-txt", | |
| MARQUEE: "scroll-txt", | |
| BOUNCE: "cardBounce" | |
| }, Object.freeze(enums.UIAnimation), enums.UIText = { | |
| SECONDARY: "secondary" | |
| }, Object.freeze(enums.UIText), enums.UINavigationBarStyle = { | |
| DEFAULT: "", | |
| SECONDARY: "subnav" | |
| }, Object.freeze(enums.UINavigationBarStyle), enums.UIRowActionClass = { | |
| ADD: "add", | |
| SWAP: "swap", | |
| MORE: "more" | |
| }, Object.freeze(enums.UIRowActionClass), enums.UIState = { | |
| ACTIVE: "active", | |
| DISABLED: "disabled", | |
| ENABLED: "enabled", | |
| HOVER: "hover", | |
| SELECTED: "selected" | |
| }, Object.freeze(enums.UIState), enums.UILayout = { | |
| RIGHT: "ui-layout-right", | |
| LEFT: "ui-layout-left", | |
| TOP: "ui-layout-top", | |
| BOTTOM: "ui-layout-bottom" | |
| }, Object.freeze(enums.UILayout), enums.UIDirection = { | |
| RIGHT: "ui-direction-right", | |
| LEFT: "ui-direction-left", | |
| UP: "ui-direction-up", | |
| DOWN: "ui-direction-down", | |
| FLIP_HORIZONTAL: "ui-flip-horizontal", | |
| FLIP_VERTICAL: "ui-flip-vertical", | |
| DEFAULT: "ui-direction-default" | |
| }, Object.freeze(enums.UIDirection), enums.UISlotInteractionState = { | |
| NONE: "", | |
| HOVER: "ui-slot-hover", | |
| SELECTED: "ui-slot-selected" | |
| }, Object.freeze(enums.UISlotInteractionState), enums.UIButtonState = { | |
| ACTIVE: enums.UIState.ACTIVE, | |
| DISABLED: enums.UIState.DISABLED, | |
| HOVER: enums.UIState.HOVER, | |
| CALL_TO_ACTION: "call-to-action" | |
| }, Object.freeze(enums.UIButtonState), enums.UIListRowState = { | |
| HAS_ACTION: "has-action", | |
| HAS_TAP_CALLBACK: "has-tap-callback", | |
| IS_ACTIVE_SQUAD: "is-active", | |
| SELECTED: enums.UIState.SELECTED, | |
| ACTIVE: enums.UIState.ACTIVE, | |
| DISABLED: enums.UIState.DISABLED, | |
| ENABLED: enums.UIState.ENABLED | |
| }, Object.freeze(enums.UIListRowState), enums.UIFeedbackState = { | |
| NONE: "no-state", | |
| LOW: "feedback-red", | |
| MEDIUM: "feedback-orange", | |
| HIGH: "feedback-green", | |
| STAT_INCREASE: "statIncrease", | |
| STAT_DECREASE: "statIncrease" | |
| }, Object.freeze(enums.UIFeedbackState), enums.UICompletionState = { | |
| INCOMPLETE: 0, | |
| IN_PROGRESS: 1, | |
| COMPLETE: 2 | |
| }, Object.freeze(enums.UICompletionState), enums.UIPinnedListItem = { | |
| HAS_ITERATOR: "has-iterator", | |
| HAS_NEXT: "has-next", | |
| HAS_PREV: "has-prev" | |
| }, Object.freeze(enums.UIPinnedListItem), enums.UIPanels = { | |
| TABLE_ALTERNATING: "panel-table-alternating" | |
| }, Object.freeze(enums.UIPanels), enums.UIDeviceTypes = { | |
| PHONE: "phone", | |
| LANDSCAPE: "landscape" | |
| }, Object.freeze(enums.UIDeviceTypes), enums.UIProgressBar = { | |
| SBC: "sbc-progress-bar", | |
| STATS: "stats-progress-bar", | |
| REVERSE: "reverse" | |
| }, Object.freeze(enums.UIProgressBar), enums.UIFlexible = { | |
| LG: "lg", | |
| XLG: "xlg", | |
| MD: "md", | |
| SM: "sm" | |
| }, Object.freeze(enums.UIFlexible), enums.UISquadTabTypes = { | |
| WORK_AREA: "workTab", | |
| DOCK_TAB: "dockTab", | |
| ACTION_TAB: "actionTab", | |
| DEFAULT: "default" | |
| }, Object.freeze(enums.UISquadTabTypes), enums.UIConsumableCategory = { | |
| CONTRACTS: 0, | |
| FITNESS: 1, | |
| HEALING: 2, | |
| LEAGUEMOD: 3, | |
| PLAYSTYLE: 4, | |
| POSITION: 5, | |
| TRAINING: 6 | |
| }, Object.freeze(enums.UIConsumableCategory), enums.UIActiveItemImgType = { | |
| HOME_KIT: 0, | |
| AWAY_KIT: 1, | |
| BADGE_NORMAL: 2, | |
| BADGE_DARK: 3, | |
| BALL: 4, | |
| STADIUM: 5 | |
| }, Object.freeze(enums.UIActiveItemImgType), enums.UIInputType = { | |
| TEXT: "text", | |
| PASSWORD: "password" | |
| }, Object.freeze(enums.UIInputType), enums.UISearchFilters = { | |
| YEAR: "year", | |
| TYPE: "type", | |
| LEVEL: "level", | |
| POSITION: "position", | |
| POSITION_MOD: "positionMod", | |
| PLAYSTYLE: "playStyle", | |
| NATION: "nation", | |
| LEAGUE: "league", | |
| CLUB: "club" | |
| }, Object.freeze(enums.UISearchFilters), enums.UINotificationType = { | |
| POSITIVE: 0, | |
| NEUTRAL: 1, | |
| NEGATIVE: 2 | |
| }, Object.freeze(enums.UINotificationType), enums.UIOnboardingSelectionType = { | |
| NATION: "selection-nation", | |
| HOME_KIT: "selection-kit-home", | |
| AWAY_KIT: "selection-kit-away", | |
| BADGE: "selection-badge" | |
| }, Object.freeze(enums.UIOnboardingSelectionType), enums.UIOnboardingStep = { | |
| NATION: 1, | |
| LOANER: 2, | |
| KITS: 3, | |
| BADGE: 4, | |
| SUMMARY: 5 | |
| }, Object.freeze(enums.UIOnboardingStep), enums.UIPlatform = { | |
| NONE: "", | |
| XBX: "xbox360", | |
| XBO: "xboxOne", | |
| PS3: "playstation3", | |
| PS4: "playstation4", | |
| PC: "pc", | |
| SWI: "nintendoSwitch" | |
| }, Object.freeze(enums.UIPlatform), enums.ItemTintValues = {}, enums.ItemTintValues[enums.ItemRareType.NONE] = [ | |
| ["#d5ae7e", "#d5ae7e"], | |
| ["#b8bec3", "#b8bec3"], | |
| ["#e4d565", "#e4d565"] | |
| ], enums.ItemTintValues[enums.ItemRareType.RARE] = [ | |
| ["#d5ae7e", "#ffe8cc"], | |
| ["#b8bec3", "#fafeff"], | |
| ["#e4d565", "#fff9dd"] | |
| ], enums.ItemTintValues[enums.ItemRareType.TOTW] = [ | |
| ["#d5ae7e", "#372513"], | |
| ["#b8bec3", "#474c51"], | |
| ["#e4d565", "#372d13"] | |
| ], enums.ItemTintValues[enums.ItemRareType.PURPLE] = ["#c8b3f4", "#3e2b6f"], enums.ItemTintValues[enums.ItemRareType.TOTY] = ["#0d2b5e", "#e4d565"], enums.ItemTintValues[enums.ItemRareType.RB] = ["#d62a2a", "#1a4fd7"], enums.ItemTintValues[enums.ItemRareType.GREEN] = ["#3a9358", "#e8e8e8"], enums.ItemTintValues[enums.ItemRareType.ORANGE] = ["#f86e00", "#a54b0f"], enums.ItemTintValues[enums.ItemRareType.PINK] = ["#eb6495", "#692340"], enums.ItemTintValues[enums.ItemRareType.TEAL] = ["#66d0c6", "#0c3232"], enums.ItemTintValues[enums.ItemRareType.TOTS] = [ | |
| ["#0439b6", "#d5ae7e"], | |
| ["#0439b6", "#d8dfe5"], | |
| ["#0439b6", "#e4d565"] | |
| ], enums.ItemTintValues[enums.ItemRareType.LEGEND] = ["#1f365e", "#b1a274"], enums.ItemTintValues[enums.ItemRareType.FUTTY] = ["#ff8ebe", "#e4d565"], enums.ItemTintValues[enums.ItemRareType.STORYMODE] = ["#e4d565", "#372d13"], enums.ItemTintValues[enums.ItemRareType.CHAMPION] = [ | |
| ["#f4cb98", "#d62a2a"], | |
| ["#b8bec3", "#d62a2a"], | |
| ["#e4d565", "#d62a2a"] | |
| ], enums.ItemTintValues[enums.ItemRareType.CMOTM] = ["#007ec0", "#db8439"], enums.ItemTintValues[enums.ItemRareType.IMOTM] = ["#aa2716", "#db8439"], enums.ItemTintValues[enums.ItemRareType.OTW] = ["#b8bec3", "#e4d565"], enums.ItemTintValues[enums.ItemRareType.HALLOWEEN] = ["#c5540f", "#240f00"], enums.ItemTintValues[enums.ItemRareType.MOVEMBER] = ["#aea590", "#412819"], enums.ItemTintValues[enums.ItemRareType.SBC] = ["#0e96e4", "#9610b1"], enums.ItemTintValues[enums.ItemRareType.SBCP] = ["#9dfef8", "#e00cc8"], enums.ItemTintValues[enums.ItemRareType.PROMOA] = ["#3b7ddf", "#ff8a00"], enums.ItemTintValues[enums.ItemRareType.PROMOB] = ["#1763a3", "#a41f27"], enums.ItemTintValues[enums.ItemRareType.AWARD] = ["#7d5ab8", "#d8c065"], enums.ItemTintValues[enums.ItemRareType.UNITED] = ["#e94389", "#373183"], enums.ItemTintValues[enums.ItemRareType.RTRC] = ["#d62a2a", "#2c4b8d"], enums.ItemTintValues[enums.ItemRareType.RTRS] = ["#d62a2a", "#2c4b8d"], enums.ItemTintValues[enums.ItemRareType.RTRW] = [ | |
| ["#d62a2a", "#b8bec3"], | |
| ["#d62a2a", "#b8bec3"], | |
| ["#d62a2a", "#e4d565"] | |
| ], enums.ItemTintValues[enums.ItemRareType.MARQUEE] = ["#b4ee34", "#201d55"], enums.ItemTintValues[enums.ItemRareType.EUMOTM] = ["#28a0f2", "#ff8a00"], Object.freeze(enums.ItemTintValues), NamespaceManager.Register("enums"), enums.URLParams = { | |
| TOKEN: "token", | |
| EXPIRE: "expire", | |
| SHOWOFFID: "showoffId" | |
| }, enums.DeepLinkSections = { | |
| NONE: "", | |
| HOME: "home", | |
| SBC: "sbc", | |
| AUCTION: "auction", | |
| ACTIVE_SQUAD: "activesquad", | |
| STORE: "store", | |
| TOTW: "teamoftheweek", | |
| TRADE_PILE: "tradepile", | |
| UNASSIGNED: "unassigned", | |
| WATCH_LIST: "watchlist", | |
| OBJECTIVES: "objectives" | |
| }, Object.defineProperty(FUTObject.prototype, "superclass", { | |
| get: function get() { | |
| for (var t = get.caller, name = t.name, i = this[name] === t, s = this; s && (s = Object.getPrototypeOf(s)) && s[name];) | |
| if (s[name] === t) i = !0; | |
| else if (i) return s[name]; | |
| return utils.Debug.Assert(!1, "superclass() may not be called outside a named method implementation."), null | |
| } | |
| }), FUTObject.prototype.isSubClass = function isSubClass(t) { | |
| return utils.Debug.Assert(utils.JS.isFunction(t), "Expected function representing a class."), this instanceof t | |
| }, FUTObject.prototype.conforms = function conforms(t) { | |
| utils.Debug.Assert(utils.JS.isFunction(t), "Expected function representing an interface."); | |
| var i; | |
| for (i in t.prototype) | |
| if (t.prototype.hasOwnProperty(i) && !this[i]) return !1; | |
| return !0 | |
| }, FUTObject.prototype.init = function init() {}, | |
| FUTObject.prototype.dealloc = function dealloc() {}, FUTHashTable.prototype.set = function set(key, value) { | |
| var t = this.has(key) ? this._collection[key] : null; | |
| return this._collection[key] = value, t | |
| }, FUTHashTable.prototype.get = function get(key) { | |
| return this.has(key) ? this._collection[key] : null | |
| }, FUTHashTable.prototype.has = function has(key) { | |
| return this._collection.hasOwnProperty(key) | |
| }, FUTHashTable.prototype.remove = function remove(key) { | |
| if (this.has(key)) { | |
| var t = this._collection[key]; | |
| return delete this._collection[key], t | |
| } | |
| return null | |
| }, FUTHashTable.prototype.keys = function keys() { | |
| return Object.keys(this._collection) | |
| }, FUTHashTable.prototype.values = function values() { | |
| var t, i = []; | |
| for (t in this._collection) this._collection.hasOwnProperty(t) && i.push(this._collection[t]); | |
| return i | |
| }, FUTHashTable.prototype.forEach = function forEach(t, scope) { | |
| var i, s = 0; | |
| for (i in this._collection) this._collection.hasOwnProperty(i) && (t.call(scope, this._collection[i], s, this.values().slice(0)), ++s) | |
| }, FUTHashTable.prototype.map = function map(t, scope) { | |
| var i, s = 0, | |
| result = []; | |
| for (i in this._collection) this._collection.hasOwnProperty(i) && (result.push(t.call(scope, this._collection[i], s, this.values().slice(0))), ++s); | |
| return result | |
| }, FUTHashTable.prototype.filter = function filter(t, scope) { | |
| var i, s = 0, | |
| result = []; | |
| for (i in this._collection) this._collection.hasOwnProperty(i) && (t.call(scope, this._collection[i], s, this.values().slice(0)) && result.push(this._collection[i]), ++s); | |
| return result | |
| }, FUTHashTable.prototype.find = function find(t) { | |
| if ("function" != typeof t) return utils.Debug.Assert(!1, "[FUTHashTable::find] Expected a comparison function as first parameter."), null; | |
| var i; | |
| for (i in this._collection) | |
| if (this._collection.hasOwnProperty(i) && t(this._collection[i])) return this._collection[i]; | |
| return null | |
| }, FUTHashTable.prototype.clear = function clear() { | |
| this._collection = {} | |
| }, utils.JS.inherits(FUTIterator, FUTObject), FUTIterator.prototype.setIndex = function setIndex(t) { | |
| utils.Debug.Assert(0 === t || t > 0 && t < this._collection.length, "[FUTIterator::setIndex] Value provided is outside acceptable bounds."), t < 0 ? t = 0 : t >= this._collection.length && (t = this._collection.length - 1), this._index = t | |
| }, FUTIterator.prototype.getIndex = function getIndex() { | |
| return this._index | |
| }, FUTIterator.prototype.resetIndex = function resetIndex() { | |
| this._index = 0 | |
| }, FUTIterator.prototype.resetCollection = function resetCollection(t) { | |
| this._collection = t, this._index = 0 | |
| }, FUTIterator.prototype.current = function current() { | |
| return this._collection[this._index] | |
| }, FUTIterator.prototype.get = function get(index) { | |
| return this._collection[index] || null | |
| }, FUTIterator.prototype.set = function set(t, index) { | |
| utils.JS.isNumber(index) && index < this._collection.length ? this._collection[index] = t : utils.Debug.Assert(!1, "FUTIterator::set. Trying to set val in an invalid index.") | |
| }, FUTIterator.prototype.next = function next() { | |
| return this._index < this._collection.length - 1 && ++this._index, this._collection[this._index] | |
| }, FUTIterator.prototype.previous = function previous() { | |
| return this._index > 0 && --this._index, this._collection[this._index] | |
| }, FUTIterator.prototype.add = function add(t, index) { | |
| return !utils.JS.isNumber(index) || index >= this._collection.length ? this._collection.push(t) : this._collection.splice(index, 0, t), t | |
| }, FUTIterator.prototype.remove = function remove(index) { | |
| var t = this._collection.splice(index, 1); | |
| return this._index >= this._collection.length && (this._index = this._collection.length > 0 ? this._collection.length - 1 : 0), t | |
| }, FUTIterator.prototype.shift = function shift() { | |
| var t = this._collection.shift(); | |
| return this._index >= this._collection.length && (this._index = this._collection.length > 0 ? this._collection.length - 1 : 0), t | |
| }, FUTIterator.prototype.pop = function pop() { | |
| var t = this._collection.pop(); | |
| return this._index >= this._collection.length && (this._index = this._collection.length > 0 ? this._collection.length - 1 : 0), t | |
| }, FUTIterator.prototype.values = function values() { | |
| return this._collection | |
| }, FUTIterator.prototype.indexOf = function indexOf(t) { | |
| if ("function" != typeof t) return utils.Debug.Assert(!1, "[FUTIterator::indexOf] Expected a function to be provided."), -1; | |
| var i; | |
| for (i = 0; i < this._collection.length; ++i) | |
| if (t(this._collection[i])) return i; | |
| return -1 | |
| }, utils.JS.inherits(FUTObservable, FUTObject), FUTObservable.prototype.dealloc = function dealloc() { | |
| this.clearObservers(), this.superclass() | |
| }, FUTObservable.prototype.observe = function observe(t, i) { | |
| utils.Debug.Assert(utils.JS.isObject(t), "Expected a scope of type object."), utils.Debug.Assert(utils.JS.isFunction(i), "Expected a callback function."); | |
| for (var s = this._observers.length; s-- > 0;) { | |
| var o = this._observers[s]; | |
| if (o.scope === t && o.cb === i) return this | |
| } | |
| return this._observers.push({ | |
| scope: t, | |
| cb: i | |
| }), this | |
| }, FUTObservable.prototype.unobserve = function unobserve(t, i) { | |
| return this._observers = this._observers.filter(function _clearObserver(s) { | |
| return s.scope !== t && (!utils.JS.isFunction(i) || s.cb !== i) | |
| }, this), this | |
| }, FUTObservable.prototype.clearObservers = function clearObservers() { | |
| return this._observers = [], this | |
| }, FUTObservable.prototype.notify = function notify(data) { | |
| function _notifyObserver(t) { | |
| t.cb.apply(t.scope, s) | |
| } | |
| var t, i = arguments.length, | |
| s = []; | |
| for (t = 0; t < i; t++) s[t] = arguments[t]; | |
| return s.unshift(this), setTimeout(function() { | |
| this._observers.slice().forEach(_notifyObserver, this) | |
| }.bind(this), 0), this | |
| }, utils.JS.inherits(FUTStorageAlternative, FUTObject), FUTStorageAlternative.prototype.setItem = function setItem(key, value) { | |
| this._localStorage[key] = value | |
| }, FUTStorageAlternative.prototype.getItem = function getItem(key) { | |
| return void 0 !== this._localStorage[key] ? this._localStorage[key] : null | |
| }, FUTStorageAlternative.prototype.key = function key(t) { | |
| return Object.keys(this._localStorage)[t] | |
| }, FUTStorageAlternative.prototype.removeItem = function removeItem(key) { | |
| delete this._localStorage[key] | |
| }, FUTStorageAlternative.prototype.clear = function clear() { | |
| var key; | |
| for (key in this._localStorage) this._localStorage.hasOwnProperty(key) && this.removeItem(key); | |
| this._localStorage = {} | |
| }, utils.JS.inherits(FUTNotificationDispatcher, FUTObject), FUTNotificationDispatcher.prototype.addObserver = function addObserver(id, t, i) { | |
| this._observers.has(id) || this._observers.set(id, new FUTObservable), this._observers.get(id).observe(t, i) | |
| }, FUTNotificationDispatcher.prototype.removeObserver = function removeObserver(id, t) { | |
| this._observers.has(id) && this._observers.get(id).unobserve(t) | |
| }, FUTNotificationDispatcher.prototype.removeObserversById = function removeObserversById(id) { | |
| this._observers.has(id) && (this._observers.get(id).clearObservers(), this._observers.remove(id)) | |
| }, FUTNotificationDispatcher.prototype.clearObservers = function clearObservers() { | |
| this._observers.clear() | |
| }, FUTNotificationDispatcher.prototype.notify = function notify(id, sender, data) { | |
| this._observers.has(id) && this._observers.get(id).notify(sender, data) | |
| }, NamespaceManager.Register("interfaces"), interfaces.TouchResponder = function() {}, interfaces.TouchResponder.prototype._touchStarted = function(e) {}, interfaces.TouchResponder.prototype._touchMoved = function(e) {}, interfaces.TouchResponder.prototype._touchEnded = function(e) {}, interfaces.TouchResponder.prototype._touchCancelled = function(e) {}, interfaces.TouchResponder.prototype._tapDetected = function(e) {}, NamespaceManager.Register("interfaces"), interfaces.ValueObject = function() {}, interfaces.ValueObject.prototype.get = function() {}, interfaces.ValueObject.prototype.set = function(t) {}, NamespaceManager.Register("valueobjects"), valueobjects.BooleanVO = function() { | |
| this._value = !1 | |
| }, valueobjects.BooleanVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.BooleanVO.prototype.set = function(t) { | |
| var i = utils.JS.isBoolean(t); | |
| utils.Debug.Assert(i, "Invalid assignment; expected a boolean."), i && (this._value = t) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.NumberVO = function() { | |
| this._value = 0 | |
| }, valueobjects.NumberVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.NumberVO.prototype.set = function(t) { | |
| var i = utils.JS.isNumber(t); | |
| utils.Debug.Assert(i, "Invalid assignment; expected a number."), i && (this._value = t) | |
| }, utils.JS.inherits(FUIResponder, FUTObject), FUIResponder.prototype.dealloc = function dealloc() { | |
| this._stopHandlingEvents(!0), this._eventElement = null, | |
| this._eventDelegates = [], this.superclass() | |
| }, FUIResponder.prototype.setEventDelegate = function setEventDelegate(t) { | |
| utils.Debug.Assert(t instanceof FUIResponder, "Expected an instance of FUIResponder"), this._eventDelegates.push(t) | |
| }, FUIResponder.prototype.getEventDelegate = function getEventDelegate() { | |
| var t = this._eventDelegates.length; | |
| return t > 0 ? this._eventDelegates[t - 1] : null | |
| }, FUIResponder.prototype.removeEventDelegate = function removeEventDelegate(t) { | |
| utils.Debug.Assert(t instanceof FUIResponder, "Expected an instance of FUIResponder"); | |
| var index = this._eventDelegates.indexOf(t); | |
| index >= 0 && this._eventDelegates.splice(index, 1) | |
| }, FUIResponder.prototype._addListener = function _addListener(event, t, i, s) { | |
| event.split(" ").forEach(function(event) { | |
| t.addEventListener(event, i, !1), this._eventListeners.push({ | |
| event: event, | |
| elem: t, | |
| cb: i, | |
| ns: s || "" | |
| }) | |
| }, this) | |
| }, FUIResponder.prototype._removeListenersByNS = function _removeListenersByNS(t) { | |
| var i = []; | |
| this._eventListeners.forEach(function(s) { | |
| s.ns === t ? s.elem.removeEventListener(s.event, s.cb) : i.push(s) | |
| }, this), this._eventListeners = i | |
| }, FUIResponder.prototype._removeListenersByName = function _removeListenersByName(t) { | |
| Array.prototype.slice.call(arguments, 0).forEach(function _removeListenerByName(event) { | |
| var t = []; | |
| this._eventListeners.forEach(function(i) { | |
| event.indexOf(i.event) > -1 ? i.elem.removeEventListener(i.event, i.cb) : t.push(i) | |
| }, this), this._eventListeners = t | |
| }, this) | |
| }, FUIResponder.prototype._setScrollPosCache = function _setScrollPosCache(t, i) { | |
| t.push(i.scrollTop), "BODY" !== i.nodeName && this._setScrollPosCache(t, i.parentElement) | |
| }, FUIResponder.prototype._detectScroll = function _detectScroll() { | |
| var t = []; | |
| if (this._setScrollPosCache(t, this._eventElement), t.length !== this._scrollPositions.length) return !0; | |
| for (var i = t.length; i-- > 0;) | |
| if (t[i] !== this._scrollPositions[i]) return !0; | |
| return !1 | |
| }, FUIResponder.prototype._compareTouchIdentifier = function _compareTouchIdentifier(t) { | |
| return t.identifier === this._touchID | |
| }, FUIResponder.prototype._getTouch = function _getTouch(e) { | |
| return e instanceof MouseEvent ? e : utils.JS.find(e.targetTouches, this._compareTouchIdentifier.bind(this)) | |
| }, FUIResponder.prototype._checkDidTouchChange = function _checkDidTouchChange(e) { | |
| if (e instanceof MouseEvent) return !0; | |
| var t = utils.JS.find(e.changedTouches, this._compareTouchIdentifier.bind(this)); | |
| return utils.JS.isValid(t) | |
| }, FUIResponder.prototype._resetState = function _resetState() { | |
| this._touchID = -1, this._hasMoved = !1, this._touchOriginX = 0, this._touchOriginY = 0, this._scrollPositions = [] | |
| }, FUIResponder.prototype._startHandlingEvents = function _startHandlingEvents(t) { | |
| utils.Debug.Assert(t instanceof Element || t instanceof jQuery, "[FUIResponder::_startHandlingEvents] Expected an HTML element as first parameter."), this._eventElement = t instanceof jQuery ? t.get(0) : t, this._addListener(enums.Event.TOUCHSTART, this._eventElement, this._handleTouchStartEvent.bind(this)), this._addListener(enums.Event.MOUSEDOWN, this._eventElement, this._handleTouchStartEvent.bind(this)), this._addListener(enums.Event.MOUSEENTER, this._eventElement, this._handleMouseEnterEvent.bind(this)), this._addListener(enums.Event.MOUSELEAVE, this._eventElement, this._handleMouseLeaveEvent.bind(this)) | |
| }, FUIResponder.prototype._stopHandlingEvents = function _stopHandlingEvents(t) { | |
| this._touchID >= 0 && this._touchCancelled(null), this._eventListeners.forEach(function(i) { | |
| (t || i.elem === this._eventElement) && i.elem.removeEventListener(i.event, i.cb) | |
| }, this), this._eventListeners = [], this._resetState() | |
| }, FUIResponder.prototype._handleTouchStartEvent = function _handleTouchStartEvent(e) { | |
| if (this._eventElement && !(this._touchID >= 0)) { | |
| if (this.allowLegacyPropagation || e.stopImmediatePropagation(), e instanceof MouseEvent) this._touchID = 1, this._touchOriginX = e.clientX, this._touchOriginY = e.clientY; | |
| else { | |
| if (e.touches.length > 1) return e.preventDefault(), void e.stopPropagation(); | |
| this._touchID = e.targetTouches[0].identifier, this._touchOriginX = e.targetTouches[0].clientX, this._touchOriginY = e.targetTouches[0].clientY | |
| } | |
| this._setScrollPosCache(this._scrollPositions, this._eventElement), | |
| this._eventElementClientRect = this._eventElement.getBoundingClientRect(), this._touchStarted(e), this._addListener(enums.Event.TOUCHMOVE, this._eventElement, this._handleTouchMoveEvent.bind(this)), this._addListener(enums.Event.TOUCHEND, this._eventElement, this._handleTouchEndEvent.bind(this)), this._addListener(enums.Event.TOUCHCANCEL, this._eventElement, this._handleTouchCancelEvent.bind(this)), this._addListener(enums.Event.MOUSEMOVE, this._eventElement, this._handleTouchMoveEvent.bind(this)), this._addListener(enums.Event.MOUSEUP, this._eventElement, this._handleTouchEndEvent.bind(this)), this._addListener(enums.Event.MOUSECANCEL, this._eventElement, this._handleTouchCancelEvent.bind(this)) | |
| } | |
| }, FUIResponder.prototype._handleTouchMoveEvent = function _handleTouchMoveEvent(e) { | |
| if (this._checkDidTouchChange(e)) | |
| if (this._eventElement) { | |
| var t = this._getTouch(e); | |
| if (t) { | |
| if (!this._hasMoved) { | |
| var i = t.clientX, | |
| s = t.clientY, | |
| bounds = this._eventElementClientRect, | |
| o = i < bounds.left || i > bounds.right || s < bounds.top || s > bounds.bottom; | |
| this._hasMoved = o || Math.abs(i - this._touchOriginX) > this.moveDistanceThreshold || Math.abs(s - this._touchOriginY) > this.moveDistanceThreshold | |
| } | |
| this._hasMoved && this._touchMoved(e) | |
| } | |
| } else this._handleTouchCancelEvent(e) | |
| }, FUIResponder.prototype._handleTouchEndEvent = function _handleTouchEndEvent(e) { | |
| if (this._checkDidTouchChange(e)) { | |
| e.type === enums.Event.TOUCHEND && e.preventDefault(); | |
| var t = this._detectScroll(); | |
| !this._hasMoved && t && this._touchMoved(e), this._touchEnded(e), this._hasMoved || t || this._tapDetected(e), this._resetState(), this._removeListenersByName(enums.Event.MOUSEMOVE, enums.Event.MOUSEUP, enums.Event.MOUSECANCEL) | |
| } | |
| }, FUIResponder.prototype._handleTouchCancelEvent = function _handleTouchCancelEvent(e) { | |
| this._checkDidTouchChange(e) && (this._touchCancelled(e), this._resetState(), this._removeListenersByName(enums.Event.MOUSEMOVE, enums.Event.MOUSEUP, enums.Event.MOUSECANCEL)) | |
| }, FUIResponder.prototype._handleMouseEnterEvent = function _handleMouseEnterEvent(e) { | |
| e instanceof MouseEvent && this._mouseEnter(e) | |
| }, FUIResponder.prototype._handleMouseLeaveEvent = function _handleMouseLeaveEvent(e) { | |
| e instanceof MouseEvent && (this._touchID >= 0 && this._handleTouchCancelEvent(e), this._mouseLeave(e), this._resetState(), this._removeListenersByName(enums.Event.MOUSEMOVE, enums.Event.MOUSEUP, enums.Event.MOUSECANCEL)) | |
| }, FUIResponder.prototype._touchStarted = function _touchStarted(e) { | |
| var t = this.getEventDelegate(); | |
| t && t._touchStarted(e) | |
| }, FUIResponder.prototype._touchMoved = function _touchMoved(e) { | |
| var t = this.getEventDelegate(); | |
| t && t._touchMoved(e) | |
| }, FUIResponder.prototype._touchEnded = function _touchEnded(e) { | |
| var t = this.getEventDelegate(); | |
| t && t._touchEnded(e) | |
| }, FUIResponder.prototype._touchCancelled = function _touchCancelled(e) { | |
| var t = this.getEventDelegate(); | |
| t && t._touchCancelled(e) | |
| }, FUIResponder.prototype._mouseEnter = function _mouseEnter(e) {}, FUIResponder.prototype._mouseLeave = function _mouseLeave(e) {}, FUIResponder.prototype._tapDetected = function _tapDetected(e) { | |
| var t = this.getEventDelegate(); | |
| t && t._tapDetected(e) | |
| }, FUTTouchHandler.prototype.handleTouch = function(t) { | |
| this._element && this.stopTouchHandling(), this._element = t.get(0), this._addListener(enums.Event.MOUSEDOWN, this._onTouchStart.bind(this)) | |
| }, FUTTouchHandler.prototype.stopTouchHandling = function() { | |
| this._element && (this.touchend.notify(null), this._listeners.forEach(function(t) { | |
| this._element.removeEventListener(t.event, t.cb) | |
| }, this), this._listeners = [], this._resetState()), this.tap.clearObservers(), this.touchstart.clearObservers(), this.touchend.clearObservers(), this.touchmove.clearObservers() | |
| }, FUTTouchHandler.prototype._onTouchStart = function(e) { | |
| !this._element || this._touchID >= 0 || (this.preventDefault && e.preventDefault(), this.bubbleEvent || e.stopImmediatePropagation(), e instanceof MouseEvent ? (this._touchID = 1, this._originalX = e.clientX, this._originalY = e.clientY) : (this._touchID = e.targetTouches[0].identifier, this._originalX = e.targetTouches[0].clientX, this._originalY = e.targetTouches[0].clientY), this._setScrollPosCache(this._scrollPositions, this._element), | |
| this.touchstart.notify(e), this._addListener(enums.Event.MOUSEMOVE, this._onTouchMove.bind(this)), this._addListener(enums.Event.MOUSEUP, this._onTouchEnd.bind(this)), this._addListener(enums.Event.MOUSECANCEL, this._onTouchEnd.bind(this))) | |
| }, FUTTouchHandler.prototype._onTouchMove = function(e) { | |
| var t = null, | |
| i = !1; | |
| if (this._element) { | |
| if (t = this._getTouch(e)) { | |
| if (!this._hasMoved) { | |
| var s = t.clientX, | |
| o = t.clientY, | |
| bounds = this._element.getBoundingClientRect(); | |
| i = s < bounds.left || s > bounds.right || o < bounds.top || o > bounds.bottom, this._hasMoved = i || Math.abs(s - this._originalX) > this.moveDistanceThreshold || Math.abs(o - this._originalY) > this.moveDistanceThreshold | |
| } | |
| this._hasMoved && (this.touchmove.notify(e), this.endTouchOnLeave && i && this._onTouchEnd(e)) | |
| } | |
| } else this._onTouchEnd(e) | |
| }, FUTTouchHandler.prototype._onTouchEnd = function(e) { | |
| hideKeyboard(); | |
| var t = this._detectScroll(); | |
| !this._hasMoved && t && this.touchmove.notify(e), this.touchend.notify(e), this._hasMoved || t || this.tap.notify(e), this._resetState(), this._removeListenersByName(enums.Event.MOUSEMOVE, enums.Event.MOUSEUP, enums.Event.MOUSECANCEL) | |
| }, FUTTouchHandler.prototype._getTouch = function(e) { | |
| return e instanceof MouseEvent ? e : utils.JS.find(e.targetTouches, function(t) { | |
| return t.identifier === this._touchID | |
| }.bind(this)) | |
| }, FUTTouchHandler.prototype._resetState = function() { | |
| this._touchID = -1, this._hasMoved = !1, this._originalX = 0, this._originalY = 0, this._scrollPositions = [] | |
| }, FUTTouchHandler.prototype._addListener = function(event, t) { | |
| this._element.addEventListener(event, t, !1), this._listeners.push({ | |
| event: event, | |
| cb: t | |
| }) | |
| }, FUTTouchHandler.prototype._removeListenersByName = function(t) { | |
| Array.prototype.slice.call(arguments, 0).forEach(function removeEventListener(event) { | |
| for (var t = this._listeners.length; t-- > 0;) { | |
| var i = this._listeners[t]; | |
| i.event === event && (this._element.removeEventListener(i.event, i.cb), this._listeners.splice(t, 1)) | |
| } | |
| }, this) | |
| }, FUTTouchHandler.prototype._setScrollPosCache = function(t, i) { | |
| t.push(i.scrollTop), "BODY" !== i.nodeName && this._setScrollPosCache(t, i.parentElement) | |
| }, FUTTouchHandler.prototype._detectScroll = function() { | |
| var t = []; | |
| if (this._setScrollPosCache(t, this._element), t.length !== this._scrollPositions.length) return !0; | |
| for (var i = t.length; i-- > 0;) | |
| if (t[i] !== this._scrollPositions[i]) return !0; | |
| return !1 | |
| }, NamespaceManager.Register("utils"), utils.HTTP = {}, utils.HTTP.getParamsFromUrl = function getParamsFromUrl(url) { | |
| var t = url ? url.split("?")[1] : window.location.search.slice(1), | |
| i = new FUTHashTable({}); | |
| return t && (t = t.split("#")[0]).split("&").forEach(function(t) { | |
| var a = t.split("="), | |
| s = void 0 === a[1] ? "" : a[1], | |
| o = a[0]; | |
| i.set(o, s) | |
| }), i | |
| }, utils.HTTP.generateUrlParams = function generateUrlParams(t) { | |
| var i = ""; | |
| if (utils.JS.isValid(t)) { | |
| var s; | |
| for (s in t) t.hasOwnProperty(s) && (i += -1 === i.indexOf("?") ? "?" : "&", i += s + "=" + t[s]) | |
| } | |
| return i | |
| }, utils.HTTP.getUriRoot = function getUriRoot(href) { | |
| return href.substring(0, href.lastIndexOf("/")) + "/" | |
| }, utils.HTTP.urlHasFile = function urlHasFile(href, t) { | |
| var i = new RegExp("." + t + "$"); | |
| return href.match(i) | |
| }, utils.HTTP.urlHasImage = function urlHasImage(href) { | |
| return href = href.toLowerCase(), utils.HTTP.urlHasFile(href, "png") || utils.HTTP.urlHasFile(href, "gif") || utils.HTTP.urlHasFile(href, "jpg") || utils.HTTP.urlHasFile(href, "jpeg") | |
| }, utils.HTTP.urlHasScheme = function urlHasScheme(href) { | |
| href = href.toLowerCase(); | |
| var t = new RegExp("^(http|https)://"); | |
| return href.match(t) | |
| }, utils.HTTP.getHostname = function getHostname(url) { | |
| var hostname; | |
| return hostname = url.indexOf("://") > -1 ? url.split("/")[2] : url.split("/")[0], hostname = hostname.split(":")[0], hostname = hostname.split("?")[0] | |
| }, NamespaceManager.Register("utils"), utils.Debug = {}, utils.Debug.Assert = function(t, message) {}, utils.Debug.StackTrace = function() {}, utils.Debug.Watch = function(name, scope) {}, NamespaceManager.Register("transferobjects"), transferobjects.FUTHttpResponse = function FUTHttpResponseDTO() { | |
| this.status = enums.HTTPStatusCode.UNKNOWN, this.success = !1, this.response = null, this.maxAge = 0, this.retryAfter = 0 | |
| }, utils.JS.inherits(FUTHttpRequest, FUTObservable), FUTHttpRequest.prototype.setCache = function setCache(t) { | |
| this._cache = !!t | |
| }, | |
| FUTHttpRequest.prototype.setUrl = function setUrl(url) { | |
| this._url = url | |
| }, FUTHttpRequest.prototype.setContentType = function setContentType(type) { | |
| this._contentType = type | |
| }, FUTHttpRequest.prototype.setRequestType = function setRequestType(type) { | |
| this._requestType = type | |
| }, FUTHttpRequest.prototype.overrideMimeType = function overrideMimeType(type) { | |
| this._mimeOverride = type | |
| }, FUTHttpRequest.prototype.setUrlVariables = function setUrlVariables(t) { | |
| this._urlVariables = utils.HTTP.generateUrlParams(t) | |
| }, FUTHttpRequest.prototype.setRequestBody = function setRequestBody(body) { | |
| this._requestBody = JSON.stringify(body) | |
| }, FUTHttpRequest.prototype.setRequestHeader = function setRequestHeader(name, value) { | |
| this._http.readyState > XMLHttpRequest.OPENED ? utils.Debug.Assert(!1, "Attempted to set an HTTP request header when request has already been sent.") : this._http.readyState === XMLHttpRequest.UNSENT ? this._requestHeaders.push({ | |
| name: name, | |
| value: value | |
| }) : this._http.setRequestHeader(name, value) | |
| }, FUTHttpRequest.prototype.setTimeout = function setTimeout(time) { | |
| this._http.readyState === XMLHttpRequest.DONE ? utils.Debug.Assert(!1, "Attempted to assign timeout to an HTTP request when it has already been completed.") : this._http.readyState > XMLHttpRequest.UNSENT && (this._http.timeout = time), this._timeout = time | |
| }, FUTHttpRequest.prototype._setDefaultHeaders = function _setDefaultHeaders() { | |
| this._http.setRequestHeader("Content-Type", this._contentType) | |
| }, FUTHttpRequest.prototype.reset = function reset() { | |
| this._http.abort() | |
| }, FUTHttpRequest.prototype.send = function send() { | |
| if (this._http.readyState > XMLHttpRequest.UNSENT && this._http.readyState < XMLHttpRequest.DONE) utils.Debug.Assert(!1, "Attempted to send an HTTP request when it is in the middle of sending."); | |
| else if (this._http.readyState === XMLHttpRequest.DONE && this.reset(), utils.JS.isEmpty(this._url)) utils.Debug.Assert(!1, "Attempted to send an HTTP request when URL is not set."); | |
| else { | |
| var url = this._url + this._urlVariables; | |
| this._cache || (url += (/\?/.test(url) ? "&" : "?") + Date.now()), this._http.open(this._requestType, url, !0), this._setDefaultHeaders(); | |
| for (var headers = this._requestHeaders.slice(); headers.length > 0;) { | |
| var t = headers.pop(); | |
| this._http.setRequestHeader(t.name, t.value) | |
| } | |
| this._timeout > 0 && (this._http.timeout = this._timeout), this._http.onreadystatechange = this._onStateChange.bind(this), this._requestBody && this._requestType !== enums.HTTPRequestMethod.DELETE ? this._http.send(this._requestBody) : this._http.send() | |
| } | |
| }, FUTHttpRequest.prototype._onStateChange = function _onStateChange() { | |
| this._http.readyState === XMLHttpRequest.DONE && (this._http.status >= 200 && this._http.status < 300 || 304 === this._http.status ? this._handleSuccess() : this._handleFail()) | |
| }, FUTHttpRequest.prototype._parseResponse = function _parseResponse() { | |
| if (this._http.response) { | |
| if ("json" === this._http.responseType || utils.JS.isString(this._http.response) && this._http.response.length > 0) try { | |
| return JSON.parse(this._http.response) | |
| } catch (t) {} | |
| return this._http.response.toString() | |
| } | |
| return null | |
| }, FUTHttpRequest.prototype._handleSuccess = function _handleSuccess() { | |
| var t = new transferobjects.FUTHttpResponse; | |
| t.status = this._http.status, t.success = !0, t.response = this._parseResponse(), this.notify(t) | |
| }, FUTHttpRequest.prototype._handleFail = function _handleFail() { | |
| var t = new transferobjects.FUTHttpResponse; | |
| if (t.status = this._http.status, utils.JS.isString(this._http.response)) { | |
| var reason = this._http.response; | |
| reason.match(enums.NetworkErrorReason.MULTIPLE_SESSION) ? t.status = enums.HTTPStatusCode.LOGGED_IN_ON_CONSOLE : reason.match(enums.NetworkErrorReason.WRONG_CREDENTIALS) || reason.match(enums.NetworkErrorReason.INVALID_CREDENTIALS) ? t.status = enums.HTTPStatusCode.INVALID_CREDENTIALS : reason.match(enums.NetworkErrorReason.BANNED) ? t.status = enums.HTTPStatusCode.ACCOUNT_BANNED : (reason.match(enums.NetworkErrorReason.CLIENT_VERSION_EXPIRED) || reason.match(enums.NetworkErrorReason.CLIENT_VERSION_UNKNOWN)) && (t.status = enums.HTTPStatusCode.UPDATE_REQUIRED) | |
| } | |
| t.retryAfter = parseInt(this._http.getResponseHeader("Retry-After"), 10) || 0, this.notify(t) | |
| }, | |
| utils.JS.inherits(FUTUtasHttpRequest, FUTHttpRequest), FUTUtasHttpRequest.prototype.reset = function reset() { | |
| this.superclass(), this._doReauth = !0 | |
| }, FUTUtasHttpRequest.prototype.setUrl = function setUrl(url) { | |
| this._url = this._delegate.getSession(enums.AuthEnvironment.UTAS).url + url | |
| }, FUTUtasHttpRequest.prototype._setDefaultHeaders = function _setDefaultHeaders() { | |
| this.superclass(), this._http.setRequestHeader("X-UT-SID", this._delegate.getSession(enums.AuthEnvironment.UTAS).id), this._http.setRequestHeader("X-UT-PHISHING-TOKEN", gUserSettingsModel.getUserItem(models.UserSettingsModel.SECURITY_TOKEN)) | |
| }, FUTUtasHttpRequest.prototype._handleReauth = function _handleReauth(t, data) { | |
| t.unobserve(this), data.success ? this.send() : (this._doReauth = !1, this._handleFail()) | |
| }, FUTUtasHttpRequest.prototype._handleSuccess = function _handleSuccess() { | |
| var t = new transferobjects.FUTHttpResponse; | |
| t.status = this._http.status, t.success = !0, t.response = this._parseResponse(), utils.JS.isObject(t.response) && t.response.hasOwnProperty("code") && "200" !== t.response.code && (t.success = !1, t.status = t.response.code); | |
| var i = this._http.getResponseHeader("Cache-Control"); | |
| if (i) { | |
| var s = i.split(/[= ,]/); | |
| "max-age" === s[0] && "string" == typeof s[1] && s[1].length > 0 && (t.maxAge = parseInt(s[1], 10)) | |
| } | |
| this.notify(t) | |
| }, FUTUtasHttpRequest.prototype._handleFail = function _handleFail() { | |
| this._doReauth && this._http.status === enums.HTTPStatusCode.UNAUTHORIZED ? this._delegate.authenticate(enums.AuthEnvironment.UTAS).observe(this, this._handleReauth) : this.superclass() | |
| }, NamespaceManager.Register("entities"), entities.Objective = function(data) { | |
| this.id = data.objectiveId, Object.defineProperty(this, "id", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.name = data.name, Object.defineProperty(this, "name", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.header = data.header, Object.defineProperty(this, "header", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.description = data.description, Object.defineProperty(this, "description", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.shortDescription = data.shortDescription, Object.defineProperty(this, "shortDescription", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.imageBase = data.imageBase, Object.defineProperty(this, "imageBase", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.gameArea = data.gameArea, Object.defineProperty(this, "gameArea", { | |
| writable: !1, | |
| enumerable: !0 | |
| }); | |
| var t; | |
| Object.defineProperty(this, "link", { | |
| get: function() { | |
| return t | |
| }, | |
| set: function(i) { | |
| var key; | |
| for (key in enums.Objectives.GoToLink) | |
| if (enums.Objectives.GoToLink.hasOwnProperty(key) && enums.Objectives.GoToLink[key] === i) return void(t = i); | |
| utils.Debug.Assert(!1, "Invalid assignment to entities.Objective -> link") | |
| } | |
| }), this.link = data.takeMeThereLink, this.difficulty = data.difficulty, Object.defineProperty(this, "difficulty", { | |
| writable: !1, | |
| enumerable: !0 | |
| }); | |
| var i; | |
| Object.defineProperty(this, "type", { | |
| get: function() { | |
| return i | |
| }, | |
| set: function(t) { | |
| var key; | |
| for (key in enums.Objectives.Type) | |
| if (enums.Objectives.Type.hasOwnProperty(key) && enums.Objectives.Type[key] === t) return void(i = t); | |
| utils.Debug.Assert(!1, "Invalid assignment to entities.Objective -> type") | |
| } | |
| }), this.type = data.type, this.requiresReset = data.requiresReset, Object.defineProperty(this, "requiresReset", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.isWeb = data.isWeb, Object.defineProperty(this, "isWeb", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.startTime = data.startTime, Object.defineProperty(this, "startTime", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.lastUpdateTime = data.lastUpdateTime, Object.defineProperty(this, "lastUpdateTime", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.expiryTime = data.expiryTime + 10, Object.defineProperty(this, "expiryTime", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.slot = data.slot, Object.defineProperty(this, "slot", { | |
| writable: !1, | |
| enumerable: !0 | |
| }); | |
| var s; | |
| Object.defineProperty(this, "state", { | |
| get: function() { | |
| return s | |
| }, | |
| set: function(t) { | |
| var key; | |
| for (key in enums.Objectives.State) | |
| if (enums.Objectives.State.hasOwnProperty(key) && enums.Objectives.State[key] === t) return void(s = t); | |
| utils.Debug.Assert(!1, "Invalid assignment to entities.Objective -> state") | |
| } | |
| }), this.state = data.state, this.currentProgress = data.currentProgress, Object.defineProperty(this, "currentProgress", { | |
| writable: !0, | |
| enumerable: !0 | |
| }), this.multiplier = data.multiplier, Object.defineProperty(this, "multiplier", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.isDaily = this.type === enums.Objectives.Type.DAILY, Object.defineProperty(this, "isDaily", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.isWeekly = this.type === enums.Objectives.Type.WEEKLY, Object.defineProperty(this, "isWeekly", { | |
| writable: !1, | |
| enumerable: !0 | |
| }) | |
| }, entities.Objective.prototype.markAsCompleted = function markAsCompleted() { | |
| this.state = enums.Objectives.State.COMPLETED | |
| }, entities.Objective.prototype.markAsRedeemed = function markAsRedeemed() { | |
| this.state = enums.Objectives.State.REDEEMED | |
| }, entities.Objective.prototype.isInvalid = function isInvalid() { | |
| return this.state === enums.Objectives.State.INVALID | |
| }, entities.Objective.prototype.isInProgress = function isInProgress() { | |
| return this.state === enums.Objectives.State.IN_PROGRESS | |
| }, entities.Objective.prototype.isUnclaimed = function isUnclaimed() { | |
| return this.state === enums.Objectives.State.COMPLETED | |
| }, entities.Objective.prototype.isRedeemed = function isRedeemed() { | |
| return this.state === enums.Objectives.State.REDEEMED | |
| }, entities.Objective.prototype.isCompleted = function isCompleted() { | |
| return this.isUnclaimed() || this.isRedeemed() | |
| }, entities.Objective.prototype.hasWebLink = function hasWebLink() { | |
| return this.link === enums.Objectives.GoToLink.AUCTION_SEARCH || this.link === enums.Objectives.GoToLink.SBC_SQUAD || this.link === enums.Objectives.GoToLink.SQUAD | |
| }, entities.Objective.prototype.getImageIdentifier = function getImageIdentifier() { | |
| return utils.JS.isEmpty(this.imageBase) ? this.gameArea : this.imageBase | |
| }, NamespaceManager.Register("factories"), factories.Objective = function() { | |
| function ObjectiveFactory() {} | |
| return ObjectiveFactory.prototype.createObjectivesFromPayload = function createObjectivesFromPayload(data) { | |
| var t = []; | |
| return Array.isArray(data.dailyObjectives) && (t = this.createObjectivesFromObjArray(data.dailyObjectives)), Array.isArray(data.weeklyObjectives) && (t = this.createObjectivesFromObjArray(data.weeklyObjectives)), t | |
| }, ObjectiveFactory.prototype.createObjectivesFromObjArray = function createObjectivesFromObjArray(data) { | |
| return data && Array.isArray(data) ? data.map(function(t) { | |
| return this.createObjectiveFromObjData(t) | |
| }, this) : [] | |
| }, ObjectiveFactory.prototype.createObjectiveFromObjData = function createObjectiveFromObjData(data) { | |
| return new entities.Objective(data) | |
| }, new ObjectiveFactory | |
| }(), NamespaceManager.Register("transferobjects"), transferobjects.Reward = function(data) { | |
| this.value = data.value, Object.defineProperty(this, "value", { | |
| writable: !1 | |
| }), this.count = data.count, Object.defineProperty(this, "count", { | |
| writable: !1 | |
| }), this.halId = data.halId, Object.defineProperty(this, "halId", { | |
| writable: !1 | |
| }), this.type = data.type || data.awardType, Object.defineProperty(this, "type", { | |
| writable: !1 | |
| }), this.isCoin = this.type === enums.AwardType.COIN, Object.defineProperty(this, "isCoin", { | |
| writable: !1 | |
| }), this.isPack = this.type === enums.AwardType.PACK, Object.defineProperty(this, "isPack", { | |
| writable: !1 | |
| }), this.isItem = this.type === enums.AwardType.ITEM, Object.defineProperty(this, "isItem", { | |
| writable: !1 | |
| }), this.isUntradeable = data.isUntradeable, Object.defineProperty(this, "isUntradeable", { | |
| writable: !1 | |
| }), this.itemData = null, this.isItem && (data.itemData.loans = 0 === data.itemData.loans ? -1 : data.itemData.loans, data.itemData.contract = data.itemData.loans > 0 ? data.itemData.loans : 7, this.itemData = factories.Item.createItem(data.itemData), this.itemData.playStyle = this.itemData.isGK() ? enums.ItemSubType.TRAINING_PLAYERSTYLE_GOALKEEPER_1 : enums.ItemSubType.TRAINING_PLAYERSTYLE_GENERAL_1), Object.defineProperty(this, "itemData", { | |
| writable: !1 | |
| }) | |
| }, transferobjects.Reward.prototype.buildString = function() { | |
| var text = ""; | |
| if (this.isCoin) text = gLocalization.lText("card.desc.FreeCreditsDesc"); | |
| else { | |
| if (this.isPack) text += "x" + this.count + " " + utils.TextUtils.capitalize(gLocalization.lText("FUT_STORE_PACK_" + this.value + "_NAME_MOBILE")); | |
| else if (this.isItem) { | |
| var t = this.itemData.getStaticData(), | |
| i = "x" + this.count + " ", | |
| s = "", | |
| o = "", | |
| l = t.name; | |
| (this.itemData.isCommon() || this.itemData.isRare()) && (o = gLocalization.lText("search.cardLevels.cardLevel" + this.itemData.getTier()) + " "), this.itemData.isCommon() || (s = gLocalization.lText("item.raretype" + this.itemData.rareflag) + " "), this.itemData.isKit() ? l = utils.TextUtils.capitalize(gLocalization.lText("card.title.kit")) : this.itemData.isConsumable() && (l = t.name + " " + gLocalization.lText("itemtype.consumable")), text += i + s + o + l | |
| } | |
| this.isUntradeable && (text += " (" + gLocalization.lText("infopanel.context.untradeable") + ")") | |
| } | |
| return text | |
| }, transferobjects.Reward.prototype.getPriority = function() { | |
| switch (this.type) { | |
| case enums.AwardType.ITEM: | |
| return 0; | |
| case enums.AwardType.PACK: | |
| return 1; | |
| case enums.AwardType.COIN: | |
| return 2; | |
| default: | |
| return utils.Debug.Assert(!1, "[transferobjects.Reward] | Reached default case: " + this.type), 3 | |
| } | |
| }, transferobjects.ObjectiveReward = function(data) { | |
| transferobjects.Reward.call(this, data), this.setId = data.setId, Object.defineProperty(this, "setId", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.assetId = data.assetId, Object.defineProperty(this, "assetId", { | |
| writable: !1, | |
| enumerable: !0 | |
| }) | |
| }, utils.JS.inherits(transferobjects.ObjectiveReward, transferobjects.Reward), NamespaceManager.Register("accessobjects"), accessobjects.Objectives = function() { | |
| function ObjectivesDAO() { | |
| FUTObject.call(this), this.UTAS_REQUEST_PATH = "/ut/game/" + GAME_NAME + "/", Object.defineProperty(this, "UTAS_REQUEST_PATH", { | |
| writable: !1, | |
| enumerable: !0 | |
| }) | |
| } | |
| return utils.JS.inherits(ObjectivesDAO, FUTObject), ObjectivesDAO.prototype.getObjectives = function getObjectives(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "user/dynamicobjectives"), s.setUrlVariables({ | |
| scope: "all" | |
| }), s.observe(this, function _onGetObjectivesComplete(t, data) { | |
| t.unobserve(this); | |
| var s = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response), | |
| response = o ? data.response : null; | |
| s.response = {}, s.response.dailyAutoClaimed = !!o && response.dailyRewardsAutoClaimed, s.response.weeklyAutoClaimed = !!o && response.weeklyRewardsAutoClaimed, s.response.dailyObjectives = o ? factories.Objective.createObjectivesFromObjArray(response.dailyObjectives) : [], s.response.weeklyObjectives = o ? factories.Objective.createObjectivesFromObjArray(response.weeklyObjectives) : [], s.status = data.status, s.success = data.success, i.notify(s) | |
| }), s.send(), i | |
| }, ObjectivesDAO.prototype.claimById = function claimById(t, id) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "user/dynamicobjectives/claim/" + id), s.setRequestType(enums.HTTPRequestMethod.POST), s.observe(this, function _onClaimByIdComplete(t, data) { | |
| t.unobserve(this); | |
| var s = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response), | |
| response = o ? data.response : null; | |
| s.response = {}, s.response.awards = o && id === response.objectiveId ? response.awards.map(function(t) { | |
| return new transferobjects.ObjectiveReward(t) | |
| }, this) : [], s.status = data.status, s.success = data.success, i.notify(s) | |
| }), s.send(), i | |
| }, ObjectivesDAO.prototype.claimAll = function claimAll(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "user/dynamicobjectives/claim/all"), s.setRequestType(enums.HTTPRequestMethod.POST), s.observe(this, function _onClaimAllComplete(t, data) { | |
| t.unobserve(this); | |
| var s = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response), | |
| response = o ? data.response : null; | |
| s.response = {}, s.response.awards = o ? response.awards.map(function(t) { | |
| return new transferobjects.ObjectiveReward(t) | |
| }, this) : [], s.status = data.status, s.success = data.success, i.notify(s) | |
| }), s.send(), i | |
| }, new ObjectivesDAO | |
| }(), NamespaceManager.Register("interfaces"), interfaces.AuthDelegate = function() {}, interfaces.AuthDelegate.prototype.getCurrentUser = function getCurrentUser() {}, interfaces.AuthDelegate.prototype.getSession = function getSession(t) {}, interfaces.AuthDelegate.prototype.authenticate = function authenticate(t) {}, NamespaceManager.Register("accessobjects"), accessobjects.Authentication = function() { | |
| function AuthenticationDAO() { | |
| FUTObject.call(this) | |
| } | |
| return utils.JS.inherits(AuthenticationDAO, FUTObject), AuthenticationDAO.prototype.authenticate = function authenticate(t, i) { | |
| var s = t.getCurrentUser(), | |
| o = t.getSession(i), | |
| l = new FUTHttpRequest, | |
| u = new FUTObservable; | |
| if (i === enums.AuthEnvironment.UTAS) { | |
| var h = s.getSelectedPersona(), | |
| p = utils.FUTData.mapSkuToCurrentYear(h.sku); | |
| l.setUrl(o.url + "/ut/auth?sku_a=FFT18"), l.setRequestBody({ | |
| isReadOnly: !1, | |
| sku: enums.SKU.FUT, | |
| clientVersion: CLIENT_VERSION, | |
| locale: gLocalization.getEffectiveLocaleFormattedForServer(), | |
| method: "authcode", | |
| priorityLevel: 4, | |
| identification: { | |
| authCode: t.authToken, | |
| redirectUrl: "nucleus:rest" | |
| }, | |
| nucleusPersonaId: h.id, | |
| gameSku: p | |
| }) | |
| } else utils.Debug.Assert(!1, "Unsupported LiOn environment"); | |
| var m = gUserSettingsModel.getUserItem(models.UserSettingsModel.SECURITY_TOKEN); | |
| return m && l.setRequestHeader("X-UT-PHISHING-TOKEN", m), l.setRequestType(enums.HTTPRequestMethod.POST), l.setCache(!1), l.observe(this, function _onLoginComplete(t, data) { | |
| t.unobserve(this); | |
| var key, s = new transferobjects.FUTHttpResponse; | |
| for (key in s) s.hasOwnProperty(key) && data.hasOwnProperty(key) && (s[key] = data[key]); | |
| s.response = { | |
| protocol: data.success ? data.response.protocol : "", | |
| hostname: data.success ? data.response.ipPort : "", | |
| id: data.success ? data.response.sid : "", | |
| environment: i | |
| }, u.notify(s) | |
| }), l.send(), u | |
| }, AuthenticationDAO.prototype.unauthenticate = function unauthenticate(t, i) {}, new AuthenticationDAO | |
| }(), NamespaceManager.Register("transferobjects"), transferobjects.Session = function SessionDTO(t) { | |
| this.id = "", this.environment = t, Object.defineProperty(this, "environment", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.hostname = "", this.url = "", Object.defineProperty(this, "url", { | |
| get: this.getUrl, | |
| enumerable: !0 | |
| }), this.protocol = enums.SessionProtocol.HTTP, this.state = enums.AuthenticationState.STATE_UNAUTHENTICATED, this.statusCode = enums.HTTPStatusCode.OK, this.securityQuestionAnswered = !1, this.accountLocked = !1, this.captchaCooldown = 10, this.count = 0 | |
| }, transferobjects.Session.prototype.getUrl = function getUrl() { | |
| return this.protocol + "://" + this.hostname | |
| }, transferobjects.Session.prototype.isAuthenticated = function isAuthenticated() { | |
| return this.state === enums.AuthenticationState.STATE_AUTHENTICATED | |
| }, NamespaceManager.Register("services"), services.Authentication = function() { | |
| function AuthenticationService() { | |
| FUTObject.call(this), this.authToken = "", this._sessionUtas = new transferobjects.Session(enums.AuthEnvironment.UTAS), Object.defineProperty(this, "_sessionUtas", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this.onAuthComplete = new FUTObservable, Object.defineProperty(this, "onAuthComplete", { | |
| writable: !1, | |
| enumerable: !0 | |
| }) | |
| } | |
| return utils.JS.inherits(AuthenticationService, FUTObject), AuthenticationService.prototype.reset = function reset() { | |
| this.authToken = "", this._sessionUtas = new transferobjects.Session(enums.AuthEnvironment.UTAS), this.onAuthComplete.clearObservers() | |
| }, AuthenticationService.prototype.getCurrentUser = function getCurrentUser() { | |
| return repositories.User.getCurrent() | |
| }, AuthenticationService.prototype.getSession = function getSession(t) { | |
| switch (t) { | |
| case enums.AuthEnvironment.UTAS: | |
| return this._sessionUtas | |
| } | |
| return utils.Debug.Assert(!1, "No session DTO found for environment"), new transferobjects.Session(enums.AuthEnvironment.NONE) | |
| }, AuthenticationService.prototype.setSession = function setSession(t) { | |
| switch (t.environment) { | |
| case enums.AuthEnvironment.UTAS: | |
| this._sessionUtas = t | |
| } | |
| utils.Debug.Assert(!1, "Session is associated with an unsupported environment") | |
| }, AuthenticationService.prototype.authenticate = function authenticate(t) { | |
| function _onAuthComplete(o, data) { | |
| o.unobserve(this), data.success ? (s.id = data.response.id, t === enums.AuthEnvironment.UTAS && gPinManager.setUniqueSessionID(data.response.id), data.response.protocol && (s.protocol = data.response.protocol), data.response.hostname && (s.hostname = data.response.hostname), s.state = enums.AuthenticationState.STATE_AUTHENTICATED, s.statusCode = enums.HTTPStatusCode.OK) : (s.state = enums.AuthenticationState.STATE_AUTHENTICATION_FAILED, s.statusCode = data.status), i.notify(data) | |
| } | |
| var i = this.onAuthComplete, | |
| s = this.getSession(t); | |
| return s.state === enums.AuthenticationState.STATE_AUTHENTICATING ? i : (s.state = enums.AuthenticationState.STATE_AUTHENTICATING, eadp.identity.token2code("FOS-SERVER", function _onGetTokenSuccess(data) { | |
| this.authToken = data.response.code, accessobjects.Authentication.authenticate(this, t).observe(this, _onAuthComplete) | |
| }.bind(this), function _onGetTokenFail(data) { | |
| s.state = enums.AuthenticationState.STATE_AUTHENTICATION_FAILED, s.statusCode = data.status === enums.HTTPStatusCode.UNKNOWN ? enums.HTTPStatusCode.NO_INTERNET_CONNECTION : data.status, i.notify(data) | |
| }.bind(this)), i) | |
| }, AuthenticationService.prototype.unauthenticate = function unauthenticate(t) {}, new AuthenticationService | |
| }(), NamespaceManager.Register("accessobjects"), accessobjects.Item = function() { | |
| function ItemDAO() { | |
| FUTObject.call(this), this.MAX_DISCARDS = 35, Object.defineProperty(this, "MAX_DISCARDS", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.UTAS_REQUEST_PATH = "/ut/game/" + GAME_NAME + "/", this.UTAS_DELETE_PATH = "/ut/delete/game/" + GAME_NAME + "/" | |
| } | |
| return utils.JS.inherits(ItemDAO, FUTObject), ItemDAO.prototype.getItemDataByDefId = function getItemDataByDefId(t, i) { | |
| var s = new FUTObservable, | |
| o = new FUTUtasHttpRequest(t); | |
| return utils.Debug.Assert(utils.JS.isNumber(i), "Expected a numeric definition ID"), o.setUrl(this.UTAS_REQUEST_PATH + "defid"), o.setUrlVariables({ | |
| defId: i | |
| }), o.observe(this, function _onGetItemDataByDefIdComplete(t, data) { | |
| t.unobserve(this); | |
| var key, i = new transferobjects.FUTHttpResponse; | |
| for (key in i) i.hasOwnProperty(key) && data.hasOwnProperty(key) && (i[key] = data[key]); | |
| var o = data.success && utils.JS.isObject(data.response) ? data.response.itemData[0] : null; | |
| i.response = { | |
| item: o ? factories.Item.createItem(o) : null | |
| }, s.notify(i) | |
| }), o.send(), s | |
| }, ItemDAO.prototype.discardByItemId = function discardByItemId(t, i) { | |
| var s = new FUTObservable, | |
| o = new FUTUtasHttpRequest(t), | |
| isArray = Array.isArray(i); | |
| if (utils.Debug.Assert(!isArray || i.length <= this.MAX_DISCARDS, "Item collection exceeds maximum discard amount, will only discard the first " + this.MAX_DISCARDS + " items"), isArray && 1 !== i.length) o.setUrl(this.UTAS_DELETE_PATH + "item"), o.setRequestType(enums.HTTPRequestMethod.POST), o.setRequestBody({ | |
| itemId: i.map(function(item) { | |
| return item.id | |
| }).slice(0, this.MAX_DISCARDS) | |
| }); | |
| else { | |
| var item = isArray ? i[0] : i; | |
| o.setUrl(this.UTAS_REQUEST_PATH + "item/" + item.id), o.setRequestType(enums.HTTPRequestMethod.DELETE), item.isDuplicateLoanPlayer() && o.setUrlVariables({ | |
| combineWith: item.duplicateId | |
| }) | |
| } | |
| return o.observe(this, function _onDiscardByItemIdComplete(t, data) { | |
| t.unobserve(this); | |
| var i = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response); | |
| i.success = data.success, i.status = data.status, i.response = { | |
| totalCredits: o ? data.response.totalCredits : null, | |
| itemIds: o ? data.response.items.map(function(t) { | |
| return t.id | |
| }) : [] | |
| }, i.maxAge = data.maxAge, i.retryAfter = data.retryAfter, s.notify(i) | |
| }), o.send(), s | |
| }, ItemDAO.prototype.discardByResourceId = function discardByResourceId(t, item) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "item/resource/" + item.resourceId), s.setRequestType(enums.HTTPRequestMethod.DELETE), s.observe(this, function _onDiscardByResourceIdComplete(t, data) { | |
| t.unobserve(this); | |
| var s = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response); | |
| s.success = data.success, s.status = data.status, s.response = { | |
| totalCredits: o ? data.response.totalCredits : null, | |
| itemIds: o ? data.response.items.map(function(t) { | |
| return t.id | |
| }) : [] | |
| }, s.maxAge = data.maxAge, s.retryAfter = data.retryAfter, i.notify(s) | |
| }), s.send(), i | |
| }, new ItemDAO | |
| }(), NamespaceManager.Register("utils"), utils.EventDispatcher = function() { | |
| this._messageListeners = {} | |
| }, utils.EventDispatcher.prototype.dispatch = function(t, i) { | |
| if (utils.JS.isValid(this._messageListeners[t])) { | |
| var s, o = this._messageListeners[t].slice(0), | |
| l = [this]; | |
| l = l.concat(Array.prototype.slice.call(arguments, 1)); | |
| var u = o.length; | |
| for (s = 0; s < u; ++s) o[s].listener.apply(o[s].scope, l) | |
| } | |
| }, utils.EventDispatcher.prototype.addListener = function(t, scope, listener) { | |
| utils.Debug.Assert(utils.JS.isValid(listener) && utils.JS.isValid(scope), "Invalid listener parameters"), | |
| utils.JS.isValid(this._messageListeners[t]) || (this._messageListeners[t] = []), this._messageListeners[t].push({ | |
| listener: listener, | |
| scope: scope | |
| }) | |
| }, utils.EventDispatcher.prototype.removeListener = function(t, scope, listener) { | |
| utils.Debug.Assert(utils.JS.isValid(listener) && utils.JS.isValid(scope), "Invalid listener parameters"); | |
| var i, s, o; | |
| if (utils.JS.isValid(this._messageListeners[t])) | |
| do { | |
| for (o = null, s = this._messageListeners[t].length, i = 0; i < s; i++) | |
| if (this._messageListeners[t][i].listener === listener && this._messageListeners[t][i].scope === scope) { | |
| o = i; | |
| break | |
| } | |
| null !== o && this._messageListeners[t].splice(o, 1) | |
| } while (null !== o) | |
| }, utils.EventDispatcher.prototype.clearListeners = function() { | |
| this._messageListeners = {} | |
| }, utils.EventDispatcher.prototype.clearListenersByEvent = function(t) { | |
| delete this._messageListeners[t] | |
| }, utils.EventDispatcher.prototype.clearListenersByScope = function(scope) { | |
| var t, x, i, s = null, | |
| o = []; | |
| for (x in this._messageListeners) | |
| if (this._messageListeners.hasOwnProperty(x) && utils.JS.isValid(this._messageListeners[x])) { | |
| do { | |
| for (s = null, i = this._messageListeners[x].length, t = 0; t < i; t++) | |
| if (this._messageListeners[x][t].scope === scope) { | |
| s = t; | |
| break | |
| } | |
| null !== s && this._messageListeners[x].splice(s, 1) | |
| } while (null !== s); | |
| 0 === this._messageListeners[x].length && o.push(x) | |
| } | |
| for (i = o.length, t = 0; t < i; ++t) delete this._messageListeners[o[t]] | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.IDelegateVO = function() {}, valueobjects.IDelegateVO.prototype.cancel = function() {}, NamespaceManager.Register("models"), models.CommunicationModel = {}, models.CommunicationModel.METHOD = { | |
| POST: "POST", | |
| GET: "GET", | |
| PUT: "PUT", | |
| DELETE: "DELETE" | |
| }, models.CommunicationModel.RESPONSE = { | |
| TEXT: "text", | |
| TEXT_JSON: "text json", | |
| TEXT_XML: "text xml", | |
| EMPTY: null | |
| }, models.CommunicationModel.CONTENT_TYPE = { | |
| XML: "text/xml", | |
| JSON: "application/json", | |
| TEXT_PLAIN: "text/plain" | |
| }, NamespaceManager.Register("models"), models.ConfigurationModel = function() { | |
| this._dataObject = {}, this._remoteConfigTimestamp = 0, this._remoteConfigPollLock = !1, this._remoteConfigPollHandler = 0, this._remoteConfigPollers = new FUTHashTable([]), this.onRemoteConfigLoaded = new FUTObservable, Object.defineProperty(this, "onRemoteConfigLoaded", { | |
| writable: !1 | |
| }) | |
| }, models.ConfigurationModel.KEY_DEFAULT_FUT_SERVICE_URL = "authURL", models.ConfigurationModel.KEY_DEFAULT_FUT_SERVICE_PROTOCOL = "requestProtocol", models.ConfigurationModel.KEY_EADP_CONNECT_HOST = "eadpConnectHost", models.ConfigurationModel.KEY_EADP_PORTAL_HOST = "eadpPortalHost", models.ConfigurationModel.KEY_EADP_PROXY_HOST = "eadpProxyHost", models.ConfigurationModel.KEY_EADP_CLIENT_ID = "eadpClientId", models.ConfigurationModel.KEY_EADP_CLIENT_SECRET = "eadpClientSecret", models.ConfigurationModel.KEY_PIN_URL = "pinURL", models.ConfigurationModel.KEY_SHOW_OFF_URL = "showOffURL", models.ConfigurationModel.KEY_RESOURCE_ROOT = "resourceRoot", models.ConfigurationModel.KEY_STATIC_DATA_ROOT = "resourceBase", models.ConfigurationModel.KEY_LOCAL_STORAGE_VERSION = "localStorageVersion", models.ConfigurationModel.KEY_CHANGELIST = "changelist", models.ConfigurationModel.KEY_SETTINGS_REFRESH_INTERVAL = "settingsRefreshInterval", models.ConfigurationModel.KEY_REQUEST_TIMEOUT = "requestTimeout", models.ConfigurationModel.KEY_MAX_CONSECUTIVE_500_ERRORS = "maxConsecutive500Errors", models.ConfigurationModel.KEY_VERBOSE_LOGGING = "verboseLogging", models.ConfigurationModel.KEY_ORIGIN_CSS = "originCss", models.ConfigurationModel.KEY_ORIGIN_JS = "originJS", models.ConfigurationModel.KEY_ORIGIN_HOST = "origiHost", models.ConfigurationModel.KEY_ORIGIN_PROFILE = "originProfile", models.ConfigurationModel.KEY_ORIGIN_MASTER_TITLE = "originMasterTitle", models.ConfigurationModel.KEY_ANALYTICS = "analytics", models.ConfigurationModel.KEY_ASSETS_VERSION = "assetsVersion", models.ConfigurationModel.KEY_HIDE_TRANSFER_MARKET = "hideTransferMarket", models.ConfigurationModel.KEY_ITEMS_PER_PAGE = "itemsPerPage", models.ConfigurationModel.KEY_PATCH = "patch", models.ConfigurationModel.KEY_PIN = "pin", models.ConfigurationModel.KEY_WINTER_THEME = "winterTheme", models.ConfigurationModel.KEY_FUTWEB_MAINTENANCE = "futweb_maintenance", | |
| models.ConfigurationModel.KEY_FUNCAPTCHA_PK = "funCaptchaPublicKey", models.ConfigurationModel.ITEMS_PER_PAGE = { | |
| CLUB: "club", | |
| TRANSFER_MARKET: "transferMarket" | |
| }; | |
| var gConfigurationModel = new models.ConfigurationModel; | |
| models.ConfigurationModel.prototype.subscribePoller = function subscribePoller(t, frequency, i) { | |
| var s = t.constructor.name; | |
| utils.JS.isEmpty(s) ? utils.Debug.Assert(!1, "Object must have a declared constructor name in order to register for remote config polls") : (utils.Debug.Assert(frequency >= 6e4, "Frequency must be at least a minute."), this._remoteConfigPollers.has(s) || this.onRemoteConfigLoaded.observe(t, i), this._remoteConfigPollers.set(s, Math.max(6e4, frequency)), this._setupRemoteConfigPolling()) | |
| }, models.ConfigurationModel.prototype.unsubscribePoller = function unsubscribePoller(t) { | |
| var i = t.constructor.name; | |
| utils.JS.isEmpty(i) ? utils.Debug.Assert(!1, "Object must have a declared constructor name in order to unregister for remote config polls") : (this._remoteConfigPollers.remove(i), this.onRemoteConfigLoaded.unobserve(t), this._setupRemoteConfigPolling()) | |
| }, models.ConfigurationModel.prototype._getRemoteConfigPollFrequency = function _getRemoteConfigPollFrequency() { | |
| var t = this._remoteConfigPollers.values(); | |
| return t.length > 0 ? Math.min.apply(Math, t) : 0 | |
| }, models.ConfigurationModel.prototype._setupRemoteConfigPolling = function _setupRemoteConfigPolling() { | |
| var t = this._getRemoteConfigPollFrequency(); | |
| t > 0 && (this._remoteConfigPollHandler > 0 && clearInterval(this._remoteConfigPollHandler), (!this.hasRemoteConfigLoaded() || Date.now() - this._remoteConfigTimestamp > t) && this.loadRemoteConfig(), this._remoteConfigPollHandler = setInterval(this.loadRemoteConfig.bind(this), t)) | |
| }, models.ConfigurationModel.prototype.loadRemoteConfig = function loadRemoteConfig() { | |
| function onResumeRemoteConfigFailed(sender) { | |
| sender.clearListenersByScope(this), this.onRemoteConfigLoaded.notify(!1), this._remoteConfigPollLock = !1 | |
| } | |
| if (!this._remoteConfigPollLock) { | |
| this._remoteConfigPollLock = !0; | |
| var t = this.getConfigString(models.ConfigurationModel.KEY_RESOURCE_ROOT) + utils.AssetLocator.getRemoteConfigFileURI(), | |
| i = new communication.RemoteConfigurationDelegate(t, !0); | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, function onRemoteConfigLoadedSuccess(sender, data) { | |
| sender.clearListenersByScope(this), this._remoteConfigTimestamp = Date.now(), this.setDataObject(data), this.onRemoteConfigLoaded.notify(!0), this._remoteConfigPollLock = !1 | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, onResumeRemoteConfigFailed), i.addListener(communication.BaseDelegate.CANCEL, this, onResumeRemoteConfigFailed), i.execute() | |
| } | |
| }, models.ConfigurationModel.prototype.hasRemoteConfigLoaded = function hasRemoteConfigLoaded() { | |
| return this._remoteConfigTimestamp > 0 | |
| }, models.ConfigurationModel.prototype.setDataObject = function setDataObject(t) { | |
| var key; | |
| for (key in t) t.hasOwnProperty(key) && (this._dataObject[key] = t[key]) | |
| }, models.ConfigurationModel.prototype.getConfigObject = function getConfigObject(key) { | |
| return utils.JS.isObject(this._dataObject[key]) ? this._dataObject[key] : null | |
| }, models.ConfigurationModel.prototype.getConfigNumber = function getConfigNumber(key) { | |
| if (utils.JS.isValid(this._dataObject[key])) { | |
| if (utils.JS.isNumber(this._dataObject[key])) return this._dataObject[key]; | |
| try { | |
| return parseFloat(this._dataObject[key]) | |
| } catch (t) { | |
| return 0 | |
| } | |
| } | |
| return 0 | |
| }, models.ConfigurationModel.prototype.getConfigBoolean = function getConfigBoolean(key) { | |
| if (utils.JS.isValid(this._dataObject[key])) { | |
| if (utils.JS.isBoolean(this._dataObject[key])) return this._dataObject[key]; | |
| try { | |
| return "true" === this._dataObject[key] | |
| } catch (t) { | |
| return !1 | |
| } | |
| } | |
| return !1 | |
| }, models.ConfigurationModel.prototype.getConfigString = function getConfigString(key) { | |
| if (utils.JS.isValid(this._dataObject[key])) { | |
| if (utils.JS.isString(this._dataObject[key])) return this._dataObject[key]; | |
| try { | |
| return this._dataObject[key].toString() | |
| } catch (t) { | |
| return "" | |
| } | |
| } | |
| return "" | |
| }, NamespaceManager.Register("communication"), communication.BaseDelegate = function() { | |
| utils.EventDispatcher.call(this), this._url = "", this._urlVariables = {}, this._customHeaders = [], | |
| this._requestType = models.CommunicationModel.METHOD.GET, this._responseType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON, this._mimeType = null, this._data = null, this._statusCode = 0, this._networkError = null, this._xhr = null, this._cancelled = !1, this._timedOut = !1, this._isImportant = !1, this._isSending = !1, this._cache = !1, this._useClickShield = !1, this._csShowing = !1, this._clickShieldType = components.ClickShield.SHIELD.LOADING | |
| }, utils.JS.inherits(communication.BaseDelegate, utils.EventDispatcher), communication.BaseDelegate.SUCCESS = "communication.BaseDelegate.SUCCESS", communication.BaseDelegate.FAIL = "communication.BaseDelegate.FAIL", communication.BaseDelegate.CANCEL = "communication.BaseDelegate.CANCEL", communication.BaseDelegate.prototype._showClickShield = function() { | |
| this.useClickShield() && !this._csShowing && (gClickShield.showShield(this._clickShieldType), this._csShowing = !0) | |
| }, communication.BaseDelegate.prototype._hideClickShield = function() { | |
| this._csShowing && !this._isSending && (gClickShield.hideShield(this._clickShieldType), this._csShowing = !1) | |
| }, communication.BaseDelegate.prototype.setRequest = function(url, method, t, contentType) { | |
| this._url = url, this._requestType = method, this._dataType = t, this._contentType = contentType | |
| }, communication.BaseDelegate.prototype.setImportant = function(t) { | |
| this._isImportant = t | |
| }, communication.BaseDelegate.prototype.isImportant = function() { | |
| return this._isImportant | |
| }, communication.BaseDelegate.prototype.setURLVariables = function(t) { | |
| this._urlVariables = t | |
| }, communication.BaseDelegate.prototype.setMimeType = function(mimeType) { | |
| this._mimeType = mimeType | |
| }, communication.BaseDelegate.prototype.setData = function(requestData) { | |
| this._data = requestData | |
| }, communication.BaseDelegate.prototype._getStaticPayload = function() { | |
| var t, i = gConfigurationModel.getConfigObject("staticResponseData"), | |
| s = null; | |
| if (!utils.JS.isValid(i)) return s; | |
| for (t in i) | |
| if (i.hasOwnProperty(t) && this.constructor === utils.JS.getDefinitionByName(t)) { | |
| s = i[t]; | |
| break | |
| } | |
| return s | |
| }, communication.BaseDelegate.prototype.addHeader = function(t, i) { | |
| this._customHeaders[t] = i | |
| }, communication.BaseDelegate.prototype.getDefaultHeaders = function() { | |
| return {} | |
| }, communication.BaseDelegate.prototype.getHeaders = function() { | |
| var t, i = this.getDefaultHeaders(), | |
| s = this._customHeaders, | |
| headers = {}; | |
| for (t in i) i.hasOwnProperty(t) && (headers[t] = i[t]); | |
| for (t in s) s.hasOwnProperty(t) && (headers[t] = s[t]); | |
| return headers | |
| }, communication.BaseDelegate.prototype.setCache = function(t) { | |
| this._cache = t | |
| }, communication.BaseDelegate.prototype.generateUrlParams = function() { | |
| return utils.HTTP.generateUrlParams(this._urlVariables) | |
| }, communication.BaseDelegate.prototype.generateURL = function() { | |
| return this._url + this.generateUrlParams() | |
| }, communication.BaseDelegate.prototype.getStatusCode = function() { | |
| return this._statusCode | |
| }, communication.BaseDelegate.prototype.dataIsCached = function() { | |
| return !1 | |
| }, communication.BaseDelegate.prototype.getError = function() { | |
| return this._networkError | |
| }, communication.BaseDelegate.prototype.execute = function() { | |
| this.send() | |
| }, communication.BaseDelegate.prototype.cancel = function() { | |
| utils.JS.isValid(this._xhr) && !this._cancelled && (this._cancelled = !0, this._xhr.abort()) | |
| }, communication.BaseDelegate.prototype.send = function() { | |
| if (!this.dataIsCached()) { | |
| if (!hasConnection()) return this.onFail(enums.HTTPStatusCode.NO_INTERNET_CONNECTION), void gPinManager.sendDisconnectEvent(); | |
| this._isSending = !0, this._showClickShield(); | |
| var url = this.generateURL(), | |
| data = ""; | |
| utils.JS.isValid(this._data) && (data = utils.JS.isObject(this._data) ? $.toJSON(this._data) : this._data), this._sendExtension() && (this._xhr = $.ajax({ | |
| url: url, | |
| headers: this.getHeaders(), | |
| type: this._requestType, | |
| dataType: this._dataType, | |
| contentType: this._contentType, | |
| mimeType: this._mimeType, | |
| timeout: gConfigurationModel.getConfigNumber(models.ConfigurationModel.KEY_REQUEST_TIMEOUT), | |
| data: data, | |
| cache: this._cache | |
| }).done(this.onAPISuccess.bind(this)).fail(this.onAPIFailure.bind(this))) | |
| } | |
| }, communication.BaseDelegate.prototype._sendExtension = function() { | |
| return !0 | |
| }, | |
| communication.BaseDelegate.prototype.onAPISuccess = function(data, t, i) { | |
| this._isSending = !1, this._xhr = null, this._statusCode = i.status, data = this._appendMaxAge(i, data), this._logSuccessResponse(i, t), this.onSuccess(data), this._hideClickShield() | |
| }, communication.BaseDelegate.prototype.onAPIFailure = function(t, i, s) { | |
| if (this._isSending = !1, this._xhr = null, this._statusCode = t.status, "timeout" === i && (this._timedOut = !0), this._cancelled) return this.onCancel(), void this._hideClickShield(); | |
| this._logErrorResponse(t, i, s), this.handleErrors(""), this._hideClickShield() | |
| }, communication.BaseDelegate.prototype.onSuccess = function(data) { | |
| this.dispatch(communication.BaseDelegate.SUCCESS, data) | |
| }, communication.BaseDelegate.prototype.onFail = function(errorCode) { | |
| this._networkError = this.generateDefaultNetworkError(errorCode), this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.BaseDelegate.prototype.onCancel = function() { | |
| this.dispatch(communication.BaseDelegate.CANCEL) | |
| }, communication.BaseDelegate.prototype.handleErrors = function(t) { | |
| this._handleError() | |
| }, communication.BaseDelegate.prototype._handleError = function() { | |
| this._timedOut ? this._statusCode = enums.HTTPStatusCode.REQUEST_TIME_OUT : this._statusCode === enums.HTTPStatusCode.UNKNOWN ? this._statusCode = enums.HTTPStatusCode.NETWORK_ERROR : this._statusCode === enums.HTTPStatusCode.SERVER_ERROR && NetworkErrorManager.trackServerError(), this.onFail(this._statusCode) | |
| }, communication.BaseDelegate.prototype.generateDefaultNetworkError = function(errorCode) { | |
| var t, i = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.HTTPStatusCode.NOT_FOUND: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "popup.error.serviceNotFoundTitle", "popup.error.serviceNotFound"); | |
| break; | |
| case enums.HTTPStatusCode.LOGGED_IN_ON_CONSOLE: | |
| case enums.HTTPStatusCode.LOGGED_IN_ON_CONSOLE_LEGACY: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "signedontoanotherdevice.title", "rpcErrorResponses.general.CARDHOUSE_ERR_ALREADY_LOGGEDIN_ON_CONSOLE"); | |
| break; | |
| case enums.HTTPStatusCode.ACCOUNT_BANNED: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "error.banneduser.header", "error.banneduser.body"); | |
| break; | |
| case enums.HTTPStatusCode.INVALID_COOKIE: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "popup.error.invalidcookieTitle", "popup.error.invalidcookie"); | |
| break; | |
| case enums.HTTPStatusCode.CAPTCHA_REQUIRED: | |
| case enums.HTTPStatusCode.FUN_CAPTCHA_REQUIRED: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "popup.error.captcharequiredTitle", "popup.error.captcharequired"); | |
| break; | |
| case enums.HTTPStatusCode.NO_CONTENT: | |
| case enums.HTTPStatusCode.BAD_REQUEST: | |
| case enums.HTTPStatusCode.UT_BAD_REQUEST: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.invalidrequestTitle", "popup.error.invalidrequest"); | |
| break; | |
| case enums.HTTPStatusCode.PROFANITY: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.profanityTitle", "popup.error.profanity"); | |
| break; | |
| case enums.HTTPStatusCode.NO_CARD_EXISTS: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.NoSuchCardTitle", "popup.error.NoSuchCard"); | |
| break; | |
| case enums.HTTPStatusCode.SERVER_ERROR: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.serverdownTitle", "popup.error.serverdown"); | |
| break; | |
| case enums.HTTPStatusCode.SERVICE_IS_DISABLED: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.ServiceIsDisabledTitle", "popup.error.ServiceIsDisabled"); | |
| break; | |
| case enums.HTTPStatusCode.RATE_LIMIT: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.UNIMPORTANT, "popup.error.RateLimitHeader", "popup.error.RateLimitBody"); | |
| break; | |
| case enums.HTTPStatusCode.UNAUTHORIZED: | |
| case enums.HTTPStatusCode.UNRECOVERABLE_ERROR: | |
| t = new valueobjects.NetworkErrorVO(errorCode, enums.NetworkErrorLevel.CRITICAL, "popup.error.cannotcontinueTitle", "popup.error.cannotcontinue"); | |
| break; | |
| case enums.HTTPStatusCode.NO_INTERNET_CONNECTION: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.NoInternetConnectionTitle", "popup.error.NoInternetConnection"); | |
| break; | |
| case enums.HTTPStatusCode.REQUEST_TIME_OUT: | |
| case enums.HTTPStatusCode.NETWORK_ERROR: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.networkerrorTitle", "popup.error.networkerrorNotCritical"); | |
| break; | |
| case enums.HTTPStatusCode.SOME_ITEMS_NOT_FREE: | |
| t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.error.activesquad.itemsNotFreeTitle", "popup.error.activesquad.itemsNotFreeMsg"); | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "[communication.BaseServiceDelegate] Hit default case in method generateDefaultNetworkError on error code " + errorCode + "."), t = new valueobjects.NetworkErrorVO(errorCode, i, "popup.title.genericError", "popup.body.genericError") | |
| } | |
| return t | |
| }, communication.BaseDelegate.prototype.useClickShield = function(t, type) { | |
| return utils.JS.isBoolean(t) && (this._useClickShield = t), utils.JS.isNumber(type) && (this._clickShieldType = type), this._useClickShield | |
| }, communication.BaseDelegate.prototype._appendMaxAge = function(t, data) { | |
| if (t.getResponseHeader("Cache-Control")) { | |
| var i = t.getResponseHeader("Cache-Control").split(/[= ,]/); | |
| this._responseType === models.CommunicationModel.RESPONSE.TEXT_JSON && "max-age" === i[0] && utils.JS.isValid(i[1]) && "" !== i[1] && (data.maxAge = parseInt(i[1], 10)) | |
| } | |
| return data | |
| }, communication.BaseDelegate.prototype._logSuccessResponse = function(t, i) { | |
| this._statusCode, this._url, this._requestType, this._dataType, this._contentType | |
| }, communication.BaseDelegate.prototype._logErrorResponse = function(t, i, s) { | |
| this._statusCode, this._url, this._requestType, this._dataType, this._contentType, this._timedOut | |
| }, communication.BaseServiceDelegate = function() { | |
| communication.BaseDelegate.call(this), this._cachedClientSessionId = 0, this._reAuthAttempts = 0, this._checkAuth = !0 | |
| }, utils.JS.inherits(communication.BaseServiceDelegate, communication.BaseDelegate), communication.BaseServiceDelegate.prototype._hideClickShield = function() { | |
| var t = this.getSessionInfo(), | |
| i = !(!utils.JS.isValid(t) || !this._checkAuth) && t.state === enums.AuthenticationState.STATE_AUTHENTICATING; | |
| !this._csShowing || this._isSending || i || (gClickShield.hideShield(this._clickShieldType), this._csShowing = !1) | |
| }, communication.BaseServiceDelegate.prototype.getDefaultHeaders = function() { | |
| return utils.Debug.Assert(!1, "[BaseServiceDelegate::getDefaultHeaders] Abstract method not overridden."), { | |
| "Easw-Session-Data-Nucleus-Id": gAuthenticationModel.getUser().id | |
| } | |
| }, communication.BaseServiceDelegate.prototype.generateURL = function() { | |
| var t = this.getSessionInfo(); | |
| return t.protocol + "://" + t.hostname + this._url + this.generateUrlParams() | |
| }, communication.BaseServiceDelegate.prototype.checkAuthentication = function(t) { | |
| return utils.JS.isBoolean(t) && (this._checkAuth = t), this._checkAuth | |
| }, communication.BaseServiceDelegate.prototype._sendExtension = function() { | |
| var t = this.getSessionInfo(); | |
| return this._cachedClientSessionId = utils.JS.isValid(t) ? t.count : 0, !this.checkAuthentication() || t.state === enums.AuthenticationState.STATE_AUTHENTICATED || (this.attemptAuthentication(), !1) | |
| }, communication.BaseServiceDelegate.prototype.onAPISuccess = function(data, t, i) { | |
| this._isSending = !1, this._xhr = null, this._statusCode = i.status, data = this._appendMaxAge(i, data); | |
| var s = i.getResponseHeader("Retry-After"), | |
| o = this.getSessionInfo(); | |
| utils.JS.isValid(s) && utils.JS.isValid(o) && (o.captchaCooldown = s), this._hasFOSLegacyError(data) ? this.onAPIFailure(i, t, "Encountered legacy FOS error code.") : (this._logSuccessResponse(i, t), this.onSuccess(data), this._hideClickShield()) | |
| }, communication.BaseServiceDelegate.prototype.onAPIFailure = function(t, i, s) { | |
| if (this._isSending = !1, this._xhr = null, this._statusCode = t.status, "timeout" === i && (this._timedOut = !0), this._cancelled) return this.onCancel(), void this._hideClickShield(); | |
| if (this._logErrorResponse(t, i, s), this.isSameClientSession()) { | |
| var o = this.getSessionInfo(), | |
| l = this._responseType === models.CommunicationModel.RESPONSE.TEXT_JSON ? t.responseJSON : null, | |
| u = l && l.hasOwnProperty("reason") ? l.reason : t.responseText; | |
| utils.JS.isValid(l) && l.hasOwnProperty("code") && 200 !== parseInt(l.code, 10) && (this._statusCode = parseInt(l.code, 10)); | |
| var h = t.getResponseHeader("Retry-After"); | |
| utils.JS.isValid(h) && utils.JS.isValid(o) && (o.captchaCooldown = h), this.handleErrorResponse(l), this.handleErrors(u) | |
| } else utils.Debug.Assert(!1, "BaseServiceDelegate::onAPIFailure - Not handling errors because we are not in same client session as when the request was sent."); | |
| this._hideClickShield() | |
| }, communication.BaseServiceDelegate.prototype.attemptAuthentication = function() { | |
| var t = this.getService(), | |
| i = this.getSessionInfo(); | |
| switch (this._reAuthAttempts > 2 && (i.state = enums.AuthenticationState.STATE_AUTHENTICATION_FAILED), this._requestType, this._url, i.state) { | |
| case enums.AuthenticationState.STATE_AUTHENTICATED: | |
| this.send(); | |
| break; | |
| case enums.AuthenticationState.STATE_UNAUTHENTICATED: | |
| this._reAuthAttempts++, gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, this, this.onAuthenticationSuccess), gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, this, this.onAuthenticationFail), gAuthenticationModel.authenticate(t); | |
| break; | |
| case enums.AuthenticationState.STATE_AUTHENTICATING: | |
| this._reAuthAttempts++, gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, this, this.onAuthenticationSuccess), gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, this, this.onAuthenticationFail); | |
| break; | |
| case enums.AuthenticationState.STATE_AUTHENTICATION_FAILED: | |
| this._isSending = !1, this._reAuthAttempts = 0, this.onFail(enums.NetworkError.UNAUTHORIZED), this.clearListeners(), this._hideClickShield() | |
| } | |
| }, communication.BaseServiceDelegate.prototype.onAuthenticationSuccess = function(sender, t) { | |
| t === this.getService() && (sender.clearListenersByScope(this), this._reAuthAttempts = 0, this.send()) | |
| }, communication.BaseServiceDelegate.prototype.onAuthenticationFail = function(sender, t, error) { | |
| if (t === this.getService()) { | |
| if (sender.clearListenersByScope(this), error === enums.NetworkError.LOGGED_IN_ON_CONSOLE || error === enums.NetworkError.ACCOUNT_BANNED) this.onFail(error); | |
| else { | |
| if (error !== enums.NetworkError.INVALID_CREDENTIALS && error !== enums.NetworkError.UPDATE_REQUIRED) return void this.attemptAuthentication(); | |
| this.onFail(enums.NetworkError.UNAUTHORIZED) | |
| } | |
| this._isSending = !1, this._hideClickShield() | |
| } | |
| }, communication.BaseServiceDelegate.prototype.handleErrorResponse = function(t) {}, communication.BaseServiceDelegate.prototype.handleErrors = function(t) { | |
| switch (this._statusCode) { | |
| case enums.NetworkError.UNAUTHORIZED: | |
| this._handleUnauthorizedError(t); | |
| break; | |
| default: | |
| this._handleError() | |
| } | |
| }, communication.BaseServiceDelegate.prototype._handleUnauthorizedError = function(t) { | |
| var i = this.getSessionInfo(); | |
| t !== enums.NetworkErrorReason.MULTIPLE_SESSION ? (i.state !== enums.AuthenticationState.STATE_AUTHENTICATING && (i.state = enums.AuthenticationState.STATE_UNAUTHENTICATED), this.attemptAuthentication()) : this.onFail(enums.NetworkError.LOGGED_IN_ON_CONSOLE) | |
| }, communication.BaseServiceDelegate.prototype._hasFOSLegacyError = function(response) { | |
| return utils.JS.isValid(response) && response.hasOwnProperty("code") && "200" !== response.code | |
| }, communication.BaseServiceDelegate.prototype.getService = function() { | |
| return utils.Debug.Assert(!1, "Delegate's getService method not overridden."), "" | |
| }, communication.BaseServiceDelegate.prototype.getSessionInfo = function() { | |
| return gAuthenticationModel.getSessionInfo(this.getService()) | |
| }, communication.BaseServiceDelegate.prototype.isSameClientSession = function() { | |
| var t = this.getSessionInfo(); | |
| return null === t || t.count === this._cachedClientSessionId | |
| }, communication.BaseFUTDelegate = function() { | |
| communication.BaseServiceDelegate.call(this) | |
| }, utils.JS.inherits(communication.BaseFUTDelegate, communication.BaseServiceDelegate), communication.BaseFUTDelegate.REQUEST_ROOT = "/ut/game/fifa18/", communication.BaseFUTDelegate.DELETE_ROOT = "/ut/delete/game/fifa18/", communication.BaseFUTDelegate.REQUEST_MM = "/ut/mm/game/fifa18/", | |
| communication.BaseFUTDelegate.prototype.getService = function() { | |
| return enums.FOSService.FUT | |
| }, communication.BaseFUTDelegate.prototype.getDefaultHeaders = function() { | |
| return { | |
| "Easw-Session-Data-Nucleus-Id": gAuthenticationModel.getUser().id, | |
| "X-UT-SID": this.getSessionInfo().id, | |
| "X-UT-PHISHING-TOKEN": gUserSettingsModel.getUserItem(models.UserSettingsModel.SECURITY_TOKEN) | |
| } | |
| }, communication.BaseFUTDelegate.prototype.handleErrors = function(t) { | |
| switch (this._statusCode) { | |
| case enums.NetworkError.UNAUTHORIZED: | |
| this._handleUnauthorizedError(t); | |
| break; | |
| case enums.NetworkError.INVALID_COOKIE: | |
| case enums.NetworkError.NO_USER: | |
| this.onFail(this._statusCode); | |
| break; | |
| case enums.NetworkError.CAPTCHA_REQUIRED: | |
| case enums.NetworkError.FUN_CAPTCHA_REQUIRED: | |
| this.onFail(this._statusCode); | |
| break; | |
| default: | |
| this._handleError() | |
| } | |
| }, communication.ItemDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), this.setURLVariables({ | |
| idList: t.join(",") | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "item", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.ItemDelegate, communication.BaseFUTDelegate), communication.ItemDelegate.prototype.onSuccess = function(response) { | |
| var t = factories.Item.generateItemsFromItemData(response.itemData, null); | |
| this.dispatch(communication.BaseDelegate.SUCCESS, t) | |
| }, communication.DreamSearchDelegate = function(t, i, s) { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "defid", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON; | |
| var o = {}; | |
| if (o.type = enums.SearchType.PLAYER, o.start = i, o.count = s, t.level !== enums.SearchLevel.ANY && (o.level = t.level), t.club > 0 && (o.team = t.club), t.league > 0 && (o.league = t.league), t.nation > 0 && (o.nation = t.nation), t.zone !== enums.SearchType.ANY) { | |
| var l = utils.JS.find(PLAYER_ZONE_LOOKUP, function(i) { | |
| return i.value === t.zone | |
| }); | |
| utils.JS.isValid(l) && (o.type = l.id) | |
| } else t.position !== enums.SearchType.ANY && (o.position = t.position); | |
| t.playStyle > 0 && (o.playStyle = t.playStyle), t.defId > 0 && (o.defId = t.defId), this.setURLVariables(o), this.useClickShield(!0) | |
| }, utils.JS.inherits(communication.DreamSearchDelegate, communication.BaseFUTDelegate), communication.TradePileDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "tradepile", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.TradePileDelegate, communication.BaseFUTDelegate), communication.UnassignedItemsDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "purchased/items", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.UnassignedItemsDelegate, communication.BaseFUTDelegate), communication.WatchListDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "watchlist", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.WatchListDelegate, communication.BaseFUTDelegate), communication.ActivateClubItemDelegate = function(id, t) { | |
| communication.BaseFUTDelegate.call(this), utils.JS.isNumber(t) && this.setData({ | |
| itemState: "active", | |
| activateSlotNumber: t | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "item/" + id, models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.ActivateClubItemDelegate, communication.BaseFUTDelegate), communication.BidDelegate = function(t, i) { | |
| communication.BaseFUTDelegate.call(this), this.setData({ | |
| bid: i | |
| }), | |
| this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "trade/" + t + "/bid", models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this._urlVariables.sku_a = "FFT18" | |
| }, utils.JS.inherits(communication.BidDelegate, communication.BaseFUTDelegate), communication.BidDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.item.bidDeniedTitle", "popup.error.item.bidDenied"); | |
| break; | |
| case enums.NetworkError.STATE_INVALID: | |
| case enums.NetworkError.NO_TRADE_EXISTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.item.InvalidStateTitle", "popup.error.item.InvalidState"); | |
| break; | |
| case enums.NetworkError.NO_BID_TOKENS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.NoBidTokensTitle", "popup.error.tradetoken.NoBidTokens"); | |
| break; | |
| case enums.NetworkError.INVALID_OWNER: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.BidYourCardTitle", "popup.error.tradetoken.BidYourCard"); | |
| break; | |
| case enums.NetworkError.CARD_IN_TRADE: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.ItemInTradeOfferTitle", "popup.error.tradetoken.ItemInTradeOffer"); | |
| break; | |
| case enums.NetworkError.NOT_ENOUGH_CREDIT: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.auctionInsufficientCoinsTitle", "popup.error.auctionInsufficientCoins"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.CreditsDelegate = function() { | |
| communication.BaseFUTDelegate.call(this) | |
| }, utils.JS.inherits(communication.CreditsDelegate, communication.BaseFUTDelegate), communication.CreditsDelegate.prototype.execute = function() { | |
| var url = communication.BaseFUTDelegate.REQUEST_ROOT + "user/credits"; | |
| this.setRequest(url, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.CreditsDelegate.prototype.onSuccess = function(t) { | |
| var i = new valueobjects.CurrencyVO; | |
| i.parseCurrencyDataObject(t.currencies), gUserModel.setCurrencyDirtyFlag(!1), this.dispatch(communication.BaseDelegate.SUCCESS, i) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.UserVO = function() { | |
| utils.EventDispatcher.call(this), this._clubName = "", this._clubAbbr = "", this._established = new Date, this._establishedSet = !1, this._trophies = 0, this._wins = 0, this._draws = 0, this._losses = 0, this._badgeId = 0 | |
| }, utils.JS.inherits(valueobjects.UserVO, utils.EventDispatcher), valueobjects.UserVO.prototype.update = function(t) { | |
| this._clubName = t.getClubName(), this._clubAbbr = t.getClubAbbr(), this._badgeId = t.getBadgeId(), this._established = t.getEstablished(), this._establishedSet = !0, this._trophies = t.getTrophies(), this._wins = t.getWins(), this._draws = t.getDraws(), this._losses = t.getLosses(), this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getClubName = function() { | |
| return this._clubName | |
| }, valueobjects.UserVO.prototype.setClubName = function(value) { | |
| this._clubName = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getClubAbbr = function() { | |
| return this._clubAbbr | |
| }, valueobjects.UserVO.prototype.setClubAbbr = function(value) { | |
| this._clubAbbr = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getEstablished = function() { | |
| return this._established | |
| }, valueobjects.UserVO.prototype.setEstablished = function(value) { | |
| this._established = value, this._establishedSet = !0, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getEstablishedSet = function() { | |
| return this._establishedSet | |
| }, valueobjects.UserVO.prototype.getTrophies = function() { | |
| return this._trophies | |
| }, | |
| valueobjects.UserVO.prototype.setTrophies = function(value) { | |
| this._trophies = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getWins = function() { | |
| return this._wins | |
| }, valueobjects.UserVO.prototype.setWins = function(value) { | |
| this._wins = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getDraws = function() { | |
| return this._draws | |
| }, valueobjects.UserVO.prototype.setDraws = function(value) { | |
| this._draws = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getLosses = function() { | |
| return this._losses | |
| }, valueobjects.UserVO.prototype.setLosses = function(value) { | |
| this._losses = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.prototype.getBadgeId = function() { | |
| return this._badgeId | |
| }, valueobjects.UserVO.prototype.setBadgeId = function(value) { | |
| this._badgeId = value, this.dispatch(valueobjects.UserVO.EVENT_USER_DATA_CHANGED) | |
| }, valueobjects.UserVO.EVENT_USER_DATA_CHANGED = "valueobjects.UserVO.EVENT_USER_DATA_CHANGE", NamespaceManager.Register("utils"), utils.TextUtils = {}, utils.TextUtils.getYearString = function getYearString(t) { | |
| switch (t) { | |
| case enums.Year.YEAR_2009: | |
| return "2009"; | |
| case enums.Year.YEAR_2010: | |
| return "2010"; | |
| case enums.Year.YEAR_2011: | |
| return "2011"; | |
| case enums.Year.YEAR_2012: | |
| return "2012"; | |
| case enums.Year.YEAR_2013: | |
| return "2013"; | |
| case enums.Year.YEAR_2014: | |
| return "2014"; | |
| case enums.Year.YEAR_2015: | |
| return "2015"; | |
| case enums.Year.YEAR_2016: | |
| return "2016"; | |
| case enums.Year.YEAR_2017: | |
| return "2017"; | |
| case enums.Year.YEAR_2018: | |
| default: | |
| return "2018" | |
| } | |
| }, utils.TextUtils.getYearEnum = function getYearEnum(t) { | |
| switch (t) { | |
| case 2009: | |
| return enums.Year.YEAR_2009; | |
| case 2010: | |
| return enums.Year.YEAR_2010; | |
| case 2011: | |
| return enums.Year.YEAR_2011; | |
| case 2012: | |
| return enums.Year.YEAR_2012; | |
| case 2013: | |
| return enums.Year.YEAR_2013; | |
| case 2014: | |
| return enums.Year.YEAR_2014; | |
| case 2015: | |
| return enums.Year.YEAR_2015; | |
| case 2016: | |
| return enums.Year.YEAR_2016; | |
| case 2017: | |
| return enums.Year.YEAR_2017; | |
| case 2018: | |
| default: | |
| return enums.Year.YEAR_2018 | |
| } | |
| }, utils.TextUtils.getYearFromString = function getYearFromString(t) { | |
| switch (t) { | |
| case "2009": | |
| return enums.Year.YEAR_2009; | |
| case "2010": | |
| return enums.Year.YEAR_2010; | |
| case "2011": | |
| return enums.Year.YEAR_2011; | |
| case "2012": | |
| return enums.Year.YEAR_2012; | |
| case "2013": | |
| return enums.Year.YEAR_2013; | |
| case "2014": | |
| return enums.Year.YEAR_2014; | |
| case "2015": | |
| return enums.Year.YEAR_2015; | |
| case "2016": | |
| return enums.Year.YEAR_2016; | |
| case "2017": | |
| return enums.Year.YEAR_2017; | |
| case "2018": | |
| return enums.Year.YEAR_2018; | |
| default: | |
| return enums.Year.ASSET | |
| } | |
| }, utils.TextUtils.nltobr = function nltobr(t) { | |
| return t.split("\\n").join("<br />") | |
| }, utils.TextUtils.localizeEstablishedDate = function localizeEstablishedDate(t) { | |
| return function _FUTFounder(t) { | |
| return t.valueOf() < new Date(2009, 4, 1).valueOf() | |
| }(t) ? gLocalization.lText("controlbar.FUTFounder") : gLocalization.lPrint("controlbar.clubinfo.established", [function _localizeMonthYear(t) { | |
| var i = t.getMonth(), | |
| s = t.getFullYear().toString(); | |
| return gLocalization.lPrint("date.mmyy", [gLocalization.lText(MONTH_NAMES[i]), s]) | |
| }(t)]) | |
| }, utils.TextUtils.formatDatePrettified = function formatDatePrettified(t) { | |
| var i = gLocalization.lText(MONTH_NAMES[t.getMonth()]), | |
| s = t.getFullYear().toString(), | |
| o = utils.TextUtils.formatToTwoDigits(t.getMinutes()), | |
| l = t.getDate().toString(), | |
| u = t.getHours().toString(), | |
| h = ""; | |
| return gLocalization.isEnglishLocale() && (u = t.getHours() > 12 ? (t.getHours() - 12).toString() : t.getHours().toString(), h = t.getHours() >= 12 ? "pm" : "am"), gLocalization.lPrint("date.ddmmmyyyyhhmm", [l, i, s, u, o, h]) | |
| }, utils.TextUtils.formatToTwoDigits = function formatToTwoDigits(n) { | |
| return n < 10 ? "0" + n : n.toString() | |
| }, utils.TextUtils.centimetersToFeet = function centimetersToFeet(t) { | |
| var i = utils.TextUtils.centimetersToInches(t), | |
| s = Math.floor(i / 12), | |
| o = i / 12 - s, | |
| l = Math.round(12 * o); | |
| return l >= 12 && (s++, l = 0), s + "' " + l + '"' | |
| }, utils.TextUtils.centimetersToInches = function centimetersToInches(t) { | |
| return .393700787 * t | |
| }, utils.TextUtils.basename = function basename(path) { | |
| return path.replace(/\\/g, "/").replace(/.*\//, "") | |
| }, | |
| utils.TextUtils.dirname = function dirname(path) { | |
| return path.replace(/\\/g, "/").replace(/\/[^\/]*$/, "") | |
| }, utils.TextUtils.truncate = function truncate(length, t) { | |
| return utils.JS.isString(t) && "" !== t ? !utils.JS.isNumber(length) || length < 1 ? (utils.Debug.Assert(!1, "[utils.JS::truncate] Invalid length parameter; expected number greater than zero."), t) : (t.length > length && (t = t.substr(0, length).trim(), t += "…"), t) : (utils.Debug.Assert(!1, "[utils.JS::truncate] Invalid string parameter; expected non-empty string."), "") | |
| }, utils.TextUtils.stripTrailingSlash = function stripTrailingSlash(t) { | |
| return "/" === t.substr(-1) ? t.substr(0, t.length - 1) : t | |
| }, utils.TextUtils.cleanString = function cleanString(input) { | |
| return input.replace(/\s+/g, " ").trim() | |
| }, utils.TextUtils.capitalize = function capitalize(input) { | |
| return input.replace(/\w\S*/g, function(t) { | |
| return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase() | |
| }) | |
| }, utils.TextUtils.restrictSpecialCharacters = function restrictSpecialCharacters(input) { | |
| return input.replace(/[^a-zA-Z0-9 ]/g, "") | |
| }, utils.TextUtils.removeEmoticons = function removeEmoticons(input) { | |
| return input.replace(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g, "") | |
| }, utils.TextUtils.stripSpecialCharacters = function stripSpecialCharacters(input) { | |
| for (var t = "", i = input.length; i-- > 0;) { | |
| var s = input.charAt(i); | |
| if (input.charCodeAt(i) < 128) t = s + t; | |
| else { | |
| for (var o = STRING_EQUALITY_LOOKUP.length, l = !1; o-- > 0;) { | |
| var u = STRING_EQUALITY_LOOKUP[o]; | |
| if (u.characters.indexOf(s.toLowerCase()) >= 0) { | |
| t = u.equivalent + t, l = !0; | |
| break | |
| } | |
| } | |
| l || (t = s + t) | |
| } | |
| } | |
| return t | |
| }, utils.TextUtils.isValidNameSquad = function isValidNameSquad(t) { | |
| var i = utils.TextUtils.cleanString(t); | |
| return i.length >= MIN_SQUAD_NAME_LENGTH && i.length <= MAX_SQUAD_NAME_LENGTH | |
| }, utils.TextUtils.squadNameExists = function squadNameExists(t, i) { | |
| for (var s = i.length; s > 0;) | |
| if (--s, i[s].getName() === t) return !0; | |
| return !1 | |
| }, utils.TextUtils.createSquadNameCopy = function createSquadNameCopy(t, i) { | |
| var s = gLocalization.lText("squad.name.copy").toUpperCase(), | |
| o = 0, | |
| l = t, | |
| u = ""; | |
| do { | |
| u = s, u += o > 0 ? o.toString() + " " : " ", (u += l).length > MAX_SQUAD_NAME_LENGTH && (u = u.slice(0, -(u.length - MAX_SQUAD_NAME_LENGTH))), t = u, o++ | |
| } while (utils.TextUtils.squadNameExists(t, i)); | |
| return t | |
| }, utils.TextUtils.createSquadName = function createSquadName(t, i) { | |
| var s = 0, | |
| o = t, | |
| l = ""; | |
| do { | |
| l = o, (l += s > 0 ? " " + s.toString() : "").length > MAX_SQUAD_NAME_LENGTH && (l = l.slice(0, -(l.length - MAX_SQUAD_NAME_LENGTH))), t = l, s++ | |
| } while (utils.TextUtils.squadNameExists(t, i)); | |
| return t | |
| }, NamespaceManager.Register("utils"), utils.Localization = function() { | |
| this._stringArray = {}, this._onLoadedCallback = null, this._appLocale = "", this._appLanguage = ""; | |
| var t = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "storeLocLoaded", { | |
| get: t.get.bind(t), | |
| set: t.set.bind(t) | |
| }), this.storeLocLoaded = !1, this._validLanguages = [enums.Language.ENGLISH, enums.Language.FRENCH, enums.Language.ITALIAN, enums.Language.GERMAN, enums.Language.SPANISH, enums.Language.DUTCH, enums.Language.PORTUGUESE] | |
| }; | |
| var gLocalization = new utils.Localization; | |
| utils.Localization.MS_PER_SECOND = 1e3, utils.Localization.SECONDS_PER_MINUTE = 60, utils.Localization.SECONDS_PER_HOUR = 3600, utils.Localization.SECONDS_PER_DAY = 86400, utils.Localization.SECONDS_PER_MONTH = 2678400, utils.Localization.SECONDS_PER_YEAR = 31536e3, utils.Localization.prototype.setLocale = function(locale) { | |
| switch (locale) { | |
| case enums.ServerLocale.USA: | |
| return void(this._appLocale = enums.Locale.USA); | |
| case enums.ServerLocale.GREAT_BRITAIN: | |
| return void(this._appLocale = enums.Locale.GREAT_BRITAIN); | |
| case enums.ServerLocale.AUSTRALIA: | |
| return void(this._appLocale = enums.Locale.AUSTRALIA); | |
| case enums.ServerLocale.FRANCE: | |
| return void(this._appLocale = enums.Locale.FRANCE); | |
| case enums.ServerLocale.GERMANY: | |
| return void(this._appLocale = enums.Locale.GERMANY); | |
| case enums.ServerLocale.SPAIN: | |
| return void(this._appLocale = enums.Locale.SPAIN); | |
| case enums.ServerLocale.MEXICO: | |
| return void(this._appLocale = enums.Locale.MEXICO); | |
| case enums.ServerLocale.ITALY: | |
| return void(this._appLocale = enums.Locale.ITALY); | |
| case enums.ServerLocale.NETHERLANDS: | |
| return void(this._appLocale = enums.Locale.NETHERLANDS); | |
| case enums.ServerLocale.POLAND: | |
| return void(this._appLocale = enums.Locale.POLAND); | |
| case enums.ServerLocale.RUSSIA: | |
| return void(this._appLocale = enums.Locale.RUSSIA); | |
| case enums.ServerLocale.BRAZIL: | |
| return void(this._appLocale = enums.Locale.BRAZIL); | |
| default: | |
| return void(this._appLocale = locale) | |
| } | |
| }, utils.Localization.prototype.getLocale = function() { | |
| return this._appLocale | |
| }, utils.Localization.prototype.isEnglishLocale = function() { | |
| switch (this.getLocale()) { | |
| case enums.Locale.USA: | |
| case enums.Locale.CANADA: | |
| case enums.Locale.GREAT_BRITAIN: | |
| case enums.Locale.AUSTRALIA: | |
| case enums.ServerLocale.USA: | |
| case enums.ServerLocale.AUSTRALIA: | |
| case enums.ServerLocale.GREAT_BRITAIN: | |
| return !0; | |
| default: | |
| return !1 | |
| } | |
| }, utils.Localization.prototype.isEnglishLanguage = function(lang) { | |
| switch (lang.toLowerCase()) { | |
| case enums.Language.ENGLISH.toLowerCase(): | |
| case enums.URLLocale.USA.toLowerCase(): | |
| case enums.URLLocale.GREAT_BRITAIN.toLowerCase(): | |
| case enums.URLLocale.AUSTRALIA.toLowerCase(): | |
| case enums.URLLocale.UK.toLowerCase(): | |
| return !0; | |
| default: | |
| return !1 | |
| } | |
| }, utils.Localization.prototype.setLanguage = function(language, t) { | |
| utils.Debug.Assert(this.isLanguageSupported(language), "Attempting to load unsupported language: " + language), this._onLoadedCallback = t, this._appLanguage = language, $.getJSON("loc/" + this.getEffectiveLocale() + ".json", this._onLanguageLoaded.bind(this)) | |
| }, utils.Localization.prototype.getLanguage = function() { | |
| return this._appLanguage | |
| }, utils.Localization.prototype._onLanguageLoaded = function(data) { | |
| this.appendAdditionalStrings(data), this._onLoadedCallback(), this._onLoadedCallback = null | |
| }, utils.Localization.prototype.isLanguageSupported = function(language) { | |
| return -1 !== this._validLanguages.indexOf(language) | |
| }, utils.Localization.prototype.getEffectiveLocale = function(language) { | |
| switch (utils.JS.isValid(language) || (language = this.getLanguage()), language) { | |
| case enums.Language.ENGLISH: | |
| return enums.Locale.USA; | |
| case enums.Language.FRENCH: | |
| return enums.Locale.FRANCE; | |
| case enums.Language.ITALIAN: | |
| return enums.Locale.ITALY; | |
| case enums.Language.GERMAN: | |
| return enums.Locale.GERMANY; | |
| case enums.Language.SPANISH: | |
| return enums.Locale.SPAIN; | |
| case enums.Language.DUTCH: | |
| return enums.Locale.NETHERLANDS; | |
| case enums.Language.PORTUGUESE: | |
| return enums.Locale.BRAZIL; | |
| default: | |
| return enums.Locale.USA | |
| } | |
| }, utils.Localization.prototype.getLanguageFromLocale = function(locale) { | |
| switch (locale) { | |
| case enums.Locale.USA: | |
| return enums.Language.ENGLISH; | |
| case enums.Locale.FRANCE: | |
| return enums.Language.FRENCH; | |
| case enums.Locale.ITALY: | |
| return enums.Language.ITALIAN; | |
| case enums.Locale.GERMANY: | |
| return enums.Language.GERMAN; | |
| case enums.Locale.SPAIN: | |
| return enums.Language.SPANISH; | |
| case enums.Locale.NETHERLANDS: | |
| return enums.Language.DUTCH; | |
| case enums.Locale.BRAZIL: | |
| return enums.Language.PORTUGUESE; | |
| default: | |
| return enums.Language.ENGLISH | |
| } | |
| }, utils.Localization.prototype.getEffectiveLocaleFormattedForServer = function() { | |
| switch (this.getLanguage()) { | |
| case enums.Language.ENGLISH: | |
| return enums.ServerLocale.USA; | |
| case enums.Language.FRENCH: | |
| return enums.ServerLocale.FRANCE; | |
| case enums.Language.ITALIAN: | |
| return enums.ServerLocale.ITALY; | |
| case enums.Language.GERMAN: | |
| return enums.ServerLocale.GERMANY; | |
| case enums.Language.SPANISH: | |
| return enums.ServerLocale.SPAIN; | |
| case enums.Language.DUTCH: | |
| return enums.ServerLocale.NETHERLANDS; | |
| case enums.Language.PORTUGUESE: | |
| return enums.ServerLocale.BRAZIL; | |
| default: | |
| return enums.ServerLocale.USA | |
| } | |
| }, utils.Localization.prototype.getLocaleFormattedForURLs = function() { | |
| switch (this.getLocale()) { | |
| case enums.Locale.USA: | |
| case enums.ServerLocale.USA: | |
| return enums.URLLocale.USA; | |
| case enums.Locale.CANADA: | |
| return enums.URLLocale.CANADA; | |
| case enums.Locale.GREAT_BRITAIN: | |
| case enums.ServerLocale.GREAT_BRITAIN: | |
| return enums.URLLocale.GREAT_BRITAIN; | |
| case enums.Locale.AUSTRALIA: | |
| case enums.ServerLocale.AUSTRALIA: | |
| return enums.URLLocale.AUSTRALIA; | |
| case enums.Locale.FRANCE: | |
| case enums.ServerLocale.FRANCE: | |
| return enums.URLLocale.FRANCE; | |
| case enums.Locale.GERMANY: | |
| case enums.ServerLocale.GERMANY: | |
| return enums.URLLocale.GERMANY; | |
| case enums.Locale.SPAIN: | |
| case enums.ServerLocale.SPAIN: | |
| return enums.URLLocale.SPAIN; | |
| case enums.Locale.MEXICO: | |
| case enums.ServerLocale.MEXICO: | |
| return enums.URLLocale.MEXICO; | |
| case enums.Locale.ITALY: | |
| case enums.ServerLocale.ITALY: | |
| return enums.URLLocale.ITALY; | |
| case enums.Locale.NETHERLANDS: | |
| case enums.ServerLocale.NETHERLANDS: | |
| return enums.URLLocale.NETHERLANDS; | |
| case enums.Locale.POLAND: | |
| case enums.ServerLocale.POLAND: | |
| return enums.URLLocale.POLAND; | |
| case enums.Locale.RUSSIA: | |
| case enums.ServerLocale.RUSSIA: | |
| return enums.URLLocale.RUSSIA; | |
| case enums.Locale.BRAZIL: | |
| case enums.ServerLocale.BRAZIL: | |
| return enums.URLLocale.BRAZIL; | |
| default: | |
| return enums.URLLocale.USA | |
| } | |
| }, utils.Localization.prototype.lText = function(t) { | |
| var i = this._stringArray[t]; | |
| return i || (i = "*" + t), i | |
| }, utils.Localization.prototype.appendStoreDescriptionsToLoc = function(t) { | |
| var i, s, key, value, o = $(t).find("trans-unit"), | |
| l = o.length; | |
| for (i = 0; i < l; i++)(s = o[i]).attributes.resname && utils.JS.isValid(s.attributes.resname.value) && (key = s.attributes.resname.value, value = $(s).text().trim(), this._stringArray[key] = value); | |
| this.storeLocLoaded = !0 | |
| }, utils.Localization.prototype.appendAdditionalStrings = function(data) { | |
| var key; | |
| for (key in data) data.hasOwnProperty(key) && (this._stringArray[key] = data[key]) | |
| }, utils.Localization.prototype.lPrint = function(key, t) { | |
| var i = this.lText(key), | |
| length = null === t ? 0 : t.length, | |
| s = 1, | |
| o = 0; | |
| for (o = 0; o < length; ++o) i = i.replace("%" + s.toString(), t[o]), s++; | |
| return i | |
| }, utils.Localization.prototype.lDate = function(t) { | |
| var i = utils.TextUtils.formatToTwoDigits((t.getMonth() + 1).toString()), | |
| s = utils.TextUtils.formatToTwoDigits(t.getDate().toString()), | |
| o = t.getFullYear().toString(); | |
| return this.lPrint("date.mmddyyyy", [i, s, o]) | |
| }, utils.Localization.prototype.lNum = function(t, i, s) { | |
| null !== i && void 0 !== i || (i = 0), null !== s && void 0 !== s || (s = 0), s < i && (s = i); | |
| for (var o = t < 0 ? "-" : "", l = 0 === (t = Math.abs(t)) && 0 === i ? "0" : t.toFixed(s), u = "", h = this.lText("global.thousandsSeperator"), p = this.lText("global.decimal"), m = l.split("."), _ = m[0], g = _.length - 3; g > 0;) u = h + _.substr(g, 3) + u, g -= 3; | |
| if (u = _.substr(0, 3 + g) + u, m.length > 1) { | |
| for (var S = m[1]; S.length > i && "0" === S.substr(S.length - 1, 1);) S = S.substr(0, S.length - 1); | |
| S.length > 0 && (u = u + p + S) | |
| } | |
| return o + u | |
| }, utils.Localization.prototype.lHeight = function(t) { | |
| return this.getLanguage() === enums.Locale.USA ? utils.TextUtils.centimetersToFeet(t) : t + " cm" | |
| }, utils.Localization.prototype.lTimeRemaining = function(t) { | |
| var i = Math.floor(t / utils.Localization.SECONDS_PER_DAY); | |
| t -= i * utils.Localization.SECONDS_PER_DAY; | |
| var s = Math.floor(t / utils.Localization.SECONDS_PER_HOUR); | |
| t -= s * utils.Localization.SECONDS_PER_HOUR; | |
| var o = Math.floor(t / utils.Localization.SECONDS_PER_MINUTE); | |
| return t -= o * utils.Localization.SECONDS_PER_MINUTE, t = Math.floor(t), i > 0 ? this.lPrint("timespan.dayshours", [i, s]) : s > 0 ? this.lPrint("timespan.hoursminutes", [s, o]) : o > 0 ? this.lPrint("timespan.minutesseconds", [o, t]) : 1 === t ? "1 " + gLocalization.lText("timespan.second") : this.lPrint("timespan.seconds", [t]) | |
| }, utils.Localization.prototype.lTimeRemainingPromo = function(t) { | |
| if (t < 0) return this.lText("timespan.listview.seconds"); | |
| var i = Math.floor(t / utils.Localization.SECONDS_PER_DAY); | |
| t -= i * utils.Localization.SECONDS_PER_DAY; | |
| var s = Math.floor(t / utils.Localization.SECONDS_PER_HOUR); | |
| t -= s * utils.Localization.SECONDS_PER_HOUR; | |
| var o = Math.floor(t / utils.Localization.SECONDS_PER_MINUTE); | |
| return t -= o * utils.Localization.SECONDS_PER_MINUTE, t = Math.floor(t), i > 0 ? this.lPrint("timespan.dayshours", [i, s]) : s > 0 ? this.lPrint("timespan.hoursminutes", [s, o]) : o > 0 ? 1 === o ? "1 " + gLocalization.lText("timespan.minute") : this.lPrint("timespan.minutes", [o]) : this.lText("timespan.listview.seconds") | |
| }, utils.Localization.prototype.lTimeRemainingCondensed = function(t) { | |
| var i = Math.floor(t / utils.Localization.SECONDS_PER_DAY); | |
| t -= i * utils.Localization.SECONDS_PER_DAY; | |
| var s = Math.floor(t / utils.Localization.SECONDS_PER_HOUR); | |
| t -= s * utils.Localization.SECONDS_PER_HOUR; | |
| var o = Math.floor(t / utils.Localization.SECONDS_PER_MINUTE); | |
| return t -= o * utils.Localization.SECONDS_PER_MINUTE, t = Math.floor(t), | |
| i > 0 ? 1 === i ? "1 " + gLocalization.lText("timespan.day") : this.lPrint("timespan.days", [i]) : s > 0 ? 1 === s ? "1 " + gLocalization.lText("timespan.hour") : this.lPrint("timespan.hours", [s]) : o > 0 ? 1 === o ? "1 " + gLocalization.lText("timespan.minute") : this.lPrint("timespan.minutes", [o]) : t > 15 ? this.lText("timespan.listview.seconds") : this.lText("timespan.listview.sniper") | |
| }, utils.Localization.prototype.lTimePast = function(then, now) { | |
| var t = (now.getTime() - then.getTime()) / utils.Localization.MS_PER_SECOND; | |
| t = t < 0 ? 1 : t; | |
| var i = Math.floor(t / utils.Localization.SECONDS_PER_YEAR); | |
| t -= i * utils.Localization.SECONDS_PER_YEAR; | |
| var s = Math.floor(t / utils.Localization.SECONDS_PER_MONTH); | |
| t -= s * utils.Localization.SECONDS_PER_MONTH; | |
| var o = Math.floor(t / utils.Localization.SECONDS_PER_DAY); | |
| t -= o * utils.Localization.SECONDS_PER_DAY; | |
| var l = Math.floor(t / utils.Localization.SECONDS_PER_HOUR); | |
| t -= l * utils.Localization.SECONDS_PER_HOUR; | |
| var u = Math.floor(t / utils.Localization.SECONDS_PER_MINUTE); | |
| return t -= u * utils.Localization.SECONDS_PER_MINUTE, t = Math.floor(t), i > 0 ? 1 === i ? this.lPrint("timepast.year", [i]) : this.lPrint("timepast.years", [i]) : s > 0 ? 1 === s ? this.lPrint("timepast.month", [s]) : this.lPrint("timepast.months", [s]) : o > 0 ? 1 === o ? this.lText("timepast.yesterday") : this.lPrint("timepast.days", [o]) : l > 0 ? 1 === l ? this.lPrint("timepast.hour", [l]) : this.lPrint("timepast.hours", [l]) : u > 0 ? 1 === u ? this.lPrint("timepast.minute", [u]) : this.lPrint("timepast.minutes", [u]) : (u = 1, this.lPrint("timepast.minute", [u])) | |
| }, utils.Localization.prototype.replaceHtmlLinks = function replaceHtmlLinks(t) { | |
| $('a[target="_blank"]', t).each(function() { | |
| var t = $(this), | |
| href = t.attr("href"); | |
| t.removeAttr("href"), t.on(enums.Event.TAP, function() { | |
| services.URL.process(href) | |
| }) | |
| }) | |
| }, utils.Localization.prototype.destroyHtmlLinks = function destroyHtmlLinks(t) { | |
| $('a[target="_blank"]', t).each(function() { | |
| $(this).off(enums.Event.TAP) | |
| }) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.CurrencyVO = function() { | |
| this._coins = 0, this._fifaPoints = 0, this._draftTokens = 0, this._containsCoins = !1, this._containsFifaPoints = !1, this._containsDraftTokens = !1 | |
| }, valueobjects.CurrencyVO.prototype.parseCurrencyDataObject = function(data) { | |
| var t, i, s = utils.JS.isValid(data) ? data.length : 0; | |
| for (i = 0; i < s; i++) { | |
| var o = (t = data[i]).funds; | |
| switch (t.name) { | |
| case valueobjects.CurrencyVO.COINS: | |
| this.setCoins(o); | |
| break; | |
| case valueobjects.CurrencyVO.FIFA_POINTS: | |
| this.setFifaPoints(o); | |
| break; | |
| case valueobjects.CurrencyVO.DRAFT_TOKENS: | |
| this.setDraftTokens(o); | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "[CurrencyVO] | Reached default case: " + t.name) | |
| } | |
| } | |
| }, valueobjects.CurrencyVO.prototype.setCoins = function(value) { | |
| this._coins = value, this._containsCoins = !0 | |
| }, valueobjects.CurrencyVO.prototype.getCoins = function() { | |
| return this._coins | |
| }, valueobjects.CurrencyVO.prototype.setFifaPoints = function(value) { | |
| this._fifaPoints = value, this._containsFifaPoints = !0 | |
| }, valueobjects.CurrencyVO.prototype.getFifaPoints = function() { | |
| return this._fifaPoints | |
| }, valueobjects.CurrencyVO.prototype.setDraftTokens = function(value) { | |
| this._draftTokens = value, this._containsDraftTokens = !0 | |
| }, valueobjects.CurrencyVO.prototype.getDraftTokens = function() { | |
| return this._draftTokens | |
| }, valueobjects.CurrencyVO.prototype.isContainsCoins = function() { | |
| return this._containsCoins | |
| }, valueobjects.CurrencyVO.prototype.isContainsFifaPoints = function() { | |
| return this._containsFifaPoints | |
| }, valueobjects.CurrencyVO.prototype.isContainsDraftTokens = function() { | |
| return this._containsDraftTokens | |
| }, valueobjects.CurrencyVO.COINS = "COINS", valueobjects.CurrencyVO.FIFA_POINTS = "POINTS", valueobjects.CurrencyVO.DRAFT_TOKENS = "DRAFT_TOKEN", NamespaceManager.Register("models"), models.UserModel = function() { | |
| utils.EventDispatcher.call(this), this._personaName = "", this._userVO = new valueobjects.UserVO, this._currencyFlag = !0, this._currencies = new valueobjects.CurrencyVO, this._tradeAccess = models.UserModel.TRADE_ACCESS.WHITELIST | |
| }, utils.JS.inherits(models.UserModel, utils.EventDispatcher), models.UserModel.TRADE_ACCESS = { | |
| NONE: 0, | |
| BLACKLIST: 1, | |
| WHITELIST: 2, | |
| MAINTENANCE: 3 | |
| }, models.UserModel.EVENT_USER_DATA_CHANGED = "UserModel.EVENT_USER_DATA_CHANGE", | |
| models.UserModel.EVENT_USER_CREDITS_CHANGED = "UserModel.EVENT_USER_CREDITS_CHANGED", models.UserModel.EVENT_USER_FIFACASH_CHANGED = "UserModel.EVENT_USER_FIFACASH_CHANGED", models.UserModel.EVENT_USER_TRADE_TOKEN_CHANGED = "UserModel.EVENT_USER_TRADE_TOKEN_CHANGED", models.UserModel.EVENT_USER_TRADE_TOKEN_PURCHASED = "UserModel.EVENT_USER_TRADE_TOKEN_PURCHASED", models.UserModel.EVENT_UPDATE_CREDITS_COMPLETE = "models.UserModel.EVENT_UPDATE_CREDITS_COMPLETE", models.UserModel.EVENT_UPDATE_CREDITS = "models.UserModel.EVENT_UPDATE_CREDITS", models.UserModel.EVENT_AUCTION_CLOSED = "models.UserModel.EVENT_AUCTION_CLOSED"; | |
| var gUserModel = new models.UserModel; | |
| models.UserModel.prototype.init = function() { | |
| this.addListener(models.UserModel.EVENT_UPDATE_CREDITS, this, this._onCreditsUpdate), this.addListener(models.UserModel.EVENT_AUCTION_CLOSED, this, this._onCreditsUpdate) | |
| }, models.UserModel.prototype.reset = function() { | |
| this._personaName = "", this._userVO = new valueobjects.UserVO, this._currencies = new valueobjects.CurrencyVO, this._tradeAccess = models.UserModel.TRADE_ACCESS.WHITELIST, this._currencyFlag = !0 | |
| }, models.UserModel.prototype.onUserDataChanged = function(sender, t) { | |
| sender.clearListenersByScope(this), this.dispatch(models.UserModel.EVENT_USER_DATA_CHANGED) | |
| }, models.UserModel.prototype.getUserVO = function() { | |
| return this._userVO | |
| }, models.UserModel.prototype.setUserVO = function(t) { | |
| this._userVO.update(t) | |
| }, models.UserModel.prototype.setTradeAccess = function(t) { | |
| this._tradeAccess = t | |
| }, models.UserModel.prototype.getTradeAccess = function() { | |
| return this._tradeAccess | |
| }, models.UserModel.prototype.hasTradeAccess = function() { | |
| return this._tradeAccess === models.UserModel.TRADE_ACCESS.WHITELIST | |
| }, models.UserModel.prototype.setPersonaName = function(t) { | |
| this._personaName = t | |
| }, models.UserModel.prototype.notifyAuctionClosed = function() { | |
| this.dispatch(models.UserModel.EVENT_AUCTION_CLOSED) | |
| }, models.UserModel.prototype.updateCredits = function(t) { | |
| utils.JS.isBoolean(t) || (t = !1), this.dispatch(models.UserModel.EVENT_UPDATE_CREDITS, t) | |
| }, models.UserModel.prototype.isCurrencyDirty = function() { | |
| return this._currencyFlag | |
| }, models.UserModel.prototype.setCurrencyDirtyFlag = function(value) { | |
| this._currencyFlag = value | |
| }, models.UserModel.prototype.getCurrencyVO = function() { | |
| return this._currencies | |
| }, models.UserModel.prototype.setCurrencyVO = function(t, animation) { | |
| animation = animation || !1, this.setCredits(t.getCoins(), animation), this.setFifacash(t.getFifaPoints(), animation), this.setDraftTokens(t.getDraftTokens()) | |
| }, models.UserModel.prototype.getCredits = function() { | |
| return this._currencies.getCoins() | |
| }, models.UserModel.prototype.setCredits = function(t, i) { | |
| var s = {}; | |
| s.oldVal = this.getCredits(), s.newVal = t, this._currencies.setCoins(t), this.dispatch(models.UserModel.EVENT_USER_CREDITS_CHANGED, s, i) | |
| }, models.UserModel.prototype.getFifacash = function() { | |
| return this._currencies.getFifaPoints() | |
| }, models.UserModel.prototype.setFifacash = function(t, i) { | |
| var s = {}; | |
| s.oldVal = this.getFifacash(), s.newVal = t, this._currencies.setFifaPoints(t), this.dispatch(models.UserModel.EVENT_USER_FIFACASH_CHANGED, s, i) | |
| }, models.UserModel.prototype.getDraftTokens = function() { | |
| return this._currencies.getDraftTokens() | |
| }, models.UserModel.prototype.setDraftTokens = function(t) { | |
| this._currencies.setDraftTokens(t) | |
| }, models.UserModel.prototype._onCreditsUpdate = function(sender, t) { | |
| var i = new communication.CreditsDelegate; | |
| i.setImportant(t), i.addListener(communication.BaseDelegate.SUCCESS, this, this._onCreditsUpdateComplete), i.addListener(communication.BaseDelegate.FAIL, this, this._onCreditsUpdateFail), i.execute() | |
| }, models.UserModel.prototype._onCreditsUpdateComplete = function(sender, t) { | |
| sender.clearListenersByScope(this), this.setCredits(t.getCoins(), !0), this.setFifacash(t.getFifaPoints(), !0), this.setDraftTokens(t.getDraftTokens()), this.dispatch(models.UserModel.EVENT_UPDATE_CREDITS_COMPLETE) | |
| }, models.UserModel.prototype._onCreditsUpdateFail = function(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !0, function() { | |
| this.dispatch(models.UserModel.EVENT_UPDATE_CREDITS_COMPLETE) | |
| }.bind(this)) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.AlphanumericVO = function() { | |
| this._value = 0 | |
| }, valueobjects.AlphanumericVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.AlphanumericVO.prototype.set = function(t) { | |
| var i = utils.JS.isNumber(t) || utils.JS.isString(t); | |
| utils.Debug.Assert(i, "Invalid assignment; expected a number or string."), i && (this._value = t) | |
| }, NamespaceManager.Register("entities"), entities.Auction = function FUTAuction() { | |
| this.onDataUpdated = new FUTObservable, Object.defineProperty(this, "onDataUpdated", { | |
| writable: !1, | |
| enumerable: !0 | |
| }); | |
| var t; | |
| Object.defineProperty(this, "bidState", { | |
| get: function() { | |
| return t | |
| }, | |
| set: function(i) { | |
| if (i !== t) { | |
| var s; | |
| for (s in enums.AuctionBidState) | |
| if (enums.AuctionBidState.hasOwnProperty(s)) return void(t = i); | |
| utils.Debug.Assert(!1, "[entities.Auction.bidState::set] Invalid assignment; expected enums.AuctionTradeState enum value") | |
| } | |
| } | |
| }); | |
| var i = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "expires", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i) | |
| }); | |
| var s = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "isUpdating", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s) | |
| }); | |
| var o = new valueobjects.AlphanumericVO; | |
| Object.defineProperty(this, "tradeId", { | |
| get: o.get.bind(o), | |
| set: o.set.bind(o) | |
| }); | |
| var l = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "tradeOwner", { | |
| get: l.get.bind(l), | |
| set: l.set.bind(l) | |
| }); | |
| var u; | |
| Object.defineProperty(this, "tradeState", { | |
| get: function() { | |
| return u | |
| }, | |
| set: function(t) { | |
| if (t !== u) { | |
| var i; | |
| for (i in enums.AuctionTradeState) | |
| if (enums.AuctionTradeState.hasOwnProperty(i)) return void(u = t); | |
| utils.Debug.Assert(!1, "[entities.Auction.tradeState::set] Invalid assignment; expected enums.AuctionTradeState enum value") | |
| } | |
| } | |
| }); | |
| var h = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "watched", { | |
| get: h.get.bind(h), | |
| set: h.set.bind(h) | |
| }); | |
| var p = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "buyNowPrice", { | |
| get: p.get.bind(p), | |
| set: p.set.bind(p) | |
| }); | |
| var m = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "currentBid", { | |
| get: m.get.bind(m), | |
| set: m.set.bind(m) | |
| }); | |
| var _ = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "startingBid", { | |
| get: _.get.bind(_), | |
| set: _.set.bind(_) | |
| }), this.bidState = enums.AuctionBidState.NONE, this.buyNowPrice = 0, this.currentBid = 0, this.expires = -1, this.isUpdating = !1, this.startingBid = 0, this.timestamp = 0, this.tradeId = "0", this.tradeOwner = !1, this.tradeState = enums.AuctionTradeState.INACTIVE, this.watched = !1, this._stale = !1 | |
| }, entities.Auction.prototype.parseAuctionDataObject = function parseAuctionDataObject(data) { | |
| this.timestamp = Date.now(); | |
| var t = { | |
| timestamp: this.timestamp | |
| }; | |
| this.bidState !== data.bidState && (this.bidState = data.bidState || enums.AuctionBidState.NONE, t.bidState = this.bidState), this.buyNowPrice !== data.buyNowPrice && (this.buyNowPrice = data.buyNowPrice, t.buyNowPrice = this.buyNowPrice), this.currentBid !== data.currentBid && (this.currentBid = data.currentBid, t.currentBid = this.currentBid), this.expires !== data.expires && (this.expires = data.expires, t.expires = this.expires), this.startingBid !== data.startingBid && (this.startingBid = data.startingBid, t.startingBid = this.startingBid); | |
| var i = data.tradeIdStr || data.tradeId.toString(); | |
| this.tradeId !== i && (this.tradeId = i, t.tradeId = this.tradeId); | |
| var s = data.tradeOwner || !1; | |
| this.tradeOwner !== s && (this.tradeOwner = s, t.tradeOwner = this.tradeOwner), this.tradeState !== data.tradeState && (this.tradeState = data.tradeState || enums.AuctionTradeState.INACTIVE, t.tradeState = this.tradeState); | |
| var o = data.watched || !1; | |
| this.watched !== o && (this.watched = o, t.watched = this.watched), this.isWon() && (this.watched = !1, t.watched = this.watched), this.onDataUpdated.notify(t) | |
| }, entities.Auction.prototype.update = function update(data) { | |
| this.isHighestBid() && data.isOutbid(); | |
| var t = !this.isClosedTrade() && data.isClosedTrade(), | |
| i = {}; | |
| this.bidState !== data.bidState && (this.bidState = data.bidState, i.bidState = this.bidState), this.buyNowPrice !== data.buyNowPrice && (this.buyNowPrice = data.buyNowPrice, i.buyNowPrice = this.buyNowPrice), this.currentBid !== data.currentBid && (this.currentBid = data.currentBid, i.currentBid = this.currentBid), this.expires !== data.expires && (this.expires = data.expires, | |
| i.expires = this.expires), this.startingBid !== data.startingBid && (this.startingBid = data.startingBid, i.startingBid = this.startingBid), this.timestamp !== data.timestamp && (this.timestamp = data.timestamp, i.timestamp = this.timestamp), this.tradeId !== data.tradeId && (this.tradeId = data.tradeId, i.tradeId = this.tradeId), this.tradeOwner !== data.tradeOwner && (this.tradeOwner = data.tradeOwner, i.tradeOwner = this.tradeOwner), this.tradeState !== data.tradeState && (this.tradeState = data.tradeState, i.tradeState = this.tradeState), this.watched !== data.watched && (this.watched = data.watched, i.watched = this.watched), this.isWon() && (this.watched = !1, i.watched = this.watched), this.onDataUpdated.notify(i), this.isUpdating = !1, this.setStale(!1), t && gUserModel.notifyAuctionClosed() | |
| }, entities.Auction.prototype.setStale = function setStale(t) { | |
| this._stale = !!t | |
| }, entities.Auction.prototype.isStale = function isStale() { | |
| return this._stale | |
| }, entities.Auction.prototype.isValid = function isValid() { | |
| return "0" !== this.tradeId && this.tradeState !== enums.AuctionTradeState.INVALID | |
| }, entities.Auction.prototype.getAge = function getAge() { | |
| return Date.now() - this.timestamp | |
| }, entities.Auction.prototype.getAgeInSeconds = function getAgeInSeconds() { | |
| return Math.round((Date.now() - this.timestamp) / 1e3) | |
| }, entities.Auction.prototype.getSecondsRemaining = function getSecondsRemaining() { | |
| var t = this.getAgeInSeconds(); | |
| return t < this.expires ? this.expires - t : 0 | |
| }, entities.Auction.prototype.isWon = function isWon() { | |
| return !this.tradeOwner && this.isClosedTrade() && (this.isHighestBid() || this.isBought()) | |
| }, entities.Auction.prototype.isSold = function isSold() { | |
| return this.tradeOwner && this.isClosedTrade() | |
| }, entities.Auction.prototype.isSelling = function isSelling() { | |
| return this.tradeOwner && this.isActiveTrade() | |
| }, entities.Auction.prototype.isPendingExpiry = function isPendingExpiry() { | |
| return this.isActiveTrade() && (this.expires <= 0 || this.getSecondsRemaining() <= 0) | |
| }, entities.Auction.prototype.isBid = function isBid() { | |
| return this.bidState !== enums.AuctionBidState.NONE | |
| }, entities.Auction.prototype.isBought = function isBought() { | |
| return this.bidState === enums.AuctionBidState.BUYNOW | |
| }, entities.Auction.prototype.isOutbid = function isOutbid() { | |
| return this.bidState === enums.AuctionBidState.OUTBID | |
| }, entities.Auction.prototype.isHighestBid = function isHighestBid() { | |
| return this.bidState === enums.AuctionBidState.HIGHEST | |
| }, entities.Auction.prototype.isActiveTrade = function isActiveTrade() { | |
| return this.tradeState === enums.AuctionTradeState.ACTIVE | |
| }, entities.Auction.prototype.isClosedTrade = function isClosedTrade() { | |
| return this.tradeState === enums.AuctionTradeState.CLOSED | |
| }, entities.Auction.prototype.isExpired = function isExpired() { | |
| return this.tradeState === enums.AuctionTradeState.EXPIRED | |
| }, entities.Auction.prototype.isInactive = function isInactive() { | |
| return this.tradeState === enums.AuctionTradeState.INACTIVE | |
| }, entities.Auction.prototype.canWatch = function canWatch() { | |
| return !this.watched && this.isActiveTrade() && !this.isPendingExpiry() | |
| }, entities.Auction.prototype.canBid = function canBid(value, t) { | |
| var i = !0; | |
| return !(value < this.startingBid || value <= this.currentBid) && (!(value > AUCTION_MAX_BID || this.buyNowPrice > 0 && value >= this.buyNowPrice) && (utils.JS.isNumber(t) && (i = t >= value), this.isActiveTrade() && !this.isPendingExpiry() && i)) | |
| }, entities.Auction.prototype.canBuy = function canBuy(t) { | |
| var i = !0; | |
| return utils.JS.isNumber(t) && (i = t >= (this.isHighestBid() ? this.buyNowPrice - this.currentBid : this.buyNowPrice)), this.isActiveTrade() && !this.isPendingExpiry() && i | |
| }, entities.Auction.prototype.compareTo = function compareTo(t) { | |
| return this.isValid() && t.isValid() && this.tradeId === t.tradeId | |
| }, entities.Auction.prototype.bid = function bid(t) { | |
| var i = new FUTObservable, | |
| s = { | |
| success: !1, | |
| currencies: [], | |
| itemData: null, | |
| duplicates: null, | |
| error: null | |
| }; | |
| if (!this.isValid() || this.tradeOwner || t <= 0) return i.notify(s), i; | |
| var o = new communication.BidDelegate(this.tradeId, t); | |
| return o.addListener(communication.BaseDelegate.SUCCESS, this, function _bidSuccess(sender, response) { | |
| if (sender.clearListenersByScope(this), this.parseAuctionDataObject(response.auctionInfo[0]), | |
| response.currencies.forEach(function(t) { | |
| var i = new transferobjects.Currency(t); | |
| s.currencies.push(i), i.isCoins && (gUserModel.setCredits(i.funds, !0), gUserModel.setCurrencyDirtyFlag(!1)) | |
| }), Array.isArray(response.duplicateItemIdList)) { | |
| var t = {}; | |
| response.duplicateItemIdList.forEach(function(i) { | |
| t[i.itemId] = i.duplicateItemId | |
| }), s.duplicates = new FUTHashTable(t) | |
| } | |
| var o = response.auctionInfo[0].itemData; | |
| s.itemData = { | |
| id: o.id, | |
| lastSalePrice: o.lastSalePrice, | |
| pile: o.pile | |
| }, s.dynamicObjectivesUpdates = response.dynamicObjectivesUpdates || null, s.success = !0, i.notify(s) | |
| }), o.addListener(communication.BaseDelegate.FAIL, this, function _bidFail(sender, error) { | |
| sender.clearListenersByScope(this), s.error = error, i.notify(s) | |
| }), o.send(), i | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.IListItemVO = function() {}, valueobjects.IListItemVO.prototype.getItemData = function() {}, valueobjects.IListItemVO.prototype.getAuctionData = function() {}, NamespaceManager.Register("valueobjects"), valueobjects.ItemPileVO = function() { | |
| this._value = enums.FUTItemPile.ANY | |
| }, valueobjects.ItemPileVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.ItemPileVO.prototype.set = function(t) { | |
| if (t !== this._value) { | |
| var i; | |
| for (i in enums.FUTItemPile) | |
| if (enums.FUTItemPile.hasOwnProperty(i)) return void(this._value = t); | |
| utils.Debug.Assert(!1, "Invalid assignment; expected enums.FUTItemPile enum value.") | |
| } | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.ItemRareTypeVO = function() { | |
| this._value = enums.ItemRareType.NONE | |
| }, valueobjects.ItemRareTypeVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.ItemRareTypeVO.prototype.set = function(t) { | |
| if (t !== this._value) { | |
| var i; | |
| for (i in enums.ItemRareType) | |
| if (enums.ItemRareType.hasOwnProperty(i)) return void(this._value = t); | |
| utils.Debug.Assert(!1, "Invalid assignment; expected enums.ItemRareType enum value.") | |
| } | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.ItemStateVO = function() { | |
| this._value = enums.ItemState.FREE | |
| }, valueobjects.ItemStateVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.ItemStateVO.prototype.set = function(t) { | |
| if (t !== this._value) { | |
| var i; | |
| for (i in enums.ItemState) | |
| if (enums.ItemState.hasOwnProperty(i)) return void(this._value = t); | |
| utils.Debug.Assert(!1, "Invalid assignment; expected enums.ItemState enum value.") | |
| } | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.ItemTypeVO = function() { | |
| this._value = enums.ItemType.PLAYER | |
| }, valueobjects.ItemTypeVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.ItemTypeVO.prototype.set = function(t) { | |
| if (t !== this._value) { | |
| var i; | |
| for (i in enums.ItemType) | |
| if (enums.ItemType.hasOwnProperty(i)) return void(this._value = t); | |
| utils.Debug.Assert(!1, "Invalid assignment; expected enums.ItemType enum value.") | |
| } | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.RatingVO = function() { | |
| this._value = 0 | |
| }, valueobjects.RatingVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.RatingVO.prototype.set = function(t) { | |
| var i = utils.JS.isNumber(t); | |
| utils.Debug.Assert(i, "Invalid assignment; expected a number."), utils.Debug.Assert(t >= 0 && t <= 99, "Invalid assignment; value outside of bounds. Will assign boundary value instead."), i && (t < 0 ? t = 0 : t > 99 && (t = 99), this._value = t) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.ItemPriceLimits = function(t, i) { | |
| this.maxPrice = t || 0, Object.defineProperty(this, "maxPrice", { | |
| writable: !1 | |
| }), this.minPrice = i || 0, Object.defineProperty(this, "minPrice", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.CareerEntry = function(data) { | |
| this.startYear = data.s, Object.defineProperty(this, "startYear", { | |
| writable: !1 | |
| }), this.endYear = data.e, Object.defineProperty(this, "endYear", { | |
| writable: !1 | |
| }), this.teamId = data.t, Object.defineProperty(this, "teamId", { | |
| writable: !1 | |
| }), this.matches = data.m, Object.defineProperty(this, "matches", { | |
| writable: !1 | |
| }), this.goals = data.g, Object.defineProperty(this, "goals", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.LegendsBio = function(data) { | |
| function extractCareer(t) { | |
| var entries = []; | |
| return t.forEach(function(t) { | |
| var i = new transferobjects.CareerEntry(t); | |
| entries.push(i) | |
| }), entries | |
| } | |
| this.clubCareer = utils.JS.isValid(data) ? extractCareer(data.c) : [], Object.defineProperty(this, "clubCareer", { | |
| writable: !1 | |
| }), this.nationalCareer = utils.JS.isValid(data) ? extractCareer(data.n) : [], Object.defineProperty(this, "nationalCareer", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.PlayerMetaData = function(id, data) { | |
| this.id = id, Object.defineProperty(this, "id", { | |
| writable: !1 | |
| }), this.birthday = data.b, Object.defineProperty(this, "birthday", { | |
| writable: !1 | |
| }), this.isLeftFoot = 1 !== parseInt(data.f, 10), Object.defineProperty(this, "isLeftFoot", { | |
| writable: !1 | |
| }), this.height = data.h, Object.defineProperty(this, "height", { | |
| writable: !1 | |
| }), this.legendBio = new transferobjects.LegendsBio(data.l), Object.defineProperty(this, "legendBio", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.StringVO = function() { | |
| this._value = "" | |
| }, valueobjects.StringVO.prototype.get = function() { | |
| return this._value | |
| }, valueobjects.StringVO.prototype.set = function(t) { | |
| var i = utils.JS.isString(t); | |
| utils.Debug.Assert(i, "Invalid assignment; expected a string."), i && (this._value = t) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.StaticItemData = function() { | |
| var t = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "assetId", { | |
| get: t.get.bind(t), | |
| set: t.set.bind(t), | |
| enumerable: !0 | |
| }); | |
| var i = new valueobjects.StringVO; | |
| Object.defineProperty(this, "assetType", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i), | |
| enumerable: !0 | |
| }); | |
| var s = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "assetYear", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s), | |
| enumerable: !0 | |
| }); | |
| var o = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "amount", { | |
| get: o.get.bind(o), | |
| set: o.set.bind(o), | |
| enumerable: !0 | |
| }); | |
| var name = new valueobjects.StringVO; | |
| Object.defineProperty(this, "name", { | |
| get: name.get.bind(name), | |
| set: name.set.bind(name), | |
| enumerable: !0 | |
| }); | |
| var l = new valueobjects.StringVO; | |
| Object.defineProperty(this, "description", { | |
| get: l.get.bind(l), | |
| set: l.set.bind(l), | |
| enumerable: !0 | |
| }); | |
| var u = new valueobjects.StringVO; | |
| Object.defineProperty(this, "manufacturer", { | |
| get: u.get.bind(u), | |
| set: u.set.bind(u), | |
| enumerable: !0 | |
| }); | |
| var h = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "trainedAttribute", { | |
| get: h.get.bind(h), | |
| set: h.set.bind(h), | |
| enumerable: !0 | |
| }); | |
| var p = new valueobjects.StringVO; | |
| Object.defineProperty(this, "trainPosFrom", { | |
| get: p.get.bind(p), | |
| set: p.set.bind(p), | |
| enumerable: !0 | |
| }); | |
| var m = new valueobjects.StringVO; | |
| Object.defineProperty(this, "trainPosTo", { | |
| get: m.get.bind(m), | |
| set: m.set.bind(m), | |
| enumerable: !0 | |
| }); | |
| var _ = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "goldBoost", { | |
| get: _.get.bind(_), | |
| set: _.set.bind(_), | |
| enumerable: !0 | |
| }); | |
| var g = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "silverBoost", { | |
| get: g.get.bind(g), | |
| set: g.set.bind(g), | |
| enumerable: !0 | |
| }); | |
| var S = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "bronzeBoost", { | |
| get: S.get.bind(S), | |
| set: S.set.bind(S), | |
| enumerable: !0 | |
| }); | |
| var T = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "dynamicPortrait", { | |
| get: T.get.bind(T), | |
| set: T.set.bind(T), | |
| enumerable: !0 | |
| }), this.assetId = 0, this.assetType = "", this.assetYear = -1, this.amount = 0, this.name = enums.Localization.BLANK_STR, this.firstName = enums.Localization.BLANK_STR, this.lastName = enums.Localization.BLANK_STR, this.knownAs = enums.Localization.BLANK_STR, this.description = "", this.manufacturer = "", this.trainedAttribute = -1, this.trainPosFrom = "", this.trainPosTo = "", this.goldBoost = 0, this.silverBoost = 0, this.bronzeBoost = 0, this.dynamicPortrait = !1 | |
| }, transferobjects.StaticItemData.prototype.parseDynamicItemData = function(item, data) { | |
| this.amount = data.amount || 0, this.dynamicPortrait = item.rareflag > enums.ItemRareType.RARE | |
| }, transferobjects.StaticItemData.prototype.generateNameData = function generateNameData(t, i, s) { | |
| this.firstName = t || enums.Localization.BLANK_STR, this.lastName = i || enums.Localization.BLANK_STR, this.knownAs = s || enums.Localization.BLANK_STR, this.name = this.knownAs === enums.Localization.BLANK_STR ? this.lastName : this.knownAs | |
| }, transferobjects.StaticItemData.prototype.getFullName = function() { | |
| return this.knownAs === enums.Localization.BLANK_STR ? this.firstName + " " + this.lastName : this.knownAs | |
| }, transferobjects.StaticItemData.prototype.hasLoanPackDescription = function() { | |
| return "FreeLoanPackDesc" === this.description | |
| }, transferobjects.StaticPlayerItemData = function() { | |
| transferobjects.StaticItemData.call(this) | |
| }, utils.JS.inherits(transferobjects.StaticPlayerItemData, transferobjects.StaticItemData), transferobjects.StaticPlayerItemData.prototype.parseDynamicItemData = function parseDynamicItemData(item, data) { | |
| transferobjects.StaticPlayerItemData.superClass_.parseDynamicItemData.call(this, item, data), this.generateNameData(data.firstName, data.lastName, data.knownAs) | |
| }, transferobjects.StaticPlayerItemData.prototype.hasNameData = function hasNameData() { | |
| return this.firstName !== enums.Localization.BLANK_STR || this.lastName !== enums.Localization.BLANK_STR || this.knownAs !== enums.Localization.BLANK_STR | |
| }, transferobjects.StaticManagerItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticManagerItemData, transferobjects.StaticItemData), transferobjects.StaticManagerItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticManagerItemData.superClass_.parseDynamicItemData.call(this, item, data), this.firstName = data.firstName || enums.Localization.BLANK_STR, this.lastName = data.lastName || enums.Localization.BLANK_STR, this.knownAs = data.commonname || enums.Localization.BLANK_STR, (this.lastName === enums.Localization.BLANK_STR || utils.JS.isEmpty(this.lastName.trim())) && (this.knownAs = this.firstName), this.amount = data.negotiation || 0, this.firstName === enums.Localization.BLANK_STR && this.lastName === enums.Localization.BLANK_STR && this.knownAs === enums.Localization.BLANK_STR ? this.name = enums.Localization.BLANK_STR : this.name = this.knownAs === enums.Localization.BLANK_STR ? this.firstName.charAt(0) + "." + this.lastName : this.knownAs | |
| }, transferobjects.StaticStaffItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticStaffItemData, transferobjects.StaticItemData), transferobjects.StaticStaffItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticStaffItemData.superClass_.parseDynamicItemData.call(this, item, data), this.firstName = data.firstName || enums.Localization.BLANK_STR, this.lastName = data.lastName || enums.Localization.BLANK_STR, this.name = this.firstName + "." + this.lastName, this.trainedAttribute = parseInt(data.attribute, 10) || 0 | |
| }, transferobjects.StaticBadgeItemData = function() { | |
| transferobjects.StaticItemData.apply(this), this.name = gLocalization.lText("card.title.badge") | |
| }, utils.JS.inherits(transferobjects.StaticBadgeItemData, transferobjects.StaticItemData), NamespaceManager.Register("valueobjects"), transferobjects.StaticKitItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticKitItemData, transferobjects.StaticItemData), transferobjects.StaticKitItemData.CATEGORY_KIT_HOME = 2, transferobjects.StaticKitItemData.CATEGORY_KIT_AWAY = 3, transferobjects.StaticKitItemData.CATEGORY_KIT_THIRD = 5, transferobjects.StaticKitItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticKitItemData.superClass_.parseDynamicItemData.call(this, item, data); | |
| var category = parseInt(data.category, 10) || 0; | |
| this.assetYear = parseInt(data.year, 10) || 0, this.name = gLocalization.lText("clubtype.kit"), category === transferobjects.StaticKitItemData.CATEGORY_KIT_HOME ? (this.description = gLocalization.lText("card.desc.homekit"), this.assetType = utils.AssetLocator.IMAGE_TYPE_KIT_HOME) : category === transferobjects.StaticKitItemData.CATEGORY_KIT_AWAY ? (this.description = gLocalization.lText("card.desc.awaykit"), this.assetType = utils.AssetLocator.IMAGE_TYPE_KIT_AWAY) : (this.description = gLocalization.lText("card.desc.thirdkit"), this.assetType = utils.AssetLocator.IMAGE_TYPE_KIT_THIRD), this.assetYear > 0 && (this.description = gLocalization.lText("card.desc.classickit")) | |
| }, transferobjects.StaticBallItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, | |
| utils.JS.inherits(transferobjects.StaticBallItemData, transferobjects.StaticItemData), transferobjects.StaticBallItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticBallItemData.superClass_.parseDynamicItemData.call(this, item, data), this.assetId = parseInt(data.assetId, 10) || 0, this.name = gLocalization.lText("club.edit.ballLabel"), this.description = data.name || "", this.manufacturer = data.manufacturer || "" | |
| }, NamespaceManager.Register("valueobjects"), transferobjects.StaticStadiumItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticStadiumItemData, transferobjects.StaticItemData), transferobjects.StaticStadiumItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticStadiumItemData.superClass_.parseDynamicItemData.call(this, item, data), this.name = gLocalization.lText("club.edit.stadiumLabel"), this.assetId = parseInt(data.stadiumid, 10) || 0, this.description = gLocalization.lText("global.stadiumFull." + utils.TextUtils.getYearString(item.getYear()) + ".stadium" + this.assetId) | |
| }, transferobjects.StaticTrainingItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticTrainingItemData, transferobjects.StaticItemData), transferobjects.StaticTrainingItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticTrainingItemData.superClass_.parseDynamicItemData.call(this, item, data); | |
| var t = item.subtype; | |
| if (item.isGKTraining()) switch (this.name = gLocalization.lText("card.desc.training.goalkeeper"), this.assetType = utils.AssetLocator.IMAGE_TYPE_TRAINING_GKATTRIB, t) { | |
| case enums.ItemSubType.TRAINING_GK_DIVING: | |
| this.assetId = 0, this.trainedAttribute = 0; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_HANDLING: | |
| this.assetId = 1, this.trainedAttribute = 1; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_KICKING: | |
| this.assetId = 2, this.trainedAttribute = 2; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_SPEED: | |
| this.assetId = 3, this.trainedAttribute = 3; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_POSITION: | |
| this.assetId = 4, this.trainedAttribute = 4; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_REFLEX: | |
| this.assetId = 5, this.trainedAttribute = 5; | |
| break; | |
| case enums.ItemSubType.TRAINING_GK_ALL: | |
| this.assetId = 6, this.trainedAttribute = 6 | |
| } else if (item.isPlayerTraining()) switch (this.name = gLocalization.lText("card.desc.contract.player"), this.assetType = utils.AssetLocator.IMAGE_TYPE_TRAINING_PLAYERATTRIB, t) { | |
| case enums.ItemSubType.TRAINING_PLAYER_PACE: | |
| this.assetId = 0, this.trainedAttribute = 0; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_SHOOTING: | |
| this.assetId = 1, this.trainedAttribute = 1; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_PASSING: | |
| this.assetId = 2, this.trainedAttribute = 2; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_DRIBBLING: | |
| this.assetId = 3, this.trainedAttribute = 3; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_HEADING: | |
| this.assetId = 4, this.trainedAttribute = 4; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_DEFEND: | |
| this.assetId = 5, this.trainedAttribute = 5; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_ALL: | |
| this.assetId = 6, this.trainedAttribute = 6 | |
| } else if (item.isPlayerPositionModifier()) switch (this.name = gLocalization.lText("card.title.position"), this.assetId = utils.AssetLocator.ASSET_ID_PLAYER, this.assetType = utils.AssetLocator.IMAGE_TYPE_TRAINING_POSITION, t) { | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LWB_LB: | |
| this.trainPosFrom = enums.PlayerPositions.LWB, this.trainPosTo = enums.PlayerPositions.LB; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LB_LWB: | |
| this.trainPosFrom = enums.PlayerPositions.LB, this.trainPosTo = enums.PlayerPositions.LWB; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RWB_RB: | |
| this.trainPosFrom = enums.PlayerPositions.RWB, this.trainPosTo = enums.PlayerPositions.RB; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RB_RWB: | |
| this.trainPosFrom = enums.PlayerPositions.RB, this.trainPosTo = enums.PlayerPositions.RWB; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LM_LW: | |
| this.trainPosFrom = enums.PlayerPositions.LM, this.trainPosTo = enums.PlayerPositions.LW; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RM_RW: | |
| this.trainPosFrom = enums.PlayerPositions.RM, this.trainPosTo = enums.PlayerPositions.RW; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LW_LM: | |
| this.trainPosFrom = enums.PlayerPositions.LW, this.trainPosTo = enums.PlayerPositions.LM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RW_RM: | |
| this.trainPosFrom = enums.PlayerPositions.RW, this.trainPosTo = enums.PlayerPositions.RM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LW_LF: | |
| this.trainPosFrom = enums.PlayerPositions.LW, this.trainPosTo = enums.PlayerPositions.LF; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RW_RF: | |
| this.trainPosFrom = enums.PlayerPositions.RW, this.trainPosTo = enums.PlayerPositions.RF; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_LF_LW: | |
| this.trainPosFrom = enums.PlayerPositions.LF, this.trainPosTo = enums.PlayerPositions.LW; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_RF_RW: | |
| this.trainPosFrom = enums.PlayerPositions.RF, this.trainPosTo = enums.PlayerPositions.RW; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CM_CAM: | |
| this.trainPosFrom = enums.PlayerPositions.CM, this.trainPosTo = enums.PlayerPositions.CAM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CAM_CM: | |
| this.trainPosFrom = enums.PlayerPositions.CAM, this.trainPosTo = enums.PlayerPositions.CM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CDM_CM: | |
| this.trainPosFrom = enums.PlayerPositions.CDM, this.trainPosTo = enums.PlayerPositions.CM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CM_CDM: | |
| this.trainPosFrom = enums.PlayerPositions.CM, this.trainPosTo = enums.PlayerPositions.CDM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CAM_CF: | |
| this.trainPosFrom = enums.PlayerPositions.CAM, this.trainPosTo = enums.PlayerPositions.CF; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CF_CAM: | |
| this.trainPosFrom = enums.PlayerPositions.CF, this.trainPosTo = enums.PlayerPositions.CAM; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_CF_ST: | |
| this.trainPosFrom = enums.PlayerPositions.CF, this.trainPosTo = enums.PlayerPositions.ST; | |
| break; | |
| case enums.ItemSubType.TRAINING_PLAYER_POS_ST_CF: | |
| this.trainPosFrom = enums.PlayerPositions.ST, this.trainPosTo = enums.PlayerPositions.CF | |
| } else item.isManagerLeagueModifier() ? (this.name = gLocalization.lText("card.title.leaguechange"), this.assetType = utils.AssetLocator.IMAGE_TYPE_TRAINING_LEAGUEMOD, item.leagueId = this.amount) : item.isStyleModifier() ? (this.name = gLocalization.lText("card.title.playstyle"), this.assetType = utils.AssetLocator.IMAGE_TYPE_TRAINING_POSITION) : utils.Debug.Assert(!1, "Unknown item subtype: " + t) | |
| }, transferobjects.StaticHealingItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticHealingItemData, transferobjects.StaticItemData), transferobjects.StaticHealingItemData.prototype.parseDynamicItemData = function(item, data) { | |
| if (transferobjects.StaticHealingItemData.superClass_.parseDynamicItemData.call(this, item, data), item.isPlayerFitness()) this.name = gLocalization.lText("card.desc.contract.player"), this.assetType = utils.AssetLocator.IMAGE_TYPE_HEALING_FITNESS, this.assetId = utils.AssetLocator.ASSET_ID_PLAYER; | |
| else if (item.isTeamFitness()) this.name = gLocalization.lText("card.desc.healing.squad"), this.assetType = utils.AssetLocator.IMAGE_TYPE_HEALING_FITNESS, this.assetId = utils.AssetLocator.ASSET_ID_TEAM; | |
| else if (item.isInjuryHealing()) switch (this.name = gLocalization.lText("card.desc.contract.player"), this.assetType = utils.AssetLocator.IMAGE_TYPE_HEALING_INJURY, item.subtype) { | |
| case enums.ItemSubType.HEALING_HEAD: | |
| this.assetId = 0; | |
| break; | |
| case enums.ItemSubType.HEALING_SHOULDER: | |
| this.assetId = 1; | |
| break; | |
| case enums.ItemSubType.HEALING_ARM: | |
| this.assetId = 2; | |
| break; | |
| case enums.ItemSubType.HEALING_BACK: | |
| this.assetId = 3; | |
| break; | |
| case enums.ItemSubType.HEALING_HIP: | |
| this.assetId = 4; | |
| break; | |
| case enums.ItemSubType.HEALING_LEG: | |
| this.assetId = 5; | |
| break; | |
| case enums.ItemSubType.HEALING_FOOT: | |
| this.assetId = 6; | |
| break; | |
| case enums.ItemSubType.HEALING_ALL: | |
| this.assetId = 7 | |
| } else utils.Debug.Assert(!1, "Unknown item subtype: " + item.subtype) | |
| }, transferobjects.StaticContractItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, | |
| utils.JS.inherits(transferobjects.StaticContractItemData, transferobjects.StaticItemData), transferobjects.StaticContractItemData.prototype.parseDynamicItemData = function(item, data) { | |
| transferobjects.StaticContractItemData.superClass_.parseDynamicItemData.call(this, item, data), this.assetType = utils.AssetLocator.IMAGE_TYPE_CONTRACT; | |
| var t = item.isManagerContract(); | |
| this.assetId = t ? 1 : 0, this.name = gLocalization.lText(t ? "card.desc.contract.manager" : "card.desc.contract.player"), data.bronze && (this.bronzeBoost = parseInt(data.bronze, 10)), data.silver && (this.silverBoost = parseInt(data.silver, 10)), data.gold && (this.goldBoost = parseInt(data.gold, 10)) | |
| }, transferobjects.StaticMiscItemData = function() { | |
| transferobjects.StaticItemData.apply(this) | |
| }, utils.JS.inherits(transferobjects.StaticMiscItemData, transferobjects.StaticItemData), transferobjects.StaticMiscItemData.prototype.parseDynamicItemData = function(item, data) { | |
| switch (transferobjects.StaticMiscItemData.superClass_.parseDynamicItemData.call(this, item, data), this.name = gLocalization.lText("card.title.unlock"), this.description = data.description || "", item.subtype) { | |
| case enums.ItemSubType.FREE_COINS: | |
| this.assetType = utils.AssetLocator.IMAGE_TYPE_BOOST_COIN, this.assetId = utils.AssetLocator.ASSET_ID_DEFAULT; | |
| break; | |
| case enums.ItemSubType.DRAFT_TOKEN: | |
| this.assetType = utils.AssetLocator.IMAGE_TYPE_DRAFTTOKEN, this.assetId = utils.AssetLocator.ASSET_ID_DEFAULT; | |
| break; | |
| case enums.ItemSubType.FREE_PACK: | |
| this.assetType = utils.AssetLocator.IMAGE_TYPE_BOOST_PACK, item.isBronzeRating() ? this.assetId = utils.AssetLocator.ASSET_ID_BRONZE_PACK : item.isSilverRating() ? this.assetId = utils.AssetLocator.ASSET_ID_SILVER_PACK : this.assetId = utils.AssetLocator.ASSET_ID_GOLD_PACK | |
| } | |
| }, NamespaceManager.Register("entities"), entities.Item = function FUTItem(t) { | |
| var id = new valueobjects.AlphanumericVO; | |
| Object.defineProperty(this, "id", { | |
| get: id.get.bind(id), | |
| set: id.set.bind(id) | |
| }); | |
| var i = new valueobjects.AlphanumericVO; | |
| Object.defineProperty(this, "duplicateId", { | |
| get: i.get.bind(i), | |
| set: i.set.bind(i) | |
| }); | |
| var s = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "resourceId", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s) | |
| }); | |
| var o = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "iconId", { | |
| get: o.get.bind(o), | |
| set: o.set.bind(o) | |
| }); | |
| var l = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "resourceGameYear", { | |
| get: l.get.bind(l), | |
| set: l.set.bind(l) | |
| }); | |
| var type = new valueobjects.ItemTypeVO; | |
| Object.defineProperty(this, "type", { | |
| get: type.get.bind(type), | |
| set: type.set.bind(type) | |
| }); | |
| var u = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "subtype", { | |
| get: u.get.bind(u), | |
| set: u.set.bind(u) | |
| }); | |
| var h = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "lastSalePrice", { | |
| get: h.get.bind(h), | |
| set: h.set.bind(h) | |
| }); | |
| var p = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "discardValue", { | |
| get: p.get.bind(p), | |
| set: p.set.bind(p) | |
| }); | |
| var m = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "untradeable", { | |
| get: m.get.bind(m), | |
| set: m.set.bind(m) | |
| }); | |
| var _ = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "untradeableCount", { | |
| get: _.get.bind(_), | |
| set: _.set.bind(_) | |
| }); | |
| var g = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "concept", { | |
| get: g.get.bind(g), | |
| set: g.set.bind(g) | |
| }); | |
| var S = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "contract", { | |
| get: S.get.bind(S), | |
| set: S.set.bind(S) | |
| }); | |
| var T = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "teamId", { | |
| get: T.get.bind(T), | |
| set: T.set.bind(T) | |
| }); | |
| var v = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "leagueId", { | |
| get: v.get.bind(v), | |
| set: v.set.bind(v) | |
| }); | |
| var C = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "nationId", { | |
| get: C.get.bind(C), | |
| set: C.set.bind(C) | |
| }); | |
| var I = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "loans", { | |
| get: I.get.bind(I), | |
| set: I.set.bind(I) | |
| }); | |
| var L = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "fitness", { | |
| get: L.get.bind(L), | |
| set: L.set.bind(L) | |
| }); | |
| var A = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "injuryGames", { | |
| get: A.get.bind(A), | |
| set: A.set.bind(A) | |
| }); | |
| var R = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "preferredPosition", { | |
| get: R.get.bind(R), | |
| set: R.set.bind(R) | |
| }); | |
| var P = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "training", { | |
| get: P.get.bind(P), | |
| set: P.set.bind(P) | |
| }); | |
| var state = new valueobjects.ItemStateVO; | |
| Object.defineProperty(this, "state", { | |
| get: state.get.bind(state), | |
| set: state.set.bind(state) | |
| }); | |
| var D = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "suspensionGames", { | |
| get: D.get.bind(D), | |
| set: D.set.bind(D) | |
| }); | |
| var N = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "duplicateItemLoans", { | |
| get: N.get.bind(N), | |
| set: N.set.bind(N) | |
| }); | |
| var O = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "playStyle", { | |
| get: O.get.bind(O), | |
| set: O.set.bind(O) | |
| }); | |
| var B = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "loyaltyBonus", { | |
| get: B.get.bind(B), | |
| set: B.set.bind(B) | |
| }); | |
| var M = new valueobjects.ItemPileVO; | |
| Object.defineProperty(this, "pile", { | |
| get: M.get.bind(M), | |
| set: M.set.bind(M) | |
| }); | |
| var U = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "stackCount", { | |
| get: U.get.bind(U), | |
| set: U.set.bind(U) | |
| }); | |
| var F = new valueobjects.ItemRareTypeVO; | |
| Object.defineProperty(this, "rareflag", { | |
| get: F.get.bind(F), | |
| set: F.set.bind(F) | |
| }); | |
| var k = new valueobjects.RatingVO; | |
| Object.defineProperty(this, "rating", { | |
| get: k.get.bind(k), | |
| set: k.set.bind(k) | |
| }), this.onDataUpdated = new FUTObservable, Object.defineProperty(this, "onDataUpdated", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.id = 0, this.resourceId = 0, this.iconId = 0, this.resourceGameYear = 0, this.type = utils.JS.isValid(t) ? t : enums.ItemType.PLAYER, this.subtype = 0, this.lastSalePrice = 0, this.discardValue = 0, this.state = enums.ItemState.FREE, this.untradeable = !0, this.untradeableCount = 0, this.concept = !1, this.contract = -1, this.teamId = -1, this.leagueId = -1, this.nationId = -1, this.loans = -1, this.fitness = -1, this.injuryType = enums.PlayerInjury.NONE, this.injuryGames = 0, this.preferredPosition = -1, this._attributes = [0, 0, 0, 0, 0, 0], this._lifetimeStats = [0, 0, 0, 0], this._stats = [0, 0, 0, 0], this.training = 0, this.suspensionGames = 0, this._auction = new entities.Auction, this.duplicateId = 0, this.duplicateItemLoans = -1, this.playStyle = 0, this.loyaltyBonus = 0, this.pile = enums.FUTItemPile.ANY, this.stackCount = 0, this.rareflag = enums.ItemRareType.NONE, this.rating = 0, this.owners = 0, this.timestamp = 0, this._itemPriceLimits = null, this._staticData = this._generateStaticData(), this._trainingItem = null, this._metaData = null | |
| }, entities.Item.prototype.activate = function activate(t) { | |
| var i, s = new FUTObservable, | |
| o = { | |
| success: !1, | |
| error: null | |
| }; | |
| return this.isClubItem() ? (this.isKit() ? (utils.Debug.Assert(utils.JS.isNumber(t), "Missing kit activation slot."), i = new communication.ActivateClubItemDelegate(this.id, t)) : i = new communication.ActivateClubItemDelegate(this.id), i.addListener(communication.BaseDelegate.SUCCESS, this, function _onActivateSuccess(sender) { | |
| if (sender.clearListenersByScope(this), this.clearAuction(), this.isBadge()) this.state = enums.ItemState.ACTIVE_BADGE; | |
| else if (this.isBall()) this.state = enums.ItemState.ACTIVE_BALL; | |
| else if (this.isKit()) switch (t) { | |
| case enums.KitActivationSlot.HOME: | |
| this.state = enums.ItemState.ACTIVE_HOME_KIT; | |
| break; | |
| case enums.KitActivationSlot.AWAY: | |
| this.state = enums.ItemState.ACTIVE_AWAY_KIT | |
| } else this.isStadium() && (this.state = enums.ItemState.ACTIVE_STADIUM); | |
| o.success = !0, s.notify(o) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onActivateFail(sender, error) { | |
| sender.clearListenersByScope(this), o.error = error, s.notify(o) | |
| }), i.useClickShield(!0), i.send(), s) : (utils.Debug.Assert(!1, "Cannot activate non-club items."), s.notify(o), s) | |
| }, entities.Item.prototype.bid = function bid(t) { | |
| var i = new FUTObservable; | |
| return this.getAuctionData().bid(t).observe(this, function _bidComplete(t, data) { | |
| t.unobserve(this), data.itemData && (this.id = data.itemData.id, this.lastSalePrice = data.itemData.lastSalePrice, this.pile = data.itemData.pile), data.duplicates && data.duplicates.has(this.id) && (this.duplicateId = data.duplicates.get(this.id)); | |
| var s = { | |
| success: data.success, | |
| currencies: data.currencies, | |
| error: data.error, | |
| dynamicObjectivesUpdates: data.dynamicObjectivesUpdates | |
| }; | |
| i.notify(s) | |
| }), i | |
| }, entities.Item.prototype.loadStaticData = function loadStaticData() { | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1 | |
| }; | |
| if (this.isValid() && this.isPlayer() && 0 !== this.getMaskedResourceId() && this.getYear() < enums.Year.ASSET && (!this.getStaticData().hasNameData() || this.nationId <= 0 || this.leagueId <= 0 || this.teamId <= 0)) { | |
| var i = new communication.StaticDataLoaderDelegate(this); | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, function _onStaticDataLoadSuccess(sender, i) { | |
| sender.clearListenersByScope(this); | |
| var data = i.Item || i.Player; | |
| this.getStaticData().generateNameData(data.FirstName, data.LastName, data.CommonName), this.nationId <= 0 && (this.nationId = parseInt(data.NationId, 10)), this.leagueId <= 0 && (this.leagueId = parseInt(data.LeagueId, 10)), this.teamId <= 0 && (this.teamId = parseInt(data.ClubId, 10)), t.success = !0, event.notify(t) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onStaticDataLoadFail(sender, error) { | |
| sender.clearListenersByScope(this), event.notify(t) | |
| }), i.useClickShield(!0), i.send() | |
| } else t.success = !0, event.notify(t); | |
| return event | |
| }, entities.Item.prototype.clearAuction = function clearAuction() { | |
| this._auction = new entities.Auction | |
| }, entities.Item.prototype._generateStaticData = function _generateStaticData() { | |
| var t; | |
| switch (this.type) { | |
| case enums.ItemType.PLAYER: | |
| t = new transferobjects.StaticPlayerItemData; | |
| break; | |
| case enums.ItemType.MANAGER: | |
| t = new transferobjects.StaticManagerItemData; | |
| break; | |
| case enums.ItemType.HEAD_COACH: | |
| case enums.ItemType.GK_COACH: | |
| case enums.ItemType.FITNESS_COACH: | |
| case enums.ItemType.PHYSIO: | |
| t = new transferobjects.StaticStaffItemData; | |
| break; | |
| case enums.ItemType.BADGE: | |
| t = new transferobjects.StaticBadgeItemData; | |
| break; | |
| case enums.ItemType.KIT: | |
| t = new transferobjects.StaticKitItemData; | |
| break; | |
| case enums.ItemType.BALL: | |
| t = new transferobjects.StaticBallItemData; | |
| break; | |
| case enums.ItemType.STADIUM: | |
| t = new transferobjects.StaticStadiumItemData; | |
| break; | |
| case enums.ItemType.TRAINING: | |
| t = new transferobjects.StaticTrainingItemData; | |
| break; | |
| case enums.ItemType.HEALTH: | |
| t = new transferobjects.StaticHealingItemData; | |
| break; | |
| case enums.ItemType.CONTRACT: | |
| t = new transferobjects.StaticContractItemData; | |
| break; | |
| case enums.ItemType.MISC: | |
| t = new transferobjects.StaticMiscItemData; | |
| break; | |
| default: | |
| this.type, t = new transferobjects.StaticItemData | |
| } | |
| return t | |
| }, entities.Item.prototype.update = function update(item) { | |
| this.lastSalePrice = item.lastSalePrice, this.state = item.state, this.pile = item.pile, this.duplicateId = item.duplicateId, this.stackCount = item.stackCount, this.untradeableCount = item.untradeableCount, 0 !== item.id && (this.id = item.id), (this.isPlayer() || this.isManager()) && (this.contract = item.contract, this.loans = item.loans), this.isPlayer() && (this.loyaltyBonus = item.loyaltyBonus, this.fitness = item.fitness, this.injuryType = item.injuryType, this.injuryGames = item.injuryGames, this.preferredPosition = item.preferredPosition, this.suspensionGames = item.suspensionGames, this.training = item.training, this.playStyle = item.playStyle), this.getAuctionData().update(item.getAuctionData()) | |
| }, entities.Item.prototype.isValid = function isValid() { | |
| return (0 !== this.id || 0 !== this.resourceId) && this.stackCount > 0 | |
| }, entities.Item.prototype.isStack = function isStack() { | |
| return this.stackCount > 1 | |
| }, entities.Item.prototype.isCustomBrick = function isCustomBrick() { | |
| return !1 | |
| }, entities.Item.prototype.getMaskedResourceId = function getMaskedResourceId() { | |
| return this.resourceId & enums.ItemMask.DATABASE | |
| }, entities.Item.prototype.getDefId = function getDefId() { | |
| return gSettingsModel.isLegacyYearIdEnabled() ? this.resourceId & (enums.ItemMask.DATABASE | enums.ItemMask.REVISION) : this.resourceId & (enums.ItemMask.DATABASE | enums.ItemMask.FULL_REVISION) | |
| }, entities.Item.prototype.getItemData = function getItemData() { | |
| return this | |
| }, entities.Item.prototype.getTier = function getTier() { | |
| return this.isValid() ? this.isBronzeRating() ? enums.ItemRatingTier.BRONZE : this.isSilverRating() ? enums.ItemRatingTier.SILVER : enums.ItemRatingTier.GOLD : enums.ItemRatingTier.NONE | |
| }, entities.Item.prototype.getBoostLevel = function getBoostLevel() { | |
| return this.hasTraining() ? this._trainingItem.getTier() : enums.ItemRatingTier.NONE | |
| }, entities.Item.prototype.getYear = function getYear() { | |
| return utils.TextUtils.getYearEnum(this.resourceGameYear) | |
| }, | |
| entities.Item.prototype.getSearchType = function getSearchType() { | |
| switch (this.type) { | |
| case enums.ItemType.PLAYER: | |
| return enums.SearchType.PLAYER; | |
| case enums.ItemType.MANAGER: | |
| case enums.ItemType.HEAD_COACH: | |
| case enums.ItemType.FITNESS_COACH: | |
| case enums.ItemType.GK_COACH: | |
| case enums.ItemType.PHYSIO: | |
| return enums.SearchType.STAFF; | |
| case enums.ItemType.BADGE: | |
| case enums.ItemType.KIT: | |
| return enums.SearchType.CLUB_INFO; | |
| case enums.ItemType.STADIUM: | |
| return enums.SearchType.STADIUM; | |
| case enums.ItemType.BALL: | |
| return enums.SearchType.BALL; | |
| case enums.ItemType.CONTRACT: | |
| case enums.ItemType.HEALTH: | |
| return enums.SearchType.CONSUMABLES_DEVELOPMENT; | |
| case enums.ItemType.TRAINING: | |
| return enums.SearchType.CONSUMABLES_TRAINING; | |
| default: | |
| return utils.Debug.Assert(!1, "[entities.Item::getSearchType] Unexpected item type. Defaulting to search type 'Any'."), enums.SearchType.ANY | |
| } | |
| }, entities.Item.prototype.isInjured = function isInjured() { | |
| return this.isPlayer() && this.injuryGames > 0 | |
| }, entities.Item.prototype.hasTraining = function hasTraining() { | |
| return 0 !== this.training && utils.JS.isValid(this._trainingItem) | |
| }, entities.Item.prototype.getAppliedTrainingItem = function getAppliedTrainingItem() { | |
| return this._trainingItem | |
| }, entities.Item.prototype.isSuspended = function isSuspended() { | |
| return this.isPlayer() && this.suspensionGames > 0 | |
| }, entities.Item.prototype.getStaticData = function getStaticData() { | |
| return this._staticData | |
| }, entities.Item.prototype.setStaticData = function setStaticData(data) { | |
| this._staticData = data | |
| }, entities.Item.prototype.setTrainingItem = function setTrainingItem(item) { | |
| utils.Debug.Assert(item.isTraining(), "Expected a training consumable item."), item.isTraining() && (this.training = item.id, this._trainingItem = item) | |
| }, entities.Item.prototype.getAuctionData = function getAuctionData() { | |
| return this._auction | |
| }, entities.Item.prototype.setAuctionData = function setAuctionData(value) { | |
| this._auction = value | |
| }, entities.Item.prototype.getMetaData = function getMetaData() { | |
| return this._metaData | |
| }, entities.Item.prototype.setMetaData = function setMetaData(data) { | |
| var t = data instanceof transferobjects.PlayerMetaData; | |
| utils.Debug.Assert(t, "Expected a PlayerMetaData DTO"), utils.Debug.Assert(this.isPlayer(), "Cannot assign player meta data to non-player items"), t && this.isPlayer() && (this._metaData = data) | |
| }, entities.Item.prototype.isDiscardable = function isDiscardable() { | |
| return this.isValid() && this.subtype !== enums.ItemSubType.FREE_PACK && this.subtype !== enums.ItemSubType.FREE_COINS && this.subtype !== enums.ItemSubType.DRAFT_TOKEN | |
| }, entities.Item.prototype.isMovable = function isMovable() { | |
| var t = !this.isDuplicate() && !this.isDuplicateLoanPlayer(); | |
| return t = t && this.type !== enums.ItemType.MISC | |
| }, entities.Item.prototype.isDuplicate = function isDuplicate() { | |
| return !this.isConsumable() && this.duplicateId > 0 | |
| }, entities.Item.prototype.isLoaned = function isLoaned() { | |
| return this.loans >= 0 | |
| }, entities.Item.prototype.isPlayer = function isPlayer() { | |
| return this.type === enums.ItemType.PLAYER | |
| }, entities.Item.prototype.isManager = function isManager() { | |
| return this.type === enums.ItemType.MANAGER | |
| }, entities.Item.prototype.isHeadCoach = function isHeadCoach() { | |
| return this.type === enums.ItemType.HEAD_COACH | |
| }, entities.Item.prototype.isFitnessCoach = function isFitnessCoach() { | |
| return this.type === enums.ItemType.FITNESS_COACH | |
| }, entities.Item.prototype.isGKCoach = function isGKCoach() { | |
| return this.type === enums.ItemType.GK_COACH | |
| }, entities.Item.prototype.isPhysio = function isPhysio() { | |
| return this.type === enums.ItemType.PHYSIO | |
| }, entities.Item.prototype.isCoach = function isCoach() { | |
| return this.isHeadCoach() || this.isFitnessCoach() || this.isGKCoach() || this.isPhysio() | |
| }, entities.Item.prototype.isStaff = function isStaff() { | |
| return this.isManager() || this.isCoach() | |
| }, entities.Item.prototype.isPlayerBanned = function isPlayerBanned() { | |
| return this.isValid() && this.isPlayer() && (this.isSuspended() || this.contract <= 0) | |
| }, entities.Item.prototype.isContractExpired = function isContractExpired() { | |
| return (this.isPlayer() || this.isManager()) && this.contract <= 0 | |
| }, entities.Item.prototype.isDuplicateLoanPlayer = function isDuplicateLoanPlayer() { | |
| return this.isValid() && this.isPlayer() && this.isDuplicate() && this.isLoaned() | |
| }, entities.Item.prototype.getAttribute = function getAttribute(index, t) { | |
| var i = this._attributes[index] || 0; | |
| return this.hasTraining() && !t && (i = this._modifyAttribute(index, parseInt(i, 10))), i | |
| }, entities.Item.prototype.getAttributes = function getAttributes() { | |
| var attributes = this.isPlayer() ? this._attributes : []; | |
| return this.hasTraining() && (attributes = attributes.map(function(t, i) { | |
| return this._modifyAttribute(i, parseInt(t, 10)) | |
| }, this)), attributes | |
| }, entities.Item.prototype.getStats = function getStats() { | |
| return this.isPlayer() ? this._stats : [] | |
| }, entities.Item.prototype.getYellowCards = function getYellowCards() { | |
| return this.isPlayer() ? this._stats[2] : 0 | |
| }, entities.Item.prototype.getRedCards = function getRedCards() { | |
| return this.isPlayer() ? this._stats[3] : 0 | |
| }, entities.Item.prototype.getLifetimeStats = function getLifetimeStats() { | |
| return this.isPlayer() ? this._lifetimeStats : [] | |
| }, entities.Item.prototype.getGamesPlayed = function getGamesPlayed() { | |
| return this.isPlayer() ? this._lifetimeStats[0] : 0 | |
| }, entities.Item.prototype.getGoals = function getGoals() { | |
| return this.isPlayer() ? this._lifetimeStats[1] : 0 | |
| }, entities.Item.prototype.getTotalYellowCards = function getTotalYellowCards() { | |
| return this.isPlayer() ? this._lifetimeStats[2] : 0 | |
| }, entities.Item.prototype.getTotalRedCards = function getTotalRedCards() { | |
| return this.isPlayer() ? this._lifetimeStats[3] : 0 | |
| }, entities.Item.prototype.isAttributeBoosted = function isAttributeBoosted(index) { | |
| return this.hasTraining() && (this._trainingItem.isAllAttributeTraining() || this._trainingItem.getStaticData().trainedAttribute === index) | |
| }, entities.Item.prototype._modifyAttribute = function _modifyAttribute(index, value) { | |
| if (this.isAttributeBoosted(index)) { | |
| var t = this._trainingItem.getStaticData(), | |
| i = t.amount; | |
| return this._trainingItem.isPlayerTraining() ? i += Math.floor(gStaffStatsModel.getPlayerAttribBoost(index) * t.amount) : this._trainingItem.isGKTraining() && (i += Math.floor(gStaffStatsModel.getGKAttribBoost(index) * t.amount)), Math.min(value + i, 99) | |
| } | |
| return value | |
| }, entities.Item.prototype.isGK = function isGK() { | |
| return 0 === this.preferredPosition | |
| }, entities.Item.prototype.isContract = function isContract() { | |
| return this.type === enums.ItemType.CONTRACT | |
| }, entities.Item.prototype.isPlayerContract = function isPlayerContract() { | |
| return this.isContract() && this.subtype === enums.ItemSubType.CONTRACT_PLAYER | |
| }, entities.Item.prototype.isManagerContract = function isManagerContract() { | |
| return this.isContract() && this.subtype === enums.ItemSubType.CONTRACT_MANAGER | |
| }, entities.Item.prototype.isTraining = function isTraining() { | |
| return this.type === enums.ItemType.TRAINING | |
| }, entities.Item.prototype.isGKTraining = function isGKTraining() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_GK_DIVING && this.subtype <= enums.ItemSubType.TRAINING_GK_ALL | |
| }, entities.Item.prototype.isPlayerTraining = function isPlayerTraining() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_PLAYER_PACE && this.subtype <= enums.ItemSubType.TRAINING_PLAYER_ALL | |
| }, entities.Item.prototype.isAllAttributeTraining = function isAllAttributeTraining() { | |
| return this.isTraining() && (this.subtype === enums.ItemSubType.TRAINING_GK_ALL || this.subtype === enums.ItemSubType.TRAINING_PLAYER_ALL) | |
| }, entities.Item.prototype.isPlayerPositionModifier = function isPlayerPositionModifier() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_PLAYER_POS_LWB_LB && this.subtype <= enums.ItemSubType.TRAINING_PLAYER_POS_ST_CF | |
| }, entities.Item.prototype.isStyleModifier = function isStyleModifier() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_PLAYERSTYLE_GENERAL_1 && this.subtype <= enums.ItemSubType.TRAINING_PLAYERSTYLE_GOALKEEPER_5 | |
| }, entities.Item.prototype.isPlayerStyleModifier = function isPlayerStyleModifier() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_PLAYERSTYLE_GENERAL_1 && this.subtype < enums.ItemSubType.TRAINING_PLAYERSTYLE_GOALKEEPER_1 | |
| }, entities.Item.prototype.isGKStyleModifier = function isGKStyleModifier() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.TRAINING_PLAYERSTYLE_GOALKEEPER_1 && this.subtype <= enums.ItemSubType.TRAINING_PLAYERSTYLE_GOALKEEPER_5 | |
| }, entities.Item.prototype.isManagerLeagueModifier = function isManagerLeagueModifier() { | |
| return this.isTraining() && this.subtype >= enums.ItemSubType.MANAGERLEAGUE_DENMARK && this.subtype <= enums.ItemSubType.MANAGERLEAGUE_ARGENTINA | |
| }, entities.Item.prototype.isManagerConsumable = function isManagerConsumable() { | |
| return this.isManagerLeagueModifier() || this.isManagerContract() | |
| }, entities.Item.prototype.isHealth = function isHealth() { | |
| return this.type === enums.ItemType.HEALTH | |
| }, entities.Item.prototype.isInjuryHealing = function isInjuryHealing() { | |
| return this.isHealth() && this.subtype >= enums.ItemSubType.HEALING_HEAD && this.subtype <= enums.ItemSubType.HEALING_ALL | |
| }, entities.Item.prototype.isFitness = function isFitness() { | |
| return this.isHealth() && (this.subtype === enums.ItemSubType.FITNESS_PLAYER || this.subtype === enums.ItemSubType.FITNESS_TEAM) | |
| }, entities.Item.prototype.isPlayerFitness = function isPlayerFitness() { | |
| return this.isHealth() && this.subtype === enums.ItemSubType.FITNESS_PLAYER | |
| }, entities.Item.prototype.isTeamFitness = function isTeamFitness() { | |
| return this.isHealth() && this.subtype === enums.ItemSubType.FITNESS_TEAM | |
| }, entities.Item.prototype.isConsumable = function isConsumable() { | |
| return this.isContract() || this.isTraining() || this.isHealth() | |
| }, entities.Item.prototype.isClubConsumable = function isClubConsumable() { | |
| return this.isConsumable() && this.pile === enums.FUTItemPile.CLUB | |
| }, entities.Item.prototype.isBadge = function isBadge() { | |
| return this.type === enums.ItemType.BADGE | |
| }, entities.Item.prototype.isBall = function isBall() { | |
| return this.type === enums.ItemType.BALL | |
| }, entities.Item.prototype.isKit = function isKit() { | |
| return this.type === enums.ItemType.KIT | |
| }, entities.Item.prototype.isStadium = function isStadium() { | |
| return this.type === enums.ItemType.STADIUM | |
| }, entities.Item.prototype.isClubItem = function isClubItem() { | |
| return this.isBadge() || this.isBall() || this.isKit() || this.isStadium() | |
| }, entities.Item.prototype.isActiveBall = function isActiveBall() { | |
| return this.isBall() && this.state === enums.ItemState.ACTIVE_BALL | |
| }, entities.Item.prototype.isActiveBadge = function isActiveBadge() { | |
| return this.isBadge() && this.state === enums.ItemState.ACTIVE_BADGE | |
| }, entities.Item.prototype.isActiveAwayKit = function isActiveAwayKit() { | |
| return this.isKit() && this.state === enums.ItemState.ACTIVE_AWAY_KIT | |
| }, entities.Item.prototype.isActiveHomeKit = function isActiveHomeKit() { | |
| return this.isKit() && this.state === enums.ItemState.ACTIVE_HOME_KIT | |
| }, entities.Item.prototype.isActiveStadium = function isActiveStadium() { | |
| return this.isStadium() && this.state === enums.ItemState.ACTIVE_STADIUM | |
| }, entities.Item.prototype.isActiveClubItem = function isActiveClubItem() { | |
| return this.isActiveBall() || this.isActiveBadge() || this.isActiveAwayKit() || this.isActiveHomeKit() || this.isActiveStadium() | |
| }, entities.Item.prototype.isMiscItem = function isMiscItem() { | |
| return this.type === enums.ItemType.MISC | |
| }, entities.Item.prototype.isFreeCoins = function isFreeCoins() { | |
| return this.isMiscItem() && this.subtype === enums.ItemSubType.FREE_COINS | |
| }, entities.Item.prototype.isFreePack = function isFreePack() { | |
| return this.isMiscItem() && this.subtype === enums.ItemSubType.FREE_PACK | |
| }, entities.Item.prototype.isDraftToken = function isDraftToken() { | |
| return this.isMiscItem() && this.subtype === enums.ItemSubType.DRAFT_TOKEN | |
| }, entities.Item.prototype.isCharityItem = function isCharityItem() { | |
| return this.getMaskedResourceId() === entities.Item.DANNY_MILLER_CHARITY_ID || this.getMaskedResourceId() === entities.Item.KENTON_CHARITY_ID | |
| }, entities.Item.prototype.isCommon = function isCommon() { | |
| return this.rareflag === enums.ItemRareType.NONE | |
| }, entities.Item.prototype.isRare = function isRare() { | |
| return this.rareflag === enums.ItemRareType.RARE | |
| }, entities.Item.prototype.isSpecial = function isSpecial() { | |
| return !this.isCommon() && !this.isRare() | |
| }, entities.Item.prototype.isLegend = function isLegend() { | |
| return this.rareflag === enums.ItemRareType.LEGEND | |
| }, entities.Item.prototype.isTeamOfTheWeek = function isTeamOfTheWeek() { | |
| return this.rareflag === enums.ItemRareType.TOTW | |
| }, entities.Item.prototype.isTeamOfTheYear = function isTeamOfTheYear() { | |
| return this.rareflag === enums.ItemRareType.TOTY | |
| }, entities.Item.prototype.isTeamOfTheSeason = function isTeamOfTheSeason() { | |
| return this.rareflag === enums.ItemRareType.TOTS | |
| }, entities.Item.prototype.isStoryMode = function isStoryMode() { | |
| return this.rareflag === enums.ItemRareType.STORYMODE | |
| }, entities.Item.isAlex = function isAlex(id) { | |
| return id >= ALEX_HUNTER_MIN_ID && id <= ALEX_HUNTER_MAX_ID | |
| }, entities.Item.isDanny = function isDanny(id) { | |
| return id >= DANNY_WILLIAMS_MIN_ID && id <= DANNY_WILLIAMS_MAX_ID | |
| }, entities.Item.prototype.isRussiaWorldCup = function isRussiaWorldCup() { | |
| return this.rareflag === enums.ItemRareType.RTRW | |
| }, entities.Item.prototype.isChampion = function isChampion() { | |
| return this.rareflag === enums.ItemRareType.CHAMPION | |
| }, entities.Item.prototype.hasQualityTiers = function hasQualityTiers() { | |
| return this.isCommon() || this.isRare() || this.isTeamOfTheWeek() || this.isTeamOfTheYear() || this.isTeamOfTheSeason() || this.isChampion() || this.isRussiaWorldCup() | |
| }, entities.Item.prototype.isBronzeRating = function isBronzeRating() { | |
| return this.rating <= 64 | |
| }, entities.Item.prototype.isSilverRating = function isSilverRating() { | |
| return this.rating <= 74 && this.rating > 64 | |
| }, entities.Item.prototype.isGoldRating = function isGoldRating() { | |
| return this.rating > 74 | |
| }, entities.Item.prototype.prefersDefensePosition = function prefersDefensePosition() { | |
| return this.isPlayer() && this.preferredPosition >= enums.PlayerPositionsAsInts.RWB && this.preferredPosition <= enums.PlayerPositionsAsInts.LWB | |
| }, entities.Item.prototype.prefersMidfieldPosition = function prefersMidfieldPosition() { | |
| return this.isPlayer() && this.preferredPosition >= enums.PlayerPositionsAsInts.RDM && this.preferredPosition <= enums.PlayerPositionsAsInts.LAM | |
| }, entities.Item.prototype.prefersAttackerPosition = function prefersAttackerPosition() { | |
| return this.isPlayer() && this.preferredPosition >= enums.PlayerPositionsAsInts.RF | |
| }, entities.Item.prototype.getLocalizedItemType = function getLocalizedItemType() { | |
| var t = "itemtype.default"; | |
| if (this.isCoach()) t = "itemtype.staff"; | |
| else switch (this.type) { | |
| case enums.ItemType.PLAYER: | |
| t = "itemtype.player"; | |
| break; | |
| case enums.ItemType.MANAGER: | |
| t = "itemtype.manager"; | |
| break; | |
| case enums.ItemType.HEALTH: | |
| case enums.ItemType.CONTRACT: | |
| case enums.ItemType.TRAINING: | |
| t = "itemtype.consumable"; | |
| break; | |
| case enums.ItemType.BADGE: | |
| t = "itemtype.badge"; | |
| break; | |
| case enums.ItemType.STADIUM: | |
| t = "itemtype.stadium"; | |
| break; | |
| case enums.ItemType.KIT: | |
| t = "itemtype.kit"; | |
| break; | |
| case enums.ItemType.BALL: | |
| t = "itemtype.ball" | |
| } | |
| return gLocalization.lText(t) | |
| }, entities.Item.prototype.compareTo = function compareTo(item) { | |
| var t = this.getAuctionData(), | |
| i = item.getAuctionData(); | |
| return t.isValid() && i.isValid() ? t.compareTo(i) : this.id === item.id | |
| }, entities.Item.prototype.compareResourceTo = function compareResourceTo(item, t) { | |
| return item instanceof entities.Item ? t ? this.resourceId === item.resourceId : this.isLegend() && item.isLegend() && this.iconId > 0 && item.iconId > 0 ? this.iconId === item.iconId : this.getMaskedResourceId() === item.getMaskedResourceId() : (utils.Debug.Assert(!1, "[entities.Item::compareResourceTo] Parameter expected a valid item entity."), !1) | |
| }, entities.Item.prototype.setItemPriceLimits = function setItemPriceLimits(t) { | |
| this._itemPriceLimits = t | |
| }, entities.Item.prototype.hasPriceLimits = function hasPriceLimits() { | |
| return null !== this._itemPriceLimits | |
| }, entities.Item.prototype.getPriceLimits = function getPriceLimits() { | |
| return this._itemPriceLimits | |
| }, entities.Item.prototype.increaseStackCount = function increaseStackCount() { | |
| return this.stackCount++, this._updateUntradeableState(), this.stackCount | |
| }, entities.Item.prototype.decreaseStackCount = function decreaseStackCount() { | |
| return this.stackCount--, this._updateUntradeableState(), this.stackCount | |
| }, entities.Item.prototype._updateUntradeableState = function _updateUntradeableState() { | |
| this.untradeable = this.untradeableCount > 0 && this.stackCount <= this.untradeableCount | |
| }, entities.Item.prototype.compareDream = function compareDream(item) { | |
| return item instanceof entities.Item ? this.getMaskedResourceId() === item.getMaskedResourceId() && this.concept !== item.concept : (utils.Debug.Assert(!1, "[entities.Item::compareToDream] Parameter expected a valid item entity."), !1) | |
| }, entities.Item.prototype.compareType = function compareType(item) { | |
| return item instanceof entities.Item ? this.type === item.type : (utils.Debug.Assert(!1, "[entities.Item::compareType] Parameter expected a valid item entity."), !1) | |
| }, entities.Item.prototype.canApplyTo = function canApplyTo(item) { | |
| if (!this.isConsumable() || item.isConsumable()) return !1; | |
| var t = this.getStaticData(); | |
| if (this.isPlayerStyleModifier()) return item.isPlayer() && !item.isGK() && item.playStyle !== this.subtype; | |
| if (this.isGKStyleModifier()) return item.isGK() && item.playStyle !== this.subtype; | |
| if (this.isManagerLeagueModifier()) return item.isManager() && item.leagueId !== this.leagueId; | |
| if (this.isPlayerTraining()) return item.isPlayer() && !item.isGK(); | |
| if (this.isGKTraining()) return item.isPlayer() && item.isGK(); | |
| if (this.isPlayerContract()) return item.isPlayer() && !item.isLoaned() && item.contract < 99; | |
| if (this.isManagerContract()) return item.isManager() && item.contract < 99; | |
| if (this.isPlayerPositionModifier()) { | |
| var position = repositories.Squad.getPosition(item.preferredPosition); | |
| return !!position && position.getTypeName() === t.trainPosFrom | |
| } | |
| return this.isFitness() ? item.isPlayer() && (this.isTeamFitness() || item.fitness < 99) : !!this.isInjuryHealing() && (item.isInjured() && this._canApplyToInjury(item.injuryType)) | |
| }, entities.Item.prototype._canApplyToInjury = function _canApplyToInjury(t) { | |
| if (!this.isInjuryHealing()) return !1; | |
| switch (this.subtype) { | |
| case enums.ItemSubType.HEALING_HEAD: | |
| return t === enums.PlayerInjury.HEAD; | |
| case enums.ItemSubType.HEALING_SHOULDER: | |
| return t === enums.PlayerInjury.SHOULDER; | |
| case enums.ItemSubType.HEALING_ARM: | |
| return t === enums.PlayerInjury.ARM; | |
| case enums.ItemSubType.HEALING_BACK: | |
| return t === enums.PlayerInjury.BACK; | |
| case enums.ItemSubType.HEALING_HIP: | |
| return t === enums.PlayerInjury.HIP; | |
| case enums.ItemSubType.HEALING_LEG: | |
| return t === enums.PlayerInjury.LEG; | |
| case enums.ItemSubType.HEALING_FOOT: | |
| return t === enums.PlayerInjury.FOOT; | |
| case enums.ItemSubType.HEALING_ALL: | |
| return !0 | |
| } | |
| return !1 | |
| }, entities.Item.DANNY_MILLER_CHARITY_ID = 227904, entities.Item.KENTON_CHARITY_ID = 235430, entities.CustomBrickItem = function FUTCustomBrickItem() { | |
| entities.Item.call(this, enums.ItemType.PLAYER) | |
| }, utils.JS.inherits(entities.CustomBrickItem, entities.Item), entities.CustomBrickItem.prototype.activate = function activate(t) { | |
| var i = new FUTObservable; | |
| return i.notify({ | |
| success: !1, | |
| error: null | |
| }), i | |
| }, entities.CustomBrickItem.prototype.bid = function bid(t) { | |
| var i = new FUTObservable; | |
| return i.notify({ | |
| success: !1, | |
| currencies: [], | |
| error: null | |
| }), i | |
| }, entities.CustomBrickItem.prototype.loadStaticData = function loadStaticData() { | |
| var t = new FUTObservable; | |
| return t.notify({ | |
| success: !1 | |
| }), t | |
| }, entities.CustomBrickItem.prototype._generateStaticData = function _generateStaticData() { | |
| return new transferobjects.StaticItemData | |
| }, entities.CustomBrickItem.prototype.update = function update(t) {}, entities.CustomBrickItem.prototype.isValid = function isValid() { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.isCustomBrick = function isCustomBrick() { | |
| return !0 | |
| }, entities.CustomBrickItem.prototype.isInjured = function isInjured() { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.hasTraining = function hasTraining() { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.isSuspended = function isSuspended() { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.setStaticData = function setStaticData(data) {}, entities.CustomBrickItem.prototype.setAuctionData = function setAuctionData(value) {}, entities.CustomBrickItem.prototype.getAttribute = function getAttribute(index, t) { | |
| return 0 | |
| }, entities.CustomBrickItem.prototype.isAttributeBoosted = function isAttributeBoosted(index) { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype._modifyAttribute = function _modifyAttribute(index, value) { | |
| return 0 | |
| }, entities.CustomBrickItem.prototype.hasQualityTiers = function hasQualityTiers() { | |
| return !1 | |
| }, | |
| entities.CustomBrickItem.prototype.getLocalizedItemType = function getLocalizedItemType() { | |
| return "" | |
| }, entities.CustomBrickItem.prototype.compareTo = function compareTo(item) { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.compareResourceTo = function compareResourceTo(item, t) { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.setItemPriceLimits = function setItemPriceLimits(t) {}, entities.CustomBrickItem.prototype.increaseStackCount = function increaseStackCount() {}, entities.CustomBrickItem.prototype.decreaseStackCount = function decreaseStackCount() {}, entities.CustomBrickItem.prototype._updateUntradeableState = function _updateUntradeableState() {}, entities.CustomBrickItem.prototype.compareDream = function compareDream(item) { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype.canApplyTo = function canApplyTo(item) { | |
| return !1 | |
| }, entities.CustomBrickItem.prototype._canApplyToInjury = function _canApplyToInjury(t) { | |
| return !1 | |
| }, entities.NullItem = function FUTNullItem() { | |
| entities.Item.call(this, enums.ItemType.NONE) | |
| }, utils.JS.inherits(entities.NullItem, entities.Item), entities.NullItem.prototype.activate = function activate(t) { | |
| var i = new FUTObservable; | |
| return i.notify({ | |
| success: !1, | |
| error: null | |
| }), i | |
| }, entities.NullItem.prototype.bid = function bid(t) { | |
| var i = new FUTObservable; | |
| return i.notify({ | |
| success: !1, | |
| currencies: [], | |
| error: null | |
| }), i | |
| }, entities.NullItem.prototype.loadStaticData = function loadStaticData() { | |
| var t = new FUTObservable; | |
| return t.notify({ | |
| success: !1 | |
| }), t | |
| }, entities.NullItem.prototype._generateStaticData = function _generateStaticData() { | |
| return new transferobjects.StaticItemData | |
| }, entities.NullItem.prototype.update = function update(t) {}, entities.NullItem.prototype.isValid = function isValid() { | |
| return !1 | |
| }, entities.NullItem.prototype.isInjured = function isInjured() { | |
| return !1 | |
| }, entities.NullItem.prototype.hasTraining = function hasTraining() { | |
| return !1 | |
| }, entities.NullItem.prototype.isSuspended = function isSuspended() { | |
| return !1 | |
| }, entities.NullItem.prototype.setStaticData = function setStaticData(data) {}, entities.NullItem.prototype.setAuctionData = function setAuctionData(value) {}, entities.NullItem.prototype.getAttribute = function getAttribute(index, t) { | |
| return 0 | |
| }, entities.NullItem.prototype.isAttributeBoosted = function isAttributeBoosted(index) { | |
| return !1 | |
| }, entities.NullItem.prototype._modifyAttribute = function _modifyAttribute(index, value) { | |
| return 0 | |
| }, entities.NullItem.prototype.hasQualityTiers = function hasQualityTiers() { | |
| return !1 | |
| }, entities.NullItem.prototype.getLocalizedItemType = function getLocalizedItemType() { | |
| return "" | |
| }, entities.NullItem.prototype.compareTo = function compareTo(item) { | |
| return !1 | |
| }, entities.NullItem.prototype.compareResourceTo = function compareResourceTo(item, t) { | |
| return !1 | |
| }, entities.NullItem.prototype.setItemPriceLimits = function setItemPriceLimits(t) {}, entities.NullItem.prototype.increaseStackCount = function increaseStackCount() {}, entities.NullItem.prototype.decreaseStackCount = function decreaseStackCount() {}, entities.NullItem.prototype._updateUntradeableState = function _updateUntradeableState() {}, entities.NullItem.prototype.compareDream = function compareDream(item) { | |
| return !1 | |
| }, entities.NullItem.prototype.canApplyTo = function canApplyTo(item) { | |
| return !1 | |
| }, entities.NullItem.prototype._canApplyToInjury = function _canApplyToInjury(t) { | |
| return !1 | |
| }, NamespaceManager.Register("factories"), factories.Item = function() { | |
| function ItemEntityFactory() {} | |
| function _generateResourceGameYear(t, i) { | |
| if (!gSettingsModel.isLegacyYearIdEnabled() && utils.JS.isValid(i) && !utils.JS.isEmpty(i)) return parseInt(i, 10); | |
| var s = (t & enums.ItemMask.YEAR) >>> 28; | |
| return parseInt(utils.TextUtils.getYearString(s), 10) | |
| } | |
| function _generateSubtype(item) { | |
| switch (utils.Debug.Assert(item.isPlayer() || item.isStaff(), "Missing required item subtype in server payload."), item.type) { | |
| case enums.ItemType.PLAYER: | |
| return enums.ItemSubType.PLAYER; | |
| case enums.ItemType.MANAGER: | |
| return enums.ItemSubType.MANAGER; | |
| case enums.ItemType.HEAD_COACH: | |
| return enums.ItemSubType.HEAD_COACH; | |
| case enums.ItemType.GK_COACH: | |
| return enums.ItemSubType.GK_COACH; | |
| case enums.ItemType.FITNESS_COACH: | |
| return enums.ItemSubType.FITNESS_COACH; | |
| case enums.ItemType.PHYSIO: | |
| return enums.ItemSubType.PHYSIO | |
| } | |
| return enums.ItemSubType.NONE | |
| } | |
| function _convertCardAssetIdToItemType(t) { | |
| switch (t) { | |
| case enums.ItemCardAssetId.CONTRACT_PLAYER: | |
| case enums.ItemCardAssetId.CONTRACT_MANAGER: | |
| return enums.ItemType.CONTRACT; | |
| case enums.ItemCardAssetId.HEALING: | |
| case enums.ItemCardAssetId.FITNESS: | |
| return enums.ItemType.HEALTH; | |
| case enums.ItemCardAssetId.TRAINING_PLAYER: | |
| case enums.ItemCardAssetId.TRAINING_GK: | |
| case enums.ItemCardAssetId.MANAGER_LEAGUE: | |
| case enums.ItemCardAssetId.POSITION_MODIFIER: | |
| case enums.ItemCardAssetId.PLAYSTYLE_PLAYER: | |
| case enums.ItemCardAssetId.PLAYSTYLE_GK: | |
| return enums.ItemType.TRAINING | |
| } | |
| return utils.Debug.Assert(!1, "Unknown cardassetid: " + t), enums.ItemType.NONE | |
| } | |
| function _normalizePayload(data, t) { | |
| data.resourceGameYear = _generateResourceGameYear(data.resourceId, data.resourceGameYear); | |
| var i = utils.TextUtils.getYearEnum(data.resourceGameYear); | |
| if (utils.JS.isNumber(data.rareFlag) && (data.rareflag = data.rareFlag, delete data.rareFlag), utils.JS.isNumber(data.teamid) && (data.teamId = data.teamid, delete data.teamid), !utils.JS.isBoolean(t) || t) { | |
| if (data.teamId && (!utils.JS.isNumber(data.leagueId) || data.leagueId <= 0)) { | |
| var s = repositories.TeamConfig.getTeam(data.teamId, i); | |
| data.leagueId = s ? s.league : -1 | |
| } | |
| if (data.leagueId && (!utils.JS.isNumber(data.nation) || data.nation <= 0)) { | |
| var o = repositories.TeamConfig.getLeague(data.leagueId, i); | |
| data.nation = o ? o.nation : -1 | |
| } | |
| } | |
| return data | |
| } | |
| function _parseItemPayload(item, data) { | |
| if (item.id = data.id, item.resourceId = data.resourceId, item.resourceGameYear = data.resourceGameYear, item.type = data.itemType, item.subtype = data.cardsubtypeid || _generateSubtype(item), item.untradeable = !(utils.JS.isBoolean(data.untradeable) && item.getYear() >= enums.Year.ASSET) || data.untradeable, item.lastSalePrice = data.lastSalePrice || 0, item.discardValue = data.discardValue || 0, item.state = data.itemState, item.pile = data.pile, item.rating = parseInt(data.rating, 10) || 0, item.teamId = data.teamId || 0, item.leagueId = data.leagueId || 0, item.nationId = data.nation || 0, item.rareflag = data.rareflag || 0, item.owners = data.owners || 0, item.timestamp = data.timestamp || 0, item.stackCount = 1, item.untradeableCount = item.untradeable ? 1 : 0, (item.isPlayer() || item.isManager()) && (item.contract = data.contract, item.concept = data.dream || !1, item.loans = utils.JS.isNumber(data.loans) ? data.loans : -1), item.isPlayer()) { | |
| item.loyaltyBonus = item.concept ? 0 : data.loyaltyBonus || 0, item.fitness = data.fitness, item.injuryType = data.injuryType || enums.PlayerInjury.NONE, item.injuryGames = data.injuryGames || 0, item.suspensionGames = data.suspension || 0, item.training = utils.JS.isNumber(data.training) ? data.training : 0, item.playStyle = data.playStyle || DEFAULT_PLAYSTYLE_ID; | |
| var position = repositories.Squad.getPositionByUniqueName(data.preferredPosition); | |
| if (item.preferredPosition = position ? position.getId() : 0, Array.isArray(data.attributeList) && data.attributeList.forEach(function(t, i) { | |
| item._attributes[i] = t.value | |
| }, this), Array.isArray(data.lifetimeStats) && data.lifetimeStats.forEach(function(t, i) { | |
| item._lifetimeStats[i] = t.value | |
| }, this), Array.isArray(data.statsList) && data.statsList.forEach(function(t, i) { | |
| item._stats[i] = t.value | |
| }, this), item.isLegend()) { | |
| var t = repositories.PlayerIcon.get(item.getMaskedResourceId()); | |
| item.iconId = t ? t.iconId : 0 | |
| } | |
| var i = repositories.PlayerMeta.get(item.getMaskedResourceId()); | |
| i && item.setMetaData(i) | |
| } | |
| item._staticData.parseDynamicItemData(item, data), data.trainingItem && (item._trainingItem = this.createItem(data.trainingItem)), utils.JS.isNumber(data.marketDataMaxPrice) && utils.JS.isNumber(data.marketDataMinPrice) && (item._itemPriceLimits = new transferobjects.ItemPriceLimits(data.marketDataMaxPrice, data.marketDataMinPrice)) | |
| } | |
| function _parseConsumablePayload(item, data) { | |
| data.item.itemType || (data.item.itemType = item.type), _parseItemPayload.call(this, item, data.item), item.discardValue = data.discardValue, item.stackCount = data.count, item.resourceId = data.resourceId, item.untradeableCount = data.untradeableCount, item._updateUntradeableState() | |
| } | |
| return ItemEntityFactory.prototype.createItem = function createItem(data) { | |
| if (!data) return new entities.NullItem; | |
| if (data.itemType || (data.itemType = data.cardassetid ? _convertCardAssetIdToItemType(data.cardassetid) : enums.ItemType.PLAYER), (data = _normalizePayload(data)).itemType === enums.ItemType.PLAYER) { | |
| var t = repositories.Item.getStaticDataByDefId(data.resourceId & enums.ItemMask.DATABASE); | |
| t && (data.firstName = t.firstName, data.lastName = t.lastName, data.knownAs = t.commonName || enums.Localization.BLANK_STR) | |
| } | |
| var item = new entities.Item(data.itemType); | |
| return _parseItemPayload.call(this, item, data), item | |
| }, ItemEntityFactory.prototype.createConsumable = function createConsumable(data) { | |
| if (!data) return new entities.NullItem; | |
| data.item.itemType || (data.item.itemType = data.item.cardassetid ? _convertCardAssetIdToItemType(data.item.cardassetid) : enums.ItemType.PLAYER), data.item = _normalizePayload(data.item); | |
| var item = new entities.Item(data.item.itemType); | |
| return _parseConsumablePayload.call(this, item, data), item | |
| }, ItemEntityFactory.prototype.createCustomBrickItem = function createItem(data) { | |
| if (!data) return new entities.NullItem; | |
| data = _normalizePayload(data, !1); | |
| var item = new entities.CustomBrickItem; | |
| return _parseItemPayload.call(this, item, data), item | |
| }, ItemEntityFactory.prototype.generateItemsFromItemData = function generateItemsFromItemData(t, i) { | |
| return t.map(function(data) { | |
| var item = utils.JS.isValid(data.count) ? this.createConsumable(data) : this.createItem(data); | |
| if (utils.JS.isValid(i)) { | |
| var duplicate = utils.JS.find(i, function(t) { | |
| return t.itemId === item.id | |
| }); | |
| utils.JS.isValid(duplicate) && (item.duplicateId = duplicate.duplicateItemId, utils.JS.isValid(duplicate.duplicateItemLoans) && (item.duplicateItemLoans = duplicate.duplicateItemLoans)) | |
| } | |
| return item | |
| }, this) | |
| }, ItemEntityFactory.prototype.generateItemsFromAuctionData = function generateItemsFromAuctionData(t, i) { | |
| return t.map(function(data) { | |
| var item = this.createItem(data.itemData), | |
| t = item.getAuctionData(); | |
| if (t.parseAuctionDataObject(data), 0 === item.id && (item.id = "Trade" + t.tradeId), !item.isConsumable() && utils.JS.isValid(i)) { | |
| var duplicate = utils.JS.find(i, function(t) { | |
| return t.itemId === item.id | |
| }); | |
| utils.JS.isValid(duplicate) && (item.duplicateId = duplicate.duplicateItemId) | |
| } | |
| return item | |
| }, this) | |
| }, new ItemEntityFactory | |
| }(), utils.JS.inherits(ItemRepository, FUTHashTable), ItemRepository.prototype.reset = function reset() { | |
| this.clear(), this.endOfList = !1 | |
| }, ItemRepository.prototype.search = function search(t) { | |
| return this.values().filter(function(item) { | |
| if (t.type === enums.SearchType.PLAYER) { | |
| if (t.position !== enums.SearchType.ANY && repositories.Squad.getPositionByUniqueName(t.position).getId() !== item.preferredPosition) return !1; | |
| if (t.zone !== enums.SearchType.ANY) { | |
| var i = utils.JS.find(POSITION_ZONE_LOOKUP, function(i) { | |
| return i.value === t.zone | |
| }); | |
| if (i.minPosId > item.preferredPosition || i.maxPosId < item.preferredPosition) return !1 | |
| } | |
| if (-1 !== t.playStyle && item.playStyle !== t.playStyle) return !1; | |
| if (t.defId.length > 0 && t.defId.indexOf(item.getMaskedResourceId()) < 0) return !1 | |
| } else if (t.type === enums.SearchType.STAFF && t.category !== enums.SearchCategory.ANY && (item.isManager() && t.category !== enums.SearchCategory.MANAGER || item.isHeadCoach() && t.category !== enums.SearchCategory.COACH_HEAD || item.isFitnessCoach() && t.category !== enums.SearchCategory.COACH_FITNESS || item.isGKCoach() && t.category !== enums.SearchCategory.COACH_GK || item.isPhysio() && t.category !== enums.SearchCategory.PHYSIO)) return !1; | |
| if (t.type !== enums.SearchType.CONSUMABLES_DEVELOPMENT && t.type !== enums.SearchType.CONSUMABLES_TRAINING) { | |
| if (t.level !== enums.SearchType.ANY && (item.getTier() === enums.ItemRatingTier.BRONZE && t.level !== enums.SearchLevel.BRONZE || item.getTier() === enums.ItemRatingTier.SILVER && t.level !== enums.SearchLevel.SILVER || item.getTier() === enums.ItemRatingTier.GOLD && t.level !== enums.SearchLevel.GOLD)) return !1; | |
| if (-1 !== t.nation && t.nation !== item.nationId || -1 !== t.league && t.league !== item.leagueId || -1 !== t.club && t.club !== item.teamId) return !1 | |
| } | |
| return !0 | |
| }) | |
| }, communication.ClubConsumableSearchDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "club/consumables/development", | |
| this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON | |
| }, utils.JS.inherits(communication.ClubConsumableSearchDelegate, communication.BaseFUTDelegate), communication.ClubSearchDelegate = function(t, i, s) { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "club", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON; | |
| var o = {}, | |
| l = !1; | |
| if (o.sort = t.sort, t.year !== enums.SearchType.ANY ? (o.type = 1, o.year = t.year, l = utils.TextUtils.getYearFromString(t.year) <= enums.Year.YEAR_2012) : o.type = t.type === enums.SearchType.ANY ? enums.SearchType.PLAYER : t.type, t.category !== enums.SearchCategory.ANY && (o.type = t.category.toLowerCase()), o.type === enums.SearchType.PLAYER && t.level === enums.SearchLevel.SPECIAL) o.rare = t.level; | |
| else if (t.level !== enums.SearchLevel.ANY) | |
| if (l) { | |
| var u; | |
| for (u in enums.SearchLevel) | |
| if (enums.SearchLevel.hasOwnProperty(u) && t.level === enums.SearchLevel[u] && enums.ItemRatingTier.hasOwnProperty(u)) { | |
| o.level = enums.ItemRatingTier[u]; | |
| break | |
| } | |
| } else o.level = t.level; | |
| if (t.club > 0 && (o.team = t.club), t.league > 0 && (o.league = t.league), t.nation > 0 && (o.nation = t.nation), t.isExactSearch && (o.filter = "exact"), t.zone !== enums.SearchType.ANY) { | |
| var h = utils.JS.find(PLAYER_ZONE_LOOKUP, function(i) { | |
| return i.value === t.zone | |
| }); | |
| utils.JS.isValid(h) && (o.type = h.id) | |
| } else if (t.position !== enums.SearchType.ANY) | |
| if (l) { | |
| var p; | |
| for (p in enums.PlayerPositions) | |
| if (enums.PlayerPositions.hasOwnProperty(p) && t.position === enums.PlayerPositions[p] && enums.PlayerPositionsAsInts.hasOwnProperty(p)) { | |
| o.position = enums.PlayerPositionsAsInts[p]; | |
| break | |
| } | |
| } else o.position = t.position; | |
| t.playStyle > 0 && (o.playStyle = t.playStyle), t.hasValidDefId() && (o.defId = t.defId), o.start = i, o.count = s, this.setURLVariables(o), this.useClickShield(!0) | |
| }, utils.JS.inherits(communication.ClubSearchDelegate, communication.BaseFUTDelegate), ClubRepository.prototype.reset = function reset() { | |
| this._players.reset(), this._staff.reset(), this._consumables.reset(), this._badges.reset(), this._balls.reset(), this._kits.reset(), this._stadiums.reset(), this._activeItems.clear() | |
| }, ClubRepository.prototype._getActiveItems = function _getActiveItems() { | |
| var t = []; | |
| return this._activeItems.keys().forEach(function(i) { | |
| var id = this._activeItems.get(i); | |
| switch (i) { | |
| case enums.ItemState.ACTIVE_BADGE: | |
| t.push(this._badges.get(id)); | |
| break; | |
| case enums.ItemState.ACTIVE_BALL: | |
| t.push(this._balls.get(id)); | |
| break; | |
| case enums.ItemState.ACTIVE_AWAY_KIT: | |
| case enums.ItemState.ACTIVE_HOME_KIT: | |
| t.push(this._kits.get(id)); | |
| break; | |
| case enums.ItemState.ACTIVE_STADIUM: | |
| t.push(this._stadiums.get(id)) | |
| } | |
| }, this), t | |
| }, ClubRepository.prototype.getActiveItems = function getActiveItems(state) { | |
| var t = this._getActiveItems(); | |
| return state ? utils.JS.find(t, function(t) { | |
| return t.state === state | |
| }) : t | |
| }, ClubRepository.prototype.setActiveItem = function setActiveItem(item) { | |
| if (item.isActiveClubItem()) { | |
| var t = this.getActiveItems(item.state); | |
| utils.JS.isValid(t) && t.id !== item.id && (t.state = enums.ItemState.FREE), this._activeItems.set(item.state, item.id) | |
| } | |
| }, ClubRepository.prototype._addClubItem = function _addClubItem(item) { | |
| item.isBadge() ? this._badges.set(item.id, item) : item.isBall() ? this._balls.set(item.id, item) : item.isKit() ? this._kits.set(item.id, item) : item.isStadium() && this._stadiums.set(item.id, item), this.setActiveItem(item) | |
| }, ClubRepository.prototype._removeClubItem = function _removeClubItem(item) { | |
| item.isActiveClubItem() ? utils.Debug.Assert(!1, "[ClubRepository::_removeClubItem] Can't remove an active club item.") : item.isBadge() ? this._badges.remove(item.id) : item.isBall() ? this._balls.remove(item.id) : item.isKit() ? this._kits.remove(item.id) : item.isStadium() && this._stadiums.remove(item.id) | |
| }, ClubRepository.prototype._addConsumable = function _addConsumable(item) { | |
| this._consumables.has(item.resourceId) ? this._consumables.get(item.resourceId).increaseStackCount() : this._consumables.set(item.resourceId, item) | |
| }, ClubRepository.prototype._removeConsumable = function _removeConsumable(t) { | |
| 0 === this._consumables.get(t).stackCount && this._consumables.remove(t) | |
| }, ClubRepository.prototype.add = function add(item) { | |
| function _add(t) { | |
| t.isPlayer() ? this._players.set(t.id, t) : t.isStaff() ? this._staff.set(t.id, t) : t.isClubItem() ? this._addClubItem(t) : t.isConsumable() && this._addConsumable(t) | |
| } | |
| Array.isArray(item) ? item.forEach(function(t) { | |
| _add.call(this, t) | |
| }, this) : _add.call(this, item) | |
| }, ClubRepository.prototype.remove = function remove(item) { | |
| function _remove(t) { | |
| t.isPlayer() ? this._players.remove(t.id) : item.isStaff() ? this._staff.remove(t.id) : item.isClubItem() ? this._removeClubItem(t) : item.isConsumable() && this._removeConsumable(t.resourceId) | |
| } | |
| Array.isArray(item) ? item.forEach(function(t) { | |
| _remove.call(this, t) | |
| }, this) : _remove.call(this, item) | |
| }, ClubRepository.prototype.update = function update(item) { | |
| item.isPlayer() && this._players.has(item.id) && this._players.set(item.id, item) | |
| }, ClubRepository.prototype.search = function search(t) { | |
| var i, s, event = new FUTObservable, | |
| o = new transferobjects.ItemDomainResponse; | |
| switch (t.type) { | |
| case enums.SearchType.PLAYER: | |
| i = this._players; | |
| break; | |
| case enums.SearchType.STAFF: | |
| i = this._staff; | |
| break; | |
| case enums.SearchType.CONSUMABLES_DEVELOPMENT: | |
| case enums.SearchType.CONSUMABLES_TRAINING: | |
| i = this._consumables; | |
| break; | |
| case enums.SearchType.CLUB_INFO: | |
| t.category === enums.SearchCategory.BADGE ? i = this._badges : t.category === enums.SearchCategory.KIT && (i = this._kits); | |
| break; | |
| case enums.SearchType.BALL: | |
| i = this._balls; | |
| break; | |
| case enums.SearchType.STADIUM: | |
| i = this._stadiums | |
| } | |
| return i ? !i.endOfList || t.year !== enums.SearchType.ANY && t.year !== utils.TextUtils.getYearString(enums.Year.ASSET) ? ((s = t.type === enums.SearchType.CONSUMABLES_DEVELOPMENT || t.type === enums.SearchType.CONSUMABLES_TRAINING ? new communication.ClubConsumableSearchDelegate : new communication.ClubSearchDelegate(t, t.offset, t.count)).addListener(communication.BaseDelegate.SUCCESS, this, function _onClubSearchSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var s = Array.isArray(response.itemData) ? factories.Item.generateItemsFromItemData(response.itemData) : [], | |
| l = s.length <= t.count - 1, | |
| u = !t.isModified() && (t.category === enums.SearchType.ANY || t.type === enums.SearchType.CLUB_INFO); | |
| this.add(s), i.endOfList = t.type === enums.SearchType.CONSUMABLES_DEVELOPMENT || l && u, o.success = !0, o.items = s, o.retrievedAll = l, event.notify(o) | |
| }), s.addListener(communication.BaseDelegate.FAIL, this, function _onClubSearchFail(sender, error) { | |
| sender.clearListenersByScope(this), o.error = error, event.notify(o) | |
| }), s.setImportant(!0), s.useClickShield(!0), s.send()) : (o.success = !0, o.items = i.search(t), event.notify(o)) : (utils.Debug.Assert(!1, "[ClubRepository::search] Invalid search, no repository associated to it."), event.notify(o)), event | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.ItemDomainResponse = function(data) { | |
| var t = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "success", { | |
| set: t.set.bind(t), | |
| get: t.get.bind(t) | |
| }), this.success = !!data && data.success, this.error = data ? data.error : null, this.items = data ? data.items : [], this.retrievedAll = !data || data.retrievedAll | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.StaticPlayerData = function(data) { | |
| this.id = data.id, Object.defineProperty(this, "id", { | |
| writable: !1 | |
| }), this.firstName = data.f, Object.defineProperty(this, "firstName", { | |
| writable: !1 | |
| }), this.lastName = data.l, Object.defineProperty(this, "lastName", { | |
| writable: !1 | |
| }), this.commonName = data.c || null, Object.defineProperty(this, "commonName", { | |
| writable: !1 | |
| }), this.name = "", Object.defineProperty(this, "name", { | |
| get: function() { | |
| return this.commonName || this.firstName + " " + this.lastName | |
| } | |
| }), this.rating = data.r, Object.defineProperty(this, "rating", { | |
| writable: !1 | |
| }), this.nationId = data.n, Object.defineProperty(this, "nationId", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("repositories"), repositories.Item = function() { | |
| function ItemDomainRepository() { | |
| var t; | |
| Object.defineProperty(this, "cachedDurationIndex", { | |
| get: function() { | |
| return t | |
| }, | |
| set: function(index) { | |
| utils.JS.isNumber(index) && (t = index) | |
| } | |
| }); | |
| var i; | |
| Object.defineProperty(this, "maxAllowedAuctions", { | |
| get: function() { | |
| return i | |
| }, | |
| set: function(t) { | |
| utils.JS.isNumber(t) && (i = t) | |
| } | |
| }), this._pileSizes = new FUTHashTable({}), this._unassigned = new ItemRepository, this._transfer = new ItemRepository, this._inbox = new ItemRepository, this._club = new ClubRepository, this._unassignedCacheTimestamp = 0, this._transferCacheTimestamp = 0, this._inboxCacheTimestamp = 0, this.cachedDurationIndex = 0, this.maxAllowedAuctions = 30, this._pileSizes.set(enums.FUTItemPile.PURCHASED, 5), this._pileSizes.set(enums.FUTItemPile.TRANSFER, 30), this._pileSizes.set(enums.FUTItemPile.INBOX, 30) | |
| } | |
| var t = new FUTHashTable({}); | |
| return ItemDomainRepository.prototype.reset = function reset() { | |
| this._unassigned.reset(), this._unassignedCacheTimestamp = 0, this._transfer.reset(), this._transferCacheTimestamp = 0, this._inbox.reset(), this._inboxCacheTimestamp = 0, this._club.reset() | |
| }, ItemDomainRepository.prototype.setDirty = function setDirty(t) { | |
| if (utils.JS.isValid(t)) switch (t) { | |
| case enums.FUTItemPile.PURCHASED: | |
| this._unassignedCacheTimestamp = 0; | |
| break; | |
| case enums.FUTItemPile.TRANSFER: | |
| this._transferCacheTimestamp = 0; | |
| break; | |
| case enums.FUTItemPile.INBOX: | |
| this._inboxCacheTimestamp = 0 | |
| } else this._unassignedCacheTimestamp = 0, this._transferCacheTimestamp = 0, this._inboxCacheTimestamp = 0 | |
| }, ItemDomainRepository.prototype.setPileSize = function setPileSize(t, size) { | |
| this._pileSizes.set(t, size) | |
| }, ItemDomainRepository.prototype.getPileSize = function getPileSize(t) { | |
| return utils.Debug.Assert(this._pileSizes.has(t), "[ItemDomainRepository::getPileSize] Unsupported pile requested."), this._pileSizes.get(t) || 0 | |
| }, ItemDomainRepository.prototype.isPileFull = function isPileFull(t) { | |
| var i = 0, | |
| s = this._pileSizes.has(t) ? this._pileSizes.get(t) : 0; | |
| switch (t) { | |
| case enums.FUTItemPile.PURCHASED: | |
| i = this._unassigned.length; | |
| break; | |
| case enums.FUTItemPile.TRANSFER: | |
| i = this._transfer.length; | |
| break; | |
| case enums.FUTItemPile.INBOX: | |
| i = this._inbox.length; | |
| break; | |
| case enums.FUTItemPile.CLUB: | |
| return !1 | |
| } | |
| return i >= s | |
| }, ItemDomainRepository.prototype.numItemsInCache = function numItemsInCache(t) { | |
| switch (t) { | |
| case enums.FUTItemPile.PURCHASED: | |
| return this._unassigned.length; | |
| case enums.FUTItemPile.TRANSFER: | |
| return this._transfer.length; | |
| case enums.FUTItemPile.INBOX: | |
| return this._inbox.length; | |
| default: | |
| return utils.Debug.Assert(!1, "Unsupported item pile: " + t), 0 | |
| } | |
| }, ItemDomainRepository.prototype.hasStaticData = function hasStaticData() { | |
| return t.length > 0 | |
| }, ItemDomainRepository.prototype.setStaticData = function setStaticData(data) { | |
| t.clear(), data.forEach(function(d) { | |
| var i = new transferobjects.StaticPlayerData(d); | |
| t.set(i.id, i) | |
| }) | |
| }, ItemDomainRepository.prototype.getStaticDataByDefId = function getStaticDataByDefId(i) { | |
| return t.get(i) | |
| }, ItemDomainRepository.prototype.getStaticData = function getStaticData() { | |
| return t.values() | |
| }, ItemDomainRepository.prototype.getItemsById = function getItemsById(t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemDomainResponse; | |
| t = Array.isArray(t) ? t : [t]; | |
| var o = new communication.ItemDelegate(t); | |
| return o.addListener(communication.BaseDelegate.SUCCESS, this, function _onGetItemDataSuccess(sender, response) { | |
| sender.clearListenersByScope(this), s.success = !0, s.items = response, i.notify(s) | |
| }), o.addListener(communication.BaseDelegate.FAIL, this, function _onGetItemDataFail(sender, error) { | |
| sender.clearListenersByScope(this), s.error = error, i.notify(s) | |
| }), o.useClickShield(!0), o.send(), i | |
| }, ItemDomainRepository.prototype.getWatchedItems = function getWatchedItems() { | |
| var event = new FUTObservable, | |
| t = new transferobjects.ItemDomainResponse; | |
| if (Date.now() < this._inboxCacheTimestamp + 6e4) return t.success = !0, t.items = this._inbox.values(), event.notify(t), event; | |
| var i = new communication.WatchListDelegate; | |
| return i.addListener(communication.BaseDelegate.SUCCESS, this, function _onGetWatchListSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var i = this.setWatchedItemsFromPayload(response); | |
| t.success = !0, t.items = i, event.notify(t) | |
| }), | |
| i.addListener(communication.BaseDelegate.FAIL, this, function _onGetWatchListFail(sender, error) { | |
| sender.clearListenersByScope(this), error.getCode() === enums.HTTPStatusCode.SERVICE_IS_DISABLED && gSettingsModel.disableService(models.SettingsModel.TRADING_ENABLED), t.error = error, event.notify(t) | |
| }), i.useClickShield(!0), i.send(), event | |
| }, ItemDomainRepository.prototype.setWatchedItemsFromPayload = function setWatchedItemsFromPayload(response) { | |
| this._inbox.clear(), this._inboxCacheTimestamp = Date.now(); | |
| var t = factories.Item.generateItemsFromAuctionData(response.auctionInfo || [], response.duplicateItemIdList || []); | |
| return t.forEach(function(item) { | |
| this._inbox.set(item.id, item) | |
| }, this), this._inbox.endOfList = !0, t | |
| }, ItemDomainRepository.prototype.getTransferItems = function getTransferItems() { | |
| var event = new FUTObservable, | |
| t = new transferobjects.ItemDomainResponse; | |
| if (Date.now() < this._transferCacheTimestamp + 6e4) return t.success = !0, t.items = this._transfer.values(), event.notify(t), event; | |
| var i = new communication.TradePileDelegate; | |
| return i.useClickShield(!0), i.setImportant(!0), i.addListener(communication.BaseDelegate.SUCCESS, this, function _onGetTradePileSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var i = this.setTransferItemsFromPayload(response); | |
| t.success = !0, t.items = i, event.notify(t) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onGetTradePileFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| t.error = error, event.notify(t) | |
| }) | |
| }), i.send(), event | |
| }, ItemDomainRepository.prototype.setTransferItemsFromPayload = function setTransferItemsFromPayload(response) { | |
| this._transfer.clear(), this._transferCacheTimestamp = Date.now(); | |
| var t = factories.Item.generateItemsFromAuctionData(response.auctionInfo || [], response.duplicateItemIdList || []); | |
| return t.forEach(function(item) { | |
| this._transfer.set(item.id, item) | |
| }, this), this._transfer.endOfList = !0, t | |
| }, ItemDomainRepository.prototype.getUnassignedItems = function getUnassignedItems() { | |
| var event = new FUTObservable, | |
| t = new transferobjects.ItemDomainResponse; | |
| if (Date.now() < this._unassignedCacheTimestamp + 6e4) return t.success = !0, t.items = this._unassigned.values(), event.notify(t), event; | |
| var i = new communication.UnassignedItemsDelegate; | |
| return i.useClickShield(!0), i.setImportant(!0), i.addListener(communication.BaseDelegate.SUCCESS, this, function _onGetUnassignedSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var i = this.setUnassignedItemsFromPayload(response); | |
| t.success = !0, t.items = i, event.notify(t) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onGetUnassignedFail(sender, error) { | |
| sender.clearListenersByScope(this), t.error = error, event.notify(t) | |
| }), i.send(), event | |
| }, ItemDomainRepository.prototype.setUnassignedItemsFromPayload = function setUnassignedItemsFromPayload(response) { | |
| this._unassigned.clear(), this._unassignedCacheTimestamp = Date.now(); | |
| var t = factories.Item.generateItemsFromItemData(response.itemData, response.duplicateItemIdList); | |
| return t.forEach(function(item) { | |
| this._unassigned.set(item.id, item) | |
| }, this), this._unassigned.endOfList = !0, t | |
| }, ItemDomainRepository.prototype.setActiveItem = function setActiveItem(item) { | |
| this._club.setActiveItem(item) | |
| }, ItemDomainRepository.prototype.getActiveItems = function getActiveItems(state) { | |
| return this._club.getActiveItems(state) | |
| }, ItemDomainRepository.prototype.getClubItems = function getClubItems(t) { | |
| var event = new FUTObservable; | |
| return this._club.search(t).observe(this, function _onClubSearchComplete(t, data) { | |
| t.unobserve(this), event.notify(data) | |
| }), event | |
| }, ItemDomainRepository.prototype.getConceptItems = function getConceptItems(t) { | |
| var event = new FUTObservable, | |
| i = new transferobjects.ItemDomainResponse, | |
| s = new communication.DreamSearchDelegate(t, t.offset, t.count); | |
| return s.addListener(communication.BaseDelegate.SUCCESS, this, function _onConceptSearchSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var s = factories.Item.generateItemsFromItemData(response.itemData); | |
| i.success = !0, i.items = s, i.retrievedAll = s.length <= t.count - 1, event.notify(i) | |
| }), | |
| s.addListener(communication.BaseDelegate.FAIL, this, function _onConceptSearchFail(sender, error) { | |
| sender.clearListenersByScope(this), i.error = error, event.notify(i) | |
| }), s.useClickShield(!0), s.send(), event | |
| }, ItemDomainRepository.prototype.add = function add(t) { | |
| function _add(item) { | |
| var t = item.getAuctionData(); | |
| if (t.watched && !t.tradeOwner) { | |
| if (this.isPileFull(enums.FUTItemPile.INBOX)) return; | |
| this._inbox.set(item.id, item) | |
| } else { | |
| if (this.isPileFull(item.pile)) return; | |
| switch (item.pile) { | |
| case enums.FUTItemPile.PURCHASED: | |
| this._unassigned.set(item.id, item); | |
| break; | |
| case enums.FUTItemPile.TRANSFER: | |
| this._transfer.set(item.id, item); | |
| break; | |
| case enums.FUTItemPile.INBOX: | |
| this._inbox.set(item.id, item); | |
| break; | |
| case enums.FUTItemPile.CLUB: | |
| this._club.add(item) | |
| } | |
| } | |
| i.push(item) | |
| } | |
| var i = []; | |
| return Array.isArray(t) ? t.forEach(_add, this) : _add.call(this, t), i | |
| }, ItemDomainRepository.prototype.remove = function remove(t) { | |
| function _remove(item) { | |
| var t = item.getAuctionData(); | |
| if (!t.watched || t.tradeOwner) switch (item.pile) { | |
| case enums.FUTItemPile.PURCHASED: | |
| this._unassigned.remove(item.id); | |
| break; | |
| case enums.FUTItemPile.TRANSFER: | |
| this._transfer.remove(item.id); | |
| break; | |
| case enums.FUTItemPile.INBOX: | |
| this._inbox.remove(item.id); | |
| break; | |
| case enums.FUTItemPile.CLUB: | |
| this._club.remove(item) | |
| } else this._inbox.remove(item.id) | |
| } | |
| Array.isArray(t) ? t.forEach(_remove, this) : _remove.call(this, t) | |
| }, ItemDomainRepository.prototype.update = function update(t) { | |
| function _update(item) { | |
| switch (item.pile) { | |
| case enums.FUTItemPile.CLUB: | |
| this._club.update(item); | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "ItemDomainRepository::update. This pile does not support updating items.") | |
| } | |
| } | |
| Array.isArray(t) ? t.forEach(_update, this) : _update.call(this, t) | |
| }, new ItemDomainRepository | |
| }(), communication.ApplyConsumableDelegate = function(id, t) { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "item/resource/" + id.toString(), models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setData({ | |
| apply: t.map(function(itemId) { | |
| return { | |
| id: itemId | |
| } | |
| }) | |
| }) | |
| }, utils.JS.inherits(communication.ApplyConsumableDelegate, communication.BaseFUTDelegate), communication.AuctionInfoDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this); | |
| var i = t.reduce(function(t, item) { | |
| var i = item.getAuctionData(); | |
| return i.isValid() && (i.isUpdating = !0, t.push(i.tradeId)), t | |
| }, []); | |
| utils.Debug.Assert(i.length > 0, "[communication.AuctionInfoDelegate] No valid auctions to retrieve info for."), this.setCache(!1), this.setURLVariables({ | |
| tradeIds: i.join(",") | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "trade/status", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.AuctionInfoDelegate, communication.BaseFUTDelegate), communication.AuctionRelistDelegate = function() { | |
| communication.BaseFUTDelegate.call(this) | |
| }, utils.JS.inherits(communication.AuctionRelistDelegate, communication.BaseFUTDelegate), communication.AuctionRelistDelegate.prototype.execute = function() { | |
| var url = communication.BaseFUTDelegate.REQUEST_ROOT + "auctionhouse/relist"; | |
| this.setRequest(url, models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.AuctionRelistDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.FORBIDDEN: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.list.forbidden.title", "popup.error.relistall.forbidden.message"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this._networkError.isCodeValid() || (this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.relistall.title", "popup.error.relistall")), this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.ConsumeUnlockableDelegate = function(itemId) { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "item/" + itemId, models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setData({ | |
| apply: [] | |
| }) | |
| }, utils.JS.inherits(communication.ConsumeUnlockableDelegate, communication.BaseFUTDelegate), communication.ListItemDelegate = function(data) { | |
| communication.BaseFUTDelegate.call(this); | |
| var t = { | |
| itemData: { | |
| id: data.itemId | |
| }, | |
| startingBid: data.startingBid, | |
| duration: data.duration | |
| }; | |
| 0 !== data.buyNowPrice && (t.buyNowPrice = data.buyNowPrice), this.setData(t), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "auctionhouse", models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this._urlVariables.sku_a = "FFT18" | |
| }, utils.JS.inherits(communication.ListItemDelegate, communication.BaseFUTDelegate), communication.ListItemDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.FORBIDDEN: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.list.forbidden.title", "popup.error.list.forbidden.message"); | |
| break; | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.list.PermissionDeniedTitle", "popup.error.list.PermissionDenied"); | |
| break; | |
| case enums.NetworkError.STATE_INVALID: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.list.InvalidStateTitle", "popup.error.list.InvalidState"); | |
| break; | |
| case enums.NetworkError.DESTINATION_FULL: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.SellItemTradePileFullTitle", "popup.error.tradetoken.SellItemTradePileFull"); | |
| break; | |
| case enums.NetworkError.CARD_IN_TRADE: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.ItemInTradeOfferTitle", "popup.error.tradetoken.ItemInTradeOffer"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.MarketDataDelegate = function(t, i) { | |
| communication.BaseFUTDelegate.call(this); | |
| var s = {}, | |
| o = t.map(function(item) { | |
| return i ? item.id : item.getDefId() | |
| }); | |
| i ? s.itemIdList = o : s.defId = o, this.setURLVariables(s), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "marketdata/" + (i ? "item/" : "") + "pricelimits", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.MarketDataDelegate, communication.BaseFUTDelegate), communication.MoveItemDelegate = function(t, i, s) { | |
| communication.BaseFUTDelegate.call(this); | |
| var o; | |
| switch (i) { | |
| case enums.FUTItemPile.CLUB: | |
| o = "club"; | |
| break; | |
| case enums.FUTItemPile.TRANSFER: | |
| o = "trade"; | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "Unsupported destination pile when moving items. Will attempt to send to club..."), o = "club" | |
| } | |
| this.setData({ | |
| itemData: t.map(function(item) { | |
| var data = { | |
| id: s ? item.resourceId : item.id, | |
| pile: o | |
| }; | |
| if (!s) { | |
| var t = item.getAuctionData(); | |
| item.isDuplicate() && i === enums.FUTItemPile.CLUB && (data.swap = item.duplicateId), t && t.isWon() && t.isHighestBid() && (data.tradeId = t.tradeId) | |
| } | |
| return data | |
| }) | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + (s ? "item/resource" : "item"), models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.MoveItemDelegate, communication.BaseFUTDelegate), communication.MoveItemDelegate.prototype.onSuccess = function(response) { | |
| var t = response.itemData.length, | |
| errorCode = 0; | |
| if (0 !== t) { | |
| for (; t-- > 0;) { | |
| var i = response.itemData[t]; | |
| if (i.success) return void this.dispatch(communication.BaseDelegate.SUCCESS, response); | |
| (!utils.JS.isNumber(errorCode) || errorCode <= 0) && (errorCode = i.errorCode || 0) | |
| } | |
| this.onFail(errorCode) | |
| } else this.dispatch(communication.BaseDelegate.SUCCESS, response) | |
| }, communication.MoveItemDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.item.PermissionDeniedTitle", "popup.error.item.PermissionDenied"); | |
| break; | |
| case enums.NetworkError.STATE_INVALID: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.item.InvalidStateTitle", "popup.error.item.InvalidState"); | |
| break; | |
| case enums.NetworkError.DUPLICATE_ITEM_TYPE: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.item.DuplicatedItemTypeTitle", "popup.error.item.DuplicatedItemType"); | |
| break; | |
| case enums.NetworkError.DESTINATION_FULL: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.DestinationFullTitle", "popup.error.item.DestinationFull"); | |
| break; | |
| case enums.NetworkError.INVALID_DECK: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.InvalidDeckTitle", "popup.error.tradetoken.InvalidDeck"); | |
| break; | |
| case enums.NetworkError.CARD_IN_TRADE: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.tradetoken.ItemInTradeOfferTitle", "popup.error.tradetoken.ItemInTradeOffer"); | |
| break; | |
| case enums.NetworkError.NO_CARD_EXISTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.NoSuchCardTitle", "popup.error.NoSuchCard"); | |
| break; | |
| case enums.NetworkError.PLAYER_HAS_RED_CARD: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.move.PlayerHasRedCardTitle", "popup.error.move.PlayerHasRedCard"); | |
| break; | |
| case enums.NetworkError.REMOVE_WATCH_FAILURE: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.watchlist.RemoveWatchFailureTitle", "popup.error.watchlist.RemoveWatchFailure"); | |
| break; | |
| case enums.NetworkError.SWAP_ITEM_WITH_ITSELF: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.CantSwapItemWithItselfTitle", "popup.error.CantSwapItemWithItself"); | |
| break; | |
| case enums.NetworkError.USER_IS_HIGHEST_BIDDER: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.watchlist.UserIsHighestBidderTitle", "popup.error.watchlist.UserIsHighestBidder"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.RemoveSoldItemDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "trade/" + (t && t > 0 && "0" !== t ? t.toString() : "sold"), models.CommunicationModel.METHOD.DELETE, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.RemoveSoldItemDelegate, communication.BaseFUTDelegate), communication.UnWatchDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this); | |
| var i = t.map(function(t) { | |
| return t.tradeId | |
| }).join(","); | |
| this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "watchlist?tradeId=" + i, models.CommunicationModel.METHOD.DELETE, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.UnWatchDelegate, communication.BaseFUTDelegate), communication.UnWatchDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.unwatch.PermissionDeniedTitle", "popup.error.unwatch.PermissionDenied"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.WatchDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), | |
| this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "watchlist", models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON), this.setData({ | |
| auctionInfo: t.map(function(t) { | |
| return { | |
| id: t.tradeId | |
| } | |
| }) | |
| }) | |
| }, utils.JS.inherits(communication.WatchDelegate, communication.BaseFUTDelegate), communication.WatchDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.watch.PermissionDeniedTitle", "popup.error.watch.PermissionDenied"); | |
| break; | |
| case enums.NetworkError.CONFLICT: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.watch.ItemNoLongerAvailableTitle", "popup.error.watch.ItemNoLongerAvailable"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.ItemServiceResponse = function(data) { | |
| var t = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "success", { | |
| set: t.set.bind(t), | |
| get: t.get.bind(t) | |
| }), this.success = !!data && data.success, this.error = data ? data.error : null, this.itemIds = data ? data.itemIds : [], this.clubDuplicates = data ? data.clubDuplicates : [] | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.ServiceResponse = function ServiceResponseDTO() { | |
| this.success = !1, this.status = enums.HTTPStatusCode.UNKNOWN, this.data = null | |
| }, NamespaceManager.Register("services"), services.Item = function() { | |
| function ItemService() {} | |
| return ItemService.prototype.move = function move(t, i) { | |
| function _runMoveDelegate() { | |
| if (0 === h.length && 0 === p.length) return s.notify(o), s; | |
| var t = []; | |
| h.length > 0 && t.push(new communication.MoveItemDelegate(h, i, !1)), p.length > 0 && t.push(new communication.MoveItemDelegate(p, i, !0)); | |
| var l = new utils.DelegateChain(t, !0); | |
| l.addListener(utils.DelegateChain.SUCCESS, this, _onMoveSuccess), l.addListener(utils.DelegateChain.FAIL, this, _onMoveFail), l.execute() | |
| } | |
| function _onMoveSuccess(sender, t, m) { | |
| function _cleanupItem(item) { | |
| if (this._removeItems(item), o.itemIds.indexOf(item.id) >= 0) { | |
| _ || i !== enums.FUTItemPile.CLUB && item.pile !== enums.FUTItemPile.CLUB || (_ = !0); | |
| var t = utils.JS.find(u, function(d) { | |
| return item.duplicateId === d.id | |
| }); | |
| t && (o.clubDuplicates.push(t), repositories.Item.add(t)), item.clearAuction(), i === enums.FUTItemPile.CLUB ? this._replaceItemInConceptSquads(item) : item.pile === enums.FUTItemPile.CLUB && this._removeItemsFromSquads(item), item.pile = i, repositories.Item.add(item) | |
| } else p.length > 0 && i === enums.FUTItemPile.TRANSFER && (_ = !0) | |
| } | |
| sender.clearListenersByScope(this); | |
| var _ = !1; | |
| o.itemIds = m.reduce(function(t, response) { | |
| return response.itemData.forEach(function(i) { | |
| i.success && t.push(i.id) | |
| }), t | |
| }, []), h.forEach(_cleanupItem, this), p.forEach(_cleanupItem, this), _ && repositories.Item.setDirty(), l.forEach(function(data) { | |
| data.duplicates.forEach(function(duplicate) { | |
| duplicate.duplicateId = data.item | |
| }) | |
| }), o.success = !0, s.notify(o), getDefaultDispatcher().notify(enums.AppNotification.ITEM_MOVE, this, o) | |
| } | |
| function _onMoveFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| o.error = error, s.notify(o) | |
| }.bind(this)) | |
| } | |
| var s = new FUTObservable, | |
| o = new transferobjects.ItemServiceResponse, | |
| l = new FUTHashTable({}), | |
| u = [], | |
| h = [], | |
| p = []; | |
| if (Array.isArray(t) || (t = [t]), t.length < 1) return utils.Debug.Assert(!1, "[services.Item::move] Expected at least one item."), o.success = !0, s.notify(o), s; | |
| if (repositories.Item.isPileFull(i)) { | |
| var m = i === enums.FUTItemPile.TRANSFER ? utils.PopupManager.Alerts.TRANSFER_LIST_FULL : utils.PopupManager.Alerts.DESTINATION_FULL; | |
| return utils.PopupManager.ShowAlert(m, function() { | |
| s.notify(o) | |
| }), s | |
| } | |
| if (t.forEach(function(item) { | |
| if (i !== enums.FUTItemPile.TRANSFER || !item.untradeable) { | |
| if (i === enums.FUTItemPile.CLUB && !item.isConsumable()) { | |
| if (l.has(item.resourceId)) return void l.get(item.resourceId).duplicates.push(item); | |
| l.set(item.resourceId, { | |
| item: item.id, | |
| duplicates: [] | |
| }) | |
| } | |
| item.isClubConsumable() ? p.push(item) : h.push(item) | |
| } | |
| }), i === enums.FUTItemPile.CLUB) { | |
| var _ = "", | |
| length = h.length, | |
| g = h.reduce(function(t, item) { | |
| return item.isDuplicate() && t.push(item.duplicateId), t | |
| }, []); | |
| g.length > 0 ? repositories.Item.getItemsById(g).observe(this, function(t, data) { | |
| t.unobserve(this), data.success ? (data.items.forEach(function(d) { | |
| for (var t = length, i = []; t-- > 0;) { | |
| var s = h[t]; | |
| s.duplicateId === d.id && (d.untradeable || d.isInjured() || d.isSuspended() ? 1 === length && (_ = d.untradeable ? "popup.error.tradepile.untradeableduplicate" : "popup.error.item.InjuredOrSuspended") : (d.duplicateId = s.id, d.pile = s.pile, u.push(d), i.push(s))) | |
| } | |
| h = i | |
| }), utils.JS.isEmpty(_) ? _runMoveDelegate.call(this) : (services.Notification.queue([gLocalization.lText(_), enums.UINotificationType.NEGATIVE]), s.notify(o))) : (services.Notification.queue([gLocalization.lText("popup.error.activesquad.SwapPlayerFailed"), enums.UINotificationType.NEGATIVE]), o.error = data.error, s.notify(o)) | |
| }) : _runMoveDelegate.call(this) | |
| } else _runMoveDelegate.call(this); | |
| return s | |
| }, ItemService.prototype.relistExpiredAuctions = function relistExpiredAuctions() { | |
| function _onRelistAllFail(sender, error) { | |
| sender.clearListenersByScope(this); | |
| var s = function() { | |
| error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), i.error = error, t.notify(i) | |
| }.bind(this); | |
| NetworkErrorManager.handle(error, !1, s) | |
| } | |
| var t = new FUTObservable, | |
| i = new transferobjects.ItemServiceResponse, | |
| s = new communication.AuctionRelistDelegate; | |
| return s.addListener(communication.BaseDelegate.SUCCESS, this, function _onRelistAllSuccess(sender) { | |
| sender.clearListenersByScope(this), repositories.Item.setDirty(enums.FUTItemPile.TRANSFER), i.success = !0, t.notify(i) | |
| }), s.addListener(communication.BaseDelegate.FAIL, this, _onRelistAllFail), s.addListener(communication.BaseDelegate.CANCEL, this, _onRelistAllFail), s.execute(), t | |
| }, ItemService.prototype.clearSoldItems = function clearSoldItems(item) { | |
| function _onClearSoldSuccess(sender) { | |
| sender.clearListenersByScope(this), i.success = !0, item ? (this._removeItems(item), i.itemIds = [item.id], t.notify(i), getDefaultDispatcher().notify(enums.AppNotification.ITEM_CLEARSOLD, this, i)) : (repositories.Item.setDirty(enums.FUTItemPile.TRANSFER), repositories.Item.getTransferItems().observe(this, function(o, data) { | |
| o.unobserve(this); | |
| var l = s.reduce(function(t, item) { | |
| var i, length = data.items.length; | |
| for (i = 0; i < length; i++) | |
| if (data.items[i].id === item.id) return t; | |
| return t.push(item), t | |
| }, []); | |
| i.itemIds = l.map(function(item) { | |
| return item.id | |
| }), t.notify(i), getDefaultDispatcher().notify(enums.AppNotification.ITEM_CLEARSOLD, this, i) | |
| })) | |
| } | |
| function _onClearSoldFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| i.error = error, t.notify(i) | |
| }.bind(this)) | |
| } | |
| var t = new FUTObservable, | |
| i = new transferobjects.ItemServiceResponse, | |
| s = []; | |
| if (item) { | |
| utils.Debug.Assert(item.getAuctionData().isValid(), "Expected a valid auction."); | |
| var o = new communication.RemoveSoldItemDelegate(item.getAuctionData().tradeId); | |
| o.addListener(communication.BaseDelegate.SUCCESS, this, _onClearSoldSuccess), o.addListener(communication.BaseDelegate.FAIL, this, _onClearSoldFail), o.useClickShield(!0), o.send() | |
| } else repositories.Item.getTransferItems().observe(this, function(t, data) { | |
| t.unobserve(this), s = data.items; | |
| var i = new communication.RemoveSoldItemDelegate; | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, _onClearSoldSuccess), i.addListener(communication.BaseDelegate.FAIL, this, _onClearSoldFail), i.useClickShield(!0), i.send() | |
| }); | |
| return t | |
| }, ItemService.prototype.discard = function discard(t) { | |
| function _onDiscardComplete(s, data) { | |
| s.unobserve(this); | |
| var o = new transferobjects.ServiceResponse; | |
| if (o.success = data.success, o.status = data.status, o.data = { | |
| itemIds: data.response.itemIds || [] | |
| }, i.notify(o), data.success) { | |
| data.response.totalCredits && gUserModel.setCredits(data.response.totalCredits, !0); | |
| var l = []; | |
| Array.isArray(t) ? l = t.filter(function(item) { | |
| return item.pile === enums.FUTItemPile.CLUB | |
| }) : t.pile === enums.FUTItemPile.CLUB && l.push(t), | |
| l.length > 0 && this._removeItemsFromSquads(l), this._removeItems(t), getDefaultDispatcher().notify(enums.AppNotification.ITEM_DISCARD, this, o) | |
| } | |
| } | |
| var i = new FUTObservable, | |
| s = services.Authentication; | |
| return Array.isArray(t) && (t = t.filter(function(item) { | |
| return item.isDiscardable() | |
| })), !Array.isArray(t) && t.isClubConsumable() ? accessobjects.Item.discardByResourceId(s, t).observe(this, _onDiscardComplete) : accessobjects.Item.discardByItemId(s, t).observe(this, _onDiscardComplete), i | |
| }, ItemService.prototype.combineLoans = function combineLoans(item) { | |
| var t = new FUTObservable, | |
| i = new transferobjects.ServiceResponse, | |
| s = services.Authentication; | |
| return item.isDuplicateLoanPlayer() ? accessobjects.Item.discardByItemId(s, item).observe(this, function _onCombineComplete(s, data) { | |
| s.unobserve(this), i.success = data.success, i.status = data.status, i.data = { | |
| itemIds: data.response.itemIds || [] | |
| }, t.notify(i), data.success && (repositories.Item.getItemsById(item.duplicateId).observe(this, function(t, data) { | |
| data.items.length > 0 && repositories.Item.update(data.items[0]) | |
| }), this._removeItems(item), getDefaultDispatcher().notify(enums.AppNotification.ITEM_DISCARD, this, i)) | |
| }) : (utils.Debug.Assert(!1, "Attempted to combine loans from a an item that isn't a duplicate loaner."), i.success = !1, i.status = enums.HTTPStatusCode.BAD_REQUEST, t.notify(i)), t | |
| }, ItemService.prototype.redeem = function redeem(item) { | |
| function _onRedeemFail(sender, error) { | |
| sender.clearListenersByScope(this); | |
| var s = function() { | |
| i.error = error, t.notify(i) | |
| }.bind(this); | |
| NetworkErrorManager.handle(error, !1, s) | |
| } | |
| var t = new FUTObservable, | |
| i = new transferobjects.ItemServiceResponse; | |
| if (!item.isMiscItem()) return t.notify(i), t; | |
| var s = new communication.ConsumeUnlockableDelegate(item.id); | |
| return s.useClickShield(!0), s.addListener(communication.BaseDelegate.SUCCESS, this, function _onRedeemSuccess(sender, response) { | |
| sender.clearListenersByScope(this), services.Objectives.handlePayload(response.dynamicObjectivesUpdates), this._removeItems(item), item.isFreeCoins() ? (services.Notification.queue([gLocalization.lText("notification.coins.added"), enums.UINotificationType.POSITIVE]), gUserModel.updateCredits()) : item.isFreePack() ? (services.Notification.queue([gLocalization.lText("notification.pack.added"), enums.UINotificationType.POSITIVE]), repositories.User.getCurrent().incrementNumUnopenedPacks()) : item.isDraftToken() && (services.Notification.queue([gLocalization.lText("notification.drafttoken.added"), enums.UINotificationType.POSITIVE]), gUserModel.updateCredits()), i.success = !0, i.itemIds.push(item.id), t.notify(i), getDefaultDispatcher().notify(enums.AppNotification.ITEM_REDEEM, this, i) | |
| }), s.addListener(communication.BaseDelegate.FAIL, this, _onRedeemFail), s.addListener(communication.BaseDelegate.CANCEL, this, _onRedeemFail), s.send(), t | |
| }, ItemService.prototype.list = function list(item, t, i, duration) { | |
| function _onListSuccess(sender, response) { | |
| sender.clearListenersByScope(this), item.isStack() || (item.getAuctionData().tradeId = utils.JS.isString(response.idStr) ? response.idStr : response.id.toString(), this.getAuctionInfo(item).observe(this, function(t, data) { | |
| t.unobserve(this), o.success = !0, o.itemIds.push(item.id), s.notify(o), getDefaultDispatcher().notify(enums.AppNotification.ITEM_LIST, this, o) | |
| })) | |
| } | |
| function _onListFail(sender, error) { | |
| sender.clearListenersByScope(this); | |
| var t = function() { | |
| error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), o.error = error, s.notify(o) | |
| }.bind(this); | |
| NetworkErrorManager.handle(error, !1, t) | |
| } | |
| function _runListDelegate(id) { | |
| var s = new communication.ListItemDelegate({ | |
| itemId: id, | |
| startingBid: t, | |
| buyNowPrice: i, | |
| duration: duration | |
| }); | |
| s.addListener(communication.BaseDelegate.SUCCESS, this, _onListSuccess), s.addListener(communication.BaseDelegate.FAIL, this, _onListFail), s.useClickShield(!0), s.send() | |
| } | |
| var s = new FUTObservable, | |
| o = new transferobjects.ItemServiceResponse; | |
| return item.pile !== enums.FUTItemPile.TRANSFER ? this.move(item, enums.FUTItemPile.TRANSFER).observe(this, function(t, data) { | |
| t.unobserve(this), | |
| data.success && data.itemIds.length > 0 ? _runListDelegate.call(this, data.itemIds[0]) : (o.error = data.error, s.notify(o)) | |
| }) : _runListDelegate.call(this, item.id), s | |
| }, ItemService.prototype.getMarketData = function getMarketData(t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse, | |
| o = [], | |
| l = !0; | |
| if (0 === (o = Array.isArray(t) ? t.reduce(function(t, item) { | |
| var i = item.getAuctionData(); | |
| return (!i.isValid() || i.isClosedTrade() && !i.tradeOwner || i.isExpired() && i.tradeOwner) && item.isValid() && !item.concept && !item.untradeable && t.push(item), t | |
| }, []) : [t]).length) return s.success = !0, i.notify(s), i; | |
| var u = new communication.MarketDataDelegate(o, l); | |
| return u.addListener(communication.BaseDelegate.SUCCESS, this, function _onMarketDataSuccess(sender, response) { | |
| sender.clearListenersByScope(this), gSettingsModel.enableService(models.SettingsModel.MARKET_DATA_ENABLED), s.success = !0, s.itemIds = o.map(function(item) { | |
| return item.id | |
| }), response.forEach(function(data) { | |
| var item = utils.JS.find(o, function(t, index) { | |
| return l ? t.id === data.itemId : t.resourceId === data.defId | |
| }); | |
| item && item.setItemPriceLimits(new transferobjects.ItemPriceLimits(data.maxPrice, data.minPrice)) | |
| }), i.notify(s) | |
| }), u.addListener(communication.BaseDelegate.FAIL, this, function _onMarketDataFail(sender, error) { | |
| sender.clearListenersByScope(this); | |
| var t = function() { | |
| enums.NetworkError.SERVICE_UNAVAILABLE_ERROR === error.getCode() && gSettingsModel.isMarketDataEnabled() && gSettingsModel.disableService(models.SettingsModel.MARKET_DATA_ENABLED), s.error = error, i.notify(s) | |
| }.bind(this); | |
| NetworkErrorManager.handle(error, !1, t) | |
| }), u.useClickShield(!0), u.send(), i | |
| }, ItemService.prototype.getAuctionInfo = function getAuctionInfo(t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse, | |
| o = Array.isArray(t) ? t : [t]; | |
| if (0 === (o = o.filter(function(item) { | |
| return item.getAuctionData().isValid() | |
| })).length) return i.notify(s), i; | |
| var l = new communication.AuctionInfoDelegate(o); | |
| return l.addListener(communication.BaseDelegate.SUCCESS, this, function _onGetAuctionInfoSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var t = response.auctionInfo.map(function(t) { | |
| var i = new entities.Auction; | |
| return i.parseAuctionDataObject(t), i | |
| }); | |
| Array.isArray(response.auctionInfo) && response.auctionInfo.forEach(function(t) { | |
| var i = t.tradeId, | |
| itemId = t.itemData.id; | |
| if (0 !== itemId) { | |
| var s = "Trade" + i, | |
| item = utils.JS.find(o, function(result) { | |
| return result.id === s | |
| }); | |
| utils.JS.isValid(item) && (item.id = itemId) | |
| } | |
| }), utils.JS.isNumber(response.credits) && response.credits !== gUserModel.getCredits() && gUserModel.setCredits(response.credits, !0), o.forEach(function(item) { | |
| if (response.duplicateItemIdList) { | |
| var duplicate = utils.JS.find(response.duplicateItemIdList, function(t) { | |
| return t.itemId === item.id | |
| }); | |
| duplicate && (item.duplicateId = duplicate.duplicateItemId) | |
| } | |
| var i = item.getAuctionData(), | |
| s = utils.JS.find(t, function(result) { | |
| return result.compareTo(i) | |
| }); | |
| s && (i.update(s), i.isClosedTrade() && i.isHighestBid() ? item.pile = enums.FUTItemPile.INBOX : i.isBought() && (item.pile = enums.FUTItemPile.PURCHASED)) | |
| }), s.success = !0, s.itemIds = o.map(function(item) { | |
| return item.id | |
| }), i.notify(s) | |
| }), l.addListener(communication.BaseDelegate.FAIL, this, function _onGetAuctionInfoFail(sender, error) { | |
| sender.clearListenersByScope(this); | |
| var t = function() { | |
| error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), s.error = error, i.notify(s) | |
| }.bind(this); | |
| NetworkErrorManager.handle(error, !1, t) | |
| }), l.send(), i | |
| }, ItemService.prototype.applyTo = function applyTo(t, i) { | |
| function _onApplySuccess(sender, data) { | |
| sender.clearListenersByScope(this), services.Objectives.handlePayload(data.dynamicObjectivesUpdates), data.itemData.forEach(function(item) { | |
| for (var t = i.length; t-- > 0;) { | |
| var s = i[t]; | |
| if (s.id === item.id) { | |
| if (s.contract = item.contract, s.leagueId = item.leagueId, s.isPlayer()) { | |
| s.fitness = item.fitness, s.injuryGames = item.injuryGames, s.injuryType = item.injuryType, s.playStyle = item.playStyle; | |
| var position = repositories.Squad.getPositionByUniqueName(item.preferredPosition); | |
| s.preferredPosition = position ? position.getId() : 0, | |
| item.trainingItem && s.setTrainingItem(factories.Item.createItem(item.trainingItem)) | |
| } | |
| repositories.Item.update(s), s.onDataUpdated.notify(s); | |
| break | |
| } | |
| } | |
| o.itemIds.push(item.id) | |
| }, this), this._removeItems(t), services.Notification.queue([gLocalization.lText("notification.item.appliedConsumable"), enums.UINotificationType.NEUTRAL]), o.success = !0, s.notify(o), getDefaultDispatcher().notify(enums.AppNotification.ITEM_APPLY, this, o) | |
| } | |
| function _onApplyFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !0, function() { | |
| services.Notification.queue([gLocalization.lText("notification.item.unableToApplyConsumable"), enums.UINotificationType.NEGATIVE]), o.error = error, s.notify(o) | |
| }.bind(this)) | |
| } | |
| function _performApply() { | |
| if (!((i = Array.isArray(i) ? i.filter(t.canApplyTo, t) : t.canApplyTo(i) ? [i] : []).length > 0)) return utils.Debug.Assert(!1, "Unable to apply item."), void s.notify(o); | |
| utils.Debug.Assert(t.isTeamFitness() || !t.isTeamFitness() && 1 === i.length, "Cannot apply single-use consumables to multiple items. Will only apply to one."), !t.isTeamFitness() && i.length > 1 && (i = i.slice(0, 1)); | |
| var l = new communication.ApplyConsumableDelegate(t.resourceId, i.map(function(item) { | |
| return item.id | |
| })); | |
| l.addListener(communication.BaseDelegate.SUCCESS, this, _onApplySuccess), l.addListener(communication.BaseDelegate.FAIL, this, _onApplyFail), l.useClickShield(!0), l.send() | |
| } | |
| var s = new FUTObservable, | |
| o = new transferobjects.ItemServiceResponse; | |
| return t.isClubConsumable() ? _performApply.call(this) : this.move(t, enums.FUTItemPile.CLUB).observe(this, function(t, data) { | |
| t.unobserve(this), data.success ? _performApply.call(this) : (services.Notification.queue([gLocalization.lText("notification.item.unableToApplyConsumable"), enums.UINotificationType.NEGATIVE]), o.error = data.error, s.notify(o)) | |
| }), s | |
| }, ItemService.prototype.target = function target(t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse, | |
| o = []; | |
| if (Array.isArray(t)) o = t.filter(function(item) { | |
| var t = item.getAuctionData(); | |
| return t.isValid() && !t.tradeOwner | |
| }); | |
| else { | |
| var l = t.getAuctionData(); | |
| l.isValid() && !l.tradeOwner && o.push(t) | |
| } | |
| if (0 === o.length) return utils.Debug.Assert(!1, "No valid auctions to watch."), i.notify(s), i; | |
| var u = new communication.WatchDelegate(o.map(function(item) { | |
| return item.getAuctionData() | |
| })); | |
| return u.addListener(communication.BaseDelegate.SUCCESS, this, function _onWatchSuccess(sender) { | |
| sender.clearListenersByScope(this), o.forEach(function(item) { | |
| item.getAuctionData().watched = !0, repositories.Item.add(item), s.itemIds.push(item.id) | |
| }), s.success = !0, i.notify(s), getDefaultDispatcher().notify(enums.AppNotification.ITEM_WATCH, this, s) | |
| }), u.addListener(communication.BaseDelegate.FAIL, this, function _onWatchFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !0, function() { | |
| error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), s.error = error, i.notify(s) | |
| }.bind(this)) | |
| }), u.useClickShield(!0), u.send(), i | |
| }, ItemService.prototype.untarget = function untarget(t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse, | |
| o = []; | |
| if (Array.isArray(t) ? o = t.filter(function(item) { | |
| return item.getAuctionData().watched | |
| }) : t.getAuctionData().watched && o.push(t), 0 === o.length) return utils.Debug.Assert(!1, "No watched auctions to unwatch."), i.notify(s), i; | |
| var l = new communication.UnWatchDelegate(o.map(function(item) { | |
| return item.getAuctionData() | |
| })); | |
| return l.addListener(communication.BaseDelegate.SUCCESS, this, function _onUnwatchSuccess(sender) { | |
| sender.clearListenersByScope(this), repositories.Item.setDirty(enums.FUTItemPile.INBOX), o.forEach(function(item) { | |
| this._removeItems(item), item.getAuctionData().watched = !1, s.itemIds.push(item.id) | |
| }, this), s.success = !0, i.notify(s), getDefaultDispatcher().notify(enums.AppNotification.ITEM_UNWATCH, this, s) | |
| }), l.addListener(communication.BaseDelegate.FAIL, this, function _onUnwatchFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !0, function() { | |
| error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), s.error = error, i.notify(s) | |
| }.bind(this)) | |
| }), l.useClickShield(!0), l.send(), i | |
| }, ItemService.prototype.activate = function activate(item, t) { | |
| function _onActivateComplete(t, data) { | |
| if (t.unobserve(this), s.success = data.success, s.error = data.error, data.success) services.Notification.queue([gLocalization.lText("notification.item.setAsActive"), enums.UINotificationType.NEUTRAL]), repositories.Item.setActiveItem(item), s.itemIds.push(item.id); | |
| else if (services.Notification.queue([gLocalization.lText("infopanel.label.makeActive"), enums.UINotificationType.NEGATIVE]), data.error) { | |
| if (data.error.getCode() !== enums.NetworkError.PERMISSION_DENIED) return void NetworkErrorManager.handle(data.error, !1, function() { | |
| i.notify(s) | |
| }); | |
| services.Notification.queue([gLocalization.lText("popup.error.NoSuchCardTitle"), enums.UINotificationType.NEGATIVE]) | |
| } | |
| i.notify(s), getDefaultDispatcher().notify(enums.AppNotification.ITEM_ACTIVATE, this, s) | |
| } | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse; | |
| return item.pile !== enums.FUTItemPile.CLUB ? this.move(item, enums.FUTItemPile.CLUB).observe(this, function(o, data) { | |
| o.unobserve(this), data.success ? item.activate(t).observe(this, _onActivateComplete) : (services.Notification.queue([gLocalization.lText("infopanel.label.makeActive"), enums.UINotificationType.NEGATIVE]), s.error = data.error, i.notify(s)) | |
| }) : item.activate(t).observe(this, _onActivateComplete), i | |
| }, ItemService.prototype.bid = function bid(item, t) { | |
| var i = new FUTObservable, | |
| s = new transferobjects.ItemServiceResponse, | |
| o = item.getAuctionData().watched; | |
| return item.bid(t).observe(this, function _onBidComplete(t, data) { | |
| t.unobserve(this), s.success = data.success, data.success ? (services.Objectives.handlePayload(data.dynamicObjectivesUpdates), o && item.getAuctionData().isBought() && repositories.Item.setDirty(enums.FUTItemPile.INBOX), s.itemIds = [item.id], repositories.Item.add(item), i.notify(s), getDefaultDispatcher().notify(enums.AppNotification.ITEM_BID, this, s)) : data.error ? (data.error.getCode() === enums.NetworkError.LOCKED_TRANSFER_MARKET && gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.BLACKLIST), s.error = data.error, i.notify(s)) : i.notify(s) | |
| }), i | |
| }, ItemService.prototype.getItemDataByDefId = function getItemDataByDefId(t) { | |
| var i = new FUTObservable, | |
| response = new transferobjects.ServiceResponse, | |
| s = services.Authentication; | |
| return accessobjects.Item.getItemDataByDefId(s, t).observe(this, function _onGetItemDataByDefIdComplete(t, s) { | |
| t.unobserve(this), response.success = s.success, response.status = s.status, response.data = { | |
| item: s.response.item | |
| }, i.notify(response) | |
| }), i | |
| }, ItemService.prototype._replaceItemInConceptSquads = function _replaceItemInConceptSquads(item) { | |
| item.isPlayer() && repositories.Squad.getSquads().observe(this, function(t, data) { | |
| var i = repositories.SBC.getCachedSets().reduce(function(t, set) { | |
| return set.challenges.length > 0 && set.challenges.forEach(function(i) { | |
| t.push(i.squad) | |
| }, this), t | |
| }, []); | |
| data.concat(i).forEach(function(t) { | |
| var index = t.containsDreamItem(item); | |
| index >= 0 && t.addItemToSlot(index, item) | |
| }, this) | |
| }) | |
| }, ItemService.prototype._removeItemsFromSquads = function _removeItemsFromSquads(t) { | |
| function _removeItemFromSquad(t, item) { | |
| (item.isPlayer() || item.isManager()) && t.forEach(function(t) { | |
| t.containsItem(item, !0) && t.removeItem(item) | |
| }, this) | |
| } | |
| repositories.Squad.getSquads().observe(this, function(i, data) { | |
| Array.isArray(t) ? t.forEach(function(t) { | |
| _removeItemFromSquad.call(this, data, t) | |
| }, this) : _removeItemFromSquad.call(this, data, t) | |
| }) | |
| }, ItemService.prototype._removeItems = function _removeItems(t) { | |
| function _checkForConsumables(item) { | |
| item.isClubConsumable() && item.decreaseStackCount() | |
| } | |
| Array.isArray(t) ? t.forEach(function(t) { | |
| _checkForConsumables.call(this, t) | |
| }, this) : _checkForConsumables.call(this, t), repositories.Item.remove(t) | |
| }, new ItemService | |
| }(), NamespaceManager.Register("transferobjects"), transferobjects.Notification = function() { | |
| return function NotificationDTO(message, type) { | |
| this.message = message, | |
| Object.defineProperty(this, "message", { | |
| writable: !1 | |
| }), this.type = type, Object.defineProperty(this, "type", { | |
| writable: !1 | |
| }) | |
| } | |
| }(), NamespaceManager.Register("services"), services.Notification = function() { | |
| function pushNotification() { | |
| if (this._queue.length > 0) { | |
| t || (t = setInterval(pushNotification.bind(this), 2e3)); | |
| var i = this._queue.shift(); | |
| this.display.notify(i) | |
| } else 0 === this._queue.length && (t = clearInterval(t)) | |
| } | |
| function NotificationService() { | |
| this.display = new FUTObservable, Object.freeze(this.display), this._queue = [], Object.defineProperty(this, "_queue", { | |
| writable: !1, | |
| enumerable: !1 | |
| }) | |
| } | |
| var t; | |
| return NotificationService.prototype.clearAll = function clearAll() { | |
| t = clearInterval(t), this._queue.length = 0 | |
| }, NotificationService.prototype.queue = function queue(i) { | |
| Array.prototype.slice.call(arguments).forEach(function(data) { | |
| if (Array.isArray(data)) { | |
| var t = new transferobjects.Notification(data[0], data[1]); | |
| this._queue.push(t) | |
| } else data instanceof transferobjects.Notification && this._queue.push(data) | |
| }, this), t || pushNotification.call(this) | |
| }, new NotificationService | |
| }(), NamespaceManager.Register("repositories"), repositories.Objectives = function ObjectivesRepository() { | |
| this._objectives = new FUTHashTable({}), Object.defineProperty(this, "_objectives", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this._cacheExpiration = 0, Object.defineProperty(this, "_cacheExpiration", { | |
| writable: !0, | |
| enumerable: !0 | |
| }) | |
| }, repositories.Objectives.prototype.reset = function reset() { | |
| this._objectives.clear(), this._cacheExpiration = 0 | |
| }, repositories.Objectives.prototype.setCacheTimestamp = function setCacheTimestamp(timestamp) { | |
| this._cacheExpiration = timestamp | |
| }, repositories.Objectives.prototype.isDirty = function isDirty() { | |
| return 0 === this._cacheExpiration || this._cacheExpiration < Math.round(Date.now() / 1e3) | |
| }, repositories.Objectives.prototype.getObjectives = function getObjectives() { | |
| return this._objectives.values() | |
| }, repositories.Objectives.prototype.getObjectiveById = function getObjectiveById(id) { | |
| return this._objectives.get(id) | |
| }, repositories.Objectives.prototype.storeObjectives = function storeObjectives(t) { | |
| Array.isArray(t) ? t.forEach(function(t) { | |
| this._objectives.set(t.id, t) | |
| }, this) : this._objectives.set(t.id, t) | |
| }, NamespaceManager.Register("services"), services.Objectives = function() { | |
| function ObjectivesService() { | |
| this._repository = new repositories.Objectives | |
| } | |
| return ObjectivesService.prototype.reset = function reset() { | |
| this._repository.reset() | |
| }, ObjectivesService.prototype.getObjectives = function getObjectives() { | |
| var event = new FUTObservable, | |
| t = new transferobjects.ServiceResponse; | |
| return t.data = { | |
| objectives: [], | |
| autoClaimedRewards: !1 | |
| }, gSettingsModel.isObjectivesEnabled() ? this._repository.isDirty() ? (accessobjects.Objectives.getObjectives(services.Authentication).observe(this, function _onObjectivesRetrieved(i, s) { | |
| if (i.unobserve(this), t.success = s.success, t.status = s.status, t.success) { | |
| var o = s.response.dailyObjectives, | |
| l = s.response.weeklyObjectives, | |
| u = s.response.dailyAutoClaimed || s.response.weeklyAutoClaimed, | |
| h = o.concat(l), | |
| p = Math.round(Date.now() / 1e3) + 3600, | |
| m = o.length > 0 ? Math.min(p, o[0].expiryTime) : p, | |
| _ = l.length > 0 ? Math.min(p, l[0].expiryTime) : p, | |
| g = Math.min(m, _); | |
| this._repository.reset(), this._repository.setCacheTimestamp(Math.max(g, Date.now() / 1e3 + 30)), this._repository.storeObjectives(h), t.data.objectives = h, t.data.autoClaimedRewards = u | |
| } else this._repository.setCacheTimestamp(Date.now() / 1e3 + 30), t.status === enums.HTTPStatusCode.SERVICE_IS_DISABLED && gSettingsModel.disableService(models.SettingsModel.OBJECTIVES_ENABLED), services.Notification.queue([gLocalization.lText("notification.objectives.loadFailed"), enums.UINotificationType.NEGATIVE]); | |
| event.notify(t) | |
| }), event) : (t.success = !0, t.status = enums.HTTPStatusCode.OK, t.data.objectives = this._repository.getObjectives(), event.notify(t), event) : (t.status = enums.HTTPStatusCode.SERVICE_IS_DISABLED, event.notify(t), event) | |
| }, ObjectivesService.prototype.claimById = function claimById(id) { | |
| function _onObjectiveClaimed(s, o) { | |
| if (s.unobserve(this), i.success = o.success, i.status = o.status, o.success) { | |
| t.markAsRedeemed(); | |
| var l = o.response.awards; | |
| i.data = { | |
| awards: l | |
| }, this._handleClaim(l) | |
| } else i.status === enums.HTTPStatusCode.SERVICE_IS_DISABLED && gSettingsModel.disableService(models.SettingsModel.OBJECTIVES_ENABLED), services.Notification.queue([gLocalization.lPrint("notification.objectives.claimFailed", [t.name]), enums.UINotificationType.NEGATIVE]); | |
| event.notify(i) | |
| } | |
| var t, event = new FUTObservable, | |
| i = new transferobjects.ServiceResponse; | |
| return this.getObjectives().observe(this, function(i) { | |
| i.unobserve(this), (t = this._repository.getObjectiveById(id)) && accessobjects.Objectives.claimById(services.Authentication, t.id).observe(this, _onObjectiveClaimed) | |
| }), event | |
| }, ObjectivesService.prototype.claimAll = function claimAll() { | |
| function _onObjectivesClaimed(i, s) { | |
| i.unobserve(this); | |
| var o = new transferobjects.ServiceResponse; | |
| if (o.success = s.success, o.status = s.status, o.success) { | |
| t.forEach(function(t) { | |
| t.isUnclaimed() && t.markAsRedeemed() | |
| }); | |
| var l = s.response.awards; | |
| o.data = { | |
| awards: l | |
| }, this._handleClaim(l) | |
| } else o.status === enums.HTTPStatusCode.SERVICE_IS_DISABLED && gSettingsModel.disableService(models.SettingsModel.OBJECTIVES_ENABLED), services.Notification.queue([gLocalization.lText("notification.objectives.claimAllFailed"), enums.UINotificationType.NEGATIVE]); | |
| event.notify(o) | |
| } | |
| var t, event = new FUTObservable; | |
| return this.getObjectives().observe(this, function(i, s) { | |
| i.unobserve(this), s.success ? (t = s.data.objectives, accessobjects.Objectives.claimAll(services.Authentication).observe(this, _onObjectivesClaimed)) : event.notify(s) | |
| }), event | |
| }, ObjectivesService.prototype.handlePayload = function handlePayload(data) { | |
| if (data) { | |
| var t, i = data.completedDailyObjectives || [], | |
| s = data.completedWeeklyObjectives || []; | |
| this.getObjectives().observe(this, function(o) { | |
| o.unobserve(this), i.concat(s).forEach(function(i) { | |
| if ((t = this._repository.getObjectiveById(i)).isDaily) { | |
| var s = { | |
| moment: PinManager.MILESTONE_EVT_MOMENT, | |
| mode: PinManager.MILESTONE_EVT_MODE, | |
| type: enums.PIN.MILESTONE_EVT_TYPE.OBJECTIVES, | |
| mstid: enums.PIN.MILESTONE_EVT_ID.DAILY_OBJECTIVE + t.id | |
| }; | |
| gPinManager.trigger(utils.PinFactory.createEvent(enums.PIN.EVENT.MILESTONE, s)) | |
| } | |
| t.markAsCompleted(), services.Notification.queue([gLocalization.lPrint("notification.objectives.completedObjective", [t.name]), enums.UINotificationType.POSITIVE]) | |
| }, this), data.progressOnWeeklyObjectives && (data.progressOnWeeklyObjectives.forEach(function(i) { | |
| (t = this._repository.getObjectiveById(i.objectiveId)) && (t.currentProgress = i.progressCount) | |
| }, this), services.Notification.queue([gLocalization.lPrint("notification.objectives.weeklyObjectiveProgress", [t.name]), enums.UINotificationType.POSITIVE])), (data.newDailyObjectives || data.newWeeklyObjectives) && this.reset() | |
| }) | |
| } | |
| }, ObjectivesService.prototype._handleClaim = function _handleClaim(t) { | |
| var i = !1, | |
| s = !1, | |
| o = !1; | |
| t.forEach(function(a) { | |
| i = i || a.isItem, s = s || a.isPack, o = o || a.isCoin | |
| }, this), i && (services.Notification.queue([gLocalization.lText("notification.item.added"), enums.UINotificationType.POSITIVE]), repositories.Item.setDirty(enums.FUTItemPile.PURCHASED)), s && (services.Notification.queue([gLocalization.lText("notification.pack.added"), enums.UINotificationType.POSITIVE]), repositories.User.getCurrent().incrementNumUnopenedPacks()), o && (services.Notification.queue([gLocalization.lText("notification.coins.added"), enums.UINotificationType.POSITIVE]), gUserModel.updateCredits(!0)) | |
| }, new ObjectivesService | |
| }(), NamespaceManager.Register("accessobjects"), accessobjects.Onboarding = function() { | |
| function OnboardingDAO() { | |
| FUTObject.call(this), this.UTAS_REQUEST_PATH = "/ut/game/" + GAME_NAME + "/", Object.defineProperty(this, "UTAS_REQUEST_PATH", { | |
| writable: !1, | |
| enumerable: !0 | |
| }) | |
| } | |
| return utils.JS.inherits(OnboardingDAO, FUTObject), OnboardingDAO.prototype.getHistorical = function getHistorical(t) { | |
| function _mapToRewardDTO(t) { | |
| return new transferobjects.LoyaltyReward(t) | |
| } | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "user/historical"), s.observe(this, function _onGetHistoricalComplete(t, data) { | |
| t.unobserve(this); | |
| var key, s = new transferobjects.FUTHttpResponse; | |
| for (key in s) s.hasOwnProperty(key) && data.hasOwnProperty(key) && (s[key] = data[key]); | |
| s.response = { | |
| name: data.success ? data.response.clubName : "", | |
| abbr: data.success ? data.response.clubAbbr : "", | |
| rewards: data.success && data.response.returningUserRewards ? data.response.returningUserRewards.map(_mapToRewardDTO) : [] | |
| }, i.notify(s) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.createClub = function createClub(t, i, s) { | |
| var o = new FUTObservable, | |
| l = new FUTUtasHttpRequest(t); | |
| return l.setUrl(this.UTAS_REQUEST_PATH + "user"), l.setRequestType(enums.HTTPRequestMethod.POST), l.setRequestBody({ | |
| clubName: i, | |
| clubAbbr: s, | |
| purchased: !0 | |
| }), l.observe(this, function _onCreateClubComplete(t, data) { | |
| t.unobserve(this); | |
| var i = new transferobjects.FUTHttpResponse, | |
| s = utils.JS.isObject(data.response); | |
| i.success = data.success, i.status = data.status, i.response = { | |
| login: s ? data.response.login : {}, | |
| starterPack: s ? data.response.starterPack : [] | |
| }, i.maxAge = data.maxAge, i.retryAfter = data.retryAfter, o.notify(data) | |
| }), l.send(), o | |
| }, OnboardingDAO.prototype.getState = function getState(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "clientdata/onboarding"), s.observe(this, function _onGetStateComplete(t, data) { | |
| t.unobserve(this), i.notify(data) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.setState = function setState(t, state) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(+this.UTAS_REQUEST_PATH + "clientdata/onboarding"), s.setRequestType(enums.HTTPRequestMethod.PUT), s.setRequestBody({ | |
| entries: [{ | |
| key: 0, | |
| value: state | |
| }] | |
| }), s.observe(this, function _onSetStateComplete(t, data) { | |
| t.unobserve(this), i.notify(data) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.selectDefaultPack = function selectDefaultPack(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "user/action/ICEBREAKER_DEFAULT_STARTER_PACK_SELECTED"), s.setRequestType(enums.HTTPRequestMethod.POST), s.observe(this, function _onSelectDefaultPackComplete(t, data) { | |
| t.unobserve(this), i.notify(data) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.selectCountry = function selectCountry(t, i) { | |
| var s = new FUTObservable, | |
| o = new FUTUtasHttpRequest(t); | |
| return o.setUrl(this.UTAS_REQUEST_PATH + "user/action/ONBOARDING_COUNTRY_" + i + "_SELECTED"), o.setRequestType(enums.HTTPRequestMethod.POST), o.observe(this, function _onSelectCountryComplete(t, data) { | |
| t.unobserve(this); | |
| var key, o = new transferobjects.FUTHttpResponse; | |
| for (key in o) o.hasOwnProperty(key) && data.hasOwnProperty(key) && (o[key] = data[key]); | |
| o.response = { | |
| countryId: i | |
| }, s.notify(o) | |
| }), o.send(), s | |
| }, OnboardingDAO.prototype.getBadges = function getBadges(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "onboarding/badges"), s.observe(this, function _onGetBadgesComplete(t, data) { | |
| t.unobserve(this); | |
| var key, s = new transferobjects.FUTHttpResponse; | |
| for (key in s) s.hasOwnProperty(key) && data.hasOwnProperty(key) && (s[key] = data[key]); | |
| s.response = { | |
| badges: data.success ? factories.Item.generateItemsFromItemData(data.response.badgeItemDataList) : [] | |
| }, i.notify(s) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.selectBadge = function selectBadge(t, i) { | |
| var s = new FUTObservable, | |
| o = new FUTUtasHttpRequest(t); | |
| return o.setUrl(this.UTAS_REQUEST_PATH + "onboarding/badge/" + i), o.setRequestType(enums.HTTPRequestMethod.POST), o.observe(this, function _onSelectBadgeComplete(t, data) { | |
| t.unobserve(this); | |
| var key, i = new transferobjects.FUTHttpResponse; | |
| for (key in i) i.hasOwnProperty(key) && data.hasOwnProperty(key) && (i[key] = data[key]); | |
| i.response = { | |
| badgeId: data.success ? data.response.badgeId : 0 | |
| }, s.notify(i) | |
| }), o.send(), s | |
| }, OnboardingDAO.prototype.getKits = function getKits(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "onboarding/kits"), s.observe(this, function _onGetKitsComplete(t, data) { | |
| t.unobserve(this); | |
| var key, s = new transferobjects.FUTHttpResponse; | |
| for (key in s) s.hasOwnProperty(key) && data.hasOwnProperty(key) && (s[key] = data[key]); | |
| s.response = { | |
| homeKits: data.success ? factories.Item.generateItemsFromItemData(data.response.homeItemDataList) : [], | |
| awayKits: data.success ? factories.Item.generateItemsFromItemData(data.response.awayItemDataList) : [] | |
| }, i.notify(s) | |
| }), s.send(), i | |
| }, | |
| OnboardingDAO.prototype.selectKits = function selectKits(t, i, s) { | |
| var o = new FUTObservable, | |
| l = new FUTUtasHttpRequest(t); | |
| return l.setUrl(this.UTAS_REQUEST_PATH + "onboarding/kits"), l.setRequestType(enums.HTTPRequestMethod.POST), l.setRequestBody({ | |
| homeKitId: i, | |
| awayKitId: s | |
| }), l.observe(this, function _onSelectKitsComplete(t, data) { | |
| t.unobserve(this); | |
| var key, i = new transferobjects.FUTHttpResponse; | |
| for (key in i) i.hasOwnProperty(key) && data.hasOwnProperty(key) && (i[key] = data[key]); | |
| i.response = { | |
| awayKitId: data.success ? data.response.awayKitId : 0, | |
| homeKitId: data.success ? data.response.homeKitId : 0 | |
| }, o.notify(i) | |
| }), l.send(), o | |
| }, OnboardingDAO.prototype.getLoanPlayers = function getLoanPlayers(t) { | |
| var i = new FUTObservable, | |
| s = new FUTUtasHttpRequest(t); | |
| return s.setUrl(this.UTAS_REQUEST_PATH + "loan/players"), s.observe(this, function _onGetLoanPlayersComplete(t, data) { | |
| t.unobserve(this); | |
| var s = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response); | |
| s.success = data.success, s.status = data.status, s.response = { | |
| items: o ? data.response.loans.map(function(t) { | |
| return factories.Item.createItem(t.itemData) | |
| }) : [] | |
| }, s.maxAge = data.maxAge, s.retryAfter = data.retryAfter, i.notify(s) | |
| }), s.send(), i | |
| }, OnboardingDAO.prototype.grantLoanPlayer = function grantLoanPlayer(t, i) { | |
| var s = new FUTObservable, | |
| o = new FUTUtasHttpRequest(t); | |
| return o.setUrl(this.UTAS_REQUEST_PATH + "loan/player/" + i.toString()), o.setRequestType(enums.HTTPRequestMethod.PUT), o.observe(this, function _onGrantLoanPlayerComplete(t, data) { | |
| t.unobserve(this); | |
| var i = new transferobjects.FUTHttpResponse, | |
| o = utils.JS.isObject(data.response); | |
| i.success = data.success, i.status = data.status, i.response = { | |
| item: o ? factories.Item.createItem(data.response) : null | |
| }, i.maxAge = data.maxAge, i.retryAfter = data.retryAfter, s.notify(i) | |
| }), o.send(), s | |
| }, new OnboardingDAO | |
| }(), NamespaceManager.Register("services"), services.Onboarding = function() { | |
| function OnboardingService() { | |
| FUTObject.call(this) | |
| } | |
| return utils.JS.inherits(OnboardingService, FUTObject), OnboardingService.prototype.getCountries = function getCountries() { | |
| var t = new FUTObservable, | |
| i = new transferobjects.ServiceResponse; | |
| return i.success = !0, i.status = enums.HTTPStatusCode.OK, i.data = { | |
| countries: [enums.Country.ENGLAND, enums.Country.BRAZIL, enums.Country.FRANCE, enums.Country.ARGENTINA, enums.Country.GERMANY, enums.Country.ITALY, enums.Country.SPAIN, enums.Country.PORTUGAL, enums.Country.NETHERLANDS] | |
| }, t.notify(i), t | |
| }, OnboardingService.prototype.selectDefaultPack = function selectDefaultPack() { | |
| var t = new FUTObservable, | |
| i = services.Authentication, | |
| s = new transferobjects.ServiceResponse; | |
| return accessobjects.Onboarding.selectDefaultPack(i).observe(this, function _onSelectDefaultPackComplete(i, o) { | |
| i.unobserve(this), s.success = o.success, s.status = o.status, t.notify(s) | |
| }), t | |
| }, OnboardingService.prototype.selectCountry = function selectCountry(id) { | |
| var t = new FUTObservable, | |
| i = services.Authentication, | |
| s = new transferobjects.ServiceResponse, | |
| index = utils.FUTData.mapNationIdToOnboardingCountryId(id); | |
| return 0 === index ? (utils.Debug.Assert(!1, "Encountered an unsupported nation ID."), s.success = !1, s.status = enums.HTTPStatusCode.BAD_REQUEST, t.notify(s)) : accessobjects.Onboarding.selectCountry(i, index).observe(this, function _onSelectCountryComplete(i, o) { | |
| i.unobserve(this), s.success = o.success, s.status = o.status, s.data = { | |
| countryId: o.response.countryId | |
| }, t.notify(s) | |
| }), t | |
| }, OnboardingService.prototype.getBadges = function getBadges() { | |
| var t = new FUTObservable, | |
| i = services.Authentication; | |
| return accessobjects.Onboarding.getBadges(i).observe(this, function _onGetBadgesComplete(i, s) { | |
| i.unobserve(this); | |
| var o = new transferobjects.ServiceResponse; | |
| o.success = s.success, o.status = s.status, o.data = { | |
| badges: s.response.badges || [] | |
| }, t.notify(o) | |
| }), t | |
| }, OnboardingService.prototype.selectBadge = function selectBadge(t) { | |
| var i = new FUTObservable, | |
| s = services.Authentication, | |
| o = new transferobjects.ServiceResponse; | |
| return t.isBadge() ? accessobjects.Onboarding.selectBadge(s, t.getDefId()).observe(this, function _onSelectBadgeComplete(s, l) { | |
| s.unobserve(this), l.success && (t.state = enums.ItemState.ACTIVE_BADGE, t.pile = enums.FUTItemPile.CLUB, | |
| repositories.Item.add(t)), o.success = l.success, o.status = l.status, o.data = { | |
| badgeId: l.response.badgeId | |
| }, i.notify(o) | |
| }) : (utils.Debug.Assert(!1, "Expected a badge item when selecting a badge."), o.success = !1, o.status = enums.HTTPStatusCode.BAD_REQUEST, i.notify(o)), i | |
| }, OnboardingService.prototype.getKits = function getKits() { | |
| var t = new FUTObservable, | |
| i = services.Authentication; | |
| return accessobjects.Onboarding.getKits(i).observe(this, function _onGetKitsComplete(i, s) { | |
| i.unobserve(this); | |
| var o = new transferobjects.ServiceResponse; | |
| o.success = s.success, o.status = s.status, o.data = { | |
| homeKits: s.response.homeKits || [], | |
| awayKits: s.response.awayKits || [] | |
| }, t.notify(o) | |
| }), t | |
| }, OnboardingService.prototype.selectKits = function selectKits(t, i) { | |
| var s = new FUTObservable, | |
| o = services.Authentication, | |
| l = new transferobjects.ServiceResponse; | |
| return t.isKit() && i.isKit() ? accessobjects.Onboarding.selectKits(o, t.getDefId(), i.getDefId()).observe(this, function _onSelectKitsComplete(o, u) { | |
| o.unobserve(this), u.success && (t.state = enums.ItemState.ACTIVE_HOME_KIT, t.pile = enums.FUTItemPile.CLUB, i.state = enums.ItemState.ACTIVE_AWAY_KIT, i.pile = enums.FUTItemPile.CLUB, repositories.Item.add([t, i])), l.success = u.success, l.status = u.status, l.data = { | |
| awayKitId: u.response.awayKitId, | |
| homeKitId: u.response.homeKitId | |
| }, s.notify(l) | |
| }) : (utils.Debug.Assert(t.isKit(), "Expected a kit item when selecting a home kit."), utils.Debug.Assert(i.isKit(), "Expected a kit item when selecting an away kit."), l.success = !1, l.status = enums.HTTPStatusCode.BAD_REQUEST, s.notify(l)), s | |
| }, OnboardingService.prototype.getLoanPlayers = function getLoanPlayers() { | |
| var t = new FUTObservable, | |
| i = services.Authentication, | |
| s = new transferobjects.ServiceResponse; | |
| return accessobjects.Onboarding.getLoanPlayers(i).observe(this, function _onGetLoanPlayersComplete(i, o) { | |
| i.unobserve(this), s.data = { | |
| items: o.response.items || [] | |
| }, s.success = o.success, s.status = o.status, t.notify(s) | |
| }), t | |
| }, OnboardingService.prototype.grantLoanPlayer = function grantLoanPlayer(item) { | |
| var t = new FUTObservable, | |
| i = services.Authentication, | |
| s = new transferobjects.ServiceResponse; | |
| return item.isLoaned() ? accessobjects.Onboarding.grantLoanPlayer(i, item.getDefId()).observe(this, function _onGrantLoanPlayerComplete(i, o) { | |
| i.unobserve(this), s.data = { | |
| item: o.response.item || null | |
| }, s.success = o.success, s.status = o.status, t.notify(s) | |
| }) : (s.success = !1, s.status = enums.HTTPStatusCode.BAD_REQUEST, t.notify(s)), t | |
| }, OnboardingService.prototype.createClub = function createClub() { | |
| function _onCreateClubComplete(i, response) { | |
| i.unobserve(this), s.success = response.success, s.status = response.status, response.success && (s.data = response.data), t.notify(s) | |
| } | |
| var t = new FUTObservable, | |
| i = services.Authentication, | |
| s = new transferobjects.ServiceResponse; | |
| return accessobjects.Onboarding.getHistorical(i).observe(this, function _onGetHistoricalComplete(o, l) { | |
| if (o.unobserve(this), l.success) { | |
| var data = l.response, | |
| u = i.getCurrentUser().getSelectedPersona(); | |
| u.setLoyaltyRewards(data.rewards), u.createClub(i, data.name, data.abbr).observe(this, _onCreateClubComplete) | |
| } else s.success = l.success, s.status = l.status, t.notify(s) | |
| }), t | |
| }, new OnboardingService | |
| }(), communication.CreateShowOffSquadDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "showoff/" + t, models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setData({ | |
| squadId: t | |
| }) | |
| }, utils.JS.inherits(communication.CreateShowOffSquadDelegate, communication.BaseFUTDelegate), communication.DeleteShowOffSquadDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), this.setURLVariables({ | |
| id: t | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "showoffdelete", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.DeleteShowOffSquadDelegate, communication.BaseFUTDelegate), communication.SquadCreateDelegate = function(name, t, i, s) { | |
| communication.BaseFUTDelegate.call(this); | |
| var o = { | |
| squadName: name, | |
| formation: t | |
| }; | |
| Array.isArray(i) && i.length > 0 && (o.players = i.map(function(item, t) { | |
| var i = s || item.concept; | |
| return { | |
| index: t, | |
| itemData: item ? { | |
| id: i ? item.getMaskedResourceId() : item.id, | |
| dream: i | |
| } : { | |
| id: 0, | |
| dream: !1 | |
| } | |
| } | |
| })), this.setData(o), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "squad", models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.SquadCreateDelegate, communication.BaseFUTDelegate), communication.SquadCreateDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.NAME_EXISTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.duplicateSquadNameTitle", "popup.error.duplicateSquadName"); | |
| break; | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.squadsFullTitle", "popup.error.squadsFull"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.SquadDeleteDelegate = function(t) { | |
| communication.BaseFUTDelegate.call(this), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "squad/" + t.toString(), models.CommunicationModel.METHOD.DELETE, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.SquadDeleteDelegate, communication.BaseFUTDelegate), communication.SquadCopyDelegate = function(id, name) { | |
| communication.BaseFUTDelegate.call(this), this.setData({ | |
| srcId: id, | |
| dstSquadName: name | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "squad/clone", models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.SquadCopyDelegate, communication.BaseFUTDelegate), communication.SquadCopyDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.NAME_EXISTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.duplicateSquadNameTitle", "popup.error.duplicateSquadName"); | |
| break; | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.squadsFullTitle", "popup.error.squadsFull"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.SquadRenameDelegate = function SquadRenameDelegate(id, name) { | |
| communication.BaseFUTDelegate.call(this), this.setData({ | |
| id: id, | |
| squadName: name | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "squad/" + id.toString(), models.CommunicationModel.METHOD.PUT, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.SquadRenameDelegate, communication.BaseFUTDelegate), NamespaceManager.Register("services"), services.Squad = function() { | |
| function SquadService() {} | |
| return SquadService.prototype.create = function create(name, t, i, s) { | |
| var event = new FUTObservable, | |
| o = { | |
| success: !1, | |
| squad: null, | |
| error: null | |
| }, | |
| l = new communication.SquadCreateDelegate(name, t, i, s); | |
| return l.addListener(communication.BaseDelegate.SUCCESS, this, function delegateSuccess(sender, data) { | |
| sender.clearListenersByScope(this), services.Notification.queue([gLocalization.lText("notification.squad.created"), enums.UINotificationType.NEUTRAL]); | |
| var t = gAuthenticationModel.getUser().selectedPersona; | |
| repositories.Squad.storeSquad(t, data).observe(this, function(t, i) { | |
| t.unobserve(this), repositories.Squad.setDirty(), i.setCacheTimestamp(Date.now()), o.success = !0, o.squad = i, event.notify(o), getDefaultDispatcher().notify(enums.AppNotification.SQUAD_CREATE, this, o) | |
| }) | |
| }), l.addListener(communication.BaseDelegate.FAIL, this, function delegateFail(sender, error) { | |
| sender.clearListenersByScope(this), | |
| NetworkErrorManager.handle(error, !1, function() { | |
| o.error = error, event.notify(o) | |
| }.bind(this)) | |
| }), l.execute(), event | |
| }, SquadService.prototype.copy = function copy(id, name) { | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1, | |
| squad: null, | |
| error: null | |
| }, | |
| i = new communication.SquadCopyDelegate(id, name); | |
| return i.useClickShield(!0), i.addListener(communication.BaseDelegate.SUCCESS, this, function delegateSuccess(sender, data) { | |
| sender.clearListenersByScope(this); | |
| var i = gAuthenticationModel.getUser().selectedPersona; | |
| repositories.Squad.storeSquad(i, data).observe(this, function(i, s) { | |
| i.unobserve(this), services.Notification.queue([gLocalization.lText("notification.squad.copied"), enums.UINotificationType.NEUTRAL]), s.setCacheTimestamp(Date.now()), t.success = !0, t.squad = s, event.notify(t), getDefaultDispatcher().notify(enums.AppNotification.SQUAD_CREATE, this, t) | |
| }) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function delegateFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| switch (error.getCode()) { | |
| case enums.NetworkError.NAME_EXISTS: | |
| utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.DUPLICATE_SQUAD_NAME); | |
| break; | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.SQUADS_FULL) | |
| } | |
| t.error = error, event.notify(t) | |
| }.bind(this)) | |
| }), i.execute(), event | |
| }, SquadService.prototype.duplicate = function duplicate(t) { | |
| function _onCreateDuplicateComplete(t, data) { | |
| t.unobserve(this), event.notify(data) | |
| } | |
| var event = new FUTObservable; | |
| return repositories.Squad.getSquads().observe(this, function(i, data) { | |
| i.unobserve(this); | |
| var s = t.getPlayers().map(function(t) { | |
| return t.getItem() | |
| }), | |
| name = t.getName(); | |
| name = utils.TextUtils.squadNameExists(name, data) ? utils.TextUtils.createSquadNameCopy(name, data) : name, this.create(name, t.getFormation().getName(), s, !0).observe(this, _onCreateDuplicateComplete) | |
| }), event | |
| }, SquadService.prototype.rename = function rename(id, name) { | |
| function onGetSquad(i, s) { | |
| i.unobserve(this), services.Notification.queue([gLocalization.lText("notification.squad.renamed"), enums.UINotificationType.NEUTRAL]), s.setName(name, []), t.success = !0, t.squad = s || null, event.notify(t), getDefaultDispatcher().notify(enums.AppNotification.SQUAD_SAVE, s) | |
| } | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1, | |
| squad: null, | |
| error: null | |
| }, | |
| i = new communication.SquadRenameDelegate(id, name); | |
| return i.useClickShield(!0), i.addListener(communication.BaseDelegate.SUCCESS, this, function _onRenameSuccess(sender) { | |
| sender.clearListenersByScope(this), repositories.Squad.getSquadById(id).observe(this, onGetSquad) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onRenameFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| t.error = error, event.notify(t) | |
| }.bind(this)) | |
| }), i.execute(), event | |
| }, SquadService.prototype.remove = function remove(id) { | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1, | |
| id: id, | |
| error: null | |
| }, | |
| i = new communication.SquadDeleteDelegate(id); | |
| return i.addListener(communication.BaseDelegate.SUCCESS, this, function _onRemoveSuccess(sender) { | |
| sender.clearListenersByScope(this); | |
| var i = gAuthenticationModel.getUser().selectedPersona; | |
| repositories.Squad.removeSquad(i, id), repositories.Squad.setDirty(), t.success = !0, event.notify(t), getDefaultDispatcher().notify(enums.AppNotification.SQUAD_DELETE, this, t) | |
| }), i.addListener(communication.BaseDelegate.FAIL, this, function _onRemoveFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| t.error = error, event.notify(t) | |
| }.bind(this)) | |
| }), i.useClickShield(!0), i.send(), event | |
| }, SquadService.prototype.addShowOff = function addShowOff(t) { | |
| function _onAddShowOffSuccess(sender, data) { | |
| sender.clearListenersByScope(this), repositories.Squad.getSquadById(t).observe(this, function(t, s) { | |
| if (t.unobserve(this), utils.JS.isValid(s)) { | |
| var o = new transferobjects.ShowOffSquad(s, data); | |
| repositories.Squad.addShowOffSquad(o), i.success = !0, i.url = o.url + ":" + gAuthenticationModel.getUser().getSelectedPersona().sku | |
| } | |
| event.notify(i) | |
| }) | |
| } | |
| function _onAddShowOffFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| i.error = error, event.notify(i) | |
| }.bind(this)) | |
| } | |
| function _createShowOff() { | |
| var i = new communication.CreateShowOffSquadDelegate(t); | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, _onAddShowOffSuccess), i.addListener(communication.BaseDelegate.FAIL, this, _onAddShowOffFail), i.useClickShield(!0), i.send() | |
| } | |
| var event = new FUTObservable, | |
| i = { | |
| success: !1, | |
| url: "", | |
| error: null | |
| }; | |
| return repositories.Squad.getShowOffSquads().observe(this, function(t, data) { | |
| if (t.unobserve(this), data.success) | |
| if (repositories.Squad.isShowOffListFull()) { | |
| var keys = data.showOffSquads.map(function(t) { | |
| return t.id | |
| }); | |
| this.deleteShowOff(Math.min.apply(Math, keys)).observe(this, function(t, d) { | |
| d.success && _createShowOff.call(this) | |
| }) | |
| } else _createShowOff.call(this) | |
| }), event | |
| }, SquadService.prototype.deleteShowOff = function deleteShowOff(t) { | |
| var event = new FUTObservable, | |
| i = { | |
| success: !1, | |
| error: null | |
| }, | |
| s = new communication.DeleteShowOffSquadDelegate(t); | |
| return s.addListener(communication.BaseDelegate.SUCCESS, this, function _onDeleteShowOffSuccess(sender, data) { | |
| sender.clearListenersByScope(this), repositories.Squad.removeShowOffSquad(t), i.success = !0, event.notify(i) | |
| }), s.addListener(communication.BaseDelegate.FAIL, this, function _onDeleteShowOffFail(sender, error) { | |
| sender.clearListenersByScope(this), NetworkErrorManager.handle(error, !1, function() { | |
| i.error = error, event.notify(i) | |
| }.bind(this)) | |
| }), s.useClickShield(!0), s.send(), event | |
| }, SquadService.prototype.loadShowOffSquad = function loadShowOffSquad() { | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1, | |
| squad: null, | |
| error: null | |
| }; | |
| return repositories.Squad.loadShowOffSquad().observe(this, function _onLoadShowOff(i, data) { | |
| i.unobserve(this), data.success ? (t.success = !0, t.showOffDTO = data.showOffDTO) : services.Notification.queue([gLocalization.lText("squads.showoff.error.load"), enums.UINotificationType.NEGATIVE]), event.notify(t) | |
| }), event | |
| }, SquadService.prototype.setActiveSquad = function setActiveSquad(id) { | |
| var event = new FUTObservable, | |
| t = { | |
| success: !1, | |
| error: null | |
| }; | |
| return repositories.Squad.getSquadById(id, -1).observe(this, function _onSetActiveComplete(i, s, error) { | |
| s ? (t.success = !0, repositories.Squad.setActiveSquadId(s.getId())) : error && (t.error = error), event.notify(t) | |
| }), event | |
| }, new SquadService | |
| }(), NamespaceManager.Register("services"), services.URL = function() { | |
| function URLService() {} | |
| var t = new FUTHashTable({}), | |
| i = ""; | |
| return URLService.prototype.registerDeepLinkID = function registerDeepLinkID(id, i) { | |
| t.set(id, i) | |
| }, URLService.prototype.findValidDeepLinkID = function findValidDeepLinkID(t) { | |
| return utils.JS.find(t, function(t) { | |
| return this._isValidDeepLinkID(t) | |
| }.bind(this)) || enums.DeepLinkSections.NONE | |
| }, URLService.prototype._isValidDeepLinkID = function _isValidDeepLinkID(id) { | |
| return t.has(id) | |
| }, URLService.prototype.setDeepLinkURL = function setDeepLinkURL(t, s) { | |
| if (!utils.JS.isEmpty(t)) { | |
| var url = decodeURIComponent(t).trim(); | |
| 0 !== url.indexOf("easfc://") && (url = "easfc://fut/" + t, s && (url += "/" + s)), i = url | |
| } | |
| }, URLService.prototype.getDeepLinkURL = function getDeepLinkURL() { | |
| return i | |
| }, URLService.prototype.clearDeepLinkURL = function clearDeepLinkURL() { | |
| i = "" | |
| }, URLService.prototype.hasDeepLinkURL = function hasDeepLinkURL() { | |
| return !utils.JS.isEmpty(i) | |
| }, URLService.prototype.processDeepLinkURL = function processDeepLinkURL() { | |
| if (!this.hasDeepLinkURL()) return !1; | |
| var t = this.process(this.getDeepLinkURL()); | |
| return t && this.clearDeepLinkURL(), t | |
| }, URLService.prototype.process = function process(url) { | |
| if (0 === (url = decodeURIComponent(url).trim()).indexOf("easfc://")) { | |
| if (!this._checkAuth()) return !1; | |
| var i = url.substr("easfc://".length).split("/").filter(function(t) { | |
| return "" !== t | |
| }), | |
| s = i.shift(), | |
| tag = i.shift(); | |
| if ("fut" !== s || !this._isValidDeepLinkID(tag)) return utils.Debug.Assert(!1, "[services.URL::process] Unable to process unknown deep link: " + url), !1; | |
| t.get(tag)(i) | |
| } else { | |
| if (0 !== url.indexOf("https://") && 0 !== url.indexOf("http://")) return utils.Debug.Assert(!1, "[services.URL::process] Unable to process unknown or unsupported URL structure: " + url), !1; | |
| window.open(url, "_system") | |
| } | |
| return !0 | |
| }, | |
| URLService.prototype._checkAuth = function _checkAuth() { | |
| var t = gAuthenticationModel.getFUTState(); | |
| if (!gAuthenticationModel.getUser().getSelectedPersona().hasFUT || !gAuthenticationModel.isFullyAuthenticated()) { | |
| if (t !== enums.FUTAuthState.SERVER_DOWN) switch (NavManager.clearScreenStack(), NavManager.pushScreenOntoStack(null, Screens.getView("HOME")), t) { | |
| case enums.FUTAuthState.ACCOUNT_LOCKED: | |
| NavManager.requestChildScreen(Screens.getView("ACCOUNT_LOCKED")); | |
| break; | |
| case enums.FUTAuthState.CONCURRENT_SESSION: | |
| NavManager.requestChildScreen(Screens.getView("SIGNED_ON_CONSOLE")); | |
| break; | |
| case enums.FUTAuthState.NEW_TRIAL_USER: | |
| NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), enums.GettingStartedTypes.FIFA); | |
| break; | |
| default: | |
| NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), enums.GettingStartedTypes.FUT) | |
| } | |
| return !1 | |
| } | |
| return !0 | |
| }, new URLService | |
| }(), NamespaceManager.Register("valueobjects"), valueobjects.NetworkErrorVO = function(code, level, title, message) { | |
| this._code = code, this._level = level, this._title = title, this._message = message | |
| }, valueobjects.NetworkErrorVO.prototype.getMessage = function() { | |
| return this._message | |
| }, valueobjects.NetworkErrorVO.prototype.getTitle = function() { | |
| return this._title | |
| }, valueobjects.NetworkErrorVO.prototype.getCode = function() { | |
| return this._code | |
| }, valueobjects.NetworkErrorVO.prototype.getErrorLevel = function() { | |
| return this._level | |
| }, valueobjects.NetworkErrorVO.prototype.isCritical = function() { | |
| return this._level === enums.NetworkErrorLevel.CRITICAL | |
| }, valueobjects.NetworkErrorVO.prototype.isImportant = function() { | |
| return this._level === enums.NetworkErrorLevel.IMPORTANT | |
| }, valueobjects.NetworkErrorVO.prototype.isUnimportant = function() { | |
| return this._level === enums.NetworkErrorLevel.UNIMPORTANT | |
| }, valueobjects.NetworkErrorVO.prototype.isCodeValid = function() { | |
| return this._code > 0 | |
| }; | |
| var NetworkErrorManager = {}; | |
| NetworkErrorManager.NUM_INTERNAL_SERVER_ERRORS = 0, NetworkErrorManager.handle = function(t, i, s) { | |
| if (t.isCritical()) { | |
| s = gAuthenticationModel.errorLogout.bind(gAuthenticationModel); | |
| var o = { | |
| sid: services.Authentication.getSession(enums.AuthEnvironment.UTAS).id, | |
| type: PinManager.ERROR_EVT_TYPE, | |
| errid: enums.PIN.ERROR_EVT_ERRID.SERVER, | |
| server_type: PinManager.SERVER_TYPE | |
| }; | |
| gPinManager.trigger(utils.PinFactory.createEvent(enums.PIN.EVENT.ERROR, o)) | |
| }!t.isUnimportant() || t.isUnimportant() && !i ? utils.PopupManager.displayNetworkError(t, s) : utils.JS.isFunction(s) && s() | |
| }, NetworkErrorManager.trackServerError = function() { | |
| if (NetworkErrorManager.NUM_INTERNAL_SERVER_ERRORS++, NetworkErrorManager.NUM_INTERNAL_SERVER_ERRORS >= gConfigurationModel.getConfigNumber(models.ConfigurationModel.KEY_MAX_CONSECUTIVE_500_ERRORS)) { | |
| NetworkErrorManager.NUM_INTERNAL_SERVER_ERRORS = 0; | |
| var t = new valueobjects.NetworkErrorVO(enums.NetworkError.SERVER_ERROR, enums.NetworkErrorLevel.CRITICAL, "popup.error.cannotcontinueTitle", "popup.error.cannotcontinue"); | |
| return NetworkErrorManager.handle(t, !1), !0 | |
| } | |
| return !1 | |
| }, NamespaceManager.Register("utils"), utils.GoogleAnalytics = function() { | |
| window.ga("create", "UA-24487626-1") | |
| }, utils.GoogleAnalytics.prototype.trackPage = function(url) { | |
| window.ga("send", "pageview", "/" + encodeURIComponent(url)) | |
| }, utils.GoogleAnalytics.prototype.trackEvent = function(category, action, screen, value) { | |
| window.ga("send", "event", category, action, screen, value) | |
| }, utils.GoogleAnalytics.prototype.isEnabled = function(t) { | |
| var i = gConfigurationModel.getConfigObject(models.ConfigurationModel.KEY_ANALYTICS); | |
| return !!(utils.JS.isValid(i) && i.enabled && i.sectionEnabled[t] && gUserSettingsModel.getUsageSharingEnabled()) | |
| }; | |
| var TelemetryManager = {}; | |
| TelemetryManager.Sections = { | |
| LOGIN: "LOGIN", | |
| MOBILE_START: "MOBILE_START", | |
| HOME: "HOME", | |
| EASFC: "EASFC", | |
| SQUADS: "SQUADS", | |
| STORE: "STORE", | |
| OBJECTIVES: "OBJECTIVES", | |
| ONBOARDING: "ONBOARDING", | |
| SBC: "SBC", | |
| TOTW: "TOTW", | |
| CLUB: "CLUB", | |
| AUCTIONS: "AUCTIONS", | |
| MISC: "MISC" | |
| }, TelemetryManager.Categories = { | |
| BUTTON_PRESS: "buttonpress", | |
| CAPTCHA: "captcha", | |
| FILTER: "filter", | |
| MARKET_STATUS: "marketstatus", | |
| OBJECTIVE_REWARDS_CLAIMED: "objectiverewardsclaimed", | |
| PATCH_FAIL: "patchfail", | |
| PN: "pn", | |
| SQUAD_BUILDING: "squadbuilding", | |
| ERROR: "error" | |
| }, | |
| TelemetryManager.LegacyScreenIds = { | |
| ClubHub: "NavClub", | |
| TransfersHub: "NavTransfers", | |
| SquadsHub: "NavSquads", | |
| StoreHub: "NavStore" | |
| }; | |
| var googleAnalytics = new utils.GoogleAnalytics; | |
| TelemetryManager.convertToLegacyScreenId = function(screen) { | |
| return utils.JS.isString(TelemetryManager.LegacyScreenIds[screen]) ? TelemetryManager.LegacyScreenIds[screen] : screen | |
| }, TelemetryManager.trackPage = function(t, url) { | |
| url = TelemetryManager.convertToLegacyScreenId(url), googleAnalytics.isEnabled(t) && (utils.JS.isString(url) ? googleAnalytics.trackPage(url) : utils.Debug.Assert(!1, "Invalid parameters set for TelemetryManager.trackPage")) | |
| }, TelemetryManager.trackEvent = function(t, category, action, screen, value) { | |
| googleAnalytics.isEnabled(t) && (utils.JS.isString(category) && utils.JS.isString(action) ? (utils.JS.isString(screen) || (utils.Debug.Assert(!utils.JS.isValid(screen), "Invalid variable type for screen in TelemetryManager.trackEvent"), screen = NavManager.getCurrentScreen().getScreenId()), screen = TelemetryManager.convertToLegacyScreenId(screen), utils.JS.isNumber(value) || (utils.Debug.Assert(!utils.JS.isValid(value), "Invalid variable type for value in TelemetryManager.trackEvent"), value = 0), googleAnalytics.trackEvent(category, action, screen, value)) : utils.Debug.Assert(!1, "Invalid parameters set for TelemetryManager.trackEvent")) | |
| }, TelemetryManager.getSection = function() { | |
| var screen = Screens._sections[NavManager.getCurrentScreen().getScreenId()], | |
| t = TelemetryManager.Sections.MISC; | |
| switch (screen) { | |
| case Screens.APP_SECTION.LOGIN: | |
| t = TelemetryManager.Sections.LOGIN; | |
| break; | |
| case Screens.APP_SECTION.MOBILE_START: | |
| t = TelemetryManager.Sections.MOBILE_START; | |
| break; | |
| case Screens.APP_SECTION.HOME: | |
| t = TelemetryManager.Sections.HOME; | |
| break; | |
| case Screens.APP_SECTION.SQUADS: | |
| t = TelemetryManager.Sections.SQUADS; | |
| break; | |
| case Screens.APP_SECTION.STORE: | |
| t = TelemetryManager.Sections.STORE; | |
| break; | |
| case Screens.APP_SECTION.OBJECTIVES: | |
| t = TelemetryManager.Sections.OBJECTIVES; | |
| break; | |
| case Screens.APP_SECTION.SBC: | |
| t = TelemetryManager.Sections.SBC; | |
| break; | |
| case Screens.APP_SECTION.TOTW: | |
| t = TelemetryManager.Sections.TOTW; | |
| break; | |
| case Screens.APP_SECTION.CLUB: | |
| t = TelemetryManager.Sections.CLUB; | |
| break; | |
| case Screens.APP_SECTION.AUCTION_SEARCH: | |
| case Screens.APP_SECTION.TRADE_PILE: | |
| case Screens.APP_SECTION.WATCH_LIST: | |
| t = TelemetryManager.Sections.AUCTIONS | |
| } | |
| return t | |
| }; | |
| var gTelemetryManager = TelemetryManager; | |
| NamespaceManager.Register("interfaces"), interfaces.View = function() {}, interfaces.View.prototype.getRoot = function() {}, interfaces.View.prototype.destroyGeneratedElements = function() {}, interfaces.View.prototype.destroy = function() {}, NamespaceManager.Register("components"), components.HeaderButton = function() { | |
| this._generate(), this.tap = new FUTObservable, Object.defineProperty(this, "tap", { | |
| writable: !1 | |
| }), this._touchHandler = new FUTTouchHandler, this._touchHandler.handleTouch(this.getRoot()), this._touchHandler.bubbleEvent = !1, this._touchHandler.touchstart.observe(this, function(t, e) { | |
| this.getRoot().addClass("active") | |
| }), this._touchHandler.touchmove.observe(this, function(t, e) { | |
| this.getRoot().removeClass("active") | |
| }), this._touchHandler.tap.observe(this, function(t, e) { | |
| this.getRoot().removeClass("active"), this.tap.notify(e) | |
| }) | |
| }, components.HeaderButton.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("button"); | |
| t.classList.add("headerButton"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.HeaderButton.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, components.HeaderButton.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.HeaderButton.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.HeaderButton.prototype.destroy = function() { | |
| this._touchHandler.stopTouchHandling(), this.tap.dealloc(), this.destroyGeneratedElements() | |
| }, NamespaceManager.Register("components"), components.BaseComponent = function() { | |
| utils.EventDispatcher.call(this) | |
| }, utils.JS.inherits(components.BaseComponent, utils.EventDispatcher), | |
| components.BaseComponent.prototype.destroy = function() { | |
| this.destroyGeneratedElements() | |
| }, components.BaseComponent.prototype.getRoot = function() { | |
| return utils.Debug.Assert(!1, "Abstract method not overridden by Preprocessor: BaseComponent.getRoot"), null | |
| }, components.BaseButton = function() { | |
| components.BaseComponent.call(this), this._text = "", this._enabled = !0, this._touchHandler = new FUTTouchHandler | |
| }, utils.JS.inherits(components.BaseButton, components.BaseComponent), components.BaseButton.TOUCHSTART = "components.BaseButton.TOUCHSTART", components.BaseButton.TOUCHEND = "components.BaseButton.TOUCHEND", components.BaseButton.CLICKED = "components.BaseButton.CLICKED", components.BaseButton.STATUS = { | |
| ACTIVE: "active", | |
| DISABLED: "disabled", | |
| BUSY: "busy" | |
| }, components.BaseButton.prototype.init = function() { | |
| this._touchHandler.handleTouch(this.getRoot()), this._touchHandler.tap.observe(this, this.onTap.bind(this)), this._touchHandler.bubbleEvent = !1 | |
| }, components.BaseButton.prototype.destroy = function() { | |
| this._touchHandler.stopTouchHandling(), this.clearListeners(), this.destroyGeneratedElements() | |
| }, components.BaseButton.prototype.setText = function(text) { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: showText") | |
| }, components.BaseButton.prototype.getText = function() { | |
| return this._text | |
| }, components.BaseButton.prototype.showText = function() { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: showText") | |
| }, components.BaseButton.prototype.hideText = function() { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: hideText") | |
| }, components.BaseButton.prototype.setSubText = function(text) { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: setSubText") | |
| }, components.BaseButton.prototype.hideSubText = function(t) { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: hideSubText") | |
| }, components.BaseButton.prototype.showSubText = function() { | |
| utils.Debug.Assert(!1, "Abstract method not overridden: showSubText") | |
| }, components.BaseButton.prototype.enable = function() { | |
| this.setEnabled(!0) | |
| }, components.BaseButton.prototype.disable = function() { | |
| this.setEnabled(!1) | |
| }, components.BaseButton.prototype.setEnabled = function(enabled) { | |
| this._enabled !== enabled && (this._enabled = enabled, this.getRoot().removeClass(components.BaseButton.STATUS.ACTIVE).toggleClass(components.BaseButton.STATUS.DISABLED, !this._enabled)) | |
| }, components.BaseButton.prototype.getEnabled = function() { | |
| return this._enabled | |
| }, components.BaseButton.prototype.onTouchStart = function(t, e) { | |
| this._enabled && (this.getRoot().addClass("active"), this.dispatch(components.BaseButton.TOUCHSTART)) | |
| }, components.BaseButton.prototype.onTouchEnd = function(t, e) { | |
| this.getRoot().removeClass("active"), this._enabled && this.dispatch(components.BaseButton.TOUCHEND) | |
| }, components.BaseButton.prototype.onTap = function(t, e) { | |
| this._enabled && this.dispatch(components.BaseButton.CLICKED) | |
| }, components.BaseButton.prototype.toggle = function(t) { | |
| utils.Debug.Assert(utils.JS.isBoolean(t), "Invalid parameter for Base Button:toggle. Expected a boolean."), this.getRoot().toggle(t) | |
| }, components.BaseButton.prototype.hide = function() { | |
| this.getRoot().hide() | |
| }, components.BaseButton.prototype.show = function() { | |
| this.getRoot().show() | |
| }, components.BaseButton.prototype.remove = function() { | |
| this.getRoot().remove() | |
| }, components.Button = function() { | |
| components.BaseButton.call(this), this._generate() | |
| }, utils.JS.inherits(components.Button, components.BaseButton), components.Button.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.setAttribute("role", "button"), t.classList.add("btn"), t.classList.add("btn-raised"), this.__text = document.createElement("span"), this.$_text = $(this.__text), this.__text.classList.add("btn-text"), t.appendChild(this.__text), this.__subtext = document.createElement("span"), this.$_subtext = $(this.__subtext), this.__subtext.classList.add("btn-subtext"), t.appendChild(this.__subtext), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.Button.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, | |
| this.__text = null, this.$_text = null, this.__subtext = null, this.$_subtext = null | |
| }, components.Button.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.Button.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.Button.prototype.init = function() { | |
| components.Button.superClass_.init.call(this), this.hideSubText(), this.hideBusyAnimation() | |
| }, components.Button.prototype.setText = function(text) { | |
| this._text = text, this.$_text.html(this._text) | |
| }, components.Button.prototype.hideText = function() { | |
| this.$_text.addClass("invisible") | |
| }, components.Button.prototype.showText = function() { | |
| this.$_text.removeClass("invisible") | |
| }, components.Button.prototype.setSubText = function(text) { | |
| this.$_subtext.html(text) | |
| }, components.Button.prototype.hideSubText = function(t) { | |
| this.$_subtext.addClass("invisible"), t && this.$_subtext.removeClass("currency-coin") | |
| }, components.Button.prototype.showSubText = function() { | |
| this.$_subtext.removeClass("invisible") | |
| }, components.Button.prototype.setBusyAnimation = function(value) { | |
| value ? this.showBusyAnimation() : this.hideBusyAnimation() | |
| }, components.Button.prototype.showBusyAnimation = function() { | |
| this.getRoot().addClass(components.BaseButton.STATUS.DISABLED + " " + components.BaseButton.STATUS.BUSY), this.hideText() | |
| }, components.Button.prototype.hideBusyAnimation = function() { | |
| this.getRoot().toggleClass(components.BaseButton.STATUS.DISABLED, !this.getEnabled()), this.getRoot().removeClass(components.BaseButton.STATUS.ACTIVE + " " + components.BaseButton.STATUS.BUSY), this.showText() | |
| }, components.Button.prototype.setEnabled = function(enabled) { | |
| enabled !== this.getEnabled() && this.hideBusyAnimation(), components.Button.superClass_.setEnabled.call(this, enabled) | |
| }, NamespaceManager.Register("utils"), utils.OriginStore = function() { | |
| function OriginStoreUtil() {} | |
| var t = null; | |
| return OriginStoreUtil.prototype.init = function(i) { | |
| var s = this, | |
| locale = gLocalization.getLocale().replace("_", "-").toLowerCase(), | |
| o = document.createElement("link"); | |
| o.href = gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_ORIGIN_CSS), o.rel = "stylesheet", o.type = "text/css", document.head.appendChild(o); | |
| var l = document.createElement("script"); | |
| l.src = gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_ORIGIN_JS), l.onload = function() { | |
| t = new window.EA.ODC.StorePlugin({ | |
| host: gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_ORIGIN_HOST), | |
| locale: locale, | |
| geoLocate: !0, | |
| useDefaultLanguage: !1, | |
| profileId: gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_ORIGIN_PROFILE), | |
| offerQuery: { | |
| masterTitle: gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_ORIGIN_MASTER_TITLE), | |
| platform: "pc-download", | |
| gameType: "currency" | |
| }, | |
| events: { | |
| onCheckoutModalClose: function() { | |
| s._onCheckoutSuccess() | |
| } | |
| } | |
| }), i() | |
| }, document.head.appendChild(l) | |
| }, OriginStoreUtil.prototype.openStore = function() { | |
| t.open() | |
| }, OriginStoreUtil.prototype._onCheckoutSuccess = function() { | |
| gUserModel.updateCredits() | |
| }, new OriginStoreUtil | |
| }(), NamespaceManager.Register("viewmodels"), viewmodels.ItemList = function ItemList(t) { | |
| FUTIterator.call(this, t), this.dataUpdated = new FUTObservable, Object.defineProperty(this, "dataUpdated", { | |
| writable: !1 | |
| }), this._auctionUpdateArray = [], this._auctionUpdateInterval = 0, this._auctionObservable = null, this._updateIntervals = [{ | |
| expires: 15, | |
| interval: 1 | |
| }, { | |
| expires: 60, | |
| interval: 5 | |
| }, { | |
| expires: 600, | |
| interval: 120 | |
| }, { | |
| expires: 3600, | |
| interval: 600 | |
| }, { | |
| expires: 432e3, | |
| interval: 43200 | |
| }], this._pendingExpiryUpdateInterval = 5e3, this.sort = enums.SearchSort.DESCENDING | |
| }, utils.JS.inherits(viewmodels.ItemList, FUTIterator), viewmodels.ItemList.prototype.add = function add(t, index) { | |
| viewmodels.ItemList.superClass_.add.call(this, t, index), utils.JS.isNumber(index) || this._organizeItems() | |
| }, viewmodels.ItemList.prototype.addArray = function addArray(t) { | |
| var lastIndex = this.length; | |
| t.forEach(function(item) { | |
| this.add(item, lastIndex), lastIndex++ | |
| }, this), this._organizeItems() | |
| }, viewmodels.ItemList.prototype.removeArray = function removeArray(t) { | |
| function isInArray(item) { | |
| return !!utils.JS.find(t, function(t) { | |
| return item.id === t.id | |
| }) | |
| } | |
| var i = []; | |
| this._collection.forEach(function(item) { | |
| isInArray(item) || i.push(item) | |
| }), this._collection = i, this._organizeItems() | |
| }, viewmodels.ItemList.prototype.getItemList = function getItemList() { | |
| return this.values() | |
| }, viewmodels.ItemList.prototype._organizeItems = function _organizeItems() { | |
| if (0 !== this.length) { | |
| var t = this.values().sort(this.sortByType.bind(this)); | |
| this.resetCollection(t) | |
| } | |
| }, viewmodels.ItemList.prototype.startAuctionUpdates = function startAuctionUpdates() { | |
| this.stopAuctionUpdates(); | |
| var t = this._auctionUpdateArray.slice(); | |
| this._auctionUpdateArray = this.values().filter(function(item) { | |
| var t = item.getAuctionData(); | |
| if (!t.isUpdating && t.isActiveTrade()) { | |
| if ((t.expires <= 0 || t.getSecondsRemaining() <= 0) && t.getAge() < this._pendingExpiryUpdateInterval) return !1; | |
| for (var i = this._updateIntervals.length; i-- > 0;) { | |
| var s = this._updateIntervals[i]; | |
| if (t.isStale() || t.getSecondsRemaining() <= s.expires && t.getAgeInSeconds() >= s.interval) return !0 | |
| } | |
| } | |
| return !1 | |
| }, this), this._auctionUpdateArray.length > 0 ? (this._auctionObservable = services.Item.getAuctionInfo(this._auctionUpdateArray), this._auctionObservable.observe(this, function(t, data) { | |
| t.unobserve(this), this.dataUpdated.notify(), this._auctionObservable = null, this._auctionUpdateInterval = setTimeout(this.startAuctionUpdates.bind(this), 1e3) | |
| })) : (t.length > 0 && this.dataUpdated.notify(), this._auctionUpdateInterval = setTimeout(this.startAuctionUpdates.bind(this), 1e3)) | |
| }, viewmodels.ItemList.prototype.stopAuctionUpdates = function stopAuctionUpdates() { | |
| this._auctionUpdateInterval = clearTimeout(this._auctionUpdateInterval), this._auctionObservable && (this._auctionObservable.unobserve(this), this._auctionObservable = null) | |
| }, viewmodels.ItemList.prototype.sortByType = function sortByType(a, b) { | |
| var t, i = [enums.ItemType.PLAYER, enums.ItemType.MANAGER, enums.ItemType.HEAD_COACH, enums.ItemType.FITNESS_COACH, enums.ItemType.PHYSIO, enums.ItemType.GK_COACH, enums.ItemType.CONTRACT, enums.ItemType.HEALTH, enums.ItemType.TRAINING, enums.ItemType.BADGE, enums.ItemType.KIT, enums.ItemType.BALL, enums.ItemType.STADIUM, enums.ItemType.MISC]; | |
| t = a.getAuctionData().isActiveTrade() && b.getAuctionData().isActiveTrade() ? 1 : 2; | |
| for (var s = 0; 0 === s;) { | |
| if (1 === t) s = utils.JS.sortCompare(a.getAuctionData().getSecondsRemaining(), b.getAuctionData().getSecondsRemaining(), !1); | |
| else if (2 === t) s = utils.JS.sortCompare(a.isLoaned(), b.isLoaned(), !0); | |
| else if (3 === t) s = utils.JS.sortCompare(a.untradeable, b.untradeable, this.sort === enums.SearchSort.ASCENDING); | |
| else if (4 === t) s = utils.JS.sortCompare(i.indexOf(a.type), i.indexOf(b.type), !1); | |
| else if (5 === t) s = utils.JS.sortCompare(a.isLegend(), b.isLegend(), !0); | |
| else if (6 === t) s = utils.JS.sortCompare(a.isTeamOfTheWeek(), b.isTeamOfTheWeek(), !0); | |
| else if (7 === t) s = utils.JS.sortCompare(a.getTier(), b.getTier(), !0); | |
| else if (8 === t) s = utils.JS.sortCompare(a.rareflag, b.rareflag, !0); | |
| else if (9 === t) s = utils.JS.sortCompare(a.rating, b.rating, !0); | |
| else { | |
| if (10 !== t) break; | |
| s = utils.JS.sortCompare(a.resourceId, b.resourceId, !1) | |
| } | |
| t++ | |
| } | |
| return s | |
| }, NamespaceManager.Register("viewmodels"), viewmodels.PaginatedItemList = function(t, i) { | |
| viewmodels.ItemList.call(this, t); | |
| var s = new valueobjects.NumberVO; | |
| Object.defineProperty(this, "numItemsPerPage", { | |
| get: s.get.bind(s), | |
| set: s.set.bind(s), | |
| enumerable: !0 | |
| }); | |
| var o = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "isFull", { | |
| get: o.get.bind(o), | |
| set: o.set.bind(o), | |
| enumerable: !0 | |
| }), this.numItemsPerPage = utils.JS.isNumber(i) && i > 0 ? i : 15, this.isFull = !1 | |
| }, utils.JS.inherits(viewmodels.PaginatedItemList, viewmodels.ItemList), viewmodels.PaginatedItemList.prototype.resetCollection = function resetCollection(t) { | |
| this.superclass(t), this.isFull = !1 | |
| }, viewmodels.PaginatedItemList.prototype.getCurrentPage = function getCurrentPage() { | |
| return Math.max(Math.ceil((this.getIndex() + 1) / this.numItemsPerPage), 1) | |
| }, viewmodels.PaginatedItemList.prototype.getNumPages = function getNumPages() { | |
| return Math.max(Math.ceil(this.length / this.numItemsPerPage), 1) | |
| }, viewmodels.PaginatedItemList.prototype._getPageStartIndex = function _getPageStartIndex(page) { | |
| return page >= 1 ? (page - 1) * this.numItemsPerPage : 0 | |
| }, | |
| viewmodels.PaginatedItemList.prototype.getPageItems = function getPageItems() { | |
| var t = this._getPageStartIndex(this.getCurrentPage()); | |
| return this.values().slice(t, t + this.numItemsPerPage) | |
| }, viewmodels.PaginatedItemList.prototype.hasPreviousPage = function hasPreviousPage() { | |
| return this.getCurrentPage() > 1 | |
| }, viewmodels.PaginatedItemList.prototype.hasNextPage = function hasNextPage() { | |
| return this.getCurrentPage() < this.getNumPages() | |
| }, viewmodels.PaginatedItemList.prototype.canShowPage = function canShowPage(page) { | |
| if (page = utils.JS.isNumber(page) ? page : this.getCurrentPage(), utils.Debug.Assert(page > 0 && page <= this.getNumPages(), "viewmodels.PaginatedItemList::canShowPage. Page number out of bounds."), this.isFull) return !0; | |
| var index = this._getPageStartIndex(page); | |
| return this.values().slice(index, index + this.numItemsPerPage).length === this.numItemsPerPage | |
| }, viewmodels.PaginatedItemList.prototype.previousPage = function previousPage() { | |
| return this.hasPreviousPage() && this.setIndex(this._getPageStartIndex(this.getCurrentPage() - 1)), this.getPageItems() | |
| }, viewmodels.PaginatedItemList.prototype.nextPage = function nextPage() { | |
| return this.hasNextPage() && this.setIndex(this._getPageStartIndex(this.getCurrentPage() + 1)), this.getPageItems() | |
| }, NamespaceManager.Register("viewmodels"), viewmodels.Club = function ClubViewModel(t) { | |
| var i = gConfigurationModel.getConfigObject(models.ConfigurationModel.KEY_ITEMS_PER_PAGE), | |
| s = utils.JS.isValid(i) ? i[models.ConfigurationModel.ITEMS_PER_PAGE.CLUB] : 15; | |
| viewmodels.PaginatedItemList.call(this, t, s) | |
| }, utils.JS.inherits(viewmodels.Club, viewmodels.PaginatedItemList), viewmodels.Club.prototype.shouldRequestItems = function shouldRequestItems() { | |
| return !this.isFull && this.length <= this.numItemsPerPage * this.getCurrentPage() | |
| }, viewmodels.Club.prototype.removeEmptyConsumables = function removeEmptyConsumables() { | |
| var index = this.getIndex(), | |
| t = this.values(), | |
| i = this.isFull; | |
| t = t.filter(function(c) { | |
| return c.stackCount > 0 | |
| }), this.resetCollection(t), this.isFull = i, this.setIndex(t.length > 0 ? Math.min(index, t.length - 1) : 0) | |
| }, viewmodels.Club.prototype.getActiveItemsURLs = function getActiveItemsURLs() { | |
| return this._getItemsURLs() | |
| }, viewmodels.Club.prototype.getActiveItemURL = function getActiveItemURL(t) { | |
| return this._getItemsURLs(t) | |
| }, viewmodels.Club.prototype.getActiveItemsImgs = function getActiveItemsImgs() { | |
| var t, i = {}, | |
| s = this._getItemsURLs(); | |
| for (t in s) | |
| if (s.hasOwnProperty(t)) { | |
| var o = t, | |
| l = new components.ImageLoader; | |
| l.setResource(s[o]), i[o] = l | |
| } | |
| return i | |
| }, viewmodels.Club.prototype.getActiveItemImg = function getActiveItemImg(t) { | |
| var i = new components.ImageLoader; | |
| return i.setResource(this.getActiveItemURL(t)), i | |
| }, viewmodels.Club.prototype._getItemsURLs = function _getItemsURLs(t) { | |
| var i = {}, | |
| s = utils.JS.isValid(t); | |
| if (s) { | |
| var state; | |
| switch (t) { | |
| case enums.UIActiveItemImgType.BADGE_NORMAL: | |
| case enums.UIActiveItemImgType.BADGE_DARK: | |
| state = enums.ItemState.ACTIVE_BADGE; | |
| break; | |
| case enums.UIActiveItemImgType.BALL: | |
| state = enums.ItemState.ACTIVE_BALL; | |
| break; | |
| case enums.UIActiveItemImgType.STADIUM: | |
| state = enums.ItemState.ACTIVE_STADIUM; | |
| break; | |
| case enums.UIActiveItemImgType.HOME_KIT: | |
| state = enums.ItemState.ACTIVE_HOME_KIT; | |
| break; | |
| case enums.UIActiveItemImgType.AWAY_KIT: | |
| state = enums.ItemState.ACTIVE_AWAY_KIT; | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "viewmodels.Club:_getItemsURLs. Expected an enums.UIActiveItemImgType.<string>") | |
| } | |
| } | |
| var o = repositories.Item.getActiveItems(state); | |
| return Array.isArray(o) || (o = [o]), o.forEach(function(o) { | |
| if (utils.JS.isValid(o)) { | |
| var l, u = o.getStaticData(), | |
| h = o.getYear(), | |
| url = ""; | |
| switch (o.state) { | |
| case enums.ItemState.ACTIVE_BADGE: | |
| if (s && t !== enums.UIActiveItemImgType.BADGE_NORMAL || (url = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BADGE_LIGHT, h, o.teamId), utils.AssetLocator.hasPlaceholder(enums.PlaceholderAssetKey.CREST, o.teamId.toString(), h, enums.PlaceholderAssetKey.CREST_LIGHT) && (url = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BADGE_LIGHT, h)), l = enums.UIActiveItemImgType.BADGE_NORMAL), !s || t === enums.UIActiveItemImgType.BADGE_DARK) { | |
| var p = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BADGE_DARK, h, o.teamId); | |
| utils.AssetLocator.hasPlaceholder(enums.PlaceholderAssetKey.CREST, o.teamId.toString(), h, enums.PlaceholderAssetKey.CREST_DARK) && (p = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BADGE_DARK, h)), i[enums.UIActiveItemImgType.BADGE_DARK] = p | |
| } | |
| break; | |
| case enums.ItemState.ACTIVE_BALL: | |
| url = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BALL, h, u.assetId), utils.AssetLocator.hasPlaceholder(enums.PlaceholderAssetKey.BALLS, u.assetId, h) && (url = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BALL, h)), l = enums.UIActiveItemImgType.BALL; | |
| break; | |
| case enums.ItemState.ACTIVE_STADIUM: | |
| url = utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_STADIUM_FULL, h, u.assetId), l = enums.UIActiveItemImgType.STADIUM; | |
| break; | |
| case enums.ItemState.ACTIVE_HOME_KIT: | |
| url = utils.AssetLocator.getImage(u.assetType, h, o.teamId, u.assetYear), utils.AssetLocator.hasPlaceholderKit(url, h) && (url = utils.AssetLocator.getImage(u.assetType, h)), l = enums.UIActiveItemImgType.HOME_KIT; | |
| break; | |
| case enums.ItemState.ACTIVE_AWAY_KIT: | |
| url = utils.AssetLocator.getImage(u.assetType, h, o.teamId, u.assetYear), utils.AssetLocator.hasPlaceholderKit(url, h) && (url = utils.AssetLocator.getImage(u.assetType, h)), l = enums.UIActiveItemImgType.AWAY_KIT | |
| } | |
| utils.JS.isEmpty(url) || (i[l] = url) | |
| } | |
| }), s ? i[t] : i | |
| }, utils.JS.inherits(FUIView, FUIResponder), FUIView.prototype.getRoot = function getRoot() {}, FUIView.prototype.getRootElement = function getRootElement() {}, FUIView.prototype.getSuperview = function getSuperview() { | |
| return this._superview | |
| }, FUIView.prototype.destroyGeneratedElements = function destroyGeneratedElements() {}, FUIView.prototype.destroy = function destroy() { | |
| this.dealloc() | |
| }, FUIView.prototype.dealloc = function dealloc() { | |
| this.superclass(), this.removeSubviews(), this.destroyGeneratedElements() | |
| }, FUIView.prototype.removeSubviews = function removeSubviews(animate) { | |
| for (var t = this._subviews.length; t-- > 0;) this._subviews[0].view.removeFromSuperview(animate) | |
| }, FUIView.prototype.addSubview = function addSubview(view, t) { | |
| utils.Debug.Assert(view.conforms && view.conforms(FUIView), "Expected parameter to be of type FUIView."), view.willAddToSuperview(this), t && 0 !== this.getRoot().find(t).length || (t = this.getRoot()), this._subviews.push({ | |
| view: view, | |
| container: t | |
| }), view._superview = this, view.setEventDelegate(this), view.didAddToSuperview() | |
| }, FUIView.prototype.willAddToSuperview = function willAddToSuperview(view) {}, FUIView.prototype.didAddToSuperview = function didAddToSuperview() {}, FUIView.prototype.removeFromSuperview = function removeFromSuperview(animate) { | |
| function _completeRemoveFromSuperview() { | |
| this._remove(); | |
| var index = 0; | |
| utils.JS.find(this._superview._subviews, function(t, i) { | |
| return t.view === this && (index = i, !0) | |
| }.bind(this)), this.removeEventDelegate(this._superview), this._superview._subviews.splice(index, 1), this._superview.didRemoveSubview(this), this._superview = null | |
| } | |
| this._superview && (this._superview.willRemoveSubview(this), animate ? this.perform(enums.UIAnimation.FADE_OUT, _completeRemoveFromSuperview.bind(this)) : _completeRemoveFromSuperview.call(this)) | |
| }, FUIView.prototype.willRemoveSubview = function willRemoveSubview(view) {}, FUIView.prototype.didRemoveSubview = function didRemoveSubview(view) {}, FUIView.prototype.layoutSubviews = function layoutSubviews() { | |
| this._subviews.forEach(function(t) { | |
| t.view._remove(), t.container.append(t.view.getRootElement()) | |
| }, this) | |
| }, FUIView.prototype.isSubview = function isSubview(view) { | |
| return this === view || !!this._superview && this._superview.isSubview(view) | |
| }, FUIView.prototype._setInteractionStateFlag = function _setInteractionStateFlag(t) { | |
| return t = !!t, this._interactionState !== t && (this._interactionState = t, !0) | |
| }, FUIView.prototype.setInteractionState = function setInteractionState(t) { | |
| this._setInteractionStateFlag(t) && (this._interactionState ? this._startHandlingEvents(this.getRootElement()) : this._stopHandlingEvents()) | |
| }, FUIView.prototype.isInteractionEnabled = function isInteractionEnabled() { | |
| return this._interactionState | |
| }, FUIView.prototype.getBoundingClientRect = function getBoundingClientRect() { | |
| return this.getRootElement().getBoundingClientRect() | |
| }, | |
| FUIView.prototype.perform = function perform(t, i) { | |
| var s = this.getRootElement(); | |
| s && (this._addListener(enums.Event.ANIMATIONEND, s, function _onAnimateComplete(e) { | |
| this._removeListenersByNS("viewAnimate"), this.removeClass(t), utils.JS.isFunction(i) && i() | |
| }.bind(this), "viewAnimate"), this.addClass(t)) | |
| }, FUIView.prototype.show = function show() { | |
| var t = this.getRootElement(); | |
| "none" === t.style.display && (t.style.display = "none" !== this._defaultDisplay ? this._defaultDisplay : "block") | |
| }, FUIView.prototype.hide = function hide() { | |
| var t = this.getRootElement(), | |
| display = t.style.display; | |
| "none" !== display && (this._defaultDisplay = display, t.style.display = "none") | |
| }, FUIView.prototype.setDisplay = function setDisplay(t) { | |
| t = !!t, this.getRootElement().style.display = t ? "" : "none" | |
| }, FUIView.prototype.setVisibility = function setVisibility(t) { | |
| t = !!t, this.getRootElement().style.visibility = t ? "visible" : "hidden" | |
| }, FUIView.prototype.addClass = function addClass(t) { | |
| var root = this.getRootElement(); | |
| utils.JS.isValid(root) && DOMKit.addClass(root, t) | |
| }, FUIView.prototype.removeClass = function removeClass(t) { | |
| var root = this.getRootElement(); | |
| utils.JS.isValid(root) && DOMKit.removeClass(root, t) | |
| }, FUIView.prototype.toggleClass = function toggleClass(t, i) { | |
| var root = this.getRootElement(); | |
| utils.JS.isValid(root) && DOMKit.toggleClass(root, t, i) | |
| }, FUIView.prototype.hasClass = function hasClass(className) { | |
| var root = this.getRootElement(); | |
| return !!utils.JS.isValid(root) && DOMKit.hasClass(root, className) | |
| }, FUIView.prototype._remove = function _remove() { | |
| var root = this.getRootElement(); | |
| utils.JS.isValid(root) && DOMKit.remove(root) | |
| }, NamespaceManager.Register("components"), components.Header = function AppHeader() { | |
| FUIView.call(this), this._viewmodel = new viewmodels.Club([]), this._visible = !0, this.onHamburgerPress = new FUTObservable, Object.defineProperty(this, "onHamburgerPress", { | |
| writable: !1 | |
| }), this._touchHandler = new FUTTouchHandler, this._generate() | |
| }, utils.JS.inherits(components.Header, FUIView), components.Header.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("header"); | |
| t.setAttribute("id", "header"), this.__mainHeader = document.createElement("div"), this.$_mainHeader = $(this.__mainHeader), this.__mainHeader.classList.add("mainHeader"), this._backButton = new views.buttons.FlatButton, this._backButton.getRootElement().classList.add("back"), this._backButton.getRootElement().classList.add("headerButton"), this.__mainHeader.appendChild(this._backButton.getRootElement()), this._settingsButton = new views.buttons.FlatButton, this._settingsButton.getRootElement().classList.add("settings"), this._settingsButton.getRootElement().classList.add("headerButton"), this.__mainHeader.appendChild(this._settingsButton.getRootElement()), this._hamburgerButton = new views.buttons.FlatButton, this._hamburgerButton.getRootElement().classList.add("hamburger"), this._hamburgerButton.getRootElement().classList.add("headerButton"), this.__mainHeader.appendChild(this._hamburgerButton.getRootElement()), this.__pageTitle = document.createElement("span"), this.$_pageTitle = $(this.__pageTitle), this.__pageTitle.setAttribute("id", "futHeaderTitle"), this.__pageTitle.classList.add("pageTitle"), this.__mainHeader.appendChild(this.__pageTitle), t.appendChild(this.__mainHeader), this.__subHeader = document.createElement("div"), this.$_subHeader = $(this.__subHeader), this.__subHeader.classList.add("currency"), this.__currencyChange = document.createElement("span"), this.$_currencyChange = $(this.__currencyChange), this.__currencyChange.classList.add("balance-change"), this.__subHeader.appendChild(this.__currencyChange), this.__subTitle = document.createElement("span"), this.$_subTitle = $(this.__subTitle), this.__subTitle.classList.add("subTitle"), this.__subHeader.appendChild(this.__subTitle), this.__userCoins = document.createElement("div"), this.$_userCoins = $(this.__userCoins), this.__userCoins.setAttribute("id", "user-coin"); | |
| var i = document.createElement("div"); | |
| this.__coinsLabel = document.createElement("span"), this.$_coinsLabel = $(this.__coinsLabel), this.__coinsLabel.classList.add("user-currency-label"), | |
| i.appendChild(this.__coinsLabel); | |
| var s = document.createElement("i"); | |
| s.classList.add("icon_chevron"), s.classList.add("fut_icon"), i.appendChild(s), this.__coinsValue = document.createElement("span"), this.$_coinsValue = $(this.__coinsValue), this.__coinsValue.classList.add("user-currency-balance"), i.appendChild(this.__coinsValue), this.__userCoins.appendChild(i), this.__subHeader.appendChild(this.__userCoins), this.__userPoints = document.createElement("div"), this.$_userPoints = $(this.__userPoints), this.__userPoints.setAttribute("id", "user-point"); | |
| var o = document.createElement("span"); | |
| o.classList.add("add-icon"), this.__userPoints.appendChild(o); | |
| var l = document.createElement("div"); | |
| this.__fifaPointsLabel = document.createElement("span"), this.$_fifaPointsLabel = $(this.__fifaPointsLabel), this.__fifaPointsLabel.classList.add("user-currency-label"), l.appendChild(this.__fifaPointsLabel); | |
| var u = document.createElement("i"); | |
| u.classList.add("icon_chevron"), u.classList.add("fut_icon"), l.appendChild(u), this.__fifaPointsValue = document.createElement("span"), this.$_fifaPointsValue = $(this.__fifaPointsValue), this.__fifaPointsValue.classList.add("user-currency-balance"), l.appendChild(this.__fifaPointsValue), this.__userPoints.appendChild(l), this.__subHeader.appendChild(this.__userPoints), this.__userInfo = document.createElement("div"), this.$_userInfo = $(this.__userInfo), this.__userInfo.classList.add("user-info"); | |
| var h = document.createElement("div"); | |
| h.classList.add("user-data-container"), this.__established = document.createElement("span"), this.$_established = $(this.__established), this.__established.classList.add("user-info-date"), h.appendChild(this.__established), this.__userName = document.createElement("span"), this.$_userName = $(this.__userName), this.__userName.classList.add("user-info-club"), h.appendChild(this.__userName), this.__userInfo.appendChild(h), this._imageContainer = new components.ImageLoader, this._imageContainer.getRootElement().classList.add("imageContainer"), this.__userInfo.appendChild(this._imageContainer.getRootElement()), this.__subHeader.appendChild(this.__userInfo), t.appendChild(this.__subHeader), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.Header.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this.__mainHeader = null, this.$_mainHeader = null, this._backButton.destroy(), this._backButton = null, this._settingsButton.destroy(), this._settingsButton = null, this._hamburgerButton.destroy(), this._hamburgerButton = null, this.__pageTitle = null, this.$_pageTitle = null, this.__subHeader = null, this.$_subHeader = null, this.__currencyChange = null, this.$_currencyChange = null, this.__subTitle = null, this.$_subTitle = null, this.__userCoins = null, this.$_userCoins = null, this.__coinsLabel = null, this.$_coinsLabel = null, this.__coinsValue = null, this.$_coinsValue = null, this.__userPoints = null, this.$_userPoints = null, this.__fifaPointsLabel = null, this.$_fifaPointsLabel = null, this.__fifaPointsValue = null, this.$_fifaPointsValue = null, this.__userInfo = null, this.$_userInfo = null, this.__established = null, this.$_established = null, this.__userName = null, this.$_userName = null, this._imageContainer.destroy(), this._imageContainer = null | |
| }, components.Header.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.Header.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }; | |
| var gHeader = null; | |
| components.Header.NO_HEADER = -1, components.Header.EMPTY = 0, components.Header.SETTINGS_BUTTON = 2, components.Header.BACK_BUTTON = 4, components.Header.CURRENCY = 8, components.Header.FIFA_POINTS = 16, components.Header.HAMBURGER_BUTTON = 32, components.Header.HIDE_ON_MOBILE = 64, components.Header.HIDE_ON_LANDSCAPE = 128, components.Header.UNAUTHENTICATED = 256, components.Header.DEFAULT_CHILD_PAGE = components.Header.BACK_BUTTON | components.Header.CURRENCY | components.Header.FIFA_POINTS, components.Header.LANDING_CLASS = "companion", components.Header.FUT_CLASS = "fut", components.Header.HIDE_USER_INFO = "hide-user-info", | |
| components.Header.prototype.init = function init() { | |
| this.superclass(), this.getRoot().addClass(components.Header.HIDE_USER_INFO), this._backButton.init(), this._settingsButton.init(), this._hamburgerButton.init(), this._backButton.addTarget(this, this._eBackButtonClicked, enums.Event.TAP), this._settingsButton.addTarget(this, this._eSettingsButtonClicked, enums.Event.TAP), this._hamburgerButton.addTarget(this, function() { | |
| this.onHamburgerPress.notify() | |
| }, enums.Event.TAP), getDefaultDispatcher().addObserver(enums.AppNotification.ITEM_ACTIVATE, this, this.updateBadgeImage), gUserModel.addListener(models.UserModel.EVENT_USER_CREDITS_CHANGED, this, this.setCoins), gUserModel.addListener(models.UserModel.EVENT_USER_FIFACASH_CHANGED, this, this.setFifaPoints) | |
| }, components.Header.prototype.dealloc = function dealloc() { | |
| gUserModel.removeListener(models.UserModel.EVENT_USER_CREDITS_CHANGED, this, this.setCoins), gUserModel.removeListener(models.UserModel.EVENT_USER_FIFACASH_CHANGED, this, this.setFifaPoints), getDefaultDispatcher().removeObserver(enums.AppNotification.ITEM_ACTIVATE, this), this.onHamburgerPress.dealloc(), this.superclass() | |
| }, components.Header.prototype.setupContent = function setupContent() { | |
| if (this.getRoot().removeClass("is-pc"), this._touchHandler.stopTouchHandling(), gAuthenticationModel.getUser().getSelectedPersona().isPC && utils.OriginStore.init(function() { | |
| this.getRoot().addClass("is-pc"), this._touchHandler.handleTouch(this.$_userPoints), this._touchHandler.touchstart.observe(this, this.onPointsTouchStart), this._touchHandler.touchmove.observe(this, this.onPointsTouchEnd), this._touchHandler.touchend.observe(this, this.onPointsTouchEnd), this._touchHandler.tap.observe(this, this.openStoreButtonClicked) | |
| }.bind(this)), this.$_coinsLabel.text(gLocalization.lText("header.Coins")), this.$_fifaPointsLabel.text(gLocalization.lText("header.FifaPoints")), gAuthenticationModel.getFUTState() !== enums.FUTAuthState.NO_DATA && gAuthenticationModel.getUser().getSelectedPersona().hasClubForCurrentYear) { | |
| if (gAuthenticationModel.getUser().getSelectedPersona().hasFUT && gAuthenticationModel.isFullyAuthenticated()) this.updateBadgeImage(), this.$_userName.text(gUserModel.getUserVO().getClubName()), this.$_established.text(utils.TextUtils.localizeEstablishedDate(gUserModel.getUserVO().getEstablished())); | |
| else { | |
| var t = gAuthenticationModel.getUser().getSelectedPersona().getCurrentClub(); | |
| this._imageContainer.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BADGE_DARK, enums.Year.ASSET, t.assetId)), this.$_userName.text(t.name), this.$_established.text(utils.TextUtils.localizeEstablishedDate(new Date(1e3 * t.established))) | |
| } | |
| this.getRoot().removeClass(components.Header.HIDE_USER_INFO) | |
| } else this.getRoot().addClass(components.Header.HIDE_USER_INFO) | |
| }, components.Header.prototype.setTitle = function setTitle(t) { | |
| (t = t.trim()).length > 18 ? this.$_pageTitle.addClass("long-text") : this.$_pageTitle.removeClass("long-text"), this.$_pageTitle.html(t) | |
| }, components.Header.prototype.renderUnauthenticatedPersona = function renderUnauthenticatedPersona(t, i) { | |
| this.getRoot().removeClass(components.Header.HIDE_USER_INFO), this.$_userName.html(t), this.$_established.text(utils.TextUtils.localizeEstablishedDate(new Date(1e3 * i))) | |
| }, components.Header.prototype.setSubTitle = function setSubTitle(t) { | |
| this.$_subTitle.html(t) | |
| }, components.Header.prototype.updateBadgeImage = function updateBadgeImage() { | |
| this._imageContainer.setResource(this._viewmodel.getActiveItemURL(enums.UIActiveItemImgType.BADGE_NORMAL)) | |
| }, components.Header.prototype.setHeaderClass = function setHeaderClass(className) { | |
| var t = [components.Header.LANDING_CLASS, components.Header.FUT_CLASS].join(" "); | |
| this.$_mainHeader.removeClass(t), this.$_mainHeader.addClass(className) | |
| }, components.Header.prototype.setViewState = function setViewState(state) { | |
| this.hideAllElements(); | |
| var t = gSettingsModel.isServiceAvailable(models.SettingsModel.FIFA_POINTS_ENABLED); | |
| if (state !== components.Header.NO_HEADER) { | |
| this.setVisible(!0), this.$_pageTitle.toggleClass("fullWidth", state === components.Header.EMPTY), | |
| 0 != (state & components.Header.BACK_BUTTON) ? this._backButton.getRoot().removeClass("invisible") : 0 != (state & components.Header.SETTINGS_BUTTON) && this._settingsButton.getRoot().removeClass("invisible"), 0 != (state & components.Header.HAMBURGER_BUTTON) && this._hamburgerButton.getRoot().removeClass("invisible"), this.getRoot().toggleClass("hide-on-mobile", 0 != (state & components.Header.HIDE_ON_MOBILE)), this.getRoot().toggleClass("unauthentificated", 0 != (state & components.Header.UNAUTHENTICATED)), this.getRoot().parent().toggleClass("hide-header-on-mobile", 0 != (state & components.Header.HIDE_ON_MOBILE)), this.getRoot().parent().toggleClass("hide-header-on-landscape", 0 != (state & components.Header.HIDE_ON_LANDSCAPE)); | |
| var i = this.getRoot().parent(), | |
| s = 0 != (state & (components.Header.CURRENCY | components.Header.FIFA_POINTS)); | |
| this.$_subHeader.toggle(s), i.toggleClass("header-currency", s), this.$_subHeader.toggleClass("showFifaPoints", 0 != (state & components.Header.FIFA_POINTS) && t) | |
| } else this.setVisible(!1) | |
| }, components.Header.prototype.hideAllElements = function hideAllElements() { | |
| this.setVisible(!1), this.$_subHeader.hide(), this._backButton.getRoot().addClass("invisible"), this._settingsButton.getRoot().addClass("invisible"), this._hamburgerButton.getRoot().addClass("invisible") | |
| }, components.Header.prototype.setVisible = function setVisible(visible) { | |
| this._visible = visible, this._visible ? this.getRoot().parent().removeClass("noHeader") : this.getRoot().parent().addClass("noHeader") | |
| }, components.Header.prototype.setCoins = function setCoins(sender, t, i) { | |
| this._setCurrency(enums.Currency.COINS, t, i) | |
| }, components.Header.prototype.setFifaPoints = function setFifaPoints(sender, t, i) { | |
| this._setCurrency(enums.Currency.POINTS, t, i) | |
| }, components.Header.prototype._setCurrency = function _setCurrency(type, t, i) { | |
| var s = type === enums.Currency.COINS ? this.$_coinsValue : this.$_fifaPointsValue; | |
| i && t.newVal !== t.oldVal ? isPhone() ? this._animatePhoneCurrencyChange(type, t) : this._animateLandscapeCurrencyChange(type, t) : s.html(gLocalization.lNum(t.newVal)) | |
| }, components.Header.prototype._animatePhoneCurrencyChange = function _animatePhoneCurrencyChange(type, t) { | |
| var i = t.newVal - t.oldVal, | |
| s = type === enums.Currency.COINS ? this.$_coinsValue : this.$_fifaPointsValue, | |
| o = type === enums.Currency.COINS ? "coinsChange" : "pointsChange"; | |
| this.$_currencyChange.html((i > 0 ? "+" : "") + gLocalization.lNum(i)), this.$_subHeader.addClass(o), this.$_subHeader.on(enums.Event.ANIMATIONEND, function(e) { | |
| s.html(gLocalization.lNum(t.newVal)), $(this).removeClass(o), $(this).off(e) | |
| }) | |
| }, components.Header.prototype._animateLandscapeCurrencyChange = function _animateLandscapeCurrencyChange(type, t) { | |
| var i = t.newVal - t.oldVal, | |
| s = i > 0 ? "more" : "less", | |
| o = type === enums.Currency.COINS ? this.$_coinsValue : this.$_fifaPointsValue, | |
| l = type === enums.Currency.COINS ? this.$_userCoins : this.$_userPoints, | |
| u = type === enums.Currency.COINS ? "coinsChange" : "pointsChange"; | |
| o.html((i > 0 ? "+" : "") + gLocalization.lNum(i)), l.addClass("anim-" + s), setTimeout(function() { | |
| o.html(gLocalization.lNum(t.newVal)), l.removeClass("anim-" + s), l.addClass(s) | |
| }.bind(this), 1e3), l.on(enums.Event.ANIMATIONEND, function(e) { | |
| l.removeClass(s), l.addClass(u), setTimeout(function() { | |
| l.removeClass(u) | |
| }.bind(this), 1e3), $(this).off(e) | |
| }) | |
| }, components.Header.prototype.setup = function setup(t) { | |
| this.setViewState(t.getHeaderState()) | |
| }, components.Header.prototype._eBackButtonClicked = function _eBackButtonClicked(sender, event, data) { | |
| NavManager.requestGoBackScreen() | |
| }, components.Header.prototype._eSettingsButtonClicked = function _eSettingsButtonClicked(sender, event, data) { | |
| NavManager.requestChildScreen(Screens.getView("APP_SETTINGS")) | |
| }, components.Header.prototype.openStoreButtonClicked = function openStoreButtonClicked(t, e) { | |
| gSettingsModel.isServiceAvailable(models.SettingsModel.MTX_ENABLED) ? utils.OriginStore.openStore() : this.removeClass("is-pc") | |
| }, components.Header.prototype.onPointsTouchStart = function onPointsTouchStart(t, e) { | |
| this.$_userPoints.addClass("active") | |
| }, components.Header.prototype.onPointsTouchEnd = function onPointsTouchEnd(t, e) { | |
| this.$_userPoints.removeClass("active") | |
| }, | |
| utils.JS.inherits(FUITargetActionView, FUIView), FUITargetActionView.prototype.dealloc = function dealloc() { | |
| this._targets.clear(), this._targets = null, this.superclass() | |
| }, FUITargetActionView.prototype.addTarget = function addTarget(target, action, event) { | |
| this.getActions(target, event).indexOf(action) >= 0 || (this._targets.has(event) ? this._targets.get(event).push(Object.freeze({ | |
| target: target, | |
| action: action | |
| })) : this._targets.set(event, [Object.freeze({ | |
| target: target, | |
| action: action | |
| })])) | |
| }, FUITargetActionView.prototype.removeTarget = function removeTarget(target, action, event) { | |
| if (this._targets.has(event)) { | |
| this._targets.get(event); | |
| var t = this._targets.get(event).filter(function(t) { | |
| return !(t.target === target && t.action === action) | |
| }); | |
| this._targets.set(event, t) | |
| } | |
| }, FUITargetActionView.prototype.getActions = function getActions(target, event) { | |
| var t = [], | |
| i = this._targets.get(event); | |
| return i && (t = i.reduce(function(t, i) { | |
| return i.target === target && t.push(i.action), t | |
| }, [])), t | |
| }, FUITargetActionView.prototype._triggerActions = function _triggerActions(event, data) { | |
| data = data || null, this._targets.has(event) && this._targets.get(event).forEach(function(t) { | |
| t.action.call(t.target, this, event, data) | |
| }, this) | |
| }, utils.JS.inherits(FUIControl, FUITargetActionView), FUIControl.prototype.addTarget = function addTarget(target, action, event) { | |
| var t = this._evaluateEventString(event); | |
| utils.Debug.Assert(t, "Invalid assignment; expected enums.Event.<string>"), t && this.superclass(target, action, event) | |
| }, FUIControl.prototype.removeTarget = function removeTarget(target, action, event) { | |
| var t = this._evaluateEventString(event); | |
| utils.Debug.Assert(t, "Invalid assignment; expected enums.Event.<string>"), t && this.superclass(target, action, event) | |
| }, FUIControl.prototype.getActions = function getActions(target, event) { | |
| var t = this._evaluateEventString(event); | |
| return utils.Debug.Assert(t, "Invalid assignment; expected enums.Event.<string>"), t ? this.superclass(target, event) : [] | |
| }, FUIControl.prototype._triggerActions = function _triggerActions(event, data) { | |
| var t = this._evaluateEventString(event); | |
| utils.Debug.Assert(t, "Invalid assignment; expected enums.Event.<string>"), t && this.superclass(event, data) | |
| }, FUIControl.prototype._evaluateEventString = function _evaluateEventString(t) { | |
| var i; | |
| for (i in enums.Event) | |
| if (enums.Event.hasOwnProperty(i) && t === enums.Event[i]) return !0; | |
| return !1 | |
| }, utils.JS.inherits(FUIButton, FUIControl), FUIButton.prototype.init = function init() { | |
| this.superclass(), this.setInteractionState(!0) | |
| }, FUIButton.prototype.setInteractionState = function setInteractionState(t) { | |
| var i = this._interactionState; | |
| this.superclass(t), this._interactionState !== i && (this.getRootElement().disabled = !this._interactionState, this.toggleClass(enums.UIButtonState.DISABLED, !this._interactionState), this._interactionState || this.removeClass([enums.UIButtonState.ACTIVE, enums.UIButtonState.HOVER].join(" "))) | |
| }, FUIButton.prototype.setText = function setText(text) { | |
| this.getRootElement().textContent = text | |
| }, FUIButton.prototype._touchStarted = function _touchStarted(e) { | |
| this.superclass(), this.addClass(enums.UIButtonState.ACTIVE) | |
| }, FUIButton.prototype._touchMoved = function _touchMoved(e) { | |
| this.superclass(), this.removeClass(enums.UIButtonState.ACTIVE) | |
| }, FUIButton.prototype._touchEnded = function _touchEnded(e) { | |
| this.superclass(), this.removeClass(enums.UIButtonState.ACTIVE) | |
| }, FUIButton.prototype._touchCancelled = function _touchCancelled(e) { | |
| this.superclass(), this.removeClass(enums.UIButtonState.ACTIVE) | |
| }, FUIButton.prototype._mouseLeave = function _mouseLeave(e) { | |
| this.superclass(), this.removeClass(enums.UIButtonState.ACTIVE), this.removeClass(enums.UIButtonState.HOVER) | |
| }, FUIButton.prototype._mouseEnter = function _mouseEnter(e) { | |
| this.superclass(), this.addClass(enums.UIButtonState.HOVER) | |
| }, FUIButton.prototype._tapDetected = function _tapDetected(e) { | |
| this.superclass(), this._triggerActions(enums.Event.TAP) | |
| }, NamespaceManager.Register("components"), components.NotificationBubble = function() { | |
| this._generate() | |
| }, components.NotificationBubble.prototype._generate = function _generate() { | |
| this._generated || (this.__notificationBubble = document.createElement("div"), this.$_notificationBubble = $(this.__notificationBubble), this.__notificationBubble.classList.add("footerNotification"), this.__root = this.__notificationBubble, this.$_root = $(this.$_notificationBubble), this._generated = !0) | |
| }, components.NotificationBubble.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this.__notificationBubble = null, this.$_notificationBubble = null | |
| }, components.NotificationBubble.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.NotificationBubble.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.NotificationBubble.prototype.destroy = function() { | |
| this.destroyGeneratedElements() | |
| }, components.NotificationBubble.prototype.toggle = function(t) { | |
| this.$_notificationBubble.toggle(t) | |
| }, components.NotificationBubble.prototype.setNumber = function(value) { | |
| var t = utils.JS.isValid(value) && value > 0; | |
| this.toggle(t), this.$_notificationBubble.html(t ? gLocalization.lNum(value) : "") | |
| }, NamespaceManager.Register("components"), components.FooterButton = function FUIFooterButton() { | |
| FUIButton.call(this), this._unreadBubble = null, this._generate() | |
| }, utils.JS.inherits(components.FooterButton, FUIButton), components.FooterButton.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("button"); | |
| t.classList.add("btnFooter"), t.setAttribute("aria-disabled", "false"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.FooterButton.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, components.FooterButton.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.FooterButton.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.FooterButton.prototype.dealloc = function dealloc() { | |
| this.removeUnreadBubble(), this.superclass() | |
| }, components.FooterButton.prototype.removeUnreadBubble = function removeUnreadBubble() { | |
| utils.JS.isValid(this._unreadBubble) && (this.removeClass("unreadBubble"), this._unreadBubble.destroy(), this._unreadBubble = null) | |
| }, components.FooterButton.prototype.addUnreadBubble = function addUnreadBubble() { | |
| var root = this.getRoot(); | |
| utils.JS.isValid(this._unreadBubble) || (this.addClass("unreadBubble"), this._unreadBubble = new components.NotificationBubble), root.append(this._unreadBubble.getRoot()) | |
| }, NamespaceManager.Register("components"), components.Footer = function AppFooterView() { | |
| FUIView.call(this), this._generate() | |
| }, utils.JS.inherits(components.Footer, FUIView), components.Footer.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("nav"); | |
| t.setAttribute("id", "footer"), this._btnLogo = new components.FooterButton, this._btnLogo.getRootElement().classList.add("btnLogo"), t.appendChild(this._btnLogo.getRootElement()), this._btnHome = new components.FooterButton, this._btnHome.getRootElement().classList.add("btnHome"), t.appendChild(this._btnHome.getRootElement()), this._btnSquads = new components.FooterButton, this._btnSquads.getRootElement().classList.add("btnSquads"), t.appendChild(this._btnSquads.getRootElement()), this._btnSBC = new components.FooterButton, this._btnSBC.getRootElement().classList.add("btnSBC"), t.appendChild(this._btnSBC.getRootElement()), this._btnTransfers = new components.FooterButton, this._btnTransfers.getRootElement().classList.add("btnTransfers"), t.appendChild(this._btnTransfers.getRootElement()), this._btnStore = new components.FooterButton, this._btnStore.getRootElement().classList.add("btnStore"), t.appendChild(this._btnStore.getRootElement()), this._btnClub = new components.FooterButton, this._btnClub.getRootElement().classList.add("btnClub"), t.appendChild(this._btnClub.getRootElement()), this._btnSettings = new components.FooterButton, this._btnSettings.getRootElement().classList.add("btnSettings"), t.appendChild(this._btnSettings.getRootElement()), this.__root = t, | |
| this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.Footer.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this._btnLogo.destroy(), this._btnLogo = null, this._btnHome.destroy(), this._btnHome = null, this._btnSquads.destroy(), this._btnSquads = null, this._btnSBC.destroy(), this._btnSBC = null, this._btnTransfers.destroy(), this._btnTransfers = null, this._btnStore.destroy(), this._btnStore = null, this._btnClub.destroy(), this._btnClub = null, this._btnSettings.destroy(), this._btnSettings = null | |
| }, components.Footer.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.Footer.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.Footer.prototype.init = function init() { | |
| this.superclass(), isPhone() && this._btnSBC.setDisplay(!1), this._btnLogo.init(), this._btnHome.init(), this._btnSquads.init(), this._btnSBC.init(), this._btnTransfers.init(), this._btnStore.init(), this._btnClub.init(), this._btnSettings.init(), this._btnLogo.addTarget(this, function() { | |
| this.gotoScreen("HOME") | |
| }, enums.Event.TAP), this._btnHome.addTarget(this, function() { | |
| this.gotoScreen("HOME") | |
| }, enums.Event.TAP), this._btnSquads.addTarget(this, function() { | |
| this.gotoScreen("SQUADS_HUB") | |
| }, enums.Event.TAP), this._btnSBC.addTarget(this, function() { | |
| this.gotoScreen("SBC_HUB") | |
| }, enums.Event.TAP), this._btnTransfers.addTarget(this, function() { | |
| this.gotoScreen("TRANSFERS_HUB") | |
| }, enums.Event.TAP), this._btnStore.addTarget(this, function() { | |
| this.gotoScreen("STORE_HUB") | |
| }, enums.Event.TAP), this._btnClub.addTarget(this, function() { | |
| this.gotoScreen("CLUB_HUB") | |
| }, enums.Event.TAP), this._btnSettings.addTarget(this, function() { | |
| this.gotoScreen("APP_SETTINGS") | |
| }, enums.Event.TAP), this._btnHome.setText(gLocalization.lText("navbar.label.home")), this._btnSquads.setText(gLocalization.lText("nav.label.squads")), this._btnSBC.setText(gLocalization.lText("nav.label.sbc")), this._btnTransfers.setText(gLocalization.lText("nav.label.trading")), this._btnStore.setText(gLocalization.lText("navbar.label.store")), this._btnClub.setText(gLocalization.lText("nav.label.club")), this._btnSettings.setText(gLocalization.lText("button.settings")), this._btnHome.addClass(enums.UIState.SELECTED), NavManager.onScreenRequest.observe(this, this._onScreenRequested), this._toggleStoreNotificationBubble(repositories.User.getCurrent().getNumUnopenedPacks() > 0), getDefaultDispatcher().addObserver(enums.AppNotification.STORE_PACK_COUNT_CHANGE, this, this._nStorePackChange) | |
| }, components.Footer.prototype.dealloc = function dealloc() { | |
| NavManager.onScreenRequest.unobserve(this), getDefaultDispatcher().removeObserver(enums.AppNotification.STORE_PACK_COUNT_CHANGE, this), this.superclass() | |
| }, components.Footer.prototype.setInteractionState = function setInteractionState(t) { | |
| this.superclass(t), this._btnLogo.setInteractionState(t), this._btnHome.setInteractionState(t), this._btnSquads.setInteractionState(t), this._btnSBC.setInteractionState(t), this._btnTransfers.setInteractionState(t), this._btnStore.setInteractionState(t), this._btnClub.setInteractionState(t), this._btnSettings.setInteractionState(t) | |
| }, components.Footer.prototype._onScreenRequested = function _onScreenRequested(t, i, s, o) { | |
| s === NavManager.SCREEN_TYPE.ROOT ? (this._btnHome.toggleClass(enums.UIState.SELECTED, i === Screens.getView("HOME")), this._btnSquads.toggleClass(enums.UIState.SELECTED, i === Screens.getView("SQUADS_HUB")), this._btnSBC.toggleClass(enums.UIState.SELECTED, i === Screens.getView("SBC_HUB")), this._btnTransfers.toggleClass(enums.UIState.SELECTED, i === Screens.getView("TRANSFERS_HUB")), this._btnStore.toggleClass(enums.UIState.SELECTED, i === Screens.getView("STORE_HUB")), this._btnClub.toggleClass(enums.UIState.SELECTED, i === Screens.getView("CLUB_HUB")), | |
| this._btnSettings.toggleClass(enums.UIState.SELECTED, i === Screens.getView("APP_SETTINGS"))) : o !== Screens.APP_SECTION.SETTINGS || isPhone() || this._btnSettings.hasClass(enums.UIState.SELECTED) || (DOMKit.removeClass(this.getRootElement().getElementsByTagName("button"), enums.UIState.SELECTED), this._btnSettings.addClass(enums.UIState.SELECTED)) | |
| }, components.Footer.prototype.gotoScreen = function gotoScreen(t) { | |
| gTelemetryManager.trackEvent(TelemetryManager.Sections.MISC, TelemetryManager.Categories.BUTTON_PRESS, "Nav - " + t), NavManager.requestRootScreen(Screens.getView(t)) | |
| }, components.Footer.prototype.show = function show() { | |
| var root = this.getRootElement(); | |
| root && root.parentNode && DOMKit.removeClass(root.parentNode, "noFooter") | |
| }, components.Footer.prototype.hide = function hide() { | |
| var root = this.getRootElement(); | |
| root && root.parentNode && DOMKit.addClass(root.parentNode, "noFooter") | |
| }, components.Footer.prototype.toggle = function toggle(t) { | |
| var root = this.getRootElement(); | |
| root && root.parentNode && DOMKit.toggleClass(root.parentNode, "noFooter", t) | |
| }, components.Footer.prototype.reset = function reset() { | |
| NavManager.onScreenRequest.unobserve(this), this._btnStore.removeUnreadBubble() | |
| }, components.Footer.prototype.isVisible = function isVisible() { | |
| var root = this.getRootElement(); | |
| return !(!root || !root.parentNode) && !DOMKit.hasClass(root.parentNode, "noFooter") | |
| }, components.Footer.prototype.getStoreButton = function getStoreButton() { | |
| return this._btnStore | |
| }, components.Footer.prototype._toggleStoreNotificationBubble = function _toggleStoreNotificationBubble(t) { | |
| t ? this._btnStore.addUnreadBubble() : this._btnStore.removeUnreadBubble() | |
| }, components.Footer.prototype._nStorePackChange = function _nStorePackChange(t, object, data) { | |
| this._toggleStoreNotificationBubble(data.unopenedPacks > 0) | |
| }; | |
| var gFooter = new components.Footer, | |
| Screens = { | |
| _controllers: {}, | |
| _views: {}, | |
| _sections: {}, | |
| _pin: {} | |
| }; | |
| Screens.Register = function(t, view, i, s) { | |
| Screens[t] = view, Screens._sections[view] = i, utils.JS.isString(s) && (Screens._pin[view] = s) | |
| }, Screens.getView = function(t) { | |
| return Screens[t] || "" | |
| }, Screens.setPINName = function(t, i) { | |
| Screens._pin[t] = i | |
| }, Screens.getPINName = function(t) { | |
| return Screens._pin[t] | |
| }, Screens.OverrideView = function(t, i) { | |
| Screens._views[Screens[t]] = i | |
| }, Screens.OverrideController = function(t, i) { | |
| Screens._controllers[Screens[t]] = i | |
| }, Screens.CreateScreen = function(t) { | |
| var i = pages.controllers, | |
| s = Screens._views[t], | |
| o = Screens._controllers[t], | |
| l = s && pages[s] || pages[t], | |
| u = o && i[o] || i[t + "Controller"] || i.ScreenControllerBase; | |
| l || utils.Debug.Assert(!1, "Unable to find screen by id " + t + " (doesn't exist and no override was found)"), i.ScreenControllerBase; | |
| var h = new l, | |
| p = new u(h); | |
| return h.setController(p), h | |
| }, Screens.APP_SECTION = { | |
| NONE: "", | |
| LOGIN: "LOGIN", | |
| MOBILE_START: "MOBILE_START", | |
| HOME: "HOME", | |
| FUT: "FUT", | |
| PLAYER_SEARCH: "PLAYER_SEARCH", | |
| AUCTION_SEARCH: "AUCTION_SEARCH", | |
| WATCH_LIST: "WATCH_LIST", | |
| SQUADS: "SQUADS", | |
| OBJECTIVES: "OBJECTIVES", | |
| SBC: "SBC", | |
| TOTW: "TOTW", | |
| CLUB: "CLUB", | |
| TRADE_PILE: "TRADE_PILE", | |
| UNASSIGNED: "UNASSIGNED", | |
| STORE: "STORE", | |
| SERVICE_UNAVAILABLE: "SCREEN_SERVICE_UNAVAILABLE", | |
| SETTINGS: "SETTINGS", | |
| DEBUG: "DEBUG" | |
| }, NamespaceManager.Register("components"), components.FUTBody = function() { | |
| components.BaseComponent.call(this), this._generate() | |
| }, utils.JS.inherits(components.FUTBody, components.BaseComponent), components.FUTBody.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("section"); | |
| t.classList.add("content"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.FUTBody.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, components.FUTBody.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.FUTBody.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.FUTBody.prototype.scrollTopTo = function(t) { | |
| $("#scrollWrapper", this.getRoot()).scrollTop(t) | |
| }, components.FUTBody.prototype.setVisibility = function(t) { | |
| this.getRoot().toggleClass("invisible", !t) | |
| }; | |
| var gFUTBody = new components.FUTBody; | |
| NamespaceManager.Register("components"), components.ClickShield = function ClickShieldView() { | |
| FUIView.call(this), this._shieldCounter = { | |
| FULL: 0, | |
| LOADING: 0, | |
| INTERACTION: 0 | |
| }, this.dismissed = new FUTObservable, Object.defineProperty(this, "dismissed", { | |
| writable: !1 | |
| }), this._generate(), this._update(), this._startHandlingEvents(this.getRootElement()) | |
| }, utils.JS.inherits(components.ClickShield, FUIView), components.ClickShield.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.setAttribute("id", "ClickShield"), this.__loaderIcon = document.createElement("img"), this.$_loaderIcon = $(this.__loaderIcon), this.__loaderIcon.setAttribute("src", "images/loader.svg"), this.__loaderIcon.classList.add("loaderIcon"), t.appendChild(this.__loaderIcon), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, components.ClickShield.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this.__loaderIcon = null, this.$_loaderIcon = null | |
| }, components.ClickShield.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, components.ClickShield.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, components.ClickShield.SHIELD = { | |
| NONE: 0, | |
| FULL: 1, | |
| LOADING: 2, | |
| INTERACTION: 4 | |
| }, components.ClickShield.prototype.dealloc = function dealloc() { | |
| this._stopHandlingEvents(), this.reset(), this.superclass() | |
| }, components.ClickShield.prototype.reset = function reset() { | |
| this._shieldCounter.FULL = 0, this._shieldCounter.LOADING = 0, this._shieldCounter.INTERACTION = 0, this._update() | |
| }, components.ClickShield.prototype.showShield = function(t) { | |
| if (t !== components.ClickShield.SHIELD.NONE) { | |
| switch (t) { | |
| case components.ClickShield.SHIELD.FULL: | |
| ++this._shieldCounter.FULL; | |
| break; | |
| case components.ClickShield.SHIELD.LOADING: | |
| ++this._shieldCounter.LOADING; | |
| break; | |
| case components.ClickShield.SHIELD.INTERACTION: | |
| ++this._shieldCounter.INTERACTION | |
| } | |
| this.__loaderIcon.src = isIE() ? "images/loader.gif" : "images/loader.svg", this._update() | |
| } | |
| }, components.ClickShield.prototype.hideShield = function(t) { | |
| if (t !== components.ClickShield.SHIELD.NONE) { | |
| switch (t) { | |
| case components.ClickShield.SHIELD.FULL: | |
| utils.Debug.Assert(this._shieldCounter.FULL - 1 >= 0, "Hiding full shield when counter is 0."), this._shieldCounter.FULL >= 1 && --this._shieldCounter.FULL; | |
| break; | |
| case components.ClickShield.SHIELD.LOADING: | |
| utils.Debug.Assert(this._shieldCounter.LOADING - 1 >= 0, "Hiding loading shield when counter is 0."), this._shieldCounter.LOADING >= 1 && --this._shieldCounter.LOADING; | |
| break; | |
| case components.ClickShield.SHIELD.INTERACTION: | |
| utils.Debug.Assert(this._shieldCounter.INTERACTION - 1 >= 0, "Hiding interaction shield when counter is 0."), this._shieldCounter.INTERACTION >= 1 && --this._shieldCounter.INTERACTION | |
| } | |
| this._update(), this.isShowing() || this.dismissed.notify() | |
| } | |
| }, components.ClickShield.prototype.isShowing = function isShowing() { | |
| return this._shieldCounter.FULL > 0 || this._shieldCounter.LOADING > 0 || this._shieldCounter.INTERACTION > 0 | |
| }, components.ClickShield.prototype.isInteractionShieldShowing = function isInteractionShieldShowing() { | |
| return this._shieldCounter.INTERACTION > 0 | |
| }, components.ClickShield.prototype._update = function _update() { | |
| DOMKit.toggleDisplayStyle(this.__loaderIcon, this._shieldCounter.LOADING > 0); | |
| var t = this._shieldCounter.INTERACTION > 0 && !(this._shieldCounter.LOADING > 0 || this._shieldCounter.FULL > 0); | |
| this.setDisplay(this.isShowing()), this.toggleClass("interaction", t) | |
| }, components.ClickShield.prototype._tapDetected = function _tapDetected(e) { | |
| this.superclass(), hideKeyboard() | |
| }; | |
| var gClickShield = new components.ClickShield; | |
| NamespaceManager.Register("valueobjects"), valueobjects.PinEventVO = function(t, i) { | |
| var s = gAuthenticationModel.getUser(); | |
| this._coreParams = { | |
| s: gPinManager.getCurrentStep(), | |
| pidt: "persona", | |
| pid: s && s.getSelectedPersona() ? s.getSelectedPersona().id : "", | |
| pidm: { | |
| nucleus: s ? s.id : 0 | |
| }, | |
| didm: { | |
| uuid: getUUID() | |
| }, | |
| ts_event: (new Date).toISOString(), | |
| en: t | |
| }, this._otherParams = i | |
| }, valueobjects.PinEventVO.prototype.parseData = function(data) { | |
| this._coreParams = data._coreParams, | |
| this._otherParams = data._otherParams | |
| }, valueobjects.PinEventVO.prototype.getCoreParams = function() { | |
| return utils.JS.isValid(gAuthenticationModel.getUser()) && (this._coreParams.dob = gAuthenticationModel.getUser().dateOfBirth.slice(0, -3)), this._coreParams | |
| }, valueobjects.PinEventVO.prototype.getOtherParams = function() { | |
| return this._otherParams | |
| }, valueobjects.PinEventVO.prototype.addOtherParam = function(name, value) { | |
| this._otherParams[name] = value | |
| }, NamespaceManager.Register("utils"), utils.PinFactory = {}, utils.PinFactory.bootStartCounter = 0, utils.PinFactory.createEvent = function(t, i) { | |
| var event = new valueobjects.PinEventVO(t, i); | |
| return t === enums.PIN.EVENT.BOOT_START && (i.source = utils.PinFactory.bootStartCounter + "-" + i.source, utils.PinFactory.bootStartCounter++), event | |
| }, utils.PinFactory.createPayload = function(t) { | |
| var i = utils.PinFactory._setupPayload(); | |
| return t.forEach(function(e, t) { | |
| i.events.push(e.getOtherParams()), i.events[t].core = e.getCoreParams() | |
| }), i | |
| }, utils.PinFactory._setupPayload = function() { | |
| var version = getAppVersion(); | |
| isChrome() || (version += "." + gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_CHANGELIST)); | |
| var t = gPinManager.getUniqueSessionID(), | |
| i = { | |
| taxv: PinManager.TAXONOMY_VERSION, | |
| tidt: PinManager.TITLE_ID_TYPE, | |
| tid: enums.SKU.FUT, | |
| rel: "prod", | |
| v: version, | |
| ts_post: (new Date).toISOString(), | |
| sid: t, | |
| gid: 0, | |
| plat: "web", | |
| et: "client", | |
| loc: gLocalization.getEffectiveLocale(), | |
| is_sess: !utils.JS.isEmpty(t), | |
| custom: { | |
| networkAccess: isChrome() || "wifi" === navigator.connection.type ? "W" : "G" | |
| }, | |
| events: [] | |
| }, | |
| s = gAuthenticationModel.getUser(), | |
| o = utils.JS.isValid(s) ? s.getSelectedPersona() : null; | |
| return utils.JS.isValid(o) && (i.custom.service_plat = o.platform.toLowerCase()), i | |
| }, communication.LogoutDelegate = function() { | |
| communication.BaseFUTDelegate.call(this) | |
| }, utils.JS.inherits(communication.LogoutDelegate, communication.BaseFUTDelegate), communication.LogoutDelegate.prototype.execute = function() { | |
| if (this.getSessionInfo().isAuthenticated()) { | |
| this.useClickShield(!0), this.setRequest("/ut/auth", models.CommunicationModel.METHOD.DELETE, models.CommunicationModel.RESPONSE.EMPTY, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| } else this.dispatch(communication.BaseDelegate.SUCCESS) | |
| }, communication.PileSizeDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "clientdata/pileSize", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON | |
| }, utils.JS.inherits(communication.PileSizeDelegate, communication.BaseFUTDelegate), communication.PileSizeDelegate.prototype.onSuccess = function(t) { | |
| if (communication.PileSizeDelegate.superClass_.onSuccess.call(this, t), t.entries && t.entries.length) { | |
| var i, s, o = t.entries.length; | |
| for (i = 0; i < o; ++i) switch ((s = t.entries[i]).key) { | |
| case communication.PileSizeDelegate.PILE_ID_TRADEPILE: | |
| repositories.Item.setPileSize(enums.FUTItemPile.TRANSFER, s.value); | |
| break; | |
| case communication.PileSizeDelegate.PILE_ID_WATCHLIST: | |
| repositories.Item.setPileSize(enums.FUTItemPile.INBOX, s.value); | |
| break; | |
| case communication.PileSizeDelegate.PILE_ID_SQUADSLOTS: | |
| repositories.Squad.MAX_SQUADS = s.value; | |
| break; | |
| case communication.PileSizeDelegate.MAX_ALLOWED_AUCTIONS: | |
| repositories.Item.maxAllowedAuctions = s.value | |
| } | |
| } | |
| }, communication.PileSizeDelegate.PILE_ID_TRADEPILE = 2, communication.PileSizeDelegate.PILE_ID_CONSUMABLES = 3, communication.PileSizeDelegate.PILE_ID_WATCHLIST = 4, communication.PileSizeDelegate.PILE_ID_SQUADSLOTS = 6, communication.PileSizeDelegate.MAX_ALLOWED_AUCTIONS = 11, communication.SquadLoadDelegate = function SquadLoadDelegate(t, i) { | |
| communication.BaseFUTDelegate.call(this); | |
| var s = enums.UserSquadId.ACTIVE; | |
| if (utils.JS.isNumber(t) && t >= 0) s = t.toString(); | |
| else { | |
| var o; | |
| for (o in enums.UserSquadId) enums.UserSquadId.hasOwnProperty(o) && enums.UserSquadId[o] === t && (s = t) | |
| } | |
| var url = communication.BaseFUTDelegate.REQUEST_ROOT + "squad/" + s; | |
| utils.JS.isNumber(i) && i > 0 && (url += "/user/" + i.toString()), | |
| this.setRequest(url, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON) | |
| }, utils.JS.inherits(communication.SquadLoadDelegate, communication.BaseFUTDelegate), communication.UserModelDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "user", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON | |
| }, utils.JS.inherits(communication.UserModelDelegate, communication.BaseFUTDelegate), communication.UserModelDelegate.prototype.onSuccess = function(response) { | |
| var t = new valueobjects.UserVO; | |
| t.setClubName(response.clubName), t.setClubAbbr(response.clubAbbr), t.setEstablished(new Date(1e3 * response.established)), t.setTrophies(response.trophies), t.setWins(response.won), t.setDraws(response.draw), t.setLosses(response.loss), t.setBadgeId(this.parseClubIdFromActivesData(response.actives)); | |
| var i = new valueobjects.CurrencyVO; | |
| if (i.parseCurrencyDataObject(response.currencies), gUserModel.setPersonaName(response.personaName), gUserModel.setUserVO(t), gUserModel.setCurrencyVO(i), gUserModel.setCurrencyDirtyFlag(!1), utils.JS.isValid(response.feature) && utils.JS.isValid(response.feature.trade) ? gUserModel.setTradeAccess(parseInt(response.feature.trade, 10)) : gUserModel.setTradeAccess(models.UserModel.TRADE_ACCESS.MAINTENANCE), response.unopenedPacks) { | |
| var s = repositories.User.getCurrent(); | |
| s && s.setNumUnopenedPacks((response.unopenedPacks.recoveredPacks || 0) + (response.unopenedPacks.preOrderPacks || 0)) | |
| } | |
| var o = factories.Item.generateItemsFromItemData(response.actives, null); | |
| repositories.Item.add(o), this.dispatch(communication.BaseDelegate.SUCCESS) | |
| }, communication.UserModelDelegate.prototype.parseClubIdFromActivesData = function(t) { | |
| var object, i = 0; | |
| for (object in t) | |
| if (t.hasOwnProperty(object) && (object = t[object], enums.ItemType.BADGE === object.itemType)) { | |
| i = object.assetId; | |
| break | |
| } | |
| return i | |
| }, communication.UserMassInfoDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this._url = communication.BaseFUTDelegate.REQUEST_ROOT + "usermassinfo", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON | |
| }, utils.JS.inherits(communication.UserMassInfoDelegate, communication.BaseFUTDelegate), communication.UserMassInfoDelegate.prototype.onSuccess = function(t) { | |
| function callDelegate(t) { | |
| s++, t.addListener(communication.BaseDelegate.SUCCESS, this, delegateComplete), t.addListener(communication.BaseDelegate.FAIL, this, delegateComplete), t.send() | |
| } | |
| function delegateComplete() { | |
| 0 === --s && this.dispatch(communication.BaseDelegate.SUCCESS) | |
| } | |
| var i, s = 0; | |
| if (t.settings && gSettingsModel.setConfigs(t.settings.configs), i = new communication.UserModelDelegate, t.userInfo ? i.onSuccess(t.userInfo) : callDelegate.call(this, i), i = new communication.PileSizeDelegate, t.pileSizeClientData ? i.onSuccess(t.pileSizeClientData) : callDelegate.call(this, i), t.purchasedItems && repositories.Item.setUnassignedItemsFromPayload(t.purchasedItems), t.squad) repositories.Squad.storeSquad(gAuthenticationModel.getUser().selectedPersona, t.squad), repositories.Squad.setActiveSquadId(t.squad.id); | |
| else { | |
| s++; | |
| var o = new communication.SquadLoadDelegate; | |
| o.addListener(communication.BaseDelegate.SUCCESS, this, function _loadSquadSuccess(sender, data) { | |
| sender.clearListenersByScope(this), repositories.Squad.storeSquad(gAuthenticationModel.getUser().selectedPersona, data), repositories.Squad.setActiveSquadId(data.id), delegateComplete.call(this) | |
| }), o.addListener(communication.BaseDelegate.FAIL, this, function _loadSquadFail(sender, error) { | |
| sender.clearListenersByScope(this), delegateComplete.call(this) | |
| }), o.send() | |
| } | |
| if (t.activeMessages) { | |
| var l = t.activeMessages.activeMessage; | |
| if (utils.JS.isValid(l) && Array.isArray(l)) { | |
| var u = l.filter(function(t) { | |
| return utils.JS.isValid(t.rewardType) | |
| }), | |
| h = u.length > 0 ? u[0] : null; | |
| utils.JS.isValid(h) && repositories.Message.setDailyGift(h) | |
| } else utils.Debug.Assert(utils.JS.isValid(l) && Array.isArray(l), "WARNING - Data received did not contain an activeMessage variable. Did the data format change?") | |
| } | |
| 0 === s && this.dispatch(communication.BaseDelegate.SUCCESS, t) | |
| }, communication.TeamsConfigDelegate = function() { | |
| communication.BaseDelegate.call(this) | |
| }, utils.JS.inherits(communication.TeamsConfigDelegate, communication.BaseDelegate), communication.TeamsConfigDelegate.prototype.execute = function() { | |
| var url = utils.AssetLocator.getStaticTeamConfigURI(); | |
| utils.ResourceManager.RequestResource(url, this.onResourceCached.bind(this), this.onResourceCacheFailed.bind(this)) | |
| }, communication.TeamsConfigDelegate.prototype.onResourceCached = function(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), this.send() | |
| }, communication.TeamsConfigDelegate.prototype.onResourceCacheFailed = function() { | |
| this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }, communication.TeamsConfigDelegate.prototype.onSuccess = function(t) { | |
| communication.TeamsConfigDelegate.parseTeamConfig(t), communication.TeamsConfigDelegate.superClass_.onSuccess.call(this, t) | |
| }, communication.TeamsConfigDelegate.parseTeamConfig = function(t) { | |
| t.Years.forEach(function(t) { | |
| var i = utils.TextUtils.getYearFromString(t.Year); | |
| repositories.TeamConfig.addTeams(t.Teams, i), t.InternationalTeams && repositories.TeamConfig.addTeams(t.InternationalTeams, i), t.LegendsTeams && repositories.TeamConfig.addTeams(t.LegendsTeams, i, !0), repositories.TeamConfig.addLeagues(t.Leagues, i), t.LegendsLeagues && repositories.TeamConfig.addLeagues(t.LegendsLeagues, i, !0), repositories.TeamConfig.addNations(t.Nations, i) | |
| }, this) | |
| }, communication.StaticPlayerDataDelegate = function() { | |
| function StaticPlayerDataDelegate() { | |
| communication.BaseDelegate.call(this) | |
| } | |
| function onCacheSuccess(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), StaticPlayerDataDelegate.superClass_.send.call(this) | |
| } | |
| function onCacheFail() { | |
| this.onFail(enums.NetworkError.NOT_FOUND) | |
| } | |
| return utils.JS.inherits(StaticPlayerDataDelegate, communication.BaseDelegate), StaticPlayerDataDelegate.prototype.send = function() { | |
| utils.ResourceManager.RequestResource(utils.AssetLocator.getPlayerSearchFileURI(), onCacheSuccess.bind(this), onCacheFail.bind(this)) | |
| }, StaticPlayerDataDelegate | |
| }(), communication.PlayerMetaDataDelegate = function() { | |
| function PlayerMetaDataDelegate() { | |
| communication.BaseDelegate.call(this) | |
| } | |
| function onCacheSuccess(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), PlayerMetaDataDelegate.superClass_.send.call(this) | |
| } | |
| function onCacheFail() { | |
| this.onFail(enums.NetworkError.NOT_FOUND) | |
| } | |
| return utils.JS.inherits(PlayerMetaDataDelegate, communication.BaseDelegate), PlayerMetaDataDelegate.prototype.send = function() { | |
| utils.ResourceManager.RequestResource(utils.AssetLocator.getPlayerMetaFileURI(), onCacheSuccess.bind(this), onCacheFail.bind(this)) | |
| }, PlayerMetaDataDelegate | |
| }(), communication.PlayerIconDataDelegate = function() { | |
| function PlayerIconDataDelegate() { | |
| communication.BaseDelegate.call(this) | |
| } | |
| function onCacheSuccess(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), PlayerIconDataDelegate.superClass_.send.call(this) | |
| } | |
| function onCacheFail() { | |
| this.onFail(enums.NetworkError.NOT_FOUND) | |
| } | |
| return utils.JS.inherits(PlayerIconDataDelegate, communication.BaseDelegate), PlayerIconDataDelegate.prototype.send = function() { | |
| utils.ResourceManager.RequestResource(utils.AssetLocator.getPlayerIconFileURI(), onCacheSuccess.bind(this), onCacheFail.bind(this)) | |
| }, PlayerIconDataDelegate | |
| }(), communication.PlaceholderAssetsDelegate = function() { | |
| communication.BaseDelegate.call(this) | |
| }, utils.JS.inherits(communication.PlaceholderAssetsDelegate, communication.BaseDelegate), communication.PlaceholderAssetsDelegate.prototype.send = function send() { | |
| utils.ResourceManager.RequestResource(utils.AssetLocator.getStaticPlaceholderAssetConfigURI(), function _onCacheSuccess(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), communication.PlaceholderAssetsDelegate.superClass_.send.call(this) | |
| }.bind(this), function _onCacheFail() { | |
| this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }.bind(this)) | |
| }, communication.PlaceholderAssetsDelegate.prototype.onSuccess = function(t) { | |
| utils.AssetLocator.PLACEHOLDER_LOOKUP = t, communication.PlaceholderAssetsDelegate.superClass_.onSuccess.call(this, t) | |
| }, communication.SquadDataDelegate = function() { | |
| communication.BaseDelegate.call(this) | |
| }, utils.JS.inherits(communication.SquadDataDelegate, communication.BaseDelegate), communication.SquadDataDelegate.prototype.send = function send() { | |
| utils.ResourceManager.RequestResource(utils.AssetLocator.getSquadDataURI(utils.TextUtils.getYearString(enums.Year.ASSET)), function _onCacheSuccess(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.setCache(!0), communication.SquadDataDelegate.superClass_.send.call(this) | |
| }.bind(this), function _onCacheFail() { | |
| this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }.bind(this)) | |
| }, communication.SquadDataDelegate.prototype.onSuccess = function(t) { | |
| repositories.Squad.setSquadDataLookup(t), repositories.PlayStyle.setPlayStyles(t.styleAttribMods), communication.SquadDataDelegate.superClass_.onSuccess.call(this, t) | |
| }, communication.SetMTXTransactionDelegate = function(transaction) { | |
| communication.BaseFUTDelegate.call(this), this._url = "/ut/v2/game/fifa14/store/transaction/" + transaction.idStr, this._requestType = models.CommunicationModel.METHOD.PUT, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON, this._data = { | |
| state: transaction.state, | |
| useCount: 1, | |
| productId: transaction.productId, | |
| groupName: transaction.groupName | |
| } | |
| }, utils.JS.inherits(communication.SetMTXTransactionDelegate, communication.BaseFUTDelegate), communication.SetMTXTransactionDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.NOT_ENOUGH_CREDIT: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.auctionInsufficientCoinsTitle", "popup.error.auctionInsufficientCoins"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, NamespaceManager.Register("entities"), entities.MTXTransaction = function(data) { | |
| this.firstPartyStoreId = data.firstPartyStoreId, Object.defineProperty(this, "firstPartyStoreId", { | |
| writable: !1 | |
| }), this.groupName = data.groupName, Object.defineProperty(this, "groupName", { | |
| writable: !1 | |
| }), this.NPTicketLength = data.NPTicketLength, Object.defineProperty(this, "NPTicketLength", { | |
| writable: !1 | |
| }), this.packId = data.packId, Object.defineProperty(this, "packId", { | |
| writable: !1 | |
| }), this.productId = data.productId, Object.defineProperty(this, "productId", { | |
| writable: !1 | |
| }), this.purchasePackType = data.purchasePackType, Object.defineProperty(this, "purchasePackType", { | |
| writable: !1 | |
| }); | |
| var t; | |
| Object.defineProperty(this, "state", { | |
| get: function() { | |
| return t | |
| }, | |
| set: function(i) { | |
| var key; | |
| for (key in enums.Purchase.State) | |
| if (enums.Purchase.State.hasOwnProperty(key) && enums.Purchase.State[key] === i) return void(t = i); | |
| utils.Debug.Assert(!1, "Invalid assignment to entity: MTXTransaction.state") | |
| } | |
| }), this.state = data.state, this.timestamp = data.timestamp, Object.defineProperty(this, "timestamp", { | |
| writable: !1 | |
| }), this.id = data.transactionId, Object.defineProperty(this, "id", { | |
| writable: !1 | |
| }), | |
| this.idStr = data.transactionIdString, Object.defineProperty(this, "idStr", { | |
| writable: !1 | |
| }), this.useAuth = data.useAuth, Object.defineProperty(this, "useAuth", { | |
| writable: !1 | |
| }), this.nextState = enums.Purchase.State.INVALID, Object.defineProperty(this, "nextState", { | |
| get: function() { | |
| switch (this.state) { | |
| case enums.Purchase.State.TRANSACTIONCREATED: | |
| return enums.Purchase.State.PURCHASECOMPLETE; | |
| case enums.Purchase.State.PURCHASECOMPLETE: | |
| return enums.Purchase.State.PURCHASECONSUMABLECOUNT; | |
| case enums.Purchase.State.TRANSACTIONCOMPLETE: | |
| return enums.Purchase.State.TRANSACTIONCOMPLETE; | |
| default: | |
| return enums.Purchase.State.INVALID | |
| } | |
| } | |
| }) | |
| }, entities.MTXTransaction.prototype.process = function() { | |
| function onProcessStateSuccess(sender, result) { | |
| sender.clearListenersByScope(this), this.state = result.state, processNextState(this) | |
| } | |
| function onProcessStateFail(sender, error) { | |
| sender.clearListenersByScope(this), error.getCode() === enums.NetworkError.SERVICE_IS_DISABLED && gSettingsModel.disableService(models.SettingsModel.STORE_ENABLED); | |
| NetworkErrorManager.handle(error, !0, function() { | |
| event.notify(0, error.getCode()) | |
| }) | |
| } | |
| function processNextState(transaction) { | |
| if (transaction.state = transaction.nextState, transaction.state !== enums.Purchase.State.TRANSACTIONCOMPLETE && transaction.state !== enums.Purchase.State.TRANSACTIONCANCEL) { | |
| var t = new communication.SetMTXTransactionDelegate(transaction); | |
| t.addListener(communication.BaseDelegate.SUCCESS, transaction, onProcessStateSuccess), t.addListener(communication.BaseDelegate.FAIL, transaction, onProcessStateFail), t.send() | |
| } else event.notify(transaction.packId) | |
| } | |
| var event = new FUTObservable; | |
| return processNextState(this), event | |
| }, communication.GetMTXTransactionDelegate = function() { | |
| communication.BaseFUTDelegate.call(this), this._url = "/ut/v2/game/fifa14/store/transaction", this._requestType = models.CommunicationModel.METHOD.GET, this._dataType = models.CommunicationModel.RESPONSE.TEXT_JSON, this._contentType = models.CommunicationModel.CONTENT_TYPE.JSON | |
| }, utils.JS.inherits(communication.GetMTXTransactionDelegate, communication.BaseFUTDelegate), communication.GetMTXTransactionDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.NOT_ENOUGH_CREDIT: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.error.auctionInsufficientCoinsTitle", "popup.error.auctionInsufficientCoins"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.StoreLocDelegate = function() { | |
| communication.BaseDelegate.call(this) | |
| }, utils.JS.inherits(communication.StoreLocDelegate, communication.BaseDelegate), communication.StoreLocDelegate.prototype.execute = function() { | |
| var url = utils.AssetLocator.getStoreLocFileURI(); | |
| utils.ResourceManager.RequestResource(url, this.onResourceCached.bind(this), this.onResourceCacheFailed.bind(this)) | |
| }, communication.StoreLocDelegate.prototype.onResourceCached = function(value) { | |
| this.setRequest(value.path, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_XML, models.CommunicationModel.CONTENT_TYPE.XML), this.send() | |
| }, communication.StoreLocDelegate.prototype.onResourceCacheFailed = function() { | |
| this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }, communication.PhishingGetQuestionDelegate = function() { | |
| communication.BaseFUTDelegate.call(this) | |
| }, utils.JS.inherits(communication.PhishingGetQuestionDelegate, communication.BaseFUTDelegate), communication.PhishingGetQuestionDelegate.prototype.execute = function() { | |
| var url = communication.BaseFUTDelegate.REQUEST_ROOT + "phishing/question"; | |
| this.setRequest(url, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.PhishingGetQuestionDelegate.prototype.handleErrorResponse = function(t) { | |
| utils.JS.isObject(t) && t.token && gUserSettingsModel.setUserItem(models.UserSettingsModel.SECURITY_TOKEN, t.token) | |
| }, | |
| communication.PhishingGetQuestionDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.ALREADY_ANSWERED_PHISHING_QUESTION: | |
| case enums.NetworkError.ACCOUNT_LOCKED: | |
| case enums.NetworkError.NO_REMAINING_ATTEMPTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "", ""); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, communication.PersonaDelegate = function(t, i) { | |
| communication.BaseFUTDelegate.call(this), this._customURL = t, this._customProtocol = i, this.setURLVariables({ | |
| filterConsoleLogin: !0, | |
| sku: enums.SKU.FUT, | |
| returningUserGameYear: (parseInt(utils.TextUtils.getYearString(), 10) - 1).toString() | |
| }), this.setRequest(communication.BaseFUTDelegate.REQUEST_ROOT + "user/accountinfo", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.checkAuthentication(!1) | |
| }, utils.JS.inherits(communication.PersonaDelegate, communication.BaseFUTDelegate), communication.PersonaDelegate.prototype.generateURL = function() { | |
| return this._customProtocol + "://" + this._customURL + this._url + this.generateUrlParams() | |
| }, communication.PersonaDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.NO_USER: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "popup.title.genericError", "popup.body.genericError"); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, NamespaceManager.Register("valueobjects"), valueobjects.ShardDataItemVO = function() { | |
| this._shardId = "", this._clientFacingIpPort = "", this._clientProtocol = "", this._platforms = [], this._skus = [] | |
| }, valueobjects.ShardDataItemVO.prototype.parseItemDataObject = function(data) { | |
| this._shardId = data.shardId, this._clientFacingIpPort = data.clientFacingIpPort, this._clientProtocol = data.clientProtocol, this._platforms = data.platforms, this._skus = data.skus | |
| }, valueobjects.ShardDataItemVO.prototype.getShardId = function() { | |
| return this._shardId | |
| }, valueobjects.ShardDataItemVO.prototype.getClientFacingIpPort = function() { | |
| return this._clientFacingIpPort | |
| }, valueobjects.ShardDataItemVO.prototype.getClientProtocol = function() { | |
| return this._clientProtocol | |
| }, valueobjects.ShardDataItemVO.prototype.getPlatforms = function() { | |
| return this._platforms | |
| }, valueobjects.ShardDataItemVO.prototype.containsPlatform = function(platform) { | |
| var t, length = this._platforms.length; | |
| for (t = 0; t < length; ++t) | |
| if (platform === this._platforms[t]) return !0; | |
| return !1 | |
| }, valueobjects.ShardDataItemVO.prototype.containsSku = function(t) { | |
| var i, length = this._skus.length; | |
| for (i = 0; i < length; ++i) | |
| if (t === this._skus[i]) return !0; | |
| return !1 | |
| }, communication.ShardInfoDelegate = function() { | |
| communication.BaseFUTDelegate.call(this) | |
| }, utils.JS.inherits(communication.ShardInfoDelegate, communication.BaseFUTDelegate), communication.ShardInfoDelegate.prototype.execute = function() { | |
| this.checkAuthentication(!1); | |
| this.setRequest("/ut/shards/v2", models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.ShardInfoDelegate.prototype.getDefaultHeaders = function() { | |
| var t = gAuthenticationModel.getUser(); | |
| return { | |
| "Easw-Session-Data-Nucleus-Id": t ? t.id : 0, | |
| "X-UT-SID": this.getSessionInfo().id, | |
| "X-UT-PHISHING-TOKEN": gUserSettingsModel.getUserItem(models.UserSettingsModel.SECURITY_TOKEN) | |
| } | |
| }, communication.ShardInfoDelegate.prototype.generateURL = function() { | |
| return gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_DEFAULT_FUT_SERVICE_PROTOCOL) + "://" + gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_DEFAULT_FUT_SERVICE_URL) + this._url + this.generateUrlParams() | |
| }, communication.ShardInfoDelegate.prototype.onSuccess = function(t) { | |
| var i = t.shardInfo.map(function(t) { | |
| var i = new valueobjects.ShardDataItemVO; | |
| return i.parseItemDataObject(t), i | |
| }); | |
| this.dispatch(communication.BaseDelegate.SUCCESS, i) | |
| }, communication.ExtendedLocDelegate = function() { | |
| communication.BaseDelegate.call(this) | |
| }, utils.JS.inherits(communication.ExtendedLocDelegate, communication.BaseDelegate), communication.ExtendedLocDelegate.prototype.execute = function() { | |
| var url = gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_RESOURCE_ROOT) + utils.AssetLocator.getExtendedLocFileURI(); | |
| this.setRequest(url, models.CommunicationModel.METHOD.GET, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.ExtendedLocDelegate.prototype.onResourceCached = function(value) {}, communication.ExtendedLocDelegate.prototype.onResourceCacheFailed = function() { | |
| this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }, communication.ExtendedLocDelegate.prototype.onSuccess = function(t) { | |
| gLocalization.appendAdditionalStrings(t), communication.ExtendedLocDelegate.superClass_.onSuccess.call(this, t) | |
| }, communication.ExtendedLocDelegate.prototype.onFail = function(errorCode) { | |
| communication.ExtendedLocDelegate.superClass_.onFail.call(this, enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }, NamespaceManager.Register("repositories"), repositories.PlayerMeta = function() { | |
| function PlayerMetaRepository() {} | |
| var t = new FUTHashTable({}); | |
| return PlayerMetaRepository.prototype.setData = function setData(data) { | |
| this.clearData(); | |
| var index; | |
| for (index in data) | |
| if (data.hasOwnProperty(index)) { | |
| var i = new transferobjects.PlayerMetaData(parseInt(index, 10), data[index]); | |
| t.set(i.id, i) | |
| } | |
| }, PlayerMetaRepository.prototype.get = function get(i) { | |
| return t.get(i) | |
| }, PlayerMetaRepository.prototype.clearData = function clearData() { | |
| t.clear() | |
| }, new PlayerMetaRepository | |
| }(), NamespaceManager.Register("transferobjects"), transferobjects.PlayerIconData = function(data) { | |
| this.playerId = data.playerId, Object.defineProperty(this, "playerId", { | |
| writable: !1 | |
| }), this.iconId = data.iconId, Object.defineProperty(this, "iconId", { | |
| writable: !1 | |
| }) | |
| }, NamespaceManager.Register("repositories"), repositories.PlayerIcon = function() { | |
| function PlayerIconRepository() {} | |
| var t = new FUTHashTable({}); | |
| return PlayerIconRepository.prototype.reset = function reset() { | |
| t.clear() | |
| }, PlayerIconRepository.prototype.setData = function setData(data) { | |
| this.reset(), data.forEach(function _storeIconEntry(i) { | |
| var s = new transferobjects.PlayerIconData(i); | |
| t.set(s.playerId, s) | |
| }) | |
| }, PlayerIconRepository.prototype.get = function get(i) { | |
| return t.get(i) | |
| }, new PlayerIconRepository | |
| }(), NamespaceManager.Register("viewmodels"), viewmodels.OnboardingState = function OnboardingStateViewmodel() { | |
| FUTObject.call(this), this._countryId = 0, this._homeKitId = 0, this._awayKitId = 0, this._badgeId = 0, this._loanerDefId = 0 | |
| }, utils.JS.inherits(viewmodels.OnboardingState, FUTObject), viewmodels.OnboardingState.prototype.getCountryId = function getCountryId() { | |
| return this._countryId | |
| }, viewmodels.OnboardingState.prototype.setCountryId = function setCountryId(id) { | |
| this._countryId = id | |
| }, viewmodels.OnboardingState.prototype.getHomeKitId = function getHomeKitId() { | |
| return this._homeKitId | |
| }, viewmodels.OnboardingState.prototype.setHomeKitId = function setHomeKitId(id) { | |
| this._homeKitId = id | |
| }, viewmodels.OnboardingState.prototype.hasHomeKit = function hasHomeKit() { | |
| return 0 !== this._homeKitId | |
| }, viewmodels.OnboardingState.prototype.getAwayKitId = function getAwayKitId() { | |
| return this._awayKitId | |
| }, viewmodels.OnboardingState.prototype.setAwayKitId = function setAwayKitId(id) { | |
| this._awayKitId = id | |
| }, viewmodels.OnboardingState.prototype.hasAwayKit = function hasAwayKit() { | |
| return 0 !== this._awayKitId | |
| }, viewmodels.OnboardingState.prototype.getBadgeId = function getBadgeId() { | |
| return this._badgeId | |
| }, viewmodels.OnboardingState.prototype.setBadgeId = function setBadgeId(id) { | |
| this._badgeId = id | |
| }, viewmodels.OnboardingState.prototype.hasBadge = function hasBadge() { | |
| return 0 !== this._badgeId | |
| }, viewmodels.OnboardingState.prototype.getLoanerDefId = function getLoanerDefId() { | |
| return this._loanerDefId | |
| }, | |
| viewmodels.OnboardingState.prototype.setLoanerDefId = function setLoanerDefId(id) { | |
| this._loanerDefId = id | |
| }, viewmodels.OnboardingState.prototype.hasLoaner = function hasLoaner() { | |
| return 0 !== this._loanerDefId | |
| }, viewmodels.OnboardingState.prototype.isComplete = function isComplete() { | |
| return this.hasBadge() | |
| }, NamespaceManager.Register("models"), models.LoginModel = function() { | |
| utils.EventDispatcher.call(this), this._currentLoginStep = 0, this._isRunning = !1, this._onboardingState = null | |
| }, utils.JS.inherits(models.LoginModel, utils.EventDispatcher), models.LoginModel.LOGIN_STEP = { | |
| EXTENDED_LOC: 0, | |
| SHARD_INFO: 1, | |
| PERSONA_LIST: 2, | |
| FUT_AUTH: 3, | |
| CHECK_SECURITY: 4, | |
| RUN_PRE_BOOT_SEQUENCE: 5, | |
| RUN_BOOT_SEQUENCE: 6, | |
| HOME_SCREEN: 7 | |
| }, models.LoginModel.prototype.login = function(resume) { | |
| utils.Debug.Assert(!this._isRunning, "[LOGIN] Attempted to login when a login/logout request is already running."), this._isRunning || (gClickShield.showShield(components.ClickShield.SHIELD.LOADING), this._isRunning = !0, resume || (this._currentLoginStep = 0), this._runCurrentStep()) | |
| }, models.LoginModel.prototype._runNextStep = function() { | |
| this._currentLoginStep++, this._runCurrentStep() | |
| }, models.LoginModel.prototype._runCurrentStep = function() { | |
| switch (this._currentLoginStep) { | |
| case models.LoginModel.LOGIN_STEP.EXTENDED_LOC: | |
| this._getExtendedLocFile(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.SHARD_INFO: | |
| this._requestShardInfo(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.PERSONA_LIST: | |
| this._getFUTPersonaList(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.FUT_AUTH: | |
| this._authenticateWithFUT(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.CHECK_SECURITY: | |
| this._getPhishingQuestion(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.RUN_PRE_BOOT_SEQUENCE: | |
| this._runPreBootStaticDataChain(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.RUN_BOOT_SEQUENCE: | |
| this._runInitialMassBoot(); | |
| break; | |
| case models.LoginModel.LOGIN_STEP.HOME_SCREEN: | |
| this._gotoHomeScreen(); | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "[models.LoginModel] Invalid or unsupported bootflow step requested."), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| } | |
| }, models.LoginModel.prototype._getExtendedLocFile = function() { | |
| var t = new communication.ExtendedLocDelegate; | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, this._getExtendedLocFileSuccess), t.addListener(communication.BaseDelegate.FAIL, this, this._getExtendedLocFileFail), t.addListener(communication.BaseDelegate.CANCEL, this, this._getExtendedLocFileFail), t.execute() | |
| }, models.LoginModel.prototype._getExtendedLocFileSuccess = function(sender) { | |
| sender.clearListenersByScope(this), this._runNextStep() | |
| }, models.LoginModel.prototype._getExtendedLocFileFail = function(sender) { | |
| sender.clearListenersByScope(this), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype._requestShardInfo = function() { | |
| var t = new communication.ShardInfoDelegate; | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, this._onShardInfoSuccess), t.addListener(communication.BaseDelegate.FAIL, this, this._onShardInfoFail), t.addListener(communication.BaseDelegate.CANCEL, this, this._onShardInfoFail), t.execute() | |
| }, models.LoginModel.prototype._onShardInfoSuccess = function(sender, data) { | |
| sender.clearListenersByScope(this), gAuthenticationModel.setShardInfoList(data), this._runNextStep() | |
| }, models.LoginModel.prototype._onShardInfoFail = function(sender, error) { | |
| sender.clearListenersByScope(this), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype._getFUTPersonaList = function() { | |
| function processShard() { | |
| if (++t >= gAuthenticationModel.getShardInfoList().length) | |
| if (gAuthenticationModel.getUser().personas.length < 1) this._isRunning = !1, | |
| NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), enums.GettingStartedTypes.FIFA) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| else { | |
| var i = gAuthenticationModel.getUser().getSelectedPersona(); | |
| if (i.isSwitch) this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), enums.GettingStartedTypes.PLATFORM_SWITCH) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| else if (i.state === enums.UserState.RETURNING_USER_EXPIRED) this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("WEBSTART_ACCESS_OVER"), enums.GettingStartedTypes.FIFA) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| else if (i.isReturningUser || i.hasFullAccess) { | |
| var s = gAuthenticationModel.getShardItemBySKU(i.sku), | |
| o = services.Authentication.getSession(enums.AuthEnvironment.UTAS); | |
| if (utils.Debug.Assert(utils.JS.isValid(s), "No shard was found for the selected persona."), !s) return this._isRunning = !1, void utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)); | |
| o.protocol = s._clientProtocol, o.hostname = s._clientFacingIpPort, this._runNextStep() | |
| } else { | |
| this._isRunning = !1; | |
| var l = i.isFreeTrial ? enums.GettingStartedTypes.FREE_TRIAL : i.isAccessTrial ? enums.GettingStartedTypes.ACCESS_TRIAL : enums.GettingStartedTypes.FUT; | |
| NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), l) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| } | |
| } | |
| } | |
| function onSuccess(sender, result) { | |
| result.userAccountInfo.personas.forEach(function(t) { | |
| gAuthenticationModel.getUser().addPersona(t) | |
| }), processShard.call(this) | |
| } | |
| function onFail(sender, error) { | |
| processShard.call(this) | |
| } | |
| var t = 0; | |
| gAuthenticationModel.getShardInfoList().forEach(function(t) { | |
| var i = new communication.PersonaDelegate(t._clientFacingIpPort, t._clientProtocol); | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, onSuccess), i.addListener(communication.BaseDelegate.FAIL, this, onFail), i.addListener(communication.BaseDelegate.CANCEL, this, onFail), i.send() | |
| }, this) | |
| }, models.LoginModel.prototype._authenticateWithFUT = function() { | |
| gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, this, this._onAuthenticateWithFUTSuccess), gAuthenticationModel.addListener(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, this, this._onAuthenticateWithFUTFail), gAuthenticationModel.authenticate(enums.FOSService.FUT) | |
| }, models.LoginModel.prototype._onAuthenticateWithFUTSuccess = function() { | |
| gAuthenticationModel.removeListener(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, this, this._onAuthenticateWithFUTSuccess), gAuthenticationModel.removeListener(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, this, this._onAuthenticateWithFUTFail); | |
| var t = { | |
| type: PinManager.SERVER_TYPE, | |
| status: enums.PIN.LOGIN_EVT_STATUS.SUCCESS, | |
| userid: gAuthenticationModel.getUser().getSelectedPersona().id | |
| }; | |
| gPinManager.trigger(utils.PinFactory.createEvent(enums.PIN.EVENT.LOGIN, t)), this._runNextStep() | |
| }, models.LoginModel.prototype._onAuthenticateWithFUTFail = function(sender, t, error) { | |
| gAuthenticationModel.removeListener(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, this, this._onAuthenticateWithFUTSuccess), gAuthenticationModel.removeListener(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, this, this._onAuthenticateWithFUTFail); | |
| var i = { | |
| type: PinManager.SERVER_TYPE, | |
| status: enums.PIN.LOGIN_EVT_STATUS.FAIL, | |
| status_code: error | |
| }; | |
| switch (gPinManager.trigger(utils.PinFactory.createEvent(enums.PIN.EVENT.LOGIN, i)), error) { | |
| case enums.NetworkError.NO_INTERNET_CONNECTION: | |
| this._isRunning = !1, utils.PopupManager.ShowNoInternetConnectionPopup(), | |
| gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.INVALID_CREDENTIALS: | |
| this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.ACCOUNT_BANNED: | |
| this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ACCOUNT_BANNED, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.UPDATE_REQUIRED: | |
| utils.PopupManager.ShowConfirmation(utils.PopupManager.Confirmations.UPDATE_FUT, null, this.onUpdateFUTOK.bind(this), this.onUpdateFUTCancel.bind(this)); | |
| break; | |
| case enums.NetworkError.DID_CREATE_EXCEEDED: | |
| this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.DID_CREATE_EXCEEDED, this.logout.bind(this)); | |
| break; | |
| case enums.NetworkError.DID_LOGIN_EXCEEDED: | |
| this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.DID_LOGIN_EXCEEDED, this.logout.bind(this)); | |
| break; | |
| case enums.NetworkError.LOGGED_IN_ON_CONSOLE: | |
| this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("SIGNED_ON_CONSOLE")) || (NavManager.getCurrentScreen().getScreenId() === Screens.getView("SIGNED_ON_CONSOLE") ? NavManager.getCurrentScreen().setInteractionsEnabled(!0) : utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this))), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| default: | |
| this._currentLoginStep = models.LoginModel.LOGIN_STEP.HOME_SCREEN, this._runCurrentStep() | |
| } | |
| }, models.LoginModel.prototype.onUpdateFUTOK = function() { | |
| isChrome() ? this.onUpdateFUTCancel() : window.plugins.utilities.showStoreAppPage(this.onForceUpdateSuccess.bind(this), this.onUpdateFUTCancel.bind(this)) | |
| }, models.LoginModel.prototype.onForceUpdateSuccess = function() { | |
| this._isRunning = !1, this.logout(), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype.onUpdateFUTCancel = function() { | |
| this._isRunning = !1, this.logout(), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype._getPhishingQuestion = function() { | |
| var t = new communication.PhishingGetQuestionDelegate; | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, this._onGetPhishingQuestionSuccess), t.addListener(communication.BaseDelegate.FAIL, this, this._onGetPhishingQuestionFail), t.addListener(communication.BaseDelegate.CANCEL, this, this._onGetPhishingQuestionFail), t.setImportant(!0), t.execute() | |
| }, models.LoginModel.prototype._onGetPhishingQuestionSuccess = function(sender, data) { | |
| sender.clearListenersByScope(this), this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("PHISHING"), data) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype._onGetPhishingQuestionFail = function(sender, error) { | |
| switch (sender.clearListenersByScope(this), error.getCode()) { | |
| case enums.NetworkError.ALREADY_ANSWERED_PHISHING_QUESTION: | |
| case enums.NetworkError.SERVICE_IS_DISABLED: | |
| services.Authentication.getSession(enums.AuthEnvironment.UTAS).securityQuestionAnswered = !0, this._runNextStep(); | |
| break; | |
| case enums.NetworkError.NO_CONTENT: | |
| this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("NO_SECURITY_QUESTION")) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.ACCOUNT_LOCKED: | |
| case enums.NetworkError.NO_REMAINING_ATTEMPTS: | |
| services.Authentication.getSession(enums.AuthEnvironment.UTAS).accountLocked = !0, this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("ACCOUNT_LOCKED")) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.NO_INTERNET_CONNECTION: | |
| this._isRunning = !1, utils.PopupManager.ShowNoInternetConnectionPopup(), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| case enums.NetworkError.FUN_CAPTCHA_REQUIRED: | |
| this._isRunning = !1, this._fcHealthCheck().observe(this, this._onHealthCheckComplete); | |
| break; | |
| case enums.NetworkError.CAPTCHA_REQUIRED: | |
| this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("CAPTCHA_REQUIRED")) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING); | |
| break; | |
| default: | |
| this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| } | |
| }, models.LoginModel.prototype._runPreBootStaticDataChain = function() { | |
| var t = new communication.StoreLocDelegate; | |
| t.setImportant(!1), t.addListener(communication.BaseDelegate.SUCCESS, this, this._onStoreLocSuccess), t.addListener(communication.BaseDelegate.FAIL, this, this._onStaticDataFail); | |
| var i = new communication.TeamsConfigDelegate; | |
| i.setImportant(!0); | |
| var s = new communication.StaticPlayerDataDelegate; | |
| s.addListener(communication.BaseDelegate.SUCCESS, this, this._onStaticDataSuccess), s.addListener(communication.BaseDelegate.FAIL, this, this._onStaticDataFail), s.setImportant(!0); | |
| var o = new communication.PlayerMetaDataDelegate; | |
| o.addListener(communication.BaseDelegate.SUCCESS, this, this._onPlayerMetaDataSuccess), o.addListener(communication.BaseDelegate.FAIL, this, this._onPlayerMetaDataFail), o.setImportant(!0); | |
| var l = new communication.PlayerIconDataDelegate; | |
| l.addListener(communication.BaseDelegate.SUCCESS, this, this._onPlayerIconDataSuccess), l.addListener(communication.BaseDelegate.FAIL, this, this._onPlayerIconDataFail), l.setImportant(!0); | |
| var u = new communication.PlaceholderAssetsDelegate; | |
| u.setImportant(!0); | |
| var h = new communication.SquadDataDelegate; | |
| h.setImportant(!0); | |
| var p = [t, i, s, o, u, h, l], | |
| m = new utils.DelegateChain(p, !1); | |
| m.addListener(utils.DelegateChain.SUCCESS, this, this._onRunPreBootStaticDataChainSuccess), m.addListener(utils.DelegateChain.FAIL, this, this._onRunInitialBootChainFailure), m.execute() | |
| }, models.LoginModel.prototype._onStaticDataSuccess = function(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var t = [].concat(response.Players); | |
| gAuthenticationModel.getUser().getSelectedPersona().isGen3 || (t = t.concat(response.LegendsPlayers)), repositories.Item.setStaticData(t) | |
| }, models.LoginModel.prototype._onStaticDataFail = function(sender) { | |
| sender.clearListenersByScope(this) | |
| }, models.LoginModel.prototype._onPlayerMetaDataSuccess = function(sender, response) { | |
| sender.clearListenersByScope(this), repositories.PlayerMeta.setData(response) | |
| }, models.LoginModel.prototype._onPlayerMetaDataFail = function(sender) { | |
| sender.clearListenersByScope(this) | |
| }, models.LoginModel.prototype._onPlayerIconDataSuccess = function(sender, response) { | |
| sender.clearListenersByScope(this), repositories.PlayerIcon.setData(response) | |
| }, models.LoginModel.prototype._onPlayerIconDataFail = function(sender) { | |
| sender.clearListenersByScope(this) | |
| }, models.LoginModel.prototype._onStoreLocSuccess = function(sender, response) { | |
| sender.clearListenersByScope(this), gLocalization.appendStoreDescriptionsToLoc(response) | |
| }, models.LoginModel.prototype._onRunPreBootStaticDataChainSuccess = function(sender) { | |
| sender.clearListenersByScope(this), gAuthenticationModel.getUser().getSelectedPersona().isEligibleForMobileStart ? (this._isRunning = !1, this._currentLoginStep++, gUserSettingsModel.checkUserItemBool(models.UserSettingsModel.EULA_ACCEPTED) ? NavManager.requestRootScreen(Screens.getView("MOBILE_START_INTRO")) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)) : NavManager.requestRootScreen(Screens.getView("EULA"), { | |
| nextScreen: Screens.getView("MOBILE_START_INTRO") | |
| }), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING)) : this._runNextStep() | |
| }, models.LoginModel.prototype._runInitialMassBoot = function() { | |
| var t = new communication.TOTWHistoryDelegate(0, 90); | |
| t.setImportant(!1), t.execute(); | |
| var i = new communication.UserMassInfoDelegate; | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, this._onRunInitialBootSuccess), i.addListener(communication.BaseDelegate.FAIL, this, this._onRunInitialMassBootFailure), i.send() | |
| }, models.LoginModel.prototype._runInitialBootChain = function _runInitialBootChain() { | |
| var t = new communication.UserModelDelegate; | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, this._onUserDataSuccess), t.addListener(communication.BaseDelegate.FAIL, this, this._onUserDataFail), t.setImportant(!0); | |
| var i = new communication.PileSizeDelegate; | |
| i.setImportant(!0); | |
| var s = new communication.DailyGiftDelegate; | |
| s.setImportant(!1); | |
| var o = [t, i, s], | |
| l = new utils.DelegateChain(o, !1); | |
| l.addListener(utils.DelegateChain.SUCCESS, this, this._onRunInitialBootSuccess), l.addListener(utils.DelegateChain.FAIL, this, this._onRunInitialBootChainFailure), l.execute() | |
| }, models.LoginModel.prototype._onUserDataSuccess = function _onUserDataSuccess(sender, response) { | |
| sender.clearListenersByScope(this), repositories.Squad.setActiveSquadId(response.squadList.activeSquadId), response.squadList.squad.forEach(function(t) { | |
| repositories.Squad.storeSquad(response.personaId, t) | |
| }) | |
| }, models.LoginModel.prototype._onUserDataFail = function _onUserDataFail(sender) { | |
| sender.clearListenersByScope(this) | |
| }, models.LoginModel.prototype._setOnboardingState = function _setOnboardingState(t, i) { | |
| if (t) { | |
| var s = Array.isArray(t.entries) ? t.entries[0] : null; | |
| s && (this._onboardingState = new viewmodels.OnboardingState, this._onboardingState.setLoanerDefId(s.value)) | |
| } | |
| i && (this._onboardingState || (this._onboardingState = new viewmodels.OnboardingState), Array.isArray(i.entries) && i.entries.forEach(function(t) { | |
| switch (t.key) { | |
| case enums.OnboardingStateType.HOME_KIT: | |
| this._onboardingState.setHomeKitId(t.value); | |
| break; | |
| case enums.OnboardingStateType.AWAY_KIT: | |
| this._onboardingState.setAwayKitId(t.value); | |
| break; | |
| case enums.OnboardingStateType.BADGE: | |
| this._onboardingState.setBadgeId(t.value); | |
| break; | |
| case enums.OnboardingStateType.NATION: | |
| this._onboardingState.setCountryId(t.value) | |
| } | |
| }, this)) | |
| }, models.LoginModel.prototype._onRunInitialBootSuccess = function _onRunInitialBootSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var t = repositories.User.getCurrent().getSelectedPersona(); | |
| if (t.isGen3 || this._setOnboardingState(response.loanPlayerClientData, response.onboardingClientData), t.isPC) { | |
| var i = new communication.GetMTXTransactionDelegate; | |
| i.addListener(communication.BaseDelegate.SUCCESS, this, this._onGetMTXSuccess), i.addListener(communication.BaseDelegate.FAIL, this, this._onGetMTXFail), i.send() | |
| } else gSettingsModel.setFIFAPointsUnrecoveredTransation(!0), this._runNextStep() | |
| }, models.LoginModel.prototype._onRunInitialMassBootFailure = function(sender, error) { | |
| sender.clearListenersByScope(this), this._runInitialBootChain() | |
| }, models.LoginModel.prototype._onRunInitialBootChainFailure = function(sender, error, t) { | |
| sender.clearListenersByScope(this), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype._onGetMTXSuccess = function(sender, data) { | |
| if (sender.clearListenersByScope(this), data.state !== enums.Purchase.State.NOTRANSACTION) { | |
| var transaction = new entities.MTXTransaction(data); | |
| if (transaction.nextState !== enums.Purchase.State.INVALID) transaction.process().observe(this, function onProcessComplete(t, i, errorCode) { | |
| if (t.unobserve(this), errorCode && (gSettingsModel.setFIFAPointsUnrecoveredTransation(!1), gSettingsModel.isServiceAvailable(models.SettingsModel.FIFA_POINTS_ENABLED))) { | |
| var s = new valueobjects.NetworkErrorVO(enums.NetworkError.FIFA_POINTS_FAILED, enums.NetworkErrorLevel.UNIMPORTANT, "popup.error.ServiceIsDisabledTitle", "popup.error.mobile.invalidTransactionState"); | |
| utils.PopupManager.displayNetworkError(s) | |
| } | |
| this._runNextStep() | |
| }); | |
| else { | |
| if (gSettingsModel.setFIFAPointsUnrecoveredTransation(!1), gSettingsModel.isServiceAvailable(models.SettingsModel.FIFA_POINTS_ENABLED)) { | |
| var t = new valueobjects.NetworkErrorVO(enums.NetworkError.FIFA_POINTS_FAILED, enums.NetworkErrorLevel.UNIMPORTANT, "popup.error.ServiceIsDisabledTitle", "popup.error.mobile.invalidTransactionState"); | |
| utils.PopupManager.displayNetworkError(t) | |
| } | |
| this._runNextStep() | |
| } | |
| } else gSettingsModel.setFIFAPointsUnrecoveredTransation(!0), this._runNextStep() | |
| }, models.LoginModel.prototype._onGetMTXFail = function(sender, error) { | |
| if (sender.clearListenersByScope(this), gSettingsModel.setFIFAPointsUnrecoveredTransation(!1), gSettingsModel.isServiceAvailable(models.SettingsModel.FIFA_POINTS_ENABLED)) { | |
| var t = new valueobjects.NetworkErrorVO(enums.NetworkError.FIFA_POINTS_FAILED, enums.NetworkErrorLevel.UNIMPORTANT, "popup.error.ServiceIsDisabledTitle", "popup.error.mobile.invalidTransactionState"); | |
| utils.PopupManager.displayNetworkError(t) | |
| } | |
| this._runNextStep() | |
| }, models.LoginModel.prototype._gotoHomeScreen = function() { | |
| this._isRunning = !1, gHeader.setupContent(), services.Authentication.getSession(enums.AuthEnvironment.UTAS).state === enums.AuthenticationState.STATE_AUTHENTICATION_FAILED ? utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.SERVER_DOWN, this.logout.bind(this)) : this._onboardingState && !this._onboardingState.isComplete() ? gUserSettingsModel.checkUserItemBool(models.UserSettingsModel.EULA_ACCEPTED) ? (NavManager.requestRootScreen(Screens.getView("MOBILE_START_INTRO"), { | |
| state: this._onboardingState | |
| }), this._onboardingState = null) : NavManager.requestRootScreen(Screens.getView("EULA"), { | |
| nextScreen: Screens.getView("MOBILE_START_INTRO"), | |
| nextScreenData: { | |
| state: this._onboardingState | |
| } | |
| }) : (controllers.SettingsUpdaterController.startTimer(), NavManager.attemptHomeScreenTransition()), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.LoginModel.prototype.logout = function() { | |
| if (utils.Debug.Assert(!this._isRunning, "[LOGIN] Attempted to logout when a login/logout request is already running."), !this._isRunning) { | |
| this._isRunning = !0, gClickShield.showShield(components.ClickShield.SHIELD.LOADING), gFooter.hide(); | |
| var t = new communication.LogoutDelegate; | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, this._eadpLogout), t.addListener(communication.BaseDelegate.FAIL, this, this._eadpLogout), t.addListener(communication.BaseDelegate.CANCEL, this, this._eadpLogout), t.execute() | |
| } | |
| }, models.LoginModel.prototype._eadpLogout = function(sender) { | |
| sender.clearListenersByScope(this), eadp.identity.logout(this._completeLogout.bind(this)) | |
| }, models.LoginModel.prototype._completeLogout = function() { | |
| gClickShield.hideShield(components.ClickShield.SHIELD.LOADING), this._resetApp(), this._isRunning = !1 | |
| }, models.LoginModel.prototype.switchPersona = function(t) { | |
| repositories.User.getCurrent().selectedPersona = t.id, this._resetModels(), gFooter.hide(); | |
| var i = services.Authentication.getSession(enums.AuthEnvironment.UTAS); | |
| if (t.isSwitch) NavManager.requestChildScreen(Screens.getView("GETTING_STARTED"), enums.GettingStartedTypes.PLATFORM_SWITCH) || utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)); | |
| else if (t.hasFUT) { | |
| var s = gAuthenticationModel.getShardItemBySKU(t.sku); | |
| i.protocol = s._clientProtocol, i.hostname = s._clientFacingIpPort, this._currentLoginStep = models.LoginModel.LOGIN_STEP.FUT_AUTH, this.login(!0) | |
| } else i.state = enums.AuthenticationState.STATE_AUTHENTICATION_FAILED, i.status = enums.HTTPStatusCode.NO_USER, this._currentLoginStep = models.LoginModel.LOGIN_STEP.HOME_SCREEN, this.login(!0) | |
| }, models.LoginModel.prototype._resetApp = function() { | |
| controllers.SettingsUpdaterController.clearTimer(), this._resetModels(), repositories.User.reset(), services.Authentication.reset(), gUserSettingsModel.clearUserKey(), gUserModel.reset(), gPinManager.resetUniqueSessionID(), gFooter.reset(), NavManager.reset() | |
| }, models.LoginModel.prototype._resetModels = function() { | |
| gStaffStatsModel.reset(), gTOTWHistoryModel.reset(), repositories.Item.reset(), repositories.Message.reset(), repositories.SBC.reset(), repositories.Squad.reset(), repositories.TeamConfig.reset(), services.Objectives.reset() | |
| }, | |
| models.LoginModel.prototype._onHealthCheckComplete = function _onHealthCheckComplete(t, i) { | |
| t.unobserve(this), utils.JS.isValid(i) && !0 === i._value ? (NavManager.requestChildScreen(Screens.getView("FUN_CAPTCHA_REQUIRED")) || gAuthenticationModel.logout(), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING)) : this._handleFunCaptchaOutage() | |
| }, models.LoginModel.prototype._handleFunCaptchaOutage = function _handleFunCaptchaOutage() { | |
| var t = new communication.FunCaptchaValidateDelegate(""); | |
| t.addListener(communication.BaseDelegate.SUCCESS, this, function _onCaptchaValidateSuccess(sender) { | |
| sender.clearListenersByScope(this), gAuthenticationModel.login(!0) | |
| }), t.addListener(communication.BaseDelegate.FAIL, this, function _onCaptchaValidateFail(sender, error) { | |
| sender.clearListenersByScope(this), error._code === enums.NetworkError.CAPTCHA_REQUIRED ? NavManager.requestChildScreen(Screens.getView("CAPTCHA_REQUIRED")) || gAuthenticationModel.logout() : gAuthenticationModel.logout(), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }), t.send() | |
| }, models.LoginModel.prototype._fcHealthCheck = function _fcHealthCheck() { | |
| function _onFcHealthCheckSuccess(sender, response) { | |
| sender.clearListenersByScope(this); | |
| var i = new valueobjects.FunCaptchaHealthCheckStatusVO; | |
| i.parseFCHealthCheckDataObject(response), utils.JS.isValid(i) && utils.JS.isValid(i.getStatus()) ? t.set(i.getStatus()) : t.set(!1), event.notify(t) | |
| } | |
| var event = new FUTObservable, | |
| t = new valueobjects.BooleanVO, | |
| i = new communication.FunCaptchaHealthCheckDelegate; | |
| return i.addListener(communication.BaseDelegate.SUCCESS, this, _onFcHealthCheckSuccess), i.addListener(communication.BaseDelegate.FAIL, this, _onFcHealthCheckSuccess), i.send(), event | |
| }, NamespaceManager.Register("models"), models.AuthenticationModel = function() { | |
| utils.EventDispatcher.call(this), this._loginModel = null, this._shardInfoList = null | |
| }, utils.JS.inherits(models.AuthenticationModel, utils.EventDispatcher), models.AuthenticationModel.prototype.getUser = function getUser() { | |
| return repositories.User.getCurrent() | |
| }, models.AuthenticationModel.prototype.getSessionInfo = function(t) { | |
| return services.Authentication.getSession(enums.AuthEnvironment.UTAS) | |
| }, models.AuthenticationModel.prototype.setLoginModel = function(t) { | |
| this._loginModel = t | |
| }, models.AuthenticationModel.prototype.login = function(resume) { | |
| utils.Debug.Assert(utils.JS.isValid(this._loginModel), "[AuthenticationModel] Login model hasn't been defined."), this._loginModel.login(resume) | |
| }, models.AuthenticationModel.prototype._logout = function(t) { | |
| gPinManager.trigger(utils.PinFactory.createEvent(enums.PIN.EVENT.LOGOUT, { | |
| type: PinManager.SERVER_TYPE, | |
| end_reason: t | |
| })), utils.Debug.Assert(utils.JS.isValid(this._loginModel), "[AuthenticationModel] Login model hasn't been defined."), this._loginModel.logout() | |
| }, models.AuthenticationModel.prototype.logout = function() { | |
| this._logout(enums.PIN.LOGOUT_EVT_END_REASON.NORMAL) | |
| }, models.AuthenticationModel.prototype.errorLogout = function() { | |
| this._logout(enums.PIN.LOGOUT_EVT_END_REASON.ERROR) | |
| }, models.AuthenticationModel.prototype.switchPersona = function(t) { | |
| utils.Debug.Assert(utils.JS.isValid(this._loginModel), "[AuthenticationModel] Login model hasn't been defined."), this._loginModel.switchPersona(t) | |
| }, models.AuthenticationModel.prototype.setShardInfoList = function(list) { | |
| this._shardInfoList = list | |
| }, models.AuthenticationModel.prototype.getShardInfoList = function() { | |
| return this._shardInfoList | |
| }, models.AuthenticationModel.prototype.getShardItemBySKU = function(t) { | |
| for (var i = this._shardInfoList.length; i-- > 0;) | |
| if (this._shardInfoList[i].containsSku(t)) return this._shardInfoList[i]; | |
| return null | |
| }, models.AuthenticationModel.prototype.authenticate = function authenticate(t) { | |
| var i = this.getSessionInfo(t); | |
| services.Authentication.authenticate(i.environment).observe(this, function _onAuthComplete(i, data) { | |
| i.unobserve(this), data.success ? this.dispatch(models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL, t) : this.dispatch(models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED, t, data.status) | |
| }) | |
| }, models.AuthenticationModel.prototype.getFUTState = function() { | |
| var t = services.Authentication.getSession(enums.AuthEnvironment.UTAS), | |
| status = t.statusCode, | |
| i = !1; | |
| if (status !== enums.HTTPStatusCode.OK) switch (status) { | |
| case enums.HTTPStatusCode.NO_USER: | |
| return enums.FUTAuthState.NO_DATA; | |
| case enums.HTTPStatusCode.SERVER_ERROR: | |
| case enums.HTTPStatusCode.NOT_FOUND: | |
| return enums.FUTAuthState.SERVER_DOWN; | |
| case enums.HTTPStatusCode.LOGGED_IN_ON_CONSOLE: | |
| return enums.FUTAuthState.CONCURRENT_SESSION; | |
| default: | |
| i = !0 | |
| } | |
| var s = repositories.User.getCurrent(); | |
| if (!utils.JS.isValid(s)) return enums.FUTAuthState.NO_DATA; | |
| var o = s.getSelectedPersona(); | |
| return o ? !o.isAccessTrial && !o.isFreeTrial || o.isReturningUser ? i ? enums.FUTAuthState.SERVER_DOWN : t.accountLocked ? enums.FUTAuthState.ACCOUNT_LOCKED : t.securityQuestionAnswered ? enums.FUTAuthState.COMPLETE : enums.FUTAuthState.NO_SECURITY_QUESTION : enums.FUTAuthState.NEW_TRIAL_USER : enums.FUTAuthState.NO_DATA | |
| }, models.AuthenticationModel.prototype.isFullyAuthenticated = function() { | |
| return this.getFUTState() === enums.FUTAuthState.COMPLETE | |
| }, models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL = "models.AuthenticationModel.EVENT_AUTHENTICATION_SUCCESSFUL", models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED = "models.AuthenticationModel.EVENT_AUTHENTICATION_FAILED"; | |
| var gAuthenticationModel = new models.AuthenticationModel; | |
| NamespaceManager.Register("utils"), utils.ScreenServiceMap = function() {}, utils.ScreenServiceMap.init = function() { | |
| utils.ScreenServiceMap.MAP = [{ | |
| appSection: Screens.APP_SECTION.WATCH_LIST, | |
| services: [models.SettingsModel.TRADING_ENABLED] | |
| }, { | |
| appSection: Screens.APP_SECTION.AUCTION_SEARCH, | |
| services: [models.SettingsModel.TRADING_ENABLED] | |
| }, { | |
| appSection: Screens.APP_SECTION.STORE, | |
| services: [models.SettingsModel.CARD_PACK_STORE_ENABLED, models.SettingsModel.STORE_ENABLED] | |
| }] | |
| }, utils.ScreenServiceMap.getServicesByAppSection = function(t) { | |
| var i, s; | |
| for (s = utils.ScreenServiceMap.MAP.length, i = 0; i < s; i++) | |
| if (utils.ScreenServiceMap.MAP[i].appSection === t) return utils.ScreenServiceMap.MAP[i].services; | |
| return [] | |
| }, utils.ScreenServiceMap.MAP = [], NamespaceManager.Register("models"), models.SettingsModel = function() { | |
| this._configs = new FUTHashTable({}), this._isFIFAPointsUnrecoveredTransationEnabled = !0, this._supportedServices = [models.SettingsModel.CARD_PACK_STORE_ENABLED, models.SettingsModel.STORE_ENABLED, models.SettingsModel.COIN_ENABLED, models.SettingsModel.FIFA_POINTS_ENABLED, models.SettingsModel.TRADING_ENABLED, models.SettingsModel.MTX_ENABLED, models.SettingsModel.OBJECTIVES_ENABLED, models.SettingsModel.SBC_ENABLED, models.SettingsModel.TOTW_HISTORY_ENABLED, models.SettingsModel.LIVE_MESSAGING_ENABLED], this._configsRetrieved = !1 | |
| }, models.SettingsModel.prototype.getSupportedServices = function() { | |
| return this._supportedServices | |
| }, models.SettingsModel.prototype.getConfigs = function() { | |
| return this._configs.keys().map(function(key, t) { | |
| return { | |
| k: key, | |
| v: this.getConfigsByKey(key) | |
| } | |
| }, this) | |
| }, models.SettingsModel.prototype.getConfigsByKey = function(key) { | |
| return this._configs.get(key) | |
| }, models.SettingsModel.prototype.setConfigsByKey = function(key, value) { | |
| this._configs.set(key, value) | |
| }, models.SettingsModel.prototype.setConfigs = function(t) { | |
| t.forEach(function(t) { | |
| this.setConfigsByKey(t.type, t.value) | |
| }, this), this._configsRetrieved = !0 | |
| }, models.SettingsModel.prototype.checkConfigsRetrieved = function() { | |
| return this._configsRetrieved | |
| }, models.SettingsModel.prototype.isUpdateRequired = function() { | |
| if (this._configs.length < 1) return !0; | |
| var t, keys = this._configs.keys(); | |
| for (t = 0; t < keys.length; t++) { | |
| var i = keys[t]; | |
| if (!this._configs.get(i) && this.isServiceSupported(i)) return !0 | |
| } | |
| return !1 | |
| }, models.SettingsModel.prototype.isServiceSupported = function(t) { | |
| var i, s; | |
| for (s = this._supportedServices.length, i = 0; i < s; i++) | |
| if (this._supportedServices[i] === t) return !0; | |
| return !1 | |
| }, models.SettingsModel.prototype.isServiceAvailable = function(t) { | |
| var i = this.getConfigsByKey(t); | |
| return !0 === i || 1 === i || null === i | |
| }, models.SettingsModel.prototype.enableService = function(t) { | |
| this.setConfigsByKey(t, !0) | |
| }, models.SettingsModel.prototype.disableService = function(t) { | |
| this.setConfigsByKey(t, !1) | |
| }, | |
| models.SettingsModel.prototype.isKillSwitchOn = function(t) { | |
| var i, s, o = utils.ScreenServiceMap.getServicesByAppSection(t); | |
| for (s = o.length, i = 0; i < s; i++) | |
| if (this.isServiceSupported(o[i]) && !this.isServiceAvailable(o[i])) return !0; | |
| return !1 | |
| }, models.SettingsModel.prototype.isFIFAPointsUnrecoveredTransation = function() { | |
| return this._isFIFAPointsUnrecoveredTransationEnabled | |
| }, models.SettingsModel.prototype.setFIFAPointsUnrecoveredTransation = function(isEnabled) { | |
| this._isFIFAPointsUnrecoveredTransationEnabled = isEnabled | |
| }, models.SettingsModel.prototype.checkKillSwitch = function(t, i) { | |
| if (this.isKillSwitchOn(t)) return services.Notification.queue([gLocalization.lText("killswitch.sectionDisabled." + t), enums.UINotificationType.NEGATIVE]), i && NavManager.requestChildScreen(i), !0 | |
| }, models.SettingsModel.prototype.isTradingEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.TRADING_ENABLED) | |
| }, models.SettingsModel.prototype.isMarketDataEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.MARKET_DATA_ENABLED) | |
| }, models.SettingsModel.prototype.isObjectivesEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.OBJECTIVES_ENABLED) | |
| }, models.SettingsModel.prototype.isDailyObjectivesEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.DAILY_OBJECTIVES_ENABLED) | |
| }, models.SettingsModel.prototype.isWeeklyObjectivesEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.WEEKLY_OBJECTIVES_ENABLED) | |
| }, models.SettingsModel.prototype.isTOTWHistoryEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.TOTW_HISTORY_ENABLED) | |
| }, models.SettingsModel.prototype.isSBCEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.SBC_ENABLED) | |
| }, models.SettingsModel.prototype.isLegacyYearIdEnabled = function() { | |
| return !this._configs.has(models.SettingsModel.LEGACY_YEAR_ENABLED) || 1 === parseInt(this._configs.get(models.SettingsModel.LEGACY_YEAR_ENABLED), 10) | |
| }, models.SettingsModel.prototype.isSquadRatingFloatCalculationEnabled = function() { | |
| return this.isServiceAvailable(models.SettingsModel.FLOAT_SQUAD_RATING_CALCULATION_ENABLED) | |
| }, models.SettingsModel.STORE_ENABLED = "storeEnabled", models.SettingsModel.CARD_PACK_STORE_ENABLED = "cardPackStoreEnabled", models.SettingsModel.COIN_ENABLED = "coinEnabled", models.SettingsModel.FIFA_POINTS_ENABLED = "fifaPointsEnabled", models.SettingsModel.TRADING_ENABLED = "tradingEnabled", models.SettingsModel.MTX_ENABLED = "mtxEnabled", models.SettingsModel.MARKET_DATA_ENABLED = "marketDataEnabled", models.SettingsModel.OBJECTIVES_ENABLED = "enableDynamicObjectives", models.SettingsModel.DAILY_OBJECTIVES_ENABLED = "enableDailyDynamicObjectives", models.SettingsModel.WEEKLY_OBJECTIVES_ENABLED = "enableWeeklyDynamicObjectives", models.SettingsModel.SBC_ENABLED = "enableSquadBuildingSetsFeature", models.SettingsModel.SBC_ALLOW_UNTRADEABLE = "allowUntradeableForSquadBuildingSets", models.SettingsModel.SBC_GRACE_PERIOD_MINUTES = "squadBuildingSetsGracePeriodMinutes", models.SettingsModel.TOTW_HISTORY_ENABLED = "totwHistoryEnabled", models.SettingsModel.LIVE_MESSAGING_ENABLED = "enableLiveMessaging", models.SettingsModel.LEGACY_YEAR_ENABLED = "enableLegacyYearInfoInItemResourceId", models.SettingsModel.FLOAT_SQUAD_RATING_CALCULATION_ENABLED = "enableFloatPointSquadRating"; | |
| var gSettingsModel = new models.SettingsModel; | |
| NamespaceManager.Register("pages"), pages.ScreenBase = function() { | |
| utils.EventDispatcher.call(this), this._screenId = "", this._previousScreenId = null, this._controller = null, this._interactionEnabled = !1, this._headerState = components.Header.EMPTY, this._images = [], this._forwardTransitionAnimIn = "", this._forwardTransitionAnimOut = "", this._backwardTransitionAnimIn = "", this._backwardTransitionAnimOut = "", this._didGoBack = !1 | |
| }, utils.JS.inherits(pages.ScreenBase, utils.EventDispatcher), pages.ScreenBase.prototype.init = function(data, t) {}, pages.ScreenBase.prototype.destroy = function() { | |
| this.destroyGeneratedElements() | |
| }, pages.ScreenBase.prototype.getScreenId = function() { | |
| return this._screenId | |
| }, pages.ScreenBase.prototype.setScreenId = function(t) { | |
| this._screenId = t | |
| }, pages.ScreenBase.prototype.setPreviousScreenId = function(t) { | |
| this._previousScreenId = t | |
| }, pages.ScreenBase.prototype.getPreviousScreenId = function() { | |
| return this._previousScreenId | |
| }, pages.ScreenBase.prototype.getController = function() { | |
| return this._controller | |
| }, pages.ScreenBase.prototype.setController = function(controller) { | |
| this._controller = controller | |
| }, pages.ScreenBase.prototype.getNativeScrollSupported = function() { | |
| return !0 | |
| }, pages.ScreenBase.prototype.setDidGoBack = function(t) { | |
| this._didGoBack = t | |
| }, pages.ScreenBase.prototype.didGoBack = function() { | |
| return this._didGoBack | |
| }, pages.ScreenBase.prototype.addImage = function(t) { | |
| utils.JS.isValid(t) && this._images.push(t) | |
| }, pages.ScreenBase.prototype.setImages = function(images) { | |
| this._images = images | |
| }, pages.ScreenBase.prototype.getImages = function() { | |
| return this._images | |
| }, pages.ScreenBase.prototype.start = function() {}, pages.ScreenBase.prototype.stop = function() {}, pages.ScreenBase.prototype.onAppPaused = function() {}, pages.ScreenBase.prototype.onAppResumed = function() { | |
| var images = this.getImages(); | |
| images.forEach(function(t, i) { | |
| utils.JS.isValid(t.getRoot()) && !t.getRoot().complete ? t.getRoot().attr("src", t.src) : images.splice(i, 1) | |
| }) | |
| }, pages.ScreenBase.prototype.beforeAnimateIn = function() {}, pages.ScreenBase.prototype.afterAnimateOut = function() {}, pages.ScreenBase.prototype.animateIn = function() {}, pages.ScreenBase.prototype.animateOut = function() {}, pages.ScreenBase.prototype.moveOffScreen = function(t) { | |
| t ? this.getRoot().addClass("offScreen") : this.getRoot().removeClass("offScreen") | |
| }, pages.ScreenBase.prototype.isInteractionEnabled = function() { | |
| return this._interactionEnabled | |
| }, pages.ScreenBase.prototype.setInteractionsEnabled = function(enabled) { | |
| this._interactionEnabled !== enabled && (this._interactionEnabled = enabled, this.dispatch(pages.ScreenBase.INTERACTION_STATE_CHANGED, enabled), enabled ? gClickShield.isInteractionShieldShowing() && gClickShield.hideShield(components.ClickShield.SHIELD.INTERACTION) : gClickShield.showShield(components.ClickShield.SHIELD.INTERACTION)) | |
| }, pages.ScreenBase.prototype.updateHeader = function(state, title, t) { | |
| this._headerState = state, t = t || "", gHeader.setTitle(title), gHeader.setSubTitle(""), gHeader.setHeaderClass(t) | |
| }, pages.ScreenBase.prototype.getHeaderState = function() { | |
| return this._headerState | |
| }, pages.ScreenBase.prototype.setForwardTransitionAnimIn = function(value) { | |
| this._forwardTransitionAnimIn = value | |
| }, pages.ScreenBase.prototype.setForwardTransitionAnimOut = function(value) { | |
| this._forwardTransitionAnimOut = value | |
| }, pages.ScreenBase.prototype.setBackwardTransitionAnimIn = function(value) { | |
| this._backwardTransitionAnimIn = value | |
| }, pages.ScreenBase.prototype.setBackwardTransitionAnimOut = function(value) { | |
| this._backwardTransitionAnimOut = value | |
| }, pages.ScreenBase.prototype.getTransitionAnimIn = function(direction) { | |
| var t; | |
| return direction === NavManager.TRANSITION_TYPE_BACKWARD ? t = this._backwardTransitionAnimIn : direction === NavManager.TRANSITION_TYPE_FORWARD && (t = this._forwardTransitionAnimIn), utils.JS.isString(t) && "" !== t ? t : pages.ScreenBase.DEFAULT_IN_ANIM | |
| }, pages.ScreenBase.prototype.getTransitionAnimOut = function(direction) { | |
| var t; | |
| return direction === NavManager.TRANSITION_TYPE_BACKWARD ? t = this._backwardTransitionAnimOut : direction === NavManager.TRANSITION_TYPE_FORWARD && (t = this._forwardTransitionAnimOut), utils.JS.isString(t) && "" !== t ? t : pages.ScreenBase.DEFAULT_OUT_ANIM | |
| }, pages.ScreenBase.prototype.supportsLandscapeOrientation = function() { | |
| return !1 | |
| }, pages.ScreenBase.prototype.getSupportedOrientations = function() { | |
| return this.supportsLandscapeOrientation() ? [pages.controllers.ScreenControllerBase.ORIENTATION_STATE.PORTRAIT, pages.controllers.ScreenControllerBase.ORIENTATION_STATE.PORTRAIT_DOWN, pages.controllers.ScreenControllerBase.ORIENTATION_STATE.LANDSCAPE_LEFT, pages.controllers.ScreenControllerBase.ORIENTATION_STATE.LANDSCAPE_RIGHT] : [pages.controllers.ScreenControllerBase.ORIENTATION_STATE.PORTRAIT, pages.controllers.ScreenControllerBase.ORIENTATION_STATE.PORTRAIT_DOWN] | |
| }, pages.ScreenBase.prototype.destroyHtmlLinks = function(t) { | |
| $('a[target="_blank"]', t).each(function() { | |
| $(this).off(enums.Event.TAP) | |
| }) | |
| }, pages.ScreenBase.INTERACTION_STATE_CHANGED = "pages.ScreenBase.INTERACTION_STATE_CHANGED", pages.ScreenBase.DEFAULT_IN_ANIM = "fade-in-screen", pages.ScreenBase.DEFAULT_OUT_ANIM = "fade-out-screen", utils.JS.inherits(FUIViewController, FUIResponder), FUIViewController.prototype.init = function init() { | |
| this.initialized || (this.superclass(), this.initialized = !0) | |
| }, FUIViewController.prototype.dealloc = function dealloc() { | |
| this.removeFromParentViewController(), this._childViewControllers.forEach(function(c) { | |
| c.willMove(this), c._parentViewController = null, c.didMove(this) | |
| }, this), this._childViewControllers = [], this._view && (this._view.dealloc(), this._view = null), this.superclass() | |
| }, FUIViewController.prototype.getParentViewController = function getParentViewController() { | |
| return this._parentViewController | |
| }, FUIViewController.prototype.getNavigationController = function getNavigationController() { | |
| for (var t = this.getParentViewController(); null !== t;) { | |
| if (t.isSubClass(FUINavigationController)) return t; | |
| t = t.getParentViewController() | |
| } | |
| return null | |
| }, FUIViewController.prototype.getRootNavigationController = function getRootNavigationController() { | |
| for (var t = this.getNavigationController(), i = null; null !== t;) i = t, t = t.getNavigationController(); | |
| return i | |
| }, FUIViewController.prototype._getViewInstanceFromData = function _getViewInstanceFromData() { | |
| return null | |
| }, FUIViewController.prototype._loadView = function _loadView() { | |
| if (!this.hasLoaded) { | |
| var view = this._getViewInstanceFromData(); | |
| view && (this._view = view, this._view.setEventDelegate(this), this._view.init()) | |
| } | |
| }, FUIViewController.prototype.getView = function getView() { | |
| return this._view || (this.isLoading = !0, this._loadView(), this.isLoading = !1, this.viewDidLoad()), this.hasLoaded || this.isLoading || (this.hasLoaded = !0), this._view | |
| }, FUIViewController.prototype.setView = function setView(view) { | |
| if (view !== this._view) { | |
| if (this._view) { | |
| var t = this._view; | |
| t.removeFromSuperview(), t.dealloc() | |
| } | |
| this._view = view | |
| } | |
| }, FUIViewController.prototype.isViewDisplayed = function isViewDisplayed() { | |
| function _checkIfInElement(t, i) { | |
| var parent = t.parentNode; | |
| return !!parent && (parent === i || _checkIfInElement(parent, i)) | |
| } | |
| return _checkIfInElement(this.getView().getRootElement(), document.getElementsByTagName("body")[0]) | |
| }, FUIViewController.prototype.addChildViewController = function addChildViewController(t) { | |
| t.willMove(this), this._childViewControllers.push(t), t._parentViewController = this, t.setEventDelegate(this), t.didMove(this) | |
| }, FUIViewController.prototype.removeChildViewController = function removeChildViewController(t) { | |
| var index = this._childViewControllers.indexOf(t); | |
| if (index >= 0) { | |
| t.willMove(this); | |
| var view = this.getView(), | |
| i = t.getView(); | |
| view && i && i.isSubview(view) && i.removeFromSuperview(), t.removeEventDelegate(this), t._parentViewController === this && (t._parentViewController = null), this._childViewControllers.splice(index, 1), t.didMove(this) | |
| } | |
| }, FUIViewController.prototype.removeFromParentViewController = function removeFromParentViewController() { | |
| var parent = this.getParentViewController(); | |
| parent && parent.removeChildViewController(this) | |
| }, FUIViewController.prototype.getNavigationTitle = function getNavigationTitle() { | |
| return "" | |
| }, FUIViewController.prototype.getToolbarItems = function getToolbarItems() { | |
| return this.getNavigationController().getToolbarItems() | |
| }, FUIViewController.prototype.getNavigationItem = function getNavigationItem() { | |
| return null | |
| }, FUIViewController.prototype.willMove = function willMove(t) {}, FUIViewController.prototype.didMove = function didMove(t) {}, FUIViewController.prototype.viewDidLoad = function viewDidLoad() {}, FUIViewController.prototype.viewWillAppear = function viewWillAppear() {}, FUIViewController.prototype.viewWillDisappear = function viewWillDisappear() {}, FUIViewController.prototype.viewDidAppear = function viewDidAppear() {}, FUIViewController.prototype.viewDidDisappear = function viewDidDisappear() {}, NamespaceManager.Register("views.popups"), views.popups.LiveMessage = function LiveMessage() { | |
| FUIView.call(this), this._isRendered = !1, this._generate() | |
| }, | |
| utils.JS.inherits(views.popups.LiveMessage, FUIView), views.popups.LiveMessage.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.setAttribute("id", "LiveMessageOverlay"), t.classList.add("p-boot-base"), t.classList.add("l-boot-base"); | |
| var i = document.createElement("div"); | |
| i.classList.add("p-liveMessage"), i.classList.add("l-liveMessage"), i.classList.add("boot-box"); | |
| var s = document.createElement("div"); | |
| s.classList.add("boot-content-container"); | |
| var o = document.createElement("div"); | |
| o.classList.add("boot-secondary-content"), this.__image = document.createElement("div"), this.$_image = $(this.__image), this.__image.classList.add("boot-content"), this.__image.classList.add("img-tablet"), this.__image.classList.add("img-container"), this._image = new components.ImageLoader, this.__image.appendChild(this._image.getRootElement()), o.appendChild(this.__image), s.appendChild(o); | |
| var l = document.createElement("div"); | |
| l.classList.add("boot-primary-content"), l.classList.add("flush-top"); | |
| var u = document.createElement("div"); | |
| u.classList.add("boot-content"), this.__header = document.createElement("header"), this.$_header = $(this.__header), this._date = new components.TextField, this._date.getRootElement().classList.add("secondary"), this._date.getRootElement().classList.add("left"), this.__header.appendChild(this._date.getRootElement()), this.__title = document.createElement("h2"), this.$_title = $(this.__title), this.__header.appendChild(this.__title), this._numMessages = new components.TextField, this._numMessages.getRootElement().classList.add("secondary"), this._numMessages.getRootElement().classList.add("right"), this.__header.appendChild(this._numMessages.getRootElement()), u.appendChild(this.__header), this.__image2 = document.createElement("div"), this.$_image2 = $(this.__image2), this.__image2.classList.add("img-mobile"), this.__image2.classList.add("img-container"), this._image2 = new components.ImageLoader, this.__image2.appendChild(this._image2.getRootElement()), u.appendChild(this.__image2), this.__content = document.createElement("div"), this.$_content = $(this.__content), this.__content.classList.add("scrollable"), this.__content.classList.add("message-content"), u.appendChild(this.__content), this._continueBtn = new views.buttons.DefaultButton, this._continueBtn.getRootElement().classList.add("call-to-action"), u.appendChild(this._continueBtn.getRootElement()), l.appendChild(u), s.appendChild(l), i.appendChild(s), t.appendChild(i), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.popups.LiveMessage.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this.__image = null, this.$_image = null, this._image.destroy(), this._image = null, this.__header = null, this.$_header = null, this._date.destroy(), this._date = null, this.__title = null, this.$_title = null, this._numMessages.destroy(), this._numMessages = null, this.__image2 = null, this.$_image2 = null, this._image2.destroy(), this._image2 = null, this.__content = null, this.$_content = null, this._continueBtn.destroy(), this._continueBtn = null | |
| }, views.popups.LiveMessage.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.popups.LiveMessage.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.popups.LiveMessage.prototype.init = function init() { | |
| this.superclass(), this._continueBtn.init(), this._continueBtn.setText(gLocalization.lText("common.dialog.continue")), this.setInteractionState(!0) | |
| }, views.popups.LiveMessage.prototype.setInteractionState = function setInteractionState(t) { | |
| this._setInteractionStateFlag(t), this._continueBtn.setInteractionState(t) | |
| }, views.popups.LiveMessage.prototype._renderHeader = function _renderHeader(title, t, i) { | |
| this.$_title.html(title), this._date.setText(utils.TextUtils.formatDatePrettified(new Date(1e3 * t))), this._numMessages.setText(i) | |
| }, views.popups.LiveMessage.prototype._renderImage = function _renderImage(src) { | |
| "undefined" !== src ? (this._image.setLocalResource(src), | |
| this._image2.setLocalResource(src)) : (this._image.setLocalResource("images/liveMessageDefault.png"), this._image2.setLocalResource("images/liveMessageDefault.png")) | |
| }, views.popups.LiveMessage.prototype._renderContent = function _renderContent(content) { | |
| this.$_content.html(utils.TextUtils.nltobr(content)) | |
| }, views.popups.LiveMessage.prototype.render = function render(t, i) { | |
| this._isRendered ? (this.$_header.fadeOut(200, function() { | |
| this._renderHeader(t.title, t.startDateTime, i), this.$_header.fadeIn(200) | |
| }.bind(this)), this.$_content.fadeOut(200, function() { | |
| this._renderContent(t.text), this.$_content.fadeIn(200) | |
| }.bind(this)), this._image.getRoot().fadeOut(200, function() { | |
| this._renderImage(t.imageSrc), this._image.getRoot().fadeIn(200) | |
| }.bind(this))) : (this._renderHeader(t.title, t.startDateTime, i), this._renderImage(t.imageSrc), this._renderContent(t.text), this._isRendered = !0) | |
| }, views.popups.LiveMessage.prototype.getContinueButton = function getContinueButton() { | |
| return this._continueBtn | |
| }, NamespaceManager.Register("views.popups"), views.popups.DailyGift = function LiveMessage() { | |
| FUIView.call(this), this.onComplete = new FUTObservable, Object.defineProperty(this, "onComplete", { | |
| writable: !1 | |
| }), this._generate() | |
| }, utils.JS.inherits(views.popups.DailyGift, FUIView), views.popups.DailyGift.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.classList.add("popupDailyGift"); | |
| var i = document.createElement("header"); | |
| this.__popupTitle = document.createElement("h1"), this.$_popupTitle = $(this.__popupTitle), this.__popupTitle.classList.add("popupTitle"), i.appendChild(this.__popupTitle), t.appendChild(i), this.__textInfo = document.createElement("p"), this.$_textInfo = $(this.__textInfo), this.__textInfo.classList.add("text-info"), t.appendChild(this.__textInfo); | |
| var s = document.createElement("div"); | |
| s.classList.add("bodySection"), this.__packGiftImage = document.createElement("div"), this.$_packGiftImage = $(this.__packGiftImage), this.__packGiftImage.classList.add("packGiftImage"), this._packBackgroundImage = new components.ImageLoader, this._packBackgroundImage.getRootElement().classList.add("packBackgroundImage"), this.__packGiftImage.appendChild(this._packBackgroundImage.getRootElement()), this._packForegroundImage = new components.ImageLoader, this._packForegroundImage.getRootElement().classList.add("packForegroundImage"), this.__packGiftImage.appendChild(this._packForegroundImage.getRootElement()), this._packLogoImage = new components.ImageLoader, this._packLogoImage.getRootElement().classList.add("packLogoImage"), this.__packGiftImage.appendChild(this._packLogoImage.getRootElement()), s.appendChild(this.__packGiftImage), this.__coinGiftImage = document.createElement("div"), this.$_coinGiftImage = $(this.__coinGiftImage), this.__coinGiftImage.classList.add("coinGiftImage"), this._coinGiftBackground = new components.ImageLoader, this._coinGiftBackground.getRootElement().classList.add("packBackgroundImage"), this.__coinGiftImage.appendChild(this._coinGiftBackground.getRootElement()), this._coinGiftForeground = new components.ImageLoader, this._coinGiftForeground.getRootElement().classList.add("packForegroundImage"), this.__coinGiftImage.appendChild(this._coinGiftForeground.getRootElement()), this._coinGiftLogoImage = new components.ImageLoader, this._coinGiftLogoImage.getRootElement().classList.add("packLogoImage"), this.__coinGiftImage.appendChild(this._coinGiftLogoImage.getRootElement()), s.appendChild(this.__coinGiftImage), this._giftType = new components.TextField, s.appendChild(this._giftType.getRootElement()), t.appendChild(s), this._claimButton = new components.Button, this._claimButton.getRootElement().classList.add("call-to-action"), t.appendChild(this._claimButton.getRootElement()), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.popups.DailyGift.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this.__popupTitle = null, this.$_popupTitle = null, this.__textInfo = null, this.$_textInfo = null, | |
| this.__packGiftImage = null, this.$_packGiftImage = null, this._packBackgroundImage.destroy(), this._packBackgroundImage = null, this._packForegroundImage.destroy(), this._packForegroundImage = null, this._packLogoImage.destroy(), this._packLogoImage = null, this.__coinGiftImage = null, this.$_coinGiftImage = null, this._coinGiftBackground.destroy(), this._coinGiftBackground = null, this._coinGiftForeground.destroy(), this._coinGiftForeground = null, this._coinGiftLogoImage.destroy(), this._coinGiftLogoImage = null, this._giftType.destroy(), this._giftType = null, this._claimButton.destroy(), this._claimButton = null | |
| }, views.popups.DailyGift.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.popups.DailyGift.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.popups.DailyGift.COIN_ASSET_ID = 23, views.popups.DailyGift.prototype.init = function init() { | |
| this._claimButton.addListener(components.BaseButton.CLICKED, this, this.onComplete.notify.bind(this.onComplete)), this._claimButton.init(), this._claimButton.setText(gLocalization.lText("common.dialog.accept")), this._claimButton.hideBusyAnimation(), this._claimButton.enable(), this.$_textInfo.html(gLocalization.lText("dailyreward.popupInfo")), this.superclass() | |
| }, views.popups.DailyGift.prototype.dealloc = function dealloc() { | |
| this.onComplete.dealloc(), this.superclass() | |
| }, views.popups.DailyGift.prototype.render = function render(type, value) { | |
| var t = 0; | |
| "coin" === type ? (this.$_packGiftImage.hide(), this.$_coinGiftImage.show(), t = views.popups.DailyGift.COIN_ASSET_ID, this._coinGiftBackground.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_PACKS_BACKGROUND, enums.Year.ASSET, t, t)), this._coinGiftForeground.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_BOOST_COIN, enums.Year.ASSET, 1, 0)), this._coinGiftLogoImage.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_PACKS_LOGO, enums.Year.ASSET, t)), this._giftType.setText(value + " " + gLocalization.lText("card.title.coins"))) : "pack" === type && (t = enums.Purchase.DisplayGroupId.MYPACKS, this.$_packGiftImage.show(), this.$_coinGiftImage.hide(), this._packBackgroundImage.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_PACKS_BACKGROUND, enums.Year.ASSET, t, t)), this._packForegroundImage.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_PACKS_FOREGROUND, enums.Year.ASSET, t, 0)), this._packLogoImage.setResource(utils.AssetLocator.getImage(utils.AssetLocator.IMAGE_TYPE_PACKS_LOGO, enums.Year.ASSET, t)), this._giftType.setText(gLocalization.lText("FUT_STORE_PACK_" + value.toString() + "_NAME_MOBILE"))), this.$_popupTitle.html(gLocalization.lText("dailyreward.popupheader").toUpperCase()) | |
| }, NamespaceManager.Register("interfaces"), interfaces.KeyboardEventDelegate = function() {}, interfaces.KeyboardEventDelegate.prototype.handleKeyUpEvent = function(e) {}, NamespaceManager.Register("controllers.views.popups"), controllers.views.popups.BasePopup = function BasePopup() { | |
| FUIViewController.call(this), this.onExit = new FUTObservable, Object.defineProperty(this, "onExit", { | |
| writable: !1 | |
| }); | |
| var animate = new valueobjects.BooleanVO; | |
| Object.defineProperty(this, "animate", { | |
| set: animate.set.bind(animate), | |
| get: animate.get.bind(animate) | |
| }), this.animate = !1 | |
| }, utils.JS.inherits(controllers.views.popups.BasePopup, FUIViewController), controllers.views.popups.BasePopup.prototype.init = function init() { | |
| this.superclass(), getKeyboardEventController().registerDelegate(this, UTKeyboardEventController.PRIORITY.POPUP) | |
| }, controllers.views.popups.BasePopup.prototype.dealloc = function dealloc() { | |
| this.onExit.dealloc(), this.onExit = null, getKeyboardEventController().unregisterDelegate(this, UTKeyboardEventController.PRIORITY.POPUP), this.superclass() | |
| }, controllers.views.popups.BasePopup.prototype.onBackButton = function onBackButton() { | |
| return this.closePopup(), !1 | |
| }, controllers.views.popups.BasePopup.prototype.closePopup = function closePopup() { | |
| this.onExit.notify() | |
| }, controllers.views.popups.BasePopup.prototype.handleKeyUpEvent = function handleKeyUpEvent(e) { | |
| e.key !== enums.KeyboardKey.ESCAPE && e.key !== enums.KeyboardKey.MS_ESCAPE || this.onExit.notify(enums.UIDialogOptions.CANCEL) | |
| }, NamespaceManager.Register("controllers.views.popups"), controllers.views.popups.DailyGift = function DailyGift(t) { | |
| controllers.views.popups.BasePopup.call(this), this._rewardType = t.rewardType || "", Object.defineProperty(this, "_rewardType", { | |
| writable: !1 | |
| }), this._rewardValue = t.rewardValue || -1, Object.defineProperty(this, "_rewardValue", { | |
| writable: !1 | |
| }) | |
| }, utils.JS.inherits(controllers.views.popups.DailyGift, controllers.views.popups.BasePopup), controllers.views.popups.DailyGift.prototype.init = function init() { | |
| this.superclass(), this.getView().render(this._rewardType, this._rewardValue), this.getView().onComplete.observe(this, this.onExit.notify.bind(this.onExit)), gTelemetryManager.trackPage(TelemetryManager.Sections.MISC, "Daily Gift") | |
| }, controllers.views.popups.DailyGift.prototype._getViewInstanceFromData = function _getViewInstanceFromData() { | |
| return new views.popups.DailyGift | |
| }, NamespaceManager.Register("pages.controllers"), pages.controllers.ScreenControllerBase = function(view) { | |
| this._view = view | |
| }, pages.controllers.ScreenControllerBase.prototype.getView = function() { | |
| return this._view | |
| }, pages.controllers.ScreenControllerBase.prototype.init = function() { | |
| repositories.Message.getDailyGift().observe(this, this.onDailyGift) | |
| }, pages.controllers.ScreenControllerBase.prototype.destroy = function() {}, pages.controllers.ScreenControllerBase.prototype.onAppPaused = function() {}, pages.controllers.ScreenControllerBase.prototype.onAppResumed = function() { | |
| gAuthenticationModel.isFullyAuthenticated() && controllers.SettingsUpdaterController.startTimer(), repositories.Squad.hasExternalShowOffSquad() && services.Squad.loadShowOffSquad().observe(this, function(t, i) { | |
| t.unobserve(this), i.success && NavManager.requestChildScreen(Screens.getView("SHOW_OFF_SQUAD"), { | |
| showOffDTO: i.showOffDTO | |
| }) | |
| }) | |
| }, pages.controllers.ScreenControllerBase.prototype.getDataCache = function() { | |
| return null | |
| }, pages.controllers.ScreenControllerBase.prototype.setPreviousScreenId = function(t) { | |
| this.getView().setPreviousScreenId(t) | |
| }, pages.controllers.ScreenControllerBase.prototype.getPreviousScreenId = function() { | |
| return this.getView().getPreviousScreenId() | |
| }, pages.controllers.ScreenControllerBase.prototype.onDailyGift = function(t, i, data) { | |
| function onGiftClaimed(t, i, data, errorCode) { | |
| t.unobserve(this), i ? (services.Notification.queue([gLocalization.lText("infopanel.label.claimed"), enums.UINotificationType.POSITIVE]), "pack" === data.rewardType && repositories.User.getCurrent().incrementNumUnopenedPacks()) : services.Notification.queue([gLocalization.lText("dailyreward.claimfailed"), enums.UINotificationType.NEGATIVE]) | |
| } | |
| if (t.unobserve(this), i) { | |
| var s = new controllers.views.popups.DailyGift(data.dailyGift); | |
| s.onExit.observe(this, function onCloseDailyGiftPopup(t) { | |
| t.unobserve(this), data.dailyGift.claim().observe(this, onGiftClaimed) | |
| }), gPopupClickShield.setActivePopup(s) | |
| } | |
| }, pages.controllers.ScreenControllerBase.prototype.onOrientationChanged = function(orientation) {}, pages.controllers.ScreenControllerBase.prototype.onScreenInitialized = function(data, t) {}, pages.controllers.ScreenControllerBase.prototype.onScreenStarted = function() {}, pages.controllers.ScreenControllerBase.prototype.onScreenStopped = function() {}, pages.controllers.ScreenControllerBase.prototype.onScreenTransitionRequest = function(t) { | |
| return !0 | |
| }, pages.controllers.ScreenControllerBase.prototype.onRequestBack = function() { | |
| return !0 | |
| }, pages.controllers.ScreenControllerBase.prototype.onDeviceBackButton = function() { | |
| return !0 | |
| }, pages.controllers.ScreenControllerBase.prototype.onActiveScreenTransitionRequest = function() {}, pages.controllers.ScreenControllerBase.ORIENTATION_STATE = { | |
| PORTRAIT_DOWN: 180, | |
| LANDSCAPE_LEFT: -90, | |
| LANDSCAPE_RIGHT: 90, | |
| PORTRAIT: 0 | |
| }, NamespaceManager.Register("interfaces"), interfaces.EADPIdentityManager = function() {}, interfaces.EADPIdentityManager.prototype.isAuthenticated = function(t) {}, interfaces.EADPIdentityManager.prototype.getToken2CodeRedirectUri = function() {}, | |
| interfaces.EADPIdentityManager.prototype.clearStorage = function() {}, interfaces.EADPIdentityManager.prototype.checkEADPAuth = function checkEADPAuth(t, i) {}, interfaces.EADPIdentityManager.prototype.getUserInfo = function getUserInfo(t, i) {}, interfaces.EADPIdentityManager.prototype.initiateLoginFlow = function(t, i, s) {}, interfaces.EADPIdentityManager.prototype.getLoginUrl = function getLoginUrl() {}, utils.JS.inherits(EADPIdentityManager, FUTObject), EADPIdentityManager.prototype.setLocale = function setLocale(locale) { | |
| this.locale = locale | |
| }, EADPIdentityManager.prototype.setRedirectUri = function setRedirectUri(uri) { | |
| this.redirect_uri = uri | |
| }, EADPIdentityManager.prototype.setDeviceId = function setDeviceId(t) { | |
| this.device_id = t | |
| }, EADPIdentityManager.prototype.setConnectHost = function setConnectHost(t) { | |
| this.connectHost = t | |
| }, EADPIdentityManager.prototype.setPortalHost = function setPortalHost(t) { | |
| this.portalHost = t | |
| }, EADPIdentityManager.prototype.setProxyHost = function setProxyHost(t) { | |
| this.proxyHost = t | |
| }, EADPIdentityManager.prototype.setClientScope = function setClientScope(scope) { | |
| this.mobile_client_scope = scope | |
| }, EADPIdentityManager.prototype.setClientId = function setClientId(id) { | |
| this.mobile_client_id = id | |
| }, EADPIdentityManager.prototype.setClientSecret = function setClientSecret(t) { | |
| this.mobile_client_secret = t | |
| }, EADPIdentityManager.prototype.getAccessToken = function getAccessToken() { | |
| var t = getStorage(); | |
| return t ? t.getItem("_eadp.identity.access_token") : null | |
| }, EADPIdentityManager.prototype.getRefreshToken = function() { | |
| var t = getStorage(); | |
| return t ? t.getItem("_eadp.identity.refresh_token") : null | |
| }, EADPIdentityManager.prototype.isAuthenticated = function isAuthenticated(t) { | |
| eadp.identity.getAccessToken() && eadp.identity.getRefreshToken() && t() | |
| }, EADPIdentityManager.prototype.isExternalLink = function isExternalLink(url) { | |
| return null !== url && "" !== url && (-1 === url.lastIndexOf(this.connectHost) && -1 === url.lastIndexOf(this.portalHost) && -1 === url.lastIndexOf("127.0.0.1") && -1 === url.lastIndexOf("/fifa/fltOnlineAssets/")) | |
| }, EADPIdentityManager.prototype.isErrorPattern = function isErrorPattern(url, pattern, t) { | |
| var i = this.portalHost + pattern; | |
| return null !== url && "" !== url && (0 === url.lastIndexOf(i) && -1 === url.lastIndexOf(t + "=")) | |
| }, EADPIdentityManager.prototype.getToken2CodeRedirectUri = function getToken2CodeRedirectUri() { | |
| return "nucleus:rest" | |
| }, EADPIdentityManager.prototype.clearStorage = function clearStorage() { | |
| var t = getStorage(); | |
| t && (t.setItem("_eadp.identity.access_token", ""), t.setItem("_eadp.identity.expire", ""), t.setItem("_eadp.identity.timestamp", ""), t.setItem("_eadp.identity.refresh_token", ""), t.setItem("_eadp.identity.pidId", "")) | |
| }, EADPIdentityManager.prototype.getResponseType = function getResponseType() { | |
| return "code" | |
| }, EADPIdentityManager.prototype.checkEADPAuth = function checkEADPAuth(t, i) { | |
| var s = { | |
| client_id: this.mobile_client_id, | |
| response_type: this.getResponseType(), | |
| display: "web2/login", | |
| locale: this.locale, | |
| redirect_uri: "nucleus:rest", | |
| prompt: "none" | |
| }; | |
| this.mobile_client_scope && (s.scope = this.mobile_client_scope); | |
| var o = new FUTHttpRequest; | |
| o.setUrl(this.connectHost + "/connect/auth"), o.setUrlVariables(s), o.observe(this, function _onAuthCheckComplete(s, data) { | |
| s.unobserve(this), data.success && utils.JS.isObject(data.response) && data.response.code ? t() : i() | |
| }), o.send() | |
| }, EADPIdentityManager.prototype.getUserInfo = function getUserInfo(t, i) { | |
| function _cbUserInfoTokenRefresh(code) { | |
| code ? i(code) : this.getUserInfo(t, i) | |
| } | |
| var s = new FUTHttpRequest; | |
| s.setUrl(this.proxyHost + "/proxy/identity/pids/me"), s.setRequestHeader("Authorization", "Bearer " + this.getAccessToken()), s.setRequestHeader("Accept", "application/json; charset=utf-8; */*; q=0.01"), s.observe(this, function _onGetUserInfoComplete(s, data) { | |
| if (s.unobserve(this), data.success) { | |
| var o = getStorage(); | |
| o ? (o.setItem("_eadp.identity.pidId", data.response.pid.pidId), t(data.response.pid)) : i(this.error.LOCAL_STORAGE) | |
| } else data.status === enums.HTTPStatusCode.FORBIDDEN ? this.tokenRefresh(_cbUserInfoTokenRefresh.bind(this)) : i(this.error.SERVER) | |
| }), s.send() | |
| }, EADPIdentityManager.prototype.tokenRefresh = function tokenRefresh(t) { | |
| var i = this.getRefreshToken(); | |
| if (!i) return utils.Debug.Assert(!1, "[EADPlib] Token refresh flow attempted when refresh token is null."), void t(this.error.REFRESH_TOKEN); | |
| var s = new FUTHttpRequest; | |
| s.setContentType(enums.HTTPContentType.FORM_DATA), s.setRequestType(enums.HTTPRequestMethod.POST), s.setUrl(this.connectHost + "/connect/token"), s.observe(this, function _onTokenRefreshComplete(i, data) { | |
| if (i.unobserve(this), data.success) { | |
| var s = getStorage(); | |
| s ? (s.setItem("_eadp.identity.access_token", data.response.access_token), s.setItem("_eadp.identity.expire", data.response.expires_id), s.setItem("_eadp.identity.timestamp", Date.now()), s.setItem("_eadp.identity.refresh_token", data.response.refresh_token), t()) : t(this.error.LOCAL_STORAGE) | |
| } else t(this.error.REFRESH_TOKEN) | |
| }), s.setUrlVariables({ | |
| client_id: this.mobile_client_id, | |
| refresh_token: i, | |
| client_secret: this.mobile_client_secret, | |
| grant_type: "refresh_token" | |
| }), s.send() | |
| }, EADPIdentityManager.prototype.closeLoginFlow = function() { | |
| var t = document.getElementById("eadp_chrome_iframe"); | |
| t.outerHTML = "", t = null | |
| }, EADPIdentityManager.prototype.initiateLoginFlow = function initiateLoginFlow(t, i, s) { | |
| var o = document.getElementById(t); | |
| if (o) { | |
| this.exchangeAccessTokenSuccessCallback = i, this.exchangeAccessTokenFailCallback = s; | |
| var l = document.createElement("iframe"); | |
| l.src = this.getLoginUrl(), l.id = "eadp_chrome_iframe", l.frameBorder = 0, l.onload = function() { | |
| var url = document.getElementById(l.id).src; | |
| if (-1 !== url.indexOf("code=")) { | |
| var code = url.split("code=")[1].split("&")[0]; | |
| this.exchangeAccessToken(code, i, s) | |
| } | |
| }.bind(this), o.appendChild(l) | |
| } | |
| }, EADPIdentityManager.prototype.exchangeAccessToken = function exchangeAccessToken(code, t, i) { | |
| var s = new FUTHttpRequest; | |
| s.setRequestType(enums.HTTPRequestMethod.POST), s.setUrl(this.connectHost + "/connect/token"), s.setContentType(enums.HTTPContentType.FORM_DATA), s.setUrlVariables({ | |
| grant_type: "authorization_code", | |
| code: code, | |
| client_id: this.mobile_client_id, | |
| client_secret: this.mobile_client_secret | |
| }), s.observe(this, function _onExchangeAccessTokenComplete(s, data) { | |
| if (s.unobserve(this), data.success) { | |
| var o = getStorage(); | |
| o ? (o.setItem("_eadp.identity.access_token", data.response.access_token), o.setItem("_eadp.identity.expire", data.response.expires_in), o.setItem("_eadp.identity.timestamp", Date.now()), o.setItem("_eadp.identity.refresh_token", data.response.refresh_token), t(data.response.access_token)) : i(this.error.LOCAL_STORAGE) | |
| } else i(this.error.SERVER) | |
| }), s.send() | |
| }, EADPIdentityManager.prototype.getLoginUrl = function getLoginUrl() { | |
| var t = { | |
| prompt: "login", | |
| accessToken: this.getAccessToken(), | |
| client_id: this.mobile_client_id, | |
| response_type: this.getResponseType(), | |
| display: "web2/login", | |
| locale: this.locale, | |
| machineProfileKey: this.device_id | |
| }; | |
| return null !== t.accessToken && "" !== t.accessToken && delete t.prompt, utils.JS.isEmpty(this.mobile_client_scope) || (t.scope = this.mobile_client_scope), this.connectHost + "/connect/auth" + utils.HTTP.generateUrlParams(t) | |
| }, EADPIdentityManager.prototype.token2code = function token2code(t, i, s) { | |
| function _cbToken2CodeTokenRefresh(code) { | |
| code ? (code === this.error.REFRESH_TOKEN && (o.status = enums.HTTPStatusCode.INVALID_CREDENTIALS), s(o)) : this.token2code(t, i, s) | |
| } | |
| var o, l = new FUTHttpRequest; | |
| l.setUrl(this.connectHost + "/connect/auth"), l.setUrlVariables({ | |
| client_id: t, | |
| redirect_uri: this.getToken2CodeRedirectUri(), | |
| response_type: "code", | |
| access_token: this.getAccessToken() | |
| }), l.observe(this, function _onToken2CodeComplete(t, data) { | |
| t.unobserve(this), data.success ? i(data) : data.status === enums.HTTPStatusCode.BAD_REQUEST ? (o = data, this.tokenRefresh(_cbToken2CodeTokenRefresh.bind(this))) : s(data) | |
| }), l.send() | |
| }, EADPIdentityManager.prototype.logout = function(t) { | |
| var i = new FUTHttpRequest; | |
| i.setRequestType(enums.HTTPRequestMethod.GET), i.setUrl(this.connectHost + "/connect/logout"), i.setTimeout(5e3), i.observe(this, function _onLogoutComplete(i, data) { | |
| i.unobserve(this), this.clearStorage(), t() | |
| }), i.setUrlVariables({ | |
| client_id: this.mobile_client_id, | |
| redirect_uri: "nucleus:rest" | |
| }), i.send() | |
| }, utils.JS.inherits(EADPIdentityManager_Web, EADPIdentityManager), | |
| EADPIdentityManager_Web.prototype.isAuthenticated = function isAuthenticated(t) { | |
| eadp.identity.getAccessToken() && t() | |
| }, EADPIdentityManager_Web.prototype.getResponseType = function getResponseType() { | |
| return "token" | |
| }, EADPIdentityManager_Web.prototype.parseCheckEADPResponse = function parseCheckEADPResponse(responseText, t, i) { | |
| try { | |
| var json = JSON.parse(responseText); | |
| if (json.access_token) return this.setAccessToken(json.access_token), t() | |
| } catch (t) {} | |
| i() | |
| }, EADPIdentityManager_Web.prototype.setAccessToken = function setAccessToken(t) { | |
| getStorage().setItem("_eadp.identity.access_token", t) | |
| }, EADPIdentityManager_Web.prototype.tokenRefresh = function tokenRefresh(t) { | |
| this.checkEADPAuth(t.bind(this), t.bind(this, this.error.REFRESH_TOKEN)) | |
| }, EADPIdentityManager_Web.prototype.initiateLoginFlow = function initiateLoginFlow(t, i, s) { | |
| window.top.location = this.getLoginUrl() | |
| }, EADPIdentityManager_Web.prototype.getLoginUrl = function getLoginUrl() { | |
| var t = { | |
| prompt: "login", | |
| accessToken: this.getAccessToken(), | |
| client_id: this.mobile_client_id, | |
| response_type: this.getResponseType(), | |
| display: "web2/login", | |
| locale: this.locale, | |
| redirect_uri: this.redirect_uri | |
| }; | |
| return null !== t.accessToken && "" !== t.accessToken && delete t.prompt, utils.JS.isEmpty(this.mobile_client_scope) || (t.scope = this.mobile_client_scope), this.connectHost + "/connect/auth" + utils.HTTP.generateUrlParams(t) | |
| }, EADPIdentityManager_Web.prototype.logout = function(context, t) { | |
| var i = { | |
| client_id: this.mobile_client_id, | |
| redirect_uri: this.redirect_uri | |
| }, | |
| url = this.connectHost + "/connect/logout" + utils.HTTP.generateUrlParams(i); | |
| this.clearStorage(), window.top.location = url | |
| }; | |
| var eadp = {}; | |
| eadp.identity = new EADPIdentityManager_Web, Screens.Register("LOGIN", "Login", Screens.APP_SECTION.LOGIN), pages.Login = function() { | |
| pages.ScreenBase.call(this), this.updateHeader(components.Header.NO_HEADER, gLocalization.lText("navbar.label.loginfut")), gTelemetryManager.trackPage(TelemetryManager.Sections.LOGIN, "Login"), this._generate() | |
| }, utils.JS.inherits(pages.Login, pages.ScreenBase), pages.Login.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("article"); | |
| t.classList.add("l-content-container"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, pages.Login.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, pages.Login.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, pages.Login.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, models.ShowOffLoginModel = function() { | |
| models.LoginModel.call(this), this._showOffDTO = null | |
| }, utils.JS.inherits(models.ShowOffLoginModel, models.LoginModel), models.ShowOffLoginModel.LOGIN_STEP = { | |
| PRE_LOAD_SQUAD: 0, | |
| LOAD_SQUAD: 1, | |
| SQUAD_SCREEN: 2 | |
| }, models.ShowOffLoginModel.prototype._runCurrentStep = function() { | |
| switch (this._currentLoginStep) { | |
| case models.ShowOffLoginModel.LOGIN_STEP.PRE_LOAD_SQUAD: | |
| this._onPreLoadSquad(); | |
| break; | |
| case models.ShowOffLoginModel.LOGIN_STEP.LOAD_SQUAD: | |
| this._getShowOffSquad(); | |
| break; | |
| case models.ShowOffLoginModel.LOGIN_STEP.SQUAD_SCREEN: | |
| this._goToSquadScreen(); | |
| break; | |
| default: | |
| utils.Debug.Assert(!1, "[models.ShowOffLoginModel] Invalid or unsupported bootflow step requested."), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| } | |
| }, models.ShowOffLoginModel.prototype._onPreLoadSquad = function() { | |
| var t = new communication.SquadDataDelegate; | |
| t.setImportant(!0); | |
| var i = new communication.TeamsConfigDelegate; | |
| i.setImportant(!0); | |
| var s = new communication.PlayerMetaDataDelegate; | |
| s.addListener(communication.BaseDelegate.SUCCESS, this, this._onPlayerMetaDataSuccess), s.addListener(communication.BaseDelegate.FAIL, this, this._onPlayerMetaDataFail), s.setImportant(!0); | |
| var o = new communication.StaticPlayerDataDelegate; | |
| o.addListener(communication.BaseDelegate.SUCCESS, this, this._onStaticDataSuccess), o.addListener(communication.BaseDelegate.FAIL, this, this._onStaticDataFail), o.setImportant(!0); | |
| var l = new communication.PlayerIconDataDelegate; | |
| l.addListener(communication.BaseDelegate.SUCCESS, this, this._onPlayerIconDataSuccess), l.addListener(communication.BaseDelegate.FAIL, this, this._onPlayerIconDataFail), l.setImportant(!0); | |
| var u = new communication.ExtendedLocDelegate; | |
| u.setImportant(!0); | |
| var h = new communication.PlaceholderAssetsDelegate; | |
| h.setImportant(!0); | |
| var p = [t, i, s, o, l, u, h], | |
| m = new utils.DelegateChain(p, !1); | |
| m.addListener(utils.DelegateChain.SUCCESS, this, this._onPreLoadSquadSuccess), m.addListener(utils.DelegateChain.FAIL, this, this._onPreLoadSquadFail), m.execute() | |
| }, models.ShowOffLoginModel.prototype._onStaticDataSuccess = function(sender, response) { | |
| sender.clearListenersByScope(this), repositories.Item.setStaticData([].concat(response.Players, response.LegendsPlayers)) | |
| }, models.ShowOffLoginModel.prototype._onPreLoadSquadSuccess = function(sender) { | |
| sender.clearListenersByScope(this), this._runNextStep() | |
| }, models.ShowOffLoginModel.prototype._onPreLoadSquadFail = function(sender) { | |
| sender.clearListenersByScope(this), this._isRunning = !1, utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.logout.bind(this)), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.ShowOffLoginModel.prototype._getShowOffSquad = function() { | |
| services.Squad.loadShowOffSquad().observe(this, function(t, i) { | |
| t.unobserve(this), i.success ? (this._showOffDTO = i.showOffDTO, this._runNextStep()) : (window.location.search.substring(1).length && void 0 !== window.history && void 0 !== window.history.pushState && window.history.pushState({}, document.title, window.location.pathname), this._isRunning = !1, gClickShield.hideShield(components.ClickShield.SHIELD.LOADING)) | |
| }) | |
| }, models.ShowOffLoginModel.prototype._goToSquadScreen = function() { | |
| this._isRunning = !1, NavManager.requestChildScreen(Screens.getView("SHOW_OFF_SQUAD"), { | |
| showOffDTO: this._showOffDTO | |
| }), gClickShield.hideShield(components.ClickShield.SHIELD.LOADING) | |
| }, models.ShowOffLoginModel.prototype.logout = function() { | |
| utils.Debug.Assert(!this._isRunning, "[LOGIN] Attempted to logout when a login/logout request is already running."), this._isRunning || (gFooter.hide(), this._resetApp()) | |
| }, NamespaceManager.Register("views.bootFlow"), views.bootFlow.FUTLogo = function FUTLogoView() { | |
| FUIView.call(this), this._generate() | |
| }, utils.JS.inherits(views.bootFlow.FUTLogo, FUIView), views.bootFlow.FUTLogo.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("header"); | |
| t.classList.add("FUTLogo-container"), t.classList.add("header"), this._eaSportsLogo = new components.ImageLoader, this._eaSportsLogo.getRootElement().classList.add("EALogo"), t.appendChild(this._eaSportsLogo.getRootElement()), this._futProductLogo = new components.ImageLoader, this._futProductLogo.getRootElement().classList.add("FIFALogo"), t.appendChild(this._futProductLogo.getRootElement()), this._licenseLogo = new components.ImageLoader, this._licenseLogo.getRootElement().classList.add("licenseLogo"), t.appendChild(this._licenseLogo.getRootElement()), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.bootFlow.FUTLogo.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this._eaSportsLogo.destroy(), this._eaSportsLogo = null, this._futProductLogo.destroy(), this._futProductLogo = null, this._licenseLogo.destroy(), this._licenseLogo = null | |
| }, views.bootFlow.FUTLogo.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.bootFlow.FUTLogo.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.bootFlow.FUTLogo.prototype.init = function init() { | |
| this.superclass(); | |
| var product = enums.Product.COMPANION; | |
| product = enums.Product.WEB; | |
| var t = gLocalization.getLanguage(); | |
| this._eaSportsLogo.setLocalResource("images/logo/ea_sports_logo.png"), this._futProductLogo.setLocalResource(utils.AssetLocator.getFUTProductColorLogoURI(t, product)), this._licenseLogo.setLocalResource(utils.AssetLocator.getLicenseLogoURI(t)) | |
| }, NamespaceManager.Register("views.bootFlow"), | |
| views.bootFlow.Login = function() { | |
| FUIView.call(this), this._generate() | |
| }, utils.JS.inherits(views.bootFlow.Login, FUIView), views.bootFlow.Login.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.setAttribute("id", "Login"), t.classList.add("p-boot-base"), t.classList.add("l-boot-base"); | |
| var i = document.createElement("div"); | |
| i.classList.add("p-login"), i.classList.add("l-login"), i.classList.add("boot-box"); | |
| var s = document.createElement("div"); | |
| s.classList.add("boot-content-container"); | |
| var o = document.createElement("div"); | |
| o.classList.add("boot-primary-content"); | |
| var l = document.createElement("div"); | |
| l.classList.add("flush-top"), l.classList.add("layout-article"), l.classList.add("boot-content"), this._futLogo = new views.bootFlow.FUTLogo, l.appendChild(this._futLogo.getRootElement()), this._btnLogin = new views.buttons.DefaultButton, this._btnLogin.getRootElement().classList.add("call-to-action"), l.appendChild(this._btnLogin.getRootElement()), this._linkGettingStarted = new views.buttons.FlatButton, this._linkGettingStarted.getRootElement().classList.add("camel-case"), l.appendChild(this._linkGettingStarted.getRootElement()), o.appendChild(l), s.appendChild(o); | |
| var u = document.createElement("div"); | |
| u.classList.add("boot-secondary-content"), s.appendChild(u), i.appendChild(s), t.appendChild(i), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.bootFlow.Login.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this._futLogo.destroy(), this._futLogo = null, this._btnLogin.destroy(), this._btnLogin = null, this._linkGettingStarted.destroy(), this._linkGettingStarted = null | |
| }, views.bootFlow.Login.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.bootFlow.Login.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.bootFlow.Login.prototype.init = function init() { | |
| this.superclass(), this._btnLogin.init(), this._btnLogin.setText(gLocalization.lText("login.loginButtonText")), this._linkGettingStarted.init(), this._linkGettingStarted.setText(gLocalization.lText("login.gettingstarted")), this._linkGettingStarted.addTarget(this, this._eGettingStarted, enums.Event.TAP), this._futLogo.init() | |
| }, views.bootFlow.Login.prototype.getLoginButton = function getLoginButton() { | |
| return this._btnLogin | |
| }, views.bootFlow.Login.prototype.enableLoginButton = function enableLoginButton(t) { | |
| this._btnLogin.setInteractionState(t) | |
| }, views.bootFlow.Login.prototype._eGettingStarted = function _eGettingStarted(sender, e) { | |
| services.URL.process(gLocalization.lText("link.gettingstarted")) | |
| }, NamespaceManager.Register("controllers.bootFlow"), controllers.bootFlow.Login = function() { | |
| FUIViewController.call(this), this._inAppBrowser = null, this._successCallbackDelegate = null, this._errorCallbackDelegate = null, this._linkCallbackDelegate = null, this._browserDismissedCallbackDelegate = null, this._recreateOnResume = !1 | |
| }, utils.JS.inherits(controllers.bootFlow.Login, FUIViewController), controllers.bootFlow.Login.IOS_STATUS_BAR_STYLE = { | |
| DEFAULT: 0, | |
| BLACK: 1 | |
| }, controllers.bootFlow.Login.prototype.init = function init() { | |
| this.superclass(), eadp.identity.setConnectHost(gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_EADP_CONNECT_HOST)), eadp.identity.setPortalHost(gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_EADP_PORTAL_HOST)), eadp.identity.setProxyHost(gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_EADP_PROXY_HOST)), eadp.identity.setClientId(gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_EADP_CLIENT_ID)), eadp.identity.setClientSecret(gConfigurationModel.getConfigString(models.ConfigurationModel.KEY_EADP_CLIENT_SECRET)), eadp.identity.setLocale(gLocalization.getEffectiveLocale()), eadp.identity.setDeviceId(getUUID()); | |
| var url = window.location.href, | |
| t = utils.HTTP.getParamsFromUrl(url), | |
| uri = utils.HTTP.getUriRoot(url), | |
| i = services.URL.findValidDeepLinkID(t.keys()); | |
| i !== enums.DeepLinkSections.NONE && (services.URL.setDeepLinkURL(i, t.get(i)), | |
| getStorage().setItem("deepLinkURL", services.URL.getDeepLinkURL())), uri = uri.replace(/\/$/, "") + "/auth.html", eadp.identity.setRedirectUri(uri), this.getView().getLoginButton().addTarget(this, this._eLoginSelected, enums.Event.TAP) | |
| }, controllers.bootFlow.Login.prototype.dealloc = function dealloc() { | |
| this.superclass() | |
| }, controllers.bootFlow.Login.prototype._getViewInstanceFromData = function _getViewInstanceFromData() { | |
| return new views.bootFlow.Login | |
| }, controllers.bootFlow.Login.prototype.onScreenInitialized = function onScreenInitialized(data, t, i) { | |
| var s = this, | |
| o = function() { | |
| s.getView().enableLoginButton(!0) | |
| }, | |
| l = function() { | |
| eadp.identity.getUserInfo(s._onEadpUserInfoSuccess.bind(s), s._onEadpUserInfoFail.bind(s)) | |
| }; | |
| i ? eadp.identity.clearStorage() : repositories.Squad.hasExternalShowOffSquad() ? this.startUnauthenticatedLoginFlow() : (this.getView().enableLoginButton(!1), eadp.identity.getAccessToken() ? l() : eadp.identity.checkEADPAuth(l, o)) | |
| }, controllers.bootFlow.Login.prototype.onAppResumed = function onAppResumed() { | |
| repositories.Squad.hasExternalShowOffSquad() && (this.isLoginViewOpen() && (this.closeLoginView(), this.getView().enableLoginButton(!0)), this.startUnauthenticatedLoginFlow()), this._recreateOnResume && (this._recreateOnResume = !1, this.createLoginView()) | |
| }, controllers.bootFlow.Login.prototype.onDeviceBackButton = function onDeviceBackButton() { | |
| return !this.isLoginViewOpen() || (this.closeLoginView(), this.enableLoginButton(!0), !1) | |
| }, controllers.bootFlow.Login.prototype.startUnauthenticatedLoginFlow = function startUnauthenticatedLoginFlow() { | |
| gAuthenticationModel.setLoginModel(new models.ShowOffLoginModel), gAuthenticationModel.login() | |
| }, controllers.bootFlow.Login.prototype._onEadpLoginComplete = function _onEadpLoginComplete() { | |
| eadp.identity.getUserInfo(this._onEadpUserInfoSuccess.bind(this), this._onEadpUserInfoFail.bind(this)) | |
| }, controllers.bootFlow.Login.prototype._onEadpUserInfoFail = function _onEadpUserInfoFail(error) { | |
| if (error === eadp.identity.error.LOCAL_STORAGE) return utils.Debug.Assert(!1, "[controllers.LoginController] Unable to save EADP Identity data in local storage."), void this.getView().enableLoginButton(!0); | |
| error !== eadp.identity.error.REFRESH_TOKEN ? error !== eadp.identity.error.SERVER || this.getView().enableLoginButton(!0) : this.getView().enableLoginButton(!0) | |
| }, controllers.bootFlow.Login.prototype._onEadpUserInfoSuccess = function _onEadpUserInfoSuccess(t) { | |
| gAuthenticationModel.setLoginModel(new models.LoginModel), repositories.User.setCurrent(new entities.User(t)), gUserSettingsModel.setUserKey(t.pidId.toString()), isChrome() || window.plugins.utilities.registerNimble(t.pidId, function() {}, function() {}), gAuthenticationModel.login() | |
| }, controllers.bootFlow.Login.prototype._eLoginSelected = function _eLoginSelected(sender, t) { | |
| gPatchUpdateModel.disablePolling(), gTelemetryManager.trackEvent(TelemetryManager.Sections.LOGIN, TelemetryManager.Categories.BUTTON_PRESS, "Login"), this.getView().enableLoginButton(!1), this.createLoginView() | |
| }, controllers.bootFlow.Login.prototype.createLoginView = function createLoginView() { | |
| if (!hasConnection()) return utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, function() { | |
| this.getView().enableLoginButton(!0) | |
| }.bind(this)), !1; | |
| if (isChrome()) eadp.identity.initiateLoginFlow("Login", this.onAccessTokenSuccess.bind(this), this.onAccessTokenFail.bind(this)); | |
| else { | |
| var t = eadp.identity.getLoginUrl(); | |
| this._inAppBrowser = window.open(t, "_blank", "location=no"), this._successCallbackDelegate = this.iabLoadStart.bind(this), this._errorCallbackDelegate = this.iabLoadError.bind(this), this._browserDismissedCallbackDelegate = this.iabExit.bind(this), this._linkCallbackDelegate = this.iabLoadStop.bind(this), this._inAppBrowser.addEventListener("loadstart", this._successCallbackDelegate, !1), this._inAppBrowser.addEventListener("loadstart", this._linkCallbackDelegate, !1), this._inAppBrowser.addEventListener("loadstop", this._linkCallbackDelegate, !1), this._inAppBrowser.addEventListener("loaderror", this._errorCallbackDelegate, !1), | |
| this._inAppBrowser.addEventListener("exit", this._browserDismissedCallbackDelegate, !1) | |
| } | |
| }, controllers.bootFlow.Login.prototype.closeLoginView = function closeLoginView() { | |
| this.isLoginViewOpen() && (this._inAppBrowser.removeEventListener("loadstart", this._successCallbackDelegate, !1), this._inAppBrowser.removeEventListener("loadstart", this._linkCallbackDelegate, !1), this._inAppBrowser.removeEventListener("loadstop", this._linkCallbackDelegate, !1), this._inAppBrowser.removeEventListener("loaderror", this._errorCallbackDelegate, !1), this._inAppBrowser.removeEventListener("exit", this._browserDismissedCallbackDelegate, !1), this._successCallbackDelegate = null, this._errorCallbackDelegate = null, this._browserDismissedCallbackDelegate = null, this._inAppBrowser.close(), this._inAppBrowser = null, gPatchUpdateModel.pollForUpdates(function() { | |
| gNavManager.requestRootScreen(Screens.getView("DOWNLOAD_PATCH")) | |
| })) | |
| }, controllers.bootFlow.Login.prototype.iabLoadStart = function iabLoadStart(event) { | |
| if (eadp.identity.isErrorPattern(event.url, "/p/mobile/fifa/companion/code", "code")) gAuthenticationModel.logout(), this.closeLoginView(), this.getView().enableLoginButton(!0); | |
| else if (event.url && -1 !== event.url.indexOf("code=")) { | |
| this.closeLoginView(); | |
| var code = event.url.split("code=")[1].split("&")[0]; | |
| eadp.identity.exchangeAccessToken(code, this.onAccessTokenSuccess.bind(this), this.onAccessTokenFail.bind(this)) | |
| } | |
| }, controllers.bootFlow.Login.prototype.iabLoadStop = function iabLoadStop(event) { | |
| eadp.identity.isExternalLink(event.url) && (this.closeLoginView(), this._recreateOnResume = !0, services.URL.process(event.url)) | |
| }, controllers.bootFlow.Login.prototype.iabLoadError = function iabLoadError(event) { | |
| utils.PopupManager.ShowAlert(utils.PopupManager.Alerts.ORIGIN_UNAVAILABLE, this.iabExit.bind(this)) | |
| }, controllers.bootFlow.Login.prototype.iabExit = function iabExit(event) { | |
| this.closeLoginView(), this.getView().enableLoginButton(!0) | |
| }, controllers.bootFlow.Login.prototype.onAccessTokenSuccess = function onAccessTokenSuccess(t) { | |
| isChrome() && eadp.identity.closeLoginFlow(), this._onEadpLoginComplete() | |
| }, controllers.bootFlow.Login.prototype.onAccessTokenFail = function onAccessTokenFail(t) { | |
| this._onEadpLoginComplete() | |
| }, controllers.bootFlow.Login.prototype.isLoginViewOpen = function isLoginViewOpen() { | |
| return utils.JS.isValid(this._inAppBrowser) | |
| }, pages.controllers.LoginController = function(view) { | |
| pages.controllers.ScreenControllerBase.call(this, view), this._viewController = new controllers.bootFlow.Login | |
| }, utils.JS.inherits(pages.controllers.LoginController, pages.controllers.ScreenControllerBase), pages.controllers.LoginController.prototype.init = function() { | |
| this._viewController.init(), this.getView().getRoot().append(this._viewController.getView().getRoot()) | |
| }, pages.controllers.LoginController.prototype.onScreenInitialized = function(data, t) { | |
| this._viewController.onScreenInitialized(data, t, this.getView().didGoBack()) | |
| }, pages.controllers.LoginController.prototype.destroy = function() { | |
| this._viewController.dealloc(), this._viewController = null | |
| }, pages.controllers.LoginController.prototype.onAppResumed = function() { | |
| this._viewController.onAppResumed() | |
| }, pages.controllers.LoginController.prototype.onDeviceBackButton = function() { | |
| return this._viewController.onDeviceBackButton() | |
| }, NamespaceManager.Register("views"), views.TextInput = function FUITextInput() { | |
| FUIView.call(this), this._generate(), Object.defineProperty(this, "type", { | |
| get: function() { | |
| return this.getRoot().attr("type") | |
| }, | |
| set: function(t) { | |
| var key; | |
| for (key in enums.UIInputType) | |
| if (enums.UIInputType.hasOwnProperty(key) && enums.UIInputType[key] === t) return void this.getRoot().attr("type", t); | |
| utils.Debug.Assert(!1, "Invalid assignment to component: TextInput.type") | |
| }, | |
| enumerable: !0 | |
| }), Object.defineProperty(this, "value", { | |
| get: function() { | |
| return this.getRoot().val().toString() | |
| }, | |
| set: function(t) { | |
| this.getRoot().val(t) | |
| }, | |
| enumerable: !0 | |
| }), this.type = enums.UIInputType.TEXT, this.value = "", this.onChange = new FUTObservable, Object.defineProperty(this, "onChange", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.onInput = new FUTObservable, | |
| Object.defineProperty(this, "onInput", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this._selectionTimeout = 0, Object.defineProperty(this, "_selectionTimeout", { | |
| writable: !0, | |
| enumerable: !1 | |
| }), this._blurTimeout = 0, Object.defineProperty(this, "_blurTimeout", { | |
| writable: !0, | |
| enumerable: !1 | |
| }) | |
| }, utils.JS.inherits(views.TextInput, FUIView), views.TextInput.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("input"); | |
| t.setAttribute("type", "text"), t.classList.add("textInput"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.TextInput.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, views.TextInput.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.TextInput.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.TextInput.prototype.init = function init() { | |
| this.superclass(), this.setInteractionState(!0) | |
| }, views.TextInput.prototype.dealloc = function dealloc() { | |
| this._selectionTimeout = clearTimeout(this._selectionTimeout), this._blurTimeout = clearTimeout(this._blurTimeout), this.onChange.dealloc(), this.onInput.dealloc(), this.onChange = null, this.onInput = null, this.superclass() | |
| }, views.TextInput.prototype.setInteractionState = function setInteractionState(t) { | |
| this._setInteractionStateFlag(t); | |
| var root = this.getRoot(), | |
| i = "textEvent"; | |
| if (!this._interactionState && root.is(":focus") && root.blur(), root.prop("disabled", !this._interactionState), root.toggleClass(enums.UIState.DISABLED, !this._interactionState), this._interactionState) { | |
| var s = root.get(0); | |
| this._addListener(enums.Event.FOCUS, s, this._handleFocusEvent.bind(this), i), this._addListener(enums.Event.BLUR, s, this._handleBlurEvent.bind(this), i), this._addListener(enums.Event.CHANGE, s, this._handleChangeEvent.bind(this), i), this._addListener(enums.Event.INPUT, s, this._handleInputEvent.bind(this), i), this._addListener(enums.Event.CUT, s, this._handleInputEvent.bind(this), i), this._addListener(enums.Event.PASTE, s, this._handleInputEvent.bind(this), i) | |
| } else this._removeListenersByNS(i) | |
| }, views.TextInput.prototype.setPlaceholder = function(value) { | |
| this.getRoot().attr("placeholder", value) | |
| }, views.TextInput.prototype.setMaxLength = function(value) { | |
| this.getRoot().attr("maxlength", value) | |
| }, views.TextInput.prototype.clear = function() { | |
| this.value = "" | |
| }, views.TextInput.prototype._handleChangeEvent = function _handleChangeEvent(e) { | |
| this.onChange.notify(this.value, e) | |
| }, views.TextInput.prototype._handleInputEvent = function _handleInputEvent(e) { | |
| this.onInput.notify(this.value, e), this.onChange.notify(this.value, e) | |
| }, views.TextInput.prototype._handleFocusEvent = function _handleFocusEvent(e) { | |
| this._selectionTimeout = setTimeout(function _setSelectionRange() { | |
| var t = this.getRoot().get(0); | |
| t.setSelectionRange(0, t.value.length) | |
| }.bind(this), 50) | |
| }, views.TextInput.prototype._handleBlurEvent = function _handleBlurEvent(e) { | |
| this._selectionTimeout = clearTimeout(this._selectionTimeout) | |
| }, Screens.Register("PHISHING", "Phishing", Screens.APP_SECTION.LOGIN), pages.Phishing = function() { | |
| pages.ScreenBase.call(this), this.updateHeader(isPhone() ? components.Header.SETTINGS_BUTTON : components.Header.NO_HEADER, gLocalization.lText("title.securityquestion")), gTelemetryManager.trackPage(TelemetryManager.Sections.LOGIN, "Security Question"), this._generate() | |
| }, utils.JS.inherits(pages.Phishing, pages.ScreenBase), pages.Phishing.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("article"); | |
| t.classList.add("l-content-container"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, pages.Phishing.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, pages.Phishing.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, pages.Phishing.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, NamespaceManager.Register("utils"), utils.MD5Hash = {}, utils.MD5Hash.r1Shifts = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22], | |
| utils.MD5Hash.r2Shifts = [5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20], utils.MD5Hash.r3Shifts = [4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23], utils.MD5Hash.r4Shifts = [6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21], utils.MD5Hash.hex_chr = "0123456789abcdef", utils.MD5Hash._numToHex = function(t) { | |
| var i, s = ""; | |
| for (i = 0; i <= 3; i++) s += utils.MD5Hash.hex_chr.charAt(t >> 8 * i + 4 & 15) + utils.MD5Hash.hex_chr.charAt(t >> 8 * i & 15); | |
| return s | |
| }, utils.MD5Hash._chunkMessage = function(t) { | |
| var i, s = t.length, | |
| o = 1 + (s + 8 >> 6), | |
| l = new Array(16 * o); | |
| for (i = 0; i < 16 * o; i++) l[i] = 0; | |
| for (i = 0; i < s; i++) l[i >> 2] |= t.charCodeAt(i) << i % 4 * 8; | |
| return l[i >> 2] |= 128 << i % 4 * 8, l[16 * o - 2] = 8 * s, l | |
| }, utils.MD5Hash._add = function(x, y) { | |
| var t = (65535 & x) + (65535 & y); | |
| return (x >> 16) + (y >> 16) + (t >> 16) << 16 | 65535 & t | |
| }, utils.MD5Hash._bitwiseRotate = function(x, c) { | |
| return x << c | x >>> 32 - c | |
| }, utils.MD5Hash._cmn = function(t, a, b, x, i, s) { | |
| return utils.MD5Hash._add(utils.MD5Hash._bitwiseRotate(utils.MD5Hash._add(utils.MD5Hash._add(a, t), utils.MD5Hash._add(x, s)), i), b) | |
| }, utils.MD5Hash._md5_f = function(a, b, c, d, x, t, i) { | |
| return utils.MD5Hash._cmn(b & c | ~b & d, a, b, x, t, i) | |
| }, utils.MD5Hash._md5_g = function(a, b, c, d, x, t, i) { | |
| return utils.MD5Hash._cmn(b & d | c & ~d, a, b, x, t, i) | |
| }, utils.MD5Hash._md5_h = function(a, b, c, d, x, t, i) { | |
| return utils.MD5Hash._cmn(b ^ c ^ d, a, b, x, t, i) | |
| }, utils.MD5Hash._md5_i = function(a, b, c, d, x, t, i) { | |
| return utils.MD5Hash._cmn(c ^ (b | ~d), a, b, x, t, i) | |
| }, utils.MD5Hash.md5 = function(t) { | |
| var i, x = utils.MD5Hash._chunkMessage(t), | |
| a = 1732584193, | |
| b = -271733879, | |
| c = -1732584194, | |
| d = 271733878, | |
| s = x.length; | |
| for (i = 0; i < s; i += 16) { | |
| var o = a, | |
| l = b, | |
| u = c, | |
| h = d; | |
| a = utils.MD5Hash._md5_f(a, b, c, d, x[i], utils.MD5Hash.r1Shifts[0], -680876936), d = utils.MD5Hash._md5_f(d, a, b, c, x[i + 1], utils.MD5Hash.r1Shifts[1], -389564586), c = utils.MD5Hash._md5_f(c, d, a, b, x[i + 2], utils.MD5Hash.r1Shifts[2], 606105819), b = utils.MD5Hash._md5_f(b, c, d, a, x[i + 3], utils.MD5Hash.r1Shifts[3], -1044525330), a = utils.MD5Hash._md5_f(a, b, c, d, x[i + 4], utils.MD5Hash.r1Shifts[4], -176418897), d = utils.MD5Hash._md5_f(d, a, b, c, x[i + 5], utils.MD5Hash.r1Shifts[5], 1200080426), c = utils.MD5Hash._md5_f(c, d, a, b, x[i + 6], utils.MD5Hash.r1Shifts[6], -1473231341), b = utils.MD5Hash._md5_f(b, c, d, a, x[i + 7], utils.MD5Hash.r1Shifts[7], -45705983), a = utils.MD5Hash._md5_f(a, b, c, d, x[i + 8], utils.MD5Hash.r1Shifts[8], 1770035416), d = utils.MD5Hash._md5_f(d, a, b, c, x[i + 9], utils.MD5Hash.r1Shifts[9], -1958414417), c = utils.MD5Hash._md5_f(c, d, a, b, x[i + 10], utils.MD5Hash.r1Shifts[10], -42063), b = utils.MD5Hash._md5_f(b, c, d, a, x[i + 11], utils.MD5Hash.r1Shifts[11], -1990404162), a = utils.MD5Hash._md5_f(a, b, c, d, x[i + 12], utils.MD5Hash.r1Shifts[12], 1804603682), d = utils.MD5Hash._md5_f(d, a, b, c, x[i + 13], utils.MD5Hash.r1Shifts[13], -40341101), c = utils.MD5Hash._md5_f(c, d, a, b, x[i + 14], utils.MD5Hash.r1Shifts[14], -1502002290), b = utils.MD5Hash._md5_f(b, c, d, a, x[i + 15], utils.MD5Hash.r1Shifts[15], 1236535329), a = utils.MD5Hash._md5_g(a, b, c, d, x[i + 1], utils.MD5Hash.r2Shifts[0], -165796510), d = utils.MD5Hash._md5_g(d, a, b, c, x[i + 6], utils.MD5Hash.r2Shifts[1], -1069501632), c = utils.MD5Hash._md5_g(c, d, a, b, x[i + 11], utils.MD5Hash.r2Shifts[2], 643717713), b = utils.MD5Hash._md5_g(b, c, d, a, x[i], utils.MD5Hash.r2Shifts[3], -373897302), a = utils.MD5Hash._md5_g(a, b, c, d, x[i + 5], utils.MD5Hash.r2Shifts[4], -701558691), d = utils.MD5Hash._md5_g(d, a, b, c, x[i + 10], utils.MD5Hash.r2Shifts[5], 38016083), c = utils.MD5Hash._md5_g(c, d, a, b, x[i + 15], utils.MD5Hash.r2Shifts[6], -660478335), b = utils.MD5Hash._md5_g(b, c, d, a, x[i + 4], utils.MD5Hash.r2Shifts[7], -405537848), a = utils.MD5Hash._md5_g(a, b, c, d, x[i + 9], utils.MD5Hash.r2Shifts[8], 568446438), d = utils.MD5Hash._md5_g(d, a, b, c, x[i + 14], utils.MD5Hash.r2Shifts[9], -1019803690), c = utils.MD5Hash._md5_g(c, d, a, b, x[i + 3], utils.MD5Hash.r2Shifts[10], -187363961), b = utils.MD5Hash._md5_g(b, c, d, a, x[i + 8], utils.MD5Hash.r2Shifts[11], 1163531501), a = utils.MD5Hash._md5_g(a, b, c, d, x[i + 13], utils.MD5Hash.r2Shifts[12], -1444681467), d = utils.MD5Hash._md5_g(d, a, b, c, x[i + 2], utils.MD5Hash.r2Shifts[13], -51403784), c = utils.MD5Hash._md5_g(c, d, a, b, x[i + 7], utils.MD5Hash.r2Shifts[14], 1735328473), b = utils.MD5Hash._md5_g(b, c, d, a, x[i + 12], utils.MD5Hash.r2Shifts[15], -1926607734), | |
| a = utils.MD5Hash._md5_h(a, b, c, d, x[i + 5], utils.MD5Hash.r3Shifts[0], -378558), d = utils.MD5Hash._md5_h(d, a, b, c, x[i + 8], utils.MD5Hash.r3Shifts[1], -2022574463), c = utils.MD5Hash._md5_h(c, d, a, b, x[i + 11], utils.MD5Hash.r2Shifts[2], 1839030562), b = utils.MD5Hash._md5_h(b, c, d, a, x[i + 14], utils.MD5Hash.r3Shifts[3], -35309556), a = utils.MD5Hash._md5_h(a, b, c, d, x[i + 1], utils.MD5Hash.r3Shifts[4], -1530992060), d = utils.MD5Hash._md5_h(d, a, b, c, x[i + 4], utils.MD5Hash.r3Shifts[5], 1272893353), c = utils.MD5Hash._md5_h(c, d, a, b, x[i + 7], utils.MD5Hash.r3Shifts[6], -155497632), b = utils.MD5Hash._md5_h(b, c, d, a, x[i + 10], utils.MD5Hash.r3Shifts[7], -1094730640), a = utils.MD5Hash._md5_h(a, b, c, d, x[i + 13], utils.MD5Hash.r3Shifts[8], 681279174), d = utils.MD5Hash._md5_h(d, a, b, c, x[i], utils.MD5Hash.r3Shifts[9], -358537222), c = utils.MD5Hash._md5_h(c, d, a, b, x[i + 3], utils.MD5Hash.r3Shifts[10], -722521979), b = utils.MD5Hash._md5_h(b, c, d, a, x[i + 6], utils.MD5Hash.r3Shifts[11], 76029189), a = utils.MD5Hash._md5_h(a, b, c, d, x[i + 9], utils.MD5Hash.r3Shifts[12], -640364487), d = utils.MD5Hash._md5_h(d, a, b, c, x[i + 12], utils.MD5Hash.r3Shifts[13], -421815835), c = utils.MD5Hash._md5_h(c, d, a, b, x[i + 15], utils.MD5Hash.r3Shifts[14], 530742520), b = utils.MD5Hash._md5_h(b, c, d, a, x[i + 2], utils.MD5Hash.r3Shifts[15], -995338651), a = utils.MD5Hash._md5_i(a, b, c, d, x[i], utils.MD5Hash.r4Shifts[0], -198630844), d = utils.MD5Hash._md5_i(d, a, b, c, x[i + 7], utils.MD5Hash.r4Shifts[1], 1126891415), c = utils.MD5Hash._md5_i(c, d, a, b, x[i + 14], utils.MD5Hash.r4Shifts[2], -1416354905), b = utils.MD5Hash._md5_i(b, c, d, a, x[i + 5], utils.MD5Hash.r4Shifts[3], -57434055), a = utils.MD5Hash._md5_i(a, b, c, d, x[i + 12], utils.MD5Hash.r4Shifts[4], 1700485571), d = utils.MD5Hash._md5_i(d, a, b, c, x[i + 3], utils.MD5Hash.r4Shifts[5], -1894986606), c = utils.MD5Hash._md5_i(c, d, a, b, x[i + 10], utils.MD5Hash.r4Shifts[6], -1051523), b = utils.MD5Hash._md5_i(b, c, d, a, x[i + 1], utils.MD5Hash.r4Shifts[7], -2054922799), a = utils.MD5Hash._md5_i(a, b, c, d, x[i + 8], utils.MD5Hash.r4Shifts[8], 1873313359), d = utils.MD5Hash._md5_i(d, a, b, c, x[i + 15], utils.MD5Hash.r4Shifts[9], -30611744), c = utils.MD5Hash._md5_i(c, d, a, b, x[i + 6], utils.MD5Hash.r4Shifts[10], -1560198380), b = utils.MD5Hash._md5_i(b, c, d, a, x[i + 13], utils.MD5Hash.r4Shifts[11], 1309151649), a = utils.MD5Hash._md5_i(a, b, c, d, x[i + 4], utils.MD5Hash.r4Shifts[12], -145523070), d = utils.MD5Hash._md5_i(d, a, b, c, x[i + 11], utils.MD5Hash.r4Shifts[13], -1120210379), c = utils.MD5Hash._md5_i(c, d, a, b, x[i + 2], utils.MD5Hash.r4Shifts[14], 718787259), b = utils.MD5Hash._md5_i(b, c, d, a, x[i + 9], utils.MD5Hash.r4Shifts[15], -343485551), b = utils.MD5Hash._md5_i(b, c, d, a, x[i + 9], utils.MD5Hash.r4Shifts[15], -343485551), a = utils.MD5Hash._add(a, o), b = utils.MD5Hash._add(b, l), c = utils.MD5Hash._add(c, u), d = utils.MD5Hash._add(d, h) | |
| } | |
| return utils.MD5Hash._numToHex(a) + utils.MD5Hash._numToHex(b) + utils.MD5Hash._numToHex(c) + utils.MD5Hash._numToHex(d) | |
| }, communication.PhishingValidateAnswerDelegate = function(data) { | |
| communication.BaseFUTDelegate.call(this), this._data = data | |
| }, utils.JS.inherits(communication.PhishingValidateAnswerDelegate, communication.BaseFUTDelegate), communication.PhishingValidateAnswerDelegate.prototype.execute = function() { | |
| var url = communication.BaseFUTDelegate.REQUEST_ROOT + "phishing/validate?answer=" + this._data; | |
| this.setRequest(url, models.CommunicationModel.METHOD.POST, models.CommunicationModel.RESPONSE.TEXT_JSON, models.CommunicationModel.CONTENT_TYPE.JSON), this.send() | |
| }, communication.PhishingValidateAnswerDelegate.prototype.onSuccess = function(t) { | |
| t.token ? (gUserSettingsModel.setUserItem(models.UserSettingsModel.SECURITY_TOKEN, t.token), this.dispatch(communication.BaseDelegate.SUCCESS, t)) : this.onFail(enums.NetworkError.UNRECOVERABLE_ERROR) | |
| }, communication.PhishingValidateAnswerDelegate.prototype.onFail = function(errorCode) { | |
| var t = this.isImportant() ? enums.NetworkErrorLevel.IMPORTANT : enums.NetworkErrorLevel.UNIMPORTANT; | |
| switch (errorCode) { | |
| case enums.NetworkError.PERMISSION_DENIED: | |
| case enums.NetworkError.ACCOUNT_LOCKED: | |
| case enums.NetworkError.NO_REMAINING_ATTEMPTS: | |
| this._networkError = new valueobjects.NetworkErrorVO(errorCode, t, "", ""); | |
| break; | |
| default: | |
| this._networkError = this.generateDefaultNetworkError(errorCode) | |
| } | |
| this.dispatch(communication.BaseDelegate.FAIL, this._networkError) | |
| }, NamespaceManager.Register("views.bootFlow"), views.bootFlow.BootFlow = function BootFlowView() { | |
| FUIView.call(this) | |
| }, utils.JS.inherits(views.bootFlow.BootFlow, FUIView), views.bootFlow.BootFlow.prototype.init = function init() { | |
| this.superclass(), this._settingsBtn.init(), this._settingsBtn.setText(gLocalization.lText("button.settings")) | |
| }, views.bootFlow.BootFlow.prototype.getSettingsButton = function getSettingsButton() { | |
| return this._settingsBtn | |
| }, NamespaceManager.Register("views.bootFlow"), views.bootFlow.EULA = function() { | |
| views.bootFlow.BootFlow.call(this), this._generate() | |
| }, utils.JS.inherits(views.bootFlow.EULA, views.bootFlow.BootFlow), views.bootFlow.EULA.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("div"); | |
| t.classList.add("p-boot-base"), t.classList.add("l-boot-base"); | |
| var i = document.createElement("div"); | |
| i.classList.add("p-eula"), i.classList.add("l-eula"), i.classList.add("boot-box"); | |
| var s = document.createElement("div"); | |
| s.classList.add("boot-content-container"); | |
| var o = document.createElement("div"); | |
| o.classList.add("boot-secondary-content"); | |
| var l = document.createElement("div"); | |
| l.classList.add("boot-content"), this._futLogo = new views.bootFlow.FUTLogo, l.appendChild(this._futLogo.getRootElement()), o.appendChild(l), s.appendChild(o); | |
| var u = document.createElement("div"); | |
| u.classList.add("layout-article"), u.classList.add("boot-primary-content"); | |
| var h = document.createElement("div"); | |
| h.classList.add("flat"), h.classList.add("layout-article"), h.classList.add("boot-content"), this.__title = document.createElement("h2"), this.$_title = $(this.__title), h.appendChild(this.__title), this.__eulaText = document.createElement("p"), this.$_eulaText = $(this.__eulaText), h.appendChild(this.__eulaText); | |
| var p = document.createElement("p"); | |
| this._eulaLink = new views.buttons.FlatButton, this._eulaLink.getRootElement().classList.add("camel-case"), p.appendChild(this._eulaLink.getRootElement()), h.appendChild(p); | |
| var m = document.createElement("p"); | |
| this._privacyLink = new views.buttons.FlatButton, this._privacyLink.getRootElement().classList.add("camel-case"), m.appendChild(this._privacyLink.getRootElement()), h.appendChild(m), this._cancelButton = new views.buttons.DefaultButton, h.appendChild(this._cancelButton.getRootElement()), this._acceptButton = new views.buttons.DefaultButton, this._acceptButton.getRootElement().classList.add("call-to-action"), h.appendChild(this._acceptButton.getRootElement()), u.appendChild(h), s.appendChild(u), i.appendChild(s), t.appendChild(i), this._settingsBtn = new views.buttons.FlatButton, this._settingsBtn.getRootElement().classList.add("settings-btn"), t.appendChild(this._settingsBtn.getRootElement()), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.bootFlow.EULA.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null, this._futLogo.destroy(), this._futLogo = null, this.__title = null, this.$_title = null, this.__eulaText = null, this.$_eulaText = null, this._eulaLink.destroy(), this._eulaLink = null, this._privacyLink.destroy(), this._privacyLink = null, this._cancelButton.destroy(), this._cancelButton = null, this._acceptButton.destroy(), this._acceptButton = null, this._settingsBtn.destroy(), this._settingsBtn = null | |
| }, views.bootFlow.EULA.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.bootFlow.EULA.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, views.bootFlow.EULA.prototype.init = function init() { | |
| this.superclass(), this._cancelButton.init(), this._cancelButton.setText(gLocalization.lText("common.dialog.cancel")), this._acceptButton.init(), this._acceptButton.setText(gLocalization.lText("EULA.accept")), this._eulaLink.init(), this._eulaLink.setText(gLocalization.lText("EULA.view")), this._privacyLink.init(), this._privacyLink.setText(gLocalization.lText("more.privacy")), this._futLogo.init(); | |
| var t = gLocalization.lText("EULA.text.mobile"); | |
| t = gLocalization.lText("EULA.text.web"), this.__eulaText.textContent = t, this.$_title.html(gLocalization.lText("EULA.view")) | |
| }, views.bootFlow.EULA.prototype.getAcceptButton = function getAcceptButton() { | |
| return this._acceptButton | |
| }, views.bootFlow.EULA.prototype.getCancelButton = function getCancelButton() { | |
| return this._cancelButton | |
| }, views.bootFlow.EULA.prototype.getEULALink = function getEULALink() { | |
| return this._eulaLink | |
| }, views.bootFlow.EULA.prototype.getPrivacyLink = function getPrivacyLink() { | |
| return this._privacyLink | |
| }, NamespaceManager.Register("controllers.bootFlow"), controllers.bootFlow.BootFlow = function BootFlowViewController() { | |
| FUIViewController.call(this) | |
| }, utils.JS.inherits(controllers.bootFlow.BootFlow, FUIViewController), controllers.bootFlow.BootFlow.prototype.init = function init() { | |
| this.superclass(), this.getView().getSettingsButton().addTarget(this, this._eSettingsSelected, enums.Event.TAP) | |
| }, controllers.bootFlow.BootFlow.prototype._eSettingsSelected = function _eSettingsSelected(sender, t) { | |
| NavManager.requestChildScreen(Screens.getView("APP_SETTINGS"), { | |
| showHeader: !0 | |
| }) | |
| }, NamespaceManager.Register("views.buttons"), views.buttons.FlatButton = function FUIFlatButton() { | |
| FUIButton.call(this), this._generate() | |
| }, utils.JS.inherits(views.buttons.FlatButton, FUIButton), views.buttons.FlatButton.prototype._generate = function _generate() { | |
| if (!this._generated) { | |
| var t = document.createElement("a"); | |
| t.classList.add("btn-flat"), this.__root = t, this.$_root = $(t), this._generated = !0 | |
| } | |
| }, views.buttons.FlatButton.prototype.destroyGeneratedElements = function destroyGeneratedElements() { | |
| this.$_root.off(), this.$_root.remove(), this.__root = null, this.$_root = null | |
| }, views.buttons.FlatButton.prototype.getRoot = function getRoot() { | |
| return this.$_root | |
| }, views.buttons.FlatButton.prototype.getRootElement = function getRootElement() { | |
| return this.__root | |
| }, NamespaceManager.Register("transferobjects"), transferobjects.PersonaClub = function(data) { | |
| this.abbr = data.clubAbbr, Object.defineProperty(this, "abbr", { | |
| writable: !1, | |
| enumerable: !0 | |
| }), this.name = data.clubName, Object.definePro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment