| (function(){var COMPILED = !0, goog = goog || {}; |
| goog.global = this; |
| goog.isDef = function(a) { |
| return void 0 !== a; |
| }; |
| goog.exportPath_ = function(a, b, c) { |
| a = a.split("."); |
| c = c || goog.global; |
| a[0] in c || !c.execScript || c.execScript("var " + a[0]); |
| for (var d;a.length && (d = a.shift());) { |
| !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {}; |
| } |
| }; |
| goog.define = function(a, b) { |
| var c = b; |
| COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a])); |
| goog.exportPath_(a, c); |
| }; |
| goog.DEBUG = !0; |
| goog.LOCALE = "en"; |
| goog.TRUSTED_SITE = !0; |
| goog.STRICT_MODE_COMPATIBLE = !1; |
| goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG; |
| goog.provide = function(a) { |
| if (!COMPILED && goog.isProvided_(a)) { |
| throw Error('Namespace "' + a + '" already declared.'); |
| } |
| goog.constructNamespace_(a); |
| }; |
| goog.constructNamespace_ = function(a, b) { |
| if (!COMPILED) { |
| delete goog.implicitNamespaces_[a]; |
| for (var c = a;(c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectByName(c);) { |
| goog.implicitNamespaces_[c] = !0; |
| } |
| } |
| goog.exportPath_(a, b); |
| }; |
| goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/; |
| goog.module = function(a) { |
| if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) { |
| throw Error("Invalid module identifier"); |
| } |
| if (!goog.isInModuleLoader_()) { |
| throw Error("Module " + a + " has been loaded incorrectly."); |
| } |
| if (goog.moduleLoaderState_.moduleName) { |
| throw Error("goog.module may only be called once per module."); |
| } |
| goog.moduleLoaderState_.moduleName = a; |
| if (!COMPILED) { |
| if (goog.isProvided_(a)) { |
| throw Error('Namespace "' + a + '" already declared.'); |
| } |
| delete goog.implicitNamespaces_[a]; |
| } |
| }; |
| goog.module.get = function(a) { |
| return goog.module.getInternal_(a); |
| }; |
| goog.module.getInternal_ = function(a) { |
| if (!COMPILED) { |
| return goog.isProvided_(a) ? a in goog.loadedModules_ ? goog.loadedModules_[a] : goog.getObjectByName(a) : null; |
| } |
| }; |
| goog.moduleLoaderState_ = null; |
| goog.isInModuleLoader_ = function() { |
| return null != goog.moduleLoaderState_; |
| }; |
| goog.module.declareTestMethods = function() { |
| if (!goog.isInModuleLoader_()) { |
| throw Error("goog.module.declareTestMethods must be called from within a goog.module"); |
| } |
| goog.moduleLoaderState_.declareTestMethods = !0; |
| }; |
| goog.module.declareLegacyNamespace = function() { |
| if (!COMPILED && !goog.isInModuleLoader_()) { |
| throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module"); |
| } |
| if (!COMPILED && !goog.moduleLoaderState_.moduleName) { |
| throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace."); |
| } |
| goog.moduleLoaderState_.declareLegacyNamespace = !0; |
| }; |
| goog.setTestOnly = function(a) { |
| if (goog.DISALLOW_TEST_ONLY_CODE) { |
| throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : ".")); |
| } |
| }; |
| goog.forwardDeclare = function(a) { |
| }; |
| COMPILED || (goog.isProvided_ = function(a) { |
| return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a)); |
| }, goog.implicitNamespaces_ = {"goog.module":!0}); |
| goog.getObjectByName = function(a, b) { |
| for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) { |
| if (goog.isDefAndNotNull(d[e])) { |
| d = d[e]; |
| } else { |
| return null; |
| } |
| } |
| return d; |
| }; |
| goog.globalize = function(a, b) { |
| var c = b || goog.global, d; |
| for (d in a) { |
| c[d] = a[d]; |
| } |
| }; |
| goog.addDependency = function(a, b, c, d) { |
| if (goog.DEPENDENCIES_ENABLED) { |
| var e; |
| a = a.replace(/\\/g, "/"); |
| for (var f = goog.dependencies_, g = 0;e = b[g];g++) { |
| f.nameToPath[e] = a, f.pathIsModule[a] = !!d; |
| } |
| for (d = 0;b = c[d];d++) { |
| a in f.requires || (f.requires[a] = {}), f.requires[a][b] = !0; |
| } |
| } |
| }; |
| goog.ENABLE_DEBUG_LOADER = !0; |
| goog.logToConsole_ = function(a) { |
| goog.global.console && goog.global.console.error(a); |
| }; |
| goog.require = function(a) { |
| if (!COMPILED) { |
| goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_ && goog.maybeProcessDeferredDep_(a); |
| if (goog.isProvided_(a)) { |
| return goog.isInModuleLoader_() ? goog.module.getInternal_(a) : null; |
| } |
| if (goog.ENABLE_DEBUG_LOADER) { |
| var b = goog.getPathFromDeps_(a); |
| if (b) { |
| return goog.included_[b] = !0, goog.writeScripts_(), null; |
| } |
| } |
| a = "goog.require could not find: " + a; |
| goog.logToConsole_(a); |
| throw Error(a); |
| } |
| }; |
| goog.basePath = ""; |
| goog.nullFunction = function() { |
| }; |
| goog.identityFunction = function(a, b) { |
| return a; |
| }; |
| goog.abstractMethod = function() { |
| throw Error("unimplemented abstract method"); |
| }; |
| goog.addSingletonGetter = function(a) { |
| a.getInstance = function() { |
| if (a.instance_) { |
| return a.instance_; |
| } |
| goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); |
| return a.instance_ = new a; |
| }; |
| }; |
| goog.instantiatedSingletons_ = []; |
| goog.LOAD_MODULE_USING_EVAL = !0; |
| goog.SEAL_MODULE_EXPORTS = goog.DEBUG; |
| goog.loadedModules_ = {}; |
| goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER; |
| goog.DEPENDENCIES_ENABLED && (goog.included_ = {}, goog.dependencies_ = {pathIsModule:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() { |
| var a = goog.global.document; |
| return "undefined" != typeof a && "write" in a; |
| }, goog.findBasePath_ = function() { |
| if (goog.global.CLOSURE_BASE_PATH) { |
| goog.basePath = goog.global.CLOSURE_BASE_PATH; |
| } else { |
| if (goog.inHtmlDocument_()) { |
| for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1;0 <= b;--b) { |
| var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d; |
| if ("base.js" == c.substr(d - 7, 7)) { |
| goog.basePath = c.substr(0, d - 7); |
| break; |
| } |
| } |
| } |
| } |
| }, goog.importScript_ = function(a, b) { |
| (goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dependencies_.written[a] = !0); |
| }, goog.IS_OLD_IE_ = !goog.global.atob && goog.global.document && goog.global.document.all, goog.importModule_ = function(a) { |
| goog.importScript_("", 'goog.retrieveAndExecModule_("' + a + '");') && (goog.dependencies_.written[a] = !0); |
| }, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) { |
| return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loadModule(" + goog.global.JSON.stringify(b + "\n//# sourceURL=" + a + "\n") + ");" : 'goog.loadModule(function(exports) {"use strict";' + b + "\n;return exports});\n//# sourceURL=" + a + "\n"; |
| }, goog.loadQueuedModules_ = function() { |
| var a = goog.queuedModules_.length; |
| if (0 < a) { |
| var b = goog.queuedModules_; |
| goog.queuedModules_ = []; |
| for (var c = 0;c < a;c++) { |
| goog.maybeProcessDeferredPath_(b[c]); |
| } |
| } |
| }, goog.maybeProcessDeferredDep_ = function(a) { |
| goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPathFromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a)); |
| }, goog.isDeferredModule_ = function(a) { |
| return (a = goog.getPathFromDeps_(a)) && goog.dependencies_.pathIsModule[a] ? goog.basePath + a in goog.dependencies_.deferred : !1; |
| }, goog.allDepsAreAvailable_ = function(a) { |
| if ((a = goog.getPathFromDeps_(a)) && a in goog.dependencies_.requires) { |
| for (var b in goog.dependencies_.requires[a]) { |
| if (!goog.isProvided_(b) && !goog.isDeferredModule_(b)) { |
| return !1; |
| } |
| } |
| } |
| return !0; |
| }, goog.maybeProcessDeferredPath_ = function(a) { |
| if (a in goog.dependencies_.deferred) { |
| var b = goog.dependencies_.deferred[a]; |
| delete goog.dependencies_.deferred[a]; |
| goog.globalEval(b); |
| } |
| }, goog.loadModule = function(a) { |
| var b = goog.moduleLoaderState_; |
| try { |
| goog.moduleLoaderState_ = {moduleName:void 0, declareTestMethods:!1}; |
| var c; |
| if (goog.isFunction(a)) { |
| c = a.call(goog.global, {}); |
| } else { |
| if (goog.isString(a)) { |
| c = goog.loadModuleFromSource_.call(goog.global, a); |
| } else { |
| throw Error("Invalid module definition"); |
| } |
| } |
| var d = goog.moduleLoaderState_.moduleName; |
| if (!goog.isString(d) || !d) { |
| throw Error('Invalid module name "' + d + '"'); |
| } |
| goog.moduleLoaderState_.declareLegacyNamespace ? goog.constructNamespace_(d, c) : goog.SEAL_MODULE_EXPORTS && Object.seal && Object.seal(c); |
| goog.loadedModules_[d] = c; |
| if (goog.moduleLoaderState_.declareTestMethods) { |
| for (var e in c) { |
| if (0 === e.indexOf("test", 0) || "tearDown" == e || "setUp" == e || "setUpPage" == e || "tearDownPage" == e) { |
| goog.global[e] = c[e]; |
| } |
| } |
| } |
| } finally { |
| goog.moduleLoaderState_ = b; |
| } |
| }, goog.loadModuleFromSource_ = function(a) { |
| eval(a); |
| return {}; |
| }, goog.writeScriptTag_ = function(a, b) { |
| if (goog.inHtmlDocument_()) { |
| var c = goog.global.document; |
| if ("complete" == c.readyState) { |
| if (/\bdeps.js$/.test(a)) { |
| return !1; |
| } |
| throw Error('Cannot write "' + a + '" after document load'); |
| } |
| var d = goog.IS_OLD_IE_; |
| void 0 === b ? d ? (d = " onreadystatechange='goog.onScriptLoad_(this, " + ++goog.lastNonModuleScriptIndex_ + ")' ", c.write('<script type="text/javascript" src="' + a + '"' + d + ">\x3c/script>")) : c.write('<script type="text/javascript" src="' + a + '">\x3c/script>') : c.write('<script type="text/javascript">' + b + "\x3c/script>"); |
| return !0; |
| } |
| return !1; |
| }, goog.lastNonModuleScriptIndex_ = 0, goog.onScriptLoad_ = function(a, b) { |
| "complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.loadQueuedModules_(); |
| return !0; |
| }, goog.writeScripts_ = function() { |
| function a(e) { |
| if (!(e in d.written)) { |
| if (!(e in d.visited) && (d.visited[e] = !0, e in d.requires)) { |
| for (var f in d.requires[e]) { |
| if (!goog.isProvided_(f)) { |
| if (f in d.nameToPath) { |
| a(d.nameToPath[f]); |
| } else { |
| throw Error("Undefined nameToPath for " + f); |
| } |
| } |
| } |
| } |
| e in c || (c[e] = !0, b.push(e)); |
| } |
| } |
| var b = [], c = {}, d = goog.dependencies_, e; |
| for (e in goog.included_) { |
| d.written[e] || a(e); |
| } |
| for (var f = 0;f < b.length;f++) { |
| e = b[f], goog.dependencies_.written[e] = !0; |
| } |
| var g = goog.moduleLoaderState_; |
| goog.moduleLoaderState_ = null; |
| for (f = 0;f < b.length;f++) { |
| if (e = b[f]) { |
| d.pathIsModule[e] ? goog.importModule_(goog.basePath + e) : goog.importScript_(goog.basePath + e); |
| } else { |
| throw goog.moduleLoaderState_ = g, Error("Undefined script input"); |
| } |
| } |
| goog.moduleLoaderState_ = g; |
| }, goog.getPathFromDeps_ = function(a) { |
| return a in goog.dependencies_.nameToPath ? goog.dependencies_.nameToPath[a] : null; |
| }, goog.findBasePath_(), goog.global.CLOSURE_NO_DEPS || goog.importScript_(goog.basePath + "deps.js")); |
| goog.normalizePath_ = function(a) { |
| a = a.split("/"); |
| for (var b = 0;b < a.length;) { |
| "." == a[b] ? a.splice(b, 1) : b && ".." == a[b] && a[b - 1] && ".." != a[b - 1] ? a.splice(--b, 2) : b++; |
| } |
| return a.join("/"); |
| }; |
| goog.retrieveAndExecModule_ = function(a) { |
| if (!COMPILED) { |
| var b = a; |
| a = goog.normalizePath_(a); |
| var c = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, d = null, e = new goog.global.XMLHttpRequest; |
| e.onload = function() { |
| d = this.responseText; |
| }; |
| e.open("get", a, !1); |
| e.send(); |
| d = e.responseText; |
| if (null != d) { |
| e = goog.wrapModule_(a, d), goog.IS_OLD_IE_ ? (goog.dependencies_.deferred[b] = e, goog.queuedModules_.push(b)) : c(a, e); |
| } else { |
| throw Error("load of " + a + "failed"); |
| } |
| } |
| }; |
| goog.typeOf = function(a) { |
| var b = typeof a; |
| if ("object" == b) { |
| if (a) { |
| if (a instanceof Array) { |
| return "array"; |
| } |
| if (a instanceof Object) { |
| return b; |
| } |
| var c = Object.prototype.toString.call(a); |
| if ("[object Window]" == c) { |
| return "object"; |
| } |
| if ("[object Array]" == c || "number" == typeof a.length && "undefined" != typeof a.splice && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("splice")) { |
| return "array"; |
| } |
| if ("[object Function]" == c || "undefined" != typeof a.call && "undefined" != typeof a.propertyIsEnumerable && !a.propertyIsEnumerable("call")) { |
| return "function"; |
| } |
| } else { |
| return "null"; |
| } |
| } else { |
| if ("function" == b && "undefined" == typeof a.call) { |
| return "object"; |
| } |
| } |
| return b; |
| }; |
| goog.isNull = function(a) { |
| return null === a; |
| }; |
| goog.isDefAndNotNull = function(a) { |
| return null != a; |
| }; |
| goog.isArray = function(a) { |
| return "array" == goog.typeOf(a); |
| }; |
| goog.isArrayLike = function(a) { |
| var b = goog.typeOf(a); |
| return "array" == b || "object" == b && "number" == typeof a.length; |
| }; |
| goog.isDateLike = function(a) { |
| return goog.isObject(a) && "function" == typeof a.getFullYear; |
| }; |
| goog.isString = function(a) { |
| return "string" == typeof a; |
| }; |
| goog.isBoolean = function(a) { |
| return "boolean" == typeof a; |
| }; |
| goog.isNumber = function(a) { |
| return "number" == typeof a; |
| }; |
| goog.isFunction = function(a) { |
| return "function" == goog.typeOf(a); |
| }; |
| goog.isObject = function(a) { |
| var b = typeof a; |
| return "object" == b && null != a || "function" == b; |
| }; |
| goog.getUid = function(a) { |
| return a[goog.UID_PROPERTY_] || (a[goog.UID_PROPERTY_] = ++goog.uidCounter_); |
| }; |
| goog.hasUid = function(a) { |
| return !!a[goog.UID_PROPERTY_]; |
| }; |
| goog.removeUid = function(a) { |
| "removeAttribute" in a && a.removeAttribute(goog.UID_PROPERTY_); |
| try { |
| delete a[goog.UID_PROPERTY_]; |
| } catch (b) { |
| } |
| }; |
| goog.UID_PROPERTY_ = "closure_uid_" + (1E9 * Math.random() >>> 0); |
| goog.uidCounter_ = 0; |
| goog.getHashCode = goog.getUid; |
| goog.removeHashCode = goog.removeUid; |
| goog.cloneObject = function(a) { |
| var b = goog.typeOf(a); |
| if ("object" == b || "array" == b) { |
| if (a.clone) { |
| return a.clone(); |
| } |
| var b = "array" == b ? [] : {}, c; |
| for (c in a) { |
| b[c] = goog.cloneObject(a[c]); |
| } |
| return b; |
| } |
| return a; |
| }; |
| goog.bindNative_ = function(a, b, c) { |
| return a.call.apply(a.bind, arguments); |
| }; |
| goog.bindJs_ = function(a, b, c) { |
| if (!a) { |
| throw Error(); |
| } |
| if (2 < arguments.length) { |
| var d = Array.prototype.slice.call(arguments, 2); |
| return function() { |
| var c = Array.prototype.slice.call(arguments); |
| Array.prototype.unshift.apply(c, d); |
| return a.apply(b, c); |
| }; |
| } |
| return function() { |
| return a.apply(b, arguments); |
| }; |
| }; |
| goog.bind = function(a, b, c) { |
| Function.prototype.bind && -1 != Function.prototype.bind.toString().indexOf("native code") ? goog.bind = goog.bindNative_ : goog.bind = goog.bindJs_; |
| return goog.bind.apply(null, arguments); |
| }; |
| goog.partial = function(a, b) { |
| var c = Array.prototype.slice.call(arguments, 1); |
| return function() { |
| var b = c.slice(); |
| b.push.apply(b, arguments); |
| return a.apply(this, b); |
| }; |
| }; |
| goog.mixin = function(a, b) { |
| for (var c in b) { |
| a[c] = b[c]; |
| } |
| }; |
| goog.now = goog.TRUSTED_SITE && Date.now || function() { |
| return +new Date; |
| }; |
| goog.globalEval = function(a) { |
| if (goog.global.execScript) { |
| goog.global.execScript(a, "JavaScript"); |
| } else { |
| if (goog.global.eval) { |
| if (null == goog.evalWorksForGlobals_ && (goog.global.eval("var _et_ = 1;"), "undefined" != typeof goog.global._et_ ? (delete goog.global._et_, goog.evalWorksForGlobals_ = !0) : goog.evalWorksForGlobals_ = !1), goog.evalWorksForGlobals_) { |
| goog.global.eval(a); |
| } else { |
| var b = goog.global.document, c = b.createElement("script"); |
| c.type = "text/javascript"; |
| c.defer = !1; |
| c.appendChild(b.createTextNode(a)); |
| b.body.appendChild(c); |
| b.body.removeChild(c); |
| } |
| } else { |
| throw Error("goog.globalEval not available"); |
| } |
| } |
| }; |
| goog.evalWorksForGlobals_ = null; |
| goog.getCssName = function(a, b) { |
| var c = function(a) { |
| return goog.cssNameMapping_[a] || a; |
| }, d = function(a) { |
| a = a.split("-"); |
| for (var b = [], d = 0;d < a.length;d++) { |
| b.push(c(a[d])); |
| } |
| return b.join("-"); |
| }, d = goog.cssNameMapping_ ? "BY_WHOLE" == goog.cssNameMappingStyle_ ? c : d : function(a) { |
| return a; |
| }; |
| return b ? a + "-" + d(b) : d(a); |
| }; |
| goog.setCssNameMapping = function(a, b) { |
| goog.cssNameMapping_ = a; |
| goog.cssNameMappingStyle_ = b; |
| }; |
| !COMPILED && goog.global.CLOSURE_CSS_NAME_MAPPING && (goog.cssNameMapping_ = goog.global.CLOSURE_CSS_NAME_MAPPING); |
| goog.getMsg = function(a, b) { |
| b && (a = a.replace(/\{\$([^}]+)}/g, function(a, d) { |
| return d in b ? b[d] : a; |
| })); |
| return a; |
| }; |
| goog.getMsgWithFallback = function(a, b) { |
| return a; |
| }; |
| goog.exportSymbol = function(a, b, c) { |
| goog.exportPath_(a, b, c); |
| }; |
| goog.exportProperty = function(a, b, c) { |
| a[b] = c; |
| }; |
| goog.inherits = function(a, b) { |
| function c() { |
| } |
| c.prototype = b.prototype; |
| a.superClass_ = b.prototype; |
| a.prototype = new c; |
| a.prototype.constructor = a; |
| a.base = function(a, c, f) { |
| for (var g = Array(arguments.length - 2), h = 2;h < arguments.length;h++) { |
| g[h - 2] = arguments[h]; |
| } |
| return b.prototype[c].apply(a, g); |
| }; |
| }; |
| goog.base = function(a, b, c) { |
| var d = arguments.callee.caller; |
| if (goog.STRICT_MODE_COMPATIBLE || goog.DEBUG && !d) { |
| throw Error("arguments.caller not defined. goog.base() cannot be used with strict mode code. See http://www.ecma-international.org/ecma-262/5.1/#sec-C"); |
| } |
| if (d.superClass_) { |
| for (var e = Array(arguments.length - 1), f = 1;f < arguments.length;f++) { |
| e[f - 1] = arguments[f]; |
| } |
| return d.superClass_.constructor.apply(a, e); |
| } |
| e = Array(arguments.length - 2); |
| for (f = 2;f < arguments.length;f++) { |
| e[f - 2] = arguments[f]; |
| } |
| for (var f = !1, g = a.constructor;g;g = g.superClass_ && g.superClass_.constructor) { |
| if (g.prototype[b] === d) { |
| f = !0; |
| } else { |
| if (f) { |
| return g.prototype[b].apply(a, e); |
| } |
| } |
| } |
| if (a[b] === d) { |
| return a.constructor.prototype[b].apply(a, e); |
| } |
| throw Error("goog.base called from a method of one name to a method of a different name"); |
| }; |
| goog.scope = function(a) { |
| a.call(goog.global); |
| }; |
| COMPILED || (goog.global.COMPILED = COMPILED); |
| goog.defineClass = function(a, b) { |
| var c = b.constructor, d = b.statics; |
| c && c != Object.prototype.constructor || (c = function() { |
| throw Error("cannot instantiate an interface (no constructor defined)."); |
| }); |
| c = goog.defineClass.createSealingConstructor_(c, a); |
| a && goog.inherits(c, a); |
| delete b.constructor; |
| delete b.statics; |
| goog.defineClass.applyProperties_(c.prototype, b); |
| null != d && (d instanceof Function ? d(c) : goog.defineClass.applyProperties_(c, d)); |
| return c; |
| }; |
| goog.defineClass.SEAL_CLASS_INSTANCES = goog.DEBUG; |
| goog.defineClass.createSealingConstructor_ = function(a, b) { |
| if (goog.defineClass.SEAL_CLASS_INSTANCES && Object.seal instanceof Function) { |
| if (b && b.prototype && b.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_]) { |
| return a; |
| } |
| var c = function() { |
| var b = a.apply(this, arguments) || this; |
| b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_]; |
| this.constructor === c && Object.seal(b); |
| return b; |
| }; |
| return c; |
| } |
| return a; |
| }; |
| goog.defineClass.OBJECT_PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); |
| goog.defineClass.applyProperties_ = function(a, b) { |
| for (var c in b) { |
| Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); |
| } |
| for (var d = 0;d < goog.defineClass.OBJECT_PROTOTYPE_FIELDS_.length;d++) { |
| c = goog.defineClass.OBJECT_PROTOTYPE_FIELDS_[d], Object.prototype.hasOwnProperty.call(b, c) && (a[c] = b[c]); |
| } |
| }; |
| goog.tagUnsealableClass = function(a) { |
| !COMPILED && goog.defineClass.SEAL_CLASS_INSTANCES && (a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_] = !0); |
| }; |
| goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_ = "goog_defineClass_legacy_unsealable"; |
| goog.async = {}; |
| goog.async.FreeList = function(a, b, c) { |
| this.limit_ = c; |
| this.create_ = a; |
| this.reset_ = b; |
| this.occupants_ = 0; |
| this.head_ = null; |
| }; |
| goog.async.FreeList.prototype.get = function() { |
| var a; |
| 0 < this.occupants_ ? (this.occupants_--, a = this.head_, this.head_ = a.next, a.next = null) : a = this.create_(); |
| return a; |
| }; |
| goog.async.FreeList.prototype.put = function(a) { |
| this.reset_(a); |
| this.occupants_ < this.limit_ && (this.occupants_++, a.next = this.head_, this.head_ = a); |
| }; |
| goog.async.FreeList.prototype.occupants = function() { |
| return this.occupants_; |
| }; |
| goog.debug = {}; |
| goog.debug.Error = function(a) { |
| if (Error.captureStackTrace) { |
| Error.captureStackTrace(this, goog.debug.Error); |
| } else { |
| var b = Error().stack; |
| b && (this.stack = b); |
| } |
| a && (this.message = String(a)); |
| }; |
| goog.inherits(goog.debug.Error, Error); |
| goog.debug.Error.prototype.name = "CustomError"; |
| goog.debug.LogRecord = function(a, b, c, d, e) { |
| this.reset(a, b, c, d, e); |
| }; |
| goog.debug.LogRecord.prototype.sequenceNumber_ = 0; |
| goog.debug.LogRecord.prototype.exception_ = null; |
| goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS = !0; |
| goog.debug.LogRecord.nextSequenceNumber_ = 0; |
| goog.debug.LogRecord.prototype.reset = function(a, b, c, d, e) { |
| goog.debug.LogRecord.ENABLE_SEQUENCE_NUMBERS && (this.sequenceNumber_ = "number" == typeof e ? e : goog.debug.LogRecord.nextSequenceNumber_++); |
| this.time_ = d || goog.now(); |
| this.level_ = a; |
| this.msg_ = b; |
| this.loggerName_ = c; |
| delete this.exception_; |
| }; |
| goog.debug.LogRecord.prototype.getLoggerName = function() { |
| return this.loggerName_; |
| }; |
| goog.debug.LogRecord.prototype.getException = function() { |
| return this.exception_; |
| }; |
| goog.debug.LogRecord.prototype.setException = function(a) { |
| this.exception_ = a; |
| }; |
| goog.debug.LogRecord.prototype.setLoggerName = function(a) { |
| this.loggerName_ = a; |
| }; |
| goog.debug.LogRecord.prototype.getLevel = function() { |
| return this.level_; |
| }; |
| goog.debug.LogRecord.prototype.setLevel = function(a) { |
| this.level_ = a; |
| }; |
| goog.debug.LogRecord.prototype.getMessage = function() { |
| return this.msg_; |
| }; |
| goog.debug.LogRecord.prototype.setMessage = function(a) { |
| this.msg_ = a; |
| }; |
| goog.debug.LogRecord.prototype.getMillis = function() { |
| return this.time_; |
| }; |
| goog.debug.LogRecord.prototype.setMillis = function(a) { |
| this.time_ = a; |
| }; |
| goog.debug.LogRecord.prototype.getSequenceNumber = function() { |
| return this.sequenceNumber_; |
| }; |
| goog.disposable = {}; |
| goog.disposable.IDisposable = function() { |
| }; |
| goog.Disposable = function() { |
| goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF && (goog.Disposable.INCLUDE_STACK_ON_CREATION && (this.creationStack = Error().stack), goog.Disposable.instances_[goog.getUid(this)] = this); |
| this.disposed_ = this.disposed_; |
| this.onDisposeCallbacks_ = this.onDisposeCallbacks_; |
| }; |
| goog.Disposable.MonitoringMode = {OFF:0, PERMANENT:1, INTERACTIVE:2}; |
| goog.Disposable.MONITORING_MODE = 0; |
| goog.Disposable.INCLUDE_STACK_ON_CREATION = !0; |
| goog.Disposable.instances_ = {}; |
| goog.Disposable.getUndisposedObjects = function() { |
| var a = [], b; |
| for (b in goog.Disposable.instances_) { |
| goog.Disposable.instances_.hasOwnProperty(b) && a.push(goog.Disposable.instances_[Number(b)]); |
| } |
| return a; |
| }; |
| goog.Disposable.clearUndisposedObjects = function() { |
| goog.Disposable.instances_ = {}; |
| }; |
| goog.Disposable.prototype.disposed_ = !1; |
| goog.Disposable.prototype.isDisposed = function() { |
| return this.disposed_; |
| }; |
| goog.Disposable.prototype.getDisposed = goog.Disposable.prototype.isDisposed; |
| goog.Disposable.prototype.dispose = function() { |
| if (!this.disposed_ && (this.disposed_ = !0, this.disposeInternal(), goog.Disposable.MONITORING_MODE != goog.Disposable.MonitoringMode.OFF)) { |
| var a = goog.getUid(this); |
| if (goog.Disposable.MONITORING_MODE == goog.Disposable.MonitoringMode.PERMANENT && !goog.Disposable.instances_.hasOwnProperty(a)) { |
| throw Error(this + " did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call"); |
| } |
| delete goog.Disposable.instances_[a]; |
| } |
| }; |
| goog.Disposable.prototype.registerDisposable = function(a) { |
| this.addOnDisposeCallback(goog.partial(goog.dispose, a)); |
| }; |
| goog.Disposable.prototype.addOnDisposeCallback = function(a, b) { |
| this.disposed_ ? a.call(b) : (this.onDisposeCallbacks_ || (this.onDisposeCallbacks_ = []), this.onDisposeCallbacks_.push(goog.isDef(b) ? goog.bind(a, b) : a)); |
| }; |
| goog.Disposable.prototype.disposeInternal = function() { |
| if (this.onDisposeCallbacks_) { |
| for (;this.onDisposeCallbacks_.length;) { |
| this.onDisposeCallbacks_.shift()(); |
| } |
| } |
| }; |
| goog.Disposable.isDisposed = function(a) { |
| return a && "function" == typeof a.isDisposed ? a.isDisposed() : !1; |
| }; |
| goog.dispose = function(a) { |
| a && "function" == typeof a.dispose && a.dispose(); |
| }; |
| goog.disposeAll = function(a) { |
| for (var b = 0, c = arguments.length;b < c;++b) { |
| var d = arguments[b]; |
| goog.isArrayLike(d) ? goog.disposeAll.apply(null, d) : goog.dispose(d); |
| } |
| }; |
| goog.dom = {}; |
| goog.dom.NodeType = {ELEMENT:1, ATTRIBUTE:2, TEXT:3, CDATA_SECTION:4, ENTITY_REFERENCE:5, ENTITY:6, PROCESSING_INSTRUCTION:7, COMMENT:8, DOCUMENT:9, DOCUMENT_TYPE:10, DOCUMENT_FRAGMENT:11, NOTATION:12}; |
| goog.events = {}; |
| goog.events.EventId = function(a) { |
| this.id = a; |
| }; |
| goog.events.EventId.prototype.toString = function() { |
| return this.id; |
| }; |
| goog.events.Event = function(a, b) { |
| this.type = a instanceof goog.events.EventId ? String(a) : a; |
| this.currentTarget = this.target = b; |
| this.defaultPrevented = this.propagationStopped_ = !1; |
| this.returnValue_ = !0; |
| }; |
| goog.events.Event.prototype.stopPropagation = function() { |
| this.propagationStopped_ = !0; |
| }; |
| goog.events.Event.prototype.preventDefault = function() { |
| this.defaultPrevented = !0; |
| this.returnValue_ = !1; |
| }; |
| goog.events.Event.stopPropagation = function(a) { |
| a.stopPropagation(); |
| }; |
| goog.events.Event.preventDefault = function(a) { |
| a.preventDefault(); |
| }; |
| goog.events.Listenable = function() { |
| }; |
| goog.events.Listenable.IMPLEMENTED_BY_PROP = "closure_listenable_" + (1E6 * Math.random() | 0); |
| goog.events.Listenable.addImplementation = function(a) { |
| a.prototype[goog.events.Listenable.IMPLEMENTED_BY_PROP] = !0; |
| }; |
| goog.events.Listenable.isImplementedBy = function(a) { |
| return !(!a || !a[goog.events.Listenable.IMPLEMENTED_BY_PROP]); |
| }; |
| goog.events.ListenableKey = function() { |
| }; |
| goog.events.ListenableKey.counter_ = 0; |
| goog.events.ListenableKey.reserveKey = function() { |
| return ++goog.events.ListenableKey.counter_; |
| }; |
| goog.events.Listener = function(a, b, c, d, e, f) { |
| goog.events.Listener.ENABLE_MONITORING && (this.creationStack = Error().stack); |
| this.listener = a; |
| this.proxy = b; |
| this.src = c; |
| this.type = d; |
| this.capture = !!e; |
| this.handler = f; |
| this.key = goog.events.ListenableKey.reserveKey(); |
| this.removed = this.callOnce = !1; |
| }; |
| goog.events.Listener.ENABLE_MONITORING = !1; |
| goog.events.Listener.prototype.markAsRemoved = function() { |
| this.removed = !0; |
| this.handler = this.src = this.proxy = this.listener = null; |
| }; |
| goog.fs = {}; |
| goog.fs.url = {}; |
| goog.fs.url.createObjectUrl = function(a) { |
| return goog.fs.url.getUrlObject_().createObjectURL(a); |
| }; |
| goog.fs.url.revokeObjectUrl = function(a) { |
| goog.fs.url.getUrlObject_().revokeObjectURL(a); |
| }; |
| goog.fs.url.getUrlObject_ = function() { |
| var a = goog.fs.url.findUrlObject_(); |
| if (null != a) { |
| return a; |
| } |
| throw Error("This browser doesn't seem to support blob URLs"); |
| }; |
| goog.fs.url.findUrlObject_ = function() { |
| return goog.isDef(goog.global.URL) && goog.isDef(goog.global.URL.createObjectURL) ? goog.global.URL : goog.isDef(goog.global.webkitURL) && goog.isDef(goog.global.webkitURL.createObjectURL) ? goog.global.webkitURL : goog.isDef(goog.global.createObjectURL) ? goog.global : null; |
| }; |
| goog.fs.url.browserSupportsObjectUrls = function() { |
| return null != goog.fs.url.findUrlObject_(); |
| }; |
| goog.functions = {}; |
| goog.functions.constant = function(a) { |
| return function() { |
| return a; |
| }; |
| }; |
| goog.functions.FALSE = goog.functions.constant(!1); |
| goog.functions.TRUE = goog.functions.constant(!0); |
| goog.functions.NULL = goog.functions.constant(null); |
| goog.functions.identity = function(a, b) { |
| return a; |
| }; |
| goog.functions.error = function(a) { |
| return function() { |
| throw Error(a); |
| }; |
| }; |
| goog.functions.fail = function(a) { |
| return function() { |
| throw a; |
| }; |
| }; |
| goog.functions.lock = function(a, b) { |
| b = b || 0; |
| return function() { |
| return a.apply(this, Array.prototype.slice.call(arguments, 0, b)); |
| }; |
| }; |
| goog.functions.nth = function(a) { |
| return function() { |
| return arguments[a]; |
| }; |
| }; |
| goog.functions.withReturnValue = function(a, b) { |
| return goog.functions.sequence(a, goog.functions.constant(b)); |
| }; |
| goog.functions.equalTo = function(a, b) { |
| return function(c) { |
| return b ? a == c : a === c; |
| }; |
| }; |
| goog.functions.compose = function(a, b) { |
| var c = arguments, d = c.length; |
| return function() { |
| var a; |
| d && (a = c[d - 1].apply(this, arguments)); |
| for (var b = d - 2;0 <= b;b--) { |
| a = c[b].call(this, a); |
| } |
| return a; |
| }; |
| }; |
| goog.functions.sequence = function(a) { |
| var b = arguments, c = b.length; |
| return function() { |
| for (var a, e = 0;e < c;e++) { |
| a = b[e].apply(this, arguments); |
| } |
| return a; |
| }; |
| }; |
| goog.functions.and = function(a) { |
| var b = arguments, c = b.length; |
| return function() { |
| for (var a = 0;a < c;a++) { |
| if (!b[a].apply(this, arguments)) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| }; |
| goog.functions.or = function(a) { |
| var b = arguments, c = b.length; |
| return function() { |
| for (var a = 0;a < c;a++) { |
| if (b[a].apply(this, arguments)) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| }; |
| goog.functions.not = function(a) { |
| return function() { |
| return !a.apply(this, arguments); |
| }; |
| }; |
| goog.functions.create = function(a, b) { |
| var c = function() { |
| }; |
| c.prototype = a.prototype; |
| c = new c; |
| a.apply(c, Array.prototype.slice.call(arguments, 1)); |
| return c; |
| }; |
| goog.functions.CACHE_RETURN_VALUE = !0; |
| goog.functions.cacheReturnValue = function(a) { |
| var b = !1, c; |
| return function() { |
| if (!goog.functions.CACHE_RETURN_VALUE) { |
| return a(); |
| } |
| b || (c = a(), b = !0); |
| return c; |
| }; |
| }; |
| goog.i18n = {}; |
| goog.i18n.bidi = {}; |
| goog.i18n.bidi.FORCE_RTL = !1; |
| goog.i18n.bidi.IS_RTL = goog.i18n.bidi.FORCE_RTL || ("ar" == goog.LOCALE.substring(0, 2).toLowerCase() || "fa" == goog.LOCALE.substring(0, 2).toLowerCase() || "he" == goog.LOCALE.substring(0, 2).toLowerCase() || "iw" == goog.LOCALE.substring(0, 2).toLowerCase() || "ps" == goog.LOCALE.substring(0, 2).toLowerCase() || "sd" == goog.LOCALE.substring(0, 2).toLowerCase() || "ug" == goog.LOCALE.substring(0, 2).toLowerCase() || "ur" == goog.LOCALE.substring(0, 2).toLowerCase() || "yi" == goog.LOCALE.substring(0, |
| 2).toLowerCase()) && (2 == goog.LOCALE.length || "-" == goog.LOCALE.substring(2, 3) || "_" == goog.LOCALE.substring(2, 3)) || 3 <= goog.LOCALE.length && "ckb" == goog.LOCALE.substring(0, 3).toLowerCase() && (3 == goog.LOCALE.length || "-" == goog.LOCALE.substring(3, 4) || "_" == goog.LOCALE.substring(3, 4)); |
| goog.i18n.bidi.Format = {LRE:"\u202a", RLE:"\u202b", PDF:"\u202c", LRM:"\u200e", RLM:"\u200f"}; |
| goog.i18n.bidi.Dir = {LTR:1, RTL:-1, NEUTRAL:0}; |
| goog.i18n.bidi.RIGHT = "right"; |
| goog.i18n.bidi.LEFT = "left"; |
| goog.i18n.bidi.I18N_RIGHT = goog.i18n.bidi.IS_RTL ? goog.i18n.bidi.LEFT : goog.i18n.bidi.RIGHT; |
| goog.i18n.bidi.I18N_LEFT = goog.i18n.bidi.IS_RTL ? goog.i18n.bidi.RIGHT : goog.i18n.bidi.LEFT; |
| goog.i18n.bidi.toDir = function(a, b) { |
| return "number" == typeof a ? 0 < a ? goog.i18n.bidi.Dir.LTR : 0 > a ? goog.i18n.bidi.Dir.RTL : b ? null : goog.i18n.bidi.Dir.NEUTRAL : null == a ? null : a ? goog.i18n.bidi.Dir.RTL : goog.i18n.bidi.Dir.LTR; |
| }; |
| goog.i18n.bidi.ltrChars_ = "A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff"; |
| goog.i18n.bidi.rtlChars_ = "\u0591-\u07ff\u200f\ufb1d-\ufdff\ufe70-\ufefc"; |
| goog.i18n.bidi.htmlSkipReg_ = /<[^>]*>|&[^;]+;/g; |
| goog.i18n.bidi.stripHtmlIfNeeded_ = function(a, b) { |
| return b ? a.replace(goog.i18n.bidi.htmlSkipReg_, "") : a; |
| }; |
| goog.i18n.bidi.rtlCharReg_ = new RegExp("[" + goog.i18n.bidi.rtlChars_ + "]"); |
| goog.i18n.bidi.ltrCharReg_ = new RegExp("[" + goog.i18n.bidi.ltrChars_ + "]"); |
| goog.i18n.bidi.hasAnyRtl = function(a, b) { |
| return goog.i18n.bidi.rtlCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.hasRtlChar = goog.i18n.bidi.hasAnyRtl; |
| goog.i18n.bidi.hasAnyLtr = function(a, b) { |
| return goog.i18n.bidi.ltrCharReg_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.ltrRe_ = new RegExp("^[" + goog.i18n.bidi.ltrChars_ + "]"); |
| goog.i18n.bidi.rtlRe_ = new RegExp("^[" + goog.i18n.bidi.rtlChars_ + "]"); |
| goog.i18n.bidi.isRtlChar = function(a) { |
| return goog.i18n.bidi.rtlRe_.test(a); |
| }; |
| goog.i18n.bidi.isLtrChar = function(a) { |
| return goog.i18n.bidi.ltrRe_.test(a); |
| }; |
| goog.i18n.bidi.isNeutralChar = function(a) { |
| return !goog.i18n.bidi.isLtrChar(a) && !goog.i18n.bidi.isRtlChar(a); |
| }; |
| goog.i18n.bidi.ltrDirCheckRe_ = new RegExp("^[^" + goog.i18n.bidi.rtlChars_ + "]*[" + goog.i18n.bidi.ltrChars_ + "]"); |
| goog.i18n.bidi.rtlDirCheckRe_ = new RegExp("^[^" + goog.i18n.bidi.ltrChars_ + "]*[" + goog.i18n.bidi.rtlChars_ + "]"); |
| goog.i18n.bidi.startsWithRtl = function(a, b) { |
| return goog.i18n.bidi.rtlDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.isRtlText = goog.i18n.bidi.startsWithRtl; |
| goog.i18n.bidi.startsWithLtr = function(a, b) { |
| return goog.i18n.bidi.ltrDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.isLtrText = goog.i18n.bidi.startsWithLtr; |
| goog.i18n.bidi.isRequiredLtrRe_ = /^http:\/\/.*/; |
| goog.i18n.bidi.isNeutralText = function(a, b) { |
| a = goog.i18n.bidi.stripHtmlIfNeeded_(a, b); |
| return goog.i18n.bidi.isRequiredLtrRe_.test(a) || !goog.i18n.bidi.hasAnyLtr(a) && !goog.i18n.bidi.hasAnyRtl(a); |
| }; |
| goog.i18n.bidi.ltrExitDirCheckRe_ = new RegExp("[" + goog.i18n.bidi.ltrChars_ + "][^" + goog.i18n.bidi.rtlChars_ + "]*$"); |
| goog.i18n.bidi.rtlExitDirCheckRe_ = new RegExp("[" + goog.i18n.bidi.rtlChars_ + "][^" + goog.i18n.bidi.ltrChars_ + "]*$"); |
| goog.i18n.bidi.endsWithLtr = function(a, b) { |
| return goog.i18n.bidi.ltrExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.isLtrExitText = goog.i18n.bidi.endsWithLtr; |
| goog.i18n.bidi.endsWithRtl = function(a, b) { |
| return goog.i18n.bidi.rtlExitDirCheckRe_.test(goog.i18n.bidi.stripHtmlIfNeeded_(a, b)); |
| }; |
| goog.i18n.bidi.isRtlExitText = goog.i18n.bidi.endsWithRtl; |
| goog.i18n.bidi.rtlLocalesRe_ = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i; |
| goog.i18n.bidi.isRtlLanguage = function(a) { |
| return goog.i18n.bidi.rtlLocalesRe_.test(a); |
| }; |
| goog.i18n.bidi.bracketGuardHtmlRe_ = /(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?(>)+)/g; |
| goog.i18n.bidi.bracketGuardTextRe_ = /(\(.*?\)+)|(\[.*?\]+)|(\{.*?\}+)|(<.*?>+)/g; |
| goog.i18n.bidi.guardBracketInHtml = function(a, b) { |
| return (void 0 === b ? goog.i18n.bidi.hasAnyRtl(a) : b) ? a.replace(goog.i18n.bidi.bracketGuardHtmlRe_, "<span dir=rtl>$&</span>") : a.replace(goog.i18n.bidi.bracketGuardHtmlRe_, "<span dir=ltr>$&</span>"); |
| }; |
| goog.i18n.bidi.guardBracketInText = function(a, b) { |
| var c = (void 0 === b ? goog.i18n.bidi.hasAnyRtl(a) : b) ? goog.i18n.bidi.Format.RLM : goog.i18n.bidi.Format.LRM; |
| return a.replace(goog.i18n.bidi.bracketGuardTextRe_, c + "$&" + c); |
| }; |
| goog.i18n.bidi.enforceRtlInHtml = function(a) { |
| return "<" == a.charAt(0) ? a.replace(/<\w+/, "$& dir=rtl") : "\n<span dir=rtl>" + a + "</span>"; |
| }; |
| goog.i18n.bidi.enforceRtlInText = function(a) { |
| return goog.i18n.bidi.Format.RLE + a + goog.i18n.bidi.Format.PDF; |
| }; |
| goog.i18n.bidi.enforceLtrInHtml = function(a) { |
| return "<" == a.charAt(0) ? a.replace(/<\w+/, "$& dir=ltr") : "\n<span dir=ltr>" + a + "</span>"; |
| }; |
| goog.i18n.bidi.enforceLtrInText = function(a) { |
| return goog.i18n.bidi.Format.LRE + a + goog.i18n.bidi.Format.PDF; |
| }; |
| goog.i18n.bidi.dimensionsRe_ = /:\s*([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)\s+([.\d][.\w]*)/g; |
| goog.i18n.bidi.leftRe_ = /left/gi; |
| goog.i18n.bidi.rightRe_ = /right/gi; |
| goog.i18n.bidi.tempRe_ = /%%%%/g; |
| goog.i18n.bidi.mirrorCSS = function(a) { |
| return a.replace(goog.i18n.bidi.dimensionsRe_, ":$1 $4 $3 $2").replace(goog.i18n.bidi.leftRe_, "%%%%").replace(goog.i18n.bidi.rightRe_, goog.i18n.bidi.LEFT).replace(goog.i18n.bidi.tempRe_, goog.i18n.bidi.RIGHT); |
| }; |
| goog.i18n.bidi.doubleQuoteSubstituteRe_ = /([\u0591-\u05f2])"/g; |
| goog.i18n.bidi.singleQuoteSubstituteRe_ = /([\u0591-\u05f2])'/g; |
| goog.i18n.bidi.normalizeHebrewQuote = function(a) { |
| return a.replace(goog.i18n.bidi.doubleQuoteSubstituteRe_, "$1\u05f4").replace(goog.i18n.bidi.singleQuoteSubstituteRe_, "$1\u05f3"); |
| }; |
| goog.i18n.bidi.wordSeparatorRe_ = /\s+/; |
| goog.i18n.bidi.hasNumeralsRe_ = /\d/; |
| goog.i18n.bidi.rtlDetectionThreshold_ = .4; |
| goog.i18n.bidi.estimateDirection = function(a, b) { |
| for (var c = 0, d = 0, e = !1, f = goog.i18n.bidi.stripHtmlIfNeeded_(a, b).split(goog.i18n.bidi.wordSeparatorRe_), g = 0;g < f.length;g++) { |
| var h = f[g]; |
| goog.i18n.bidi.startsWithRtl(h) ? (c++, d++) : goog.i18n.bidi.isRequiredLtrRe_.test(h) ? e = !0 : goog.i18n.bidi.hasAnyLtr(h) ? d++ : goog.i18n.bidi.hasNumeralsRe_.test(h) && (e = !0); |
| } |
| return 0 == d ? e ? goog.i18n.bidi.Dir.LTR : goog.i18n.bidi.Dir.NEUTRAL : c / d > goog.i18n.bidi.rtlDetectionThreshold_ ? goog.i18n.bidi.Dir.RTL : goog.i18n.bidi.Dir.LTR; |
| }; |
| goog.i18n.bidi.detectRtlDirectionality = function(a, b) { |
| return goog.i18n.bidi.estimateDirection(a, b) == goog.i18n.bidi.Dir.RTL; |
| }; |
| goog.i18n.bidi.setElementDirAndAlign = function(a, b) { |
| a && (b = goog.i18n.bidi.toDir(b)) && (a.style.textAlign = b == goog.i18n.bidi.Dir.RTL ? goog.i18n.bidi.RIGHT : goog.i18n.bidi.LEFT, a.dir = b == goog.i18n.bidi.Dir.RTL ? "rtl" : "ltr"); |
| }; |
| goog.i18n.bidi.DirectionalString = function() { |
| }; |
| goog.json = {}; |
| goog.json.USE_NATIVE_JSON = !1; |
| goog.json.isValid = function(a) { |
| return /^\s*$/.test(a) ? !1 : /^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g, "@").replace(/"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g, "")); |
| }; |
| goog.json.parse = goog.json.USE_NATIVE_JSON ? goog.global.JSON.parse : function(a) { |
| a = String(a); |
| if (goog.json.isValid(a)) { |
| try { |
| return eval("(" + a + ")"); |
| } catch (b) { |
| } |
| } |
| throw Error("Invalid JSON string: " + a); |
| }; |
| goog.json.unsafeParse = goog.json.USE_NATIVE_JSON ? goog.global.JSON.parse : function(a) { |
| return eval("(" + a + ")"); |
| }; |
| goog.json.serialize = goog.json.USE_NATIVE_JSON ? goog.global.JSON.stringify : function(a, b) { |
| return (new goog.json.Serializer(b)).serialize(a); |
| }; |
| goog.json.Serializer = function(a) { |
| this.replacer_ = a; |
| }; |
| goog.json.Serializer.prototype.serialize = function(a) { |
| var b = []; |
| this.serializeInternal(a, b); |
| return b.join(""); |
| }; |
| goog.json.Serializer.prototype.serializeInternal = function(a, b) { |
| switch(typeof a) { |
| case "string": |
| this.serializeString_(a, b); |
| break; |
| case "number": |
| this.serializeNumber_(a, b); |
| break; |
| case "boolean": |
| b.push(a); |
| break; |
| case "undefined": |
| b.push("null"); |
| break; |
| case "object": |
| if (null == a) { |
| b.push("null"); |
| break; |
| } |
| if (goog.isArray(a)) { |
| this.serializeArray(a, b); |
| break; |
| } |
| this.serializeObject_(a, b); |
| break; |
| case "function": |
| break; |
| default: |
| throw Error("Unknown type: " + typeof a);; |
| } |
| }; |
| goog.json.Serializer.charToJsonCharCache_ = {'"':'\\"', "\\":"\\\\", "/":"\\/", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\u000b"}; |
| goog.json.Serializer.charsToReplace_ = /\uffff/.test("\uffff") ? /[\\\"\x00-\x1f\x7f-\uffff]/g : /[\\\"\x00-\x1f\x7f-\xff]/g; |
| goog.json.Serializer.prototype.serializeString_ = function(a, b) { |
| b.push('"', a.replace(goog.json.Serializer.charsToReplace_, function(a) { |
| if (a in goog.json.Serializer.charToJsonCharCache_) { |
| return goog.json.Serializer.charToJsonCharCache_[a]; |
| } |
| var b = a.charCodeAt(0), e = "\\u"; |
| 16 > b ? e += "000" : 256 > b ? e += "00" : 4096 > b && (e += "0"); |
| return goog.json.Serializer.charToJsonCharCache_[a] = e + b.toString(16); |
| }), '"'); |
| }; |
| goog.json.Serializer.prototype.serializeNumber_ = function(a, b) { |
| b.push(isFinite(a) && !isNaN(a) ? a : "null"); |
| }; |
| goog.json.Serializer.prototype.serializeArray = function(a, b) { |
| var c = a.length; |
| b.push("["); |
| for (var d = "", e = 0;e < c;e++) { |
| b.push(d), d = a[e], this.serializeInternal(this.replacer_ ? this.replacer_.call(a, String(e), d) : d, b), d = ","; |
| } |
| b.push("]"); |
| }; |
| goog.json.Serializer.prototype.serializeObject_ = function(a, b) { |
| b.push("{"); |
| var c = "", d; |
| for (d in a) { |
| if (Object.prototype.hasOwnProperty.call(a, d)) { |
| var e = a[d]; |
| "function" != typeof e && (b.push(c), this.serializeString_(d, b), b.push(":"), this.serializeInternal(this.replacer_ ? this.replacer_.call(a, d, e) : e, b), c = ","); |
| } |
| } |
| b.push("}"); |
| }; |
| goog.net = {}; |
| goog.net.ErrorCode = {NO_ERROR:0, ACCESS_DENIED:1, FILE_NOT_FOUND:2, FF_SILENT_ERROR:3, CUSTOM_ERROR:4, EXCEPTION:5, HTTP_ERROR:6, ABORT:7, TIMEOUT:8, OFFLINE:9}; |
| goog.net.ErrorCode.getDebugMessage = function(a) { |
| switch(a) { |
| case goog.net.ErrorCode.NO_ERROR: |
| return "No Error"; |
| case goog.net.ErrorCode.ACCESS_DENIED: |
| return "Access denied to content document"; |
| case goog.net.ErrorCode.FILE_NOT_FOUND: |
| return "File not found"; |
| case goog.net.ErrorCode.FF_SILENT_ERROR: |
| return "Firefox silently errored"; |
| case goog.net.ErrorCode.CUSTOM_ERROR: |
| return "Application custom error"; |
| case goog.net.ErrorCode.EXCEPTION: |
| return "An exception occurred"; |
| case goog.net.ErrorCode.HTTP_ERROR: |
| return "Http response at 400 or 500 level"; |
| case goog.net.ErrorCode.ABORT: |
| return "Request was aborted"; |
| case goog.net.ErrorCode.TIMEOUT: |
| return "Request timed out"; |
| case goog.net.ErrorCode.OFFLINE: |
| return "The resource is not available offline"; |
| default: |
| return "Unrecognized error code"; |
| } |
| }; |
| goog.net.EventType = {COMPLETE:"complete", SUCCESS:"success", ERROR:"error", ABORT:"abort", READY:"ready", READY_STATE_CHANGE:"readystatechange", TIMEOUT:"timeout", INCREMENTAL_DATA:"incrementaldata", PROGRESS:"progress"}; |
| goog.net.HttpStatus = {CONTINUE:100, SWITCHING_PROTOCOLS:101, OK:200, CREATED:201, ACCEPTED:202, NON_AUTHORITATIVE_INFORMATION:203, NO_CONTENT:204, RESET_CONTENT:205, PARTIAL_CONTENT:206, MULTIPLE_CHOICES:300, MOVED_PERMANENTLY:301, FOUND:302, SEE_OTHER:303, NOT_MODIFIED:304, USE_PROXY:305, TEMPORARY_REDIRECT:307, BAD_REQUEST:400, UNAUTHORIZED:401, PAYMENT_REQUIRED:402, FORBIDDEN:403, NOT_FOUND:404, METHOD_NOT_ALLOWED:405, NOT_ACCEPTABLE:406, PROXY_AUTHENTICATION_REQUIRED:407, REQUEST_TIMEOUT:408, |
| CONFLICT:409, GONE:410, LENGTH_REQUIRED:411, PRECONDITION_FAILED:412, REQUEST_ENTITY_TOO_LARGE:413, REQUEST_URI_TOO_LONG:414, UNSUPPORTED_MEDIA_TYPE:415, REQUEST_RANGE_NOT_SATISFIABLE:416, EXPECTATION_FAILED:417, PRECONDITION_REQUIRED:428, TOO_MANY_REQUESTS:429, REQUEST_HEADER_FIELDS_TOO_LARGE:431, INTERNAL_SERVER_ERROR:500, NOT_IMPLEMENTED:501, BAD_GATEWAY:502, SERVICE_UNAVAILABLE:503, GATEWAY_TIMEOUT:504, HTTP_VERSION_NOT_SUPPORTED:505, NETWORK_AUTHENTICATION_REQUIRED:511, QUIRK_IE_NO_CONTENT:1223}; |
| goog.net.HttpStatus.isSuccess = function(a) { |
| switch(a) { |
| case goog.net.HttpStatus.OK: |
| ; |
| case goog.net.HttpStatus.CREATED: |
| ; |
| case goog.net.HttpStatus.ACCEPTED: |
| ; |
| case goog.net.HttpStatus.NO_CONTENT: |
| ; |
| case goog.net.HttpStatus.PARTIAL_CONTENT: |
| ; |
| case goog.net.HttpStatus.NOT_MODIFIED: |
| ; |
| case goog.net.HttpStatus.QUIRK_IE_NO_CONTENT: |
| return !0; |
| default: |
| return !1; |
| } |
| }; |
| goog.net.XhrLike = function() { |
| }; |
| goog.net.XhrLike.prototype.open = function(a, b, c, d, e) { |
| }; |
| goog.net.XhrLike.prototype.send = function(a) { |
| }; |
| goog.net.XhrLike.prototype.abort = function() { |
| }; |
| goog.net.XhrLike.prototype.setRequestHeader = function(a, b) { |
| }; |
| goog.net.XhrLike.prototype.getResponseHeader = function(a) { |
| }; |
| goog.net.XhrLike.prototype.getAllResponseHeaders = function() { |
| }; |
| goog.net.XmlHttpFactory = function() { |
| }; |
| goog.net.XmlHttpFactory.prototype.cachedOptions_ = null; |
| goog.net.XmlHttpFactory.prototype.getOptions = function() { |
| return this.cachedOptions_ || (this.cachedOptions_ = this.internalGetOptions()); |
| }; |
| goog.net.WrapperXmlHttpFactory = function(a, b) { |
| goog.net.XmlHttpFactory.call(this); |
| this.xhrFactory_ = a; |
| this.optionsFactory_ = b; |
| }; |
| goog.inherits(goog.net.WrapperXmlHttpFactory, goog.net.XmlHttpFactory); |
| goog.net.WrapperXmlHttpFactory.prototype.createInstance = function() { |
| return this.xhrFactory_(); |
| }; |
| goog.net.WrapperXmlHttpFactory.prototype.getOptions = function() { |
| return this.optionsFactory_(); |
| }; |
| goog.object = {}; |
| goog.object.forEach = function(a, b, c) { |
| for (var d in a) { |
| b.call(c, a[d], d, a); |
| } |
| }; |
| goog.object.filter = function(a, b, c) { |
| var d = {}, e; |
| for (e in a) { |
| b.call(c, a[e], e, a) && (d[e] = a[e]); |
| } |
| return d; |
| }; |
| goog.object.map = function(a, b, c) { |
| var d = {}, e; |
| for (e in a) { |
| d[e] = b.call(c, a[e], e, a); |
| } |
| return d; |
| }; |
| goog.object.some = function(a, b, c) { |
| for (var d in a) { |
| if (b.call(c, a[d], d, a)) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| goog.object.every = function(a, b, c) { |
| for (var d in a) { |
| if (!b.call(c, a[d], d, a)) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.object.getCount = function(a) { |
| var b = 0, c; |
| for (c in a) { |
| b++; |
| } |
| return b; |
| }; |
| goog.object.getAnyKey = function(a) { |
| for (var b in a) { |
| return b; |
| } |
| }; |
| goog.object.getAnyValue = function(a) { |
| for (var b in a) { |
| return a[b]; |
| } |
| }; |
| goog.object.contains = function(a, b) { |
| return goog.object.containsValue(a, b); |
| }; |
| goog.object.getValues = function(a) { |
| var b = [], c = 0, d; |
| for (d in a) { |
| b[c++] = a[d]; |
| } |
| return b; |
| }; |
| goog.object.getKeys = function(a) { |
| var b = [], c = 0, d; |
| for (d in a) { |
| b[c++] = d; |
| } |
| return b; |
| }; |
| goog.object.getValueByKeys = function(a, b) { |
| for (var c = goog.isArrayLike(b), d = c ? b : arguments, c = c ? 0 : 1;c < d.length && (a = a[d[c]], goog.isDef(a));c++) { |
| } |
| return a; |
| }; |
| goog.object.containsKey = function(a, b) { |
| return b in a; |
| }; |
| goog.object.containsValue = function(a, b) { |
| for (var c in a) { |
| if (a[c] == b) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| goog.object.findKey = function(a, b, c) { |
| for (var d in a) { |
| if (b.call(c, a[d], d, a)) { |
| return d; |
| } |
| } |
| }; |
| goog.object.findValue = function(a, b, c) { |
| return (b = goog.object.findKey(a, b, c)) && a[b]; |
| }; |
| goog.object.isEmpty = function(a) { |
| for (var b in a) { |
| return !1; |
| } |
| return !0; |
| }; |
| goog.object.clear = function(a) { |
| for (var b in a) { |
| delete a[b]; |
| } |
| }; |
| goog.object.remove = function(a, b) { |
| var c; |
| (c = b in a) && delete a[b]; |
| return c; |
| }; |
| goog.object.add = function(a, b, c) { |
| if (b in a) { |
| throw Error('The object already contains the key "' + b + '"'); |
| } |
| goog.object.set(a, b, c); |
| }; |
| goog.object.get = function(a, b, c) { |
| return b in a ? a[b] : c; |
| }; |
| goog.object.set = function(a, b, c) { |
| a[b] = c; |
| }; |
| goog.object.setIfUndefined = function(a, b, c) { |
| return b in a ? a[b] : a[b] = c; |
| }; |
| goog.object.setWithReturnValueIfNotSet = function(a, b, c) { |
| if (b in a) { |
| return a[b]; |
| } |
| c = c(); |
| return a[b] = c; |
| }; |
| goog.object.equals = function(a, b) { |
| for (var c in a) { |
| if (!(c in b) || a[c] !== b[c]) { |
| return !1; |
| } |
| } |
| for (c in b) { |
| if (!(c in a)) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.object.clone = function(a) { |
| var b = {}, c; |
| for (c in a) { |
| b[c] = a[c]; |
| } |
| return b; |
| }; |
| goog.object.unsafeClone = function(a) { |
| var b = goog.typeOf(a); |
| if ("object" == b || "array" == b) { |
| if (a.clone) { |
| return a.clone(); |
| } |
| var b = "array" == b ? [] : {}, c; |
| for (c in a) { |
| b[c] = goog.object.unsafeClone(a[c]); |
| } |
| return b; |
| } |
| return a; |
| }; |
| goog.object.transpose = function(a) { |
| var b = {}, c; |
| for (c in a) { |
| b[a[c]] = c; |
| } |
| return b; |
| }; |
| goog.object.PROTOTYPE_FIELDS_ = "constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "); |
| goog.object.extend = function(a, b) { |
| for (var c, d, e = 1;e < arguments.length;e++) { |
| d = arguments[e]; |
| for (c in d) { |
| a[c] = d[c]; |
| } |
| for (var f = 0;f < goog.object.PROTOTYPE_FIELDS_.length;f++) { |
| c = goog.object.PROTOTYPE_FIELDS_[f], Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]); |
| } |
| } |
| }; |
| goog.object.create = function(a) { |
| var b = arguments.length; |
| if (1 == b && goog.isArray(arguments[0])) { |
| return goog.object.create.apply(null, arguments[0]); |
| } |
| if (b % 2) { |
| throw Error("Uneven number of arguments"); |
| } |
| for (var c = {}, d = 0;d < b;d += 2) { |
| c[arguments[d]] = arguments[d + 1]; |
| } |
| return c; |
| }; |
| goog.object.createSet = function(a) { |
| var b = arguments.length; |
| if (1 == b && goog.isArray(arguments[0])) { |
| return goog.object.createSet.apply(null, arguments[0]); |
| } |
| for (var c = {}, d = 0;d < b;d++) { |
| c[arguments[d]] = !0; |
| } |
| return c; |
| }; |
| goog.object.createImmutableView = function(a) { |
| var b = a; |
| Object.isFrozen && !Object.isFrozen(a) && (b = Object.create(a), Object.freeze(b)); |
| return b; |
| }; |
| goog.object.isImmutableView = function(a) { |
| return !!Object.isFrozen && Object.isFrozen(a); |
| }; |
| goog.dom.tags = {}; |
| goog.dom.tags.VOID_TAGS_ = goog.object.createSet("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")); |
| goog.dom.tags.isVoidTag = function(a) { |
| return !0 === goog.dom.tags.VOID_TAGS_[a]; |
| }; |
| goog.promise = {}; |
| goog.promise.Resolver = function() { |
| }; |
| goog.Thenable = function() { |
| }; |
| goog.Thenable.prototype.then = function(a, b, c) { |
| }; |
| goog.Thenable.IMPLEMENTED_BY_PROP = "$goog_Thenable"; |
| goog.Thenable.addImplementation = function(a) { |
| goog.exportProperty(a.prototype, "then", a.prototype.then); |
| COMPILED ? a.prototype[goog.Thenable.IMPLEMENTED_BY_PROP] = !0 : a.prototype.$goog_Thenable = !0; |
| }; |
| goog.Thenable.isImplementedBy = function(a) { |
| if (!a) { |
| return !1; |
| } |
| try { |
| return COMPILED ? !!a[goog.Thenable.IMPLEMENTED_BY_PROP] : !!a.$goog_Thenable; |
| } catch (b) { |
| return !1; |
| } |
| }; |
| goog.reflect = {}; |
| goog.reflect.object = function(a, b) { |
| return b; |
| }; |
| goog.reflect.sinkValue = function(a) { |
| goog.reflect.sinkValue[" "](a); |
| return a; |
| }; |
| goog.reflect.sinkValue[" "] = goog.nullFunction; |
| goog.reflect.canAccessProperty = function(a, b) { |
| try { |
| return goog.reflect.sinkValue(a[b]), !0; |
| } catch (c) { |
| } |
| return !1; |
| }; |
| goog.string = {}; |
| goog.string.DETECT_DOUBLE_ESCAPING = !1; |
| goog.string.FORCE_NON_DOM_HTML_UNESCAPING = !1; |
| goog.string.Unicode = {NBSP:"\u00a0"}; |
| goog.string.startsWith = function(a, b) { |
| return 0 == a.lastIndexOf(b, 0); |
| }; |
| goog.string.endsWith = function(a, b) { |
| var c = a.length - b.length; |
| return 0 <= c && a.indexOf(b, c) == c; |
| }; |
| goog.string.caseInsensitiveStartsWith = function(a, b) { |
| return 0 == goog.string.caseInsensitiveCompare(b, a.substr(0, b.length)); |
| }; |
| goog.string.caseInsensitiveEndsWith = function(a, b) { |
| return 0 == goog.string.caseInsensitiveCompare(b, a.substr(a.length - b.length, b.length)); |
| }; |
| goog.string.caseInsensitiveEquals = function(a, b) { |
| return a.toLowerCase() == b.toLowerCase(); |
| }; |
| goog.string.subs = function(a, b) { |
| for (var c = a.split("%s"), d = "", e = Array.prototype.slice.call(arguments, 1);e.length && 1 < c.length;) { |
| d += c.shift() + e.shift(); |
| } |
| return d + c.join("%s"); |
| }; |
| goog.string.collapseWhitespace = function(a) { |
| return a.replace(/[\s\xa0]+/g, " ").replace(/^\s+|\s+$/g, ""); |
| }; |
| goog.string.isEmptyOrWhitespace = function(a) { |
| return /^[\s\xa0]*$/.test(a); |
| }; |
| goog.string.isEmptyString = function(a) { |
| return 0 == a.length; |
| }; |
| goog.string.isEmpty = goog.string.isEmptyOrWhitespace; |
| goog.string.isEmptyOrWhitespaceSafe = function(a) { |
| return goog.string.isEmptyOrWhitespace(goog.string.makeSafe(a)); |
| }; |
| goog.string.isEmptySafe = goog.string.isEmptyOrWhitespaceSafe; |
| goog.string.isBreakingWhitespace = function(a) { |
| return !/[^\t\n\r ]/.test(a); |
| }; |
| goog.string.isAlpha = function(a) { |
| return !/[^a-zA-Z]/.test(a); |
| }; |
| goog.string.isNumeric = function(a) { |
| return !/[^0-9]/.test(a); |
| }; |
| goog.string.isAlphaNumeric = function(a) { |
| return !/[^a-zA-Z0-9]/.test(a); |
| }; |
| goog.string.isSpace = function(a) { |
| return " " == a; |
| }; |
| goog.string.isUnicodeChar = function(a) { |
| return 1 == a.length && " " <= a && "~" >= a || "\u0080" <= a && "\ufffd" >= a; |
| }; |
| goog.string.stripNewlines = function(a) { |
| return a.replace(/(\r\n|\r|\n)+/g, " "); |
| }; |
| goog.string.canonicalizeNewlines = function(a) { |
| return a.replace(/(\r\n|\r|\n)/g, "\n"); |
| }; |
| goog.string.normalizeWhitespace = function(a) { |
| return a.replace(/\xa0|\s/g, " "); |
| }; |
| goog.string.normalizeSpaces = function(a) { |
| return a.replace(/\xa0|[ \t]+/g, " "); |
| }; |
| goog.string.collapseBreakingSpaces = function(a) { |
| return a.replace(/[\t\r\n ]+/g, " ").replace(/^[\t\r\n ]+|[\t\r\n ]+$/g, ""); |
| }; |
| goog.string.trim = goog.TRUSTED_SITE && String.prototype.trim ? function(a) { |
| return a.trim(); |
| } : function(a) { |
| return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g, ""); |
| }; |
| goog.string.trimLeft = function(a) { |
| return a.replace(/^[\s\xa0]+/, ""); |
| }; |
| goog.string.trimRight = function(a) { |
| return a.replace(/[\s\xa0]+$/, ""); |
| }; |
| goog.string.caseInsensitiveCompare = function(a, b) { |
| var c = String(a).toLowerCase(), d = String(b).toLowerCase(); |
| return c < d ? -1 : c == d ? 0 : 1; |
| }; |
| goog.string.numerateCompareRegExp_ = /(\.\d+)|(\d+)|(\D+)/g; |
| goog.string.numerateCompare = function(a, b) { |
| if (a == b) { |
| return 0; |
| } |
| if (!a) { |
| return -1; |
| } |
| if (!b) { |
| return 1; |
| } |
| for (var c = a.toLowerCase().match(goog.string.numerateCompareRegExp_), d = b.toLowerCase().match(goog.string.numerateCompareRegExp_), e = Math.min(c.length, d.length), f = 0;f < e;f++) { |
| var g = c[f], h = d[f]; |
| if (g != h) { |
| return c = parseInt(g, 10), !isNaN(c) && (d = parseInt(h, 10), !isNaN(d) && c - d) ? c - d : g < h ? -1 : 1; |
| } |
| } |
| return c.length != d.length ? c.length - d.length : a < b ? -1 : 1; |
| }; |
| goog.string.urlEncode = function(a) { |
| return encodeURIComponent(String(a)); |
| }; |
| goog.string.urlDecode = function(a) { |
| return decodeURIComponent(a.replace(/\+/g, " ")); |
| }; |
| goog.string.newLineToBr = function(a, b) { |
| return a.replace(/(\r\n|\r|\n)/g, b ? "<br />" : "<br>"); |
| }; |
| goog.string.htmlEscape = function(a, b) { |
| if (b) { |
| a = a.replace(goog.string.AMP_RE_, "&").replace(goog.string.LT_RE_, "<").replace(goog.string.GT_RE_, ">").replace(goog.string.QUOT_RE_, """).replace(goog.string.SINGLE_QUOTE_RE_, "'").replace(goog.string.NULL_RE_, "�"), goog.string.DETECT_DOUBLE_ESCAPING && (a = a.replace(goog.string.E_RE_, "e")); |
| } else { |
| if (!goog.string.ALL_RE_.test(a)) { |
| return a; |
| } |
| -1 != a.indexOf("&") && (a = a.replace(goog.string.AMP_RE_, "&")); |
| -1 != a.indexOf("<") && (a = a.replace(goog.string.LT_RE_, "<")); |
| -1 != a.indexOf(">") && (a = a.replace(goog.string.GT_RE_, ">")); |
| -1 != a.indexOf('"') && (a = a.replace(goog.string.QUOT_RE_, """)); |
| -1 != a.indexOf("'") && (a = a.replace(goog.string.SINGLE_QUOTE_RE_, "'")); |
| -1 != a.indexOf("\x00") && (a = a.replace(goog.string.NULL_RE_, "�")); |
| goog.string.DETECT_DOUBLE_ESCAPING && -1 != a.indexOf("e") && (a = a.replace(goog.string.E_RE_, "e")); |
| } |
| return a; |
| }; |
| goog.string.AMP_RE_ = /&/g; |
| goog.string.LT_RE_ = /</g; |
| goog.string.GT_RE_ = />/g; |
| goog.string.QUOT_RE_ = /"/g; |
| goog.string.SINGLE_QUOTE_RE_ = /'/g; |
| goog.string.NULL_RE_ = /\x00/g; |
| goog.string.E_RE_ = /e/g; |
| goog.string.ALL_RE_ = goog.string.DETECT_DOUBLE_ESCAPING ? /[\x00&<>"'e]/ : /[\x00&<>"']/; |
| goog.string.unescapeEntities = function(a) { |
| return goog.string.contains(a, "&") ? !goog.string.FORCE_NON_DOM_HTML_UNESCAPING && "document" in goog.global ? goog.string.unescapeEntitiesUsingDom_(a) : goog.string.unescapePureXmlEntities_(a) : a; |
| }; |
| goog.string.unescapeEntitiesWithDocument = function(a, b) { |
| return goog.string.contains(a, "&") ? goog.string.unescapeEntitiesUsingDom_(a, b) : a; |
| }; |
| goog.string.unescapeEntitiesUsingDom_ = function(a, b) { |
| var c = {"&":"&", "<":"<", ">":">", """:'"'}, d; |
| d = b ? b.createElement("div") : goog.global.document.createElement("div"); |
| return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, b) { |
| var g = c[a]; |
| if (g) { |
| return g; |
| } |
| if ("#" == b.charAt(0)) { |
| var h = Number("0" + b.substr(1)); |
| isNaN(h) || (g = String.fromCharCode(h)); |
| } |
| g || (d.innerHTML = a + " ", g = d.firstChild.nodeValue.slice(0, -1)); |
| return c[a] = g; |
| }); |
| }; |
| goog.string.unescapePureXmlEntities_ = function(a) { |
| return a.replace(/&([^;]+);/g, function(a, c) { |
| switch(c) { |
| case "amp": |
| return "&"; |
| case "lt": |
| return "<"; |
| case "gt": |
| return ">"; |
| case "quot": |
| return '"'; |
| default: |
| if ("#" == c.charAt(0)) { |
| var d = Number("0" + c.substr(1)); |
| if (!isNaN(d)) { |
| return String.fromCharCode(d); |
| } |
| } |
| return a; |
| } |
| }); |
| }; |
| goog.string.HTML_ENTITY_PATTERN_ = /&([^;\s<&]+);?/g; |
| goog.string.whitespaceEscape = function(a, b) { |
| return goog.string.newLineToBr(a.replace(/ /g, "  "), b); |
| }; |
| goog.string.preserveSpaces = function(a) { |
| return a.replace(/(^|[\n ]) /g, "$1" + goog.string.Unicode.NBSP); |
| }; |
| goog.string.stripQuotes = function(a, b) { |
| for (var c = b.length, d = 0;d < c;d++) { |
| var e = 1 == c ? b : b.charAt(d); |
| if (a.charAt(0) == e && a.charAt(a.length - 1) == e) { |
| return a.substring(1, a.length - 1); |
| } |
| } |
| return a; |
| }; |
| goog.string.truncate = function(a, b, c) { |
| c && (a = goog.string.unescapeEntities(a)); |
| a.length > b && (a = a.substring(0, b - 3) + "..."); |
| c && (a = goog.string.htmlEscape(a)); |
| return a; |
| }; |
| goog.string.truncateMiddle = function(a, b, c, d) { |
| c && (a = goog.string.unescapeEntities(a)); |
| if (d && a.length > b) { |
| d > b && (d = b); |
| var e = a.length - d; |
| a = a.substring(0, b - d) + "..." + a.substring(e); |
| } else { |
| a.length > b && (d = Math.floor(b / 2), e = a.length - d, a = a.substring(0, d + b % 2) + "..." + a.substring(e)); |
| } |
| c && (a = goog.string.htmlEscape(a)); |
| return a; |
| }; |
| goog.string.specialEscapeChars_ = {"\x00":"\\0", "\b":"\\b", "\f":"\\f", "\n":"\\n", "\r":"\\r", "\t":"\\t", "\x0B":"\\x0B", '"':'\\"', "\\":"\\\\"}; |
| goog.string.jsEscapeCache_ = {"'":"\\'"}; |
| goog.string.quote = function(a) { |
| a = String(a); |
| if (a.quote) { |
| return a.quote(); |
| } |
| for (var b = ['"'], c = 0;c < a.length;c++) { |
| var d = a.charAt(c), e = d.charCodeAt(0); |
| b[c + 1] = goog.string.specialEscapeChars_[d] || (31 < e && 127 > e ? d : goog.string.escapeChar(d)); |
| } |
| b.push('"'); |
| return b.join(""); |
| }; |
| goog.string.escapeString = function(a) { |
| for (var b = [], c = 0;c < a.length;c++) { |
| b[c] = goog.string.escapeChar(a.charAt(c)); |
| } |
| return b.join(""); |
| }; |
| goog.string.escapeChar = function(a) { |
| if (a in goog.string.jsEscapeCache_) { |
| return goog.string.jsEscapeCache_[a]; |
| } |
| if (a in goog.string.specialEscapeChars_) { |
| return goog.string.jsEscapeCache_[a] = goog.string.specialEscapeChars_[a]; |
| } |
| var b = a, c = a.charCodeAt(0); |
| if (31 < c && 127 > c) { |
| b = a; |
| } else { |
| if (256 > c) { |
| if (b = "\\x", 16 > c || 256 < c) { |
| b += "0"; |
| } |
| } else { |
| b = "\\u", 4096 > c && (b += "0"); |
| } |
| b += c.toString(16).toUpperCase(); |
| } |
| return goog.string.jsEscapeCache_[a] = b; |
| }; |
| goog.string.contains = function(a, b) { |
| return -1 != a.indexOf(b); |
| }; |
| goog.string.caseInsensitiveContains = function(a, b) { |
| return goog.string.contains(a.toLowerCase(), b.toLowerCase()); |
| }; |
| goog.string.countOf = function(a, b) { |
| return a && b ? a.split(b).length - 1 : 0; |
| }; |
| goog.string.removeAt = function(a, b, c) { |
| var d = a; |
| 0 <= b && b < a.length && 0 < c && (d = a.substr(0, b) + a.substr(b + c, a.length - b - c)); |
| return d; |
| }; |
| goog.string.remove = function(a, b) { |
| var c = new RegExp(goog.string.regExpEscape(b), ""); |
| return a.replace(c, ""); |
| }; |
| goog.string.removeAll = function(a, b) { |
| var c = new RegExp(goog.string.regExpEscape(b), "g"); |
| return a.replace(c, ""); |
| }; |
| goog.string.regExpEscape = function(a) { |
| return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08"); |
| }; |
| goog.string.repeat = function(a, b) { |
| return Array(b + 1).join(a); |
| }; |
| goog.string.padNumber = function(a, b, c) { |
| a = goog.isDef(c) ? a.toFixed(c) : String(a); |
| c = a.indexOf("."); |
| -1 == c && (c = a.length); |
| return goog.string.repeat("0", Math.max(0, b - c)) + a; |
| }; |
| goog.string.makeSafe = function(a) { |
| return null == a ? "" : String(a); |
| }; |
| goog.string.buildString = function(a) { |
| return Array.prototype.join.call(arguments, ""); |
| }; |
| goog.string.getRandomString = function() { |
| return Math.floor(2147483648 * Math.random()).toString(36) + Math.abs(Math.floor(2147483648 * Math.random()) ^ goog.now()).toString(36); |
| }; |
| goog.string.compareVersions = function(a, b) { |
| for (var c = 0, d = goog.string.trim(String(a)).split("."), e = goog.string.trim(String(b)).split("."), f = Math.max(d.length, e.length), g = 0;0 == c && g < f;g++) { |
| var h = d[g] || "", k = e[g] || "", l = RegExp("(\\d*)(\\D*)", "g"), p = RegExp("(\\d*)(\\D*)", "g"); |
| do { |
| var m = l.exec(h) || ["", "", ""], n = p.exec(k) || ["", "", ""]; |
| if (0 == m[0].length && 0 == n[0].length) { |
| break; |
| } |
| var c = 0 == m[1].length ? 0 : parseInt(m[1], 10), q = 0 == n[1].length ? 0 : parseInt(n[1], 10), c = goog.string.compareElements_(c, q) || goog.string.compareElements_(0 == m[2].length, 0 == n[2].length) || goog.string.compareElements_(m[2], n[2]); |
| } while (0 == c); |
| } |
| return c; |
| }; |
| goog.string.compareElements_ = function(a, b) { |
| return a < b ? -1 : a > b ? 1 : 0; |
| }; |
| goog.string.HASHCODE_MAX_ = 4294967296; |
| goog.string.hashCode = function(a) { |
| for (var b = 0, c = 0;c < a.length;++c) { |
| b = 31 * b + a.charCodeAt(c), b %= goog.string.HASHCODE_MAX_; |
| } |
| return b; |
| }; |
| goog.string.uniqueStringCounter_ = 2147483648 * Math.random() | 0; |
| goog.string.createUniqueString = function() { |
| return "goog_" + goog.string.uniqueStringCounter_++; |
| }; |
| goog.string.toNumber = function(a) { |
| var b = Number(a); |
| return 0 == b && goog.string.isEmptyOrWhitespace(a) ? NaN : b; |
| }; |
| goog.string.isLowerCamelCase = function(a) { |
| return /^[a-z]+([A-Z][a-z]*)*$/.test(a); |
| }; |
| goog.string.isUpperCamelCase = function(a) { |
| return /^([A-Z][a-z]*)+$/.test(a); |
| }; |
| goog.string.toCamelCase = function(a) { |
| return String(a).replace(/\-([a-z])/g, function(a, c) { |
| return c.toUpperCase(); |
| }); |
| }; |
| goog.string.toSelectorCase = function(a) { |
| return String(a).replace(/([A-Z])/g, "-$1").toLowerCase(); |
| }; |
| goog.string.toTitleCase = function(a, b) { |
| var c = goog.isString(b) ? goog.string.regExpEscape(b) : "\\s"; |
| return a.replace(new RegExp("(^" + (c ? "|[" + c + "]+" : "") + ")([a-z])", "g"), function(a, b, c) { |
| return b + c.toUpperCase(); |
| }); |
| }; |
| goog.string.capitalize = function(a) { |
| return String(a.charAt(0)).toUpperCase() + String(a.substr(1)).toLowerCase(); |
| }; |
| goog.string.parseInt = function(a) { |
| isFinite(a) && (a = String(a)); |
| return goog.isString(a) ? /^\s*-?0x/i.test(a) ? parseInt(a, 16) : parseInt(a, 10) : NaN; |
| }; |
| goog.string.splitLimit = function(a, b, c) { |
| a = a.split(b); |
| for (var d = [];0 < c && a.length;) { |
| d.push(a.shift()), c--; |
| } |
| a.length && d.push(a.join(b)); |
| return d; |
| }; |
| goog.string.editDistance = function(a, b) { |
| var c = [], d = []; |
| if (a == b) { |
| return 0; |
| } |
| if (!a.length || !b.length) { |
| return Math.max(a.length, b.length); |
| } |
| for (var e = 0;e < b.length + 1;e++) { |
| c[e] = e; |
| } |
| for (e = 0;e < a.length;e++) { |
| d[0] = e + 1; |
| for (var f = 0;f < b.length;f++) { |
| d[f + 1] = Math.min(d[f] + 1, c[f + 1] + 1, c[f] + (a[e] != b[f])); |
| } |
| for (f = 0;f < c.length;f++) { |
| c[f] = d[f]; |
| } |
| } |
| return d[b.length]; |
| }; |
| goog.asserts = {}; |
| goog.asserts.ENABLE_ASSERTS = goog.DEBUG; |
| goog.asserts.AssertionError = function(a, b) { |
| b.unshift(a); |
| goog.debug.Error.call(this, goog.string.subs.apply(null, b)); |
| b.shift(); |
| this.messagePattern = a; |
| }; |
| goog.inherits(goog.asserts.AssertionError, goog.debug.Error); |
| goog.asserts.AssertionError.prototype.name = "AssertionError"; |
| goog.asserts.DEFAULT_ERROR_HANDLER = function(a) { |
| throw a; |
| }; |
| goog.asserts.errorHandler_ = goog.asserts.DEFAULT_ERROR_HANDLER; |
| goog.asserts.doAssertFailure_ = function(a, b, c, d) { |
| var e = "Assertion failed"; |
| if (c) { |
| var e = e + (": " + c), f = d |
| } else { |
| a && (e += ": " + a, f = b); |
| } |
| a = new goog.asserts.AssertionError("" + e, f || []); |
| goog.asserts.errorHandler_(a); |
| }; |
| goog.asserts.setErrorHandler = function(a) { |
| goog.asserts.ENABLE_ASSERTS && (goog.asserts.errorHandler_ = a); |
| }; |
| goog.asserts.assert = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !a && goog.asserts.doAssertFailure_("", null, b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.fail = function(a, b) { |
| goog.asserts.ENABLE_ASSERTS && goog.asserts.errorHandler_(new goog.asserts.AssertionError("Failure" + (a ? ": " + a : ""), Array.prototype.slice.call(arguments, 1))); |
| }; |
| goog.asserts.assertNumber = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isNumber(a) && goog.asserts.doAssertFailure_("Expected number but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertString = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isString(a) && goog.asserts.doAssertFailure_("Expected string but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertFunction = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isFunction(a) && goog.asserts.doAssertFailure_("Expected function but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertObject = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isObject(a) && goog.asserts.doAssertFailure_("Expected object but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertArray = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isArray(a) && goog.asserts.doAssertFailure_("Expected array but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertBoolean = function(a, b, c) { |
| goog.asserts.ENABLE_ASSERTS && !goog.isBoolean(a) && goog.asserts.doAssertFailure_("Expected boolean but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertElement = function(a, b, c) { |
| !goog.asserts.ENABLE_ASSERTS || goog.isObject(a) && a.nodeType == goog.dom.NodeType.ELEMENT || goog.asserts.doAssertFailure_("Expected Element but got %s: %s.", [goog.typeOf(a), a], b, Array.prototype.slice.call(arguments, 2)); |
| return a; |
| }; |
| goog.asserts.assertInstanceof = function(a, b, c, d) { |
| !goog.asserts.ENABLE_ASSERTS || a instanceof b || goog.asserts.doAssertFailure_("Expected instanceof %s but got %s.", [goog.asserts.getType_(b), goog.asserts.getType_(a)], c, Array.prototype.slice.call(arguments, 3)); |
| return a; |
| }; |
| goog.asserts.assertObjectPrototypeIsIntact = function() { |
| for (var a in Object.prototype) { |
| goog.asserts.fail(a + " should not be enumerable in Object.prototype."); |
| } |
| }; |
| goog.asserts.getType_ = function(a) { |
| return a instanceof Function ? a.displayName || a.name || "unknown type name" : a instanceof Object ? a.constructor.displayName || a.constructor.name || Object.prototype.toString.call(a) : null === a ? "null" : typeof a; |
| }; |
| goog.array = {}; |
| goog.NATIVE_ARRAY_PROTOTYPES = goog.TRUSTED_SITE; |
| goog.array.ASSUME_NATIVE_FUNCTIONS = !1; |
| goog.array.peek = function(a) { |
| return a[a.length - 1]; |
| }; |
| goog.array.last = goog.array.peek; |
| goog.array.ARRAY_PROTOTYPE_ = Array.prototype; |
| goog.array.indexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.indexOf) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.indexOf.call(a, b, c); |
| } : function(a, b, c) { |
| c = null == c ? 0 : 0 > c ? Math.max(0, a.length + c) : c; |
| if (goog.isString(a)) { |
| return goog.isString(b) && 1 == b.length ? a.indexOf(b, c) : -1; |
| } |
| for (;c < a.length;c++) { |
| if (c in a && a[c] === b) { |
| return c; |
| } |
| } |
| return -1; |
| }; |
| goog.array.lastIndexOf = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.lastIndexOf) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.lastIndexOf.call(a, b, null == c ? a.length - 1 : c); |
| } : function(a, b, c) { |
| c = null == c ? a.length - 1 : c; |
| 0 > c && (c = Math.max(0, a.length + c)); |
| if (goog.isString(a)) { |
| return goog.isString(b) && 1 == b.length ? a.lastIndexOf(b, c) : -1; |
| } |
| for (;0 <= c;c--) { |
| if (c in a && a[c] === b) { |
| return c; |
| } |
| } |
| return -1; |
| }; |
| goog.array.forEach = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.forEach) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| goog.array.ARRAY_PROTOTYPE_.forEach.call(a, b, c); |
| } : function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { |
| f in e && b.call(c, e[f], f, a); |
| } |
| }; |
| goog.array.forEachRight = function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;--d) { |
| d in e && b.call(c, e[d], d, a); |
| } |
| }; |
| goog.array.filter = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.filter) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.filter.call(a, b, c); |
| } : function(a, b, c) { |
| for (var d = a.length, e = [], f = 0, g = goog.isString(a) ? a.split("") : a, h = 0;h < d;h++) { |
| if (h in g) { |
| var k = g[h]; |
| b.call(c, k, h, a) && (e[f++] = k); |
| } |
| } |
| return e; |
| }; |
| goog.array.map = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.map) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.map.call(a, b, c); |
| } : function(a, b, c) { |
| for (var d = a.length, e = Array(d), f = goog.isString(a) ? a.split("") : a, g = 0;g < d;g++) { |
| g in f && (e[g] = b.call(c, f[g], g, a)); |
| } |
| return e; |
| }; |
| goog.array.reduce = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduce) ? function(a, b, c, d) { |
| goog.asserts.assert(null != a.length); |
| for (var e = [], f = 1, g = arguments.length;f < g;f++) { |
| e.push(arguments[f]); |
| } |
| d && (e[0] = goog.bind(b, d)); |
| return goog.array.ARRAY_PROTOTYPE_.reduce.apply(a, e); |
| } : function(a, b, c, d) { |
| var e = c; |
| goog.array.forEach(a, function(c, g) { |
| e = b.call(d, e, c, g, a); |
| }); |
| return e; |
| }; |
| goog.array.reduceRight = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.reduceRight) ? function(a, b, c, d) { |
| goog.asserts.assert(null != a.length); |
| d && (b = goog.bind(b, d)); |
| return goog.array.ARRAY_PROTOTYPE_.reduceRight.call(a, b, c); |
| } : function(a, b, c, d) { |
| var e = c; |
| goog.array.forEachRight(a, function(c, g) { |
| e = b.call(d, e, c, g, a); |
| }); |
| return e; |
| }; |
| goog.array.some = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.some) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.some.call(a, b, c); |
| } : function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { |
| if (f in e && b.call(c, e[f], f, a)) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| goog.array.every = goog.NATIVE_ARRAY_PROTOTYPES && (goog.array.ASSUME_NATIVE_FUNCTIONS || goog.array.ARRAY_PROTOTYPE_.every) ? function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.every.call(a, b, c); |
| } : function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { |
| if (f in e && !b.call(c, e[f], f, a)) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.array.count = function(a, b, c) { |
| var d = 0; |
| goog.array.forEach(a, function(a, f, g) { |
| b.call(c, a, f, g) && ++d; |
| }, c); |
| return d; |
| }; |
| goog.array.find = function(a, b, c) { |
| b = goog.array.findIndex(a, b, c); |
| return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; |
| }; |
| goog.array.findIndex = function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, f = 0;f < d;f++) { |
| if (f in e && b.call(c, e[f], f, a)) { |
| return f; |
| } |
| } |
| return -1; |
| }; |
| goog.array.findRight = function(a, b, c) { |
| b = goog.array.findIndexRight(a, b, c); |
| return 0 > b ? null : goog.isString(a) ? a.charAt(b) : a[b]; |
| }; |
| goog.array.findIndexRight = function(a, b, c) { |
| for (var d = a.length, e = goog.isString(a) ? a.split("") : a, d = d - 1;0 <= d;d--) { |
| if (d in e && b.call(c, e[d], d, a)) { |
| return d; |
| } |
| } |
| return -1; |
| }; |
| goog.array.contains = function(a, b) { |
| return 0 <= goog.array.indexOf(a, b); |
| }; |
| goog.array.isEmpty = function(a) { |
| return 0 == a.length; |
| }; |
| goog.array.clear = function(a) { |
| if (!goog.isArray(a)) { |
| for (var b = a.length - 1;0 <= b;b--) { |
| delete a[b]; |
| } |
| } |
| a.length = 0; |
| }; |
| goog.array.insert = function(a, b) { |
| goog.array.contains(a, b) || a.push(b); |
| }; |
| goog.array.insertAt = function(a, b, c) { |
| goog.array.splice(a, c, 0, b); |
| }; |
| goog.array.insertArrayAt = function(a, b, c) { |
| goog.partial(goog.array.splice, a, c, 0).apply(null, b); |
| }; |
| goog.array.insertBefore = function(a, b, c) { |
| var d; |
| 2 == arguments.length || 0 > (d = goog.array.indexOf(a, c)) ? a.push(b) : goog.array.insertAt(a, b, d); |
| }; |
| goog.array.remove = function(a, b) { |
| var c = goog.array.indexOf(a, b), d; |
| (d = 0 <= c) && goog.array.removeAt(a, c); |
| return d; |
| }; |
| goog.array.removeAt = function(a, b) { |
| goog.asserts.assert(null != a.length); |
| return 1 == goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1).length; |
| }; |
| goog.array.removeIf = function(a, b, c) { |
| b = goog.array.findIndex(a, b, c); |
| return 0 <= b ? (goog.array.removeAt(a, b), !0) : !1; |
| }; |
| goog.array.removeAllIf = function(a, b, c) { |
| var d = 0; |
| goog.array.forEachRight(a, function(e, f) { |
| b.call(c, e, f, a) && goog.array.removeAt(a, f) && d++; |
| }); |
| return d; |
| }; |
| goog.array.concat = function(a) { |
| return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); |
| }; |
| goog.array.join = function(a) { |
| return goog.array.ARRAY_PROTOTYPE_.concat.apply(goog.array.ARRAY_PROTOTYPE_, arguments); |
| }; |
| goog.array.toArray = function(a) { |
| var b = a.length; |
| if (0 < b) { |
| for (var c = Array(b), d = 0;d < b;d++) { |
| c[d] = a[d]; |
| } |
| return c; |
| } |
| return []; |
| }; |
| goog.array.clone = goog.array.toArray; |
| goog.array.extend = function(a, b) { |
| for (var c = 1;c < arguments.length;c++) { |
| var d = arguments[c]; |
| if (goog.isArrayLike(d)) { |
| var e = a.length || 0, f = d.length || 0; |
| a.length = e + f; |
| for (var g = 0;g < f;g++) { |
| a[e + g] = d[g]; |
| } |
| } else { |
| a.push(d); |
| } |
| } |
| }; |
| goog.array.splice = function(a, b, c, d) { |
| goog.asserts.assert(null != a.length); |
| return goog.array.ARRAY_PROTOTYPE_.splice.apply(a, goog.array.slice(arguments, 1)); |
| }; |
| goog.array.slice = function(a, b, c) { |
| goog.asserts.assert(null != a.length); |
| return 2 >= arguments.length ? goog.array.ARRAY_PROTOTYPE_.slice.call(a, b) : goog.array.ARRAY_PROTOTYPE_.slice.call(a, b, c); |
| }; |
| goog.array.removeDuplicates = function(a, b, c) { |
| b = b || a; |
| var d = function(a) { |
| return goog.isObject(g) ? "o" + goog.getUid(g) : (typeof g).charAt(0) + g; |
| }; |
| c = c || d; |
| for (var d = {}, e = 0, f = 0;f < a.length;) { |
| var g = a[f++], h = c(g); |
| Object.prototype.hasOwnProperty.call(d, h) || (d[h] = !0, b[e++] = g); |
| } |
| b.length = e; |
| }; |
| goog.array.binarySearch = function(a, b, c) { |
| return goog.array.binarySearch_(a, c || goog.array.defaultCompare, !1, b); |
| }; |
| goog.array.binarySelect = function(a, b, c) { |
| return goog.array.binarySearch_(a, b, !0, void 0, c); |
| }; |
| goog.array.binarySearch_ = function(a, b, c, d, e) { |
| for (var f = 0, g = a.length, h;f < g;) { |
| var k = f + g >> 1, l; |
| l = c ? b.call(e, a[k], k, a) : b(d, a[k]); |
| 0 < l ? f = k + 1 : (g = k, h = !l); |
| } |
| return h ? f : ~f; |
| }; |
| goog.array.sort = function(a, b) { |
| a.sort(b || goog.array.defaultCompare); |
| }; |
| goog.array.stableSort = function(a, b) { |
| for (var c = 0;c < a.length;c++) { |
| a[c] = {index:c, value:a[c]}; |
| } |
| var d = b || goog.array.defaultCompare; |
| goog.array.sort(a, function(a, b) { |
| return d(a.value, b.value) || a.index - b.index; |
| }); |
| for (c = 0;c < a.length;c++) { |
| a[c] = a[c].value; |
| } |
| }; |
| goog.array.sortByKey = function(a, b, c) { |
| var d = c || goog.array.defaultCompare; |
| goog.array.sort(a, function(a, c) { |
| return d(b(a), b(c)); |
| }); |
| }; |
| goog.array.sortObjectsByKey = function(a, b, c) { |
| goog.array.sortByKey(a, function(a) { |
| return a[b]; |
| }, c); |
| }; |
| goog.array.isSorted = function(a, b, c) { |
| b = b || goog.array.defaultCompare; |
| for (var d = 1;d < a.length;d++) { |
| var e = b(a[d - 1], a[d]); |
| if (0 < e || 0 == e && c) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.array.equals = function(a, b, c) { |
| if (!goog.isArrayLike(a) || !goog.isArrayLike(b) || a.length != b.length) { |
| return !1; |
| } |
| var d = a.length; |
| c = c || goog.array.defaultCompareEquality; |
| for (var e = 0;e < d;e++) { |
| if (!c(a[e], b[e])) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.array.compare3 = function(a, b, c) { |
| c = c || goog.array.defaultCompare; |
| for (var d = Math.min(a.length, b.length), e = 0;e < d;e++) { |
| var f = c(a[e], b[e]); |
| if (0 != f) { |
| return f; |
| } |
| } |
| return goog.array.defaultCompare(a.length, b.length); |
| }; |
| goog.array.defaultCompare = function(a, b) { |
| return a > b ? 1 : a < b ? -1 : 0; |
| }; |
| goog.array.inverseDefaultCompare = function(a, b) { |
| return -goog.array.defaultCompare(a, b); |
| }; |
| goog.array.defaultCompareEquality = function(a, b) { |
| return a === b; |
| }; |
| goog.array.binaryInsert = function(a, b, c) { |
| c = goog.array.binarySearch(a, b, c); |
| return 0 > c ? (goog.array.insertAt(a, b, -(c + 1)), !0) : !1; |
| }; |
| goog.array.binaryRemove = function(a, b, c) { |
| b = goog.array.binarySearch(a, b, c); |
| return 0 <= b ? goog.array.removeAt(a, b) : !1; |
| }; |
| goog.array.bucket = function(a, b, c) { |
| for (var d = {}, e = 0;e < a.length;e++) { |
| var f = a[e], g = b.call(c, f, e, a); |
| goog.isDef(g) && (d[g] || (d[g] = [])).push(f); |
| } |
| return d; |
| }; |
| goog.array.toObject = function(a, b, c) { |
| var d = {}; |
| goog.array.forEach(a, function(e, f) { |
| d[b.call(c, e, f, a)] = e; |
| }); |
| return d; |
| }; |
| goog.array.range = function(a, b, c) { |
| var d = [], e = 0, f = a; |
| c = c || 1; |
| void 0 !== b && (e = a, f = b); |
| if (0 > c * (f - e)) { |
| return []; |
| } |
| if (0 < c) { |
| for (a = e;a < f;a += c) { |
| d.push(a); |
| } |
| } else { |
| for (a = e;a > f;a += c) { |
| d.push(a); |
| } |
| } |
| return d; |
| }; |
| goog.array.repeat = function(a, b) { |
| for (var c = [], d = 0;d < b;d++) { |
| c[d] = a; |
| } |
| return c; |
| }; |
| goog.array.flatten = function(a) { |
| for (var b = [], c = 0;c < arguments.length;c++) { |
| var d = arguments[c]; |
| if (goog.isArray(d)) { |
| for (var e = 0;e < d.length;e += 8192) { |
| for (var f = goog.array.slice(d, e, e + 8192), f = goog.array.flatten.apply(null, f), g = 0;g < f.length;g++) { |
| b.push(f[g]); |
| } |
| } |
| } else { |
| b.push(d); |
| } |
| } |
| return b; |
| }; |
| goog.array.rotate = function(a, b) { |
| goog.asserts.assert(null != a.length); |
| a.length && (b %= a.length, 0 < b ? goog.array.ARRAY_PROTOTYPE_.unshift.apply(a, a.splice(-b, b)) : 0 > b && goog.array.ARRAY_PROTOTYPE_.push.apply(a, a.splice(0, -b))); |
| return a; |
| }; |
| goog.array.moveItem = function(a, b, c) { |
| goog.asserts.assert(0 <= b && b < a.length); |
| goog.asserts.assert(0 <= c && c < a.length); |
| b = goog.array.ARRAY_PROTOTYPE_.splice.call(a, b, 1); |
| goog.array.ARRAY_PROTOTYPE_.splice.call(a, c, 0, b[0]); |
| }; |
| goog.array.zip = function(a) { |
| if (!arguments.length) { |
| return []; |
| } |
| for (var b = [], c = 0;;c++) { |
| for (var d = [], e = 0;e < arguments.length;e++) { |
| var f = arguments[e]; |
| if (c >= f.length) { |
| return b; |
| } |
| d.push(f[c]); |
| } |
| b.push(d); |
| } |
| }; |
| goog.array.shuffle = function(a, b) { |
| for (var c = b || Math.random, d = a.length - 1;0 < d;d--) { |
| var e = Math.floor(c() * (d + 1)), f = a[d]; |
| a[d] = a[e]; |
| a[e] = f; |
| } |
| }; |
| goog.array.copyByIndex = function(a, b) { |
| var c = []; |
| goog.array.forEach(b, function(b) { |
| c.push(a[b]); |
| }); |
| return c; |
| }; |
| goog.async.WorkQueue = function() { |
| this.workTail_ = this.workHead_ = null; |
| }; |
| goog.async.WorkQueue.DEFAULT_MAX_UNUSED = 100; |
| goog.async.WorkQueue.freelist_ = new goog.async.FreeList(function() { |
| return new goog.async.WorkItem; |
| }, function(a) { |
| a.reset(); |
| }, goog.async.WorkQueue.DEFAULT_MAX_UNUSED); |
| goog.async.WorkQueue.prototype.add = function(a, b) { |
| var c = this.getUnusedItem_(); |
| c.set(a, b); |
| this.workTail_ ? this.workTail_.next = c : (goog.asserts.assert(!this.workHead_), this.workHead_ = c); |
| this.workTail_ = c; |
| }; |
| goog.async.WorkQueue.prototype.remove = function() { |
| var a = null; |
| this.workHead_ && (a = this.workHead_, this.workHead_ = this.workHead_.next, this.workHead_ || (this.workTail_ = null), a.next = null); |
| return a; |
| }; |
| goog.async.WorkQueue.prototype.returnUnused = function(a) { |
| goog.async.WorkQueue.freelist_.put(a); |
| }; |
| goog.async.WorkQueue.prototype.getUnusedItem_ = function() { |
| return goog.async.WorkQueue.freelist_.get(); |
| }; |
| goog.async.WorkItem = function() { |
| this.next = this.scope = this.fn = null; |
| }; |
| goog.async.WorkItem.prototype.set = function(a, b) { |
| this.fn = a; |
| this.scope = b; |
| this.next = null; |
| }; |
| goog.async.WorkItem.prototype.reset = function() { |
| this.next = this.scope = this.fn = null; |
| }; |
| goog.debug.entryPointRegistry = {}; |
| goog.debug.EntryPointMonitor = function() { |
| }; |
| goog.debug.entryPointRegistry.refList_ = []; |
| goog.debug.entryPointRegistry.monitors_ = []; |
| goog.debug.entryPointRegistry.monitorsMayExist_ = !1; |
| goog.debug.entryPointRegistry.register = function(a) { |
| goog.debug.entryPointRegistry.refList_[goog.debug.entryPointRegistry.refList_.length] = a; |
| if (goog.debug.entryPointRegistry.monitorsMayExist_) { |
| for (var b = goog.debug.entryPointRegistry.monitors_, c = 0;c < b.length;c++) { |
| a(goog.bind(b[c].wrap, b[c])); |
| } |
| } |
| }; |
| goog.debug.entryPointRegistry.monitorAll = function(a) { |
| goog.debug.entryPointRegistry.monitorsMayExist_ = !0; |
| for (var b = goog.bind(a.wrap, a), c = 0;c < goog.debug.entryPointRegistry.refList_.length;c++) { |
| goog.debug.entryPointRegistry.refList_[c](b); |
| } |
| goog.debug.entryPointRegistry.monitors_.push(a); |
| }; |
| goog.debug.entryPointRegistry.unmonitorAllIfPossible = function(a) { |
| var b = goog.debug.entryPointRegistry.monitors_; |
| goog.asserts.assert(a == b[b.length - 1], "Only the most recent monitor can be unwrapped."); |
| a = goog.bind(a.unwrap, a); |
| for (var c = 0;c < goog.debug.entryPointRegistry.refList_.length;c++) { |
| goog.debug.entryPointRegistry.refList_[c](a); |
| } |
| b.length--; |
| }; |
| goog.debug.LogBuffer = function() { |
| goog.asserts.assert(goog.debug.LogBuffer.isBufferingEnabled(), "Cannot use goog.debug.LogBuffer without defining goog.debug.LogBuffer.CAPACITY."); |
| this.clear(); |
| }; |
| goog.debug.LogBuffer.getInstance = function() { |
| goog.debug.LogBuffer.instance_ || (goog.debug.LogBuffer.instance_ = new goog.debug.LogBuffer); |
| return goog.debug.LogBuffer.instance_; |
| }; |
| goog.debug.LogBuffer.CAPACITY = 0; |
| goog.debug.LogBuffer.prototype.addRecord = function(a, b, c) { |
| var d = (this.curIndex_ + 1) % goog.debug.LogBuffer.CAPACITY; |
| this.curIndex_ = d; |
| if (this.isFull_) { |
| return d = this.buffer_[d], d.reset(a, b, c), d; |
| } |
| this.isFull_ = d == goog.debug.LogBuffer.CAPACITY - 1; |
| return this.buffer_[d] = new goog.debug.LogRecord(a, b, c); |
| }; |
| goog.debug.LogBuffer.isBufferingEnabled = function() { |
| return 0 < goog.debug.LogBuffer.CAPACITY; |
| }; |
| goog.debug.LogBuffer.prototype.clear = function() { |
| this.buffer_ = Array(goog.debug.LogBuffer.CAPACITY); |
| this.curIndex_ = -1; |
| this.isFull_ = !1; |
| }; |
| goog.debug.LogBuffer.prototype.forEachRecord = function(a) { |
| var b = this.buffer_; |
| if (b[0]) { |
| var c = this.curIndex_, d = this.isFull_ ? c : -1; |
| do { |
| d = (d + 1) % goog.debug.LogBuffer.CAPACITY, a(b[d]); |
| } while (d != c); |
| } |
| }; |
| goog.events.ListenerMap = function(a) { |
| this.src = a; |
| this.listeners = {}; |
| this.typeCount_ = 0; |
| }; |
| goog.events.ListenerMap.prototype.getTypeCount = function() { |
| return this.typeCount_; |
| }; |
| goog.events.ListenerMap.prototype.getListenerCount = function() { |
| var a = 0, b; |
| for (b in this.listeners) { |
| a += this.listeners[b].length; |
| } |
| return a; |
| }; |
| goog.events.ListenerMap.prototype.add = function(a, b, c, d, e) { |
| var f = a.toString(); |
| a = this.listeners[f]; |
| a || (a = this.listeners[f] = [], this.typeCount_++); |
| var g = goog.events.ListenerMap.findListenerIndex_(a, b, d, e); |
| -1 < g ? (b = a[g], c || (b.callOnce = !1)) : (b = new goog.events.Listener(b, null, this.src, f, !!d, e), b.callOnce = c, a.push(b)); |
| return b; |
| }; |
| goog.events.ListenerMap.prototype.remove = function(a, b, c, d) { |
| a = a.toString(); |
| if (!(a in this.listeners)) { |
| return !1; |
| } |
| var e = this.listeners[a]; |
| b = goog.events.ListenerMap.findListenerIndex_(e, b, c, d); |
| return -1 < b ? (e[b].markAsRemoved(), goog.array.removeAt(e, b), 0 == e.length && (delete this.listeners[a], this.typeCount_--), !0) : !1; |
| }; |
| goog.events.ListenerMap.prototype.removeByKey = function(a) { |
| var b = a.type; |
| if (!(b in this.listeners)) { |
| return !1; |
| } |
| var c = goog.array.remove(this.listeners[b], a); |
| c && (a.markAsRemoved(), 0 == this.listeners[b].length && (delete this.listeners[b], this.typeCount_--)); |
| return c; |
| }; |
| goog.events.ListenerMap.prototype.removeAll = function(a) { |
| a = a && a.toString(); |
| var b = 0, c; |
| for (c in this.listeners) { |
| if (!a || c == a) { |
| for (var d = this.listeners[c], e = 0;e < d.length;e++) { |
| ++b, d[e].markAsRemoved(); |
| } |
| delete this.listeners[c]; |
| this.typeCount_--; |
| } |
| } |
| return b; |
| }; |
| goog.events.ListenerMap.prototype.getListeners = function(a, b) { |
| var c = this.listeners[a.toString()], d = []; |
| if (c) { |
| for (var e = 0;e < c.length;++e) { |
| var f = c[e]; |
| f.capture == b && d.push(f); |
| } |
| } |
| return d; |
| }; |
| goog.events.ListenerMap.prototype.getListener = function(a, b, c, d) { |
| a = this.listeners[a.toString()]; |
| var e = -1; |
| a && (e = goog.events.ListenerMap.findListenerIndex_(a, b, c, d)); |
| return -1 < e ? a[e] : null; |
| }; |
| goog.events.ListenerMap.prototype.hasListener = function(a, b) { |
| var c = goog.isDef(a), d = c ? a.toString() : "", e = goog.isDef(b); |
| return goog.object.some(this.listeners, function(a, g) { |
| for (var h = 0;h < a.length;++h) { |
| if (!(c && a[h].type != d || e && a[h].capture != b)) { |
| return !0; |
| } |
| } |
| return !1; |
| }); |
| }; |
| goog.events.ListenerMap.findListenerIndex_ = function(a, b, c, d) { |
| for (var e = 0;e < a.length;++e) { |
| var f = a[e]; |
| if (!f.removed && f.listener == b && f.capture == !!c && f.handler == d) { |
| return e; |
| } |
| } |
| return -1; |
| }; |
| goog.labs = {}; |
| goog.labs.userAgent = {}; |
| goog.labs.userAgent.util = {}; |
| goog.labs.userAgent.util.getNativeUserAgentString_ = function() { |
| var a = goog.labs.userAgent.util.getNavigator_(); |
| return a && (a = a.userAgent) ? a : ""; |
| }; |
| goog.labs.userAgent.util.getNavigator_ = function() { |
| return goog.global.navigator; |
| }; |
| goog.labs.userAgent.util.userAgent_ = goog.labs.userAgent.util.getNativeUserAgentString_(); |
| goog.labs.userAgent.util.setUserAgent = function(a) { |
| goog.labs.userAgent.util.userAgent_ = a || goog.labs.userAgent.util.getNativeUserAgentString_(); |
| }; |
| goog.labs.userAgent.util.getUserAgent = function() { |
| return goog.labs.userAgent.util.userAgent_; |
| }; |
| goog.labs.userAgent.util.matchUserAgent = function(a) { |
| var b = goog.labs.userAgent.util.getUserAgent(); |
| return goog.string.contains(b, a); |
| }; |
| goog.labs.userAgent.util.matchUserAgentIgnoreCase = function(a) { |
| var b = goog.labs.userAgent.util.getUserAgent(); |
| return goog.string.caseInsensitiveContains(b, a); |
| }; |
| goog.labs.userAgent.util.extractVersionTuples = function(a) { |
| for (var b = RegExp("(\\w[\\w ]+)/([^\\s]+)\\s*(?:\\((.*?)\\))?", "g"), c = [], d;d = b.exec(a);) { |
| c.push([d[1], d[2], d[3] || void 0]); |
| } |
| return c; |
| }; |
| goog.labs.userAgent.browser = {}; |
| goog.labs.userAgent.browser.matchOpera_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Opera") || goog.labs.userAgent.util.matchUserAgent("OPR"); |
| }; |
| goog.labs.userAgent.browser.matchIE_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE"); |
| }; |
| goog.labs.userAgent.browser.matchFirefox_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Firefox"); |
| }; |
| goog.labs.userAgent.browser.matchSafari_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Safari") && !(goog.labs.userAgent.browser.matchChrome_() || goog.labs.userAgent.browser.matchCoast_() || goog.labs.userAgent.browser.matchOpera_() || goog.labs.userAgent.browser.isSilk() || goog.labs.userAgent.util.matchUserAgent("Android")); |
| }; |
| goog.labs.userAgent.browser.matchCoast_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Coast"); |
| }; |
| goog.labs.userAgent.browser.matchIosWebview_ = function() { |
| return (goog.labs.userAgent.util.matchUserAgent("iPad") || goog.labs.userAgent.util.matchUserAgent("iPhone")) && !goog.labs.userAgent.browser.matchSafari_() && !goog.labs.userAgent.browser.matchChrome_() && !goog.labs.userAgent.browser.matchCoast_() && goog.labs.userAgent.util.matchUserAgent("AppleWebKit"); |
| }; |
| goog.labs.userAgent.browser.matchChrome_ = function() { |
| return (goog.labs.userAgent.util.matchUserAgent("Chrome") || goog.labs.userAgent.util.matchUserAgent("CriOS")) && !goog.labs.userAgent.browser.matchOpera_(); |
| }; |
| goog.labs.userAgent.browser.matchAndroidBrowser_ = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Android") && !(goog.labs.userAgent.browser.isChrome() || goog.labs.userAgent.browser.isFirefox() || goog.labs.userAgent.browser.isOpera() || goog.labs.userAgent.browser.isSilk()); |
| }; |
| goog.labs.userAgent.browser.isOpera = goog.labs.userAgent.browser.matchOpera_; |
| goog.labs.userAgent.browser.isIE = goog.labs.userAgent.browser.matchIE_; |
| goog.labs.userAgent.browser.isFirefox = goog.labs.userAgent.browser.matchFirefox_; |
| goog.labs.userAgent.browser.isSafari = goog.labs.userAgent.browser.matchSafari_; |
| goog.labs.userAgent.browser.isCoast = goog.labs.userAgent.browser.matchCoast_; |
| goog.labs.userAgent.browser.isIosWebview = goog.labs.userAgent.browser.matchIosWebview_; |
| goog.labs.userAgent.browser.isChrome = goog.labs.userAgent.browser.matchChrome_; |
| goog.labs.userAgent.browser.isAndroidBrowser = goog.labs.userAgent.browser.matchAndroidBrowser_; |
| goog.labs.userAgent.browser.isSilk = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Silk"); |
| }; |
| goog.labs.userAgent.browser.getVersion = function() { |
| function a(a) { |
| a = goog.array.find(a, d); |
| return c[a] || ""; |
| } |
| var b = goog.labs.userAgent.util.getUserAgent(); |
| if (goog.labs.userAgent.browser.isIE()) { |
| return goog.labs.userAgent.browser.getIEVersion_(b); |
| } |
| var b = goog.labs.userAgent.util.extractVersionTuples(b), c = {}; |
| goog.array.forEach(b, function(a) { |
| c[a[0]] = a[1]; |
| }); |
| var d = goog.partial(goog.object.containsKey, c); |
| return goog.labs.userAgent.browser.isOpera() ? a(["Version", "Opera", "OPR"]) : goog.labs.userAgent.browser.isChrome() ? a(["Chrome", "CriOS"]) : (b = b[2]) && b[1] || ""; |
| }; |
| goog.labs.userAgent.browser.isVersionOrHigher = function(a) { |
| return 0 <= goog.string.compareVersions(goog.labs.userAgent.browser.getVersion(), a); |
| }; |
| goog.labs.userAgent.browser.getIEVersion_ = function(a) { |
| var b = /rv: *([\d\.]*)/.exec(a); |
| if (b && b[1]) { |
| return b[1]; |
| } |
| var b = "", c = /MSIE +([\d\.]+)/.exec(a); |
| if (c && c[1]) { |
| if (a = /Trident\/(\d.\d)/.exec(a), "7.0" == c[1]) { |
| if (a && a[1]) { |
| switch(a[1]) { |
| case "4.0": |
| b = "8.0"; |
| break; |
| case "5.0": |
| b = "9.0"; |
| break; |
| case "6.0": |
| b = "10.0"; |
| break; |
| case "7.0": |
| b = "11.0"; |
| } |
| } else { |
| b = "7.0"; |
| } |
| } else { |
| b = c[1]; |
| } |
| } |
| return b; |
| }; |
| goog.labs.userAgent.engine = {}; |
| goog.labs.userAgent.engine.isPresto = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Presto"); |
| }; |
| goog.labs.userAgent.engine.isTrident = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Trident") || goog.labs.userAgent.util.matchUserAgent("MSIE"); |
| }; |
| goog.labs.userAgent.engine.isWebKit = function() { |
| return goog.labs.userAgent.util.matchUserAgentIgnoreCase("WebKit"); |
| }; |
| goog.labs.userAgent.engine.isGecko = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Gecko") && !goog.labs.userAgent.engine.isWebKit() && !goog.labs.userAgent.engine.isTrident(); |
| }; |
| goog.labs.userAgent.engine.getVersion = function() { |
| var a = goog.labs.userAgent.util.getUserAgent(); |
| if (a) { |
| var a = goog.labs.userAgent.util.extractVersionTuples(a), b = a[1]; |
| if (b) { |
| return "Gecko" == b[0] ? goog.labs.userAgent.engine.getVersionForKey_(a, "Firefox") : b[1]; |
| } |
| var a = a[0], c; |
| if (a && (c = a[2]) && (c = /Trident\/([^\s;]+)/.exec(c))) { |
| return c[1]; |
| } |
| } |
| return ""; |
| }; |
| goog.labs.userAgent.engine.isVersionOrHigher = function(a) { |
| return 0 <= goog.string.compareVersions(goog.labs.userAgent.engine.getVersion(), a); |
| }; |
| goog.labs.userAgent.engine.getVersionForKey_ = function(a, b) { |
| var c = goog.array.find(a, function(a) { |
| return b == a[0]; |
| }); |
| return c && c[1] || ""; |
| }; |
| goog.async.throwException = function(a) { |
| goog.global.setTimeout(function() { |
| throw a; |
| }, 0); |
| }; |
| goog.async.nextTick = function(a, b, c) { |
| var d = a; |
| b && (d = goog.bind(a, b)); |
| d = goog.async.nextTick.wrapCallback_(d); |
| !goog.isFunction(goog.global.setImmediate) || !c && goog.global.Window && goog.global.Window.prototype && goog.global.Window.prototype.setImmediate == goog.global.setImmediate ? (goog.async.nextTick.setImmediate_ || (goog.async.nextTick.setImmediate_ = goog.async.nextTick.getSetImmediateEmulator_()), goog.async.nextTick.setImmediate_(d)) : goog.global.setImmediate(d); |
| }; |
| goog.async.nextTick.getSetImmediateEmulator_ = function() { |
| var a = goog.global.MessageChannel; |
| "undefined" === typeof a && "undefined" !== typeof window && window.postMessage && window.addEventListener && !goog.labs.userAgent.engine.isPresto() && (a = function() { |
| var a = document.createElement("iframe"); |
| a.style.display = "none"; |
| a.src = ""; |
| document.documentElement.appendChild(a); |
| var b = a.contentWindow, a = b.document; |
| a.open(); |
| a.write(""); |
| a.close(); |
| var c = "callImmediate" + Math.random(), d = "file:" == b.location.protocol ? "*" : b.location.protocol + "//" + b.location.host, a = goog.bind(function(a) { |
| if (("*" == d || a.origin == d) && a.data == c) { |
| this.port1.onmessage(); |
| } |
| }, this); |
| b.addEventListener("message", a, !1); |
| this.port1 = {}; |
| this.port2 = {postMessage:function() { |
| b.postMessage(c, d); |
| }}; |
| }); |
| if ("undefined" !== typeof a && !goog.labs.userAgent.browser.isIE()) { |
| var b = new a, c = {}, d = c; |
| b.port1.onmessage = function() { |
| if (goog.isDef(c.next)) { |
| c = c.next; |
| var a = c.cb; |
| c.cb = null; |
| a(); |
| } |
| }; |
| return function(a) { |
| d.next = {cb:a}; |
| d = d.next; |
| b.port2.postMessage(0); |
| }; |
| } |
| return "undefined" !== typeof document && "onreadystatechange" in document.createElement("script") ? function(a) { |
| var b = document.createElement("script"); |
| b.onreadystatechange = function() { |
| b.onreadystatechange = null; |
| b.parentNode.removeChild(b); |
| b = null; |
| a(); |
| a = null; |
| }; |
| document.documentElement.appendChild(b); |
| } : function(a) { |
| goog.global.setTimeout(a, 0); |
| }; |
| }; |
| goog.async.nextTick.wrapCallback_ = goog.functions.identity; |
| goog.debug.entryPointRegistry.register(function(a) { |
| goog.async.nextTick.wrapCallback_ = a; |
| }); |
| goog.labs.userAgent.platform = {}; |
| goog.labs.userAgent.platform.isAndroid = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Android"); |
| }; |
| goog.labs.userAgent.platform.isIpod = function() { |
| return goog.labs.userAgent.util.matchUserAgent("iPod"); |
| }; |
| goog.labs.userAgent.platform.isIphone = function() { |
| return goog.labs.userAgent.util.matchUserAgent("iPhone") && !goog.labs.userAgent.util.matchUserAgent("iPod") && !goog.labs.userAgent.util.matchUserAgent("iPad"); |
| }; |
| goog.labs.userAgent.platform.isIpad = function() { |
| return goog.labs.userAgent.util.matchUserAgent("iPad"); |
| }; |
| goog.labs.userAgent.platform.isIos = function() { |
| return goog.labs.userAgent.platform.isIphone() || goog.labs.userAgent.platform.isIpad() || goog.labs.userAgent.platform.isIpod(); |
| }; |
| goog.labs.userAgent.platform.isMacintosh = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Macintosh"); |
| }; |
| goog.labs.userAgent.platform.isLinux = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Linux"); |
| }; |
| goog.labs.userAgent.platform.isWindows = function() { |
| return goog.labs.userAgent.util.matchUserAgent("Windows"); |
| }; |
| goog.labs.userAgent.platform.isChromeOS = function() { |
| return goog.labs.userAgent.util.matchUserAgent("CrOS"); |
| }; |
| goog.labs.userAgent.platform.getVersion = function() { |
| var a = goog.labs.userAgent.util.getUserAgent(), b = ""; |
| goog.labs.userAgent.platform.isWindows() ? (b = /Windows (?:NT|Phone) ([0-9.]+)/, b = (a = b.exec(a)) ? a[1] : "0.0") : goog.labs.userAgent.platform.isIos() ? (b = /(?:iPhone|iPod|iPad|CPU)\s+OS\s+(\S+)/, b = (a = b.exec(a)) && a[1].replace(/_/g, ".")) : goog.labs.userAgent.platform.isMacintosh() ? (b = /Mac OS X ([0-9_.]+)/, b = (a = b.exec(a)) ? a[1].replace(/_/g, ".") : "10") : goog.labs.userAgent.platform.isAndroid() ? (b = /Android\s+([^\);]+)(\)|;)/, b = (a = b.exec(a)) && a[1]) : goog.labs.userAgent.platform.isChromeOS() && |
| (b = /(?:CrOS\s+(?:i686|x86_64)\s+([0-9.]+))/, b = (a = b.exec(a)) && a[1]); |
| return b || ""; |
| }; |
| goog.labs.userAgent.platform.isVersionOrHigher = function(a) { |
| return 0 <= goog.string.compareVersions(goog.labs.userAgent.platform.getVersion(), a); |
| }; |
| goog.math = {}; |
| goog.math.randomInt = function(a) { |
| return Math.floor(Math.random() * a); |
| }; |
| goog.math.uniformRandom = function(a, b) { |
| return a + Math.random() * (b - a); |
| }; |
| goog.math.clamp = function(a, b, c) { |
| return Math.min(Math.max(a, b), c); |
| }; |
| goog.math.modulo = function(a, b) { |
| var c = a % b; |
| return 0 > c * b ? c + b : c; |
| }; |
| goog.math.lerp = function(a, b, c) { |
| return a + c * (b - a); |
| }; |
| goog.math.nearlyEquals = function(a, b, c) { |
| return Math.abs(a - b) <= (c || 1E-6); |
| }; |
| goog.math.standardAngle = function(a) { |
| return goog.math.modulo(a, 360); |
| }; |
| goog.math.standardAngleInRadians = function(a) { |
| return goog.math.modulo(a, 2 * Math.PI); |
| }; |
| goog.math.toRadians = function(a) { |
| return a * Math.PI / 180; |
| }; |
| goog.math.toDegrees = function(a) { |
| return 180 * a / Math.PI; |
| }; |
| goog.math.angleDx = function(a, b) { |
| return b * Math.cos(goog.math.toRadians(a)); |
| }; |
| goog.math.angleDy = function(a, b) { |
| return b * Math.sin(goog.math.toRadians(a)); |
| }; |
| goog.math.angle = function(a, b, c, d) { |
| return goog.math.standardAngle(goog.math.toDegrees(Math.atan2(d - b, c - a))); |
| }; |
| goog.math.angleDifference = function(a, b) { |
| var c = goog.math.standardAngle(b) - goog.math.standardAngle(a); |
| 180 < c ? c -= 360 : -180 >= c && (c = 360 + c); |
| return c; |
| }; |
| goog.math.sign = function(a) { |
| return 0 == a ? 0 : 0 > a ? -1 : 1; |
| }; |
| goog.math.longestCommonSubsequence = function(a, b, c, d) { |
| c = c || function(a, b) { |
| return a == b; |
| }; |
| d = d || function(b, c) { |
| return a[b]; |
| }; |
| for (var e = a.length, f = b.length, g = [], h = 0;h < e + 1;h++) { |
| g[h] = [], g[h][0] = 0; |
| } |
| for (var k = 0;k < f + 1;k++) { |
| g[0][k] = 0; |
| } |
| for (h = 1;h <= e;h++) { |
| for (k = 1;k <= f;k++) { |
| c(a[h - 1], b[k - 1]) ? g[h][k] = g[h - 1][k - 1] + 1 : g[h][k] = Math.max(g[h - 1][k], g[h][k - 1]); |
| } |
| } |
| for (var l = [], h = e, k = f;0 < h && 0 < k;) { |
| c(a[h - 1], b[k - 1]) ? (l.unshift(d(h - 1, k - 1)), h--, k--) : g[h - 1][k] > g[h][k - 1] ? h-- : k--; |
| } |
| return l; |
| }; |
| goog.math.sum = function(a) { |
| return goog.array.reduce(arguments, function(a, c) { |
| return a + c; |
| }, 0); |
| }; |
| goog.math.average = function(a) { |
| return goog.math.sum.apply(null, arguments) / arguments.length; |
| }; |
| goog.math.sampleVariance = function(a) { |
| var b = arguments.length; |
| if (2 > b) { |
| return 0; |
| } |
| var c = goog.math.average.apply(null, arguments); |
| return goog.math.sum.apply(null, goog.array.map(arguments, function(a) { |
| return Math.pow(a - c, 2); |
| })) / (b - 1); |
| }; |
| goog.math.standardDeviation = function(a) { |
| return Math.sqrt(goog.math.sampleVariance.apply(null, arguments)); |
| }; |
| goog.math.isInt = function(a) { |
| return isFinite(a) && 0 == a % 1; |
| }; |
| goog.math.isFiniteNumber = function(a) { |
| return isFinite(a) && !isNaN(a); |
| }; |
| goog.math.log10Floor = function(a) { |
| if (0 < a) { |
| var b = Math.round(Math.log(a) * Math.LOG10E); |
| return b - (parseFloat("1e" + b) > a); |
| } |
| return 0 == a ? -Infinity : NaN; |
| }; |
| goog.math.safeFloor = function(a, b) { |
| goog.asserts.assert(!goog.isDef(b) || 0 < b); |
| return Math.floor(a + (b || 2E-15)); |
| }; |
| goog.math.safeCeil = function(a, b) { |
| goog.asserts.assert(!goog.isDef(b) || 0 < b); |
| return Math.ceil(a - (b || 2E-15)); |
| }; |
| goog.iter = {}; |
| goog.iter.StopIteration = "StopIteration" in goog.global ? goog.global.StopIteration : Error("StopIteration"); |
| goog.iter.Iterator = function() { |
| }; |
| goog.iter.Iterator.prototype.next = function() { |
| throw goog.iter.StopIteration; |
| }; |
| goog.iter.Iterator.prototype.__iterator__ = function(a) { |
| return this; |
| }; |
| goog.iter.toIterator = function(a) { |
| if (a instanceof goog.iter.Iterator) { |
| return a; |
| } |
| if ("function" == typeof a.__iterator__) { |
| return a.__iterator__(!1); |
| } |
| if (goog.isArrayLike(a)) { |
| var b = 0, c = new goog.iter.Iterator; |
| c.next = function() { |
| for (;;) { |
| if (b >= a.length) { |
| throw goog.iter.StopIteration; |
| } |
| if (b in a) { |
| return a[b++]; |
| } |
| b++; |
| } |
| }; |
| return c; |
| } |
| throw Error("Not implemented"); |
| }; |
| goog.iter.forEach = function(a, b, c) { |
| if (goog.isArrayLike(a)) { |
| try { |
| goog.array.forEach(a, b, c); |
| } catch (d) { |
| if (d !== goog.iter.StopIteration) { |
| throw d; |
| } |
| } |
| } else { |
| a = goog.iter.toIterator(a); |
| try { |
| for (;;) { |
| b.call(c, a.next(), void 0, a); |
| } |
| } catch (d) { |
| if (d !== goog.iter.StopIteration) { |
| throw d; |
| } |
| } |
| } |
| }; |
| goog.iter.filter = function(a, b, c) { |
| var d = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| a.next = function() { |
| for (;;) { |
| var a = d.next(); |
| if (b.call(c, a, void 0, d)) { |
| return a; |
| } |
| } |
| }; |
| return a; |
| }; |
| goog.iter.filterFalse = function(a, b, c) { |
| return goog.iter.filter(a, goog.functions.not(b), c); |
| }; |
| goog.iter.range = function(a, b, c) { |
| var d = 0, e = a, f = c || 1; |
| 1 < arguments.length && (d = a, e = b); |
| if (0 == f) { |
| throw Error("Range step argument must not be zero"); |
| } |
| var g = new goog.iter.Iterator; |
| g.next = function() { |
| if (0 < f && d >= e || 0 > f && d <= e) { |
| throw goog.iter.StopIteration; |
| } |
| var a = d; |
| d += f; |
| return a; |
| }; |
| return g; |
| }; |
| goog.iter.join = function(a, b) { |
| return goog.iter.toArray(a).join(b); |
| }; |
| goog.iter.map = function(a, b, c) { |
| var d = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| a.next = function() { |
| var a = d.next(); |
| return b.call(c, a, void 0, d); |
| }; |
| return a; |
| }; |
| goog.iter.reduce = function(a, b, c, d) { |
| var e = c; |
| goog.iter.forEach(a, function(a) { |
| e = b.call(d, e, a); |
| }); |
| return e; |
| }; |
| goog.iter.some = function(a, b, c) { |
| a = goog.iter.toIterator(a); |
| try { |
| for (;;) { |
| if (b.call(c, a.next(), void 0, a)) { |
| return !0; |
| } |
| } |
| } catch (d) { |
| if (d !== goog.iter.StopIteration) { |
| throw d; |
| } |
| } |
| return !1; |
| }; |
| goog.iter.every = function(a, b, c) { |
| a = goog.iter.toIterator(a); |
| try { |
| for (;;) { |
| if (!b.call(c, a.next(), void 0, a)) { |
| return !1; |
| } |
| } |
| } catch (d) { |
| if (d !== goog.iter.StopIteration) { |
| throw d; |
| } |
| } |
| return !0; |
| }; |
| goog.iter.chain = function(a) { |
| return goog.iter.chainFromIterable(arguments); |
| }; |
| goog.iter.chainFromIterable = function(a) { |
| var b = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| var c = null; |
| a.next = function() { |
| for (;;) { |
| if (null == c) { |
| var a = b.next(); |
| c = goog.iter.toIterator(a); |
| } |
| try { |
| return c.next(); |
| } catch (e) { |
| if (e !== goog.iter.StopIteration) { |
| throw e; |
| } |
| c = null; |
| } |
| } |
| }; |
| return a; |
| }; |
| goog.iter.dropWhile = function(a, b, c) { |
| var d = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| var e = !0; |
| a.next = function() { |
| for (;;) { |
| var a = d.next(); |
| if (!e || !b.call(c, a, void 0, d)) { |
| return e = !1, a; |
| } |
| } |
| }; |
| return a; |
| }; |
| goog.iter.takeWhile = function(a, b, c) { |
| var d = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| a.next = function() { |
| var a = d.next(); |
| if (b.call(c, a, void 0, d)) { |
| return a; |
| } |
| throw goog.iter.StopIteration; |
| }; |
| return a; |
| }; |
| goog.iter.toArray = function(a) { |
| if (goog.isArrayLike(a)) { |
| return goog.array.toArray(a); |
| } |
| a = goog.iter.toIterator(a); |
| var b = []; |
| goog.iter.forEach(a, function(a) { |
| b.push(a); |
| }); |
| return b; |
| }; |
| goog.iter.equals = function(a, b, c) { |
| a = goog.iter.zipLongest({}, a, b); |
| var d = c || goog.array.defaultCompareEquality; |
| return goog.iter.every(a, function(a) { |
| return d(a[0], a[1]); |
| }); |
| }; |
| goog.iter.nextOrValue = function(a, b) { |
| try { |
| return goog.iter.toIterator(a).next(); |
| } catch (c) { |
| if (c != goog.iter.StopIteration) { |
| throw c; |
| } |
| return b; |
| } |
| }; |
| goog.iter.product = function(a) { |
| if (goog.array.some(arguments, function(a) { |
| return !a.length; |
| }) || !arguments.length) { |
| return new goog.iter.Iterator; |
| } |
| var b = new goog.iter.Iterator, c = arguments, d = goog.array.repeat(0, c.length); |
| b.next = function() { |
| if (d) { |
| for (var a = goog.array.map(d, function(a, b) { |
| return c[b][a]; |
| }), b = d.length - 1;0 <= b;b--) { |
| goog.asserts.assert(d); |
| if (d[b] < c[b].length - 1) { |
| d[b]++; |
| break; |
| } |
| if (0 == b) { |
| d = null; |
| break; |
| } |
| d[b] = 0; |
| } |
| return a; |
| } |
| throw goog.iter.StopIteration; |
| }; |
| return b; |
| }; |
| goog.iter.cycle = function(a) { |
| var b = goog.iter.toIterator(a), c = [], d = 0; |
| a = new goog.iter.Iterator; |
| var e = !1; |
| a.next = function() { |
| var a = null; |
| if (!e) { |
| try { |
| return a = b.next(), c.push(a), a; |
| } catch (g) { |
| if (g != goog.iter.StopIteration || goog.array.isEmpty(c)) { |
| throw g; |
| } |
| e = !0; |
| } |
| } |
| a = c[d]; |
| d = (d + 1) % c.length; |
| return a; |
| }; |
| return a; |
| }; |
| goog.iter.count = function(a, b) { |
| var c = a || 0, d = goog.isDef(b) ? b : 1, e = new goog.iter.Iterator; |
| e.next = function() { |
| var a = c; |
| c += d; |
| return a; |
| }; |
| return e; |
| }; |
| goog.iter.repeat = function(a) { |
| var b = new goog.iter.Iterator; |
| b.next = goog.functions.constant(a); |
| return b; |
| }; |
| goog.iter.accumulate = function(a) { |
| var b = goog.iter.toIterator(a), c = 0; |
| a = new goog.iter.Iterator; |
| a.next = function() { |
| return c += b.next(); |
| }; |
| return a; |
| }; |
| goog.iter.zip = function(a) { |
| var b = arguments, c = new goog.iter.Iterator; |
| if (0 < b.length) { |
| var d = goog.array.map(b, goog.iter.toIterator); |
| c.next = function() { |
| return goog.array.map(d, function(a) { |
| return a.next(); |
| }); |
| }; |
| } |
| return c; |
| }; |
| goog.iter.zipLongest = function(a, b) { |
| var c = goog.array.slice(arguments, 1), d = new goog.iter.Iterator; |
| if (0 < c.length) { |
| var e = goog.array.map(c, goog.iter.toIterator); |
| d.next = function() { |
| var b = !1, c = goog.array.map(e, function(c) { |
| var d; |
| try { |
| d = c.next(), b = !0; |
| } catch (e) { |
| if (e !== goog.iter.StopIteration) { |
| throw e; |
| } |
| d = a; |
| } |
| return d; |
| }); |
| if (!b) { |
| throw goog.iter.StopIteration; |
| } |
| return c; |
| }; |
| } |
| return d; |
| }; |
| goog.iter.compress = function(a, b) { |
| var c = goog.iter.toIterator(b); |
| return goog.iter.filter(a, function() { |
| return !!c.next(); |
| }); |
| }; |
| goog.iter.GroupByIterator_ = function(a, b) { |
| this.iterator = goog.iter.toIterator(a); |
| this.keyFunc = b || goog.functions.identity; |
| }; |
| goog.inherits(goog.iter.GroupByIterator_, goog.iter.Iterator); |
| goog.iter.GroupByIterator_.prototype.next = function() { |
| for (;this.currentKey == this.targetKey;) { |
| this.currentValue = this.iterator.next(), this.currentKey = this.keyFunc(this.currentValue); |
| } |
| this.targetKey = this.currentKey; |
| return [this.currentKey, this.groupItems_(this.targetKey)]; |
| }; |
| goog.iter.GroupByIterator_.prototype.groupItems_ = function(a) { |
| for (var b = [];this.currentKey == a;) { |
| b.push(this.currentValue); |
| try { |
| this.currentValue = this.iterator.next(); |
| } catch (c) { |
| if (c !== goog.iter.StopIteration) { |
| throw c; |
| } |
| break; |
| } |
| this.currentKey = this.keyFunc(this.currentValue); |
| } |
| return b; |
| }; |
| goog.iter.groupBy = function(a, b) { |
| return new goog.iter.GroupByIterator_(a, b); |
| }; |
| goog.iter.starMap = function(a, b, c) { |
| var d = goog.iter.toIterator(a); |
| a = new goog.iter.Iterator; |
| a.next = function() { |
| var a = goog.iter.toArray(d.next()); |
| return b.apply(c, goog.array.concat(a, void 0, d)); |
| }; |
| return a; |
| }; |
| goog.iter.tee = function(a, b) { |
| var c = goog.iter.toIterator(a), d = goog.isNumber(b) ? b : 2, e = goog.array.map(goog.array.range(d), function() { |
| return []; |
| }), f = function() { |
| var a = c.next(); |
| goog.array.forEach(e, function(b) { |
| b.push(a); |
| }); |
| }; |
| return goog.array.map(e, function(a) { |
| var b = new goog.iter.Iterator; |
| b.next = function() { |
| goog.array.isEmpty(a) && f(); |
| goog.asserts.assert(!goog.array.isEmpty(a)); |
| return a.shift(); |
| }; |
| return b; |
| }); |
| }; |
| goog.iter.enumerate = function(a, b) { |
| return goog.iter.zip(goog.iter.count(b), a); |
| }; |
| goog.iter.limit = function(a, b) { |
| goog.asserts.assert(goog.math.isInt(b) && 0 <= b); |
| var c = goog.iter.toIterator(a), d = new goog.iter.Iterator, e = b; |
| d.next = function() { |
| if (0 < e--) { |
| return c.next(); |
| } |
| throw goog.iter.StopIteration; |
| }; |
| return d; |
| }; |
| goog.iter.consume = function(a, b) { |
| goog.asserts.assert(goog.math.isInt(b) && 0 <= b); |
| for (var c = goog.iter.toIterator(a);0 < b--;) { |
| goog.iter.nextOrValue(c, null); |
| } |
| return c; |
| }; |
| goog.iter.slice = function(a, b, c) { |
| goog.asserts.assert(goog.math.isInt(b) && 0 <= b); |
| a = goog.iter.consume(a, b); |
| goog.isNumber(c) && (goog.asserts.assert(goog.math.isInt(c) && c >= b), a = goog.iter.limit(a, c - b)); |
| return a; |
| }; |
| goog.iter.hasDuplicates_ = function(a) { |
| var b = []; |
| goog.array.removeDuplicates(a, b); |
| return a.length != b.length; |
| }; |
| goog.iter.permutations = function(a, b) { |
| var c = goog.iter.toArray(a), d = goog.isNumber(b) ? b : c.length, c = goog.array.repeat(c, d), c = goog.iter.product.apply(void 0, c); |
| return goog.iter.filter(c, function(a) { |
| return !goog.iter.hasDuplicates_(a); |
| }); |
| }; |
| goog.iter.combinations = function(a, b) { |
| function c(a) { |
| return d[a]; |
| } |
| var d = goog.iter.toArray(a), e = goog.iter.range(d.length), e = goog.iter.permutations(e, b), f = goog.iter.filter(e, function(a) { |
| return goog.array.isSorted(a); |
| }), e = new goog.iter.Iterator; |
| e.next = function() { |
| return goog.array.map(f.next(), c); |
| }; |
| return e; |
| }; |
| goog.iter.combinationsWithReplacement = function(a, b) { |
| function c(a) { |
| return d[a]; |
| } |
| var d = goog.iter.toArray(a), e = goog.array.range(d.length), e = goog.array.repeat(e, b), e = goog.iter.product.apply(void 0, e), f = goog.iter.filter(e, function(a) { |
| return goog.array.isSorted(a); |
| }), e = new goog.iter.Iterator; |
| e.next = function() { |
| return goog.array.map(f.next(), c); |
| }; |
| return e; |
| }; |
| goog.net.XmlHttp = function() { |
| return goog.net.XmlHttp.factory_.createInstance(); |
| }; |
| goog.net.XmlHttp.ASSUME_NATIVE_XHR = !1; |
| goog.net.XmlHttpDefines = {}; |
| goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR = !1; |
| goog.net.XmlHttp.getOptions = function() { |
| return goog.net.XmlHttp.factory_.getOptions(); |
| }; |
| goog.net.XmlHttp.OptionType = {USE_NULL_FUNCTION:0, LOCAL_REQUEST_ERROR:1}; |
| goog.net.XmlHttp.ReadyState = {UNINITIALIZED:0, LOADING:1, LOADED:2, INTERACTIVE:3, COMPLETE:4}; |
| goog.net.XmlHttp.setFactory = function(a, b) { |
| goog.net.XmlHttp.setGlobalFactory(new goog.net.WrapperXmlHttpFactory(goog.asserts.assert(a), goog.asserts.assert(b))); |
| }; |
| goog.net.XmlHttp.setGlobalFactory = function(a) { |
| goog.net.XmlHttp.factory_ = a; |
| }; |
| goog.net.DefaultXmlHttpFactory = function() { |
| goog.net.XmlHttpFactory.call(this); |
| }; |
| goog.inherits(goog.net.DefaultXmlHttpFactory, goog.net.XmlHttpFactory); |
| goog.net.DefaultXmlHttpFactory.prototype.createInstance = function() { |
| var a = this.getProgId_(); |
| return a ? new ActiveXObject(a) : new XMLHttpRequest; |
| }; |
| goog.net.DefaultXmlHttpFactory.prototype.internalGetOptions = function() { |
| var a = {}; |
| this.getProgId_() && (a[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] = !0, a[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] = !0); |
| return a; |
| }; |
| goog.net.DefaultXmlHttpFactory.prototype.getProgId_ = function() { |
| if (goog.net.XmlHttp.ASSUME_NATIVE_XHR || goog.net.XmlHttpDefines.ASSUME_NATIVE_XHR) { |
| return ""; |
| } |
| if (!this.ieProgId_ && "undefined" == typeof XMLHttpRequest && "undefined" != typeof ActiveXObject) { |
| for (var a = ["MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"], b = 0;b < a.length;b++) { |
| var c = a[b]; |
| try { |
| return new ActiveXObject(c), this.ieProgId_ = c; |
| } catch (d) { |
| } |
| } |
| throw Error("Could not create ActiveXObject. ActiveX might be disabled, or MSXML might not be installed"); |
| } |
| return this.ieProgId_; |
| }; |
| goog.net.XmlHttp.setGlobalFactory(new goog.net.DefaultXmlHttpFactory); |
| goog.string.TypedString = function() { |
| }; |
| goog.string.Const = function() { |
| this.stringConstValueWithSecurityContract__googStringSecurityPrivate_ = ""; |
| this.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_ = goog.string.Const.TYPE_MARKER_; |
| }; |
| goog.string.Const.prototype.implementsGoogStringTypedString = !0; |
| goog.string.Const.prototype.getTypedStringValue = function() { |
| return this.stringConstValueWithSecurityContract__googStringSecurityPrivate_; |
| }; |
| goog.string.Const.prototype.toString = function() { |
| return "Const{" + this.stringConstValueWithSecurityContract__googStringSecurityPrivate_ + "}"; |
| }; |
| goog.string.Const.unwrap = function(a) { |
| if (a instanceof goog.string.Const && a.constructor === goog.string.Const && a.STRING_CONST_TYPE_MARKER__GOOG_STRING_SECURITY_PRIVATE_ === goog.string.Const.TYPE_MARKER_) { |
| return a.stringConstValueWithSecurityContract__googStringSecurityPrivate_; |
| } |
| goog.asserts.fail("expected object of type Const, got '" + a + "'"); |
| return "type_error:Const"; |
| }; |
| goog.string.Const.from = function(a) { |
| return goog.string.Const.create__googStringSecurityPrivate_(a); |
| }; |
| goog.string.Const.TYPE_MARKER_ = {}; |
| goog.string.Const.create__googStringSecurityPrivate_ = function(a) { |
| var b = new goog.string.Const; |
| b.stringConstValueWithSecurityContract__googStringSecurityPrivate_ = a; |
| return b; |
| }; |
| goog.html = {}; |
| goog.html.SafeScript = function() { |
| this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = ""; |
| this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| }; |
| goog.html.SafeScript.prototype.implementsGoogStringTypedString = !0; |
| goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.SafeScript.fromConstant = function(a) { |
| a = goog.string.Const.unwrap(a); |
| return 0 === a.length ? goog.html.SafeScript.EMPTY : goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(a); |
| }; |
| goog.html.SafeScript.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseSafeScriptWrappedValue_; |
| }; |
| goog.DEBUG && (goog.html.SafeScript.prototype.toString = function() { |
| return "SafeScript{" + this.privateDoNotAccessOrElseSafeScriptWrappedValue_ + "}"; |
| }); |
| goog.html.SafeScript.unwrap = function(a) { |
| if (a instanceof goog.html.SafeScript && a.constructor === goog.html.SafeScript && a.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.SafeScript.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseSafeScriptWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type SafeScript, got '" + a + "'"); |
| return "type_error:SafeScript"; |
| }; |
| goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse = function(a) { |
| return (new goog.html.SafeScript).initSecurityPrivateDoNotAccessOrElse_(a); |
| }; |
| goog.html.SafeScript.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a) { |
| this.privateDoNotAccessOrElseSafeScriptWrappedValue_ = a; |
| return this; |
| }; |
| goog.html.SafeScript.EMPTY = goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(""); |
| goog.html.SafeStyle = function() { |
| this.privateDoNotAccessOrElseSafeStyleWrappedValue_ = ""; |
| this.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| }; |
| goog.html.SafeStyle.prototype.implementsGoogStringTypedString = !0; |
| goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.SafeStyle.fromConstant = function(a) { |
| a = goog.string.Const.unwrap(a); |
| if (0 === a.length) { |
| return goog.html.SafeStyle.EMPTY; |
| } |
| goog.html.SafeStyle.checkStyle_(a); |
| goog.asserts.assert(goog.string.endsWith(a, ";"), "Last character of style string is not ';': " + a); |
| goog.asserts.assert(goog.string.contains(a, ":"), "Style string must contain at least one ':', to specify a \"name: value\" pair: " + a); |
| return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(a); |
| }; |
| goog.html.SafeStyle.checkStyle_ = function(a) { |
| goog.asserts.assert(!/[<>]/.test(a), "Forbidden characters in style string: " + a); |
| }; |
| goog.html.SafeStyle.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseSafeStyleWrappedValue_; |
| }; |
| goog.DEBUG && (goog.html.SafeStyle.prototype.toString = function() { |
| return "SafeStyle{" + this.privateDoNotAccessOrElseSafeStyleWrappedValue_ + "}"; |
| }); |
| goog.html.SafeStyle.unwrap = function(a) { |
| if (a instanceof goog.html.SafeStyle && a.constructor === goog.html.SafeStyle && a.SAFE_STYLE_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.SafeStyle.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseSafeStyleWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type SafeStyle, got '" + a + "'"); |
| return "type_error:SafeStyle"; |
| }; |
| goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse = function(a) { |
| return (new goog.html.SafeStyle).initSecurityPrivateDoNotAccessOrElse_(a); |
| }; |
| goog.html.SafeStyle.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a) { |
| this.privateDoNotAccessOrElseSafeStyleWrappedValue_ = a; |
| return this; |
| }; |
| goog.html.SafeStyle.EMPTY = goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""); |
| goog.html.SafeStyle.INNOCUOUS_STRING = "zClosurez"; |
| goog.html.SafeStyle.create = function(a) { |
| var b = "", c; |
| for (c in a) { |
| if (!/^[-_a-zA-Z0-9]+$/.test(c)) { |
| throw Error("Name allows only [-_a-zA-Z0-9], got: " + c); |
| } |
| var d = a[c]; |
| null != d && (d instanceof goog.string.Const ? (d = goog.string.Const.unwrap(d), goog.asserts.assert(!/[{;}]/.test(d), "Value does not allow [{;}].")) : goog.html.SafeStyle.VALUE_RE_.test(d) ? goog.html.SafeStyle.hasBalancedQuotes_(d) || (goog.asserts.fail("String value requires balanced quotes, got: " + d), d = goog.html.SafeStyle.INNOCUOUS_STRING) : (goog.asserts.fail("String value allows only [-,.\"'%_!# a-zA-Z0-9], got: " + d), d = goog.html.SafeStyle.INNOCUOUS_STRING), b += c + ":" + d + |
| ";"); |
| } |
| if (!b) { |
| return goog.html.SafeStyle.EMPTY; |
| } |
| goog.html.SafeStyle.checkStyle_(b); |
| return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.SafeStyle.hasBalancedQuotes_ = function(a) { |
| for (var b = !0, c = !0, d = 0;d < a.length;d++) { |
| var e = a.charAt(d); |
| "'" == e && c ? b = !b : '"' == e && b && (c = !c); |
| } |
| return b && c; |
| }; |
| goog.html.SafeStyle.VALUE_RE_ = /^[-,."'%_!# a-zA-Z0-9]+$/; |
| goog.html.SafeStyle.concat = function(a) { |
| var b = "", c = function(a) { |
| goog.isArray(a) ? goog.array.forEach(a, c) : b += goog.html.SafeStyle.unwrap(a); |
| }; |
| goog.array.forEach(arguments, c); |
| return b ? goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b) : goog.html.SafeStyle.EMPTY; |
| }; |
| goog.html.SafeStyleSheet = function() { |
| this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ = ""; |
| this.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| }; |
| goog.html.SafeStyleSheet.prototype.implementsGoogStringTypedString = !0; |
| goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.SafeStyleSheet.concat = function(a) { |
| var b = "", c = function(a) { |
| goog.isArray(a) ? goog.array.forEach(a, c) : b += goog.html.SafeStyleSheet.unwrap(a); |
| }; |
| goog.array.forEach(arguments, c); |
| return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.SafeStyleSheet.fromConstant = function(a) { |
| a = goog.string.Const.unwrap(a); |
| if (0 === a.length) { |
| return goog.html.SafeStyleSheet.EMPTY; |
| } |
| goog.asserts.assert(!goog.string.contains(a, "<"), "Forbidden '<' character in style sheet string: " + a); |
| return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(a); |
| }; |
| goog.html.SafeStyleSheet.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_; |
| }; |
| goog.DEBUG && (goog.html.SafeStyleSheet.prototype.toString = function() { |
| return "SafeStyleSheet{" + this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ + "}"; |
| }); |
| goog.html.SafeStyleSheet.unwrap = function(a) { |
| if (a instanceof goog.html.SafeStyleSheet && a.constructor === goog.html.SafeStyleSheet && a.SAFE_SCRIPT_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.SafeStyleSheet.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type SafeStyleSheet, got '" + a + "'"); |
| return "type_error:SafeStyleSheet"; |
| }; |
| goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse = function(a) { |
| return (new goog.html.SafeStyleSheet).initSecurityPrivateDoNotAccessOrElse_(a); |
| }; |
| goog.html.SafeStyleSheet.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a) { |
| this.privateDoNotAccessOrElseSafeStyleSheetWrappedValue_ = a; |
| return this; |
| }; |
| goog.html.SafeStyleSheet.EMPTY = goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(""); |
| goog.html.SafeUrl = function() { |
| this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = ""; |
| this.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| }; |
| goog.html.SafeUrl.INNOCUOUS_STRING = "about:invalid#zClosurez"; |
| goog.html.SafeUrl.prototype.implementsGoogStringTypedString = !0; |
| goog.html.SafeUrl.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_; |
| }; |
| goog.html.SafeUrl.prototype.implementsGoogI18nBidiDirectionalString = !0; |
| goog.html.SafeUrl.prototype.getDirection = function() { |
| return goog.i18n.bidi.Dir.LTR; |
| }; |
| goog.DEBUG && (goog.html.SafeUrl.prototype.toString = function() { |
| return "SafeUrl{" + this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ + "}"; |
| }); |
| goog.html.SafeUrl.unwrap = function(a) { |
| if (a instanceof goog.html.SafeUrl && a.constructor === goog.html.SafeUrl && a.SAFE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type SafeUrl, got '" + a + "'"); |
| return "type_error:SafeUrl"; |
| }; |
| goog.html.SafeUrl.fromConstant = function(a) { |
| return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a)); |
| }; |
| goog.html.SAFE_BLOB_TYPE_PATTERN_ = /^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)$/i; |
| goog.html.SafeUrl.fromBlob = function(a) { |
| a = goog.html.SAFE_BLOB_TYPE_PATTERN_.test(a.type) ? goog.fs.url.createObjectUrl(a) : goog.html.SafeUrl.INNOCUOUS_STRING; |
| return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a); |
| }; |
| goog.html.SAFE_URL_PATTERN_ = /^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/i; |
| goog.html.SafeUrl.sanitize = function(a) { |
| if (a instanceof goog.html.SafeUrl) { |
| return a; |
| } |
| a = a.implementsGoogStringTypedString ? a.getTypedStringValue() : String(a); |
| a = goog.html.SAFE_URL_PATTERN_.test(a) ? goog.html.SafeUrl.normalize_(a) : goog.html.SafeUrl.INNOCUOUS_STRING; |
| return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(a); |
| }; |
| goog.html.SafeUrl.normalize_ = function(a) { |
| try { |
| var b = encodeURI(a); |
| } catch (c) { |
| return goog.html.SafeUrl.INNOCUOUS_STRING; |
| } |
| return b.replace(goog.html.SafeUrl.NORMALIZE_MATCHER_, function(a) { |
| return goog.html.SafeUrl.NORMALIZE_REPLACER_MAP_[a]; |
| }); |
| }; |
| goog.html.SafeUrl.NORMALIZE_MATCHER_ = /[()']|%5B|%5D|%25/g; |
| goog.html.SafeUrl.NORMALIZE_REPLACER_MAP_ = {"'":"%27", "(":"%28", ")":"%29", "%5B":"[", "%5D":"]", "%25":"%"}; |
| goog.html.SafeUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse = function(a) { |
| var b = new goog.html.SafeUrl; |
| b.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = a; |
| return b; |
| }; |
| goog.html.TrustedResourceUrl = function() { |
| this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ = ""; |
| this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| }; |
| goog.html.TrustedResourceUrl.prototype.implementsGoogStringTypedString = !0; |
| goog.html.TrustedResourceUrl.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_; |
| }; |
| goog.html.TrustedResourceUrl.prototype.implementsGoogI18nBidiDirectionalString = !0; |
| goog.html.TrustedResourceUrl.prototype.getDirection = function() { |
| return goog.i18n.bidi.Dir.LTR; |
| }; |
| goog.DEBUG && (goog.html.TrustedResourceUrl.prototype.toString = function() { |
| return "TrustedResourceUrl{" + this.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ + "}"; |
| }); |
| goog.html.TrustedResourceUrl.unwrap = function(a) { |
| if (a instanceof goog.html.TrustedResourceUrl && a.constructor === goog.html.TrustedResourceUrl && a.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type TrustedResourceUrl, got '" + a + "'"); |
| return "type_error:TrustedResourceUrl"; |
| }; |
| goog.html.TrustedResourceUrl.fromConstant = function(a) { |
| return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(goog.string.Const.unwrap(a)); |
| }; |
| goog.html.TrustedResourceUrl.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse = function(a) { |
| var b = new goog.html.TrustedResourceUrl; |
| b.privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_ = a; |
| return b; |
| }; |
| goog.html.SafeHtml = function() { |
| this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = ""; |
| this.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_; |
| this.dir_ = null; |
| }; |
| goog.html.SafeHtml.prototype.implementsGoogI18nBidiDirectionalString = !0; |
| goog.html.SafeHtml.prototype.getDirection = function() { |
| return this.dir_; |
| }; |
| goog.html.SafeHtml.prototype.implementsGoogStringTypedString = !0; |
| goog.html.SafeHtml.prototype.getTypedStringValue = function() { |
| return this.privateDoNotAccessOrElseSafeHtmlWrappedValue_; |
| }; |
| goog.DEBUG && (goog.html.SafeHtml.prototype.toString = function() { |
| return "SafeHtml{" + this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ + "}"; |
| }); |
| goog.html.SafeHtml.unwrap = function(a) { |
| if (a instanceof goog.html.SafeHtml && a.constructor === goog.html.SafeHtml && a.SAFE_HTML_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ === goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_) { |
| return a.privateDoNotAccessOrElseSafeHtmlWrappedValue_; |
| } |
| goog.asserts.fail("expected object of type SafeHtml, got '" + a + "'"); |
| return "type_error:SafeHtml"; |
| }; |
| goog.html.SafeHtml.htmlEscape = function(a) { |
| if (a instanceof goog.html.SafeHtml) { |
| return a; |
| } |
| var b = null; |
| a.implementsGoogI18nBidiDirectionalString && (b = a.getDirection()); |
| a = a.implementsGoogStringTypedString ? a.getTypedStringValue() : String(a); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.htmlEscape(a), b); |
| }; |
| goog.html.SafeHtml.htmlEscapePreservingNewlines = function(a) { |
| if (a instanceof goog.html.SafeHtml) { |
| return a; |
| } |
| a = goog.html.SafeHtml.htmlEscape(a); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.newLineToBr(goog.html.SafeHtml.unwrap(a)), a.getDirection()); |
| }; |
| goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces = function(a) { |
| if (a instanceof goog.html.SafeHtml) { |
| return a; |
| } |
| a = goog.html.SafeHtml.htmlEscape(a); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(goog.string.whitespaceEscape(goog.html.SafeHtml.unwrap(a)), a.getDirection()); |
| }; |
| goog.html.SafeHtml.from = goog.html.SafeHtml.htmlEscape; |
| goog.html.SafeHtml.VALID_NAMES_IN_TAG_ = /^[a-zA-Z0-9-]+$/; |
| goog.html.SafeHtml.URL_ATTRIBUTES_ = {action:!0, cite:!0, data:!0, formaction:!0, href:!0, manifest:!0, poster:!0, src:!0}; |
| goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_ = {embed:!0, iframe:!0, link:!0, object:!0, script:!0, style:!0, template:!0}; |
| goog.html.SafeHtml.create = function(a, b, c) { |
| if (!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(a)) { |
| throw Error("Invalid tag name <" + a + ">."); |
| } |
| if (a.toLowerCase() in goog.html.SafeHtml.NOT_ALLOWED_TAG_NAMES_) { |
| throw Error("Tag name <" + a + "> is not allowed for SafeHtml."); |
| } |
| return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse(a, b, c); |
| }; |
| goog.html.SafeHtml.createIframe = function(a, b, c, d) { |
| var e = {}; |
| e.src = a || null; |
| e.srcdoc = b || null; |
| a = goog.html.SafeHtml.combineAttributes(e, {sandbox:""}, c); |
| return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("iframe", a, d); |
| }; |
| goog.html.SafeHtml.createStyle = function(a, b) { |
| var c = goog.html.SafeHtml.combineAttributes({type:"text/css"}, {}, b), d = ""; |
| a = goog.array.concat(a); |
| for (var e = 0;e < a.length;e++) { |
| d += goog.html.SafeStyleSheet.unwrap(a[e]); |
| } |
| d = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(d, goog.i18n.bidi.Dir.NEUTRAL); |
| return goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse("style", c, d); |
| }; |
| goog.html.SafeHtml.getAttrNameAndValue_ = function(a, b, c) { |
| if (c instanceof goog.string.Const) { |
| c = goog.string.Const.unwrap(c); |
| } else { |
| if ("style" == b.toLowerCase()) { |
| c = goog.html.SafeHtml.getStyleValue_(c); |
| } else { |
| if (/^on/i.test(b)) { |
| throw Error('Attribute "' + b + '" requires goog.string.Const value, "' + c + '" given.'); |
| } |
| if (b.toLowerCase() in goog.html.SafeHtml.URL_ATTRIBUTES_) { |
| if (c instanceof goog.html.TrustedResourceUrl) { |
| c = goog.html.TrustedResourceUrl.unwrap(c); |
| } else { |
| if (c instanceof goog.html.SafeUrl) { |
| c = goog.html.SafeUrl.unwrap(c); |
| } else { |
| throw Error('Attribute "' + b + '" on tag "' + a + '" requires goog.html.SafeUrl or goog.string.Const value, "' + c + '" given.'); |
| } |
| } |
| } |
| } |
| } |
| c.implementsGoogStringTypedString && (c = c.getTypedStringValue()); |
| goog.asserts.assert(goog.isString(c) || goog.isNumber(c), "String or number value expected, got " + typeof c + " with value: " + c); |
| return b + '="' + goog.string.htmlEscape(String(c)) + '"'; |
| }; |
| goog.html.SafeHtml.getStyleValue_ = function(a) { |
| if (!goog.isObject(a)) { |
| throw Error('The "style" attribute requires goog.html.SafeStyle or map of style properties, ' + typeof a + " given: " + a); |
| } |
| a instanceof goog.html.SafeStyle || (a = goog.html.SafeStyle.create(a)); |
| return goog.html.SafeStyle.unwrap(a); |
| }; |
| goog.html.SafeHtml.createWithDir = function(a, b, c, d) { |
| b = goog.html.SafeHtml.create(b, c, d); |
| b.dir_ = a; |
| return b; |
| }; |
| goog.html.SafeHtml.concat = function(a) { |
| var b = goog.i18n.bidi.Dir.NEUTRAL, c = "", d = function(a) { |
| goog.isArray(a) ? goog.array.forEach(a, d) : (a = goog.html.SafeHtml.htmlEscape(a), c += goog.html.SafeHtml.unwrap(a), a = a.getDirection(), b == goog.i18n.bidi.Dir.NEUTRAL ? b = a : a != goog.i18n.bidi.Dir.NEUTRAL && b != a && (b = null)); |
| }; |
| goog.array.forEach(arguments, d); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(c, b); |
| }; |
| goog.html.SafeHtml.concatWithDir = function(a, b) { |
| var c = goog.html.SafeHtml.concat(goog.array.slice(arguments, 1)); |
| c.dir_ = a; |
| return c; |
| }; |
| goog.html.SafeHtml.TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = {}; |
| goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse = function(a, b) { |
| return (new goog.html.SafeHtml).initSecurityPrivateDoNotAccessOrElse_(a, b); |
| }; |
| goog.html.SafeHtml.prototype.initSecurityPrivateDoNotAccessOrElse_ = function(a, b) { |
| this.privateDoNotAccessOrElseSafeHtmlWrappedValue_ = a; |
| this.dir_ = b; |
| return this; |
| }; |
| goog.html.SafeHtml.createSafeHtmlTagSecurityPrivateDoNotAccessOrElse = function(a, b, c) { |
| var d = null, e = "<" + a; |
| if (b) { |
| for (var f in b) { |
| if (!goog.html.SafeHtml.VALID_NAMES_IN_TAG_.test(f)) { |
| throw Error('Invalid attribute name "' + f + '".'); |
| } |
| var g = b[f]; |
| goog.isDefAndNotNull(g) && (e += " " + goog.html.SafeHtml.getAttrNameAndValue_(a, f, g)); |
| } |
| } |
| goog.isDef(c) ? goog.isArray(c) || (c = [c]) : c = []; |
| goog.dom.tags.isVoidTag(a.toLowerCase()) ? (goog.asserts.assert(!c.length, "Void tag <" + a + "> does not allow content."), e += ">") : (d = goog.html.SafeHtml.concat(c), e += ">" + goog.html.SafeHtml.unwrap(d) + "</" + a + ">", d = d.getDirection()); |
| (a = b && b.dir) && (d = /^(ltr|rtl|auto)$/i.test(a) ? goog.i18n.bidi.Dir.NEUTRAL : null); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(e, d); |
| }; |
| goog.html.SafeHtml.combineAttributes = function(a, b, c) { |
| var d = {}, e; |
| for (e in a) { |
| goog.asserts.assert(e.toLowerCase() == e, "Must be lower case"), d[e] = a[e]; |
| } |
| for (e in b) { |
| goog.asserts.assert(e.toLowerCase() == e, "Must be lower case"), d[e] = b[e]; |
| } |
| for (e in c) { |
| var f = e.toLowerCase(); |
| if (f in a) { |
| throw Error('Cannot override "' + f + '" attribute, got "' + e + '" with value "' + c[e] + '"'); |
| } |
| f in b && delete d[f]; |
| d[e] = c[e]; |
| } |
| return d; |
| }; |
| goog.html.SafeHtml.EMPTY = goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse("", goog.i18n.bidi.Dir.NEUTRAL); |
| goog.html.uncheckedconversions = {}; |
| goog.html.uncheckedconversions.safeHtmlFromStringKnownToSatisfyTypeContract = function(a, b, c) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(b, c || null); |
| }; |
| goog.html.uncheckedconversions.safeScriptFromStringKnownToSatisfyTypeContract = function(a, b) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmpty(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.SafeScript.createSafeScriptSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.uncheckedconversions.safeStyleFromStringKnownToSatisfyTypeContract = function(a, b) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.uncheckedconversions.safeStyleSheetFromStringKnownToSatisfyTypeContract = function(a, b) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.SafeStyleSheet.createSafeStyleSheetSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract = function(a, b) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.html.uncheckedconversions.trustedResourceUrlFromStringKnownToSatisfyTypeContract = function(a, b) { |
| goog.asserts.assertString(goog.string.Const.unwrap(a), "must provide justification"); |
| goog.asserts.assert(!goog.string.isEmptyOrWhitespace(goog.string.Const.unwrap(a)), "must provide non-empty justification"); |
| return goog.html.TrustedResourceUrl.createTrustedResourceUrlSecurityPrivateDoNotAccessOrElse(b); |
| }; |
| goog.structs = {}; |
| goog.structs.Collection = function() { |
| }; |
| goog.structs.Map = function(a, b) { |
| this.map_ = {}; |
| this.keys_ = []; |
| this.version_ = this.count_ = 0; |
| var c = arguments.length; |
| if (1 < c) { |
| if (c % 2) { |
| throw Error("Uneven number of arguments"); |
| } |
| for (var d = 0;d < c;d += 2) { |
| this.set(arguments[d], arguments[d + 1]); |
| } |
| } else { |
| a && this.addAll(a); |
| } |
| }; |
| goog.structs.Map.prototype.getCount = function() { |
| return this.count_; |
| }; |
| goog.structs.Map.prototype.getValues = function() { |
| this.cleanupKeysArray_(); |
| for (var a = [], b = 0;b < this.keys_.length;b++) { |
| a.push(this.map_[this.keys_[b]]); |
| } |
| return a; |
| }; |
| goog.structs.Map.prototype.getKeys = function() { |
| this.cleanupKeysArray_(); |
| return this.keys_.concat(); |
| }; |
| goog.structs.Map.prototype.containsKey = function(a) { |
| return goog.structs.Map.hasKey_(this.map_, a); |
| }; |
| goog.structs.Map.prototype.containsValue = function(a) { |
| for (var b = 0;b < this.keys_.length;b++) { |
| var c = this.keys_[b]; |
| if (goog.structs.Map.hasKey_(this.map_, c) && this.map_[c] == a) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| goog.structs.Map.prototype.equals = function(a, b) { |
| if (this === a) { |
| return !0; |
| } |
| if (this.count_ != a.getCount()) { |
| return !1; |
| } |
| var c = b || goog.structs.Map.defaultEquals; |
| this.cleanupKeysArray_(); |
| for (var d, e = 0;d = this.keys_[e];e++) { |
| if (!c(this.get(d), a.get(d))) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.structs.Map.defaultEquals = function(a, b) { |
| return a === b; |
| }; |
| goog.structs.Map.prototype.isEmpty = function() { |
| return 0 == this.count_; |
| }; |
| goog.structs.Map.prototype.clear = function() { |
| this.map_ = {}; |
| this.version_ = this.count_ = this.keys_.length = 0; |
| }; |
| goog.structs.Map.prototype.remove = function(a) { |
| return goog.structs.Map.hasKey_(this.map_, a) ? (delete this.map_[a], this.count_--, this.version_++, this.keys_.length > 2 * this.count_ && this.cleanupKeysArray_(), !0) : !1; |
| }; |
| goog.structs.Map.prototype.cleanupKeysArray_ = function() { |
| if (this.count_ != this.keys_.length) { |
| for (var a = 0, b = 0;a < this.keys_.length;) { |
| var c = this.keys_[a]; |
| goog.structs.Map.hasKey_(this.map_, c) && (this.keys_[b++] = c); |
| a++; |
| } |
| this.keys_.length = b; |
| } |
| if (this.count_ != this.keys_.length) { |
| for (var d = {}, b = a = 0;a < this.keys_.length;) { |
| c = this.keys_[a], goog.structs.Map.hasKey_(d, c) || (this.keys_[b++] = c, d[c] = 1), a++; |
| } |
| this.keys_.length = b; |
| } |
| }; |
| goog.structs.Map.prototype.get = function(a, b) { |
| return goog.structs.Map.hasKey_(this.map_, a) ? this.map_[a] : b; |
| }; |
| goog.structs.Map.prototype.set = function(a, b) { |
| goog.structs.Map.hasKey_(this.map_, a) || (this.count_++, this.keys_.push(a), this.version_++); |
| this.map_[a] = b; |
| }; |
| goog.structs.Map.prototype.addAll = function(a) { |
| var b; |
| a instanceof goog.structs.Map ? (b = a.getKeys(), a = a.getValues()) : (b = goog.object.getKeys(a), a = goog.object.getValues(a)); |
| for (var c = 0;c < b.length;c++) { |
| this.set(b[c], a[c]); |
| } |
| }; |
| goog.structs.Map.prototype.forEach = function(a, b) { |
| for (var c = this.getKeys(), d = 0;d < c.length;d++) { |
| var e = c[d], f = this.get(e); |
| a.call(b, f, e, this); |
| } |
| }; |
| goog.structs.Map.prototype.clone = function() { |
| return new goog.structs.Map(this); |
| }; |
| goog.structs.Map.prototype.transpose = function() { |
| for (var a = new goog.structs.Map, b = 0;b < this.keys_.length;b++) { |
| var c = this.keys_[b]; |
| a.set(this.map_[c], c); |
| } |
| return a; |
| }; |
| goog.structs.Map.prototype.toObject = function() { |
| this.cleanupKeysArray_(); |
| for (var a = {}, b = 0;b < this.keys_.length;b++) { |
| var c = this.keys_[b]; |
| a[c] = this.map_[c]; |
| } |
| return a; |
| }; |
| goog.structs.Map.prototype.getKeyIterator = function() { |
| return this.__iterator__(!0); |
| }; |
| goog.structs.Map.prototype.getValueIterator = function() { |
| return this.__iterator__(!1); |
| }; |
| goog.structs.Map.prototype.__iterator__ = function(a) { |
| this.cleanupKeysArray_(); |
| var b = 0, c = this.keys_, d = this.map_, e = this.version_, f = this, g = new goog.iter.Iterator; |
| g.next = function() { |
| for (;;) { |
| if (e != f.version_) { |
| throw Error("The map has changed since the iterator was created"); |
| } |
| if (b >= c.length) { |
| throw goog.iter.StopIteration; |
| } |
| var g = c[b++]; |
| return a ? g : d[g]; |
| } |
| }; |
| return g; |
| }; |
| goog.structs.Map.hasKey_ = function(a, b) { |
| return Object.prototype.hasOwnProperty.call(a, b); |
| }; |
| goog.structs.getCount = function(a) { |
| return "function" == typeof a.getCount ? a.getCount() : goog.isArrayLike(a) || goog.isString(a) ? a.length : goog.object.getCount(a); |
| }; |
| goog.structs.getValues = function(a) { |
| if ("function" == typeof a.getValues) { |
| return a.getValues(); |
| } |
| if (goog.isString(a)) { |
| return a.split(""); |
| } |
| if (goog.isArrayLike(a)) { |
| for (var b = [], c = a.length, d = 0;d < c;d++) { |
| b.push(a[d]); |
| } |
| return b; |
| } |
| return goog.object.getValues(a); |
| }; |
| goog.structs.getKeys = function(a) { |
| if ("function" == typeof a.getKeys) { |
| return a.getKeys(); |
| } |
| if ("function" != typeof a.getValues) { |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| var b = []; |
| a = a.length; |
| for (var c = 0;c < a;c++) { |
| b.push(c); |
| } |
| return b; |
| } |
| return goog.object.getKeys(a); |
| } |
| }; |
| goog.structs.contains = function(a, b) { |
| return "function" == typeof a.contains ? a.contains(b) : "function" == typeof a.containsValue ? a.containsValue(b) : goog.isArrayLike(a) || goog.isString(a) ? goog.array.contains(a, b) : goog.object.containsValue(a, b); |
| }; |
| goog.structs.isEmpty = function(a) { |
| return "function" == typeof a.isEmpty ? a.isEmpty() : goog.isArrayLike(a) || goog.isString(a) ? goog.array.isEmpty(a) : goog.object.isEmpty(a); |
| }; |
| goog.structs.clear = function(a) { |
| "function" == typeof a.clear ? a.clear() : goog.isArrayLike(a) ? goog.array.clear(a) : goog.object.clear(a); |
| }; |
| goog.structs.forEach = function(a, b, c) { |
| if ("function" == typeof a.forEach) { |
| a.forEach(b, c); |
| } else { |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| goog.array.forEach(a, b, c); |
| } else { |
| for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) { |
| b.call(c, e[g], d && d[g], a); |
| } |
| } |
| } |
| }; |
| goog.structs.filter = function(a, b, c) { |
| if ("function" == typeof a.filter) { |
| return a.filter(b, c); |
| } |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| return goog.array.filter(a, b, c); |
| } |
| var d, e = goog.structs.getKeys(a), f = goog.structs.getValues(a), g = f.length; |
| if (e) { |
| d = {}; |
| for (var h = 0;h < g;h++) { |
| b.call(c, f[h], e[h], a) && (d[e[h]] = f[h]); |
| } |
| } else { |
| for (d = [], h = 0;h < g;h++) { |
| b.call(c, f[h], void 0, a) && d.push(f[h]); |
| } |
| } |
| return d; |
| }; |
| goog.structs.map = function(a, b, c) { |
| if ("function" == typeof a.map) { |
| return a.map(b, c); |
| } |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| return goog.array.map(a, b, c); |
| } |
| var d, e = goog.structs.getKeys(a), f = goog.structs.getValues(a), g = f.length; |
| if (e) { |
| d = {}; |
| for (var h = 0;h < g;h++) { |
| d[e[h]] = b.call(c, f[h], e[h], a); |
| } |
| } else { |
| for (d = [], h = 0;h < g;h++) { |
| d[h] = b.call(c, f[h], void 0, a); |
| } |
| } |
| return d; |
| }; |
| goog.structs.some = function(a, b, c) { |
| if ("function" == typeof a.some) { |
| return a.some(b, c); |
| } |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| return goog.array.some(a, b, c); |
| } |
| for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) { |
| if (b.call(c, e[g], d && d[g], a)) { |
| return !0; |
| } |
| } |
| return !1; |
| }; |
| goog.structs.every = function(a, b, c) { |
| if ("function" == typeof a.every) { |
| return a.every(b, c); |
| } |
| if (goog.isArrayLike(a) || goog.isString(a)) { |
| return goog.array.every(a, b, c); |
| } |
| for (var d = goog.structs.getKeys(a), e = goog.structs.getValues(a), f = e.length, g = 0;g < f;g++) { |
| if (!b.call(c, e[g], d && d[g], a)) { |
| return !1; |
| } |
| } |
| return !0; |
| }; |
| goog.structs.Set = function(a) { |
| this.map_ = new goog.structs.Map; |
| a && this.addAll(a); |
| }; |
| goog.structs.Set.getKey_ = function(a) { |
| var b = typeof a; |
| return "object" == b && a || "function" == b ? "o" + goog.getUid(a) : b.substr(0, 1) + a; |
| }; |
| goog.structs.Set.prototype.getCount = function() { |
| return this.map_.getCount(); |
| }; |
| goog.structs.Set.prototype.add = function(a) { |
| this.map_.set(goog.structs.Set.getKey_(a), a); |
| }; |
| goog.structs.Set.prototype.addAll = function(a) { |
| a = goog.structs.getValues(a); |
| for (var b = a.length, c = 0;c < b;c++) { |
| this.add(a[c]); |
| } |
| }; |
| goog.structs.Set.prototype.removeAll = function(a) { |
| a = goog.structs.getValues(a); |
| for (var b = a.length, c = 0;c < b;c++) { |
| this.remove(a[c]); |
| } |
| }; |
| goog.structs.Set.prototype.remove = function(a) { |
| return this.map_.remove(goog.structs.Set.getKey_(a)); |
| }; |
| goog.structs.Set.prototype.clear = function() { |
| this.map_.clear(); |
| }; |
| goog.structs.Set.prototype.isEmpty = function() { |
| return this.map_.isEmpty(); |
| }; |
| goog.structs.Set.prototype.contains = function(a) { |
| return this.map_.containsKey(goog.structs.Set.getKey_(a)); |
| }; |
| goog.structs.Set.prototype.containsAll = function(a) { |
| return goog.structs.every(a, this.contains, this); |
| }; |
| goog.structs.Set.prototype.intersection = function(a) { |
| var b = new goog.structs.Set; |
| a = goog.structs.getValues(a); |
| for (var c = 0;c < a.length;c++) { |
| var d = a[c]; |
| this.contains(d) && b.add(d); |
| } |
| return b; |
| }; |
| goog.structs.Set.prototype.difference = function(a) { |
| var b = this.clone(); |
| b.removeAll(a); |
| return b; |
| }; |
| goog.structs.Set.prototype.getValues = function() { |
| return this.map_.getValues(); |
| }; |
| goog.structs.Set.prototype.clone = function() { |
| return new goog.structs.Set(this); |
| }; |
| goog.structs.Set.prototype.equals = function(a) { |
| return this.getCount() == goog.structs.getCount(a) && this.isSubsetOf(a); |
| }; |
| goog.structs.Set.prototype.isSubsetOf = function(a) { |
| var b = goog.structs.getCount(a); |
| if (this.getCount() > b) { |
| return !1; |
| } |
| !(a instanceof goog.structs.Set) && 5 < b && (a = new goog.structs.Set(a)); |
| return goog.structs.every(this, function(b) { |
| return goog.structs.contains(a, b); |
| }); |
| }; |
| goog.structs.Set.prototype.__iterator__ = function(a) { |
| return this.map_.__iterator__(!1); |
| }; |
| goog.testing = {}; |
| goog.testing.watchers = {}; |
| goog.testing.watchers.resetWatchers_ = []; |
| goog.testing.watchers.signalClockReset = function() { |
| for (var a = goog.testing.watchers.resetWatchers_, b = 0;b < a.length;b++) { |
| goog.testing.watchers.resetWatchers_[b](); |
| } |
| }; |
| goog.testing.watchers.watchClockReset = function(a) { |
| goog.testing.watchers.resetWatchers_.push(a); |
| }; |
| goog.async.run = function(a, b) { |
| goog.async.run.schedule_ || goog.async.run.initializeRunner_(); |
| goog.async.run.workQueueScheduled_ || (goog.async.run.schedule_(), goog.async.run.workQueueScheduled_ = !0); |
| goog.async.run.workQueue_.add(a, b); |
| }; |
| goog.async.run.initializeRunner_ = function() { |
| if (goog.global.Promise && goog.global.Promise.resolve) { |
| var a = goog.global.Promise.resolve(); |
| goog.async.run.schedule_ = function() { |
| a.then(goog.async.run.processWorkQueue); |
| }; |
| } else { |
| goog.async.run.schedule_ = function() { |
| goog.async.nextTick(goog.async.run.processWorkQueue); |
| }; |
| } |
| }; |
| goog.async.run.forceNextTick = function() { |
| goog.async.run.schedule_ = function() { |
| goog.async.nextTick(goog.async.run.processWorkQueue); |
| }; |
| }; |
| goog.async.run.workQueueScheduled_ = !1; |
| goog.async.run.workQueue_ = new goog.async.WorkQueue; |
| goog.DEBUG && (goog.async.run.resetQueue_ = function() { |
| goog.async.run.workQueueScheduled_ = !1; |
| goog.async.run.workQueue_ = new goog.async.WorkQueue; |
| }, goog.testing.watchers.watchClockReset(goog.async.run.resetQueue_)); |
| goog.async.run.processWorkQueue = function() { |
| for (var a = null;a = goog.async.run.workQueue_.remove();) { |
| try { |
| a.fn.call(a.scope); |
| } catch (b) { |
| goog.async.throwException(b); |
| } |
| goog.async.run.workQueue_.returnUnused(a); |
| } |
| goog.async.run.workQueueScheduled_ = !1; |
| }; |
| goog.Promise = function(a, b) { |
| this.state_ = goog.Promise.State_.PENDING; |
| this.result_ = void 0; |
| this.callbackEntries_ = this.parent_ = null; |
| this.executing_ = !1; |
| 0 < goog.Promise.UNHANDLED_REJECTION_DELAY ? this.unhandledRejectionId_ = 0 : 0 == goog.Promise.UNHANDLED_REJECTION_DELAY && (this.hadUnhandledRejection_ = !1); |
| goog.Promise.LONG_STACK_TRACES && (this.stack_ = [], this.addStackTrace_(Error("created")), this.currentStep_ = 0); |
| if (a == goog.Promise.RESOLVE_FAST_PATH_) { |
| this.resolve_(goog.Promise.State_.FULFILLED, b); |
| } else { |
| try { |
| var c = this; |
| a.call(b, function(a) { |
| c.resolve_(goog.Promise.State_.FULFILLED, a); |
| }, function(a) { |
| if (goog.DEBUG && !(a instanceof goog.Promise.CancellationError)) { |
| try { |
| if (a instanceof Error) { |
| throw a; |
| } |
| throw Error("Promise rejected."); |
| } catch (b) { |
| } |
| } |
| c.resolve_(goog.Promise.State_.REJECTED, a); |
| }); |
| } catch (d) { |
| this.resolve_(goog.Promise.State_.REJECTED, d); |
| } |
| } |
| }; |
| goog.Promise.LONG_STACK_TRACES = !1; |
| goog.Promise.UNHANDLED_REJECTION_DELAY = 0; |
| goog.Promise.State_ = {PENDING:0, BLOCKED:1, FULFILLED:2, REJECTED:3}; |
| goog.Promise.RESOLVE_FAST_PATH_ = function() { |
| }; |
| goog.Promise.resolve = function(a) { |
| return new goog.Promise(goog.Promise.RESOLVE_FAST_PATH_, a); |
| }; |
| goog.Promise.reject = function(a) { |
| return new goog.Promise(function(b, c) { |
| c(a); |
| }); |
| }; |
| goog.Promise.race = function(a) { |
| return new goog.Promise(function(b, c) { |
| a.length || b(void 0); |
| for (var d = 0, e;e = a[d];d++) { |
| e.then(b, c); |
| } |
| }); |
| }; |
| goog.Promise.all = function(a) { |
| return new goog.Promise(function(b, c) { |
| var d = a.length, e = []; |
| if (d) { |
| for (var f = function(a, c) { |
| d--; |
| e[a] = c; |
| 0 == d && b(e); |
| }, g = function(a) { |
| c(a); |
| }, h = 0, k;k = a[h];h++) { |
| k.then(goog.partial(f, h), g); |
| } |
| } else { |
| b(e); |
| } |
| }); |
| }; |
| goog.Promise.firstFulfilled = function(a) { |
| return new goog.Promise(function(b, c) { |
| var d = a.length, e = []; |
| if (d) { |
| for (var f = function(a) { |
| b(a); |
| }, g = function(a, b) { |
| d--; |
| e[a] = b; |
| 0 == d && c(e); |
| }, h = 0, k;k = a[h];h++) { |
| k.then(f, goog.partial(g, h)); |
| } |
| } else { |
| b(void 0); |
| } |
| }); |
| }; |
| goog.Promise.withResolver = function() { |
| var a, b, c = new goog.Promise(function(c, e) { |
| a = c; |
| b = e; |
| }); |
| return new goog.Promise.Resolver_(c, a, b); |
| }; |
| goog.Promise.prototype.then = function(a, b, c) { |
| null != a && goog.asserts.assertFunction(a, "opt_onFulfilled should be a function."); |
| null != b && goog.asserts.assertFunction(b, "opt_onRejected should be a function. Did you pass opt_context as the second argument instead of the third?"); |
| goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("then")); |
| return this.addChildPromise_(goog.isFunction(a) ? a : null, goog.isFunction(b) ? b : null, c); |
| }; |
| goog.Thenable.addImplementation(goog.Promise); |
| goog.Promise.prototype.thenAlways = function(a, b) { |
| goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("thenAlways")); |
| var c = function() { |
| try { |
| a.call(b); |
| } catch (c) { |
| goog.Promise.handleRejection_.call(null, c); |
| } |
| }; |
| this.addCallbackEntry_({child:null, onRejected:c, onFulfilled:c}); |
| return this; |
| }; |
| goog.Promise.prototype.thenCatch = function(a, b) { |
| goog.Promise.LONG_STACK_TRACES && this.addStackTrace_(Error("thenCatch")); |
| return this.addChildPromise_(null, a, b); |
| }; |
| goog.Promise.prototype.cancel = function(a) { |
| this.state_ == goog.Promise.State_.PENDING && goog.async.run(function() { |
| var b = new goog.Promise.CancellationError(a); |
| this.cancelInternal_(b); |
| }, this); |
| }; |
| goog.Promise.prototype.cancelInternal_ = function(a) { |
| this.state_ == goog.Promise.State_.PENDING && (this.parent_ ? (this.parent_.cancelChild_(this, a), this.parent_ = null) : this.resolve_(goog.Promise.State_.REJECTED, a)); |
| }; |
| goog.Promise.prototype.cancelChild_ = function(a, b) { |
| if (this.callbackEntries_) { |
| for (var c = 0, d = -1, e = 0, f;f = this.callbackEntries_[e];e++) { |
| if (f = f.child) { |
| if (c++, f == a && (d = e), 0 <= d && 1 < c) { |
| break; |
| } |
| } |
| } |
| 0 <= d && (this.state_ == goog.Promise.State_.PENDING && 1 == c ? this.cancelInternal_(b) : (c = this.callbackEntries_.splice(d, 1)[0], this.executeCallback_(c, goog.Promise.State_.REJECTED, b))); |
| } |
| }; |
| goog.Promise.prototype.addCallbackEntry_ = function(a) { |
| this.callbackEntries_ && this.callbackEntries_.length || this.state_ != goog.Promise.State_.FULFILLED && this.state_ != goog.Promise.State_.REJECTED || this.scheduleCallbacks_(); |
| this.callbackEntries_ || (this.callbackEntries_ = []); |
| this.callbackEntries_.push(a); |
| }; |
| goog.Promise.prototype.addChildPromise_ = function(a, b, c) { |
| var d = {child:null, onFulfilled:null, onRejected:null}; |
| d.child = new goog.Promise(function(e, f) { |
| d.onFulfilled = a ? function(b) { |
| try { |
| var d = a.call(c, b); |
| e(d); |
| } catch (k) { |
| f(k); |
| } |
| } : e; |
| d.onRejected = b ? function(a) { |
| try { |
| var d = b.call(c, a); |
| !goog.isDef(d) && a instanceof goog.Promise.CancellationError ? f(a) : e(d); |
| } catch (k) { |
| f(k); |
| } |
| } : f; |
| }); |
| d.child.parent_ = this; |
| this.addCallbackEntry_(d); |
| return d.child; |
| }; |
| goog.Promise.prototype.unblockAndFulfill_ = function(a) { |
| goog.asserts.assert(this.state_ == goog.Promise.State_.BLOCKED); |
| this.state_ = goog.Promise.State_.PENDING; |
| this.resolve_(goog.Promise.State_.FULFILLED, a); |
| }; |
| goog.Promise.prototype.unblockAndReject_ = function(a) { |
| goog.asserts.assert(this.state_ == goog.Promise.State_.BLOCKED); |
| this.state_ = goog.Promise.State_.PENDING; |
| this.resolve_(goog.Promise.State_.REJECTED, a); |
| }; |
| goog.Promise.prototype.resolve_ = function(a, b) { |
| if (this.state_ == goog.Promise.State_.PENDING) { |
| if (this == b) { |
| a = goog.Promise.State_.REJECTED, b = new TypeError("Promise cannot resolve to itself"); |
| } else { |
| if (goog.Thenable.isImplementedBy(b)) { |
| this.state_ = goog.Promise.State_.BLOCKED; |
| b.then(this.unblockAndFulfill_, this.unblockAndReject_, this); |
| return; |
| } |
| if (goog.isObject(b)) { |
| try { |
| var c = b.then; |
| if (goog.isFunction(c)) { |
| this.tryThen_(b, c); |
| return; |
| } |
| } catch (d) { |
| a = goog.Promise.State_.REJECTED, b = d; |
| } |
| } |
| } |
| this.result_ = b; |
| this.state_ = a; |
| this.parent_ = null; |
| this.scheduleCallbacks_(); |
| a != goog.Promise.State_.REJECTED || b instanceof goog.Promise.CancellationError || goog.Promise.addUnhandledRejection_(this, b); |
| } |
| }; |
| goog.Promise.prototype.tryThen_ = function(a, b) { |
| this.state_ = goog.Promise.State_.BLOCKED; |
| var c = this, d = !1, e = function(a) { |
| d || (d = !0, c.unblockAndFulfill_(a)); |
| }, f = function(a) { |
| d || (d = !0, c.unblockAndReject_(a)); |
| }; |
| try { |
| b.call(a, e, f); |
| } catch (g) { |
| f(g); |
| } |
| }; |
| goog.Promise.prototype.scheduleCallbacks_ = function() { |
| this.executing_ || (this.executing_ = !0, goog.async.run(this.executeCallbacks_, this)); |
| }; |
| goog.Promise.prototype.executeCallbacks_ = function() { |
| for (;this.callbackEntries_ && this.callbackEntries_.length;) { |
| var a = this.callbackEntries_; |
| this.callbackEntries_ = null; |
| for (var b = 0;b < a.length;b++) { |
| goog.Promise.LONG_STACK_TRACES && this.currentStep_++, this.executeCallback_(a[b], this.state_, this.result_); |
| } |
| } |
| this.executing_ = !1; |
| }; |
| goog.Promise.prototype.executeCallback_ = function(a, b, c) { |
| a.child && (a.child.parent_ = null); |
| if (b == goog.Promise.State_.FULFILLED) { |
| a.onFulfilled(c); |
| } else { |
| a.child && this.removeUnhandledRejection_(), a.onRejected(c); |
| } |
| }; |
| goog.Promise.prototype.addStackTrace_ = function(a) { |
| if (goog.Promise.LONG_STACK_TRACES && goog.isString(a.stack)) { |
| var b = a.stack.split("\n", 4)[3]; |
| a = a.message; |
| a += Array(11 - a.length).join(" "); |
| this.stack_.push(a + b); |
| } |
| }; |
| goog.Promise.prototype.appendLongStack_ = function(a) { |
| if (goog.Promise.LONG_STACK_TRACES && a && goog.isString(a.stack) && this.stack_.length) { |
| for (var b = ["Promise trace:"], c = this;c;c = c.parent_) { |
| for (var d = this.currentStep_;0 <= d;d--) { |
| b.push(c.stack_[d]); |
| } |
| b.push("Value: [" + (c.state_ == goog.Promise.State_.REJECTED ? "REJECTED" : "FULFILLED") + "] <" + String(c.result_) + ">"); |
| } |
| a.stack += "\n\n" + b.join("\n"); |
| } |
| }; |
| goog.Promise.prototype.removeUnhandledRejection_ = function() { |
| if (0 < goog.Promise.UNHANDLED_REJECTION_DELAY) { |
| for (var a = this;a && a.unhandledRejectionId_;a = a.parent_) { |
| goog.global.clearTimeout(a.unhandledRejectionId_), a.unhandledRejectionId_ = 0; |
| } |
| } else { |
| if (0 == goog.Promise.UNHANDLED_REJECTION_DELAY) { |
| for (a = this;a && a.hadUnhandledRejection_;a = a.parent_) { |
| a.hadUnhandledRejection_ = !1; |
| } |
| } |
| } |
| }; |
| goog.Promise.addUnhandledRejection_ = function(a, b) { |
| 0 < goog.Promise.UNHANDLED_REJECTION_DELAY ? a.unhandledRejectionId_ = goog.global.setTimeout(function() { |
| a.appendLongStack_(b); |
| goog.Promise.handleRejection_.call(null, b); |
| }, goog.Promise.UNHANDLED_REJECTION_DELAY) : 0 == goog.Promise.UNHANDLED_REJECTION_DELAY && (a.hadUnhandledRejection_ = !0, goog.async.run(function() { |
| a.hadUnhandledRejection_ && (a.appendLongStack_(b), goog.Promise.handleRejection_.call(null, b)); |
| })); |
| }; |
| goog.Promise.handleRejection_ = goog.async.throwException; |
| goog.Promise.setUnhandledRejectionHandler = function(a) { |
| goog.Promise.handleRejection_ = a; |
| }; |
| goog.Promise.CancellationError = function(a) { |
| goog.debug.Error.call(this, a); |
| }; |
| goog.inherits(goog.Promise.CancellationError, goog.debug.Error); |
| goog.Promise.CancellationError.prototype.name = "cancel"; |
| goog.Promise.Resolver_ = function(a, b, c) { |
| this.promise = a; |
| this.resolve = b; |
| this.reject = c; |
| }; |
| goog.userAgent = {}; |
| goog.userAgent.ASSUME_IE = !1; |
| goog.userAgent.ASSUME_GECKO = !1; |
| goog.userAgent.ASSUME_WEBKIT = !1; |
| goog.userAgent.ASSUME_MOBILE_WEBKIT = !1; |
| goog.userAgent.ASSUME_OPERA = !1; |
| goog.userAgent.ASSUME_ANY_VERSION = !1; |
| goog.userAgent.BROWSER_KNOWN_ = goog.userAgent.ASSUME_IE || goog.userAgent.ASSUME_GECKO || goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_OPERA; |
| goog.userAgent.getUserAgentString = function() { |
| return goog.labs.userAgent.util.getUserAgent(); |
| }; |
| goog.userAgent.getNavigator = function() { |
| return goog.global.navigator || null; |
| }; |
| goog.userAgent.OPERA = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_OPERA : goog.labs.userAgent.browser.isOpera(); |
| goog.userAgent.IE = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_IE : goog.labs.userAgent.browser.isIE(); |
| goog.userAgent.GECKO = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_GECKO : goog.labs.userAgent.engine.isGecko(); |
| goog.userAgent.WEBKIT = goog.userAgent.BROWSER_KNOWN_ ? goog.userAgent.ASSUME_WEBKIT || goog.userAgent.ASSUME_MOBILE_WEBKIT : goog.labs.userAgent.engine.isWebKit(); |
| goog.userAgent.isMobile_ = function() { |
| return goog.userAgent.WEBKIT && goog.labs.userAgent.util.matchUserAgent("Mobile"); |
| }; |
| goog.userAgent.MOBILE = goog.userAgent.ASSUME_MOBILE_WEBKIT || goog.userAgent.isMobile_(); |
| goog.userAgent.SAFARI = goog.userAgent.WEBKIT; |
| goog.userAgent.determinePlatform_ = function() { |
| var a = goog.userAgent.getNavigator(); |
| return a && a.platform || ""; |
| }; |
| goog.userAgent.PLATFORM = goog.userAgent.determinePlatform_(); |
| goog.userAgent.ASSUME_MAC = !1; |
| goog.userAgent.ASSUME_WINDOWS = !1; |
| goog.userAgent.ASSUME_LINUX = !1; |
| goog.userAgent.ASSUME_X11 = !1; |
| goog.userAgent.ASSUME_ANDROID = !1; |
| goog.userAgent.ASSUME_IPHONE = !1; |
| goog.userAgent.ASSUME_IPAD = !1; |
| goog.userAgent.PLATFORM_KNOWN_ = goog.userAgent.ASSUME_MAC || goog.userAgent.ASSUME_WINDOWS || goog.userAgent.ASSUME_LINUX || goog.userAgent.ASSUME_X11 || goog.userAgent.ASSUME_ANDROID || goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD; |
| goog.userAgent.MAC = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_MAC : goog.labs.userAgent.platform.isMacintosh(); |
| goog.userAgent.WINDOWS = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_WINDOWS : goog.labs.userAgent.platform.isWindows(); |
| goog.userAgent.isLegacyLinux_ = function() { |
| return goog.labs.userAgent.platform.isLinux() || goog.labs.userAgent.platform.isChromeOS(); |
| }; |
| goog.userAgent.LINUX = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_LINUX : goog.userAgent.isLegacyLinux_(); |
| goog.userAgent.isX11_ = function() { |
| var a = goog.userAgent.getNavigator(); |
| return !!a && goog.string.contains(a.appVersion || "", "X11"); |
| }; |
| goog.userAgent.X11 = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_X11 : goog.userAgent.isX11_(); |
| goog.userAgent.ANDROID = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_ANDROID : goog.labs.userAgent.platform.isAndroid(); |
| goog.userAgent.IPHONE = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPHONE : goog.labs.userAgent.platform.isIphone(); |
| goog.userAgent.IPAD = goog.userAgent.PLATFORM_KNOWN_ ? goog.userAgent.ASSUME_IPAD : goog.labs.userAgent.platform.isIpad(); |
| goog.userAgent.determineVersion_ = function() { |
| var a = "", b; |
| if (goog.userAgent.OPERA && goog.global.opera) { |
| return a = goog.global.opera.version, goog.isFunction(a) ? a() : a; |
| } |
| goog.userAgent.GECKO ? b = /rv\:([^\);]+)(\)|;)/ : goog.userAgent.IE ? b = /\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/ : goog.userAgent.WEBKIT && (b = /WebKit\/(\S+)/); |
| b && (a = (a = b.exec(goog.userAgent.getUserAgentString())) ? a[1] : ""); |
| return goog.userAgent.IE && (b = goog.userAgent.getDocumentMode_(), b > parseFloat(a)) ? String(b) : a; |
| }; |
| goog.userAgent.getDocumentMode_ = function() { |
| var a = goog.global.document; |
| return a ? a.documentMode : void 0; |
| }; |
| goog.userAgent.VERSION = goog.userAgent.determineVersion_(); |
| goog.userAgent.compare = function(a, b) { |
| return goog.string.compareVersions(a, b); |
| }; |
| goog.userAgent.isVersionOrHigherCache_ = {}; |
| goog.userAgent.isVersionOrHigher = function(a) { |
| return goog.userAgent.ASSUME_ANY_VERSION || goog.userAgent.isVersionOrHigherCache_[a] || (goog.userAgent.isVersionOrHigherCache_[a] = 0 <= goog.string.compareVersions(goog.userAgent.VERSION, a)); |
| }; |
| goog.userAgent.isVersion = goog.userAgent.isVersionOrHigher; |
| goog.userAgent.isDocumentModeOrHigher = function(a) { |
| return goog.userAgent.IE && goog.userAgent.DOCUMENT_MODE >= a; |
| }; |
| goog.userAgent.isDocumentMode = goog.userAgent.isDocumentModeOrHigher; |
| goog.userAgent.DOCUMENT_MODE = function() { |
| var a = goog.global.document; |
| return a && goog.userAgent.IE ? goog.userAgent.getDocumentMode_() || ("CSS1Compat" == a.compatMode ? parseInt(goog.userAgent.VERSION, 10) : 5) : void 0; |
| }(); |
| goog.debug.LOGGING_ENABLED = goog.DEBUG; |
| goog.debug.catchErrors = function(a, b, c) { |
| c = c || goog.global; |
| var d = c.onerror, e = !!b; |
| goog.userAgent.WEBKIT && !goog.userAgent.isVersionOrHigher("535.3") && (e = !e); |
| c.onerror = function(b, c, h, k, l) { |
| d && d(b, c, h, k, l); |
| a({message:b, fileName:c, line:h, col:k, error:l}); |
| return e; |
| }; |
| }; |
| goog.debug.expose = function(a, b) { |
| if ("undefined" == typeof a) { |
| return "undefined"; |
| } |
| if (null == a) { |
| return "NULL"; |
| } |
| var c = [], d; |
| for (d in a) { |
| if (b || !goog.isFunction(a[d])) { |
| var e = d + " = "; |
| try { |
| e += a[d]; |
| } catch (f) { |
| e += "*** " + f + " ***"; |
| } |
| c.push(e); |
| } |
| } |
| return c.join("\n"); |
| }; |
| goog.debug.deepExpose = function(a, b) { |
| var c = [], d = function(a, f, g) { |
| var h = f + " "; |
| g = new goog.structs.Set(g); |
| try { |
| if (goog.isDef(a)) { |
| if (goog.isNull(a)) { |
| c.push("NULL"); |
| } else { |
| if (goog.isString(a)) { |
| c.push('"' + a.replace(/\n/g, "\n" + f) + '"'); |
| } else { |
| if (goog.isFunction(a)) { |
| c.push(String(a).replace(/\n/g, "\n" + f)); |
| } else { |
| if (goog.isObject(a)) { |
| if (g.contains(a)) { |
| c.push("*** reference loop detected ***"); |
| } else { |
| g.add(a); |
| c.push("{"); |
| for (var k in a) { |
| if (b || !goog.isFunction(a[k])) { |
| c.push("\n"), c.push(h), c.push(k + " = "), d(a[k], h, g); |
| } |
| } |
| c.push("\n" + f + "}"); |
| } |
| } else { |
| c.push(a); |
| } |
| } |
| } |
| } |
| } else { |
| c.push("undefined"); |
| } |
| } catch (l) { |
| c.push("*** " + l + " ***"); |
| } |
| }; |
| d(a, "", new goog.structs.Set); |
| return c.join(""); |
| }; |
| goog.debug.exposeArray = function(a) { |
| for (var b = [], c = 0;c < a.length;c++) { |
| goog.isArray(a[c]) ? b.push(goog.debug.exposeArray(a[c])) : b.push(a[c]); |
| } |
| return "[ " + b.join(", ") + " ]"; |
| }; |
| goog.debug.exposeException = function(a, b) { |
| var c = goog.debug.exposeExceptionAsHtml(a, b); |
| return goog.html.SafeHtml.unwrap(c); |
| }; |
| goog.debug.exposeExceptionAsHtml = function(a, b) { |
| try { |
| var c = goog.debug.normalizeErrorObject(a), d = goog.debug.createViewSourceUrl_(c.fileName); |
| return goog.html.SafeHtml.concat(goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces("Message: " + c.message + "\nUrl: "), goog.html.SafeHtml.create("a", {href:d, target:"_new"}, c.fileName), goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces("\nLine: " + c.lineNumber + "\n\nBrowser stack:\n" + c.stack + "-> [end]\n\nJS stack traversal:\n" + goog.debug.getStacktrace(b) + "-> ")); |
| } catch (e) { |
| return goog.html.SafeHtml.htmlEscapePreservingNewlinesAndSpaces("Exception trying to expose exception! You win, we lose. " + e); |
| } |
| }; |
| goog.debug.createViewSourceUrl_ = function(a) { |
| goog.isDefAndNotNull(a) || (a = ""); |
| if (!/^https?:\/\//i.test(a)) { |
| return goog.html.SafeUrl.fromConstant(goog.string.Const.from("sanitizedviewsrc")); |
| } |
| a = goog.html.SafeUrl.sanitize(a); |
| return goog.html.uncheckedconversions.safeUrlFromStringKnownToSatisfyTypeContract(goog.string.Const.from("view-source scheme plus HTTP/HTTPS URL"), "view-source:" + goog.html.SafeUrl.unwrap(a)); |
| }; |
| goog.debug.normalizeErrorObject = function(a) { |
| var b = goog.getObjectByName("window.location.href"); |
| if (goog.isString(a)) { |
| return {message:a, name:"Unknown error", lineNumber:"Not available", fileName:b, stack:"Not available"}; |
| } |
| var c, d, e = !1; |
| try { |
| c = a.lineNumber || a.line || "Not available"; |
| } catch (f) { |
| c = "Not available", e = !0; |
| } |
| try { |
| d = a.fileName || a.filename || a.sourceURL || goog.global.$googDebugFname || b; |
| } catch (f) { |
| d = "Not available", e = !0; |
| } |
| return !e && a.lineNumber && a.fileName && a.stack && a.message && a.name ? a : {message:a.message || "Not available", name:a.name || "UnknownError", lineNumber:c, fileName:d, stack:a.stack || "Not available"}; |
| }; |
| goog.debug.enhanceError = function(a, b) { |
| var c; |
| "string" == typeof a ? (c = Error(a), Error.captureStackTrace && Error.captureStackTrace(c, goog.debug.enhanceError)) : c = a; |
| c.stack || (c.stack = goog.debug.getStacktrace(goog.debug.enhanceError)); |
| if (b) { |
| for (var d = 0;c["message" + d];) { |
| ++d; |
| } |
| c["message" + d] = String(b); |
| } |
| return c; |
| }; |
| goog.debug.getStacktraceSimple = function(a) { |
| if (goog.STRICT_MODE_COMPATIBLE) { |
| var b = goog.debug.getNativeStackTrace_(goog.debug.getStacktraceSimple); |
| if (b) { |
| return b; |
| } |
| } |
| for (var b = [], c = arguments.callee.caller, d = 0;c && (!a || d < a);) { |
| b.push(goog.debug.getFunctionName(c)); |
| b.push("()\n"); |
| try { |
| c = c.caller; |
| } catch (e) { |
| b.push("[exception trying to get caller]\n"); |
| break; |
| } |
| d++; |
| if (d >= goog.debug.MAX_STACK_DEPTH) { |
| b.push("[...long stack...]"); |
| break; |
| } |
| } |
| a && d >= a ? b.push("[...reached max depth limit...]") : b.push("[end]"); |
| return b.join(""); |
| }; |
| goog.debug.MAX_STACK_DEPTH = 50; |
| goog.debug.getNativeStackTrace_ = function(a) { |
| var b = Error(); |
| if (Error.captureStackTrace) { |
| return Error.captureStackTrace(b, a), String(b.stack); |
| } |
| try { |
| throw b; |
| } catch (c) { |
| b = c; |
| } |
| return (a = b.stack) ? String(a) : null; |
| }; |
| goog.debug.getStacktrace = function(a) { |
| var b; |
| goog.STRICT_MODE_COMPATIBLE && (b = goog.debug.getNativeStackTrace_(a || goog.debug.getStacktrace)); |
| b || (b = goog.debug.getStacktraceHelper_(a || arguments.callee.caller, [])); |
| return b; |
| }; |
| goog.debug.getStacktraceHelper_ = function(a, b) { |
| var c = []; |
| if (goog.array.contains(b, a)) { |
| c.push("[...circular reference...]"); |
| } else { |
| if (a && b.length < goog.debug.MAX_STACK_DEPTH) { |
| c.push(goog.debug.getFunctionName(a) + "("); |
| for (var d = a.arguments, e = 0;d && e < d.length;e++) { |
| 0 < e && c.push(", "); |
| var f; |
| f = d[e]; |
| switch(typeof f) { |
| case "object": |
| f = f ? "object" : "null"; |
| break; |
| case "string": |
| break; |
| case "number": |
| f = String(f); |
| break; |
| case "boolean": |
| f = f ? "true" : "false"; |
| break; |
| case "function": |
| f = (f = goog.debug.getFunctionName(f)) ? f : "[fn]"; |
| break; |
| default: |
| f = typeof f; |
| } |
| 40 < f.length && (f = f.substr(0, 40) + "..."); |
| c.push(f); |
| } |
| b.push(a); |
| c.push(")\n"); |
| try { |
| c.push(goog.debug.getStacktraceHelper_(a.caller, b)); |
| } catch (g) { |
| c.push("[exception trying to get caller]\n"); |
| } |
| } else { |
| a ? c.push("[...long stack...]") : c.push("[end]"); |
| } |
| } |
| return c.join(""); |
| }; |
| goog.debug.setFunctionResolver = function(a) { |
| goog.debug.fnNameResolver_ = a; |
| }; |
| goog.debug.getFunctionName = function(a) { |
| if (goog.debug.fnNameCache_[a]) { |
| return goog.debug.fnNameCache_[a]; |
| } |
| if (goog.debug.fnNameResolver_) { |
| var b = goog.debug.fnNameResolver_(a); |
| if (b) { |
| return goog.debug.fnNameCache_[a] = b; |
| } |
| } |
| a = String(a); |
| goog.debug.fnNameCache_[a] || (b = /function ([^\(]+)/.exec(a), goog.debug.fnNameCache_[a] = b ? b[1] : "[Anonymous]"); |
| return goog.debug.fnNameCache_[a]; |
| }; |
| goog.debug.makeWhitespaceVisible = function(a) { |
| return a.replace(/ /g, "[_]").replace(/\f/g, "[f]").replace(/\n/g, "[n]\n").replace(/\r/g, "[r]").replace(/\t/g, "[t]"); |
| }; |
| goog.debug.fnNameCache_ = {}; |
| goog.debug.Logger = function(a) { |
| this.name_ = a; |
| this.handlers_ = this.children_ = this.level_ = this.parent_ = null; |
| }; |
| goog.debug.Logger.ROOT_LOGGER_NAME = ""; |
| goog.debug.Logger.ENABLE_HIERARCHY = !0; |
| goog.debug.Logger.ENABLE_HIERARCHY || (goog.debug.Logger.rootHandlers_ = []); |
| goog.debug.Logger.Level = function(a, b) { |
| this.name = a; |
| this.value = b; |
| }; |
| goog.debug.Logger.Level.prototype.toString = function() { |
| return this.name; |
| }; |
| goog.debug.Logger.Level.OFF = new goog.debug.Logger.Level("OFF", Infinity); |
| goog.debug.Logger.Level.SHOUT = new goog.debug.Logger.Level("SHOUT", 1200); |
| goog.debug.Logger.Level.SEVERE = new goog.debug.Logger.Level("SEVERE", 1E3); |
| goog.debug.Logger.Level.WARNING = new goog.debug.Logger.Level("WARNING", 900); |
| goog.debug.Logger.Level.INFO = new goog.debug.Logger.Level("INFO", 800); |
| goog.debug.Logger.Level.CONFIG = new goog.debug.Logger.Level("CONFIG", 700); |
| goog.debug.Logger.Level.FINE = new goog.debug.Logger.Level("FINE", 500); |
| goog.debug.Logger.Level.FINER = new goog.debug.Logger.Level("FINER", 400); |
| goog.debug.Logger.Level.FINEST = new goog.debug.Logger.Level("FINEST", 300); |
| goog.debug.Logger.Level.ALL = new goog.debug.Logger.Level("ALL", 0); |
| goog.debug.Logger.Level.PREDEFINED_LEVELS = [goog.debug.Logger.Level.OFF, goog.debug.Logger.Level.SHOUT, goog.debug.Logger.Level.SEVERE, goog.debug.Logger.Level.WARNING, goog.debug.Logger.Level.INFO, goog.debug.Logger.Level.CONFIG, goog.debug.Logger.Level.FINE, goog.debug.Logger.Level.FINER, goog.debug.Logger.Level.FINEST, goog.debug.Logger.Level.ALL]; |
| goog.debug.Logger.Level.predefinedLevelsCache_ = null; |
| goog.debug.Logger.Level.createPredefinedLevelsCache_ = function() { |
| goog.debug.Logger.Level.predefinedLevelsCache_ = {}; |
| for (var a = 0, b;b = goog.debug.Logger.Level.PREDEFINED_LEVELS[a];a++) { |
| goog.debug.Logger.Level.predefinedLevelsCache_[b.value] = b, goog.debug.Logger.Level.predefinedLevelsCache_[b.name] = b; |
| } |
| }; |
| goog.debug.Logger.Level.getPredefinedLevel = function(a) { |
| goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_(); |
| return goog.debug.Logger.Level.predefinedLevelsCache_[a] || null; |
| }; |
| goog.debug.Logger.Level.getPredefinedLevelByValue = function(a) { |
| goog.debug.Logger.Level.predefinedLevelsCache_ || goog.debug.Logger.Level.createPredefinedLevelsCache_(); |
| if (a in goog.debug.Logger.Level.predefinedLevelsCache_) { |
| return goog.debug.Logger.Level.predefinedLevelsCache_[a]; |
| } |
| for (var b = 0;b < goog.debug.Logger.Level.PREDEFINED_LEVELS.length;++b) { |
| var c = goog.debug.Logger.Level.PREDEFINED_LEVELS[b]; |
| if (c.value <= a) { |
| return c; |
| } |
| } |
| return null; |
| }; |
| goog.debug.Logger.getLogger = function(a) { |
| return goog.debug.LogManager.getLogger(a); |
| }; |
| goog.debug.Logger.logToProfilers = function(a) { |
| goog.global.console && (goog.global.console.timeStamp ? goog.global.console.timeStamp(a) : goog.global.console.markTimeline && goog.global.console.markTimeline(a)); |
| goog.global.msWriteProfilerMark && goog.global.msWriteProfilerMark(a); |
| }; |
| goog.debug.Logger.prototype.getName = function() { |
| return this.name_; |
| }; |
| goog.debug.Logger.prototype.addHandler = function(a) { |
| goog.debug.LOGGING_ENABLED && (goog.debug.Logger.ENABLE_HIERARCHY ? (this.handlers_ || (this.handlers_ = []), this.handlers_.push(a)) : (goog.asserts.assert(!this.name_, "Cannot call addHandler on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."), goog.debug.Logger.rootHandlers_.push(a))); |
| }; |
| goog.debug.Logger.prototype.removeHandler = function(a) { |
| if (goog.debug.LOGGING_ENABLED) { |
| var b = goog.debug.Logger.ENABLE_HIERARCHY ? this.handlers_ : goog.debug.Logger.rootHandlers_; |
| return !!b && goog.array.remove(b, a); |
| } |
| return !1; |
| }; |
| goog.debug.Logger.prototype.getParent = function() { |
| return this.parent_; |
| }; |
| goog.debug.Logger.prototype.getChildren = function() { |
| this.children_ || (this.children_ = {}); |
| return this.children_; |
| }; |
| goog.debug.Logger.prototype.setLevel = function(a) { |
| goog.debug.LOGGING_ENABLED && (goog.debug.Logger.ENABLE_HIERARCHY ? this.level_ = a : (goog.asserts.assert(!this.name_, "Cannot call setLevel() on a non-root logger when goog.debug.Logger.ENABLE_HIERARCHY is false."), goog.debug.Logger.rootLevel_ = a)); |
| }; |
| goog.debug.Logger.prototype.getLevel = function() { |
| return goog.debug.LOGGING_ENABLED ? this.level_ : goog.debug.Logger.Level.OFF; |
| }; |
| goog.debug.Logger.prototype.getEffectiveLevel = function() { |
| if (!goog.debug.LOGGING_ENABLED) { |
| return goog.debug.Logger.Level.OFF; |
| } |
| if (!goog.debug.Logger.ENABLE_HIERARCHY) { |
| return goog.debug.Logger.rootLevel_; |
| } |
| if (this.level_) { |
| return this.level_; |
| } |
| if (this.parent_) { |
| return this.parent_.getEffectiveLevel(); |
| } |
| goog.asserts.fail("Root logger has no level set."); |
| return null; |
| }; |
| goog.debug.Logger.prototype.isLoggable = function(a) { |
| return goog.debug.LOGGING_ENABLED && a.value >= this.getEffectiveLevel().value; |
| }; |
| goog.debug.Logger.prototype.log = function(a, b, c) { |
| goog.debug.LOGGING_ENABLED && this.isLoggable(a) && (goog.isFunction(b) && (b = b()), this.doLogRecord_(this.getLogRecord(a, b, c))); |
| }; |
| goog.debug.Logger.prototype.getLogRecord = function(a, b, c) { |
| a = goog.debug.LogBuffer.isBufferingEnabled() ? goog.debug.LogBuffer.getInstance().addRecord(a, b, this.name_) : new goog.debug.LogRecord(a, String(b), this.name_); |
| c && a.setException(c); |
| return a; |
| }; |
| goog.debug.Logger.prototype.shout = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.SHOUT, a, b); |
| }; |
| goog.debug.Logger.prototype.severe = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.SEVERE, a, b); |
| }; |
| goog.debug.Logger.prototype.warning = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.WARNING, a, b); |
| }; |
| goog.debug.Logger.prototype.info = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.INFO, a, b); |
| }; |
| goog.debug.Logger.prototype.config = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.CONFIG, a, b); |
| }; |
| goog.debug.Logger.prototype.fine = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINE, a, b); |
| }; |
| goog.debug.Logger.prototype.finer = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINER, a, b); |
| }; |
| goog.debug.Logger.prototype.finest = function(a, b) { |
| goog.debug.LOGGING_ENABLED && this.log(goog.debug.Logger.Level.FINEST, a, b); |
| }; |
| goog.debug.Logger.prototype.logRecord = function(a) { |
| goog.debug.LOGGING_ENABLED && this.isLoggable(a.getLevel()) && this.doLogRecord_(a); |
| }; |
| goog.debug.Logger.prototype.doLogRecord_ = function(a) { |
| goog.debug.Logger.logToProfilers("log:" + a.getMessage()); |
| if (goog.debug.Logger.ENABLE_HIERARCHY) { |
| for (var b = this;b;) { |
| b.callPublish_(a), b = b.getParent(); |
| } |
| } else { |
| for (var b = 0, c;c = goog.debug.Logger.rootHandlers_[b++];) { |
| c(a); |
| } |
| } |
| }; |
| goog.debug.Logger.prototype.callPublish_ = function(a) { |
| if (this.handlers_) { |
| for (var b = 0, c;c = this.handlers_[b];b++) { |
| c(a); |
| } |
| } |
| }; |
| goog.debug.Logger.prototype.setParent_ = function(a) { |
| this.parent_ = a; |
| }; |
| goog.debug.Logger.prototype.addChild_ = function(a, b) { |
| this.getChildren()[a] = b; |
| }; |
| goog.debug.LogManager = {}; |
| goog.debug.LogManager.loggers_ = {}; |
| goog.debug.LogManager.rootLogger_ = null; |
| goog.debug.LogManager.initialize = function() { |
| goog.debug.LogManager.rootLogger_ || (goog.debug.LogManager.rootLogger_ = new goog.debug.Logger(goog.debug.Logger.ROOT_LOGGER_NAME), goog.debug.LogManager.loggers_[goog.debug.Logger.ROOT_LOGGER_NAME] = goog.debug.LogManager.rootLogger_, goog.debug.LogManager.rootLogger_.setLevel(goog.debug.Logger.Level.CONFIG)); |
| }; |
| goog.debug.LogManager.getLoggers = function() { |
| return goog.debug.LogManager.loggers_; |
| }; |
| goog.debug.LogManager.getRoot = function() { |
| goog.debug.LogManager.initialize(); |
| return goog.debug.LogManager.rootLogger_; |
| }; |
| goog.debug.LogManager.getLogger = function(a) { |
| goog.debug.LogManager.initialize(); |
| return goog.debug.LogManager.loggers_[a] || goog.debug.LogManager.createLogger_(a); |
| }; |
| goog.debug.LogManager.createFunctionForCatchErrors = function(a) { |
| return function(b) { |
| (a || goog.debug.LogManager.getRoot()).severe("Error: " + b.message + " (" + b.fileName + " @ Line: " + b.line + ")"); |
| }; |
| }; |
| goog.debug.LogManager.createLogger_ = function(a) { |
| var b = new goog.debug.Logger(a); |
| if (goog.debug.Logger.ENABLE_HIERARCHY) { |
| var c = a.lastIndexOf("."), d = a.substr(0, c), c = a.substr(c + 1), d = goog.debug.LogManager.getLogger(d); |
| d.addChild_(c, b); |
| b.setParent_(d); |
| } |
| return goog.debug.LogManager.loggers_[a] = b; |
| }; |
| goog.events.BrowserFeature = {HAS_W3C_BUTTON:!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9), HAS_W3C_EVENT_SUPPORT:!goog.userAgent.IE || goog.userAgent.isDocumentModeOrHigher(9), SET_KEY_CODE_TO_PREVENT_DEFAULT:goog.userAgent.IE && !goog.userAgent.isVersionOrHigher("9"), HAS_NAVIGATOR_ONLINE_PROPERTY:!goog.userAgent.WEBKIT || goog.userAgent.isVersionOrHigher("528"), HAS_HTML5_NETWORK_EVENT_SUPPORT:goog.userAgent.GECKO && goog.userAgent.isVersionOrHigher("1.9b") || goog.userAgent.IE && |
| goog.userAgent.isVersionOrHigher("8") || goog.userAgent.OPERA && goog.userAgent.isVersionOrHigher("9.5") || goog.userAgent.WEBKIT && goog.userAgent.isVersionOrHigher("528"), HTML5_NETWORK_EVENTS_FIRE_ON_BODY:goog.userAgent.GECKO && !goog.userAgent.isVersionOrHigher("8") || goog.userAgent.IE && !goog.userAgent.isVersionOrHigher("9"), TOUCH_ENABLED:"ontouchstart" in goog.global || !!(goog.global.document && document.documentElement && "ontouchstart" in document.documentElement) || !(!goog.global.navigator || |
| !goog.global.navigator.msMaxTouchPoints)}; |
| goog.events.getVendorPrefixedName_ = function(a) { |
| return goog.userAgent.WEBKIT ? "webkit" + a : goog.userAgent.OPERA ? "o" + a.toLowerCase() : a.toLowerCase(); |
| }; |
| goog.events.EventType = {CLICK:"click", RIGHTCLICK:"rightclick", DBLCLICK:"dblclick", MOUSEDOWN:"mousedown", MOUSEUP:"mouseup", MOUSEOVER:"mouseover", MOUSEOUT:"mouseout", MOUSEMOVE:"mousemove", MOUSEENTER:"mouseenter", MOUSELEAVE:"mouseleave", SELECTSTART:"selectstart", WHEEL:"wheel", KEYPRESS:"keypress", KEYDOWN:"keydown", KEYUP:"keyup", BLUR:"blur", FOCUS:"focus", DEACTIVATE:"deactivate", FOCUSIN:goog.userAgent.IE ? "focusin" : "DOMFocusIn", FOCUSOUT:goog.userAgent.IE ? "focusout" : "DOMFocusOut", |
| CHANGE:"change", SELECT:"select", SUBMIT:"submit", INPUT:"input", PROPERTYCHANGE:"propertychange", DRAGSTART:"dragstart", DRAG:"drag", DRAGENTER:"dragenter", DRAGOVER:"dragover", DRAGLEAVE:"dragleave", DROP:"drop", DRAGEND:"dragend", TOUCHSTART:"touchstart", TOUCHMOVE:"touchmove", TOUCHEND:"touchend", TOUCHCANCEL:"touchcancel", BEFOREUNLOAD:"beforeunload", CONSOLEMESSAGE:"consolemessage", CONTEXTMENU:"contextmenu", DOMCONTENTLOADED:"DOMContentLoaded", ERROR:"error", HELP:"help", LOAD:"load", LOSECAPTURE:"losecapture", |
| ORIENTATIONCHANGE:"orientationchange", READYSTATECHANGE:"readystatechange", RESIZE:"resize", SCROLL:"scroll", UNLOAD:"unload", HASHCHANGE:"hashchange", PAGEHIDE:"pagehide", PAGESHOW:"pageshow", POPSTATE:"popstate", COPY:"copy", PASTE:"paste", CUT:"cut", BEFORECOPY:"beforecopy", BEFORECUT:"beforecut", BEFOREPASTE:"beforepaste", ONLINE:"online", OFFLINE:"offline", MESSAGE:"message", CONNECT:"connect", ANIMATIONSTART:goog.events.getVendorPrefixedName_("AnimationStart"), ANIMATIONEND:goog.events.getVendorPrefixedName_("AnimationEnd"), |
| ANIMATIONITERATION:goog.events.getVendorPrefixedName_("AnimationIteration"), TRANSITIONEND:goog.events.getVendorPrefixedName_("TransitionEnd"), POINTERDOWN:"pointerdown", POINTERUP:"pointerup", POINTERCANCEL:"pointercancel", POINTERMOVE:"pointermove", POINTEROVER:"pointerover", POINTEROUT:"pointerout", POINTERENTER:"pointerenter", POINTERLEAVE:"pointerleave", GOTPOINTERCAPTURE:"gotpointercapture", LOSTPOINTERCAPTURE:"lostpointercapture", MSGESTURECHANGE:"MSGestureChange", MSGESTUREEND:"MSGestureEnd", |
| MSGESTUREHOLD:"MSGestureHold", MSGESTURESTART:"MSGestureStart", MSGESTURETAP:"MSGestureTap", MSGOTPOINTERCAPTURE:"MSGotPointerCapture", MSINERTIASTART:"MSInertiaStart", MSLOSTPOINTERCAPTURE:"MSLostPointerCapture", MSPOINTERCANCEL:"MSPointerCancel", MSPOINTERDOWN:"MSPointerDown", MSPOINTERENTER:"MSPointerEnter", MSPOINTERHOVER:"MSPointerHover", MSPOINTERLEAVE:"MSPointerLeave", MSPOINTERMOVE:"MSPointerMove", MSPOINTEROUT:"MSPointerOut", MSPOINTEROVER:"MSPointerOver", MSPOINTERUP:"MSPointerUp", TEXT:"text", |
| TEXTINPUT:"textInput", COMPOSITIONSTART:"compositionstart", COMPOSITIONUPDATE:"compositionupdate", COMPOSITIONEND:"compositionend", EXIT:"exit", LOADABORT:"loadabort", LOADCOMMIT:"loadcommit", LOADREDIRECT:"loadredirect", LOADSTART:"loadstart", LOADSTOP:"loadstop", RESPONSIVE:"responsive", SIZECHANGED:"sizechanged", UNRESPONSIVE:"unresponsive", VISIBILITYCHANGE:"visibilitychange", STORAGE:"storage", DOMSUBTREEMODIFIED:"DOMSubtreeModified", DOMNODEINSERTED:"DOMNodeInserted", DOMNODEREMOVED:"DOMNodeRemoved", |
| DOMNODEREMOVEDFROMDOCUMENT:"DOMNodeRemovedFromDocument", DOMNODEINSERTEDINTODOCUMENT:"DOMNodeInsertedIntoDocument", DOMATTRMODIFIED:"DOMAttrModified", DOMCHARACTERDATAMODIFIED:"DOMCharacterDataModified"}; |
| goog.events.BrowserEvent = function(a, b) { |
| goog.events.Event.call(this, a ? a.type : ""); |
| this.relatedTarget = this.currentTarget = this.target = null; |
| this.charCode = this.keyCode = this.button = this.screenY = this.screenX = this.clientY = this.clientX = this.offsetY = this.offsetX = 0; |
| this.metaKey = this.shiftKey = this.altKey = this.ctrlKey = !1; |
| this.state = null; |
| this.platformModifierKey = !1; |
| this.event_ = null; |
| a && this.init(a, b); |
| }; |
| goog.inherits(goog.events.BrowserEvent, goog.events.Event); |
| goog.events.BrowserEvent.MouseButton = {LEFT:0, MIDDLE:1, RIGHT:2}; |
| goog.events.BrowserEvent.IEButtonMap = [1, 4, 2]; |
| goog.events.BrowserEvent.prototype.init = function(a, b) { |
| var c = this.type = a.type; |
| this.target = a.target || a.srcElement; |
| this.currentTarget = b; |
| var d = a.relatedTarget; |
| d ? goog.userAgent.GECKO && (goog.reflect.canAccessProperty(d, "nodeName") || (d = null)) : c == goog.events.EventType.MOUSEOVER ? d = a.fromElement : c == goog.events.EventType.MOUSEOUT && (d = a.toElement); |
| this.relatedTarget = d; |
| this.offsetX = goog.userAgent.WEBKIT || void 0 !== a.offsetX ? a.offsetX : a.layerX; |
| this.offsetY = goog.userAgent.WEBKIT || void 0 !== a.offsetY ? a.offsetY : a.layerY; |
| this.clientX = void 0 !== a.clientX ? a.clientX : a.pageX; |
| this.clientY = void 0 !== a.clientY ? a.clientY : a.pageY; |
| this.screenX = a.screenX || 0; |
| this.screenY = a.screenY || 0; |
| this.button = a.button; |
| this.keyCode = a.keyCode || 0; |
| this.charCode = a.charCode || ("keypress" == c ? a.keyCode : 0); |
| this.ctrlKey = a.ctrlKey; |
| this.altKey = a.altKey; |
| this.shiftKey = a.shiftKey; |
| this.metaKey = a.metaKey; |
| this.platformModifierKey = goog.userAgent.MAC ? a.metaKey : a.ctrlKey; |
| this.state = a.state; |
| this.event_ = a; |
| a.defaultPrevented && this.preventDefault(); |
| }; |
| goog.events.BrowserEvent.prototype.isButton = function(a) { |
| return goog.events.BrowserFeature.HAS_W3C_BUTTON ? this.event_.button == a : "click" == this.type ? a == goog.events.BrowserEvent.MouseButton.LEFT : !!(this.event_.button & goog.events.BrowserEvent.IEButtonMap[a]); |
| }; |
| goog.events.BrowserEvent.prototype.isMouseActionButton = function() { |
| return this.isButton(goog.events.BrowserEvent.MouseButton.LEFT) && !(goog.userAgent.WEBKIT && goog.userAgent.MAC && this.ctrlKey); |
| }; |
| goog.events.BrowserEvent.prototype.stopPropagation = function() { |
| goog.events.BrowserEvent.superClass_.stopPropagation.call(this); |
| this.event_.stopPropagation ? this.event_.stopPropagation() : this.event_.cancelBubble = !0; |
| }; |
| goog.events.BrowserEvent.prototype.preventDefault = function() { |
| goog.events.BrowserEvent.superClass_.preventDefault.call(this); |
| var a = this.event_; |
| if (a.preventDefault) { |
| a.preventDefault(); |
| } else { |
| if (a.returnValue = !1, goog.events.BrowserFeature.SET_KEY_CODE_TO_PREVENT_DEFAULT) { |
| try { |
| if (a.ctrlKey || 112 <= a.keyCode && 123 >= a.keyCode) { |
| a.keyCode = -1; |
| } |
| } catch (b) { |
| } |
| } |
| } |
| }; |
| goog.events.BrowserEvent.prototype.getBrowserEvent = function() { |
| return this.event_; |
| }; |
| goog.events.LISTENER_MAP_PROP_ = "closure_lm_" + (1E6 * Math.random() | 0); |
| goog.events.onString_ = "on"; |
| goog.events.onStringMap_ = {}; |
| goog.events.CaptureSimulationMode = {OFF_AND_FAIL:0, OFF_AND_SILENT:1, ON:2}; |
| goog.events.CAPTURE_SIMULATION_MODE = 2; |
| goog.events.listenerCountEstimate_ = 0; |
| goog.events.listen = function(a, b, c, d, e) { |
| if (goog.isArray(b)) { |
| for (var f = 0;f < b.length;f++) { |
| goog.events.listen(a, b[f], c, d, e); |
| } |
| return null; |
| } |
| c = goog.events.wrapListener(c); |
| return goog.events.Listenable.isImplementedBy(a) ? a.listen(b, c, d, e) : goog.events.listen_(a, b, c, !1, d, e); |
| }; |
| goog.events.listen_ = function(a, b, c, d, e, f) { |
| if (!b) { |
| throw Error("Invalid event type"); |
| } |
| var g = !!e; |
| if (g && !goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) { |
| if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.OFF_AND_FAIL) { |
| return goog.asserts.fail("Can not register capture listener in IE8-."), null; |
| } |
| if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.OFF_AND_SILENT) { |
| return null; |
| } |
| } |
| var h = goog.events.getListenerMap_(a); |
| h || (a[goog.events.LISTENER_MAP_PROP_] = h = new goog.events.ListenerMap(a)); |
| c = h.add(b, c, d, e, f); |
| if (c.proxy) { |
| return c; |
| } |
| d = goog.events.getProxy(); |
| c.proxy = d; |
| d.src = a; |
| d.listener = c; |
| a.addEventListener ? a.addEventListener(b.toString(), d, g) : a.attachEvent(goog.events.getOnString_(b.toString()), d); |
| goog.events.listenerCountEstimate_++; |
| return c; |
| }; |
| goog.events.getProxy = function() { |
| var a = goog.events.handleBrowserEvent_, b = goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT ? function(c) { |
| return a.call(b.src, b.listener, c); |
| } : function(c) { |
| c = a.call(b.src, b.listener, c); |
| if (!c) { |
| return c; |
| } |
| }; |
| return b; |
| }; |
| goog.events.listenOnce = function(a, b, c, d, e) { |
| if (goog.isArray(b)) { |
| for (var f = 0;f < b.length;f++) { |
| goog.events.listenOnce(a, b[f], c, d, e); |
| } |
| return null; |
| } |
| c = goog.events.wrapListener(c); |
| return goog.events.Listenable.isImplementedBy(a) ? a.listenOnce(b, c, d, e) : goog.events.listen_(a, b, c, !0, d, e); |
| }; |
| goog.events.listenWithWrapper = function(a, b, c, d, e) { |
| b.listen(a, c, d, e); |
| }; |
| goog.events.unlisten = function(a, b, c, d, e) { |
| if (goog.isArray(b)) { |
| for (var f = 0;f < b.length;f++) { |
| goog.events.unlisten(a, b[f], c, d, e); |
| } |
| return null; |
| } |
| c = goog.events.wrapListener(c); |
| if (goog.events.Listenable.isImplementedBy(a)) { |
| return a.unlisten(b, c, d, e); |
| } |
| if (!a) { |
| return !1; |
| } |
| d = !!d; |
| if (a = goog.events.getListenerMap_(a)) { |
| if (b = a.getListener(b, c, d, e)) { |
| return goog.events.unlistenByKey(b); |
| } |
| } |
| return !1; |
| }; |
| goog.events.unlistenByKey = function(a) { |
| if (goog.isNumber(a) || !a || a.removed) { |
| return !1; |
| } |
| var b = a.src; |
| if (goog.events.Listenable.isImplementedBy(b)) { |
| return b.unlistenByKey(a); |
| } |
| var c = a.type, d = a.proxy; |
| b.removeEventListener ? b.removeEventListener(c, d, a.capture) : b.detachEvent && b.detachEvent(goog.events.getOnString_(c), d); |
| goog.events.listenerCountEstimate_--; |
| (c = goog.events.getListenerMap_(b)) ? (c.removeByKey(a), 0 == c.getTypeCount() && (c.src = null, b[goog.events.LISTENER_MAP_PROP_] = null)) : a.markAsRemoved(); |
| return !0; |
| }; |
| goog.events.unlistenWithWrapper = function(a, b, c, d, e) { |
| b.unlisten(a, c, d, e); |
| }; |
| goog.events.removeAll = function(a, b) { |
| if (!a) { |
| return 0; |
| } |
| if (goog.events.Listenable.isImplementedBy(a)) { |
| return a.removeAllListeners(b); |
| } |
| var c = goog.events.getListenerMap_(a); |
| if (!c) { |
| return 0; |
| } |
| var d = 0, e = b && b.toString(), f; |
| for (f in c.listeners) { |
| if (!e || f == e) { |
| for (var g = c.listeners[f].concat(), h = 0;h < g.length;++h) { |
| goog.events.unlistenByKey(g[h]) && ++d; |
| } |
| } |
| } |
| return d; |
| }; |
| goog.events.getListeners = function(a, b, c) { |
| return goog.events.Listenable.isImplementedBy(a) ? a.getListeners(b, c) : a ? (a = goog.events.getListenerMap_(a)) ? a.getListeners(b, c) : [] : []; |
| }; |
| goog.events.getListener = function(a, b, c, d, e) { |
| c = goog.events.wrapListener(c); |
| d = !!d; |
| return goog.events.Listenable.isImplementedBy(a) ? a.getListener(b, c, d, e) : a ? (a = goog.events.getListenerMap_(a)) ? a.getListener(b, c, d, e) : null : null; |
| }; |
| goog.events.hasListener = function(a, b, c) { |
| if (goog.events.Listenable.isImplementedBy(a)) { |
| return a.hasListener(b, c); |
| } |
| a = goog.events.getListenerMap_(a); |
| return !!a && a.hasListener(b, c); |
| }; |
| goog.events.expose = function(a) { |
| var b = [], c; |
| for (c in a) { |
| a[c] && a[c].id ? b.push(c + " = " + a[c] + " (" + a[c].id + ")") : b.push(c + " = " + a[c]); |
| } |
| return b.join("\n"); |
| }; |
| goog.events.getOnString_ = function(a) { |
| return a in goog.events.onStringMap_ ? goog.events.onStringMap_[a] : goog.events.onStringMap_[a] = goog.events.onString_ + a; |
| }; |
| goog.events.fireListeners = function(a, b, c, d) { |
| return goog.events.Listenable.isImplementedBy(a) ? a.fireListeners(b, c, d) : goog.events.fireListeners_(a, b, c, d); |
| }; |
| goog.events.fireListeners_ = function(a, b, c, d) { |
| var e = !0; |
| if (a = goog.events.getListenerMap_(a)) { |
| if (b = a.listeners[b.toString()]) { |
| for (b = b.concat(), a = 0;a < b.length;a++) { |
| var f = b[a]; |
| f && f.capture == c && !f.removed && (f = goog.events.fireListener(f, d), e = e && !1 !== f); |
| } |
| } |
| } |
| return e; |
| }; |
| goog.events.fireListener = function(a, b) { |
| var c = a.listener, d = a.handler || a.src; |
| a.callOnce && goog.events.unlistenByKey(a); |
| return c.call(d, b); |
| }; |
| goog.events.getTotalListenerCount = function() { |
| return goog.events.listenerCountEstimate_; |
| }; |
| goog.events.dispatchEvent = function(a, b) { |
| goog.asserts.assert(goog.events.Listenable.isImplementedBy(a), "Can not use goog.events.dispatchEvent with non-goog.events.Listenable instance."); |
| return a.dispatchEvent(b); |
| }; |
| goog.events.protectBrowserEventEntryPoint = function(a) { |
| goog.events.handleBrowserEvent_ = a.protectEntryPoint(goog.events.handleBrowserEvent_); |
| }; |
| goog.events.handleBrowserEvent_ = function(a, b) { |
| if (a.removed) { |
| return !0; |
| } |
| if (!goog.events.BrowserFeature.HAS_W3C_EVENT_SUPPORT) { |
| var c = b || goog.getObjectByName("window.event"), d = new goog.events.BrowserEvent(c, this), e = !0; |
| if (goog.events.CAPTURE_SIMULATION_MODE == goog.events.CaptureSimulationMode.ON) { |
| if (!goog.events.isMarkedIeEvent_(c)) { |
| goog.events.markIeEvent_(c); |
| for (var c = [], f = d.currentTarget;f;f = f.parentNode) { |
| c.push(f); |
| } |
| for (var f = a.type, g = c.length - 1;!d.propagationStopped_ && 0 <= g;g--) { |
| d.currentTarget = c[g]; |
| var h = goog.events.fireListeners_(c[g], f, !0, d), e = e && h; |
| } |
| for (g = 0;!d.propagationStopped_ && g < c.length;g++) { |
| d.currentTarget = c[g], h = goog.events.fireListeners_(c[g], f, !1, d), e = e && h; |
| } |
| } |
| } else { |
| e = goog.events.fireListener(a, d); |
| } |
| return e; |
| } |
| return goog.events.fireListener(a, new goog.events.BrowserEvent(b, this)); |
| }; |
| goog.events.markIeEvent_ = function(a) { |
| var b = !1; |
| if (0 == a.keyCode) { |
| try { |
| a.keyCode = -1; |
| return; |
| } catch (c) { |
| b = !0; |
| } |
| } |
| if (b || void 0 == a.returnValue) { |
| a.returnValue = !0; |
| } |
| }; |
| goog.events.isMarkedIeEvent_ = function(a) { |
| return 0 > a.keyCode || void 0 != a.returnValue; |
| }; |
| goog.events.uniqueIdCounter_ = 0; |
| goog.events.getUniqueId = function(a) { |
| return a + "_" + goog.events.uniqueIdCounter_++; |
| }; |
| goog.events.getListenerMap_ = function(a) { |
| a = a[goog.events.LISTENER_MAP_PROP_]; |
| return a instanceof goog.events.ListenerMap ? a : null; |
| }; |
| goog.events.LISTENER_WRAPPER_PROP_ = "__closure_events_fn_" + (1E9 * Math.random() >>> 0); |
| goog.events.wrapListener = function(a) { |
| goog.asserts.assert(a, "Listener can not be null."); |
| if (goog.isFunction(a)) { |
| return a; |
| } |
| goog.asserts.assert(a.handleEvent, "An object listener must have handleEvent method."); |
| a[goog.events.LISTENER_WRAPPER_PROP_] || (a[goog.events.LISTENER_WRAPPER_PROP_] = function(b) { |
| return a.handleEvent(b); |
| }); |
| return a[goog.events.LISTENER_WRAPPER_PROP_]; |
| }; |
| goog.debug.entryPointRegistry.register(function(a) { |
| goog.events.handleBrowserEvent_ = a(goog.events.handleBrowserEvent_); |
| }); |
| goog.events.EventTarget = function() { |
| goog.Disposable.call(this); |
| this.eventTargetListeners_ = new goog.events.ListenerMap(this); |
| this.actualEventTarget_ = this; |
| this.parentEventTarget_ = null; |
| }; |
| goog.inherits(goog.events.EventTarget, goog.Disposable); |
| goog.events.Listenable.addImplementation(goog.events.EventTarget); |
| goog.events.EventTarget.MAX_ANCESTORS_ = 1E3; |
| goog.events.EventTarget.prototype.getParentEventTarget = function() { |
| return this.parentEventTarget_; |
| }; |
| goog.events.EventTarget.prototype.setParentEventTarget = function(a) { |
| this.parentEventTarget_ = a; |
| }; |
| goog.events.EventTarget.prototype.addEventListener = function(a, b, c, d) { |
| goog.events.listen(this, a, b, c, d); |
| }; |
| goog.events.EventTarget.prototype.removeEventListener = function(a, b, c, d) { |
| goog.events.unlisten(this, a, b, c, d); |
| }; |
| goog.events.EventTarget.prototype.dispatchEvent = function(a) { |
| this.assertInitialized_(); |
| var b, c = this.getParentEventTarget(); |
| if (c) { |
| b = []; |
| for (var d = 1;c;c = c.getParentEventTarget()) { |
| b.push(c), goog.asserts.assert(++d < goog.events.EventTarget.MAX_ANCESTORS_, "infinite loop"); |
| } |
| } |
| return goog.events.EventTarget.dispatchEventInternal_(this.actualEventTarget_, a, b); |
| }; |
| goog.events.EventTarget.prototype.disposeInternal = function() { |
| goog.events.EventTarget.superClass_.disposeInternal.call(this); |
| this.removeAllListeners(); |
| this.parentEventTarget_ = null; |
| }; |
| goog.events.EventTarget.prototype.listen = function(a, b, c, d) { |
| this.assertInitialized_(); |
| return this.eventTargetListeners_.add(String(a), b, !1, c, d); |
| }; |
| goog.events.EventTarget.prototype.listenOnce = function(a, b, c, d) { |
| return this.eventTargetListeners_.add(String(a), b, !0, c, d); |
| }; |
| goog.events.EventTarget.prototype.unlisten = function(a, b, c, d) { |
| return this.eventTargetListeners_.remove(String(a), b, c, d); |
| }; |
| goog.events.EventTarget.prototype.unlistenByKey = function(a) { |
| return this.eventTargetListeners_.removeByKey(a); |
| }; |
| goog.events.EventTarget.prototype.removeAllListeners = function(a) { |
| return this.eventTargetListeners_ ? this.eventTargetListeners_.removeAll(a) : 0; |
| }; |
| goog.events.EventTarget.prototype.fireListeners = function(a, b, c) { |
| a = this.eventTargetListeners_.listeners[String(a)]; |
| if (!a) { |
| return !0; |
| } |
| a = a.concat(); |
| for (var d = !0, e = 0;e < a.length;++e) { |
| var f = a[e]; |
| if (f && !f.removed && f.capture == b) { |
| var g = f.listener, h = f.handler || f.src; |
| f.callOnce && this.unlistenByKey(f); |
| d = !1 !== g.call(h, c) && d; |
| } |
| } |
| return d && 0 != c.returnValue_; |
| }; |
| goog.events.EventTarget.prototype.getListeners = function(a, b) { |
| return this.eventTargetListeners_.getListeners(String(a), b); |
| }; |
| goog.events.EventTarget.prototype.getListener = function(a, b, c, d) { |
| return this.eventTargetListeners_.getListener(String(a), b, c, d); |
| }; |
| goog.events.EventTarget.prototype.hasListener = function(a, b) { |
| var c = goog.isDef(a) ? String(a) : void 0; |
| return this.eventTargetListeners_.hasListener(c, b); |
| }; |
| goog.events.EventTarget.prototype.setTargetForTesting = function(a) { |
| this.actualEventTarget_ = a; |
| }; |
| goog.events.EventTarget.prototype.assertInitialized_ = function() { |
| goog.asserts.assert(this.eventTargetListeners_, "Event target is not initialized. Did you call the superclass (goog.events.EventTarget) constructor?"); |
| }; |
| goog.events.EventTarget.dispatchEventInternal_ = function(a, b, c) { |
| var d = b.type || b; |
| if (goog.isString(b)) { |
| b = new goog.events.Event(b, a); |
| } else { |
| if (b instanceof goog.events.Event) { |
| b.target = b.target || a; |
| } else { |
| var e = b; |
| b = new goog.events.Event(d, a); |
| goog.object.extend(b, e); |
| } |
| } |
| var e = !0, f; |
| if (c) { |
| for (var g = c.length - 1;!b.propagationStopped_ && 0 <= g;g--) { |
| f = b.currentTarget = c[g], e = f.fireListeners(d, !0, b) && e; |
| } |
| } |
| b.propagationStopped_ || (f = b.currentTarget = a, e = f.fireListeners(d, !0, b) && e, b.propagationStopped_ || (e = f.fireListeners(d, !1, b) && e)); |
| if (c) { |
| for (g = 0;!b.propagationStopped_ && g < c.length;g++) { |
| f = b.currentTarget = c[g], e = f.fireListeners(d, !1, b) && e; |
| } |
| } |
| return e; |
| }; |
| goog.log = {}; |
| goog.log.ENABLED = goog.debug.LOGGING_ENABLED; |
| goog.log.ROOT_LOGGER_NAME = goog.debug.Logger.ROOT_LOGGER_NAME; |
| goog.log.Logger = goog.debug.Logger; |
| goog.log.Level = goog.debug.Logger.Level; |
| goog.log.LogRecord = goog.debug.LogRecord; |
| goog.log.getLogger = function(a, b) { |
| if (goog.log.ENABLED) { |
| var c = goog.debug.LogManager.getLogger(a); |
| b && c && c.setLevel(b); |
| return c; |
| } |
| return null; |
| }; |
| goog.log.addHandler = function(a, b) { |
| goog.log.ENABLED && a && a.addHandler(b); |
| }; |
| goog.log.removeHandler = function(a, b) { |
| return goog.log.ENABLED && a ? a.removeHandler(b) : !1; |
| }; |
| goog.log.log = function(a, b, c, d) { |
| goog.log.ENABLED && a && a.log(b, c, d); |
| }; |
| goog.log.error = function(a, b, c) { |
| goog.log.ENABLED && a && a.severe(b, c); |
| }; |
| goog.log.warning = function(a, b, c) { |
| goog.log.ENABLED && a && a.warning(b, c); |
| }; |
| goog.log.info = function(a, b, c) { |
| goog.log.ENABLED && a && a.info(b, c); |
| }; |
| goog.log.fine = function(a, b, c) { |
| goog.log.ENABLED && a && a.fine(b, c); |
| }; |
| goog.Timer = function(a, b) { |
| goog.events.EventTarget.call(this); |
| this.interval_ = a || 1; |
| this.timerObject_ = b || goog.Timer.defaultTimerObject; |
| this.boundTick_ = goog.bind(this.tick_, this); |
| this.last_ = goog.now(); |
| }; |
| goog.inherits(goog.Timer, goog.events.EventTarget); |
| goog.Timer.MAX_TIMEOUT_ = 2147483647; |
| goog.Timer.INVALID_TIMEOUT_ID_ = -1; |
| goog.Timer.prototype.enabled = !1; |
| goog.Timer.defaultTimerObject = goog.global; |
| goog.Timer.intervalScale = .8; |
| goog.Timer.prototype.timer_ = null; |
| goog.Timer.prototype.getInterval = function() { |
| return this.interval_; |
| }; |
| goog.Timer.prototype.setInterval = function(a) { |
| this.interval_ = a; |
| this.timer_ && this.enabled ? (this.stop(), this.start()) : this.timer_ && this.stop(); |
| }; |
| goog.Timer.prototype.tick_ = function() { |
| if (this.enabled) { |
| var a = goog.now() - this.last_; |
| 0 < a && a < this.interval_ * goog.Timer.intervalScale ? this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_ - a) : (this.timer_ && (this.timerObject_.clearTimeout(this.timer_), this.timer_ = null), this.dispatchTick(), this.enabled && (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now())); |
| } |
| }; |
| goog.Timer.prototype.dispatchTick = function() { |
| this.dispatchEvent(goog.Timer.TICK); |
| }; |
| goog.Timer.prototype.start = function() { |
| this.enabled = !0; |
| this.timer_ || (this.timer_ = this.timerObject_.setTimeout(this.boundTick_, this.interval_), this.last_ = goog.now()); |
| }; |
| goog.Timer.prototype.stop = function() { |
| this.enabled = !1; |
| this.timer_ && (this.timerObject_.clearTimeout(this.timer_), this.timer_ = null); |
| }; |
| goog.Timer.prototype.disposeInternal = function() { |
| goog.Timer.superClass_.disposeInternal.call(this); |
| this.stop(); |
| delete this.timerObject_; |
| }; |
| goog.Timer.TICK = "tick"; |
| goog.Timer.callOnce = function(a, b, c) { |
| if (goog.isFunction(a)) { |
| c && (a = goog.bind(a, c)); |
| } else { |
| if (a && "function" == typeof a.handleEvent) { |
| a = goog.bind(a.handleEvent, a); |
| } else { |
| throw Error("Invalid listener argument"); |
| } |
| } |
| return b > goog.Timer.MAX_TIMEOUT_ ? goog.Timer.INVALID_TIMEOUT_ID_ : goog.Timer.defaultTimerObject.setTimeout(a, b || 0); |
| }; |
| goog.Timer.clear = function(a) { |
| goog.Timer.defaultTimerObject.clearTimeout(a); |
| }; |
| goog.Timer.promise = function(a, b) { |
| var c = null; |
| return (new goog.Promise(function(d, e) { |
| c = goog.Timer.callOnce(function() { |
| d(b); |
| }, a); |
| c == goog.Timer.INVALID_TIMEOUT_ID_ && e(Error("Failed to schedule timer.")); |
| })).thenCatch(function(a) { |
| goog.Timer.clear(c); |
| throw a; |
| }); |
| }; |
| goog.uri = {}; |
| goog.uri.utils = {}; |
| goog.uri.utils.CharCode_ = {AMPERSAND:38, EQUAL:61, HASH:35, QUESTION:63}; |
| goog.uri.utils.buildFromEncodedParts = function(a, b, c, d, e, f, g) { |
| var h = ""; |
| a && (h += a + ":"); |
| c && (h += "//", b && (h += b + "@"), h += c, d && (h += ":" + d)); |
| e && (h += e); |
| f && (h += "?" + f); |
| g && (h += "#" + g); |
| return h; |
| }; |
| goog.uri.utils.splitRe_ = /^(?:([^:/?#.]+):)?(?:\/\/(?:([^/?#]*)@)?([^/#?]*?)(?::([0-9]+))?(?=[/#?]|$))?([^?#]+)?(?:\?([^#]*))?(?:#(.*))?$/; |
| goog.uri.utils.ComponentIndex = {SCHEME:1, USER_INFO:2, DOMAIN:3, PORT:4, PATH:5, QUERY_DATA:6, FRAGMENT:7}; |
| goog.uri.utils.split = function(a) { |
| goog.uri.utils.phishingProtection_(); |
| return a.match(goog.uri.utils.splitRe_); |
| }; |
| goog.uri.utils.needsPhishingProtection_ = goog.userAgent.WEBKIT; |
| goog.uri.utils.phishingProtection_ = function() { |
| if (goog.uri.utils.needsPhishingProtection_) { |
| goog.uri.utils.needsPhishingProtection_ = !1; |
| var a = goog.global.location; |
| if (a) { |
| var b = a.href; |
| if (b && (b = goog.uri.utils.getDomain(b)) && b != a.hostname) { |
| throw goog.uri.utils.needsPhishingProtection_ = !0, Error(); |
| } |
| } |
| } |
| }; |
| goog.uri.utils.decodeIfPossible_ = function(a, b) { |
| return a ? b ? decodeURI(a) : decodeURIComponent(a) : a; |
| }; |
| goog.uri.utils.getComponentByIndex_ = function(a, b) { |
| return goog.uri.utils.split(b)[a] || null; |
| }; |
| goog.uri.utils.getScheme = function(a) { |
| return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.SCHEME, a); |
| }; |
| goog.uri.utils.getEffectiveScheme = function(a) { |
| a = goog.uri.utils.getScheme(a); |
| !a && self.location && (a = self.location.protocol, a = a.substr(0, a.length - 1)); |
| return a ? a.toLowerCase() : ""; |
| }; |
| goog.uri.utils.getUserInfoEncoded = function(a) { |
| return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.USER_INFO, a); |
| }; |
| goog.uri.utils.getUserInfo = function(a) { |
| return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getUserInfoEncoded(a)); |
| }; |
| goog.uri.utils.getDomainEncoded = function(a) { |
| return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.DOMAIN, a); |
| }; |
| goog.uri.utils.getDomain = function(a) { |
| return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getDomainEncoded(a), !0); |
| }; |
| goog.uri.utils.getPort = function(a) { |
| return Number(goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PORT, a)) || null; |
| }; |
| goog.uri.utils.getPathEncoded = function(a) { |
| return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.PATH, a); |
| }; |
| goog.uri.utils.getPath = function(a) { |
| return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getPathEncoded(a), !0); |
| }; |
| goog.uri.utils.getQueryData = function(a) { |
| return goog.uri.utils.getComponentByIndex_(goog.uri.utils.ComponentIndex.QUERY_DATA, a); |
| }; |
| goog.uri.utils.getFragmentEncoded = function(a) { |
| var b = a.indexOf("#"); |
| return 0 > b ? null : a.substr(b + 1); |
| }; |
| goog.uri.utils.setFragmentEncoded = function(a, b) { |
| return goog.uri.utils.removeFragment(a) + (b ? "#" + b : ""); |
| }; |
| goog.uri.utils.getFragment = function(a) { |
| return goog.uri.utils.decodeIfPossible_(goog.uri.utils.getFragmentEncoded(a)); |
| }; |
| goog.uri.utils.getHost = function(a) { |
| a = goog.uri.utils.split(a); |
| return goog.uri.utils.buildFromEncodedParts(a[goog.uri.utils.ComponentIndex.SCHEME], a[goog.uri.utils.ComponentIndex.USER_INFO], a[goog.uri.utils.ComponentIndex.DOMAIN], a[goog.uri.utils.ComponentIndex.PORT]); |
| }; |
| goog.uri.utils.getPathAndAfter = function(a) { |
| a = goog.uri.utils.split(a); |
| return goog.uri.utils.buildFromEncodedParts(null, null, null, null, a[goog.uri.utils.ComponentIndex.PATH], a[goog.uri.utils.ComponentIndex.QUERY_DATA], a[goog.uri.utils.ComponentIndex.FRAGMENT]); |
| }; |
| goog.uri.utils.removeFragment = function(a) { |
| var b = a.indexOf("#"); |
| return 0 > b ? a : a.substr(0, b); |
| }; |
| goog.uri.utils.haveSameDomain = function(a, b) { |
| var c = goog.uri.utils.split(a), d = goog.uri.utils.split(b); |
| return c[goog.uri.utils.ComponentIndex.DOMAIN] == d[goog.uri.utils.ComponentIndex.DOMAIN] && c[goog.uri.utils.ComponentIndex.SCHEME] == d[goog.uri.utils.ComponentIndex.SCHEME] && c[goog.uri.utils.ComponentIndex.PORT] == d[goog.uri.utils.ComponentIndex.PORT]; |
| }; |
| goog.uri.utils.assertNoFragmentsOrQueries_ = function(a) { |
| if (goog.DEBUG && (0 <= a.indexOf("#") || 0 <= a.indexOf("?"))) { |
| throw Error("goog.uri.utils: Fragment or query identifiers are not supported: [" + a + "]"); |
| } |
| }; |
| goog.uri.utils.parseQueryData = function(a, b) { |
| for (var c = a.split("&"), d = 0;d < c.length;d++) { |
| var e = c[d].indexOf("="), f = null, g = null; |
| 0 <= e ? (f = c[d].substring(0, e), g = c[d].substring(e + 1)) : f = c[d]; |
| b(f, g ? goog.string.urlDecode(g) : ""); |
| } |
| }; |
| goog.uri.utils.appendQueryData_ = function(a) { |
| if (a[1]) { |
| var b = a[0], c = b.indexOf("#"); |
| 0 <= c && (a.push(b.substr(c)), a[0] = b = b.substr(0, c)); |
| c = b.indexOf("?"); |
| 0 > c ? a[1] = "?" : c == b.length - 1 && (a[1] = void 0); |
| } |
| return a.join(""); |
| }; |
| goog.uri.utils.appendKeyValuePairs_ = function(a, b, c) { |
| if (goog.isArray(b)) { |
| goog.asserts.assertArray(b); |
| for (var d = 0;d < b.length;d++) { |
| goog.uri.utils.appendKeyValuePairs_(a, String(b[d]), c); |
| } |
| } else { |
| null != b && c.push("&", a, "" === b ? "" : "=", goog.string.urlEncode(b)); |
| } |
| }; |
| goog.uri.utils.buildQueryDataBuffer_ = function(a, b, c) { |
| goog.asserts.assert(0 == Math.max(b.length - (c || 0), 0) % 2, "goog.uri.utils: Key/value lists must be even in length."); |
| for (c = c || 0;c < b.length;c += 2) { |
| goog.uri.utils.appendKeyValuePairs_(b[c], b[c + 1], a); |
| } |
| return a; |
| }; |
| goog.uri.utils.buildQueryData = function(a, b) { |
| var c = goog.uri.utils.buildQueryDataBuffer_([], a, b); |
| c[0] = ""; |
| return c.join(""); |
| }; |
| goog.uri.utils.buildQueryDataBufferFromMap_ = function(a, b) { |
| for (var c in b) { |
| goog.uri.utils.appendKeyValuePairs_(c, b[c], a); |
| } |
| return a; |
| }; |
| goog.uri.utils.buildQueryDataFromMap = function(a) { |
| a = goog.uri.utils.buildQueryDataBufferFromMap_([], a); |
| a[0] = ""; |
| return a.join(""); |
| }; |
| goog.uri.utils.appendParams = function(a, b) { |
| return goog.uri.utils.appendQueryData_(2 == arguments.length ? goog.uri.utils.buildQueryDataBuffer_([a], arguments[1], 0) : goog.uri.utils.buildQueryDataBuffer_([a], arguments, 1)); |
| }; |
| goog.uri.utils.appendParamsFromMap = function(a, b) { |
| return goog.uri.utils.appendQueryData_(goog.uri.utils.buildQueryDataBufferFromMap_([a], b)); |
| }; |
| goog.uri.utils.appendParam = function(a, b, c) { |
| a = [a, "&", b]; |
| goog.isDefAndNotNull(c) && a.push("=", goog.string.urlEncode(c)); |
| return goog.uri.utils.appendQueryData_(a); |
| }; |
| goog.uri.utils.findParam_ = function(a, b, c, d) { |
| for (var e = c.length;0 <= (b = a.indexOf(c, b)) && b < d;) { |
| var f = a.charCodeAt(b - 1); |
| if (f == goog.uri.utils.CharCode_.AMPERSAND || f == goog.uri.utils.CharCode_.QUESTION) { |
| if (f = a.charCodeAt(b + e), !f || f == goog.uri.utils.CharCode_.EQUAL || f == goog.uri.utils.CharCode_.AMPERSAND || f == goog.uri.utils.CharCode_.HASH) { |
| return b; |
| } |
| } |
| b += e + 1; |
| } |
| return -1; |
| }; |
| goog.uri.utils.hashOrEndRe_ = /#|$/; |
| goog.uri.utils.hasParam = function(a, b) { |
| return 0 <= goog.uri.utils.findParam_(a, 0, b, a.search(goog.uri.utils.hashOrEndRe_)); |
| }; |
| goog.uri.utils.getParamValue = function(a, b) { |
| var c = a.search(goog.uri.utils.hashOrEndRe_), d = goog.uri.utils.findParam_(a, 0, b, c); |
| if (0 > d) { |
| return null; |
| } |
| var e = a.indexOf("&", d); |
| if (0 > e || e > c) { |
| e = c; |
| } |
| d += b.length + 1; |
| return goog.string.urlDecode(a.substr(d, e - d)); |
| }; |
| goog.uri.utils.getParamValues = function(a, b) { |
| for (var c = a.search(goog.uri.utils.hashOrEndRe_), d = 0, e, f = [];0 <= (e = goog.uri.utils.findParam_(a, d, b, c));) { |
| d = a.indexOf("&", e); |
| if (0 > d || d > c) { |
| d = c; |
| } |
| e += b.length + 1; |
| f.push(goog.string.urlDecode(a.substr(e, d - e))); |
| } |
| return f; |
| }; |
| goog.uri.utils.trailingQueryPunctuationRe_ = /[?&]($|#)/; |
| goog.uri.utils.removeParam = function(a, b) { |
| for (var c = a.search(goog.uri.utils.hashOrEndRe_), d = 0, e, f = [];0 <= (e = goog.uri.utils.findParam_(a, d, b, c));) { |
| f.push(a.substring(d, e)), d = Math.min(a.indexOf("&", e) + 1 || c, c); |
| } |
| f.push(a.substr(d)); |
| return f.join("").replace(goog.uri.utils.trailingQueryPunctuationRe_, "$1"); |
| }; |
| goog.uri.utils.setParam = function(a, b, c) { |
| return goog.uri.utils.appendParam(goog.uri.utils.removeParam(a, b), b, c); |
| }; |
| goog.uri.utils.appendPath = function(a, b) { |
| goog.uri.utils.assertNoFragmentsOrQueries_(a); |
| goog.string.endsWith(a, "/") && (a = a.substr(0, a.length - 1)); |
| goog.string.startsWith(b, "/") && (b = b.substr(1)); |
| return goog.string.buildString(a, "/", b); |
| }; |
| goog.uri.utils.setPath = function(a, b) { |
| goog.string.startsWith(b, "/") || (b = "/" + b); |
| var c = goog.uri.utils.split(a); |
| return goog.uri.utils.buildFromEncodedParts(c[goog.uri.utils.ComponentIndex.SCHEME], c[goog.uri.utils.ComponentIndex.USER_INFO], c[goog.uri.utils.ComponentIndex.DOMAIN], c[goog.uri.utils.ComponentIndex.PORT], b, c[goog.uri.utils.ComponentIndex.QUERY_DATA], c[goog.uri.utils.ComponentIndex.FRAGMENT]); |
| }; |
| goog.uri.utils.StandardQueryParam = {RANDOM:"zx"}; |
| goog.uri.utils.makeUnique = function(a) { |
| return goog.uri.utils.setParam(a, goog.uri.utils.StandardQueryParam.RANDOM, goog.string.getRandomString()); |
| }; |
| goog.net.XhrIo = function(a) { |
| goog.events.EventTarget.call(this); |
| this.headers = new goog.structs.Map; |
| this.xmlHttpFactory_ = a || null; |
| this.active_ = !1; |
| this.xhrOptions_ = this.xhr_ = null; |
| this.lastMethod_ = this.lastUri_ = ""; |
| this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR; |
| this.lastError_ = ""; |
| this.inAbort_ = this.inOpen_ = this.inSend_ = this.errorDispatched_ = !1; |
| this.timeoutInterval_ = 0; |
| this.timeoutId_ = null; |
| this.responseType_ = goog.net.XhrIo.ResponseType.DEFAULT; |
| this.useXhr2Timeout_ = this.withCredentials_ = !1; |
| }; |
| goog.inherits(goog.net.XhrIo, goog.events.EventTarget); |
| goog.net.XhrIo.ResponseType = {DEFAULT:"", TEXT:"text", DOCUMENT:"document", BLOB:"blob", ARRAY_BUFFER:"arraybuffer"}; |
| goog.net.XhrIo.prototype.logger_ = goog.log.getLogger("goog.net.XhrIo"); |
| goog.net.XhrIo.CONTENT_TYPE_HEADER = "Content-Type"; |
| goog.net.XhrIo.HTTP_SCHEME_PATTERN = /^https?$/i; |
| goog.net.XhrIo.METHODS_WITH_FORM_DATA = ["POST", "PUT"]; |
| goog.net.XhrIo.FORM_CONTENT_TYPE = "application/x-www-form-urlencoded;charset=utf-8"; |
| goog.net.XhrIo.XHR2_TIMEOUT_ = "timeout"; |
| goog.net.XhrIo.XHR2_ON_TIMEOUT_ = "ontimeout"; |
| goog.net.XhrIo.sendInstances_ = []; |
| goog.net.XhrIo.send = function(a, b, c, d, e, f, g) { |
| var h = new goog.net.XhrIo; |
| goog.net.XhrIo.sendInstances_.push(h); |
| b && h.listen(goog.net.EventType.COMPLETE, b); |
| h.listenOnce(goog.net.EventType.READY, h.cleanupSend_); |
| f && h.setTimeoutInterval(f); |
| g && h.setWithCredentials(g); |
| h.send(a, c, d, e); |
| return h; |
| }; |
| goog.net.XhrIo.cleanup = function() { |
| for (var a = goog.net.XhrIo.sendInstances_;a.length;) { |
| a.pop().dispose(); |
| } |
| }; |
| goog.net.XhrIo.protectEntryPoints = function(a) { |
| goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = a.protectEntryPoint(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_); |
| }; |
| goog.net.XhrIo.prototype.cleanupSend_ = function() { |
| this.dispose(); |
| goog.array.remove(goog.net.XhrIo.sendInstances_, this); |
| }; |
| goog.net.XhrIo.prototype.getTimeoutInterval = function() { |
| return this.timeoutInterval_; |
| }; |
| goog.net.XhrIo.prototype.setTimeoutInterval = function(a) { |
| this.timeoutInterval_ = Math.max(0, a); |
| }; |
| goog.net.XhrIo.prototype.setResponseType = function(a) { |
| this.responseType_ = a; |
| }; |
| goog.net.XhrIo.prototype.getResponseType = function() { |
| return this.responseType_; |
| }; |
| goog.net.XhrIo.prototype.setWithCredentials = function(a) { |
| this.withCredentials_ = a; |
| }; |
| goog.net.XhrIo.prototype.getWithCredentials = function() { |
| return this.withCredentials_; |
| }; |
| goog.net.XhrIo.prototype.send = function(a, b, c, d) { |
| if (this.xhr_) { |
| throw Error("[goog.net.XhrIo] Object is active with another request=" + this.lastUri_ + "; newUri=" + a); |
| } |
| b = b ? b.toUpperCase() : "GET"; |
| this.lastUri_ = a; |
| this.lastError_ = ""; |
| this.lastErrorCode_ = goog.net.ErrorCode.NO_ERROR; |
| this.lastMethod_ = b; |
| this.errorDispatched_ = !1; |
| this.active_ = !0; |
| this.xhr_ = this.createXhr(); |
| this.xhrOptions_ = this.xmlHttpFactory_ ? this.xmlHttpFactory_.getOptions() : goog.net.XmlHttp.getOptions(); |
| this.xhr_.onreadystatechange = goog.bind(this.onReadyStateChange_, this); |
| try { |
| goog.log.fine(this.logger_, this.formatMsg_("Opening Xhr")), this.inOpen_ = !0, this.xhr_.open(b, String(a), !0), this.inOpen_ = !1; |
| } catch (f) { |
| goog.log.fine(this.logger_, this.formatMsg_("Error opening Xhr: " + f.message)); |
| this.error_(goog.net.ErrorCode.EXCEPTION, f); |
| return; |
| } |
| a = c || ""; |
| var e = this.headers.clone(); |
| d && goog.structs.forEach(d, function(a, b) { |
| e.set(b, a); |
| }); |
| d = goog.array.find(e.getKeys(), goog.net.XhrIo.isContentTypeHeader_); |
| c = goog.global.FormData && a instanceof goog.global.FormData; |
| !goog.array.contains(goog.net.XhrIo.METHODS_WITH_FORM_DATA, b) || d || c || e.set(goog.net.XhrIo.CONTENT_TYPE_HEADER, goog.net.XhrIo.FORM_CONTENT_TYPE); |
| e.forEach(function(a, b) { |
| this.xhr_.setRequestHeader(b, a); |
| }, this); |
| this.responseType_ && (this.xhr_.responseType = this.responseType_); |
| goog.object.containsKey(this.xhr_, "withCredentials") && (this.xhr_.withCredentials = this.withCredentials_); |
| try { |
| this.cleanUpTimeoutTimer_(), 0 < this.timeoutInterval_ && (this.useXhr2Timeout_ = goog.net.XhrIo.shouldUseXhr2Timeout_(this.xhr_), goog.log.fine(this.logger_, this.formatMsg_("Will abort after " + this.timeoutInterval_ + "ms if incomplete, xhr2 " + this.useXhr2Timeout_)), this.useXhr2Timeout_ ? (this.xhr_[goog.net.XhrIo.XHR2_TIMEOUT_] = this.timeoutInterval_, this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = goog.bind(this.timeout_, this)) : this.timeoutId_ = goog.Timer.callOnce(this.timeout_, this.timeoutInterval_, |
| this)), goog.log.fine(this.logger_, this.formatMsg_("Sending request")), this.inSend_ = !0, this.xhr_.send(a), this.inSend_ = !1; |
| } catch (f) { |
| goog.log.fine(this.logger_, this.formatMsg_("Send error: " + f.message)), this.error_(goog.net.ErrorCode.EXCEPTION, f); |
| } |
| }; |
| goog.net.XhrIo.shouldUseXhr2Timeout_ = function(a) { |
| return goog.userAgent.IE && goog.userAgent.isVersionOrHigher(9) && goog.isNumber(a[goog.net.XhrIo.XHR2_TIMEOUT_]) && goog.isDef(a[goog.net.XhrIo.XHR2_ON_TIMEOUT_]); |
| }; |
| goog.net.XhrIo.isContentTypeHeader_ = function(a) { |
| return goog.string.caseInsensitiveEquals(goog.net.XhrIo.CONTENT_TYPE_HEADER, a); |
| }; |
| goog.net.XhrIo.prototype.createXhr = function() { |
| return this.xmlHttpFactory_ ? this.xmlHttpFactory_.createInstance() : goog.net.XmlHttp(); |
| }; |
| goog.net.XhrIo.prototype.timeout_ = function() { |
| "undefined" != typeof goog && this.xhr_ && (this.lastError_ = "Timed out after " + this.timeoutInterval_ + "ms, aborting", this.lastErrorCode_ = goog.net.ErrorCode.TIMEOUT, goog.log.fine(this.logger_, this.formatMsg_(this.lastError_)), this.dispatchEvent(goog.net.EventType.TIMEOUT), this.abort(goog.net.ErrorCode.TIMEOUT)); |
| }; |
| goog.net.XhrIo.prototype.error_ = function(a, b) { |
| this.active_ = !1; |
| this.xhr_ && (this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1); |
| this.lastError_ = b; |
| this.lastErrorCode_ = a; |
| this.dispatchErrors_(); |
| this.cleanUpXhr_(); |
| }; |
| goog.net.XhrIo.prototype.dispatchErrors_ = function() { |
| this.errorDispatched_ || (this.errorDispatched_ = !0, this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.ERROR)); |
| }; |
| goog.net.XhrIo.prototype.abort = function(a) { |
| this.xhr_ && this.active_ && (goog.log.fine(this.logger_, this.formatMsg_("Aborting")), this.active_ = !1, this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1, this.lastErrorCode_ = a || goog.net.ErrorCode.ABORT, this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.ABORT), this.cleanUpXhr_()); |
| }; |
| goog.net.XhrIo.prototype.disposeInternal = function() { |
| this.xhr_ && (this.active_ && (this.active_ = !1, this.inAbort_ = !0, this.xhr_.abort(), this.inAbort_ = !1), this.cleanUpXhr_(!0)); |
| goog.net.XhrIo.superClass_.disposeInternal.call(this); |
| }; |
| goog.net.XhrIo.prototype.onReadyStateChange_ = function() { |
| if (!this.isDisposed()) { |
| if (this.inOpen_ || this.inSend_ || this.inAbort_) { |
| this.onReadyStateChangeHelper_(); |
| } else { |
| this.onReadyStateChangeEntryPoint_(); |
| } |
| } |
| }; |
| goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = function() { |
| this.onReadyStateChangeHelper_(); |
| }; |
| goog.net.XhrIo.prototype.onReadyStateChangeHelper_ = function() { |
| if (this.active_ && "undefined" != typeof goog) { |
| if (this.xhrOptions_[goog.net.XmlHttp.OptionType.LOCAL_REQUEST_ERROR] && this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE && 2 == this.getStatus()) { |
| goog.log.fine(this.logger_, this.formatMsg_("Local request error detected and ignored")); |
| } else { |
| if (this.inSend_ && this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE) { |
| goog.Timer.callOnce(this.onReadyStateChange_, 0, this); |
| } else { |
| if (this.dispatchEvent(goog.net.EventType.READY_STATE_CHANGE), this.isComplete()) { |
| goog.log.fine(this.logger_, this.formatMsg_("Request complete")); |
| this.active_ = !1; |
| try { |
| this.isSuccess() ? (this.dispatchEvent(goog.net.EventType.COMPLETE), this.dispatchEvent(goog.net.EventType.SUCCESS)) : (this.lastErrorCode_ = goog.net.ErrorCode.HTTP_ERROR, this.lastError_ = this.getStatusText() + " [" + this.getStatus() + "]", this.dispatchErrors_()); |
| } finally { |
| this.cleanUpXhr_(); |
| } |
| } |
| } |
| } |
| } |
| }; |
| goog.net.XhrIo.prototype.cleanUpXhr_ = function(a) { |
| if (this.xhr_) { |
| this.cleanUpTimeoutTimer_(); |
| var b = this.xhr_, c = this.xhrOptions_[goog.net.XmlHttp.OptionType.USE_NULL_FUNCTION] ? goog.nullFunction : null; |
| this.xhrOptions_ = this.xhr_ = null; |
| a || this.dispatchEvent(goog.net.EventType.READY); |
| try { |
| b.onreadystatechange = c; |
| } catch (d) { |
| goog.log.error(this.logger_, "Problem encountered resetting onreadystatechange: " + d.message); |
| } |
| } |
| }; |
| goog.net.XhrIo.prototype.cleanUpTimeoutTimer_ = function() { |
| this.xhr_ && this.useXhr2Timeout_ && (this.xhr_[goog.net.XhrIo.XHR2_ON_TIMEOUT_] = null); |
| goog.isNumber(this.timeoutId_) && (goog.Timer.clear(this.timeoutId_), this.timeoutId_ = null); |
| }; |
| goog.net.XhrIo.prototype.isActive = function() { |
| return !!this.xhr_; |
| }; |
| goog.net.XhrIo.prototype.isComplete = function() { |
| return this.getReadyState() == goog.net.XmlHttp.ReadyState.COMPLETE; |
| }; |
| goog.net.XhrIo.prototype.isSuccess = function() { |
| var a = this.getStatus(); |
| return goog.net.HttpStatus.isSuccess(a) || 0 === a && !this.isLastUriEffectiveSchemeHttp_(); |
| }; |
| goog.net.XhrIo.prototype.isLastUriEffectiveSchemeHttp_ = function() { |
| var a = goog.uri.utils.getEffectiveScheme(String(this.lastUri_)); |
| return goog.net.XhrIo.HTTP_SCHEME_PATTERN.test(a); |
| }; |
| goog.net.XhrIo.prototype.getReadyState = function() { |
| return this.xhr_ ? this.xhr_.readyState : goog.net.XmlHttp.ReadyState.UNINITIALIZED; |
| }; |
| goog.net.XhrIo.prototype.getStatus = function() { |
| try { |
| return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ? this.xhr_.status : -1; |
| } catch (a) { |
| return -1; |
| } |
| }; |
| goog.net.XhrIo.prototype.getStatusText = function() { |
| try { |
| return this.getReadyState() > goog.net.XmlHttp.ReadyState.LOADED ? this.xhr_.statusText : ""; |
| } catch (a) { |
| return goog.log.fine(this.logger_, "Can not get status: " + a.message), ""; |
| } |
| }; |
| goog.net.XhrIo.prototype.getLastUri = function() { |
| return String(this.lastUri_); |
| }; |
| goog.net.XhrIo.prototype.getResponseText = function() { |
| try { |
| return this.xhr_ ? this.xhr_.responseText : ""; |
| } catch (a) { |
| return goog.log.fine(this.logger_, "Can not get responseText: " + a.message), ""; |
| } |
| }; |
| goog.net.XhrIo.prototype.getResponseBody = function() { |
| try { |
| if (this.xhr_ && "responseBody" in this.xhr_) { |
| return this.xhr_.responseBody; |
| } |
| } catch (a) { |
| goog.log.fine(this.logger_, "Can not get responseBody: " + a.message); |
| } |
| return null; |
| }; |
| goog.net.XhrIo.prototype.getResponseXml = function() { |
| try { |
| return this.xhr_ ? this.xhr_.responseXML : null; |
| } catch (a) { |
| return goog.log.fine(this.logger_, "Can not get responseXML: " + a.message), null; |
| } |
| }; |
| goog.net.XhrIo.prototype.getResponseJson = function(a) { |
| if (this.xhr_) { |
| var b = this.xhr_.responseText; |
| a && 0 == b.indexOf(a) && (b = b.substring(a.length)); |
| return goog.json.parse(b); |
| } |
| }; |
| goog.net.XhrIo.prototype.getResponse = function() { |
| try { |
| if (!this.xhr_) { |
| return null; |
| } |
| if ("response" in this.xhr_) { |
| return this.xhr_.response; |
| } |
| switch(this.responseType_) { |
| case goog.net.XhrIo.ResponseType.DEFAULT: |
| ; |
| case goog.net.XhrIo.ResponseType.TEXT: |
| return this.xhr_.responseText; |
| case goog.net.XhrIo.ResponseType.ARRAY_BUFFER: |
| if ("mozResponseArrayBuffer" in this.xhr_) { |
| return this.xhr_.mozResponseArrayBuffer; |
| } |
| ; |
| } |
| goog.log.error(this.logger_, "Response type " + this.responseType_ + " is not supported on this browser"); |
| return null; |
| } catch (a) { |
| return goog.log.fine(this.logger_, "Can not get response: " + a.message), null; |
| } |
| }; |
| goog.net.XhrIo.prototype.getResponseHeader = function(a) { |
| return this.xhr_ && this.isComplete() ? this.xhr_.getResponseHeader(a) : void 0; |
| }; |
| goog.net.XhrIo.prototype.getAllResponseHeaders = function() { |
| return this.xhr_ && this.isComplete() ? this.xhr_.getAllResponseHeaders() : ""; |
| }; |
| goog.net.XhrIo.prototype.getResponseHeaders = function() { |
| for (var a = {}, b = this.getAllResponseHeaders().split("\r\n"), c = 0;c < b.length;c++) { |
| if (!goog.string.isEmptyOrWhitespace(b[c])) { |
| var d = goog.string.splitLimit(b[c], ": ", 2); |
| a[d[0]] = a[d[0]] ? a[d[0]] + (", " + d[1]) : d[1]; |
| } |
| } |
| return a; |
| }; |
| goog.net.XhrIo.prototype.getLastErrorCode = function() { |
| return this.lastErrorCode_; |
| }; |
| goog.net.XhrIo.prototype.getLastError = function() { |
| return goog.isString(this.lastError_) ? this.lastError_ : String(this.lastError_); |
| }; |
| goog.net.XhrIo.prototype.formatMsg_ = function(a) { |
| return a + " [" + this.lastMethod_ + " " + this.lastUri_ + " " + this.getStatus() + "]"; |
| }; |
| goog.debug.entryPointRegistry.register(function(a) { |
| goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_ = a(goog.net.XhrIo.prototype.onReadyStateChangeEntryPoint_); |
| }); |
| var pagespeed = {Statistics:function(a) { |
| this.xhr_ = a || new goog.net.XhrIo; |
| this.psolMessages_ = []; |
| a = document.getElementById("stat").textContent.split("\n"); |
| for (var b = 0;b < a.length;++b) { |
| var c = a[b].split(":"); |
| 2 > c.length || (c = {name:c[0].trim(), value:c[1].trim()}, this.psolMessages_.push(c)); |
| } |
| this.numUnfilteredMessages_ = this.psolMessages_.length; |
| this.lastValue_ = {statsName:0}; |
| this.timesOfChange_ = {statsName:0}; |
| this.filter_ = ""; |
| this.firstRefreshStarted_ = this.sortByNumberOfChanges_ = this.autoRefresh_ = !1; |
| a = document.createElement("div"); |
| a.style.overflow = "hidden"; |
| a.style.clear = "both"; |
| b = document.createElement("div"); |
| b.id = "ui-div"; |
| b.innerHTML = '<table id="ui-table" border=1 style="float:left; border-collapse: collapse;border-color:silver;"><tr valign="center"><td>Auto refresh (every 5 seconds): <input type="checkbox" id="auto-refresh" ' + (this.autoRefresh_ ? "checked" : "") + '></td><td> Filter: <input id="text-filter" type="text" size="70"></td></tr></table>'; |
| a.appendChild(b); |
| b = document.createElement("div"); |
| b.id = "num"; |
| b.className = "pagespeed-show-number"; |
| a.appendChild(b); |
| document.body.insertBefore(a, document.getElementById("stat")); |
| this.updateMessageCount(); |
| }}; |
| pagespeed.Statistics.prototype.toggleAutorefresh = function() { |
| this.autoRefresh_ = !this.autoRefresh_; |
| }; |
| pagespeed.Statistics.prototype.toggleSorting = function() { |
| this.sortByNumberOfChanges_ = !this.sortByNumberOfChanges_; |
| this.update(); |
| }; |
| pagespeed.Statistics.prototype.setFilter = function(a) { |
| this.filter_ = a.value; |
| this.update(); |
| }; |
| pagespeed.Statistics.prototype.updateMessageCount = function(a) { |
| a = void 0 != a ? a : this.psolMessages_.length; |
| document.getElementById("num").textContent = "The number of statistics: " + a.toString() + "/" + this.numUnfilteredMessages_; |
| }; |
| pagespeed.Statistics.prototype.error = function() { |
| goog.array.clear(this.psolMessages_); |
| this.numUnfilteredMessages_ = 0; |
| this.updateMessageCount(); |
| document.getElementById("stat").textContent = pagespeed.Statistics.REFRESH_ERROR_; |
| }; |
| pagespeed.Statistics.prototype.update = function() { |
| this.sortByNumberOfChanges_ ? this.sortByNumberOfChanges() : this.sortByAlphabet(); |
| var a = goog.array.clone(this.psolMessages_); |
| if (this.filter_) { |
| for (var b = a.length - 1;0 <= b;--b) { |
| a[b].name && goog.string.caseInsensitiveContains(a[b].name, this.filter_) || a.splice(b, 1); |
| } |
| } |
| this.updateMessageCount(a.length); |
| for (var c = document.createElement("table"), b = 0;b < a.length;++b) { |
| var d = c.insertRow(-1), e = d.insertCell(0); |
| e.textContent = a[b].name; |
| e.className = "pagespeed-stats-name"; |
| e = d.insertCell(1); |
| e.textContent = a[b].value; |
| e.className = "pagespeed-stats-value"; |
| e = d.insertCell(2); |
| e.textContent = this.timesOfChange_[a[b].name].toString(); |
| e.className = "pagespeed-stats-number-of-changes"; |
| } |
| a = c.createTHead().insertRow(0); |
| e = a.insertCell(0); |
| e.innerHTML = 'Name <input type="checkbox" id="sort-alpha" title="Sort in alphabetical order."' + (this.sortByNumberOfChanges_ ? "" : "checked") + ">"; |
| e.className = "pagespeed-stats-first-column"; |
| a.insertCell(1).textContent = "Value"; |
| e = a.insertCell(2); |
| e.innerHTML = 'Number of changes <input type="checkbox" id="sort-freq" title="Sort by the number of changes(descending order)."' + (this.sortByNumberOfChanges_ ? "checked" : "") + ">"; |
| e.title = "How many times the value changes during the auto-refresh.\nThe number of changes only accumulates when auto-refresh is on."; |
| e.className = "pagespeed-stats-third-column"; |
| e = document.getElementById("stat"); |
| e.innerHTML = ""; |
| e.appendChild(c); |
| goog.events.listen(document.getElementById("sort-freq"), "change", goog.bind(this.toggleSorting, this)); |
| goog.events.listen(document.getElementById("sort-alpha"), "change", goog.bind(this.toggleSorting, this)); |
| }; |
| pagespeed.Statistics.alphabetCompareFunc = function(a, b) { |
| return a.name > b.name ? 1 : a.name < b.name ? -1 : 0; |
| }; |
| pagespeed.Statistics.prototype.sortByNumberOfChanges = function() { |
| this.psolMessages_.sort(goog.bind(function(a, b) { |
| var c = this.timesOfChange_[a.name], d = this.timesOfChange_[b.name]; |
| return d != c ? d - c : pagespeed.Statistics.alphabetCompareFunc(a, b); |
| }, this)); |
| }; |
| pagespeed.Statistics.prototype.sortByAlphabet = function() { |
| this.psolMessages_.sort(pagespeed.Statistics.alphabetCompareFunc); |
| }; |
| pagespeed.Statistics.prototype.parseMessagesFromResponse = function(a) { |
| var b = a.variables; |
| a = a.maxlength; |
| if ("object" != goog.typeOf(b) || "number" != goog.typeOf(a)) { |
| this.error(); |
| } else { |
| a = []; |
| for (var c in b) { |
| if ("_" != c[c.length - 1]) { |
| var d = c.replace(/-/g, "_"); |
| "_" == d[0] && (d = d.substring(1)); |
| a.push({name:d, value:b[c].toString()}); |
| var e = b[c], f = this.timesOfChange_[d]; |
| void 0 == f ? this.timesOfChange_[d] = e ? 1 : 0 : e != this.lastValue_[d] && (this.timesOfChange_[d] = f + 1); |
| this.lastValue_[d] = e; |
| } |
| } |
| this.psolMessages_ = a; |
| this.numUnfilteredMessages_ = a.length; |
| this.update(); |
| } |
| }; |
| pagespeed.Statistics.REFRESH_ERROR_ = "Sorry, failed to update the statistics. Please wait and try again later."; |
| pagespeed.Statistics.prototype.requestUrl = function() { |
| var a = location.pathname, b = a.lastIndexOf("/", a.length - 2); |
| return 0 < b ? a.substring(0, b) + "/stats_json" : a + "/stats_json"; |
| }; |
| pagespeed.Statistics.prototype.performRefresh = function() { |
| this.xhr_.isActive() || this.firstRefreshStarted_ && !this.autoRefresh_ || (this.firstRefreshStarted_ = !0, this.xhr_.send(this.requestUrl())); |
| }; |
| pagespeed.Statistics.prototype.parseAjaxResponse = function() { |
| if (this.xhr_.isSuccess()) { |
| var a = this.xhr_.getResponseJson(); |
| this.parseMessagesFromResponse(a); |
| } else { |
| console.log(this.xhr_.getLastError()), this.error(); |
| } |
| }; |
| pagespeed.Statistics.FREQUENCY_ = 5E3; |
| pagespeed.Statistics.Start = function() { |
| goog.events.listen(window, "load", function() { |
| var a = new pagespeed.Statistics, b = document.getElementById("text-filter"); |
| goog.events.listen(b, "keyup", goog.bind(a.setFilter, a, b)); |
| goog.events.listen(document.getElementById("auto-refresh"), "change", goog.bind(a.toggleAutorefresh, a)); |
| setInterval(goog.bind(a.performRefresh, a), pagespeed.Statistics.FREQUENCY_); |
| goog.events.listen(a.xhr_, goog.net.EventType.COMPLETE, goog.bind(a.parseAjaxResponse, a)); |
| a.performRefresh(); |
| }); |
| }; |
| goog.exportSymbol("pagespeed.Statistics.Start", pagespeed.Statistics.Start); |
| })(); |