From 9e249665473095097d15c277e3cc4e89e8792102 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Mon, 20 Jan 2020 22:12:22 +0100 Subject: remove JSON2 (#15413) * remove JSON2 * Update CHANGELOG.md Co-authored-by: Thomas Steur --- js/piwik.js | 952 +------------------------------------------------------- js/piwik.min.js | 68 ++-- 2 files changed, 43 insertions(+), 977 deletions(-) (limited to 'js') diff --git a/js/piwik.js b/js/piwik.js index 6e77e6b3d9..1ad925fe22 100644 --- a/js/piwik.js +++ b/js/piwik.js @@ -19,6 +19,7 @@ * Incompatible with these (and earlier) versions of: * - IE4 - try..catch and for..in introduced in IE5 * - IE5 - named anonymous functions, array.push, encodeURIComponent, decodeURIComponent, and getElementsByTagName introduced in IE5.5 + * - IE6 and 7 - window.JSON introduced in IE8 * - Firefox 1.0 and Netscape 8.x - FF1.5 adds array.indexOf, among other things * - Mozilla 1.7 and Netscape 6.x-7.x * - Netscape 4.8 @@ -26,933 +27,8 @@ * - Opera 7 */ -/*global JSON_PIWIK:true */ - -if (typeof JSON_PIWIK !== 'object' && typeof window.JSON === 'object' && window.JSON.stringify && window.JSON.parse) { - JSON_PIWIK = window.JSON; -} else { - (function () { - // we make sure to not break any site that uses JSON3 as well as we do not know if they run it in conflict mode - // or not. - var exports = {}; - - // Create a JSON object only if one does not already exist. We create the - // methods in a closure to avoid creating global variables. - - /*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */ - (function () { - // Detect the `define` function exposed by asynchronous module loaders. The - // strict `define` check is necessary for compatibility with `r.js`. - var isLoader = typeof define === "function" && define.amd; - - // A set of types used to distinguish objects from primitives. - var objectTypes = { - "function": true, - "object": true - }; - - // Detect the `exports` object exposed by CommonJS implementations. - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - - // Use the `global` object exposed by Node (including Browserify via - // `insert-module-globals`), Narwhal, and Ringo as the default context, - // and the `window` object in browsers. Rhino exports a `global` function - // instead. - var root = objectTypes[typeof window] && window || this, - freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global; - - if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) { - root = freeGlobal; - } - - // Public: Initializes JSON 3 using the given `context` object, attaching the - // `stringify` and `parse` functions to the specified `exports` object. - function runInContext(context, exports) { - context || (context = root["Object"]()); - exports || (exports = root["Object"]()); - - // Native constructor aliases. - var Number = context["Number"] || root["Number"], - String = context["String"] || root["String"], - Object = context["Object"] || root["Object"], - Date = context["Date"] || root["Date"], - SyntaxError = context["SyntaxError"] || root["SyntaxError"], - TypeError = context["TypeError"] || root["TypeError"], - Math = context["Math"] || root["Math"], - nativeJSON = context["JSON"] || root["JSON"]; - - // Delegate to the native `stringify` and `parse` implementations. - if (typeof nativeJSON == "object" && nativeJSON) { - exports.stringify = nativeJSON.stringify; - exports.parse = nativeJSON.parse; - } - - // Convenience aliases. - var objectProto = Object.prototype, - getClass = objectProto.toString, - isProperty, forEach, undef; - - // Test the `Date#getUTC*` methods. Based on work by @Yaffle. - var isExtended = new Date(-3509827334573292); - try { - // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical - // results for certain dates in Opera >= 10.53. - isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 && - // Safari < 2.0.2 stores the internal millisecond time value correctly, - // but clips the values returned by the date methods to the range of - // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]). - isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708; - } catch (exception) {} - - // Internal: Determines whether the native `JSON.stringify` and `parse` - // implementations are spec-compliant. Based on work by Ken Snyder. - function has(name) { - if (has[name] !== undef) { - // Return cached feature test result. - return has[name]; - } - var isSupported; - if (name == "bug-string-char-index") { - // IE <= 7 doesn't support accessing string characters using square - // bracket notation. IE 8 only supports this for primitives. - isSupported = "a"[0] != "a"; - } else if (name == "json") { - // Indicates whether both `JSON.stringify` and `JSON.parse` are - // supported. - isSupported = has("json-stringify") && has("json-parse"); - } else { - var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'; - // Test `JSON.stringify`. - if (name == "json-stringify") { - var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended; - if (stringifySupported) { - // A test function object with a custom `toJSON` method. - (value = function () { - return 1; - }).toJSON = value; - try { - stringifySupported = - // Firefox 3.1b1 and b2 serialize string, number, and boolean - // primitives as object literals. - stringify(0) === "0" && - // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object - // literals. - stringify(new Number()) === "0" && - stringify(new String()) == '""' && - // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or - // does not define a canonical JSON representation (this applies to - // objects with `toJSON` properties as well, *unless* they are nested - // within an object or array). - stringify(getClass) === undef && - // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and - // FF 3.1b3 pass this test. - stringify(undef) === undef && - // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s, - // respectively, if the value is omitted entirely. - stringify() === undef && - // FF 3.1b1, 2 throw an error if the given value is not a number, - // string, array, object, Boolean, or `null` literal. This applies to - // objects with custom `toJSON` methods as well, unless they are nested - // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON` - // methods entirely. - stringify(value) === "1" && - stringify([value]) == "[1]" && - // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of - // `"[null]"`. - stringify([undef]) == "[null]" && - // YUI 3.0.0b1 fails to serialize `null` literals. - stringify(null) == "null" && - // FF 3.1b1, 2 halts serialization if an array contains a function: - // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3 - // elides non-JSON values from objects and arrays, unless they - // define custom `toJSON` methods. - stringify([undef, getClass, null]) == "[null,null,null]" && - // Simple serialization test. FF 3.1b1 uses Unicode escape sequences - // where character escape codes are expected (e.g., `\b` => `\u0008`). - stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized && - // FF 3.1b1 and b2 ignore the `filter` and `width` arguments. - stringify(null, value) === "1" && - stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" && - // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly - // serialize extended years. - stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' && - // The milliseconds are optional in ES 5, but required in 5.1. - stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' && - // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative - // four-digit years instead of six-digit years. Credits: @Yaffle. - stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' && - // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond - // values less than 1000. Credits: @Yaffle. - stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"'; - } catch (exception) { - stringifySupported = false; - } - } - isSupported = stringifySupported; - } - // Test `JSON.parse`. - if (name == "json-parse") { - var parse = exports.parse; - if (typeof parse == "function") { - try { - // FF 3.1b1, b2 will throw an exception if a bare literal is provided. - // Conforming implementations should also coerce the initial argument to - // a string prior to parsing. - if (parse("0") === 0 && !parse(false)) { - // Simple parsing test. - value = parse(serialized); - var parseSupported = value["a"].length == 5 && value["a"][0] === 1; - if (parseSupported) { - try { - // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings. - parseSupported = !parse('"\t"'); - } catch (exception) {} - if (parseSupported) { - try { - // FF 4.0 and 4.0.1 allow leading `+` signs and leading - // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow - // certain octal literals. - parseSupported = parse("01") !== 1; - } catch (exception) {} - } - if (parseSupported) { - try { - // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal - // points. These environments, along with FF 3.1b1 and 2, - // also allow trailing commas in JSON objects and arrays. - parseSupported = parse("1.") !== 1; - } catch (exception) {} - } - } - } - } catch (exception) { - parseSupported = false; - } - } - isSupported = parseSupported; - } - } - return has[name] = !!isSupported; - } - - if (!has("json")) { - // Common `[[Class]]` name aliases. - var functionClass = "[object Function]", - dateClass = "[object Date]", - numberClass = "[object Number]", - stringClass = "[object String]", - arrayClass = "[object Array]", - booleanClass = "[object Boolean]"; - - // Detect incomplete support for accessing string characters by index. - var charIndexBuggy = has("bug-string-char-index"); - - // Define additional utility methods if the `Date` methods are buggy. - if (!isExtended) { - var floor = Math.floor; - // A mapping between the months of the year and the number of days between - // January 1st and the first of the respective month. - var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; - // Internal: Calculates the number of days between the Unix epoch and the - // first day of the given month. - var getDay = function (year, month) { - return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400); - }; - } - - // Internal: Determines if a property is a direct property of the given - // object. Delegates to the native `Object#hasOwnProperty` method. - if (!(isProperty = objectProto.hasOwnProperty)) { - isProperty = function (property) { - var members = {}, constructor; - if ((members.__proto__ = null, members.__proto__ = { - // The *proto* property cannot be set multiple times in recent - // versions of Firefox and SeaMonkey. - "toString": 1 - }, members).toString != getClass) { - // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but - // supports the mutable *proto* property. - isProperty = function (property) { - // Capture and break the object's prototype chain (see section 8.6.2 - // of the ES 5.1 spec). The parenthesized expression prevents an - // unsafe transformation by the Closure Compiler. - var original = this.__proto__, result = property in (this.__proto__ = null, this); - // Restore the original prototype chain. - this.__proto__ = original; - return result; - }; - } else { - // Capture a reference to the top-level `Object` constructor. - constructor = members.constructor; - // Use the `constructor` property to simulate `Object#hasOwnProperty` in - // other environments. - isProperty = function (property) { - var parent = (this.constructor || constructor).prototype; - return property in this && !(property in parent && this[property] === parent[property]); - }; - } - members = null; - return isProperty.call(this, property); - }; - } - - // Internal: Normalizes the `for...in` iteration algorithm across - // environments. Each enumerated key is yielded to a `callback` function. - forEach = function (object, callback) { - var size = 0, Properties, members, property; - - // Tests for bugs in the current environment's `for...in` algorithm. The - // `valueOf` property inherits the non-enumerable flag from - // `Object.prototype` in older versions of IE, Netscape, and Mozilla. - (Properties = function () { - this.valueOf = 0; - }).prototype.valueOf = 0; - - // Iterate over a new instance of the `Properties` class. - members = new Properties(); - for (property in members) { - // Ignore all properties inherited from `Object.prototype`. - if (isProperty.call(members, property)) { - size++; - } - } - Properties = members = null; - - // Normalize the iteration algorithm. - if (!size) { - // A list of non-enumerable properties inherited from `Object.prototype`. - members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"]; - // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable - // properties. - forEach = function (object, callback) { - var isFunction = getClass.call(object) == functionClass, property, length; - var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty; - for (property in object) { - // Gecko <= 1.0 enumerates the `prototype` property of functions under - // certain conditions; IE does not. - if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) { - callback(property); - } - } - // Manually invoke the callback for each non-enumerable property. - for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property)); - }; - } else if (size == 2) { - // Safari <= 2.0.4 enumerates shadowed properties twice. - forEach = function (object, callback) { - // Create a set of iterated properties. - var members = {}, isFunction = getClass.call(object) == functionClass, property; - for (property in object) { - // Store each property name to prevent double enumeration. The - // `prototype` property of functions is not enumerated due to cross- - // environment inconsistencies. - if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) { - callback(property); - } - } - }; - } else { - // No bugs detected; use the standard `for...in` algorithm. - forEach = function (object, callback) { - var isFunction = getClass.call(object) == functionClass, property, isConstructor; - for (property in object) { - if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) { - callback(property); - } - } - // Manually invoke the callback for the `constructor` property due to - // cross-environment inconsistencies. - if (isConstructor || isProperty.call(object, (property = "constructor"))) { - callback(property); - } - }; - } - return forEach(object, callback); - }; - - // Public: Serializes a JavaScript `value` as a JSON string. The optional - // `filter` argument may specify either a function that alters how object and - // array members are serialized, or an array of strings and numbers that - // indicates which properties should be serialized. The optional `width` - // argument may be either a string or number that specifies the indentation - // level of the output. - if (!has("json-stringify")) { - // Internal: A map of control characters and their escaped equivalents. - var Escapes = { - 92: "\\\\", - 34: '\\"', - 8: "\\b", - 12: "\\f", - 10: "\\n", - 13: "\\r", - 9: "\\t" - }; - - // Internal: Converts `value` into a zero-padded string such that its - // length is at least equal to `width`. The `width` must be <= 6. - var leadingZeroes = "000000"; - var toPaddedString = function (width, value) { - // The `|| 0` expression is necessary to work around a bug in - // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`. - return (leadingZeroes + (value || 0)).slice(-width); - }; - - // Internal: Double-quotes a string `value`, replacing all ASCII control - // characters (characters with code unit values between 0 and 31) with - // their escaped equivalents. This is an implementation of the - // `Quote(value)` operation defined in ES 5.1 section 15.12.3. - var unicodePrefix = "\\u00"; - var quote = function (value) { - var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10; - var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value); - for (; index < length; index++) { - var charCode = value.charCodeAt(index); - // If the character is a control character, append its Unicode or - // shorthand escape sequence; otherwise, append the character as-is. - switch (charCode) { - case 8: case 9: case 10: case 12: case 13: case 34: case 92: - result += Escapes[charCode]; - break; - default: - if (charCode < 32) { - result += unicodePrefix + toPaddedString(2, charCode.toString(16)); - break; - } - result += useCharIndex ? symbols[index] : value.charAt(index); - } - } - return result + '"'; - }; - - // Internal: Recursively serializes an object. Implements the - // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations. - var serialize = function (property, object, callback, properties, whitespace, indentation, stack) { - var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result; - try { - // Necessary for host object support. - value = object[property]; - } catch (exception) {} - if (typeof value == "object" && value) { - className = getClass.call(value); - if (className == dateClass && !isProperty.call(value, "toJSON")) { - if (value > -1 / 0 && value < 1 / 0) { - // Dates are serialized according to the `Date#toJSON` method - // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15 - // for the ISO 8601 date time string format. - if (getDay) { - // Manually compute the year, month, date, hours, minutes, - // seconds, and milliseconds if the `getUTC*` methods are - // buggy. Adapted from @Yaffle's `date-shim` project. - date = floor(value / 864e5); - for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++); - for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++); - date = 1 + date - getDay(year, month); - // The `time` value specifies the time within the day (see ES - // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used - // to compute `A modulo B`, as the `%` operator does not - // correspond to the `modulo` operation for negative numbers. - time = (value % 864e5 + 864e5) % 864e5; - // The hours, minutes, seconds, and milliseconds are obtained by - // decomposing the time within the day. See section 15.9.1.10. - hours = floor(time / 36e5) % 24; - minutes = floor(time / 6e4) % 60; - seconds = floor(time / 1e3) % 60; - milliseconds = time % 1e3; - } else { - year = value.getUTCFullYear(); - month = value.getUTCMonth(); - date = value.getUTCDate(); - hours = value.getUTCHours(); - minutes = value.getUTCMinutes(); - seconds = value.getUTCSeconds(); - milliseconds = value.getUTCMilliseconds(); - } - // Serialize extended years correctly. - value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) + - "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) + - // Months, dates, hours, minutes, and seconds should have two - // digits; milliseconds should have three. - "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) + - // Milliseconds are optional in ES 5.0, but required in 5.1. - "." + toPaddedString(3, milliseconds) + "Z"; - } else { - value = null; - } - } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) { - // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the - // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3 - // ignores all `toJSON` methods on these objects unless they are - // defined directly on an instance. - value = value.toJSON(property); - } - } - if (callback) { - // If a replacement function was provided, call it to obtain the value - // for serialization. - value = callback.call(object, property, value); - } - if (value === null) { - return "null"; - } - className = getClass.call(value); - if (className == booleanClass) { - // Booleans are represented literally. - return "" + value; - } else if (className == numberClass) { - // JSON numbers must be finite. `Infinity` and `NaN` are serialized as - // `"null"`. - return value > -1 / 0 && value < 1 / 0 ? "" + value : "null"; - } else if (className == stringClass) { - // Strings are double-quoted and escaped. - return quote("" + value); - } - // Recursively serialize objects and arrays. - if (typeof value == "object") { - // Check for cyclic structures. This is a linear search; performance - // is inversely proportional to the number of unique nested objects. - for (length = stack.length; length--;) { - if (stack[length] === value) { - // Cyclic structures cannot be serialized by `JSON.stringify`. - throw TypeError(); - } - } - // Add the object to the stack of traversed objects. - stack.push(value); - results = []; - // Save the current indentation level and indent one additional level. - prefix = indentation; - indentation += whitespace; - if (className == arrayClass) { - // Recursively serialize array elements. - for (index = 0, length = value.length; index < length; index++) { - element = serialize(index, value, callback, properties, whitespace, indentation, stack); - results.push(element === undef ? "null" : element); - } - result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]"; - } else { - // Recursively serialize object members. Members are selected from - // either a user-specified list of property names, or the object - // itself. - forEach(properties || value, function (property) { - var element = serialize(property, value, callback, properties, whitespace, indentation, stack); - if (element !== undef) { - // According to ES 5.1 section 15.12.3: "If `gap` {whitespace} - // is not the empty string, let `member` {quote(property) + ":"} - // be the concatenation of `member` and the `space` character." - // The "`space` character" refers to the literal space - // character, not the `space` {width} argument provided to - // `JSON.stringify`. - results.push(quote(property) + ":" + (whitespace ? " " : "") + element); - } - }); - result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}"; - } - // Remove the object from the traversed object stack. - stack.pop(); - return result; - } - }; - - // Public: `JSON.stringify`. See ES 5.1 section 15.12.3. - exports.stringify = function (source, filter, width) { - var whitespace, callback, properties, className; - if (objectTypes[typeof filter] && filter) { - if ((className = getClass.call(filter)) == functionClass) { - callback = filter; - } else if (className == arrayClass) { - // Convert the property names array into a makeshift set. - properties = {}; - for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1)); - } - } - if (width) { - if ((className = getClass.call(width)) == numberClass) { - // Convert the `width` to an integer and create a string containing - // `width` number of space characters. - if ((width -= width % 1) > 0) { - for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " "); - } - } else if (className == stringClass) { - whitespace = width.length <= 10 ? width : width.slice(0, 10); - } - } - // Opera <= 7.54u2 discards the values associated with empty string keys - // (`""`) only if they are used directly within an object member list - // (e.g., `!("" in { "": 1})`). - return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []); - }; - } - - // Public: Parses a JSON source string. - if (!has("json-parse")) { - var fromCharCode = String.fromCharCode; - - // Internal: A map of escaped control characters and their unescaped - // equivalents. - var Unescapes = { - 92: "\\", - 34: '"', - 47: "/", - 98: "\b", - 116: "\t", - 110: "\n", - 102: "\f", - 114: "\r" - }; - - // Internal: Stores the parser state. - var Index, Source; - - // Internal: Resets the parser state and throws a `SyntaxError`. - var abort = function () { - Index = Source = null; - throw SyntaxError(); - }; - - // Internal: Returns the next token, or `"$"` if the parser has reached - // the end of the source string. A token may be a string, number, `null` - // literal, or Boolean literal. - var lex = function () { - var source = Source, length = source.length, value, begin, position, isSigned, charCode; - while (Index < length) { - charCode = source.charCodeAt(Index); - switch (charCode) { - case 9: case 10: case 13: case 32: - // Skip whitespace tokens, including tabs, carriage returns, line - // feeds, and space characters. - Index++; - break; - case 123: case 125: case 91: case 93: case 58: case 44: - // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at - // the current position. - value = charIndexBuggy ? source.charAt(Index) : source[Index]; - Index++; - return value; - case 34: - // `"` delimits a JSON string; advance to the next character and - // begin parsing the string. String tokens are prefixed with the - // sentinel `@` character to distinguish them from punctuators and - // end-of-string tokens. - for (value = "@", Index++; Index < length;) { - charCode = source.charCodeAt(Index); - if (charCode < 32) { - // Unescaped ASCII control characters (those with a code unit - // less than the space character) are not permitted. - abort(); - } else if (charCode == 92) { - // A reverse solidus (`\`) marks the beginning of an escaped - // control character (including `"`, `\`, and `/`) or Unicode - // escape sequence. - charCode = source.charCodeAt(++Index); - switch (charCode) { - case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114: - // Revive escaped control characters. - value += Unescapes[charCode]; - Index++; - break; - case 117: - // `\u` marks the beginning of a Unicode escape sequence. - // Advance to the first character and validate the - // four-digit code point. - begin = ++Index; - for (position = Index + 4; Index < position; Index++) { - charCode = source.charCodeAt(Index); - // A valid sequence comprises four hexdigits (case- - // insensitive) that form a single hexadecimal value. - if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) { - // Invalid Unicode escape sequence. - abort(); - } - } - // Revive the escaped character. - value += fromCharCode("0x" + source.slice(begin, Index)); - break; - default: - // Invalid escape sequence. - abort(); - } - } else { - if (charCode == 34) { - // An unescaped double-quote character marks the end of the - // string. - break; - } - charCode = source.charCodeAt(Index); - begin = Index; - // Optimize for the common case where a string is valid. - while (charCode >= 32 && charCode != 92 && charCode != 34) { - charCode = source.charCodeAt(++Index); - } - // Append the string as-is. - value += source.slice(begin, Index); - } - } - if (source.charCodeAt(Index) == 34) { - // Advance to the next character and return the revived string. - Index++; - return value; - } - // Unterminated string. - abort(); - default: - // Parse numbers and literals. - begin = Index; - // Advance past the negative sign, if one is specified. - if (charCode == 45) { - isSigned = true; - charCode = source.charCodeAt(++Index); - } - // Parse an integer or floating-point value. - if (charCode >= 48 && charCode <= 57) { - // Leading zeroes are interpreted as octal literals. - if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) { - // Illegal octal literal. - abort(); - } - isSigned = false; - // Parse the integer component. - for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++); - // Floats cannot contain a leading decimal point; however, this - // case is already accounted for by the parser. - if (source.charCodeAt(Index) == 46) { - position = ++Index; - // Parse the decimal component. - for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); - if (position == Index) { - // Illegal trailing decimal. - abort(); - } - Index = position; - } - // Parse exponents. The `e` denoting the exponent is - // case-insensitive. - charCode = source.charCodeAt(Index); - if (charCode == 101 || charCode == 69) { - charCode = source.charCodeAt(++Index); - // Skip past the sign following the exponent, if one is - // specified. - if (charCode == 43 || charCode == 45) { - Index++; - } - // Parse the exponential component. - for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++); - if (position == Index) { - // Illegal empty exponent. - abort(); - } - Index = position; - } - // Coerce the parsed value to a JavaScript number. - return +source.slice(begin, Index); - } - // A negative sign may only precede numbers. - if (isSigned) { - abort(); - } - // `true`, `false`, and `null` literals. - if (source.slice(Index, Index + 4) == "true") { - Index += 4; - return true; - } else if (source.slice(Index, Index + 5) == "false") { - Index += 5; - return false; - } else if (source.slice(Index, Index + 4) == "null") { - Index += 4; - return null; - } - // Unrecognized token. - abort(); - } - } - // Return the sentinel `$` character if the parser has reached the end - // of the source string. - return "$"; - }; - - // Internal: Parses a JSON `value` token. - var get = function (value) { - var results, hasMembers; - if (value == "$") { - // Unexpected end of input. - abort(); - } - if (typeof value == "string") { - if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") { - // Remove the sentinel `@` character. - return value.slice(1); - } - // Parse object and array literals. - if (value == "[") { - // Parses a JSON array, returning a new JavaScript array. - results = []; - for (;; hasMembers || (hasMembers = true)) { - value = lex(); - // A closing square bracket marks the end of the array literal. - if (value == "]") { - break; - } - // If the array literal contains elements, the current token - // should be a comma separating the previous element from the - // next. - if (hasMembers) { - if (value == ",") { - value = lex(); - if (value == "]") { - // Unexpected trailing `,` in array literal. - abort(); - } - } else { - // A `,` must separate each array element. - abort(); - } - } - // Elisions and leading commas are not permitted. - if (value == ",") { - abort(); - } - results.push(get(value)); - } - return results; - } else if (value == "{") { - // Parses a JSON object, returning a new JavaScript object. - results = {}; - for (;; hasMembers || (hasMembers = true)) { - value = lex(); - // A closing curly brace marks the end of the object literal. - if (value == "}") { - break; - } - // If the object literal contains members, the current token - // should be a comma separator. - if (hasMembers) { - if (value == ",") { - value = lex(); - if (value == "}") { - // Unexpected trailing `,` in object literal. - abort(); - } - } else { - // A `,` must separate each object member. - abort(); - } - } - // Leading commas are not permitted, object property names must be - // double-quoted strings, and a `:` must separate each property - // name and value. - if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") { - abort(); - } - results[value.slice(1)] = get(lex()); - } - return results; - } - // Unexpected token encountered. - abort(); - } - return value; - }; - - // Internal: Updates a traversed object member. - var update = function (source, property, callback) { - var element = walk(source, property, callback); - if (element === undef) { - delete source[property]; - } else { - source[property] = element; - } - }; - - // Internal: Recursively traverses a parsed JSON object, invoking the - // `callback` function for each value. This is an implementation of the - // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2. - var walk = function (source, property, callback) { - var value = source[property], length; - if (typeof value == "object" && value) { - // `forEach` can't be used to traverse an array in Opera <= 8.54 - // because its `Object#hasOwnProperty` implementation returns `false` - // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`). - if (getClass.call(value) == arrayClass) { - for (length = value.length; length--;) { - update(value, length, callback); - } - } else { - forEach(value, function (property) { - update(value, property, callback); - }); - } - } - return callback.call(source, property, value); - }; - - // Public: `JSON.parse`. See ES 5.1 section 15.12.2. - exports.parse = function (source, callback) { - var result, value; - Index = 0; - Source = "" + source; - result = get(lex()); - // If a JSON string contains multiple tokens, it is invalid. - if (lex() != "$") { - abort(); - } - // Reset the parser state. - Index = Source = null; - return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result; - }; - } - } - - exports["runInContext"] = runInContext; - return exports; - } - - if (freeExports && !isLoader) { - // Export for CommonJS environments. - runInContext(root, freeExports); - } else { - // Export for web browsers and JavaScript engines. - var nativeJSON = root.JSON, - previousJSON = root["JSON3"], - isRestored = false; - - var JSON3 = runInContext(root, (root["JSON3"] = { - // Public: Restores the original value of the global `JSON` object and - // returns a reference to the `JSON3` object. - "noConflict": function () { - if (!isRestored) { - isRestored = true; - root.JSON = nativeJSON; - root["JSON3"] = previousJSON; - nativeJSON = previousJSON = null; - } - return JSON3; - } - })); - - root.JSON = { - "parse": JSON3.parse, - "stringify": JSON3.stringify - }; - } - - // Export for asynchronous module loaders. - if (isLoader) { - define(function () { - return JSON3; - }); - } - }).call(this); - /************************************************************ - * end JSON - ************************************************************/ - - JSON_PIWIK = exports; - - })(); -} - /* startjslint */ /*jslint browser:true, plusplus:true, vars:true, nomen:true, evil:true, regexp: false, bitwise: true, white: true */ -/*global JSON_PIWIK */ /*global window */ /*global unescape */ /*global ActiveXObject */ @@ -4026,7 +3102,7 @@ if (typeof window.Piwik !== 'object') { cookie = getCookie(cookieName); if (cookie.length) { - cookie = JSON_PIWIK.parse(cookie); + cookie = windowAlias.JSON.parse(cookie); if (isObject(cookie)) { return cookie; @@ -4055,7 +3131,7 @@ if (typeof window.Piwik !== 'object') { return hash( (navigatorAlias.userAgent || '') + (navigatorAlias.platform || '') + - JSON_PIWIK.stringify(browserFeatures) + + windowAlias.JSON.stringify(browserFeatures) + (new Date()).getTime() + Math.random() ).slice(0, 16); @@ -4067,7 +3143,7 @@ if (typeof window.Piwik !== 'object') { return hash( (navigatorAlias.userAgent || '') + (navigatorAlias.platform || '') + - JSON_PIWIK.stringify(browserFeatures)).slice(0, 6); + windowAlias.JSON.stringify(browserFeatures)).slice(0, 6); } function getCurrentTimestampInSeconds() @@ -4293,7 +3369,7 @@ if (typeof window.Piwik !== 'object') { if (cookie.length) { try { - cookie = JSON_PIWIK.parse(cookie); + cookie = windowAlias.JSON.parse(cookie); if (isObject(cookie)) { return cookie; } @@ -4510,7 +3586,7 @@ if (typeof window.Piwik !== 'object') { purify(referralUrl.slice(0, referralUrlMaxLength)) ]; - setCookie(cookieReferrerName, JSON_PIWIK.stringify(attributionCookie), configReferralCookieTimeout, configCookiePath, configCookieDomain); + setCookie(cookieReferrerName, windowAlias.JSON.stringify(attributionCookie), configReferralCookieTimeout, configCookiePath, configCookieDomain); } } @@ -4571,14 +3647,14 @@ if (typeof window.Piwik !== 'object') { // custom data if (customData) { - request += '&data=' + encodeWrapper(JSON_PIWIK.stringify(customData)); + request += '&data=' + encodeWrapper(windowAlias.JSON.stringify(customData)); } else if (configCustomData) { - request += '&data=' + encodeWrapper(JSON_PIWIK.stringify(configCustomData)); + request += '&data=' + encodeWrapper(windowAlias.JSON.stringify(configCustomData)); } // Custom Variables, scope "page" function appendCustomVariablesToRequest(customVariables, parameterName) { - var customVariablesStringified = JSON_PIWIK.stringify(customVariables); + var customVariablesStringified = windowAlias.JSON.stringify(customVariables); if (customVariablesStringified.length > 2) { return '&' + parameterName + '=' + encodeWrapper(customVariablesStringified); } @@ -4605,7 +3681,7 @@ if (typeof window.Piwik !== 'object') { } if (configStoreCustomVariablesInCookie) { - setCookie(cookieCustomVariablesName, JSON_PIWIK.stringify(customVariables), configSessionCookieTimeout, configCookiePath, configCookieDomain); + setCookie(cookieCustomVariablesName, windowAlias.JSON.stringify(customVariables), configSessionCookieTimeout, configCookiePath, configCookieDomain); } } @@ -4728,7 +3804,7 @@ if (typeof window.Piwik !== 'object') { items.push(ecommerceItems[sku]); } } - request += '&ec_items=' + encodeWrapper(JSON_PIWIK.stringify(items)); + request += '&ec_items=' + encodeWrapper(windowAlias.JSON.stringify(items)); } request = getRequest(request, configCustomData, 'ecommerce', lastEcommerceOrderTs); sendRequest(request, configTrackerPause); @@ -5908,7 +4984,7 @@ if (typeof window.Piwik !== 'object') { * To access specific data point, you should use the other functions getAttributionReferrer* and getAttributionCampaign* * * @return array Attribution array, Example use: - * 1) Call JSON_PIWIK.stringify(piwikTracker.getAttributionInfo()) + * 1) Call windowAlias.JSON.stringify(piwikTracker.getAttributionInfo()) * 2) Pass this json encoded string to the Tracking API (php or java client): setAttributionInfo() */ this.getAttributionInfo = function () { @@ -7308,7 +6384,7 @@ if (typeof window.Piwik !== 'object') { if (!isDefined(category) || category === null || category === false || !category.length) { category = ""; } else if (category instanceof Array) { - category = JSON_PIWIK.stringify(category); + category = windowAlias.JSON.stringify(category); } customVariablesPage[5] = ['_pkc', category]; @@ -7824,7 +6900,7 @@ if (typeof window.Piwik !== 'object') { Piwik = { initialized: false, - JSON: JSON_PIWIK, + JSON: windowAlias.JSON, /** * DOM Document related methods diff --git a/js/piwik.min.js b/js/piwik.min.js index d8391f6bc6..3981d2cad1 100644 --- a/js/piwik.min.js +++ b/js/piwik.min.js @@ -8,49 +8,39 @@ * @license https://piwik.org/free-software/bsd/ BSD-3 Clause (also in js/LICENSE.txt) * @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD-3-Clause */ -;if(typeof JSON_PIWIK!=="object"&&typeof window.JSON==="object"&&window.JSON.stringify&&window.JSON.parse){JSON_PIWIK=window.JSON}else{(function(){var a={}; -/*!! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */ -(function(){var c=typeof define==="function"&&define.amd;var e={"function":true,object:true};var h=e[typeof a]&&a&&!a.nodeType&&a;var i=e[typeof window]&&window||this,b=h&&e[typeof module]&&module&&!module.nodeType&&typeof global=="object"&&global;if(b&&(b.global===b||b.window===b||b.self===b)){i=b}function j(ab,V){ab||(ab=i.Object());V||(V=i.Object()); -var K=ab.Number||i.Number,R=ab.String||i.String,x=ab.Object||i.Object,S=ab.Date||i.Date,T=ab.SyntaxError||i.SyntaxError,aa=ab.TypeError||i.TypeError,J=ab.Math||i.Math,Y=ab.JSON||i.JSON;if(typeof Y=="object"&&Y){V.stringify=Y.stringify;V.parse=Y.parse}var n=x.prototype,u=n.toString,r,m,L;var B=new S(-3509827334573292);try{B=B.getUTCFullYear()==-109252&&B.getUTCMonth()===0&&B.getUTCDate()===1&&B.getUTCHours()==10&&B.getUTCMinutes()==37&&B.getUTCSeconds()==6&&B.getUTCMilliseconds()==708}catch(v){}function o(ac){if(o[ac]!==L){return o[ac]}var ad;if(ac=="bug-string-char-index"){ad="a"[0]!="a"}else{if(ac=="json"){ad=o("json-stringify")&&o("json-parse")}else{var ak,ah='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(ac=="json-stringify"){var ai=V.stringify,aj=typeof ai=="function"&&B;if(aj){(ak=function(){return 1}).toJSON=ak;try{aj=ai(0)==="0"&&ai(new K())==="0"&&ai(new R())=='""'&&ai(u)===L&&ai(L)===L&&ai()===L&&ai(ak)==="1"&&ai([ak])=="[1]"&&ai([L])=="[null]"&&ai(null)=="null"&&ai([L,u,null])=="[null,null,null]"&&ai({a:[ak,true,false,null,"\x00\b\n\f\r\t"]})==ah&&ai(null,ak)==="1"&&ai([1,2],null,1)=="[\n 1,\n 2\n]"&&ai(new S(-8640000000000000))=='"-271821-04-20T00:00:00.000Z"'&&ai(new S(8640000000000000))=='"+275760-09-13T00:00:00.000Z"'&&ai(new S(-62198755200000))=='"-000001-01-01T00:00:00.000Z"'&&ai(new S(-1))=='"1969-12-31T23:59:59.999Z"' -}catch(ae){aj=false}}ad=aj}if(ac=="json-parse"){var ag=V.parse;if(typeof ag=="function"){try{if(ag("0")===0&&!ag(false)){ak=ag(ah);var af=ak.a.length==5&&ak.a[0]===1;if(af){try{af=!ag('"\t"')}catch(ae){}if(af){try{af=ag("01")!==1}catch(ae){}}if(af){try{af=ag("1.")!==1}catch(ae){}}}}}catch(ae){af=false}}ad=af}}}return o[ac]=!!ad}if(!o("json")){var U="[object Function]",Q="[object Date]",N="[object Number]",O="[object String]",E="[object Array]",A="[object Boolean]";var F=o("bug-string-char-index");if(!B){var s=J.floor;var Z=[0,31,59,90,120,151,181,212,243,273,304,334];var D=function(ac,ad){return Z[ad]+365*(ac-1970)+s((ac-1969+(ad=+(ad>1)))/4)-s((ac-1901+ad)/100)+s((ac-1601+ad)/400)}}if(!(r=n.hasOwnProperty)){r=function(ae){var ac={},ad;if((ac.__proto__=null,ac.__proto__={toString:1},ac).toString!=u){r=function(ah){var ag=this.__proto__,af=ah in (this.__proto__=null,this);this.__proto__=ag;return af}}else{ad=ac.constructor;r=function(ag){var af=(this.constructor||ad).prototype;return ag in this&&!(ag in af&&this[ag]===af[ag]) -}}ac=null;return r.call(this,ae)}}m=function(ae,ah){var af=0,ac,ad,ag;(ac=function(){this.valueOf=0}).prototype.valueOf=0;ad=new ac();for(ag in ad){if(r.call(ad,ag)){af++}}ac=ad=null;if(!af){ad=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];m=function(aj,an){var am=u.call(aj)==U,al,ak;var ai=!am&&typeof aj.constructor!="function"&&e[typeof aj.hasOwnProperty]&&aj.hasOwnProperty||r;for(al in aj){if(!(am&&al=="prototype")&&ai.call(aj,al)){an(al)}}for(ak=ad.length;al=ad[--ak];ai.call(aj,al)&&an(al)){}}}else{if(af==2){m=function(aj,am){var ai={},al=u.call(aj)==U,ak;for(ak in aj){if(!(al&&ak=="prototype")&&!r.call(ai,ak)&&(ai[ak]=1)&&r.call(aj,ak)){am(ak)}}}}else{m=function(aj,am){var al=u.call(aj)==U,ak,ai;for(ak in aj){if(!(al&&ak=="prototype")&&r.call(aj,ak)&&!(ai=ak==="constructor")){am(ak)}}if(ai||r.call(aj,(ak="constructor"))){am(ak)}}}}return m(ae,ah)};if(!o("json-stringify")){var q={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"}; -var I="000000";var t=function(ac,ad){return(I+(ad||0)).slice(-ac)};var z="\\u00";var C=function(ai){var ad='"',ag=0,ah=ai.length,ac=!F||ah>10;var af=ac&&(F?ai.split(""):ai);for(;ag-1/0&&at<1/0){if(D){ay=s(at/86400000);for(ap=s(ay/365.2425)+1970-1;D(ap+1,0)<=ay;ap++){}for(az=s((ay-D(ap,0))/30.42);D(ap,az+1)<=ay;az++){}ay=1+ay-D(ap,az);ak=(at%86400000+86400000)%86400000;aw=s(ak/3600000)%24;au=s(ak/60000)%60;aq=s(ak/1000)%60;an=ak%1000}else{ap=at.getUTCFullYear();az=at.getUTCMonth();ay=at.getUTCDate();aw=at.getUTCHours();au=at.getUTCMinutes();aq=at.getUTCSeconds();an=at.getUTCMilliseconds()}at=(ap<=0||ap>=10000?(ap<0?"-":"+")+t(6,ap<0?-ap:ap):t(4,ap))+"-"+t(2,az+1)+"-"+t(2,ay)+"T"+t(2,aw)+":"+t(2,au)+":"+t(2,aq)+"."+t(3,an)+"Z" -}else{at=null}}else{if(typeof at.toJSON=="function"&&((ae!=N&&ae!=O&&ae!=E)||r.call(at,"toJSON"))){at=at.toJSON(ai)}}}if(ag){at=ag.call(aA,ai,at)}if(at===null){return"null"}ae=u.call(at);if(ae==A){return""+at}else{if(ae==N){return at>-1/0&&at<1/0?""+at:"null"}else{if(ae==O){return C(""+at)}}}if(typeof at=="object"){for(af=aj.length;af--;){if(aj[af]===at){throw aa()}}aj.push(at);ar=[];av=ac;ac+=ax;if(ae==E){for(ah=0,af=at.length;ah0){for(ad="",af>10&&(af=10); -ad.length=48&&ad<=57||ad>=97&&ad<=102||ad>=65&&ad<=70)){H()}}ag+=M("0x"+ah.slice(ae,G));break;default:H()}}else{if(ad==34){break}ad=ah.charCodeAt(G);ae=G;while(ad>=32&&ad!=92&&ad!=34){ad=ah.charCodeAt(++G)}ag+=ah.slice(ae,G)}}}if(ah.charCodeAt(G)==34){G++; -return ag}H();default:ae=G;if(ad==45){ai=true;ad=ah.charCodeAt(++G)}if(ad>=48&&ad<=57){if(ad==48&&((ad=ah.charCodeAt(G+1)),ad>=48&&ad<=57)){H()}ai=false;for(;G=48&&ad<=57);G++){}if(ah.charCodeAt(G)==46){ac=++G;for(;ac=48&&ad<=57);ac++){}if(ac==G){H()}G=ac}ad=ah.charCodeAt(G);if(ad==101||ad==69){ad=ah.charCodeAt(++G);if(ad==43||ad==45){G++}for(ac=G;ac=48&&ad<=57);ac++){}if(ac==G){H()}G=ac}return +ah.slice(ae,G)}if(ai){H()}if(ah.slice(G,G+4)=="true"){G+=4;return true}else{if(ah.slice(G,G+5)=="false"){G+=5;return false}else{if(ah.slice(G,G+4)=="null"){G+=4;return null}}}H()}}return"$"};var W=function(ad){var ac,ae;if(ad=="$"){H()}if(typeof ad=="string"){if((F?ad.charAt(0):ad[0])=="@"){return ad.slice(1)}if(ad=="["){ac=[];for(;;ae||(ae=true)){ad=y();if(ad=="]"){break}if(ae){if(ad==","){ad=y();if(ad=="]"){H()}}else{H()}}if(ad==","){H()}ac.push(W(ad))}return ac}else{if(ad=="{"){ac={};for(;;ae||(ae=true)){ad=y(); -if(ad=="}"){break}if(ae){if(ad==","){ad=y();if(ad=="}"){H()}}else{H()}}if(ad==","||typeof ad!="string"||(F?ad.charAt(0):ad[0])!="@"||y()!=":"){H()}ac[ad.slice(1)]=W(y())}return ac}}H()}return ad};var P=function(ae,ad,af){var ac=w(ae,ad,af);if(ac===L){delete ae[ad]}else{ae[ad]=ac}};var w=function(af,ae,ag){var ad=af[ae],ac;if(typeof ad=="object"&&ad){if(u.call(ad)==E){for(ac=ad.length;ac--;){P(ad,ac,ag)}}else{m(ad,function(ah){P(ad,ah,ag)})}}return ag.call(af,ae,ad)};V.parse=function(ae,af){var ac,ad;G=0;X=""+ae;ac=W(y());if(y()!="$"){H()}G=X=null;return af&&u.call(af)==U?w((ad={},ad[""]=ac,ad),"",af):ac}}}V.runInContext=j;return V}if(h&&!c){j(i,h)}else{var f=i.JSON,k=i.JSON3,d=false;var g=j(i,(i.JSON3={noConflict:function(){if(!d){d=true;i.JSON=f;i.JSON3=k;f=k=null}return g}}));i.JSON={parse:g.parse,stringify:g.stringify}}if(c){define(function(){return g})}}).call(this);JSON_PIWIK=a})()}if(typeof _paq!=="object"){_paq=[]}if(typeof window.Piwik!=="object"){window.Matomo=window.Piwik=(function(){var r,b={},y={},G=document,h=navigator,X=screen,T=window,i=T.performance||T.mozPerformance||T.msPerformance||T.webkitPerformance,t=T.encodeURIComponent,S=T.decodeURIComponent,l=unescape,I=[],E,e,ah=[],x=0,ab=0,U=0,m=false; -function p(ao){try{return S(ao)}catch(ap){return unescape(ao)}}function J(ap){var ao=typeof ap;return ao!=="undefined"}function A(ao){return typeof ao==="function"}function W(ao){return typeof ao==="object"}function w(ao){return typeof ao==="string"||ao instanceof String}function ag(ao){return typeof ao==="number"||ao instanceof Number}function Y(ao){return J(ao)&&(ag(ao)||(w(ao)&&ao.length))}function B(ap){if(!ap){return true}var ao;var aq=true;for(ao in ap){if(Object.prototype.hasOwnProperty.call(ap,ao)){aq=false}}return aq}function ak(ao){var ap=typeof console;if(ap!=="undefined"&&console&&console.error){console.error(ao)}}function af(){var au,at,aw,ap,ao;for(au=0;au0;if(ar){av=aw.split("::");aq=av[0];aw=av[1];if("object"===typeof e[aq]&&"function"===typeof e[aq][aw]){e[aq][aw].apply(e[aq],ap)}else{if(ao){ah.push(ao)}}}else{for(at=0; -at0;if(ax){av=aw.split(".");if(aq&&"object"===typeof aq[av[0]]){aq=aq[av[0]];aw=av[1]}else{if(ao){ah.push(ao);break}}}if(aq[aw]){aq[aw].apply(aq,ap)}else{var ay="The method '"+aw+'\' was not found in "_paq" variable. Please have a look at the Piwik tracker documentation: https://developer.piwik.org/api-reference/tracking-javascript';ak(ay);if(!ax){throw new TypeError(ay)}}if(aw==="addTracker"){break}if(aw==="setTrackerUrl"||aw==="setSiteId"){break}}else{aw.apply(I[at],ap)}}}}}function an(ar,aq,ap,ao){if(ar.addEventListener){ar.addEventListener(aq,ap,ao);return true}if(ar.attachEvent){return ar.attachEvent("on"+aq,ap)}ar["on"+aq]=ap}function n(ao){if(G.readyState==="complete"){ao()}else{if(T.addEventListener){T.addEventListener("load",ao,false)}else{if(T.attachEvent){T.attachEvent("onload",ao)}}}}function q(ar){var ao=false;if(G.attachEvent){ao=G.readyState==="complete"}else{ao=G.readyState!=="loading"}if(ao){ar();return}var aq;if(G.addEventListener){an(G,"DOMContentLoaded",function ap(){G.removeEventListener("DOMContentLoaded",ap,false); -if(!ao){ao=true;ar()}})}else{if(G.attachEvent){G.attachEvent("onreadystatechange",function ap(){if(G.readyState==="complete"){G.detachEvent("onreadystatechange",ap);if(!ao){ao=true;ar()}}});if(G.documentElement.doScroll&&T===T.top){(function ap(){if(!ao){try{G.documentElement.doScroll("left")}catch(at){setTimeout(ap,0);return}ao=true;ar()}}())}}}an(T,"load",function(){if(!ao){ao=true;ar()}},false)}function ac(ap,av,aw){if(!ap){return""}var ao="",ar,aq,at,au;for(ar in b){if(Object.prototype.hasOwnProperty.call(b,ar)){au=b[ar]&&"function"===typeof b[ar][ap];if(au){aq=b[ar][ap];at=aq(av||{},aw);if(at){ao+=at}}}}return ao}function ai(){var ao;m=true;ac("unload");if(r){do{ao=new Date()}while(ao.getTimeAlias()=0;au--){at=av[au].split("=")[0];if(at===aq){av.splice(au,1)}}var ay=av.join("&");if(ay){aw=aw+"?"+ay}if(ax){aw+="#"+ax}}return aw}function f(aq,ap){var ao="[\\?&#]"+ap+"=([^&#]*)";var at=new RegExp(ao);var ar=at.exec(aq);return ar?S(ar[1]):""}function a(ao){if(ao&&String(ao)===ao){return ao.replace(/^\s+|\s+$/g,"")}return ao}function D(ao){return unescape(t(ao))}function am(aE){var aq=function(aK,aJ){return(aK<>>(32-aJ))},aF=function(aM){var aK="",aL,aJ;for(aL=7;aL>=0;aL--){aJ=(aM>>>(aL*4))&15;aK+=aJ.toString(16)}return aK},au,aH,aG,ap=[],ay=1732584193,aw=4023233417,av=2562383102,at=271733878,ar=3285377520,aD,aC,aB,aA,az,aI,ao,ax=[];aE=D(aE);ao=aE.length;for(aH=0;aH>>29);ax.push((ao<<3)&4294967295);for(au=0;auau.offsetWidth+au.scrollLeft||aw+az-aAau.offsetHeight+au.scrollTop||aB+ax-aAax?-1:1});if(ao.length<=1){return ao}var ap=0;var ar=0;var at=[];var aq;aq=ao[ap++];while(aq){if(aq===ao[ap]){ar=at.push(ap)}aq=ao[ap++]||null}while(ar--){ao.splice(at[ar],1)}return ao},getAttributeValueFromNode:function(at,aq){if(!this.hasNodeAttribute(at,aq)){return}if(at&&at.getAttribute){return at.getAttribute(aq)}if(!at||!at.attributes){return}var ar=(typeof at.attributes[aq]);if("undefined"===ar){return}if(at.attributes[aq].value){return at.attributes[aq].value}if(at.attributes[aq].nodeValue){return at.attributes[aq].nodeValue}var ap;var ao=at.attributes;if(!ao){return}for(ap=0;ap1000){break}ao++}},findPieceNode:function(ap){var ao;ao=ae.findFirstNodeHavingAttribute(ap,this.CONTENT_PIECE_ATTR);if(!ao){ao=ae.findFirstNodeHavingClass(ap,this.CONTENT_PIECE_CLASS)}if(ao){return ao}return ap},findTargetNodeNoDefault:function(ao){if(!ao){return}var ap=ae.findFirstNodeHavingAttributeWithValue(ao,this.CONTENT_TARGET_ATTR); -if(ap){return ap}ap=ae.findFirstNodeHavingAttribute(ao,this.CONTENT_TARGET_ATTR);if(ap){return ap}ap=ae.findFirstNodeHavingClass(ao,this.CONTENT_TARGET_CLASS);if(ap){return ap}},findTargetNode:function(ao){var ap=this.findTargetNodeNoDefault(ao);if(ap){return ap}return ao},findContentName:function(ap){if(!ap){return}var at=ae.findFirstNodeHavingAttributeWithValue(ap,this.CONTENT_NAME_ATTR);if(at){return ae.getAttributeValueFromNode(at,this.CONTENT_NAME_ATTR)}var ao=this.findContentPiece(ap);if(ao){return this.removeDomainIfIsInLink(ao)}if(ae.hasNodeAttributeWithValue(ap,"title")){return ae.getAttributeValueFromNode(ap,"title")}var aq=this.findPieceNode(ap);if(ae.hasNodeAttributeWithValue(aq,"title")){return ae.getAttributeValueFromNode(aq,"title")}var ar=this.findTargetNode(ap);if(ae.hasNodeAttributeWithValue(ar,"title")){return ae.getAttributeValueFromNode(ar,"title")}},findContentPiece:function(ap){if(!ap){return}var ar=ae.findFirstNodeHavingAttributeWithValue(ap,this.CONTENT_PIECE_ATTR); -if(ar){return ae.getAttributeValueFromNode(ar,this.CONTENT_PIECE_ATTR)}var ao=this.findPieceNode(ap);var aq=this.findMediaUrlInNode(ao);if(aq){return this.toAbsoluteUrl(aq)}},findContentTarget:function(aq){if(!aq){return}var ar=this.findTargetNode(aq);if(ae.hasNodeAttributeWithValue(ar,this.CONTENT_TARGET_ATTR)){return ae.getAttributeValueFromNode(ar,this.CONTENT_TARGET_ATTR)}var ap;if(ae.hasNodeAttributeWithValue(ar,"href")){ap=ae.getAttributeValueFromNode(ar,"href");return this.toAbsoluteUrl(ap)}var ao=this.findPieceNode(aq);if(ae.hasNodeAttributeWithValue(ao,"href")){ap=ae.getAttributeValueFromNode(ao,"href");return this.toAbsoluteUrl(ap)}},isSameDomain:function(ao){if(!ao||!ao.indexOf){return false}if(0===ao.indexOf(this.getLocation().origin)){return true}var ap=ao.indexOf(this.getLocation().host);if(8>=ap&&0<=ap){return true}return false},removeDomainIfIsInLink:function(aq){var ap="^https?://[^/]+";var ao="^.*//[^/]+";if(aq&&aq.search&&-1!==aq.search(new RegExp(ap))&&this.isSameDomain(aq)){aq=aq.replace(new RegExp(ao),""); -if(!aq){aq="/"}}return aq},findMediaUrlInNode:function(at){if(!at){return}var aq=["img","embed","video","audio"];var ao=at.nodeName.toLowerCase();if(-1!==M(aq,ao)&&ae.findFirstNodeHavingAttributeWithValue(at,"src")){var ar=ae.findFirstNodeHavingAttributeWithValue(at,"src");return ae.getAttributeValueFromNode(ar,"src")}if(ao==="object"&&ae.hasNodeAttributeWithValue(at,"data")){return ae.getAttributeValueFromNode(at,"data")}if(ao==="object"){var au=ae.findNodesByTagName(at,"param");if(au&&au.length){var ap;for(ap=0;ap0}var ap=ar.clientWidth;if(T.innerWidth&&ap>T.innerWidth){ap=T.innerWidth}var ao=ar.clientHeight;if(T.innerHeight&&ao>T.innerHeight){ao=T.innerHeight}return((at.bottom>0||aq)&&at.right>0&&at.left0;if(ar){av=aw.split("::");aq=av[0];aw=av[1];if("object"===typeof e[aq]&&"function"===typeof e[aq][aw]){e[aq][aw].apply(e[aq],ap)}else{if(ao){ah.push(ao)}}}else{for(at=0;at0;if(ax){av=aw.split(".");if(aq&&"object"===typeof aq[av[0]]){aq=aq[av[0]];aw=av[1]}else{if(ao){ah.push(ao);break}}}if(aq[aw]){aq[aw].apply(aq,ap)}else{var ay="The method '"+aw+'\' was not found in "_paq" variable. Please have a look at the Piwik tracker documentation: https://developer.piwik.org/api-reference/tracking-javascript'; +ak(ay);if(!ax){throw new TypeError(ay)}}if(aw==="addTracker"){break}if(aw==="setTrackerUrl"||aw==="setSiteId"){break}}else{aw.apply(I[at],ap)}}}}}function an(ar,aq,ap,ao){if(ar.addEventListener){ar.addEventListener(aq,ap,ao);return true}if(ar.attachEvent){return ar.attachEvent("on"+aq,ap)}ar["on"+aq]=ap}function n(ao){if(G.readyState==="complete"){ao()}else{if(T.addEventListener){T.addEventListener("load",ao,false)}else{if(T.attachEvent){T.attachEvent("onload",ao)}}}}function q(ar){var ao=false;if(G.attachEvent){ao=G.readyState==="complete"}else{ao=G.readyState!=="loading"}if(ao){ar();return}var aq;if(G.addEventListener){an(G,"DOMContentLoaded",function ap(){G.removeEventListener("DOMContentLoaded",ap,false);if(!ao){ao=true;ar()}})}else{if(G.attachEvent){G.attachEvent("onreadystatechange",function ap(){if(G.readyState==="complete"){G.detachEvent("onreadystatechange",ap);if(!ao){ao=true;ar()}}});if(G.documentElement.doScroll&&T===T.top){(function ap(){if(!ao){try{G.documentElement.doScroll("left") +}catch(at){setTimeout(ap,0);return}ao=true;ar()}}())}}}an(T,"load",function(){if(!ao){ao=true;ar()}},false)}function ac(ap,av,aw){if(!ap){return""}var ao="",ar,aq,at,au;for(ar in b){if(Object.prototype.hasOwnProperty.call(b,ar)){au=b[ar]&&"function"===typeof b[ar][ap];if(au){aq=b[ar][ap];at=aq(av||{},aw);if(at){ao+=at}}}}return ao}function ai(){var ao;m=true;ac("unload");if(r){do{ao=new Date()}while(ao.getTimeAlias()=0;au--){at=av[au].split("=")[0];if(at===aq){av.splice(au,1)}}var ay=av.join("&");if(ay){aw=aw+"?"+ay}if(ax){aw+="#"+ax}}return aw +}function f(aq,ap){var ao="[\\?&#]"+ap+"=([^&#]*)";var at=new RegExp(ao);var ar=at.exec(aq);return ar?S(ar[1]):""}function a(ao){if(ao&&String(ao)===ao){return ao.replace(/^\s+|\s+$/g,"")}return ao}function D(ao){return unescape(t(ao))}function am(aE){var aq=function(aK,aJ){return(aK<>>(32-aJ))},aF=function(aM){var aK="",aL,aJ;for(aL=7;aL>=0;aL--){aJ=(aM>>>(aL*4))&15;aK+=aJ.toString(16)}return aK},au,aH,aG,ap=[],ay=1732584193,aw=4023233417,av=2562383102,at=271733878,ar=3285377520,aD,aC,aB,aA,az,aI,ao,ax=[];aE=D(aE);ao=aE.length;for(aH=0;aH>>29);ax.push((ao<<3)&4294967295); +for(au=0;auau.offsetWidth+au.scrollLeft||aw+az-aAau.offsetHeight+au.scrollTop||aB+ax-aAax?-1:1});if(ao.length<=1){return ao}var ap=0;var ar=0;var at=[];var aq;aq=ao[ap++];while(aq){if(aq===ao[ap]){ar=at.push(ap)}aq=ao[ap++]||null}while(ar--){ao.splice(at[ar],1)}return ao},getAttributeValueFromNode:function(at,aq){if(!this.hasNodeAttribute(at,aq)){return}if(at&&at.getAttribute){return at.getAttribute(aq) +}if(!at||!at.attributes){return}var ar=(typeof at.attributes[aq]);if("undefined"===ar){return}if(at.attributes[aq].value){return at.attributes[aq].value}if(at.attributes[aq].nodeValue){return at.attributes[aq].nodeValue}var ap;var ao=at.attributes;if(!ao){return}for(ap=0;ap1000){break}ao++}},findPieceNode:function(ap){var ao;ao=ae.findFirstNodeHavingAttribute(ap,this.CONTENT_PIECE_ATTR);if(!ao){ao=ae.findFirstNodeHavingClass(ap,this.CONTENT_PIECE_CLASS)}if(ao){return ao}return ap},findTargetNodeNoDefault:function(ao){if(!ao){return}var ap=ae.findFirstNodeHavingAttributeWithValue(ao,this.CONTENT_TARGET_ATTR);if(ap){return ap}ap=ae.findFirstNodeHavingAttribute(ao,this.CONTENT_TARGET_ATTR);if(ap){return ap}ap=ae.findFirstNodeHavingClass(ao,this.CONTENT_TARGET_CLASS); +if(ap){return ap}},findTargetNode:function(ao){var ap=this.findTargetNodeNoDefault(ao);if(ap){return ap}return ao},findContentName:function(ap){if(!ap){return}var at=ae.findFirstNodeHavingAttributeWithValue(ap,this.CONTENT_NAME_ATTR);if(at){return ae.getAttributeValueFromNode(at,this.CONTENT_NAME_ATTR)}var ao=this.findContentPiece(ap);if(ao){return this.removeDomainIfIsInLink(ao)}if(ae.hasNodeAttributeWithValue(ap,"title")){return ae.getAttributeValueFromNode(ap,"title")}var aq=this.findPieceNode(ap);if(ae.hasNodeAttributeWithValue(aq,"title")){return ae.getAttributeValueFromNode(aq,"title")}var ar=this.findTargetNode(ap);if(ae.hasNodeAttributeWithValue(ar,"title")){return ae.getAttributeValueFromNode(ar,"title")}},findContentPiece:function(ap){if(!ap){return}var ar=ae.findFirstNodeHavingAttributeWithValue(ap,this.CONTENT_PIECE_ATTR);if(ar){return ae.getAttributeValueFromNode(ar,this.CONTENT_PIECE_ATTR)}var ao=this.findPieceNode(ap);var aq=this.findMediaUrlInNode(ao);if(aq){return this.toAbsoluteUrl(aq) +}},findContentTarget:function(aq){if(!aq){return}var ar=this.findTargetNode(aq);if(ae.hasNodeAttributeWithValue(ar,this.CONTENT_TARGET_ATTR)){return ae.getAttributeValueFromNode(ar,this.CONTENT_TARGET_ATTR)}var ap;if(ae.hasNodeAttributeWithValue(ar,"href")){ap=ae.getAttributeValueFromNode(ar,"href");return this.toAbsoluteUrl(ap)}var ao=this.findPieceNode(aq);if(ae.hasNodeAttributeWithValue(ao,"href")){ap=ae.getAttributeValueFromNode(ao,"href");return this.toAbsoluteUrl(ap)}},isSameDomain:function(ao){if(!ao||!ao.indexOf){return false}if(0===ao.indexOf(this.getLocation().origin)){return true}var ap=ao.indexOf(this.getLocation().host);if(8>=ap&&0<=ap){return true}return false},removeDomainIfIsInLink:function(aq){var ap="^https?://[^/]+";var ao="^.*//[^/]+";if(aq&&aq.search&&-1!==aq.search(new RegExp(ap))&&this.isSameDomain(aq)){aq=aq.replace(new RegExp(ao),"");if(!aq){aq="/"}}return aq},findMediaUrlInNode:function(at){if(!at){return}var aq=["img","embed","video","audio"];var ao=at.nodeName.toLowerCase(); +if(-1!==M(aq,ao)&&ae.findFirstNodeHavingAttributeWithValue(at,"src")){var ar=ae.findFirstNodeHavingAttributeWithValue(at,"src");return ae.getAttributeValueFromNode(ar,"src")}if(ao==="object"&&ae.hasNodeAttributeWithValue(at,"data")){return ae.getAttributeValueFromNode(at,"data")}if(ao==="object"){var au=ae.findNodesByTagName(at,"param");if(au&&au.length){var ap;for(ap=0;ap0}var ap=ar.clientWidth;if(T.innerWidth&&ap>T.innerWidth){ap=T.innerWidth}var ao=ar.clientHeight; +if(T.innerHeight&&ao>T.innerHeight){ao=T.innerHeight}return((at.bottom>0||aq)&&at.right>0&&at.left=0){dk=dk.slice(0,dj)}dj=dk.lastIndexOf("/");if(dj!==dk.length-1){dk=dk.slice(0,dj+1)}return dk+di}function cE(dk,di){var dj;dk=String(dk).toLowerCase();di=String(di).toLowerCase();if(dk===di){return true}if(di.slice(0,1)==="."){if(dk===di.slice(1)){return true}dj=dk.length-di.length;if((dj>0)&&(dk.slice(dj)===di)){return true}}return false}function ck(di){var dj=document.createElement("a"); if(di.indexOf("//")!==0&&di.indexOf("http")!==0){if(di.indexOf("*")===0){di=di.substr(1)}if(di.indexOf(".")===0){di=di.substr(1)}di="http://"+di}dj.href=v.toAbsoluteUrl(di);if(dj.pathname){return dj.pathname}return""}function a3(dj,di){if(!aj(di,"/")){di="/"+di}if(!aj(dj,"/")){dj="/"+dj}var dk=(di==="/"||di==="/*");if(dk){return true}if(dj===di){return true}di=String(di).toLowerCase();dj=String(dj).toLowerCase();if(R(di,"*")){di=di.slice(0,-1);dk=(!di||di==="/");if(dk){return true}if(dj===di){return true}return dj.indexOf(di)===0}if(!R(dj,"/")){dj+="/"}if(!R(di,"/")){di+="/"}return dj.indexOf(di)===0}function ar(dm,dp){var dj,di,dk,dl,dn;for(dj=0;dj0)&&(dl.slice(dk)===di)){return true}}}return false}function cp(di,dk){di=di.replace("send_image=0","send_image=1"); var dj=new Image(1,1);dj.onload=function(){E=0;if(typeof dk==="function"){dk({request:di,trackerUrl:aD,success:true})}};dj.onerror=function(){if(typeof dk==="function"){dk({request:di,trackerUrl:aD,success:false})}};dj.src=aD+(aD.indexOf("?")<0?"?":"&")+di}function aJ(){return"object"===typeof h&&"function"===typeof h.sendBeacon&&"function"===typeof Blob}function a6(dl,dq){var dk=aJ();if(!dk){return false}var dp={type:"application/x-www-form-urlencoded; charset=UTF-8"};var dn=false;var dj=aD;try{var di=new Blob([dl],dp);if(dl.length<=2000){di=new Blob([],dp);dj=dj+(dj.indexOf("?")<0?"?":"&")+dl}dn=h.sendBeacon(dj,di)}catch(dm){return false}if(dn&&typeof dq==="function"){dq({request:dl,trackerUrl:aD,success:true,isSendBeacon:true})}return dn}function c3(dj,dk,di){if(!J(di)||null===di){di=true}if(m&&a6(dj,dk)){return}setTimeout(function(){if(m&&a6(dj,dk)){return}var dn;try{var dm=T.XMLHttpRequest?new T.XMLHttpRequest():T.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;dm.open("POST",aD,true); dm.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)){var dp=m&&a6(dj,dk);if(!dp&&di){cp(dj,dk)}else{if(typeof dk==="function"){dk({request:dj,trackerUrl:aD,success:false,xhr:this})}}}else{if(this.readyState===4&&(typeof dk==="function")){dk({request:dj,trackerUrl:aD,success:true,xhr:this})}}};dm.setRequestHeader("Content-Type",cw);dm.withCredentials=true;dm.send(dj)}catch(dl){dn=m&&a6(dj,dk);if(!dn&&di){cp(dj,dk)}else{if(typeof dk==="function"){dk({request:dj,trackerUrl:aD,success:false})}}}},50)}function cf(dj){var di=new Date();var dk=di.getTime()+dj;if(!r||dk>r){r=dk}}function cn(di){if(cb||!a5||!bA){return}cb=setTimeout(function dj(){cb=null;if(!bc){bc=(!G.hasFocus||G.hasFocus())}if(!bc){cn(a5);return}if(bQ()){return}var dk=new Date(),dl=a5-(dk.getTime()-cX);dl=Math.min(a5,dl);cn(dl)},di||a5)}function bJ(){if(!cb){return}clearTimeout(cb);cb=null}function ba(){bc=true;cQ=new Date().getTime()}function dc(){var di=new Date().getTime();return !cQ||(di-cQ)>a5 }function ay(){if(dc()){bQ()}bJ()}function df(){if(aN||!a5){return}aN=true;an(T,"focus",ba);an(T,"blur",ay);ab++;e.addPlugin("HeartBeat"+ab,{unload:function(){if(aN&&dc()){bQ()}}})}function cB(dm){var dj=new Date();var di=dj.getTime();cX=di;if(cA&&di2000){c3(dj,dk)}else{cp(dj,dk)}cf(di)})}if(!aN){df()}}function cj(di){if(cO){return false}return(di&&di.length)}function c2(di,dm){if(!dm||dm>=di.length){return[di]}var dj=0;var dk=di.length;var dl=[];for(dj;dj=dj&&di<=(dj+aZ)){return true}}return false}function dg(di){if(!cL){return""}var dm=f(di,av);if(!dm){return""}dm=String(dm); -var dk=new RegExp("^[a-zA-Z0-9]+$");if(dm.length===32&&dk.test(dm)){var dj=dm.substr(16,32);if(c1(dj)){var dl=dm.substr(0,16);return dl}}return""}function cM(){if(!bN){bN=dg(bM)}var dk=new Date(),di=Math.round(dk.getTime()/1000),dj=aT("id"),dn=aC(dj),dm,dl;if(dn){dm=dn.split(".");dm.unshift("0");if(bN.length){dm[1]=bN}return dm}if(bN.length){dl=bN}else{if("0"===b4()){dl=""}else{dl=cP()}}dm=["1",dl,di,0,di,"",""];return dm}function aY(){var dq=cM(),dl=dq[0],dm=dq[1],dj=dq[2],di=dq[3],dn=dq[4],dk=dq[5];if(!J(dq[6])){dq[6]=""}var dp=dq[6];return{newVisitor:dl,uuid:dm,createTs:dj,visitCount:di,currentVisitTs:dn,lastVisitTs:dk,lastEcommerceOrderTs:dp}}function aG(){var dl=new Date(),dj=dl.getTime(),dm=aY().createTs;var di=parseInt(dm,10);var dk=(di*1000)+cH-dj;return dk}function aL(di){if(!b5){return}var dk=new Date(),dj=Math.round(dk.getTime()/1000);if(!J(di)){di=aY()}var dl=di.uuid+"."+di.createTs+"."+di.visitCount+"."+dj+"."+di.lastVisitTs+"."+di.lastEcommerceOrderTs;dd(aT("id"),dl,aG(),bo,cW,bR) -}function bL(){var di=aC(aT("ref"));if(di.length){try{di=JSON_PIWIK.parse(di);if(W(di)){return di}}catch(dj){}}return["","",0,""]}function bv(dj){var di="testvalue";dd("test",di,10000,null,dj);if(aC("test")===di){bX("test",null,dj);return true}return false}function aE(){var dj=bk;bk=false;var di,dk;for(di=0;didI){dz.visitCount++;dz.lastVisitTs=dz.currentVisitTs}if(!bu||!dr.length){for(dF in cq){if(Object.prototype.hasOwnProperty.call(cq,dF)){dr=f(dJ,cq[dF]);if(dr.length){break}}}for(dF in bF){if(Object.prototype.hasOwnProperty.call(bF,dF)){di=f(dJ,bF[dF]);if(di.length){break}}}}dN=d(bm);du=dE.length?d(dE):"";if(dN.length&&!aV(dN)&&(!bu||!du.length||aV(du))){dE=bm}if(dE.length||dr.length){dq=dt;dD=[dr,di,dq,b1(dE.slice(0,dm))];dd(dA,JSON_PIWIK.stringify(dD),c4,bo,cW)}}dk+="&idsite="+b5+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+dj.getHours()+"&m="+dj.getMinutes()+"&s="+dj.getSeconds()+"&url="+t(b1(dJ))+(bm.length?"&urlref="+t(b1(bm)):"")+((bx&&bx.length)?"&uid="+t(bx):"")+"&_id="+dz.uuid+"&_idts="+dz.createTs+"&_idvc="+dz.visitCount+"&_idn="+dz.newVisitor+(dr.length?"&_rcn="+t(dr):"")+(di.length?"&_rck="+t(di):"")+"&_refts="+dq+"&_viewts="+dz.lastVisitTs+(String(dz.lastEcommerceOrderTs).length?"&_ects="+dz.lastEcommerceOrderTs:"")+(String(dE).length?"&_ref="+t(b1(dE.slice(0,dm))):"")+(dw?"&cs="+t(dw):"")+"&send_image=0"; -var dM=cF();for(dF in dM){if(Object.prototype.hasOwnProperty.call(dM,dF)){dk+="&"+dF+"="+dM[dF]}}var dL=[];if(dG){for(dF in dG){if(Object.prototype.hasOwnProperty.call(dG,dF)&&/^dimension\d+$/.test(dF)){var dp=dF.replace("dimension","");dL.push(parseInt(dp,10));dL.push(String(dp));dk+="&"+dF+"="+t(dG[dF]);delete dG[dF]}}}if(dG&&B(dG)){dG=null}for(dF in bl){if(Object.prototype.hasOwnProperty.call(bl,dF)){var dv=(-1===M(dL,dF));if(dv){dk+="&dimension"+dF+"="+t(bl[dF])}}}if(dG){dk+="&data="+t(JSON_PIWIK.stringify(dG))}else{if(ao){dk+="&data="+t(JSON_PIWIK.stringify(ao))}}function ds(dO,dP){var dQ=JSON_PIWIK.stringify(dO);if(dQ.length>2){return"&"+dP+"="+t(dQ)}return""}var dK=dh(bV);var dB=dh(cl);dk+=ds(dK,"cvar");dk+=ds(dB,"e_cvar");if(aQ){dk+=ds(aQ,"_cvar");for(dF in dC){if(Object.prototype.hasOwnProperty.call(dC,dF)){if(aQ[dF][0]===""||aQ[dF][1]===""){delete aQ[dF]}}}if(bP){dd(dx,JSON_PIWIK.stringify(aQ),co,bo,cW)}}if(a2){if(cm){dk+=">_ms="+cm}else{if(i&&i.timing&&i.timing.requestStart&&i.timing.responseEnd){dk+=">_ms="+(i.timing.responseEnd-i.timing.requestStart) -}}}if(aK){dk+="&pv_id="+aK}dz.lastEcommerceOrderTs=J(dl)&&String(dl).length?dl:dz.lastEcommerceOrderTs;aL(dz);cc();dk+=ac(dH,{tracker:bH,request:dk});if(cY.length){dk+="&"+cY}if(A(ca)){dk=ca(dk)}return dk}bQ=function a7(){var di=new Date();di=di.getTime();if(!cX){return false}if((cX+(1000*c6))<=di){return false}if(cX+a5<=di){bH.ping();return true}return false};function bp(dl,dk,dr,dm,di,du){var dp="idgoal=0",dq,dj=new Date(),ds=[],dt,dn=String(dl).length;if(dn){dp+="&ec_id="+t(dl);dq=Math.round(dj.getTime()/1000)}dp+="&revenue="+dk;if(String(dr).length){dp+="&ec_st="+dr}if(String(dm).length){dp+="&ec_tx="+dm}if(String(di).length){dp+="&ec_sh="+di}if(String(du).length){dp+="&ec_dt="+du}if(cZ){for(dt in cZ){if(Object.prototype.hasOwnProperty.call(cZ,dt)){if(!J(cZ[dt][1])){cZ[dt][1]=""}if(!J(cZ[dt][2])){cZ[dt][2]=""}if(!J(cZ[dt][3])||String(cZ[dt][3]).length===0){cZ[dt][3]=0}if(!J(cZ[dt][4])||String(cZ[dt][4]).length===0){cZ[dt][4]=1}ds.push(cZ[dt])}}dp+="&ec_items="+t(JSON_PIWIK.stringify(ds)) +}if(A(T.GearsFactory)){c7.gears="1"}c7.cookie=b4()}var dk=parseInt(X.width,10);var di=parseInt(X.height,10);c7.res=parseInt(dk,10)+"x"+parseInt(di,10);return c7}function bW(){var dj=aT("cvar"),di=aC(dj);if(di.length){di=T.JSON.parse(di);if(W(di)){return di}}return{}}function cC(){if(aQ===false){aQ=bW()}}function cP(){var di=cF();return b6((h.userAgent||"")+(h.platform||"")+T.JSON.stringify(di)+(new Date()).getTime()+Math.random()).slice(0,16)}function az(){var di=cF();return b6((h.userAgent||"")+(h.platform||"")+T.JSON.stringify(di)).slice(0,6)}function bf(){return Math.floor((new Date()).getTime()/1000)}function aI(){var dj=bf();var dk=az();var di=String(dj)+dk;return di}function c1(dk){dk=String(dk);var dn=az();var dl=dn.length;var dm=dk.substr(-1*dl,dl);var dj=parseInt(dk.substr(0,dk.length-dl),10);if(dj&&dm&&dm===dn){var di=bf();if(aZ<=0){return true}if(di>=dj&&di<=(dj+aZ)){return true}}return false}function dg(di){if(!cL){return""}var dm=f(di,av);if(!dm){return""}dm=String(dm);var dk=new RegExp("^[a-zA-Z0-9]+$"); +if(dm.length===32&&dk.test(dm)){var dj=dm.substr(16,32);if(c1(dj)){var dl=dm.substr(0,16);return dl}}return""}function cM(){if(!bN){bN=dg(bM)}var dk=new Date(),di=Math.round(dk.getTime()/1000),dj=aT("id"),dn=aC(dj),dm,dl;if(dn){dm=dn.split(".");dm.unshift("0");if(bN.length){dm[1]=bN}return dm}if(bN.length){dl=bN}else{if("0"===b4()){dl=""}else{dl=cP()}}dm=["1",dl,di,0,di,"",""];return dm}function aY(){var dq=cM(),dl=dq[0],dm=dq[1],dj=dq[2],di=dq[3],dn=dq[4],dk=dq[5];if(!J(dq[6])){dq[6]=""}var dp=dq[6];return{newVisitor:dl,uuid:dm,createTs:dj,visitCount:di,currentVisitTs:dn,lastVisitTs:dk,lastEcommerceOrderTs:dp}}function aG(){var dl=new Date(),dj=dl.getTime(),dm=aY().createTs;var di=parseInt(dm,10);var dk=(di*1000)+cH-dj;return dk}function aL(di){if(!b5){return}var dk=new Date(),dj=Math.round(dk.getTime()/1000);if(!J(di)){di=aY()}var dl=di.uuid+"."+di.createTs+"."+di.visitCount+"."+dj+"."+di.lastVisitTs+"."+di.lastEcommerceOrderTs;dd(aT("id"),dl,aG(),bo,cW,bR)}function bL(){var di=aC(aT("ref")); +if(di.length){try{di=T.JSON.parse(di);if(W(di)){return di}}catch(dj){}}return["","",0,""]}function bv(dj){var di="testvalue";dd("test",di,10000,null,dj);if(aC("test")===di){bX("test",null,dj);return true}return false}function aE(){var dj=bk;bk=false;var di,dk;for(di=0;didI){dz.visitCount++;dz.lastVisitTs=dz.currentVisitTs}if(!bu||!dr.length){for(dF in cq){if(Object.prototype.hasOwnProperty.call(cq,dF)){dr=f(dJ,cq[dF]);if(dr.length){break}}}for(dF in bF){if(Object.prototype.hasOwnProperty.call(bF,dF)){di=f(dJ,bF[dF]);if(di.length){break}}}}dN=d(bm);du=dE.length?d(dE):"";if(dN.length&&!aV(dN)&&(!bu||!du.length||aV(du))){dE=bm}if(dE.length||dr.length){dq=dt;dD=[dr,di,dq,b1(dE.slice(0,dm))];dd(dA,T.JSON.stringify(dD),c4,bo,cW)}}dk+="&idsite="+b5+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+dj.getHours()+"&m="+dj.getMinutes()+"&s="+dj.getSeconds()+"&url="+t(b1(dJ))+(bm.length?"&urlref="+t(b1(bm)):"")+((bx&&bx.length)?"&uid="+t(bx):"")+"&_id="+dz.uuid+"&_idts="+dz.createTs+"&_idvc="+dz.visitCount+"&_idn="+dz.newVisitor+(dr.length?"&_rcn="+t(dr):"")+(di.length?"&_rck="+t(di):"")+"&_refts="+dq+"&_viewts="+dz.lastVisitTs+(String(dz.lastEcommerceOrderTs).length?"&_ects="+dz.lastEcommerceOrderTs:"")+(String(dE).length?"&_ref="+t(b1(dE.slice(0,dm))):"")+(dw?"&cs="+t(dw):"")+"&send_image=0"; +var dM=cF();for(dF in dM){if(Object.prototype.hasOwnProperty.call(dM,dF)){dk+="&"+dF+"="+dM[dF]}}var dL=[];if(dG){for(dF in dG){if(Object.prototype.hasOwnProperty.call(dG,dF)&&/^dimension\d+$/.test(dF)){var dp=dF.replace("dimension","");dL.push(parseInt(dp,10));dL.push(String(dp));dk+="&"+dF+"="+t(dG[dF]);delete dG[dF]}}}if(dG&&B(dG)){dG=null}for(dF in bl){if(Object.prototype.hasOwnProperty.call(bl,dF)){var dv=(-1===M(dL,dF));if(dv){dk+="&dimension"+dF+"="+t(bl[dF])}}}if(dG){dk+="&data="+t(T.JSON.stringify(dG))}else{if(ao){dk+="&data="+t(T.JSON.stringify(ao))}}function ds(dO,dP){var dQ=T.JSON.stringify(dO);if(dQ.length>2){return"&"+dP+"="+t(dQ)}return""}var dK=dh(bV);var dB=dh(cl);dk+=ds(dK,"cvar");dk+=ds(dB,"e_cvar");if(aQ){dk+=ds(aQ,"_cvar");for(dF in dC){if(Object.prototype.hasOwnProperty.call(dC,dF)){if(aQ[dF][0]===""||aQ[dF][1]===""){delete aQ[dF]}}}if(bP){dd(dx,T.JSON.stringify(aQ),co,bo,cW)}}if(a2){if(cm){dk+=">_ms="+cm}else{if(i&&i.timing&&i.timing.requestStart&&i.timing.responseEnd){dk+=">_ms="+(i.timing.responseEnd-i.timing.requestStart) +}}}if(aK){dk+="&pv_id="+aK}dz.lastEcommerceOrderTs=J(dl)&&String(dl).length?dl:dz.lastEcommerceOrderTs;aL(dz);cc();dk+=ac(dH,{tracker:bH,request:dk});if(cY.length){dk+="&"+cY}if(A(ca)){dk=ca(dk)}return dk}bQ=function a7(){var di=new Date();di=di.getTime();if(!cX){return false}if((cX+(1000*c6))<=di){return false}if(cX+a5<=di){bH.ping();return true}return false};function bp(dl,dk,dr,dm,di,du){var dp="idgoal=0",dq,dj=new Date(),ds=[],dt,dn=String(dl).length;if(dn){dp+="&ec_id="+t(dl);dq=Math.round(dj.getTime()/1000)}dp+="&revenue="+dk;if(String(dr).length){dp+="&ec_st="+dr}if(String(dm).length){dp+="&ec_tx="+dm}if(String(di).length){dp+="&ec_sh="+di}if(String(du).length){dp+="&ec_dt="+du}if(cZ){for(dt in cZ){if(Object.prototype.hasOwnProperty.call(cZ,dt)){if(!J(cZ[dt][1])){cZ[dt][1]=""}if(!J(cZ[dt][2])){cZ[dt][2]=""}if(!J(cZ[dt][3])||String(cZ[dt][3]).length===0){cZ[dt][3]=0}if(!J(cZ[dt][4])||String(cZ[dt][4]).length===0){cZ[dt][4]=1}ds.push(cZ[dt])}}dp+="&ec_items="+t(T.JSON.stringify(ds)) }dp=cs(dp,ao,"ecommerce",dq);bE(dp,bI);if(dn){cZ={}}}function bY(di,dm,dl,dk,dj,dn){if(String(di).length&&J(dm)){bp(di,dm,dl,dk,dj,dn)}}function br(di){if(J(di)){bp("",di,"","","","")}}function bZ(dj,dl,dk){aK=bg();var di=cs("action_name="+t(al(dj||bi)),dl,"log");bE(di,bI,dk)}function a0(dk,dj){var dl,di="(^| )(piwik[_-]"+dj;if(dk){for(dl=0;dl1&&ap!=="addTracker"){ak("The method "+ap+' is registered more than once in "_paq" variable. Only the last call has an effect. Please have a look at the multiple Piwik trackers documentation: https://developer.piwik.org/guides/tracking-javascript-guide#multiple-piwik-trackers')}av[ap]++}}}}return au}var C=["addTracker","disableCookies","setTrackerUrl","setAPIUrl","enableCrossDomainLinking","setCrossDomainLinkingTimeout","setSessionCookieTimeout","setVisitorCookieTimeout","setSecureCookie","setCookiePath","setCookieDomain","setDomains","setUserId","setSiteId","alwaysUseSendBeacon","enableLinkTracking","requireConsent","setConsentGiven"];function ad(ao,aq){var ap=new Q(ao,aq);I.push(ap);_paq=c(_paq,C);for(E=0;E<_paq.length;E++){if(_paq[E]){af(_paq[E])}}_paq=new H();e.trigger("TrackerAdded",[ap]);return ap}an(T,"beforeunload",ai,false);window.addEventListener("message",function(au){if(!au||!au.origin){return}var aw,ar,ap;var ax=d(au.origin);var at=e.getAsyncTrackers();for(ar=0;ar