﻿if (!this.JSON) this.JSON = {}; (function () { function a(f) { return f < 10 ? "0" + f : f } function c(f) { o.lastIndex = 0; return o.test(f) ? '"' + f.replace(o, function (k) { var g = s[k]; return typeof g === "string" ? g : "\\u" + ("0000" + k.charCodeAt(0).toString(16)).slice(-4) }) + '"' : '"' + f + '"' } function b(f, k) { var g, j, n, r, p = i, l, d = k[f]; if (d && typeof d === "object" && typeof d.toJSON === "function") d = d.toJSON(f); if (typeof m === "function") d = m.call(k, f, d); switch (typeof d) { case "string": return c(d); case "number": return isFinite(d) ? String(d) : "null"; case "boolean": case "null": return String(d); case "object": if (!d) return "null"; i += q; l = []; if (Object.prototype.toString.apply(d) === "[object Array]") { r = d.length; for (g = 0; g < r; g += 1) l[g] = b(g, d) || "null"; n = l.length === 0 ? "[]" : i ? "[\n" + i + l.join(",\n" + i) + "\n" + p + "]" : "[" + l.join(",") + "]"; i = p; return n } if (m && typeof m === "object") { r = m.length; for (g = 0; g < r; g += 1) { j = m[g]; if (typeof j === "string") if (n = b(j, d)) l.push(c(j) + (i ? ": " : ":") + n) } } else for (j in d) if (Object.hasOwnProperty.call(d, j)) if (n = b(j, d)) l.push(c(j) + (i ? ": " : ":") + n); n = l.length === 0 ? "{}" : i ? "{\n" + i + l.join(",\n" + i) + "\n" + p + "}" : "{" + l.join(",") + "}"; i = p; return n } } if (typeof Date.prototype.toJSON !== "function") { Date.prototype.toJSON = function () { return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + a(this.getUTCMonth() + 1) + "-" + a(this.getUTCDate()) + "T" + a(this.getUTCHours()) + ":" + a(this.getUTCMinutes()) + ":" + a(this.getUTCSeconds()) + "Z" : null }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () { return this.valueOf() } } var h = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, o = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, i, q, s = { "\u0008": "\\b", "\t": "\\t", "\n": "\\n", "\u000c": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }, m; if (typeof JSON.stringify !== "function") JSON.stringify = function (f, k, g) { var j; q = i = ""; if (typeof g === "number") for (j = 0; j < g; j += 1) q += " "; else if (typeof g === "string") q = g; if ((m = k) && typeof k !== "function" && (typeof k !== "object" || typeof k.length !== "number")) throw Error("JSON.stringify"); return b("", { "": f }) }; if (typeof JSON.parse !== "function") JSON.parse = function (f, k) { function g(n, r) { var p, l, d = n[r]; if (d && typeof d === "object") for (p in d) if (Object.hasOwnProperty.call(d, p)) { l = g(d, p); if (l !== undefined) d[p] = l; else delete d[p] } return k.call(n, r, d) } var j; f = String(f); h.lastIndex = 0; if (h.test(f)) f = f.replace(h, function (n) { return "\\u" + ("0000" + n.charCodeAt(0).toString(16)).slice(-4) }); if (/^[\],:{}\s]*$/.test(f.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { j = eval("(" + f + ")"); return typeof k === "function" ? g({ "": j }, "") : j } throw new SyntaxError("JSON.parse"); } })();
