sharetribe-flex-sdk
Version:
Sharetribe SDK for JavaScript
1,475 lines (1,453 loc) • 508 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("axios"), require("jsonwebtoken"));
else if(typeof define === 'function' && define.amd)
define(["axios", "jsonwebtoken"], factory);
else if(typeof exports === 'object')
exports["sharetribeSdk"] = factory(require("axios"), require("jsonwebtoken"));
else
root["sharetribeSdk"] = factory(root["axios"], root["jsonwebtoken"]);
})(global, function(__WEBPACK_EXTERNAL_MODULE__70__, __WEBPACK_EXTERNAL_MODULE__71__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 178);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var baseGet = __webpack_require__(23);
/**
* Gets the value at `path` of `object`. If the resolved value is
* `undefined`, the `defaultValue` is returned in its place.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to query.
* @param {Array|string} path The path of the property to get.
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
* @returns {*} Returns the resolved value.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.get(object, 'a[0].b.c');
* // => 3
*
* _.get(object, ['a', '0', 'b', 'c']);
* // => 3
*
* _.get(object, 'a.b.c', 'default');
* // => 'default'
*/
function get(object, path, defaultValue) {
var result = object == null ? undefined : baseGet(object, path);
return result === undefined ? defaultValue : result;
}
module.exports = get;
/***/ }),
/* 1 */
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
var baseSet = __webpack_require__(37);
/**
* Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
* it's created. Arrays are created for missing index properties while objects
* are created for all other missing properties. Use `_.setWith` to customize
* `path` creation.
*
* **Note:** This method mutates `object`.
*
* @static
* @memberOf _
* @since 3.7.0
* @category Object
* @param {Object} object The object to modify.
* @param {Array|string} path The path of the property to set.
* @param {*} value The value to set.
* @returns {Object} Returns `object`.
* @example
*
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
*
* _.set(object, 'a[0].b.c', 4);
* console.log(object.a[0].b.c);
* // => 4
*
* _.set(object, ['x', '0', 'y', 'z'], 5);
* console.log(object.x[0].y.z);
* // => 5
*/
function set(object, path, value) {
return object == null ? object : baseSet(object, path, value);
}
module.exports = set;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(42);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
// transit-js 0.8.862
// http://transit-format.org
//
// Copyright 2014 Cognitect. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License..
var $jscomp = $jscomp || {};
$jscomp.scope = {};
$jscomp.checkStringArgs = function(a, b, c) {
if (null == a) {
throw new TypeError("The 'this' value for String.prototype." + c + " must not be null or undefined");
}
if (b instanceof RegExp) {
throw new TypeError("First argument to String.prototype." + c + " must not be a regular expression");
}
return a + "";
};
$jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
a != Array.prototype && a != Object.prototype && (a[b] = c.value);
};
$jscomp.getGlobal = function(a) {
return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a;
};
$jscomp.global = $jscomp.getGlobal(this);
$jscomp.polyfill = function(a, b, c, d) {
if (b) {
c = $jscomp.global;
a = a.split(".");
for (d = 0; d < a.length - 1; d++) {
var e = a[d];
e in c || (c[e] = {});
c = c[e];
}
a = a[a.length - 1];
d = c[a];
b = b(d);
b != d && null != b && $jscomp.defineProperty(c, a, {configurable:!0, writable:!0, value:b});
}
};
$jscomp.polyfill("String.prototype.repeat", function(a) {
return a ? a : function(a) {
var b = $jscomp.checkStringArgs(this, null, "repeat");
if (0 > a || 1342177279 < a) {
throw new RangeError("Invalid count value");
}
a |= 0;
for (var d = ""; a;) {
if (a & 1 && (d += b), a >>>= 1) {
b += b;
}
}
return d;
};
}, "es6-impl", "es3");
$jscomp.SYMBOL_PREFIX = "jscomp_symbol_";
$jscomp.initSymbol = function() {
$jscomp.initSymbol = function() {
};
$jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol);
};
$jscomp.symbolCounter_ = 0;
$jscomp.Symbol = function(a) {
return $jscomp.SYMBOL_PREFIX + (a || "") + $jscomp.symbolCounter_++;
};
$jscomp.initSymbolIterator = function() {
$jscomp.initSymbol();
var a = $jscomp.global.Symbol.iterator;
a || (a = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator"));
"function" != typeof Array.prototype[a] && $jscomp.defineProperty(Array.prototype, a, {configurable:!0, writable:!0, value:function() {
return $jscomp.arrayIterator(this);
}});
$jscomp.initSymbolIterator = function() {
};
};
$jscomp.arrayIterator = function(a) {
var b = 0;
return $jscomp.iteratorPrototype(function() {
return b < a.length ? {done:!1, value:a[b++]} : {done:!0};
});
};
$jscomp.iteratorPrototype = function(a) {
$jscomp.initSymbolIterator();
a = {next:a};
a[$jscomp.global.Symbol.iterator] = function() {
return this;
};
return a;
};
$jscomp.iteratorFromArray = function(a, b) {
$jscomp.initSymbolIterator();
a instanceof String && (a += "");
var c = 0, d = {next:function() {
if (c < a.length) {
var e = c++;
return {value:b(e, a[e]), done:!1};
}
d.next = function() {
return {done:!0, value:void 0};
};
return d.next();
}};
d[Symbol.iterator] = function() {
return d;
};
return d;
};
$jscomp.polyfill("Array.prototype.entries", function(a) {
return a ? a : function() {
return $jscomp.iteratorFromArray(this, function(a, c) {
return [a, c];
});
};
}, "es6-impl", "es3");
$jscomp.polyfill("Array.prototype.keys", function(a) {
return a ? a : function() {
return $jscomp.iteratorFromArray(this, function(a) {
return a;
});
};
}, "es6-impl", "es3");
$jscomp.polyfill("Array.prototype.values", function(a) {
return a ? a : function() {
return $jscomp.iteratorFromArray(this, function(a, c) {
return c;
});
};
}, "es6", "es3");
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] !== Object.prototype[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.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1;
goog.provide = function(a) {
if (goog.isInModuleLoader_()) {
throw Error("goog.provide can not be used within a goog.module.");
}
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. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");
}
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) {
if (a in goog.loadedModules_) {
return goog.loadedModules_[a];
}
if (!goog.implicitNamespaces_[a]) {
return a = goog.getObjectByName(a), null != a ? a : null;
}
}
return null;
};
goog.moduleLoaderState_ = null;
goog.isInModuleLoader_ = function() {
return null != goog.moduleLoaderState_;
};
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, "/");
var f = goog.dependencies_;
d && "boolean" !== typeof d || (d = d ? {module:"goog"} : {});
for (var g = 0; e = b[g]; g++) {
f.nameToPath[e] = a, f.loadFlags[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)) {
if (goog.isInModuleLoader_()) {
return goog.module.getInternal_(a);
}
} else {
if (goog.ENABLE_DEBUG_LOADER) {
var b = goog.getPathFromDeps_(a);
if (b) {
goog.writeScripts_(b);
} else {
throw a = "goog.require could not find: " + a, goog.logToConsole_(a), Error(a);
}
}
}
return null;
}
};
goog.basePath = "";
goog.nullFunction = function() {
};
goog.abstractMethod = function() {
throw Error("unimplemented abstract method");
};
goog.addSingletonGetter = function(a) {
a.instance_ = void 0;
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.TRANSPILE = "detect";
goog.TRANSPILER = "transpile.js";
goog.DEPENDENCIES_ENABLED && (goog.dependencies_ = {loadFlags:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
var a = goog.global.document;
return null != a && "write" in a;
}, goog.findBasePath_ = function() {
if (goog.isDef(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.oldIeWaiting_ = !1, goog.importProcessedScript_ = function(a, b, c) {
goog.importScript_("", 'goog.retrieveAndExec_("' + a + '", ' + b + ", " + c + ");");
}, 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.oldIeWaiting_ = !1;
}, goog.maybeProcessDeferredDep_ = function(a) {
goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPathFromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a));
}, goog.isDeferredModule_ = function(a) {
var b = (a = goog.getPathFromDeps_(a)) && goog.dependencies_.loadFlags[a] || {}, c = b.lang || "es3";
return a && ("goog" == b.module || goog.needsTranspile_(c)) ? 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.loadModuleFromUrl = function(a) {
goog.retrieveAndExec_(a, !0, !1);
}, goog.writeScriptSrcNode_ = function(a) {
goog.global.document.write('<script type="text/javascript" src="' + a + '">\x3c/script>');
}, goog.appendScriptSrcNode_ = function(a) {
var b = goog.global.document, c = b.createElement("script");
c.type = "text/javascript";
c.src = a;
c.defer = !1;
c.async = !1;
b.head.appendChild(c);
}, goog.writeScriptTag_ = function(a, b) {
if (goog.inHtmlDocument_()) {
var c = goog.global.document;
if (!goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING && "complete" == c.readyState) {
if (/\bdeps.js$/.test(a)) {
return !1;
}
throw Error('Cannot write "' + a + '" after document load');
}
if (void 0 === b) {
if (goog.IS_OLD_IE_) {
goog.oldIeWaiting_ = !0;
var d = " onreadystatechange='goog.onScriptLoad_(this, " + ++goog.lastNonModuleScriptIndex_ + ")' ";
c.write('<script type="text/javascript" src="' + a + '"' + d + ">\x3c/script>");
} else {
goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING ? goog.appendScriptSrcNode_(a) : goog.writeScriptSrcNode_(a);
}
} else {
c.write('<script type="text/javascript">' + goog.protectScriptTag_(b) + "\x3c/script>");
}
return !0;
}
return !1;
}, goog.protectScriptTag_ = function(a) {
return a.replace(/<\/(SCRIPT)/ig, "\\x3c/$1");
}, goog.needsTranspile_ = function(a) {
if ("always" == goog.TRANSPILE) {
return !0;
}
if ("never" == goog.TRANSPILE) {
return !1;
}
goog.requiresTranspilation_ || (goog.requiresTranspilation_ = goog.createRequiresTranspilation_());
if (a in goog.requiresTranspilation_) {
return goog.requiresTranspilation_[a];
}
throw Error("Unknown language mode: " + a);
}, goog.requiresTranspilation_ = null, goog.lastNonModuleScriptIndex_ = 0, goog.onScriptLoad_ = function(a, b) {
"complete" == a.readyState && goog.lastNonModuleScriptIndex_ == b && goog.loadQueuedModules_();
return !0;
}, goog.writeScripts_ = function(a) {
function b(a) {
if (!(a in e.written || a in e.visited)) {
e.visited[a] = !0;
if (a in e.requires) {
for (var f in e.requires[a]) {
if (!goog.isProvided_(f)) {
if (f in e.nameToPath) {
b(e.nameToPath[f]);
} else {
throw Error("Undefined nameToPath for " + f);
}
}
}
}
a in d || (d[a] = !0, c.push(a));
}
}
var c = [], d = {}, e = goog.dependencies_;
b(a);
for (var f = 0; f < c.length; f++) {
a = c[f], goog.dependencies_.written[a] = !0;
}
var g = goog.moduleLoaderState_;
goog.moduleLoaderState_ = null;
for (f = 0; f < c.length; f++) {
if (a = c[f]) {
var h = e.loadFlags[a] || {}, k = goog.needsTranspile_(h.lang || "es3");
"goog" == h.module || k ? goog.importProcessedScript_(goog.basePath + a, "goog" == h.module, k) : goog.importScript_(goog.basePath + a);
} 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.hasBadLetScoping = null;
goog.useSafari10Workaround = function() {
if (null == goog.hasBadLetScoping) {
try {
var a = !eval('"use strict";let x = 1; function f() { return typeof x; };f() == "number";');
} catch (b) {
a = !1;
}
goog.hasBadLetScoping = a;
}
return goog.hasBadLetScoping;
};
goog.workaroundSafari10EvalBug = function(a) {
return "(function(){" + a + "\n;})();\n";
};
goog.loadModule = function(a) {
var b = goog.moduleLoaderState_;
try {
goog.moduleLoaderState_ = {moduleName:void 0, declareLegacyNamespace:!1};
if (goog.isFunction(a)) {
var c = a.call(void 0, {});
} else {
if (goog.isString(a)) {
goog.useSafari10Workaround() && (a = goog.workaroundSafari10EvalBug(a)), c = goog.loadModuleFromSource_.call(void 0, 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" == typeof c && null != c && Object.seal(c);
goog.loadedModules_[d] = c;
} finally {
goog.moduleLoaderState_ = b;
}
};
goog.loadModuleFromSource_ = function(a) {
eval(a);
return {};
};
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.loadFileSync_ = function(a) {
if (goog.global.CLOSURE_LOAD_FILE_SYNC) {
return goog.global.CLOSURE_LOAD_FILE_SYNC(a);
}
try {
var b = new goog.global.XMLHttpRequest;
b.open("get", a, !1);
b.send();
return 0 == b.status || 200 == b.status ? b.responseText : null;
} catch (c) {
return null;
}
};
goog.retrieveAndExec_ = function(a, b, c) {
if (!COMPILED) {
var d = a;
a = goog.normalizePath_(a);
var e = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_, f = goog.loadFileSync_(a);
if (null == f) {
throw Error('Load of "' + a + '" failed');
}
c && (f = goog.transpile_.call(goog.global, f, a));
f = b ? goog.wrapModule_(a, f) : f + ("\n//# sourceURL=" + a);
goog.IS_OLD_IE_ && goog.oldIeWaiting_ ? (goog.dependencies_.deferred[d] = f, goog.queuedModules_.push(d)) : e(a, f);
}
};
goog.transpile_ = function(a, b) {
var c = goog.global.$jscomp;
c || (goog.global.$jscomp = c = {});
var d = c.transpile;
if (!d) {
var e = goog.basePath + goog.TRANSPILER, f = goog.loadFileSync_(e);
if (f) {
eval(f + "\n//# sourceURL=" + e);
if (goog.global.$gwtExport && goog.global.$gwtExport.$jscomp && !goog.global.$gwtExport.$jscomp.transpile) {
throw Error('The transpiler did not properly export the "transpile" method. $gwtExport: ' + JSON.stringify(goog.global.$gwtExport));
}
goog.global.$jscomp.transpile = goog.global.$gwtExport.$jscomp.transpile;
c = goog.global.$jscomp;
d = c.transpile;
}
}
d || (d = c.transpile = function(a, b) {
goog.logToConsole_(b + " requires transpilation but no transpiler was found.");
return a;
});
return d(a, b);
};
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) {
null !== 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_) {
if (goog.global.eval("var _evalTest_ = 1;"), "undefined" != typeof goog.global._evalTest_) {
try {
delete goog.global._evalTest_;
} catch (d) {
}
goog.evalWorksForGlobals_ = !0;
} else {
goog.evalWorksForGlobals_ = !1;
}
}
if (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) {
if ("." == String(a).charAt(0)) {
throw Error('className passed in goog.getCssName must not start with ".". You passed: ' + a);
}
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;
}, d = b ? a + "-" + d(b) : d(a);
return goog.global.CLOSURE_CSS_NAME_MAP_FN ? goog.global.CLOSURE_CSS_NAME_MAP_FN(d) : d;
};
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 null != b && 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 d = Array(arguments.length - 2), e = 2; e < arguments.length; e++) {
d[e - 2] = arguments[e];
}
return b.prototype[c].apply(a, d);
};
};
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) {
if (goog.isInModuleLoader_()) {
throw Error("goog.scope is not supported within a goog.module.");
}
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) {
return a;
}
var c = !goog.defineClass.isUnsealable_(b), d = function() {
var b = a.apply(this, arguments) || this;
b[goog.UID_PROPERTY_] = b[goog.UID_PROPERTY_];
this.constructor === d && c && Object.seal instanceof Function && Object.seal(b);
return b;
};
return d;
};
goog.defineClass.isUnsealable_ = function(a) {
return a && a.prototype && a.prototype[goog.UNSEALABLE_CONSTRUCTOR_PROPERTY_];
};
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.createRequiresTranspilation_ = function() {
function a(a, b) {
d ? c[a] = !0 : b() ? c[a] = !1 : d = c[a] = !0;
}
function b(a) {
try {
return !!eval(a);
} catch (g) {
return !1;
}
}
var c = {es3:!1}, d = !1, e = goog.global.navigator && goog.global.navigator.userAgent ? goog.global.navigator.userAgent : "";
a("es5", function() {
return b("[1,].length==1");
});
a("es6", function() {
var a = e.match(/Edge\/(\d+)(\.\d)*/i);
return a && 15 > Number(a[1]) ? !1 : b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()');
});
a("es6-impl", function() {
return !0;
});
a("es7", function() {
return b("2 ** 2 == 4");
});
a("es8", function() {
return b("async () => 1, true");
});
return c;
};
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));
this.reportErrorToServer = !0;
};
goog.inherits(goog.debug.Error, Error);
goog.debug.Error.prototype.name = "CustomError";
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.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.numberAwareCompare_ = function(a, b, c) {
if (a == b) {
return 0;
}
if (!a) {
return -1;
}
if (!b) {
return 1;
}
for (var d = a.toLowerCase().match(c), e = b.toLowerCase().match(c), f = Math.min(d.length, e.length), g = 0; g < f; g++) {
c = d[g];
var h = e[g];
if (c != h) {
return a = parseInt(c, 10), !isNaN(a) && (b = parseInt(h, 10), !isNaN(b) && a - b) ? a - b : c < h ? -1 : 1;
}
}
return d.length != e.length ? d.length - e.length : a < b ? -1 : 1;
};
goog.string.intAwareCompare = function(a, b) {
return goog.string.numberAwareCompare_(a, b, /\d+|\D+/g);
};
goog.string.floatAwareCompare = function(a, b) {
return goog.string.numberAwareCompare_(a, b, /\d+|\.\d+|\D+/g);
};
goog.string.numerateCompare = goog.string.floatAwareCompare;
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 = {"&":"&", "<":"<", ">":">", """:'"'};
var d = b ? b.createElement("div") : goog.global.document.createElement("div");
return a.replace(goog.string.HTML_ENTITY_PATTERN_, function(a, b) {
var e = c[a];
if (e) {
return e;
}
if ("#" == b.charAt(0)) {
var f = Number("0" + b.substr(1));
isNaN(f) || (e = String.fromCharCode(f));
}
e || (d.innerHTML = a + " ", e = d.firstChild.nodeValue.slice(0, -1));
return c[a] = e;
});
};
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 b = Number("0" + c.substr(1));
if (!isNaN(b)) {
return String.fromCharCode(b);
}
}
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);
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.charCodeAt(0);
if (31 < b && 127 > b) {
var c = a;
} else {
if (256 > b) {
if (c = "\\x", 16 > b || 256 < b) {
c += "0";
}
} else {
c = "\\u", 4096 > b && (c += "0");
}
c += b.toString(16).toUpperCase();
}
return goog.string.jsEscapeCache_[a] = c;
};
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) {
return a.replace(b, "");
};
goog.string.removeAll = function(a, b) {
var c = new RegExp(goog.string.regExpEscape(b), "g");
return a.replace(c, "");
};
goog.string.replaceAll = function(a, b, c) {
b = new RegExp(goog.string.regExpEscape(b), "g");
return a.replace(b, c.replace(/\$/g, "$$$$"));
};
goog.string.regExpEscape = function(a) {
return String(a).replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1").replace(/\x08/g, "\\x08");
};
goog.string.repeat = String.prototype.repeat ? function(a, b) {
return a.repeat(b);
} : 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] || "";
do {
h = /(\d*)(\D*)(.*)/.exec(h) || ["", "", "", ""];
k = /(\d*)(\D*)(.*)/.exec(k) || ["", "", "", ""];
if (0 == h[0].length && 0 == k[0].length) {
break;
}
var c = 0 == h[1].length ? 0 : parseInt(h[1], 10), m = 0 == k[1].length ? 0 : parseInt(k[1], 10), c = goog.string.compareElements_(c, m) || goog.string.compareElements_(0 == h[2].length, 0 == k[2].length) || goog.string.compareElements_(h[2], k[2]), h = h[3], k = k[3];
} while (0 == c);
}
return c;
};
goog.string.compareElements_ = function(a, b) {
return a < b ? -1 : a > b ? 1 : 0;
};
goog.string.hashCode = function(a) {
for (var b = 0, c = 0; c < a.length; ++c) {
b = 31 * b + a.charCodeAt(c) >>> 0;
}
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) {