cocoda-sdk 2.0.13 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/axios/lib/helpers/bind.js", "../node_modules/axios/lib/utils.js", "../node_modules/axios/lib/helpers/buildURL.js", "../node_modules/axios/lib/core/InterceptorManager.js", "../node_modules/axios/lib/helpers/normalizeHeaderName.js", "../node_modules/axios/lib/core/enhanceError.js", "../node_modules/axios/lib/core/createError.js", "../node_modules/axios/lib/core/settle.js", "../node_modules/axios/lib/helpers/cookies.js", "../node_modules/axios/lib/helpers/isAbsoluteURL.js", "../node_modules/axios/lib/helpers/combineURLs.js", "../node_modules/axios/lib/core/buildFullPath.js", "../node_modules/axios/lib/helpers/parseHeaders.js", "../node_modules/axios/lib/helpers/isURLSameOrigin.js", "../node_modules/axios/lib/cancel/Cancel.js", "../node_modules/axios/lib/adapters/xhr.js", "../node_modules/axios/lib/defaults.js", "../node_modules/axios/lib/core/transformData.js", "../node_modules/axios/lib/cancel/isCancel.js", "../node_modules/axios/lib/core/dispatchRequest.js", "../node_modules/axios/lib/core/mergeConfig.js", "../node_modules/axios/lib/env/data.js", "../node_modules/axios/lib/helpers/validator.js", "../node_modules/axios/lib/core/Axios.js", "../node_modules/axios/lib/cancel/CancelToken.js", "../node_modules/axios/lib/helpers/spread.js", "../node_modules/axios/lib/helpers/isAxiosError.js", "../node_modules/axios/lib/axios.js", "../node_modules/axios/index.js", "../node_modules/lodash/isArray.js", "../node_modules/lodash/_freeGlobal.js", "../node_modules/lodash/_root.js", "../node_modules/lodash/_Symbol.js", "../node_modules/lodash/_getRawTag.js", "../node_modules/lodash/_objectToString.js", "../node_modules/lodash/_baseGetTag.js", "../node_modules/lodash/isObjectLike.js", "../node_modules/lodash/isSymbol.js", "../node_modules/lodash/_isKey.js", "../node_modules/lodash/isObject.js", "../node_modules/lodash/isFunction.js", "../node_modules/lodash/_coreJsData.js", "../node_modules/lodash/_isMasked.js", "../node_modules/lodash/_toSource.js", "../node_modules/lodash/_baseIsNative.js", "../node_modules/lodash/_getValue.js", "../node_modules/lodash/_getNative.js", "../node_modules/lodash/_nativeCreate.js", "../node_modules/lodash/_hashClear.js", "../node_modules/lodash/_hashDelete.js", "../node_modules/lodash/_hashGet.js", "../node_modules/lodash/_hashHas.js", "../node_modules/lodash/_hashSet.js", "../node_modules/lodash/_Hash.js", "../node_modules/lodash/_listCacheClear.js", "../node_modules/lodash/eq.js", "../node_modules/lodash/_assocIndexOf.js", "../node_modules/lodash/_listCacheDelete.js", "../node_modules/lodash/_listCacheGet.js", "../node_modules/lodash/_listCacheHas.js", "../node_modules/lodash/_listCacheSet.js", "../node_modules/lodash/_ListCache.js", "../node_modules/lodash/_Map.js", "../node_modules/lodash/_mapCacheClear.js", "../node_modules/lodash/_isKeyable.js", "../node_modules/lodash/_getMapData.js", "../node_modules/lodash/_mapCacheDelete.js", "../node_modules/lodash/_mapCacheGet.js", "../node_modules/lodash/_mapCacheHas.js", "../node_modules/lodash/_mapCacheSet.js", "../node_modules/lodash/_MapCache.js", "../node_modules/lodash/memoize.js", "../node_modules/lodash/_memoizeCapped.js", "../node_modules/lodash/_stringToPath.js", "../node_modules/lodash/_arrayMap.js", "../node_modules/lodash/_baseToString.js", "../node_modules/lodash/toString.js", "../node_modules/lodash/_castPath.js", "../node_modules/lodash/_toKey.js", "../node_modules/lodash/_baseGet.js", "../node_modules/lodash/get.js", "../node_modules/lodash/_defineProperty.js", "../node_modules/lodash/_baseAssignValue.js", "../node_modules/lodash/_assignValue.js", "../node_modules/lodash/_isIndex.js", "../node_modules/lodash/_baseSet.js", "../node_modules/lodash/set.js", "../node_modules/lodash/_setCacheAdd.js", "../node_modules/lodash/_setCacheHas.js", "../node_modules/lodash/_SetCache.js", "../node_modules/lodash/_baseFindIndex.js", "../node_modules/lodash/_baseIsNaN.js", "../node_modules/lodash/_strictIndexOf.js", "../node_modules/lodash/_baseIndexOf.js", "../node_modules/lodash/_arrayIncludes.js", "../node_modules/lodash/_arrayIncludesWith.js", "../node_modules/lodash/_cacheHas.js", "../node_modules/lodash/_Set.js", "../node_modules/lodash/noop.js", "../node_modules/lodash/_setToArray.js", "../node_modules/lodash/_createSet.js", "../node_modules/lodash/_baseUniq.js", "../node_modules/lodash/uniq.js", "../node_modules/lodash/_baseUnary.js", "../node_modules/lodash/_baseIntersection.js", "../node_modules/lodash/identity.js", "../node_modules/lodash/_apply.js", "../node_modules/lodash/_overRest.js", "../node_modules/lodash/constant.js", "../node_modules/lodash/_baseSetToString.js", "../node_modules/lodash/_shortOut.js", "../node_modules/lodash/_setToString.js", "../node_modules/lodash/_baseRest.js", "../node_modules/lodash/isLength.js", "../node_modules/lodash/isArrayLike.js", "../node_modules/lodash/isArrayLikeObject.js", "../node_modules/lodash/_castArrayLikeObject.js", "../node_modules/lodash/intersection.js", "../node_modules/lodash/_arrayPush.js", "../node_modules/lodash/_baseIsArguments.js", "../node_modules/lodash/isArguments.js", "../node_modules/lodash/_isFlattenable.js", "../node_modules/lodash/_baseFlatten.js", "../node_modules/lodash/union.js", "../node_modules/lodash/_createBaseFor.js", "../node_modules/lodash/_baseFor.js", "../node_modules/lodash/_baseTimes.js", "../node_modules/lodash/stubFalse.js", "../node_modules/lodash/isBuffer.js", "../node_modules/lodash/_baseIsTypedArray.js", "../node_modules/lodash/_nodeUtil.js", "../node_modules/lodash/isTypedArray.js", "../node_modules/lodash/_arrayLikeKeys.js", "../node_modules/lodash/_isPrototype.js", "../node_modules/lodash/_overArg.js", "../node_modules/lodash/_nativeKeys.js", "../node_modules/lodash/_baseKeys.js", "../node_modules/lodash/keys.js", "../node_modules/lodash/_baseForOwn.js", "../node_modules/lodash/_castFunction.js", "../node_modules/lodash/forOwn.js", "../node_modules/lodash/isString.js", "../node_modules/lodash/_DataView.js", "../node_modules/lodash/_Promise.js", "../node_modules/lodash/_WeakMap.js", "../node_modules/lodash/_getTag.js", "../node_modules/lodash/isEmpty.js", "../node_modules/lodash/_stackClear.js", "../node_modules/lodash/_stackDelete.js", "../node_modules/lodash/_stackGet.js", "../node_modules/lodash/_stackHas.js", "../node_modules/lodash/_stackSet.js", "../node_modules/lodash/_Stack.js", "../node_modules/lodash/_arraySome.js", "../node_modules/lodash/_equalArrays.js", "../node_modules/lodash/_Uint8Array.js", "../node_modules/lodash/_mapToArray.js", "../node_modules/lodash/_equalByTag.js", "../node_modules/lodash/_baseGetAllKeys.js", "../node_modules/lodash/_arrayFilter.js", "../node_modules/lodash/stubArray.js", "../node_modules/lodash/_getSymbols.js", "../node_modules/lodash/_getAllKeys.js", "../node_modules/lodash/_equalObjects.js", "../node_modules/lodash/_baseIsEqualDeep.js", "../node_modules/lodash/_baseIsEqual.js", "../node_modules/lodash/isEqual.js", "../node_modules/lodash/_assignMergeValue.js", "../node_modules/lodash/_cloneBuffer.js", "../node_modules/lodash/_cloneArrayBuffer.js", "../node_modules/lodash/_cloneTypedArray.js", "../node_modules/lodash/_copyArray.js", "../node_modules/lodash/_baseCreate.js", "../node_modules/lodash/_getPrototype.js", "../node_modules/lodash/_initCloneObject.js", "../node_modules/lodash/isPlainObject.js", "../node_modules/lodash/_safeGet.js", "../node_modules/lodash/_copyObject.js", "../node_modules/lodash/_nativeKeysIn.js", "../node_modules/lodash/_baseKeysIn.js", "../node_modules/lodash/keysIn.js", "../node_modules/lodash/toPlainObject.js", "../node_modules/lodash/_baseMergeDeep.js", "../node_modules/lodash/_baseMerge.js", "../node_modules/lodash/_isIterateeCall.js", "../node_modules/lodash/_createAssigner.js", "../node_modules/lodash/merge.js", "../node_modules/lodash/last.js", "../node_modules/lodash/_arrayEach.js", "../node_modules/lodash/_baseAssign.js", "../node_modules/lodash/_baseAssignIn.js", "../node_modules/lodash/_copySymbols.js", "../node_modules/lodash/_getSymbolsIn.js", "../node_modules/lodash/_copySymbolsIn.js", "../node_modules/lodash/_getAllKeysIn.js", "../node_modules/lodash/_initCloneArray.js", "../node_modules/lodash/_cloneDataView.js", "../node_modules/lodash/_cloneRegExp.js", "../node_modules/lodash/_cloneSymbol.js", "../node_modules/lodash/_initCloneByTag.js", "../node_modules/lodash/_baseIsMap.js", "../node_modules/lodash/isMap.js", "../node_modules/lodash/_baseIsSet.js", "../node_modules/lodash/isSet.js", "../node_modules/lodash/_baseClone.js", "../node_modules/lodash/_baseSlice.js", "../node_modules/lodash/_parent.js", "../node_modules/lodash/_baseUnset.js", "../node_modules/lodash/_customOmitClone.js", "../node_modules/lodash/flatten.js", "../node_modules/lodash/_flatRest.js", "../node_modules/lodash/omit.js", "../node_modules/lodash/concat.js", "../node_modules/jskos-tools/lib/sha1.js", "../node_modules/jskos-tools/lib/identifiers.js", "../node_modules/jskos-tools/lib/utils.js", "../node_modules/jskos-tools/lib/object-types.js", "../node_modules/jskos-tools/lib/concept-scheme.js", "../node_modules/jskos-tools/lib/language-preference.js", "../node_modules/jskos-tools/lib/tools.js", "../node_modules/jskos-tools/index.js", "../node_modules/localforage/dist/localforage.js", "../src/index.js", "../src/errors/index.js", "../src/lib/CocodaSDK.js", "../src/utils/lodash.js", "../src/providers/index.js", "../src/providers/base-provider.js", "../src/utils/index.js", "../src/providers/local-mappings-provider.js", "../node_modules/uuid/dist/esm-browser/rng.js", "../node_modules/uuid/dist/esm-browser/regex.js", "../node_modules/uuid/dist/esm-browser/validate.js", "../node_modules/uuid/dist/esm-browser/stringify.js", "../node_modules/uuid/dist/esm-browser/v4.js", "../src/providers/mappings-api-provider.js", "../src/providers/occurrences-api-provider.js", "../src/providers/concept-api-provider.js", "../src/providers/reconciliation-api-provider.js", "../src/providers/label-search-suggestion-provider.js", "../src/providers/skosmos-api-provider.js", "../src/providers/loc-api-provider.js"],
4
- "sourcesContent": ["'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n", "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n", "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n", "'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n", "module.exports = {\n \"version\": \"0.26.0\"\n};", "'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n", "var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n", "var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n", "var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n", "var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n", "var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n", "var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n", "var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n", "var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n", "var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n", "var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n", "var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n", "var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n", "var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n", "var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n", "var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n", "var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n", "var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n", "/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n", "var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n", "var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n", "var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n", "var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n", "var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n", "var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n", "var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n", "var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n", "var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n", "var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n", "var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n", "var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n", "/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n", "/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n", "/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n", "var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n", "var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n", "/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n", "/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n", "var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n", "var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n", "var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n", "var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n", "var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n", "var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n", "var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n", "var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n", "var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n", "var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n", "var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n", "var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n", "var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n", "var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n", "var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n", "var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n", "var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n", "var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n", "var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n", "var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n", "var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n", "var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n", "var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n", "var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n", "var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n", "var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n", "var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n", "var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n", "var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n", "var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n", "var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n", "var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n", "var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n", "var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n", "var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n", "var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n", "var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n", "var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n", "var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n", "var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n", "var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n", "var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n", "var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n", "var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n", "var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n", "var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n", "var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n", "var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n", "var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n", "var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n", "var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n", "var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n", "var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n", "var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n", "var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n", "var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n", "/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n", "var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n", "var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n", "var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n", "var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n", "var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n", "var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n", "var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n", "var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n", "var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n", "var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n", "var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n", "/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n", "var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n", "var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n", "var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n", "var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n", "var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n", "var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nmodule.exports = omit;\n", "var arrayPush = require('./_arrayPush'),\n baseFlatten = require('./_baseFlatten'),\n copyArray = require('./_copyArray'),\n isArray = require('./isArray');\n\n/**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\nfunction concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n}\n\nmodule.exports = concat;\n", "// adapted from from https://locutus.io/php/strings/sha1/\nmodule.exports = function sha1 (str) {\n // discuss at: https://locutus.io/php/sha1/\n // original by: Webtoolkit.info (https://www.webtoolkit.info/)\n // improved by: Michael White (https://getsprink.com)\n // improved by: Kevin van Zonneveld (https://kvz.io)\n // input by: Brett Zamir (https://brett-zamir.me)\n // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n // note 1: in a steaming fashion for faster and more efficient hashing\n // example 1: sha1('Kevin van Zonneveld')\n // returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'\n\n var _rotLeft = function (n, s) {\n var t4 = (n << s) | (n >>> (32 - s))\n return t4\n }\n\n var _cvtHex = function (val) {\n var str = \"\"\n var i\n var v\n\n for (i = 7; i >= 0; i--) {\n v = (val >>> (i * 4)) & 0x0f\n str += v.toString(16)\n }\n return str\n }\n\n var blockstart\n var i, j\n var W = new Array(80)\n var H0 = 0x67452301\n var H1 = 0xEFCDAB89\n var H2 = 0x98BADCFE\n var H3 = 0x10325476\n var H4 = 0xC3D2E1F0\n var A, B, C, D, E\n var temp\n\n // utf8_encode\n str = unescape(encodeURIComponent(str))\n var strLen = str.length\n\n var wordArray = []\n for (i = 0; i < strLen - 3; i += 4) {\n j = str.charCodeAt(i) << 24 |\n str.charCodeAt(i + 1) << 16 |\n str.charCodeAt(i + 2) << 8 |\n str.charCodeAt(i + 3)\n wordArray.push(j)\n }\n\n switch (strLen % 4) {\n case 0:\n i = 0x080000000\n break\n case 1:\n i = str.charCodeAt(strLen - 1) << 24 | 0x0800000\n break\n case 2:\n i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000\n break\n case 3:\n i = str.charCodeAt(strLen - 3) << 24 |\n str.charCodeAt(strLen - 2) << 16 |\n str.charCodeAt(strLen - 1) <<\n 8 | 0x80\n break\n }\n\n wordArray.push(i)\n\n while ((wordArray.length % 16) !== 14) {\n wordArray.push(0)\n }\n\n wordArray.push(strLen >>> 29)\n wordArray.push((strLen << 3) & 0x0ffffffff)\n\n for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {\n for (i = 0; i < 16; i++) {\n W[i] = wordArray[blockstart + i]\n }\n for (i = 16; i <= 79; i++) {\n W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)\n }\n\n A = H0\n B = H1\n C = H2\n D = H3\n E = H4\n\n for (i = 0; i <= 19; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 20; i <= 39; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 40; i <= 59; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 60; i <= 79; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n H0 = (H0 + A) & 0x0ffffffff\n H1 = (H1 + B) & 0x0ffffffff\n H2 = (H2 + C) & 0x0ffffffff\n H3 = (H3 + D) & 0x0ffffffff\n H4 = (H4 + E) & 0x0ffffffff\n }\n\n temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4)\n return temp.toLowerCase()\n}\n", "/**\n * Module to calculate JSKOS mapping identifiers.\n */\n\nconst sha1 = require(\"./sha1.js\")\n\n// Reduce JSKOS set to members with URI.\nfunction reduceSet(set) {\n return set.map(member => member && member.uri).filter(Boolean)\n}\n\n// Tell which concept bundle field is used.\nfunction memberField(bundle) {\n return [\"memberSet\", \"memberList\", \"memberChoice\"].find(f => bundle[f])\n}\n\n// Reduce JSKOS concept bundle to memberSet/List/Choice with member URIs only.\nfunction reduceBundle(bundle) {\n const field = memberField(bundle)\n const set = bundle[field] ? reduceSet(bundle[field]) : []\n return {\n [set.length > 1 ? field : \"memberSet\"]: set.map(uri => ({uri})),\n }\n}\n\n// Reduce mapping to reduced fields from, to, and type.\nfunction mappingContent(mapping) {\n const { from, to, type } = mapping\n let result = {\n from: reduceBundle(from || {}),\n to: reduceBundle(to || {}),\n type: [\n type && type[0] || \"http://www.w3.org/2004/02/skos/core#mappingRelation\",\n ],\n }\n for (let side of [\"from\", \"to\"]) {\n if ((result[side][memberField(result[side])] || []).length == 0) {\n let scheme = mapping[side + \"Scheme\"]\n if (scheme && scheme.uri) {\n // Create new object to remove all unnecessary properties.\n result[side + \"Scheme\"] = { uri: scheme.uri }\n }\n }\n }\n return result\n}\n\n// Get a sorted list of member URIs.\nfunction mappingMembers(mapping) {\n const { from, to } = mapping\n const memberUris = [ from, to ].filter(Boolean)\n .map(bundle => reduceSet(bundle[memberField(bundle)] || []))\n return [].concat(...memberUris).sort()\n}\n\n/**\n * Returns a mapping content identifier. The identifier starts with `urn:jskos:mapping:content:`\n * and takes concepts and type into consideration. It uses the `mappingContent` function to get\n * relevant properties from the mapping.\n * @memberof module:jskos-tools\n */\nfunction mappingContentIdentifier(mapping) {\n const json = JSON.stringify(mappingContent(mapping), [\"from\",\"fromScheme\",\"to\",\"toScheme\",\"type\",\"memberSet\",\"memberList\",\"memberChoice\",\"uri\"])\n return \"urn:jskos:mapping:content:\" + sha1(json+\"\\n\")\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction mappingMembersIdentifier(mapping) {\n const json = JSON.stringify(mappingMembers(mapping))\n return \"urn:jskos:mapping:members:\" + sha1(json+\"\\n\")\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction addMappingIdentifiers(mapping) {\n const identifier = (mapping.identifier || []).filter(\n id => id && !id.startsWith(\"urn:jskos:mapping:\"),\n ).concat([\n mappingMembersIdentifier(mapping),\n mappingContentIdentifier(mapping),\n ]).sort()\n return Object.assign({}, mapping, {identifier})\n}\n\nfunction compare(mapping1, mapping2, prefix) {\n mapping1 = mapping1 && addMappingIdentifiers(mapping1)\n mapping2 = mapping2 && addMappingIdentifiers(mapping2)\n let id1 = mapping1 && mapping1.identifier ? mapping1.identifier.find(element => element.startsWith(prefix)) : null\n let id2 = mapping2 && mapping2.identifier ? mapping2.identifier.find(element => element.startsWith(prefix)) : null\n return id1 == id2\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction compareMappings(mapping1, mapping2) {\n return compare(mapping1, mapping2, \"urn:jskos:mapping:content:\")\n}\nconst compareMappingContent = compareMappings\n\n/**\n * @memberof module:jskos-tools\n */\nfunction compareMappingMembers(mapping1, mapping2) {\n return compare(mapping1, mapping2, \"urn:jskos:mapping:members:\")\n}\n\nmodule.exports = {\n mappingContent,\n mappingMembers,\n mappingContentIdentifier,\n mappingMembersIdentifier,\n addMappingIdentifiers,\n compareMappings,\n compareMappingContent,\n compareMappingMembers,\n}\n", "function isEqualWith(a, b, compare) {\n var pSlice = Array.prototype.slice\n var Object_keys = typeof Object.keys === \"function\"\n ? Object.keys\n : function (obj) {\n var keys = []\n for (var key in obj) keys.push(key)\n return keys\n }\n var deepEqual = function (actual, expected) {\n if (actual === expected) {\n return true\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime()\n } else if (typeof actual != \"object\" && typeof expected != \"object\") {\n return actual == expected\n } else {\n return objEquiv(actual, expected)\n }\n }\n function isUndefinedOrNull(value) {\n return value === null || value === undefined\n }\n function isArguments(object) {\n return Object.prototype.toString.call(object) == \"[object Arguments]\"\n }\n function objEquiv(a, b) {\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false\n if (a.prototype !== b.prototype) return false\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false\n }\n a = pSlice.call(a)\n b = pSlice.call(b)\n return deepEqual(a, b)\n }\n try {\n var ka = Object_keys(a),\n kb = Object_keys(b),\n key, i\n } catch (e) {\n return false\n }\n if (ka.length != kb.length)\n return false\n ka.sort()\n kb.sort()\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i]\n if (compare) {\n let result = compare(a[key], b[key], key)\n if (result === undefined) {\n // fallback to method without comparison\n result = isEqualWith(a[key], b[key])\n }\n if (!result) {\n return false\n }\n } else {\n if (!deepEqual(a[key], b[key])) return false\n }\n }\n return true\n }\n return deepEqual(a, b)\n}\n\nmodule.exports = {\n get: (obj, path, defaultValue = undefined) => {\n const travel = regexp =>\n String.prototype.split\n .call(path, regexp)\n .filter(Boolean)\n .reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj)\n const result = travel(/[,[\\]]+?/) || travel(/[,[\\].]+?/)\n return result === undefined || result === obj ? defaultValue : result\n },\n pick: (object, keys) => {\n return keys.reduce((obj, key) => {\n // eslint-disable-next-line no-prototype-builtins\n if (object && object.hasOwnProperty(key)) {\n obj[key] = object[key]\n }\n return obj\n }, {})\n },\n forOwn: (object, cb) => {\n for(let key in object){\n // eslint-disable-next-line no-prototype-builtins\n if (object.hasOwnProperty(key)){\n cb(object[key], key)\n }\n }\n },\n isEqualWith,\n intersection: (...arrays) => arrays.reduce((a, b) => a.filter(c => b.includes(c))),\n isObject: object => typeof object === \"object\" && object !== null,\n isString: (str) => (str && typeof str.valueOf() === \"string\") ? true : false,\n union: (a, b) => [...new Set([...a, ...b])],\n unionWith: (a, b, compare) => [...a, ...b].reduce((p, c) => {\n if (p.findIndex(v => compare(v, c)) !== -1) {\n return p\n }\n p.push(c)\n return p\n }, []),\n omitMod: (obj, paths) => {\n for (let path of paths) {\n if (typeof path === \"string\") {\n path = path.split(\".\")\n }\n for (let i = 0; i < path.length - 1; i++) {\n obj = obj[path[i]]\n if (typeof obj === \"undefined\") {\n continue\n }\n }\n delete obj[path.pop()]\n }\n },\n}\n\n/**\n * Sources:\n * - https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore\n * - https://dustinpfister.github.io/2017/09/24/lodash_forown/\n * - https://stackoverflow.com/a/48666737/11050851\n * - https://github.com/stutrek/node-deep-equal/blob/master/index.js (heavily adapted to integrate isEqualWith)\n * - Own Implementation\n */\n", "const mappingTypes = require(\"./mapping-types.json\")\n\n/**\n * JSKOS Concept Types indexed by primary name.\n * @memberof module:jskos-tools\n */\nconst objectTypes = {\n Concept: {\n type: [\"http://www.w3.org/2004/02/skos/core#Concept\"],\n },\n ConceptScheme: {\n type: [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"],\n },\n ConceptMapping: {\n type: mappingTypes.map(type => type.uri),\n },\n ConceptOccurrence: {\n type: [\n \"http://purl.org/cld/cdtype/CatalogueOrIndex\",\n ],\n },\n Registry: {\n type: [\n \"http://www.w3.org/ns/dcat#Catalog\",\n ],\n },\n Distribution: {\n type: [\n \"http://www.w3.org/ns/dcat#Distribution\",\n ],\n },\n Concordance: {\n type: [\n \"http://rdfs.org/ns/void#Linkset\",\n \"http://rdf-vocabulary.ddialliance.org/xkos#Correspondence\",\n ],\n },\n Resource: {},\n Item: {},\n ConceptBundle: {},\n Annotation: {\n type: [\n \"Annotation\",\n \"http://www.w3.org/ns/oa#Annotation\",\n ],\n },\n}\n\n// build lookup table\nconst objectTypeUris = Object.keys(objectTypes).reduce((map, name) => {\n for (let uri of (objectTypes[name].type || [])) {\n map[uri] = name\n }\n return map\n}, {})\n\n/**\n * Guess the JSKOS Concept Type name from an object or name.\n * @memberof module:jskos-tools\n * @param {object|string} jskos|name|uri object or string to guess from\n * @param {boolean} shortname return short name if enabled (false by default)\n */\nfunction guessObjectType(obj, shortname=false) {\n var type\n if (typeof obj === \"string\" && obj) {\n if (obj in objectTypeUris) {\n // given by URI\n type = objectTypeUris[obj]\n } else {\n // given by name\n obj = obj.toLowerCase().replace(/s$/,\"\")\n type = Object.keys(objectTypes).find(name => {\n const lowercase = name.toLowerCase()\n if (lowercase === obj || lowercase === \"concept\" + obj) {\n return true\n }\n })\n }\n } else if (typeof obj === \"object\") {\n if (obj.type) {\n let types = Array.isArray(obj.type) ? obj.type : [obj.type]\n for (let uri of types) {\n if (uri in objectTypeUris) {\n type = objectTypeUris[uri]\n break\n }\n }\n }\n }\n return (shortname && type) ? type.toLowerCase().replace(/^concept(.+)/, \"$1\") : type\n}\n\nmodule.exports = { objectTypes, guessObjectType }\n", "const regexChars = /[\\\\^$.*+?()[\\]{}|]/g\nconst regexEscape = string => string.replace(regexChars, \"\\\\$&\")\n\n// Special characters that uriPattern can be build with\n// Some other special characters such as [ and ] will not work!\nconst notationEscapeChars = /[% ]/\n\n/**\n * A [JSKOS Concept Scheme](http://gbv.github.io/jskos/jskos.html#concept-schemes).\n * @memberof module:jskos-tools\n * @example\n * const { ConceptScheme } = require('jskos-tools')\n * let scheme = new ConceptScheme({\n * namespace: \"http://example.org/\",\n * notationPattern: \"[0-9]+\"\n * })\n */\nclass ConceptScheme {\n\n /**\n * @param {object} [jskos] - object that's copied as scheme (shallow copy)\n */\n constructor (scheme={}) {\n Object.assign(this, scheme)\n\n if (!this.notationPattern) {\n this.notationPattern = \".+\"\n }\n\n if (!this.uriPattern && this.namespace) {\n this.uriPattern = \"^\" + regexEscape(this.namespace)\n const escaped = this.notationPattern.replace(notationEscapeChars, encodeURI)\n this.uriPattern += \"(\" + escaped + \")$\"\n }\n\n this.NOTATION_REGEX = RegExp(\"^\" + this.notationPattern + \"$\")\n\n if (this.uriPattern) {\n this.URI_REGEX = RegExp(this.uriPattern)\n }\n }\n\n /**\n * Check whether a string is a valid notation as defined by `notationPattern`.\n * @param {string} notation\n * @returns {array|null}\n */\n isValidNotation(notation) {\n return this.NOTATION_REGEX.exec(notation)\n }\n\n /**\n * Check whether URI belongs to the scheme, return local notation on success.\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} uri\n * @returns {string|undefined}\n */\n notationFromUri(uri) {\n if (this.URI_REGEX) {\n const match = this.URI_REGEX.exec(uri)\n if (match) {\n return decodeURI(match[1])\n }\n }\n }\n\n /**\n * Map local notation to URI. Does not check whether notation is valid!\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} notation\n * @example scheme.uriFromNotation(\"123\") // http://example.org/123\n */\n uriFromNotation (notation) {\n if (this.uriPattern) {\n notation = encodeURI(notation)\n return this.uriPattern\n .replace(/^\\^|\\$$/g, \"\").replace(/\\\\/g, \"\").replace(/\\(.*\\)/, notation)\n }\n }\n\n /**\n * Check whether URI belongs to the scheme, return concept on success.\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} uri\n * @param {object} [options] boolean flags `inScheme` and `toConcept`\n */\n conceptFromUri (uri, options={}) {\n const notation = this.notationFromUri(uri)\n if (notation === undefined) {\n return\n }\n const concept = { uri, notation: [notation] }\n if (options.inScheme) {\n concept.inScheme = [{uri: this.uri }]\n }\n if (options.topConcept) {\n concept.topConceptOf = [{uri: this.uri }]\n }\n return concept\n }\n\n /**\n * Map local notation to concept, if notation is valid. Requires scheme to\n * have `uriPattern` or `namespace`.\n * @param {string} notation\n * @param {object} [options] same as conceptFromUri options\n */\n conceptFromNotation (notation, options) {\n if (this.isValidNotation(notation)) {\n return this.conceptFromUri(this.uriFromNotation(notation), options)\n }\n }\n}\n\nmodule.exports = ConceptScheme\n", "const _ = require(\"./utils\")\n\nconst languagePreference = {\n store: null,\n path: \"\",\n defaults: [\"en\"],\n getLanguages,\n selectLanguage,\n}\n\n/**\n * Get the preference list either from store or from defaults (fallback)\n */\nfunction getLanguages() {\n return _.get(languagePreference.store, languagePreference.path) || languagePreference.defaults\n}\n\n/**\n * Selects a language tag from a language map or null if no language was found.\n *\n * @param {object} languageMap map to select language tag from\n */\nfunction selectLanguage(languageMap) {\n\n if (!languageMap) {\n return null\n }\n\n for (let language of getLanguages()) {\n if (languageMap[language]) {\n return language\n }\n }\n\n // fallback: iterate through languages and choose the first one\n for (let language of Object.keys(languageMap)) {\n if (language != \"-\") {\n return language\n }\n }\n\n return null\n}\n\nmodule.exports = languagePreference\n", "const _ = require(\"./utils\")\n\n/**\n * Tests if a string only contains uppercase letters.\n * @private\n * @param {string} str\n */\nconst isUpperCase = str => {\n return (/^[A-Z]*$/).test(str)\n}\n\n/**\n * Safely get a nested property.\n * @private\n * @param {*} object the object to access\n * @param {*} path path expression\n */\nconst getNested = (object, path) => {\n return path.split(\".\").reduce(\n (xs, x) => (xs && xs[x]) ? xs[x] : null, object)\n}\n\n/**\n * Add @context URI to a JSKOS resource or to an array of JSKOS resources.\n * @memberof module:jskos-tools\n * @param {object} jskos object or array of objects\n */\nconst addContext = jskos => {\n let array = jskos instanceof Array ? jskos : [jskos]\n array.forEach(resource => {\n resource[\"@context\"] = \"https://gbv.github.io/jskos/context.json\"\n })\n return jskos\n}\n\n/**\n * Recursively cleans JSKOS object by removing properties starting with _ or containing only uppercase letters.\n * Warning: Works directly on the object without creating a copy!\n * @memberof module:jskos-tools\n * @param {object} jskos\n */\nconst clean = jskos => {\n Object.keys(jskos).forEach(key => {\n if (isUpperCase(key) || key.startsWith(\"_\")) {\n delete jskos[key]\n } else {\n if (jskos[key] != null && typeof jskos[key] === \"object\") {\n jskos[key] = clean(jskos[key])\n }\n }\n })\n return jskos\n}\n\n// cleanJSKOS as alias for clean.\nconst cleanJSKOS = clean\n\n/**\n * Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world [null] statements.\n * All properties starting with an underscore (_) will be ignored.\n * @memberof module:jskos-tools\n * @param {object} object\n * @param {array} replaceCircular - additional property names that should be replace with open world [null] statements\n * @param {bool} skipUnderscore - whether to skip properties starting with `_` (default `true`)\n */\nconst copyDeep = (object, replaceCircular = [], skipUnderscore = true) => {\n replaceCircular = replaceCircular.concat([\n \"ancestors\", \"narrower\", \"broader\", \"mappings\", \"memberList\", \"TOPCONCEPTS\", \"MAPPINGS\", \"PROVIDER\",\n ])\n let clone = Array.isArray(object) ? [] : {}\n for(let i in object) {\n // Ignore all properties starting with _\n if (skipUnderscore && i[0] == \"_\") {\n continue\n }\n if (replaceCircular.includes(i)) {\n // Remove circular structures, replace with [null] if it has elements\n if (object[i] && Array.isArray(object[i])) {\n if (object[i].length > 0) {\n clone[i] = [null]\n } else {\n clone[i] = []\n }\n continue\n } else {\n clone[i] = null\n continue\n }\n }\n if (i == \"inScheme\") {\n // Remove circular structur for inScheme and replace with new object consisting only of URI, notation, and prefLabel\n let inScheme = []\n for (let scheme of object.inScheme) {\n let newScheme = { uri: scheme.uri }\n if (scheme.notation) {\n newScheme.notation = scheme.notation\n }\n if (scheme.prefLabel) {\n newScheme.prefLabel = scheme.prefLabel\n }\n inScheme.push(newScheme)\n }\n clone.inScheme = inScheme\n continue\n }\n if (object[i] != null && typeof(object[i]) == \"object\") {\n clone[i] = copyDeep(object[i])\n } else {\n clone[i] = object[i]\n }\n }\n return clone\n}\n\n// deepCopy as alias for copyDeep.\nconst deepCopy = copyDeep\n\n/**\n * Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties.\n *\n * @memberof module:jskos-tools\n * @param {object} object\n */\nconst getAllUris = object => {\n if (!object) return []\n return (object.uri ? [object.uri] : []).concat(object.identifier || [])\n}\n\n/**\n * Compares two objects based on their URIs, using getAllUris.\n *\n * @memberof module:jskos-tools\n * @param {object} object1\n * @param {object} object2\n */\nconst compare = (object1, object2) => {\n // Return true if both objects are null.\n if (object1 == null && object2 == null) {\n return true\n }\n // Compare URIs for objects.\n const replaceUri = uri => uri.replace(\"http://\").replace(\"https://\")\n let object1uris = getAllUris(object1).map(replaceUri)\n let object2uris = getAllUris(object2).map(replaceUri)\n if (_.intersection(object1uris, object2uris).length > 0) {\n return true\n } else {\n return false\n }\n}\n\n// compareObjects, compareSchemes and compareConcepts as aliases for compare, for compatibility.\nconst compareObjects = compare\nconst compareSchemes = compare\nconst compareConcepts = compare\n\n/**\n * Checks whether JSKOS object is a concept based on type property.\n * @memberof module:jskos-tools\n */\nconst isConcept = object => {\n return _.get(object, \"type\", []).includes(\"http://www.w3.org/2004/02/skos/core#Concept\") || _.get(object, \"inScheme\") != null || _.get(object, \"topConceptOf\") != null\n}\n\n/**\n * Checks whether JSKOS object is a concept scheme based on type property.\n * @memberof module:jskos-tools\n */\nconst isScheme = object => {\n return _.get(object, \"type\", []).includes(\"http://www.w3.org/2004/02/skos/core#ConceptScheme\")\n}\n\n/**\n * Checks whether an object is contained in a list of objects using compare.\n * @memberof module:jskos-tools\n */\nconst isContainedIn = (object, objects) => {\n if (!object || !objects) {\n return false\n }\n for (let o of objects) {\n if (compare(object, o)) {\n return true\n }\n }\n return false\n}\n\n// isSchemeInList as alias for isContainedIn.\nconst isSchemeInList = isContainedIn\n\n/**\n * Sorts a list of concepts by their notation, then URI.\n *\n * @memberof module:jskos-tools\n * @param {*} concepts\n */\nconst sortConcepts = (concepts, numerical = false) => {\n return concepts.sort(\n (a, b) => {\n let _a = _.get(a, \"notation[0]\"), _b = _.get(b, \"notation[0]\")\n if (_a && _b) {\n _a = _a.toLowerCase()\n _b = _b.toLowerCase()\n }\n if (numerical) {\n _a = parseFloat(_a) || _a\n _b = parseFloat(_b) || _b\n }\n // Fallback to URI\n if (!_a || !_b || _a == _b) {\n _a = a.uri\n _b = b.uri\n }\n if (_a && _b) {\n if (_a > _b) {\n return 1\n } else if (_a < _b) {\n return -1\n }\n }\n return 0\n },\n )\n}\n\n/**\n * Sorts a list of schemes by their prefLabel (German or English), then notation, then URI.\n *\n * @memberof module:jskos-tools\n * @param {*} schemes\n */\nconst sortSchemes = schemes => {\n let order = [\"notation[0]\", [\"prefLabel.de\", \"prefLabel.en\"], \"uri\"]\n return schemes.sort(\n (a, b) => {\n for (let path of order) {\n let _a, _b\n if (Array.isArray(path)) {\n for (let path2 of path) {\n _a = _a || _.get(a, path2)\n _b = _b || _.get(b, path2)\n }\n } else {\n _a = _.get(a, path)\n _b = _.get(b, path)\n }\n if (_a != null && _b != null) {\n _a = _a.toLowerCase()\n _b = _b.toLowerCase()\n if (_a > _b) {\n return 1\n } else if (_a < _b) {\n return -1\n }\n }\n }\n return 0\n },\n )\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst minifyMapping = mapping => {\n let newMapping = _.pick(copyDeep(mapping), [\"from\", \"to\", \"fromScheme\", \"toScheme\", \"creator\", \"contributor\", \"type\", \"created\", \"modified\", \"note\", \"identifier\", \"uri\"])\n for (let fromTo of [newMapping.from, newMapping.to]) {\n _.forOwn(fromTo, (value, key) => {\n let conceptBundle = []\n for (let concept of value) {\n conceptBundle.push(_.pick(concept, [\"uri\", \"notation\"]))\n }\n fromTo[key] = conceptBundle\n })\n }\n if (newMapping.fromScheme) {\n newMapping.fromScheme = _.pick(newMapping.fromScheme, [\"uri\", \"notation\"])\n }\n if (newMapping.toScheme) {\n newMapping.toScheme = _.pick(newMapping.toScheme, [\"uri\", \"notation\"])\n }\n return newMapping\n}\n\n/**\n * @memberof module:jskos-tools\n *\n * Run `bin/localize-mapping-types` to update labels from Wikidata.\n */\nconst mappingTypes = require(\"./mapping-types.json\")\n\n/**\n * @memberof module:jskos-tools\n */\nconst mappingTypeByUri = function(uri) {\n for(let mappingType of mappingTypes) {\n if (uri == mappingType.uri) {\n return mappingType\n }\n }\n return null\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst defaultMappingType = mappingTypeByUri(\"http://www.w3.org/2004/02/skos/core#mappingRelation\")\n\n/**\n * @memberof module:jskos-tools\n */\nconst mappingTypeByType = function(type, defaultType = defaultMappingType) {\n let uri\n if (Array.isArray(type) && type.length > 0) {\n uri = type[0]\n } else {\n // This is a workaround for the type being a string instead of an array.\n uri = type\n }\n return mappingTypeByUri(uri) || defaultType\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst flattenMapping = (mapping, options = {}) => {\n const { language } = options\n\n let fromNotation = getNested(mapping, \"from.memberSet.0.notation.0\")\n let toNotation = getNested(mapping, \"to.memberSet.0.notation.0\")\n fromNotation = fromNotation !== null ? fromNotation : \"\"\n toNotation = toNotation !== null ? toNotation : \"\"\n let type = mappingTypeByUri(getNested(mapping, \"type.0\"))\n type = type ? type.SHORT : \"\"\n\n let fromLabel = \"\"\n let toLabel = \"\"\n let creator = \"\"\n if (language) {\n fromLabel = getNested(mapping, `from.memberSet.0.prefLabel.${language}`)\n toLabel = getNested(mapping, `to.memberSet.0.prefLabel.${language}`)\n creator = getNested(mapping, `creator.0.prefLabel.${language}`)\n }\n\n return {fromNotation, toNotation, fromLabel, toLabel, type, creator}\n}\n\n/**\n * Returns a function to serialize an array as CSV row as configured.\n * See CSV Dialect (<https://frictionlessdata.io/specs/csv-dialect/>).\n *\n * @memberof module:jskos-tools\n */\nconst csvSerializer = (options = {}) => {\n const delimiter = options.delimiter || \",\"\n const quoteChar = options.quoteChar || \"\\\"\"\n const lineTerminator = options.lineTerminator || \"\\n\"\n const doubleQuote = quoteChar + quoteChar\n const quote = s => quoteChar + (s == null ? \"\" : s.split(quoteChar).join(doubleQuote)) + quoteChar\n\n return row => row.map(quote).join(delimiter) + lineTerminator\n}\n\n/**\n * Returns a list of concepts for a mapping.\n *\n * @memberof module:jskos-tools\n * @param {*} mapping\n * @param {*} side - Either `from` or `to`. Default is both.\n */\nconst conceptsOfMapping = (mapping, side) => {\n let concepts = []\n for (let s of [\"from\", \"to\"]) {\n if (side == null || s === side) {\n concepts = concepts.concat(\n _.get(mapping, `${s}.memberSet`) ||\n _.get(mapping, `${s}.memberChoice`) ||\n _.get(mapping, `${s}.memberList`) ||\n [],\n )\n }\n }\n return concepts.filter(c => c != null)\n}\n\n/**\n * Returns an object of preconfigured conversion functions to convert mappings into CSV.\n *\n * @memberof module:jskos-tools\n * @param {object} options\n *\n * Possible options:\n * - delimiter: delimiter character (default `,`)\n * - quoteChar: quote character (default `\"`)\n * - lineTerminator: line terminator (default `\\n`)\n * - type: whether to include mapping type in output (default true)\n * - schemes: whether to include scheme notations in output (default false)\n * - labels: whether to include concept labels in output (default false)\n * - creator: whether to include mapping creator in output (default false)\n *\n */\nconst mappingCSV = (options = {}) => {\n const toCSV = csvSerializer(options)\n const language = options.language || \"en\"\n if (options.type == null) {\n options.type = true\n }\n\n const header = (mappings) => {\n mappings = mappings || []\n let fields = []\n for (let side of [\"from\", \"to\"]) {\n // Scheme\n if (options.schemes) {\n fields.push(`${side}Scheme`)\n }\n // Minimum count: 1 (for 1-to-1 mappings)\n let conceptCount = Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, side).length), 1)\n for (let i = 0; i < conceptCount; i += 1) {\n // Notation\n fields.push(`${side}Notation${i ? i + 1 : \"\"}`)\n // Label\n if (options.labels) {\n fields.push(`${side}Label${i ? i + 1 : \"\"}`)\n }\n }\n }\n // Type\n if (options.type) {\n fields.push(\"type\")\n }\n // Creator\n if (options.creator) {\n fields.push(\"creator\")\n }\n return toCSV(fields)\n }\n\n /**\n * Converts a single mapping into a CSV line.\n *\n * @param {*} mapping a single mapping\n * @param {*} options2 an options object with properties `fromCount` and `toCount`\n */\n const fromMapping = (mapping, options2 = {}) => {\n let fields = []\n for (let side of [\"from\", \"to\"]) {\n // Scheme\n if (options.schemes) {\n fields.push(_.get(mapping, `${side}Scheme.notation[0]`, \"\"))\n }\n const concepts = conceptsOfMapping(mapping, side)\n let conceptCount = options2[`${side}Count`]\n if (conceptCount == null) {\n conceptCount = concepts.length\n }\n // Minimum count: 1 (for 1-to-1 mappings)\n conceptCount = Math.max(conceptCount, 1)\n for (let i = 0; i < conceptCount; i += 1) {\n // Notation\n fields.push(_.get(concepts[i], \"notation[0]\", \"\"))\n // Label\n if (options.labels) {\n fields.push(_.get(concepts[i], `prefLabel.${language}`, \"\"))\n }\n }\n }\n // Type\n if (options.type) {\n fields.push(_.get(mappingTypeByUri(_.get(mapping, \"type[0]\")), \"SHORT\", \"\"))\n }\n // Creator\n if (options.creator) {\n fields.push(_.get(mapping, `creator[0].prefLabel.${language}`))\n }\n return toCSV(fields)\n }\n\n /**\n * Converts an array of mappings into CSV.\n *\n * @param {*} mapping an array of mappings\n * @param {*} options2 an options object with optional property `header` (default true)\n */\n const fromMappings = (mappings, options2 = { header: true }) => {\n let result = \"\"\n if (options2.header) {\n result += header(mappings)\n }\n const fromMappingOptions = {\n fromCount: Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, \"from\").length)),\n toCount: Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, \"to\").length)),\n }\n for (let mapping of mappings) {\n result += fromMapping(mapping, fromMappingOptions)\n }\n return result\n }\n\n return {\n header,\n fromMapping,\n fromMappings,\n }\n}\n\n/**\n * Compare two mappings based on their properties. Concept sets and schemes are compared by URI.\n *\n * @memberof module:jskos-tools\n */\nfunction compareMappingsDeep(mapping1, mapping2) {\n return _.isEqualWith(mapping1, mapping2, (object1, object2, prop) => {\n let mapping1 = { [prop]: object1 }\n let mapping2 = { [prop]: object2 }\n if (prop == \"from\" || prop == \"to\") {\n if (!_.isEqualWith(Object.getOwnPropertyNames(_.get(object1, prop, {})), Object.getOwnPropertyNames(_.get(object2, prop, {})))) {\n return false\n }\n return _.isEqualWith(conceptsOfMapping(mapping1, prop), conceptsOfMapping(mapping2, prop), (concept1, concept2, index) => {\n if (index != undefined) {\n return compare(concept1, concept2)\n }\n return undefined\n })\n }\n if (prop == \"fromScheme\" || prop == \"toScheme\") {\n return compare(object1, object2)\n }\n // Let lodash's isEqual do the comparison\n return undefined\n })\n}\n\nconst { objectTypes, guessObjectType } = require(\"./object-types\")\n\n/**\n * Checks if two objects have a matching object type. Returns false only if types for both objects could be guessed and they did not match.\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n */\nconst matchObjectTypes = (a, b) => {\n // Guess object types of both objects\n let aType = guessObjectType(a), bType = guessObjectType(b)\n // If both object types could be guessed, throw an error if they don't match\n if (aType && bType && aType != bType) {\n return false\n }\n return true\n}\n\n/**\n * Sorts an array so that `null` values are at the end.\n *\n * @private\n * @param {*} array\n */\nconst _nullSort = (array) => {\n if (Array.isArray(array)) {\n array.sort((a, b) => {\n if (a === null) {\n return 1\n }\n if (b === null) {\n return -1\n }\n return 0\n })\n }\n}\n\n/**\n * Merge URIs of two objects `a` and `b` into `a` by adding/removing URIs from identifier property.\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n */\nconst mergeUris = (a, b) => {\n if (!a || !b) {\n return a\n }\n // Merge identifier array\n if (Array.isArray(a.identifier) || Array.isArray(b.identifier)) {\n a.identifier = _.union(a.identifier || [], b.identifier || [])\n }\n // Add URI to a if necessary\n if (!a.uri && b.uri) {\n a.uri = b.uri\n }\n // Add b's URI to a's identifier if necessary\n if (a.uri && b.uri && a.uri != b.uri && !(a.identifier || []).includes(b.uri)) {\n a.identifier = (a.identifier || []).concat([b.uri])\n }\n // Remove a's URI from identifier if necessary\n if (Array.isArray(a.identifier) && a.uri) {\n a.identifier = a.identifier.filter(uri => uri !== a.uri)\n }\n // Remove identifier property if empty\n if ((a.identifier || []).length == 0) {\n delete a.identifier\n }\n // Sort null values to end\n _nullSort(a.identifier)\n return a\n}\n\n/**\n * Merges two JSKOS objects. Object properties will be merged deeply. Array properties will be combined (and URIs will be used for comparison if it's an array of objects).\n *\n * The `options` property allows for different options:\n * - `mergeUris` (boolean, default `false`) - appends b's URI to the result's `identifier` property if necessary, removes a's URI from the result's `identifier` property if necessary (useful for merging ConceptSchemes)\n * - `detectMismatch` (array of strings, default `[]`) - throws an error if the value at a certain path does not match between the two objects (allows for deep properties, e.g. `prefLabel.de`)\n * - `skipPaths` (array of strings, default `[]`) - provide paths to completely skip when merging\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n * @param {object} options - optional, see above\n */\nconst merge = (a, b, options) => {\n if (!a || !b) {\n return a ? a : b\n }\n options = options || {}\n // Path is used for deep detectMismatch checks\n let path = options._path || \"\"\n // Throw an error if two simple properties do not match between the objects\n let detectMismatch = options.detectMismatch || []\n let skipPaths = options.skipPaths || []\n let result = {}\n // Merge properties that are in both objects\n _.forOwn(a, (value, key) => {\n // Skip path if necessary\n if (skipPaths.includes(path + key)) {\n return\n }\n if (Array.isArray(value) && Array.isArray(b[key])) {\n // Merge array properties\n result[key] = _.unionWith(value, b[key], (first, second) => {\n if (_.isObject(first) && _.isObject(second)) {\n return compare(first, second)\n }\n return first === second\n })\n // Sort null values to the end while keeping the rest of the order the same\n _nullSort(result[key])\n } else if (_.isObject(value) && _.isObject(b[key])) {\n // Merge object properties\n result[key] = merge(value, b[key], Object.assign({ _path: `${path}${key}.` }, options))\n } else {\n if (value && b[key] && detectMismatch.includes(path + key) && !_.isEqualWith(value, b[key])) {\n throw new Error(\"Property mismatch in \" + path + key)\n }\n result[key] = value\n }\n })\n // Add properties that are only in b\n _.forOwn(b, (value, key) => {\n if (!a[key]) {\n result[key] = value\n }\n })\n // Remove paths if necessary\n if (path == \"\") {\n _.omitMod(result, skipPaths)\n }\n // Merge URIs if necessary\n if (options.mergeUris) {\n mergeUris(result, b)\n }\n return result\n}\n\n/**\n * Applies recursive unicode normalization to data.\n *\n * - If data is an array, it will recursively normalize all elements of that array.\n * - If data is an object, it will recursively normalize all property values of that object.\n * - If data is a string, it will apply unicode normalization to that string.\n * - If data is of any other type, it will be returned as is.\n *\n * @param {*} data\n */\nconst normalize = data => {\n if (Array.isArray(data)) {\n return data.map(element => normalize(element))\n } else if (_.isObject(data)) {\n _.forOwn(data, (value, key) => {\n data[key] = normalize(value)\n })\n return data\n } else {\n if (_.isString(data)) {\n return data.normalize()\n } else {\n return data\n }\n }\n}\n\n/**\n * Checks whether a string is a valid URI.\n *\n * @param {string} uri URI to be tested\n */\nlet isValidUri = (uri) => {\n // from: http://jmrware.com/articles/2009/uri_regexp/URI_regex.html\n var re_js_rfc3986_URI = /^[A-Za-z][A-Za-z0-9+\\-.]*:(?:\\/\\/(?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\.[A-Za-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*)(?::[0-9]*)?(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|\\/(?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?|(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|)(?:\\?(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$/\n return uri.match(re_js_rfc3986_URI) !== null\n}\n\n/**\n * An object of compare functions (can be used by array.sort for example).\n *\n * TODO: Add more functions.\n */\nlet compareFunctions = {\n /**\n * Compare mappings by their first concept.\n *\n * @param {*} mapping1 - first mapping\n * @param {*} mapping2 - second mapping\n * @param {*} fromTo - side, either `from` or `to`\n */\n mappingsByConcepts: (mapping1, mapping2, fromTo) => {\n let bundleFields = [\"memberSet\", \"memberList\", \"memberChoice\"], notation1, notation2\n for (let field of bundleFields) {\n notation1 = notation1 || _.get(mapping1, fromTo + \".\" + field + \"[0].notation[0]\")\n notation2 = notation2 || _.get(mapping2, fromTo + \".\" + field + \"[0].notation[0]\")\n }\n if (notation1 == null || notation1 < notation2) {\n return -1\n }\n if (notation2 == null || notation1 > notation2) {\n return 1\n }\n return 0\n },\n}\n\n/**\n * Returns `true` if the user owns the mapping (i.e. is first creator), `false` if not.\n *\n * @param {*} user a login-server compatible user object\n * @param {*} mapping a JSKOS mapping\n */\nconst userOwnsMapping = (user, mapping) => {\n if (!user || !mapping) {\n return false\n }\n return [user.uri].concat(Object.values(user.identities || {}).map(identity => identity.uri)).filter(uri => uri != null).includes(_.get(mapping, \"creator[0].uri\"))\n}\n\nconst ConceptScheme = require(\"./concept-scheme\")\nconst languagePreference = require(\"./language-preference\")\n\n/**\n * Returns the primary notation for a JSKOS Item. If there is no notation, it will return an empty string.\n * Scheme notations will be uppercased.\n *\n * @param {object} item a JSKOS Item\n * @param {string} type type of item (optional)\n */\nfunction notation(item, type) {\n let notation\n if (item && item.notation && item.notation.length) {\n notation = item.notation[0]\n if (isScheme(item) || type == \"scheme\") {\n notation = notation.toUpperCase()\n }\n } else if (item && item.inScheme && item.inScheme[0] && item.uri) {\n // Try to imply notation from scheme and concept URI\n try {\n const scheme = new ConceptScheme(item && item.inScheme && item.inScheme[0])\n notation = scheme.notationFromUri(item.uri)\n } catch (error) {\n // Ignore error\n }\n }\n return notation || \"\"\n}\n\n/**\n * Returns the content of a language map for a JSKOS Item.\n *\n * @param {*} item a JSKOS Item\n * @param {string} prop property of interest in the item\n * @param {object} options options object:\n * - `language`: preferred language\n */\nfunction languageMapContent(item, prop, { language } = {}) {\n let languageMap = (item && prop) ? item[prop] : item\n if (languageMap) {\n if (languageMap[language]) {\n return languageMap[language]\n }\n language = languagePreference.selectLanguage(languageMap)\n if (language) {\n return languageMap[language]\n }\n }\n return null\n}\n\n/**\n * Returns the prefLabel of a JSKOS Item. If there is no label, it will return the URI. If there is no URI, it will return an empty string.\n *\n * @param {*} item\n * @param {object} options options object:\n * - `fallbackToUri`: return URI if no prefLabel can be found (default: true)\n * - `language`: preferred language\n */\nfunction prefLabel(item, options = {}) {\n options = options || {}\n const fallbackToUri = options.fallbackToUri == null ? true : options.fallbackToUri\n return _.get(item, `prefLabel.${options.language}`)\n || languageMapContent(item, \"prefLabel\", options)\n || ((fallbackToUri && item && item.uri) ? item.uri : \"\")\n}\n\n/**\n * Returns the definition of a JSKOS Item as an array. If there is no definition, an empty array will be returned.\n *\n * @param {*} item\n * @param {object} options options object:\n * - `language`: preferred language\n */\nfunction definition(item, options = {}) {\n options = options || {}\n let content = _.get(item, `definition.${options.language}`)\n || languageMapContent(item, \"definition\", options)\n || []\n // Make sure an array is returned\n if (_.isString(content)) {\n content = [content]\n }\n return content\n}\n\n/**\n * Returns whether a mapping registry has stored mappings (`true` = database) or not (`false` = recommendations).\n *\n * @param {object} registry JSKOS registry\n */\nfunction mappingRegistryIsStored(registry) {\n return _.get(registry, \"stored\", _.get(registry, \"constructor.stored\", _.get(registry, \"provider.constructor.stored\", false)))\n}\n\n/**\n * Returns the creator URI for an annotation.\n *\n * @param {object} annotation a JSKOS annotation\n */\nfunction annotationCreatorUri(annotation) {\n if (_.isString(annotation.creator)) {\n return annotation.creator\n }\n return annotation.creator && annotation.creator.id\n}\n\n/**\n * Returns the craetor name for an annotation.\n *\n * @param {object} annotation a JSKOS annotation\n */\nfunction annotationCreatorName(annotation) {\n return _.get(annotation, \"creator.name\") || \"\"\n}\n\n/**\n * Matches an annotation's creator URI against a list of URIs (e.g. from a user).\n *\n * @param {object} annotation a JSKOS annotation\n * @param {array} uris array of user URIs\n */\nfunction annotationCreatorMatches(annotation, uris) {\n return !!(annotation && _.isString(annotation.creator) ? uris && uris.includes(annotation.creator) : uris && annotation.creator && uris.includes(annotation.creator.id))\n}\n\n\nmodule.exports = {\n addContext, clean, cleanJSKOS, copyDeep, deepCopy, getAllUris, compare,compareObjects, compareSchemes, compareConcepts, isConcept, isScheme, isContainedIn, isSchemeInList, sortConcepts, sortSchemes, minifyMapping, mappingTypes, mappingTypeByUri, mappingTypeByType, flattenMapping, mappingCSV, defaultMappingType, conceptsOfMapping, compareMappingsDeep, objectTypes, guessObjectType, matchObjectTypes, mergeUris, merge, normalize, isValidUri, compareFunctions, userOwnsMapping, notation, languageMapContent, prefLabel, definition, mappingRegistryIsStored, annotationCreatorUri, annotationCreatorName, annotationCreatorMatches,\n}\n", "/**\n * JSKOS Tools.\n * @module jskos-tools\n */\n\nconst identifiers = require(\"./lib/identifiers\")\nconst tools = require(\"./lib/tools\")\nconst ConceptScheme = require(\"./lib/concept-scheme\")\nconst languagePreference = require(\"./lib/language-preference\")\n\nmodule.exports = Object.assign({ ConceptScheme, languagePreference }, identifiers, tools)\n", "/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n", "/**\n * @module cocoda-sdk\n */\n\nimport CocodaSDK from \"./lib/CocodaSDK.js\"\nimport * as errors from \"./errors/index.js\"\nexport * from \"./providers/index.js\"\n\n// Create and export a default instance\nconst cdk = new CocodaSDK()\n\nexport {\n /**\n * Default CocodaSDK instance\n *\n * @type {CocodaSDK}\n */\n cdk,\n /**\n * CocodaSDK class (to create new instances or checks with `instanceof`)\n */\n CocodaSDK,\n /**\n * Object of error classes\n *\n * @type {Object}\n */\n errors,\n}\n\nimport * as providers from \"./providers/index.js\"\n/**\n * Adds all available providers to a CocodaSDK instance.\n *\n * @param {CocodaSDK} [_cdk] CocodaSDK instance to which to add the providers (defaults to default instance)\n */\nexport function addAllProviders(_cdk) {\n Object.values(providers).forEach(provider => (_cdk || cdk).addProvider(provider))\n}\n", "/**\n * CDKError superexport class.\n *\n * @category Errors\n */\nexport class CDKError extends Error {\n\n /**\n * CDKError constructor.\n *\n * @param {Object} options\n * @param {string} [options.message=\"\"] message for the error\n * @param {Error} [options.relatedError=null] related error\n * @param {number} [options.code] HTTP status code for the error\n */\n constructor({ message = \"\", relatedError = null, code = null } = {}) {\n if (!message && relatedError && relatedError.message) {\n message = relatedError.message\n }\n super(message)\n this.name = this.constructor.name\n this.relatedError = relatedError\n this.code = code\n }\n}\n\n/**\n * MethodNotImplementedError is thrown when the called method is valid, but not implemented for the current provider.\n *\n * @category Errors\n */\nexport class MethodNotImplementedError extends CDKError {\n\n /**\n * MethodNotImplementedError constructor.\n *\n * @param {Object} config\n * @param {string} config.method method that this error refers to\n * @param {string} [config.message=\"\"] message for the error\n */\n constructor({ method, message = \"\", ...options }) {\n options.message = `Method not implemented: ${method} (${message})`\n super(options)\n }\n}\n\n/**\n * InvalidOrMissingParameterError is thrown when a parameter is missing or is not valid for the request.\n *\n * @category Errors\n */\nexport class InvalidOrMissingParameterError extends CDKError {\n\n /**\n * InvalidOrMissingParameterError constructor.\n *\n * @param {Object} config\n * @param {string} config.parameter parameter that this error refers to\n * @param {string} [config.message=\"\"] message for the error\n */\n constructor({ parameter, message = \"\", ...options }) {\n options.message = `Invalid or missing parameter: ${parameter} (${message})`\n super(options)\n }\n}\n\n/**\n * InvalidRequestError is thrown when the server responded with a 4xx error (i.e. it's a problem on the client side).\n *\n * @category Errors\n */\nexport class InvalidRequestError extends CDKError { }\n\n/**\n * BackendError is thrown when the server responded with a 5xx error (i.e. it's a problem on the server side).\n *\n * @category Errors\n */\nexport class BackendError extends CDKError { }\n\n/**\n * BackendUnavailableError is thrown when the server did not respond, but the client's internet connection seems to be working.\n *\n * @category Errors\n */\nexport class BackendUnavailableError extends CDKError { }\n\n/**\n * NetworkError is thrown when the request could not be performend (e.g. the network was not available).\n *\n * @category Errors\n */\nexport class NetworkError extends CDKError { }\n\n/**\n * MissingApiUrlError is thrown when the called method is valid, but the required API URL is not available for the current registry.\n *\n * @category Errors\n */\nexport class MissingApiUrlError extends CDKError { }\n\n/**\n * InvalidProviderError is thrown when a provider is added to the provider list that does not inherit from BaseProvider.\n *\n * @category Errors\n */\nexport class InvalidProviderError extends CDKError { }\n", "import * as errors from \"../errors/index.js\"\nimport axios from \"axios\"\nimport * as _ from \"../utils/lodash.js\"\nimport jskos from \"jskos-tools\"\n\nimport { BaseProvider, ConceptApiProvider, MappingsApiProvider } from \"../providers/index.js\"\n\n// Registered providers\nconst providers = {\n [BaseProvider.providerName]: BaseProvider,\n init(registry) {\n if (this[registry.provider]) {\n return new this[registry.provider](registry)\n }\n throw new errors.InvalidProviderError()\n },\n addProvider(provider) {\n if (provider.prototype instanceof BaseProvider || provider === BaseProvider) {\n this[provider.providerName] = provider\n } else {\n throw new errors.InvalidProviderError()\n }\n },\n}\n// Only ConceptApi and MappingsApi are available by default\nproviders.addProvider(ConceptApiProvider)\nproviders.addProvider(MappingsApiProvider)\n\n// For the browser build, add all providers by default\nimport * as allProviders from \"../providers/index.js\"\nObject.values(allProviders).forEach(provider => {\n providers.addProvider(provider)\n})\n\n/**\n * CocodaSDK class\n */\nexport default class CocodaSDK {\n\n /**\n * CDK constructor.\n *\n * @param {Object} [config={}] Cocoda-stye config object\n */\n constructor(config) {\n this.config = config\n this.axios = axios.create()\n }\n\n /**\n * Method to set the configuration.\n *\n * @param {Object} config Cocoda-stye config object\n */\n setConfig(config) {\n this.config = config\n }\n\n /**\n * Current configuration.\n *\n * @returns {Object} current configuration\n */\n get config() {\n return this._config\n }\n\n /**\n * Prepares config when set.\n *\n * @param {Object} config Cocoda config object\n * @private\n */\n set config(config) {\n config = config || {}\n // Preparations for config\n // 1. Make sure config.registries exists\n config.registries = config.registries || []\n // 2. Initialize registries\n config.registries = config.registries.map(registry => providers.init(registry)).filter(r => r)\n // 3. Set cdk property for all registries\n config.registries.forEach(registry => {\n registry.cdk = this\n })\n this._config = config\n }\n\n /**\n * Map of registered providers.\n *\n * @returns {Object} map of registered providers (name -> provider)\n */\n get providers() {\n return providers\n }\n\n /**\n * Creates a new CDK instance (same as `new CocodaSDK(config)`).\n *\n * @param {Object} config Cocoda config object\n * @returns {CocodaSDK} new CDK instance\n */\n createInstance(config) {\n return new CocodaSDK(config)\n }\n\n /**\n * Offer method to load a config file from URL.\n *\n * @param {string} url URL of config as JSON\n */\n async loadConfig(url) {\n const response = await this.axios.get(url)\n this.config = response.data\n }\n\n /**\n * Method to load buildInfo.\n *\n * Callback will only be called if buildInfo changes; it will not be called when there is no previous value.\n *\n * @param {Object} config\n * @param {string} [config.url] full URL for build-info.json (default is taken from config.cocodaBaseUrl)\n * @param {Object} [config.buildInfo] current buildInfo\n * @param {number} [config.interval=60000] interval to load buildInfo in ms\n * @param {Function} config.callback callback function called with two parameters (error, buildInfo, previousBuildInfo)\n * @returns {Object} object with two function properties, `stop` to cancel the repeating request, `start` to restart the repeating request, as well as three convenience properties, `isPaused` (whether it is currently paused), `lastResult`, `hasErrored` (whether the last call of the function has errored)\n */\n loadBuildInfo({ url, buildInfo = null, interval = 60000, callback, ...config }) {\n if (!url && !this.config.cocodaBaseUrl) {\n throw new errors.CDKError({ message: \"Could not determine URL to load build config.\" })\n }\n if (!url) {\n url = `${this.config.cocodaBaseUrl}build-info.json`\n }\n return this.repeat({\n ...config,\n function: async () => {\n return (await this.axios.get(url, {\n headers: {\n \"Cache-Control\": \"no-cache\",\n },\n })).data\n },\n interval,\n callback: (error, result, previousResult) => {\n if (error) {\n callback(error)\n } else if (previousResult || (!previousResult && buildInfo && !_.isEqual(result, buildInfo))) {\n callback(null, result, previousResult || buildInfo)\n }\n },\n })\n }\n\n /**\n * Method to get a registry by URI.\n *\n * @param {string} uri URI of registry in config\n * @returns {?Object} initialized registry from config if found\n */\n getRegistryForUri(uri) {\n return this.config.registries.find(r => r.uri == uri)\n }\n\n /**\n * Method to initialize registry.\n *\n * @param {Object} registry JSKOS registry object\n * @returns {Object} initialized registry\n */\n initializeRegistry(registry) {\n registry = providers.init(registry)\n registry.cdk = this\n return registry\n }\n\n /**\n * Method to add custom provider.\n *\n * @param {Object} provider provider class that extends BaseProvider\n */\n addProvider(provider) {\n providers.addProvider(provider)\n }\n\n /**\n * Static method to add custom provider.\n *\n * @param {Object} provider provider class that extends BaseProvider\n */\n static addProvider(provider) {\n providers.addProvider(provider)\n }\n\n /**\n * Repeatedly call a certain function.\n *\n * Notes:\n * - Callback will only be called if the results were changed.\n * - The function will only be repeated after the previous call is resolved. This means that the total interval duration is (interval + duration of function call).\n *\n * Example:\n * ```js\n * cdk.repeat({\n * function: () => registry.getMappings(),\n * callback: (error, result) => console.log(result),\n * })\n * ```\n *\n * @param {Object} config\n * @param {string} config.function a function to be called (can be async)\n * @param {number} [config.interval=15000] interval in ms\n * @param {Function} config.callback callback function called with two parameters (error, result, previousResult)\n * @param {boolean} [config.callImmediately=true] whether to call the function immediately\n * @returns {Object} object with two function properties, `stop` to cancel the repeating request, `start` to restart the repeating request, as well as three convenience properties, `isPaused` (whether it is currently paused), `lastResult`, `hasErrored` (whether the last call of the function has errored)\n */\n repeat({ function: func, interval = 15000, callback, callImmediately = true } = {}) {\n // Check parameters\n // ? Are these thorough checks really necessary?\n if (!func) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"function\" })\n }\n if (typeof func != \"function\") {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"function\", message: \"function needs to be a function\" })\n }\n // Wrap function so that it will definitely be async\n const asyncFunc = async () => func()\n interval = parseInt(interval)\n if (isNaN(interval)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"interval\" })\n }\n if (!callback) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"callback\" })\n }\n if (typeof callback != \"function\") {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"callback\", message: \"callback needs to be a function\" })\n }\n // Prepare repeat cache\n let repeat = {\n timer: null,\n result: null,\n error: null,\n isPaused: false,\n }\n // Functions to handle results and errors\n const handleResult = (result) => {\n const previousResult = repeat.result\n if (!_.isEqual(previousResult, result)) {\n repeat.result = result\n repeat.error = null\n callback(null, result, previousResult)\n }\n }\n const handleError = (error) => {\n repeat.error = error\n callback(error)\n }\n // Method to call a method after timeout if necessary\n const repeatIfNecessary = toCall => {\n if (repeat.isPaused) {\n return\n }\n repeat.timer = setTimeout(() => {\n toCall()\n }, interval)\n }\n // Method to call the function, handle result/error, and repeat if necessary\n const call = () => asyncFunc().then(handleResult).catch(handleError).then(() => repeatIfNecessary(call))\n // Method to set up the repeating call (skip initial call if necessary)\n const setup = (_callImmediately = callImmediately) => {\n if (_callImmediately) {\n call()\n } else {\n repeatIfNecessary(call)\n }\n }\n // Set up\n setup()\n // Return object with methods to start/stop the interval and an indicator whether it is paused\n return {\n start: (...params) => {\n repeat.isPaused = false\n setup(...params)\n },\n stop: () => {\n repeat.isPaused = true\n // If timer is available, clear immediately, if not, wait for one interval\n if (repeat.timer) {\n clearTimeout(repeat.timer)\n } else {\n setTimeout(() => {\n repeat.timer && clearTimeout(repeat.timer)\n }, interval)\n }\n },\n get isPaused() {\n return repeat.isPaused\n },\n get lastResult() {\n return repeat.result\n },\n get hasErrored() {\n return !!repeat.error\n },\n }\n }\n\n /**\n * Gets schemes from all registries that support schemes and merges the results.\n *\n * @param {Object} [config={}] configuration object that will be used as a parameter for internal `getSchemes` calls\n * @returns {Object[]} array of JSKOS schemes\n */\n async getSchemes(config = {}) {\n let schemes = [], promises = []\n\n for (let registry of this.config.registries) {\n if (registry.has.schemes) {\n let promise = registry.getSchemes(config).then(results => {\n for (let scheme of results) {\n // Add scheme specific custom properties\n scheme.__DETAILSLOADED__ = 1\n scheme.type = scheme.type || [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"]\n // Check if scheme is already loaded\n let otherScheme = schemes.find(s => jskos.compare(s, scheme)), prio, otherPrio, override = false\n if (otherScheme) {\n // Set priorities as index of registry array\n prio = this.config.registries.indexOf(registry)\n if (prio != -1) {\n prio = this.config.registries.length - prio\n }\n otherPrio = this.config.registries.indexOf(_.get(otherScheme, \"_registry\"))\n if (otherPrio != -1) {\n otherPrio = this.config.registries.length - otherPrio\n }\n let currentHasConcepts = !scheme.concepts ? 0 : (scheme.concepts.length == 0 ? -1 : 1)\n let otherHasConcepts = !otherScheme.concepts ? 0 : (otherScheme.concepts.length == 0 ? -1 : 1)\n // Use existence of concepts first, priority second\n if (currentHasConcepts > otherHasConcepts) {\n override = true\n } else if (currentHasConcepts < otherHasConcepts) {\n override = false\n } else {\n override = otherPrio < prio\n }\n }\n if (!otherScheme || override) {\n if (override) {\n // Find and remove scheme from schemes array\n let otherSchemeIndex = schemes.findIndex(s => jskos.compare(s, otherScheme))\n if (otherSchemeIndex != -1) {\n schemes.splice(otherSchemeIndex, 1)\n }\n // Integrate details from existing scheme\n scheme = jskos.merge(scheme, _.omit(otherScheme, [\"concepts\", \"topConcepts\"]), { mergeUris: true, skipPaths: [\"_registry\"] })\n }\n scheme._registry = registry\n // Save scheme in objects and push into schemes array\n schemes.push(scheme)\n } else {\n // Integrate details into existing scheme\n let index = schemes.findIndex(s => jskos.compare(s, scheme))\n if (index != -1) {\n let registry = schemes[index]._registry\n schemes[index] = jskos.merge(schemes[index], _.omit(scheme, [\"concepts\", \"topConcepts\"]), { mergeUris: true, skipPaths: [\"_registry\"] })\n schemes[index]._registry = registry\n }\n }\n }\n }).catch(error => {\n // TODO\n console.warn(\"Couldn't load schemes for registry\", registry.uri, error)\n })\n promises.push(promise)\n }\n }\n\n await Promise.all(promises)\n return jskos.sortSchemes(schemes.filter(Boolean))\n }\n\n registryForScheme(scheme) {\n let registry = scheme._registry\n if (registry) {\n return registry\n }\n\n for (let { type, ...config } of scheme.API || []) {\n const provider = Object.values(providers).find(p => p.providerType === type)\n if (!provider || !provider._registryConfigForBartocApiConfig) {\n continue\n }\n const providerName = provider.providerName\n // Some providers need access to the scheme\n config.scheme = scheme\n config = providers[providerName]._registryConfigForBartocApiConfig(config)\n if (!config) {\n continue\n }\n config.provider = providerName\n\n try {\n registry = this.initializeRegistry(config)\n return registry\n } catch (error) {\n continue\n }\n }\n return null\n }\n\n}\n", "// Exports a subset of lodash methods\nimport get from \"lodash/get.js\"\nimport set from \"lodash/set.js\"\nimport uniq from \"lodash/uniq.js\"\nimport intersection from \"lodash/intersection.js\"\nimport union from \"lodash/union.js\"\nimport forOwn from \"lodash/forOwn.js\"\nimport isArray from \"lodash/isArray.js\"\nimport isObject from \"lodash/isObject.js\"\nimport isString from \"lodash/isString.js\"\nimport isEmpty from \"lodash/isEmpty.js\"\nimport isEqual from \"lodash/isEqual.js\"\nimport merge from \"lodash/merge.js\"\nimport last from \"lodash/last.js\"\nimport omit from \"lodash/omit.js\"\nimport concat from \"lodash/concat.js\"\n\nexport {\n get,\n set,\n uniq,\n intersection,\n union,\n forOwn,\n isArray,\n isObject,\n isString,\n isEmpty,\n isEqual,\n merge,\n last,\n omit,\n concat,\n}\n", "import BaseProvider from \"./base-provider.js\"\nimport LocalMappingsProvider from \"./local-mappings-provider.js\"\nimport MappingsApiProvider from \"./mappings-api-provider.js\"\nimport OccurrencesApiProvider from \"./occurrences-api-provider.js\"\nimport ConceptApiProvider from \"./concept-api-provider.js\"\nimport ReconciliationApiProvider from \"./reconciliation-api-provider.js\"\nimport LabelSearchSuggestionProvider from \"./label-search-suggestion-provider.js\"\nimport SkosmosApiProvider from \"./skosmos-api-provider.js\"\nimport LocApiProvider from \"./loc-api-provider.js\"\n\nexport {\n BaseProvider,\n LocalMappingsProvider,\n MappingsApiProvider,\n OccurrencesApiProvider,\n ConceptApiProvider,\n ReconciliationApiProvider,\n LabelSearchSuggestionProvider,\n SkosmosApiProvider,\n LocApiProvider,\n}\n", "import jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport axios from \"axios\"\nimport * as utils from \"../utils/index.js\"\nimport * as errors from \"../errors/index.js\"\n\n/**\n * BaseProvider to be subclassed to implement specific providers. Do not initialize a registry directly with this!\n *\n * Prefix all internal method and properties with underscore (e.g. `this._cache`)!\n *\n * Methods that can be overridden:\n * - Do not override the constructor! Use _prepare or _setup instead.\n * - _prepare: will be called before the registry is initialized (i.e. it's `/status` endpoint is queries if necessasry)\n * - _setup: will be called after registry is initialized (i.e. it's `/status` endpoint is queries if necessasry), should be used to set properties on this.has and custom preparations\n * - isAuthorizedFor: override if you want to customize\n * - supportsScheme: override if you want to customize\n * - getRegistries\n * - getSchemes\n * - getTypes\n * - suggest\n * - getConcordances\n * - getOccurrences\n * - getTop\n * - getConcepts\n * - getNarrower\n * - getAncestors\n * - search\n * - getMapping\n * - getMappings\n * - postMapping\n * - postMappings\n * - putMapping\n * - patchMapping\n * - deleteMapping\n * - deleteMappings\n * - getAnnotations\n * - postAnnotation\n * - putAnnotation\n * - patchAnnotation\n * - deleteAnnotation\n *\n * Internal (starting with underscore) and external properties that can be used:\n * - `this.cdk`: a reference to the current CDK instance (can be use to request other registries or initialize a new registry)\n * - `this.has`: an object of functionality of the registry (needs to be set by subclasses)\n * - `this.languages`: an array of language tags provided by the user in order of priority\n * - `this._jskos`: the raw JSKOS object used to initialize this registry\n * - `this._path`: if available, the path of the current browser window\n * - `this._defaultLanguages`: an array of default language tags\n * - `this._auth`: authentication key and token\n * - `this._api`: object of API endpoints for the registry\n * - `this._config`: configuration of the registry as provided by the `/status` endpoint if available\n *\n * All of the request methods take ONE parameter which is a config object. Actual parameters should be properties on this object. The config object should be destructured to remove the properties your method needs, and the remaining config object should be given to the axios request.\n * Example:\n * ```js\n * getConcept({ concept, ...config }) {\n * return this.axios({\n * ...config,\n * method: \"get\",\n * params: {\n * uri: concept.uri,\n * },\n * })\n * }\n * ```\n *\n * Always use `this.axios` like in the example for http requests!\n *\n * @category Providers\n */\nexport default class BaseProvider {\n\n /**\n * Provider constructor.\n *\n * @param {Object} registry the registry for this provider\n */\n constructor(registry = {}) {\n this._jskos = registry\n\n this.axios = axios.create({\n // TODO: Decide on timeout value\n timeout: 20000,\n })\n // Path is used for https check and local mappings\n this._path = typeof window !== \"undefined\" && window.location.pathname\n /**\n * A dictionary with functionality of the registry (e.g. `registry.has.schemes`).\n * @type {Object}\n * @readonly\n */\n this.has = {}\n // Set default language priority list\n this._defaultLanguages = \"en,de,fr,es,nl,it,fi,pl,ru,cs,jp\".split(\",\")\n /**\n * A list of RFC 3066 language tags in lowercase in order of priority.\n * @type {string[]}\n */\n this.languages = []\n // Set auth details to null\n this._auth = {\n key: null,\n bearerToken: null,\n }\n // Set repeating requests array\n this._repeating = []\n\n // Set API URLs from registry object\n this._api = {\n status: registry.status,\n schemes: registry.schemes,\n top: registry.top,\n data: registry.data,\n concepts: registry.concepts,\n narrower: registry.narrower,\n ancestors: registry.ancestors,\n types: registry.types,\n suggest: registry.suggest,\n search: registry.search,\n \"voc-suggest\": registry[\"voc-suggest\"],\n \"voc-search\": registry[\"voc-search\"],\n mappings: registry.mappings,\n concordances: registry.concordances,\n annotations: registry.annotations,\n occurrences: registry.occurrences,\n reconcile: registry.reconcile,\n api: registry.api,\n }\n this._config = {}\n\n // Set default retry config\n this.setRetryConfig()\n\n // Add a request interceptor\n this.axios.interceptors.request.use((config) => {\n // Add language parameter to request\n const language = _.uniq([].concat(_.get(config, \"params.language\", \"\").split(\",\"), this.languages, this._defaultLanguages).filter(lang => lang != \"\")).join(\",\")\n _.set(config, \"params.language\", language)\n // Set auth\n if (this.has.auth && this._auth.bearerToken && !_.get(config, \"headers.Authorization\")) {\n _.set(config, \"headers.Authorization\", `Bearer ${this._auth.bearerToken}`)\n }\n\n // Don't perform http requests if site is used via https\n if (config.url.startsWith(\"http:\") && typeof window !== \"undefined\" && window.location.protocol == \"https:\") {\n // TODO: Return proper error object.\n throw new axios.Cancel(\"Can't call http API from https.\")\n }\n\n return config\n })\n\n // Add a response interceptor\n this.axios.interceptors.response.use(({ data, headers = {}, config = {} }) => {\n // Apply unicode normalization\n data = jskos.normalize(data)\n\n // Add URL to array as prop\n let url = config.url\n if (!url.endsWith(\"?\")) {\n url += \"?\"\n }\n _.forOwn(config.params || {}, (value, key) => {\n url += `${key}=${encodeURIComponent(value)}&`\n })\n\n if (_.isArray(data) || _.isObject(data)) {\n // Add total count to array as prop\n let totalCount = parseInt(headers[\"x-total-count\"])\n if (!isNaN(totalCount)) {\n data._totalCount = totalCount\n }\n data._url = url\n }\n\n // TODO: Return data or whole response here?\n return data\n }, error => {\n const count = _.get(error, \"config._retryCount\", 0)\n const method = _.get(error, \"config.method\")\n const statusCode = _.get(error, \"response.status\")\n if (\n this._retryConfig.methods.includes(method)\n && this._retryConfig.statusCodes.includes(statusCode)\n && count < this._retryConfig.count\n ) {\n error.config._retryCount = count + 1\n // from: https://github.com/axios/axios/issues/934#issuecomment-531463172\n if (error.config.data) error.config.data = JSON.parse(error.config.data)\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this.axios(error.config).then(resolve).catch(reject)\n }, (() => {\n const delay = this._retryConfig.delay\n if (typeof delay === \"function\") {\n return delay(count)\n }\n return delay\n })())\n })\n } else {\n return Promise.reject(error)\n }\n })\n\n const currentRequests = []\n for (let { method, type } of utils.requestMethods) {\n // Make sure all methods exist, but thrown an error if they are not implemented\n const existingMethod = this[method] && this[method].bind(this)\n if (!existingMethod) {\n this[method] = () => { throw new errors.MethodNotImplementedError({ method }) }\n continue\n }\n this[method] = (options = {}) => {\n // Allow calling the \"raw\" method without adjustments\n if (options._raw) {\n delete options._raw\n return existingMethod(options)\n }\n // Return from existing requests if one exists\n const existingRequest = currentRequests.find(r => r.method == method && _.isEqual(r.options, options))\n if (existingRequest) {\n return existingRequest.promise\n }\n // Add an axios cancel token to each request\n let source\n if (!options.cancelToken) {\n source = this.getCancelTokenSource()\n options.cancelToken = source.token\n }\n // Make sure a registry is initialized (see `init` method) before any request\n // TODO: Is this a good solution?\n const promise = this.init()\n .then(() => existingMethod(options))\n // Add totalCount to arrays\n .then(result => {\n if (_.isArray(result) && result._totalCount === undefined) {\n result._totalCount = result.length\n } else if (_.isObject(result) && result._totalCount === undefined) {\n result._totalCount = 1\n }\n if (result && type && this[`adjust${type}`]) {\n result = this[`adjust${type}`](result)\n }\n return result\n }).catch(error => {\n if (error instanceof errors.CDKError) {\n throw error\n } else {\n if (error.response) {\n // 4xx = invalid request\n if (error.response.status.toString().startsWith(4)) {\n throw new errors.InvalidRequestError({ relatedError: error, code: error.response.status })\n } else {\n throw new errors.BackendError({ relatedError: error, code: error.response.status })\n }\n } else if (error.request) {\n if (typeof navigator !== \"undefined\") {\n // If connected, it should be a backend problem\n if (navigator.connection || navigator.mozConnection || navigator.webkitConnection) {\n throw new errors.BackendUnavailableError({ relatedError: error })\n }\n }\n // Otherwise, assume a network error\n throw new errors.NetworkError({ relatedError: error })\n } else {\n // Otherwise, throw generic CDKError\n throw new errors.CDKError({ relatedError: error })\n }\n }\n })\n // Attach cancel method to Promise\n if (source) {\n promise.cancel = (...args) => {\n return source.cancel(...args)\n }\n }\n // Save to list of existing requests\n const request = {\n method,\n options: _.omit(options, [\"cancelToken\"]),\n promise,\n }\n currentRequests.push(request)\n // Remove from list of current requests after promise is done\n promise.catch(() => { }).then(() => currentRequests.splice(currentRequests.indexOf(request), 1))\n // Add adjustment methods\n return promise\n }\n }\n }\n\n // Expose some properties from original registry object as getters\n get uri() { return this._jskos.uri }\n get notation() { return this._jskos.notation }\n get prefLabel() { return this._jskos.prefLabel }\n get definition() { return this._jskos.definition }\n get schemes() { return this._jskos.schemes }\n get excludedSchemes() { return this._jskos.excludedSchemes }\n get stored() { return this._jskos.stored !== undefined ? this._jskos.stored : this.constructor.stored }\n\n /**\n * Load data about registry via the status endpoint.\n *\n * @returns {Promise} Promise that resolves when initialization is complete.\n */\n async init() {\n // Save the actual Promise in _init and return it immediately on a second call\n if (this._init) {\n return this._init\n }\n this._init = (async () => {\n // Call preparation method\n this._prepare()\n let status\n if (_.isString(this._api.status)) {\n // Request status endpoint\n try {\n status = await this.axios({\n method: \"get\",\n url: this._api.status,\n })\n } catch (error) {\n if (_.get(error, \"response.status\") === 404) {\n // If /status is not available, remove from _api\n this._api.status = null\n }\n }\n } else {\n // Assume object\n status = this._api.status\n }\n if (_.isObject(status) && !_.isEmpty(status)) {\n // Set config\n this._config = status.config || {}\n // Merge status result and existing API URLs\n for (let key of Object.keys(this._api)) {\n // Only override if undefined\n if (this._api[key] === undefined) {\n // Fall back to null, i.e. if /status was successful, no endpoints are implied by the provider\n // See also: https://github.com/gbv/cocoda-sdk/issues/21\n this._api[key] = status[key] || null\n }\n }\n }\n this._setup()\n })()\n return this._init\n }\n\n /**\n * Preparation to be executed before init. Should be overwritten by subclasses.\n *\n * @private\n */\n _prepare() { }\n\n /**\n * Setup to be executed after init. Should be overwritten by subclasses.\n *\n * @private\n */\n _setup() { }\n\n /**\n * Returns a source for a axios cancel token.\n *\n * @returns {Object} axios cancel token source\n */\n getCancelTokenSource() {\n return axios.CancelToken.source()\n }\n\n /**\n * Sets authentication credentials.\n *\n * @param {Object} options\n * @param {string} options.key public key of login-server instance the user is authorized for\n * @param {string} options.bearerToken token that is sent with each request\n */\n setAuth({ key = this._auth.key, bearerToken = this._auth.bearerToken }) {\n this._auth.key = key\n this._auth.bearerToken = bearerToken\n }\n\n /**\n * Sets retry configuration.\n *\n * @param {Object} config\n * @param {string[]} [config.methods=[\"get\", \"head\", \"options\"]] HTTP methods to retry (lowercase)\n * @param {number[]} [config.statusCodes=[401, 403]] status codes to retry\n * @param {number} [config.count=3] maximum number of retries\n * @param {number|Function} [config.delay=300*count] a delay in ms or a function that takes the number of current retries and returns a delay in ms\n */\n setRetryConfig(config = {}) {\n this._retryConfig = Object.assign({\n methods: [\"get\", \"head\", \"options\"],\n statusCodes: [401, 403],\n count: 3,\n delay: (count) => {\n return 300 * count\n },\n }, config)\n }\n\n /**\n * Returns whether a user is authorized for a certain request.\n *\n * @param {Object} options\n * @param {string} options.type type of item (e.g. mappings)\n * @param {string} options.action action to be performed (read/create/update/delete)\n * @param {Object} options.user user object\n * @param {boolean} [options.crossUser] whether the request is a crossUser request (i.e. updading/deleting another user's item)\n * @returns {boolean}\n */\n isAuthorizedFor({ type, action, user, crossUser }) {\n if (action == \"read\" && this.has[type] === true) {\n return true\n }\n if (!this.has[type]) {\n return false\n }\n const options = _.get(this._config, `${type}.${action}`)\n if (!options) {\n return !!this.has[type][action]\n }\n if (options.auth && (!user || !this._auth.key)) {\n return false\n }\n // Public key mismatch\n if (options.auth && this._auth.key != _.get(this._config, \"auth.key\")) {\n return false\n }\n if (options.auth && options.identities) {\n // Check if one of the user's identities matches\n const uris = [user.uri].concat(Object.values(user.identities || {}).map(id => id.uri)).filter(uri => uri != null)\n if (_.intersection(uris, options.identities).length == 0) {\n return false\n }\n }\n if (options.auth && options.identityProviders) {\n // Check if user has the required provider\n const providers = Object.keys((user && user.identities) || {})\n if (_.intersection(providers, options.identityProviders).length == 0) {\n return false\n }\n }\n if (crossUser) {\n return !!options.crossUser\n }\n return !!this.has[type][action]\n }\n\n /**\n * Returns a boolean whether a certain target scheme is supported or not.\n *\n * @param {Object} scheme\n * @returns {boolean}\n */\n supportsScheme(scheme) {\n if (!scheme) {\n return false\n }\n let schemes = _.isArray(this.schemes) ? this.schemes : null\n if (schemes == null && !jskos.isContainedIn(scheme, this.excludedSchemes || [])) {\n return true\n }\n return jskos.isContainedIn(scheme, schemes)\n }\n\n adjustConcept(concept) {\n // Add _getNarrower function to concepts\n concept._getNarrower = (config) => {\n return this.getNarrower({ ...config, concept })\n }\n // Add _getAncestors function to concepts\n concept._getAncestors = (config) => {\n return this.getAncestors({ ...config, concept })\n }\n // Add _getDetails function to concepts\n concept._getDetails = async (config) => {\n return (await this.getConcepts({ ...config, concepts: [concept] }))[0]\n }\n // Adjust broader/narrower/ancestors if necessary\n for (let type of [\"broader\", \"narrower\", \"ancestors\"]) {\n if (Array.isArray(concept[type]) && !concept[type].includes(null)) {\n concept[type] = this.adjustConcepts(concept[type])\n }\n }\n // Add _registry to concepts\n concept._registry = this\n return concept\n }\n adjustConcepts(concepts) {\n return utils.withCustomProps(concepts.map(concept => this.adjustConcept(concept)), concepts)\n }\n adjustRegistries(registries) {\n return registries\n }\n adjustScheme(scheme) {\n // Add _registry to schemes\n scheme._registry = (this.cdk && this.cdk.registryForScheme(scheme)) || this\n if (scheme._registry) {\n // Add _getTop function to schemes\n scheme._getTop = (config) => {\n return scheme._registry.getTop({ ...config, scheme })\n }\n // Add _getTypes function to schemes\n scheme._getTypes = (config) => {\n return scheme._registry.getTypes({ ...config, scheme })\n }\n // Add _suggest function to schemes\n scheme._suggest = ({ search, ...config }) => {\n return scheme._registry.suggest({ ...config, search, scheme })\n }\n }\n return scheme\n }\n adjustSchemes(schemes) {\n return utils.withCustomProps(schemes.map(scheme => this.adjustScheme(scheme)), schemes)\n }\n adjustConcordances(concordances) {\n for (let concordance of concordances) {\n // Add _registry to concordance\n concordance._registry = this\n }\n return concordances\n }\n adjustMapping(mapping) {\n // TODO: Add default type\n // Add fromScheme and toScheme if missing\n for (let side of [\"from\", \"to\"]) {\n let sideScheme = `${side}Scheme`\n if (!mapping[sideScheme]) {\n mapping[sideScheme] = _.get(jskos.conceptsOfMapping(mapping, side), \"[0].inScheme[0]\", null)\n }\n }\n mapping._registry = this\n if (!mapping.identifier) {\n // Add mapping identifiers for this mapping\n let identifier = _.get(jskos.addMappingIdentifiers(mapping), \"identifier\")\n if (identifier) {\n mapping.identifier = identifier\n }\n }\n return mapping\n }\n adjustMappings(mappings) {\n return utils.withCustomProps(mappings.map(mapping => this.adjustMapping(mapping)), mappings)\n }\n\n /**\n * POSTs multiple mappings. Do not override in subclass!\n *\n * @param {Object} config\n * @param {Array} config.mappings array of mapping objects\n * @returns {Object[]} array of created mapping objects; in case of failure, consult the `_errors` property on the array at the index of the failed request\n */\n async postMappings({ mappings, ...config } = {}) {\n if (!mappings || !mappings.length) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mappings\" })\n }\n return this._callHelperForArrayWrappers({\n method: \"postMapping\",\n items: mappings,\n itemProperty: \"mapping\",\n config,\n })\n }\n\n /**\n * DELETEs multiple mappings. Do not override in subclass!\n *\n * @param {Object} config\n * @param {Array} config.mappings array of mapping objects\n * @returns {Object[]} array of results (`true` if successful); in case of failure, consult the `_errors` property on the array at the index of the failed request\n */\n async deleteMappings({ mappings, ...config } = {}) {\n if (!mappings || !mappings.length) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mappings\" })\n }\n return this._callHelperForArrayWrappers({\n method: \"deleteMapping\",\n items: mappings,\n itemProperty: \"mapping\",\n config,\n })\n }\n\n /**\n * Calls a method that is for only one item for an array of items. Returns an array of results.\n *\n * If there is an error, that index in the result array will be `null`. There is a property `_errors` on the result array that will contain the respective error at the correct index.\n *\n * @param {Object} options\n * @param {string} options.method instance method to call (e.g. `postMapping`)\n * @param {Object[]} options.items items to call the method for\n * @param {string} options.itemProperty the property name for the item when calling the method (e.g. `mapping`)\n * @param {Object} options.config other properties to pass to the method call\n * @returns {any[]} result array with values returned from individual method calls\n *\n * @private\n */\n async _callHelperForArrayWrappers({ method, items, itemProperty, config }) {\n const errors = []\n const resultItems = await Promise.all(items.map(async item => {\n try {\n const resultItem = await this[method]({ [itemProperty]: item, ...config, _raw: true })\n return resultItem\n } catch (error) {\n errors[items.indexOf(item)] = error\n return null\n }\n }))\n resultItems._errors = errors\n return resultItems\n }\n\n}\n\nBaseProvider.providerName = \"Base\"\n", "export const requestMethods = [\n // General\n {\n method: \"getRegistries\",\n fallback: [],\n type: \"Registries\",\n },\n {\n method: \"getSchemes\",\n fallback: [],\n type: \"Schemes\",\n },\n {\n method: \"vocSearch\",\n fallback: [],\n type: \"Schemes\",\n },\n {\n method: \"getTypes\",\n fallback: [],\n type: \"Types\",\n },\n {\n method: \"suggest\",\n fallback: [\"\", [], [], []],\n },\n {\n method: \"vocSuggest\",\n fallback: [\"\", [], [], []],\n },\n {\n method: \"getConcordances\",\n fallback: [],\n type: \"Concordances\",\n },\n {\n method: \"getOccurrences\",\n fallback: [],\n type: \"Occurrences\",\n },\n // Concepts\n {\n method: \"getTop\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getConcepts\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getNarrower\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getAncestors\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"search\",\n fallback: [],\n type: \"Concepts\",\n },\n // Mappings\n {\n method: \"getMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"getMappings\",\n fallback: [],\n type: \"Mappings\",\n },\n {\n method: \"postMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"postMappings\",\n fallback: [],\n type: \"Mapping\",\n },\n {\n method: \"putMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"patchMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"deleteMapping\",\n fallback: false,\n },\n {\n method: \"deleteMappings\",\n fallback: [],\n },\n // Annotations\n // {\n // method: \"getAnnotation\",\n // fallback: \"\",\n // },\n {\n method: \"getAnnotations\",\n fallback: [],\n type: \"Annotations\",\n },\n {\n method: \"postAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"putAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"patchAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"deleteAnnotation\",\n fallback: false,\n },\n]\n\nexport function concatUrl(...parts) {\n let [url, ...otherParts] = parts\n for (let part of otherParts) {\n if (!url.endsWith(\"/\")) {\n url += \"/\"\n }\n if (part.startsWith(\"/\")) {\n part = part.slice(1)\n }\n url += part\n }\n return url\n}\n\n\n// Retain custom array properties\nexport function withCustomProps(arr, from) {\n arr._totalCount = from._totalCount\n arr._url = from._url\n return arr\n}\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport localforage from \"localforage\"\nimport { v4 as uuid } from \"uuid\"\nimport * as errors from \"../errors/index.js\"\nconst uriPrefix = \"urn:uuid:\"\n\n/**\n * Local Mappings.\n *\n * This class provides read-write access to mappings in the browser's local storage.\n *\n * To use it in a registry, specify `provider` as \"LocalMappings\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/local-mappings\",\n * \"provider\": \"LocalMappings\"\n * }\n * ```\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LocalMappingsProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this.has.mappings = {\n read: true,\n create: true,\n update: true,\n delete: true,\n }\n this.queue = []\n this.localStorageKey = \"cocoda-mappings--\" + this._path\n let oldLocalStorageKey = \"mappings\"\n // Function that adds URIs to all existing local mappings that don't yet have one\n let addUris = () => {\n return localforage.getItem(this.localStorageKey).then(mappings => {\n mappings = mappings || []\n let adjusted = 0\n for (let mapping of mappings.filter(m => !m.uri || !m.uri.startsWith(uriPrefix))) {\n if (mapping.uri) {\n // Keep previous URI in identifier\n if (!mapping.identifier) {\n mapping.identifier = []\n }\n mapping.identifier.push(mapping.uri)\n }\n mapping.uri = `${uriPrefix}${uuid()}`\n adjusted += 1\n }\n if (adjusted) {\n console.warn(`URIs added to ${adjusted} local mappings.`)\n }\n return localforage.setItem(this.localStorageKey, mappings)\n })\n }\n // Show warning if there are mappings in local storage that use the old local storage key.\n localforage.getItem(oldLocalStorageKey).then(results => {\n if (results) {\n console.warn(`Warning: There is old data in local storage (or IndexedDB, depending on the ) with the key \"${oldLocalStorageKey}\". This data will not be used anymore. A manual export is necessary to get this data back.`)\n }\n })\n // Put promise into queue so that getMappings requests are waiting for adjustments to finish\n this.queue.push(\n addUris().catch(error => {\n console.warn(\"Error when adding URIs to local mappings:\", error)\n }),\n )\n }\n\n isAuthorizedFor({ type, action }) {\n // Allow all for mappings\n if (type == \"mappings\" && action != \"anonymous\") {\n return true\n }\n return false\n }\n\n /**\n * Returns a Promise that returns an object { mappings, done } with the local mappings and a done function that is supposed to be called when the transaction is finished.\n * This prevents conflicts when saveMapping is called multiple times simultaneously.\n *\n * TODO: There might be a better solution for this...\n *\n * @private\n */\n _getMappingsQueue() {\n let last = _.last(this.queue) || Promise.resolve()\n return new Promise((resolve) => {\n function defer() {\n var res, rej\n\n var promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n promise.resolve = res\n promise.reject = rej\n\n return promise\n }\n let promise = defer()\n let done = () => {\n promise.resolve()\n }\n this.queue.push(promise)\n\n last.then(() => {\n return localforage.getItem(this.localStorageKey)\n }).then(mappings => {\n resolve({ mappings, done })\n })\n })\n }\n\n /**\n * Returns a single mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async getMapping({ mapping, ...config }) {\n config._raw = true\n if (!mapping || !mapping.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n return (await this.getMappings({ ...config, uri: mapping.uri }))[0]\n }\n\n /**\n * Returns a list of local mappings.\n *\n * TODO: Add support for sort (`created` or `modified`) and order (`asc` or `desc`).\n * TODO: Clean up and use async/await\n *\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, fromScheme, to, toScheme, creator, type, partOf, offset, limit, direction, mode, identifier, uri } = {}) {\n let params = {}\n if (from) {\n params.from = _.isString(from) ? from : from.uri\n }\n if (fromScheme) {\n params.fromScheme = _.isString(fromScheme) ? { uri: fromScheme } : fromScheme\n }\n if (to) {\n params.to = _.isString(to) ? to : to.uri\n }\n if (toScheme) {\n params.toScheme = _.isString(toScheme) ? { uri: toScheme } : toScheme\n }\n if (creator) {\n params.creator = _.isString(creator) ? creator : jskos.prefLabel(creator)\n }\n if (type) {\n params.type = _.isString(type) ? type : type.uri\n }\n if (partOf) {\n params.partOf = _.isString(partOf) ? partOf : partOf.uri\n }\n if (offset) {\n params.offset = offset\n }\n if (limit) {\n params.limit = limit\n }\n if (direction) {\n params.direction = direction\n }\n if (mode) {\n params.mode = mode\n }\n if (identifier) {\n params.identifier = identifier\n }\n if (uri) {\n params.uri = uri\n }\n return this._getMappingsQueue().catch(relatedError => {\n throw new errors.CDKError({ message: \"Could not get mappings from local storage\", relatedError })\n }).then(({ mappings, done }) => {\n done()\n // Check concept with param\n let checkConcept = (concept, param) => concept.uri == param || (param && concept.notation && concept.notation[0].toLowerCase() == param.toLowerCase())\n // Filter mappings according to params (support for from + to)\n // TODO: - Support more parameters.\n // TODO: - Move to its own things.\n // TODO: - Clean all this up.\n if (params.from || params.to) {\n mappings = mappings.filter(mapping => {\n let fromInFrom = null != jskos.conceptsOfMapping(mapping, \"from\").find(concept => checkConcept(concept, params.from))\n let fromInTo = null != jskos.conceptsOfMapping(mapping, \"to\").find(concept => checkConcept(concept, params.from))\n let toInFrom = null != jskos.conceptsOfMapping(mapping, \"from\").find(concept => checkConcept(concept, params.to))\n let toInTo = null != jskos.conceptsOfMapping(mapping, \"to\").find(concept => checkConcept(concept, params.to))\n if (params.direction == \"backward\") {\n if (params.mode == \"or\") {\n return (params.from && fromInTo) || (params.to && toInFrom)\n } else {\n return (!params.from || fromInTo) && (!params.to || toInFrom)\n }\n } else if (params.direction == \"both\") {\n if (params.mode == \"or\") {\n return (params.from && (fromInFrom || fromInTo)) || (params.to && (toInFrom || toInTo))\n } else {\n return ((!params.from || fromInFrom) && (!params.to || toInTo)) || ((!params.from || fromInTo) && (!params.to || toInFrom))\n }\n } else {\n if (params.mode == \"or\") {\n return (params.from && fromInFrom) || (params.to && toInTo)\n } else {\n return (!params.from || fromInFrom) && (!params.to || toInTo)\n }\n }\n })\n }\n if (params.fromScheme || params.toScheme) {\n mappings = mappings.filter(mapping => {\n let fromInFrom = jskos.compare(mapping.fromScheme, params.fromScheme)\n let fromInTo = jskos.compare(mapping.toScheme, params.fromScheme)\n let toInFrom = jskos.compare(mapping.fromScheme, params.toScheme)\n let toInTo = jskos.compare(mapping.toScheme, params.toScheme)\n if (params.direction == \"backward\") {\n if (params.mode == \"or\") {\n return (params.fromScheme && fromInTo) || (params.toScheme && toInFrom)\n } else {\n return (!params.fromScheme || fromInTo) && (!params.toScheme || toInFrom)\n }\n } else if (params.direction == \"both\") {\n if (params.mode == \"or\") {\n return (params.fromScheme && (fromInFrom || fromInTo)) || (params.toScheme && (toInFrom || toInTo))\n } else {\n return ((!params.fromScheme || fromInFrom) && (!params.toScheme || toInTo)) || ((!params.fromScheme || fromInTo) && (!params.toScheme || toInFrom))\n }\n } else {\n if (params.mode == \"or\") {\n return (params.fromScheme && fromInFrom) || (params.toScheme && toInTo)\n } else {\n return (!params.fromScheme || fromInFrom) && (!params.toScheme || toInTo)\n }\n }\n })\n }\n // creator\n if (params.creator) {\n let creators = params.creator.split(\"|\")\n mappings = mappings.filter(mapping => {\n return (mapping.creator && mapping.creator.find(creator => creators.includes(jskos.prefLabel(creator)) || creators.includes(creator.uri))) != null\n })\n }\n // type\n if (params.type) {\n mappings = mappings.filter(mapping => (mapping.type || [jskos.defaultMappingType.uri]).includes(params.type))\n }\n // concordance\n if (params.partOf) {\n mappings = mappings.filter(mapping => {\n return mapping.partOf != null && mapping.partOf.find(partOf => jskos.compare(partOf, { uri: params.partOf })) != null\n })\n }\n // identifier\n if (params.identifier) {\n mappings = mappings.filter(mapping => {\n return params.identifier.split(\"|\").map(identifier => {\n return (mapping.identifier || []).includes(identifier) || mapping.uri == identifier\n }).reduce((current, total) => current || total)\n })\n }\n if (params.uri) {\n mappings = mappings.filter(mapping => mapping.uri == params.uri)\n }\n let totalCount = mappings.length\n // Sort mappings (default: modified/created date descending)\n mappings = mappings.sort((a, b) => {\n let aDate = a.modified || a.created\n let bDate = b.modified || b.created\n if (bDate == null) {\n return -1\n }\n if (aDate == null) {\n return 1\n }\n if (aDate > bDate) {\n return -1\n }\n return 1\n })\n mappings = mappings.slice(params.offset || 0)\n mappings = mappings.slice(0, params.limit)\n mappings._totalCount = totalCount\n return mappings\n })\n }\n\n /**\n * Creates a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async postMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Set URI if necessary\n if (!mapping.uri || !mapping.uri.startsWith(uriPrefix)) {\n if (mapping.uri) {\n // Keep previous URI in identifier\n if (!mapping.identifier) {\n mapping.identifier = []\n }\n mapping.identifier.push(mapping.uri)\n }\n mapping.uri = `${uriPrefix}${uuid()}`\n }\n // Check if mapping already exists => throw error\n if (localMappings.find(m => m.uri == mapping.uri)) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Duplicate URI\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = (new Date()).toISOString()\n }\n if (!mapping.modified) {\n mapping.modified = mapping.created\n }\n // Add to local mappings\n localMappings.push(mapping)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Overwrites a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async putMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Check if mapping already exists => throw error if it doesn't\n const index = localMappings.findIndex(m => m.uri == mapping.uri)\n if (index == -1) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Mapping not found\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = localMappings[index].created\n }\n mapping.modified = (new Date()).toISOString()\n // Add to local mappings\n localMappings[index] = mapping\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Patches a mapping.\n *\n * @param {Object} config\n * @param {Object} mapping JSKOS mapping (or part of mapping)\n * @returns {Object} JSKOS mapping object\n */\n async patchMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Check if mapping already exists => throw error if it doesn't\n const index = localMappings.findIndex(m => m.uri == mapping.uri)\n if (index == -1) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Mapping not found\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = localMappings[index].created\n }\n mapping.modified = (new Date()).toISOString()\n // Add to local mappings\n localMappings[index] = Object.assign(localMappings[index], mapping)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Removes a mapping from local storage.\n *\n * @param {Object} config\n * @param {Object} mapping JSKOS mapping\n * @returns {boolean} boolean whether deleting the mapping was successful\n */\n async deleteMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n try {\n // Remove by URI\n localMappings = localMappings.filter(m => m.uri != mapping.uri)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return true\n } catch (error) {\n done()\n throw error\n }\n }\n}\n\nLocalMappingsProvider.providerName = \"LocalMappings\"\nLocalMappingsProvider.stored = true\n", "// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}", "export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;", "import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;", "import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;", "import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\n\n// TODO: Check capabilities (`this.has`) and authorization (`this.isAuthorizedFor`) before actions.\n\n/**\n * JSKOS Mappings API.\n *\n * This class provides access to concept mappings via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n * See [jskos-server](https://github.com/gbv/jskos-server) for a JSKOS API reference implementation\n *\n * To use it in a registry, specify `provider` as \"MappingsApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-mappings\",\n * \"provider\": \"MappingsApi\",\n * \"api\": \"https://coli-conc.gbv.de/api/\"\n * }\n * ```\n *\n * If the `/status` endpoint can be queried, the remaining API methods will be taken from that. As a fallback, the default endpoints will be appended to `api`.\n *\n * Alternatively, you can provide the endpoints separately: `status`, `mappings`, `concordances`, `annotations`\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class MappingsApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n // Set status endpoint only\n if (this._api.api && this._api.status === undefined) {\n this._api.status = utils.concatUrl(this._api.api, \"/status\")\n }\n }\n\n /**\n * @private\n */\n _setup() {\n // Fill `this._api` if necessary\n if (this._api.api) {\n const endpoints = {\n mappings: \"/mappings\",\n concordances: \"/concordances\",\n annotations: \"/annotations\",\n }\n for (let key of Object.keys(endpoints)) {\n if (this._api[key] === undefined) {\n this._api[key] = utils.concatUrl(this._api.api, endpoints[key])\n }\n }\n }\n this.has.mappings = this._api.mappings ? {} : false\n if (this.has.mappings) {\n this.has.mappings.read = !!_.get(this._config, \"mappings.read\", true)\n this.has.mappings.create = !!_.get(this._config, \"mappings.create\")\n this.has.mappings.update = !!_.get(this._config, \"mappings.update\")\n this.has.mappings.delete = !!_.get(this._config, \"mappings.delete\")\n this.has.mappings.anonymous = !!_.get(this._config, \"mappings.anonymous\")\n }\n this.has.concordances = !!this._api.concordances\n this.has.annotations = this._api.annotations ? {} : false\n if (this.has.annotations) {\n this.has.annotations.read = !!_.get(this._config, \"annotations.read\")\n this.has.annotations.create = !!_.get(this._config, \"annotations.create\")\n this.has.annotations.update = !!_.get(this._config, \"annotations.update\")\n this.has.annotations.delete = !!_.get(this._config, \"annotations.delete\")\n }\n this.has.auth = _.get(this._config, \"auth.key\") != null\n this._defaultParams = {\n properties: \"annotations\",\n }\n }\n\n /**\n * Returns a single mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async getMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n if (!mapping.uri || !mapping.uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n try {\n return await this.axios({\n ...config,\n url: mapping.uri,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n } catch (error) {\n if (_.get(error, \"response.status\") == 404) {\n return null\n }\n throw error\n }\n }\n\n /**\n * Returns a list of mappings.\n *\n * @param {Object} config request config with parameters\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, fromScheme, to, toScheme, creator, type, partOf, offset, limit, direction, mode, identifier, sort, order, ...config }) {\n let params = {}, url = this._api.mappings\n if (from) {\n params.from = _.isString(from) ? from : from.uri\n }\n if (fromScheme) {\n params.fromScheme = _.isString(fromScheme) ? fromScheme : fromScheme.uri\n }\n if (to) {\n params.to = _.isString(to) ? to : to.uri\n }\n if (toScheme) {\n params.toScheme = _.isString(toScheme) ? toScheme : toScheme.uri\n }\n if (creator) {\n params.creator = _.isString(creator) ? creator : jskos.prefLabel(creator)\n }\n if (type) {\n params.type = _.isString(type) ? type : type.uri\n }\n if (partOf) {\n params.partOf = _.isString(partOf) ? partOf : partOf.uri\n }\n if (offset) {\n params.offset = offset\n }\n if (limit) {\n params.limit = limit\n }\n if (direction) {\n params.direction = direction\n }\n if (mode) {\n params.mode = mode\n }\n if (identifier) {\n params.identifier = identifier\n }\n if (sort) {\n params.sort = sort\n }\n if (order) {\n params.order = order\n }\n return this.axios({\n ...config,\n method: \"get\",\n url,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n ...params,\n },\n })\n }\n\n /**\n * Creates a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async postMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n return this.axios({\n ...config,\n method: \"post\",\n url: this._api.mappings,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Overwrites a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async putMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"put\",\n url: uri,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Patches a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping (or part of mapping)\n * @returns {Object} JSKOS mapping object\n */\n async patchMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"patch\",\n url: uri,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Deletes a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {boolean} `true` if deletion was successful\n */\n async deleteMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n await this.axios({\n ...config,\n method: \"delete\",\n url: uri,\n })\n return true\n }\n\n /**\n * Returns a list of annotations.\n *\n * @param {Object} config\n * @param {string} [config.target] target URI\n * @returns {Object[]} array of JSKOS annotation objects\n */\n async getAnnotations({ target, ...config }) {\n if (target) {\n _.set(config, \"params.target\", target)\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.annotations,\n })\n }\n\n /**\n * Creates an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async postAnnotation({ annotation, ...config }) {\n return this.axios({\n ...config,\n method: \"post\",\n url: this._api.annotations,\n data: annotation,\n })\n }\n\n /**\n * Overwrites an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async putAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"put\",\n url: uri,\n data: annotation,\n })\n }\n\n /**\n * Patches an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async patchAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"patch\",\n url: uri,\n data: annotation,\n })\n }\n\n /**\n * Deletes an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {boolean} `true` if deletion was successful\n */\n async deleteAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n await this.axios({\n ...config,\n method: \"delete\",\n url: uri,\n })\n return true\n }\n\n /**\n * Returns a list of concordances.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concordance objects\n */\n async getConcordances(config) {\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.concordances,\n })\n }\n\n}\n\nMappingsApiProvider.providerName = \"MappingsApi\"\nMappingsApiProvider.stored = true\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\n\n// TODO: Modernize.\n\n/**\n * JSKOS Occurrences API.\n *\n * This class provides access to concept occurrences via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n *\n * To use it in a registry, specify `provider` as \"OccurrencesApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/occurrences\",\n * \"provider\": \"OccurrencesApi\",\n * \"api\": \"https://coli-conc.gbv.de/occurrences/api/\"\n * }\n * ```\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class OccurrencesApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this._cache = []\n this._occurrencesSupportedSchemes = []\n this.has.occurrences = true\n this.has.mappings = true\n }\n\n /**\n * Returns whether a concept scheme is supported for occurrences.\n *\n * @private\n *\n * @param {Object} scheme JSKOS scheme to query\n */\n async _occurrencesIsSupported(scheme) {\n if (this._occurrencesSupportedSchemes && this._occurrencesSupportedSchemes.length) {\n // No action needed\n } else {\n // Load supported schemes from API\n try {\n const url = utils.concatUrl(this._api.api, \"voc\")\n const data = await this.axios({\n method: \"get\",\n url,\n })\n this._occurrencesSupportedSchemes = data || []\n } catch (error) {\n // Do nothing so that it is tried again next time\n // TODO: Save number of failures?\n }\n }\n let supported = false\n for (let supportedScheme of this._occurrencesSupportedSchemes) {\n if (jskos.compare(scheme, supportedScheme)) {\n supported = true\n }\n }\n return supported\n }\n\n /**\n * Wrapper around getOccurrences that converts occurrences into mappings.\n *\n * @param {Object} config config object for getOccurrences request\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings(config) {\n const occurrences = await this.getOccurrences(config)\n const fromScheme = _.get(config, \"from.inScheme[0]\") || config.fromScheme\n const toScheme = _.get(config, \"to.inScheme[0]\") || config.toScheme\n const mappings = []\n // Convert occurrences to mappings\n for (let occurrence of occurrences) {\n if (!occurrence) {\n continue\n }\n let mapping = {}\n mapping.from = _.get(occurrence, \"memberSet[0]\")\n if (mapping.from) {\n mapping.from = { memberSet: [mapping.from] }\n } else {\n mapping.from = null\n }\n mapping.fromScheme = _.get(occurrence, \"memberSet[0].inScheme[0]\")\n mapping.to = _.get(occurrence, \"memberSet[1]\")\n if (mapping.to) {\n mapping.to = { memberSet: [mapping.to] }\n } else {\n mapping.to = { memberSet: [] }\n }\n mapping.toScheme = _.get(occurrence, \"memberSet[1].inScheme[0]\")\n // Swap sides if necessary\n if ((fromScheme && mapping.fromScheme && !jskos.compare(mapping.fromScheme, fromScheme)) || (toScheme && mapping.toScheme && !jskos.compare(mapping.toScheme, toScheme))) {\n [mapping.from, mapping.fromScheme, mapping.to, mapping.toScheme] = [mapping.to, mapping.toScheme, mapping.from, mapping.fromScheme]\n }\n // Set fromScheme/toScheme if necessary\n if (!mapping.fromScheme && fromScheme) {\n mapping.fromScheme = fromScheme\n }\n if (!mapping.toScheme && toScheme) {\n mapping.toScheme = toScheme\n }\n mapping.type = [jskos.defaultMappingType.uri]\n mapping._occurrence = occurrence\n mapping = jskos.addMappingIdentifiers(mapping)\n if (occurrence.database) {\n mapping.creator = [occurrence.database]\n }\n mappings.push(mapping)\n }\n return mappings\n }\n\n /**\n * Returns a list of occurrences.\n *\n * @param {Object} config\n * @param {Object} [config.from] JSKOS concept to load occurrences for (from side)\n * @param {Object} [config.to] JSKOS concept to load occurrences for (to side)\n * @param {Object[]} [config.concepts] list of JSKOS concepts to load occurrences for\n * @returns {Object[]} array of JSKOS occurrence objects\n */\n async getOccurrences({ from, to, concepts, ...config }) {\n let promises = []\n concepts = (concepts || []).concat([from, to]).filter(c => !!c)\n for (let concept of concepts) {\n promises.push(this._occurrencesIsSupported(_.get(concept, \"inScheme[0]\")).then(supported => {\n if (supported && concept.uri) {\n return concept.uri\n } else {\n return null\n }\n }))\n }\n let uris = await Promise.all(promises)\n uris = uris.filter(uri => uri != null)\n if (uris.length == 0) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concepts\" })\n }\n promises = []\n for (let uri of uris) {\n promises.push(this._getOccurrences({\n ...config,\n params: {\n member: uri,\n scheme: \"*\",\n threshold: 5,\n },\n }))\n }\n // Another request for co-occurrences between two specific concepts\n if (uris.length > 1) {\n let urisString = uris.join(\" \")\n promises.push(this._getOccurrences({\n ...config,\n params: {\n member: urisString,\n threshold: 5,\n },\n }))\n }\n const results = await Promise.all(promises)\n let occurrences = _.concat([], ...results)\n // Filter duplicates\n let existingUris = []\n let indexesToDelete = []\n for (let i = 0; i < occurrences.length; i += 1) {\n let occurrence = occurrences[i]\n if (!occurrence) {\n continue\n }\n let uris = occurrence.memberSet.reduce((total, current) => total.concat(current.uri), []).sort().join(\" \")\n if (existingUris.includes(uris)) {\n indexesToDelete.push(i)\n } else {\n existingUris.push(uris)\n }\n }\n indexesToDelete.forEach(value => {\n delete occurrences[value]\n })\n // Filter null values\n occurrences = occurrences.filter(o => o != null)\n // Sort occurrences\n return occurrences.sort((a, b) => parseInt(b.count || 0) - parseInt(a.count || 0))\n }\n\n /**\n * Internal function for getOccurrences that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config passthrough of config parameter for axios request\n */\n async _getOccurrences(config) {\n // Use local cache.\n let resultsFromCache = this._cache.find(item => {\n return _.isEqual(item.config.params, config.params)\n })\n if (resultsFromCache) {\n return resultsFromCache.data\n }\n const data = await this.axios({\n ...config,\n method: \"get\",\n url: this._api.api,\n })\n this._cache.push({\n config,\n data,\n })\n if (this._cache.length > 20) {\n this._cache = this._cache.slice(this._cache.length - 20)\n }\n return data\n }\n}\n\nOccurrencesApiProvider.providerName = \"OccurrencesApi\"\nOccurrencesApiProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\nimport jskos from \"jskos-tools\"\n\n/**\n * JSKOS Concept API.\n *\n * This class provides access to concept schemes and their concepts via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n * See [jskos-server](https://github.com/gbv/jskos-server) for a JSKOS API reference implementation and [DANTE](https://api.dante.gbv.de/) for another API endpoint.\n *\n * To use it in a registry, specify `provider` as \"ConceptApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-concepts\",\n * \"provider\": \"ConceptApi\",\n * \"api\": \"https://coli-conc.gbv.de/api/\"\n * }\n * ```\n *\n * If the `/status` endpoint can be queried, the remaining API methods will be taken from that. As a fallback, the default endpoints will be appended to `api`.\n *\n * Alternatively, you can provide the endpoints separately: `status`, `schemes`, `top`, `concepts`, `data`, `narrower`, `ancestors`, `types`, `suggest`, `search`\n * Note that `schemes`, `top`, and `types` can also be provided as arrays.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class ConceptApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n // Set status endpoint only\n if (this._api.api && this._api.status === undefined) {\n this._api.status = utils.concatUrl(this._api.api, \"/status\")\n }\n // Set capabilities to true for now; will be overridden by _setup() later\n this.has.schemes = true\n this.has.top = true\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = true\n this.has.ancestors = true\n this.has.types = true\n this.has.suggest = true\n this.has.search = true\n this.has.auth = true\n }\n\n /**\n * @private\n */\n _setup() {\n // Implicitly fill `this._api` if necessary\n if (this._api.api) {\n const endpoints = {\n schemes: \"/voc\",\n top: \"/voc/top\",\n concepts: \"/voc/concepts\",\n data: \"/data\",\n narrower: \"/narrower\",\n ancestors: \"/ancestors\",\n types: \"/types\",\n suggest: \"/suggest\",\n search: \"/search\",\n }\n for (let key of Object.keys(endpoints)) {\n // Only override if undefined\n if (this._api[key] === undefined) {\n this._api[key] = utils.concatUrl(this._api.api, endpoints[key])\n }\n }\n }\n this.has.schemes = !!this._api.schemes\n this.has.top = !!this._api.top\n this.has.data = !!this._api.data\n this.has.concepts = !!this._api.concepts || this.has.data\n this.has.narrower = !!this._api.narrower\n this.has.ancestors = !!this._api.ancestors\n this.has.types = !!this._api.types\n this.has.suggest = !!this._api.suggest\n this.has.search = !!this._api.search\n this.has.auth = _.get(this._config, \"auth.key\") != null\n this._defaultParams = {\n properties: \"uri,prefLabel,notation,inScheme\",\n }\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.url API URL for server\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ url } = {}) {\n if (!url) {\n return null\n }\n return {\n api: url,\n }\n }\n\n /**\n * Returns the main vocabulary URI by requesting the scheme info and saving it in a cache.\n *\n * @private\n */\n async _getSchemeUri(scheme) {\n this._approvedSchemes = this._approvedSchemes || []\n this._rejectedSchemes = this._rejectedSchemes || []\n let _scheme = this._approvedSchemes.find(s => jskos.compare(scheme, s))\n if (_scheme) {\n return _scheme.uri\n }\n // Return null if it was already rejected\n if (this._rejectedSchemes.find(s => jskos.compare(scheme, s))) {\n return null\n }\n // Otherwise load scheme data and save in approved/rejected schemes\n const schemes = await this.getSchemes({ uri: jskos.getAllUris(scheme) })\n const resultScheme = schemes.find(s => jskos.compare(s, scheme))\n if (resultScheme) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n return resultScheme.uri\n } else {\n this._rejectedSchemes.push({\n uri: scheme.uri,\n identifier: scheme.identifier,\n })\n return null\n }\n }\n\n /**\n * Returns all concept schemes.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes(config) {\n if (!this._api.schemes) {\n throw new errors.MissingApiUrlError()\n }\n if (Array.isArray(this._api.schemes)) {\n return this._api.schemes\n }\n const schemes = await this.axios({\n ...config,\n method: \"get\",\n url: this._api.schemes,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 500,\n ...(config.params || {}),\n },\n })\n // If schemes were given in registry object, only request those schemes from API\n if (Array.isArray(this._jskos.schemes)) {\n return utils.withCustomProps(schemes.filter(s => jskos.isContainedIn(s, this._jskos.schemes)), schemes)\n } else {\n return schemes\n }\n }\n\n /**\n * Returns top concepts for a concept scheme.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getTop({ scheme, ...config }) {\n if (!this._api.top) {\n throw new errors.MissingApiUrlError()\n }\n if (!scheme) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\" })\n }\n const schemeUri = await this._getSchemeUri(scheme)\n if (!schemeUri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Requested vocabulary seems to be unsupported by this API.\" })\n }\n if (Array.isArray(this._api.top)) {\n return this._api.top\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.top,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: schemeUri,\n },\n })\n }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts, ...config }) {\n if (!this.has.data) {\n throw new errors.MissingApiUrlError()\n }\n if (!concepts) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concepts\" })\n }\n if (!Array.isArray(concepts)) {\n concepts = [concepts]\n }\n let uris = concepts.map(concept => concept.uri).filter(uri => uri != null)\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.data,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 500,\n ...(config.params || {}),\n uri: uris.join(\"|\"),\n },\n })\n }\n\n /**\n * Returns narrower concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getNarrower({ concept, ...config }) {\n if (!this._api.narrower) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.narrower,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: concept.uri,\n },\n })\n }\n\n /**\n * Returns ancestor concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getAncestors({ concept, ...config }) {\n if (!this._api.ancestors) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.ancestors,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: concept.uri,\n },\n })\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string} [config.use=notation,label] which fields to search (\"notation\", \"label\" or \"notation,label\")\n * @param {string[]} [config.types=[]] list of type URIs\n * @param {string} [config.sort=score] sorting parameter\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest({ scheme, use = \"notation,label\", types = [], sort = \"score\", ...config }) {\n return this._search({\n ...config,\n endpoint: \"suggest\",\n params: {\n ...config.params,\n voc: _.get(scheme, \"uri\", \"\"),\n type: types.join(\"|\"),\n use,\n sort,\n },\n })\n }\n\n /**\n * Returns search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} result in JSKOS Format\n */\n async search({ scheme, types = [], ...config }) {\n return this._search({\n ...config,\n endpoint: \"search\",\n params: {\n ...config.params,\n voc: _.get(scheme, \"uri\", \"\"),\n type: types.join(\"|\"),\n },\n })\n }\n\n /**\n * Returns concept scheme suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string} [config.use=notation,label] which fields to search (\"notation\", \"label\" or \"notation,label\")\n * @param {string} [config.sort=score] sorting parameter\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async vocSuggest({ use = \"notation,label\", sort = \"score\", ...config }) {\n return this._search({\n ...config,\n endpoint: \"voc-suggest\",\n params: {\n ...config.params,\n use,\n sort,\n },\n })\n }\n\n /**\n * Returns concept scheme search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in JSKOS Format\n */\n async vocSearch(config) {\n return this._search({\n ...config,\n endpoint: \"voc-search\",\n })\n }\n\n async _search({ endpoint, search, limit, offset, params, ...config }) {\n let url = this._api[endpoint]\n if (!url) {\n throw new errors.MissingApiUrlError()\n }\n if (!search) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"search\" })\n }\n limit = limit || this._jskos.suggestResultLimit || 100\n offset = offset || 0\n // Some registries use URL templates with {searchTerms}\n url = url.replace(\"{searchTerms}\", search)\n return this.axios({\n ...config,\n params: {\n ...this._defaultParams,\n ...params,\n limit: limit,\n count: limit, // Some endpoints use count instead of limit\n offset,\n search,\n query: search,\n },\n method: \"get\",\n url,\n })\n }\n\n /**\n * Returns a list of types.\n *\n * @param {Object} config\n * @param {Object} [config.scheme] concept scheme to load types for\n * @returns {Object[]} array of JSKOS type objects\n */\n async getTypes({ scheme, ...config }) {\n if (!this._api.types) {\n throw new errors.MissingApiUrlError()\n }\n if (Array.isArray(this._api.types)) {\n return this._api.types\n }\n const schemeUri = scheme && await this._getSchemeUri(scheme)\n if (schemeUri) {\n _.set(config, \"params.uri\", schemeUri)\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.types,\n })\n }\n\n}\n\nConceptApiProvider.providerName = \"ConceptApi\"\nConceptApiProvider.providerType = \"http://bartoc.org/api-type/jskos\"\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\n\n// TODO: Document namespace etc.\n\n/**\n * Reconciliation Service API.\n *\n * This class provides access to the [Reconciliation Service API](https://reconciliation-api.github.io/specs/).\n *\n * To use it in a registry, specify `provider` as \"ReconciliationApi\", provide the API base URL as `api`, and the compatible scheme or schemes in `schemes`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/wikidata-reconciliation\",\n * \"provider\": \"ReconciliationApi\",\n * \"api\": \"https://tools.wmflabs.org/openrefine-wikidata/{language}/api\",\n * \"schemes\": [\n * {\n * \"uri\": \"http://bartoc.org/en/node/1940\"\n * }\n * ],\n * }\n * ```\n *\n * The string `{language}` in `api` will be replaced with the queried language for the reconciliation request.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class ReconciliationApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this.has.mappings = true\n this._cache = []\n }\n\n /**\n * Returns a list of mappings suggestions.\n *\n * @param {Object} config\n * @param {Object} config.from JSKOS concept on from side\n * @param {Object} config.to JSKOS concept on to side\n * @param {Object} config.mode mappings mode\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, to, mode, ...config }) {\n let schemes = []\n if (_.isArray(this.schemes)) {\n schemes = this.schemes\n }\n let swap\n let concept\n let fromConceptScheme = _.get(from, \"inScheme[0]\")\n let toConceptScheme = _.get(to, \"inScheme[0]\")\n let fromScheme\n let toScheme\n if (!from || jskos.isContainedIn(fromConceptScheme, schemes)) {\n swap = true\n concept = to\n fromScheme = toConceptScheme\n toScheme = schemes.find(scheme => jskos.compare(scheme, fromConceptScheme)) || schemes[0]\n } else {\n swap = false\n concept = from\n fromScheme = fromConceptScheme\n toScheme = schemes.find(scheme => jskos.compare(scheme, toConceptScheme)) || schemes[0]\n }\n // Temporary to filter out GND mapping requests...\n // TODO: Remove?!?\n if (mode != \"or\") {\n return []\n }\n if (!this._api.api) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept) {\n throw new errors.InvalidOrMissingParameterError({ parameter: swap ? \"to\" : \"from\" })\n }\n // Prepare labels\n let language = jskos.languagePreference.selectLanguage(concept.prefLabel)\n if (!language) {\n throw new errors.InvalidOrMissingParameterError({ parameter: swap ? \"to\" : \"from\", message: \"Missing language\" })\n }\n let altLabels = _.get(concept, `altLabel.${language}`, [])\n if (_.isString(altLabels)) {\n altLabels = [altLabels]\n }\n let prefLabel = _.get(concept, `prefLabel.${language}`)\n let labels = altLabels.concat([prefLabel])\n labels = [prefLabel]\n // Get results from API or cache\n let { url, data: results } = await this._getReconciliationResults({ ...config, labels, language })\n results = [].concat(...Object.values(results).map(value => value.result)).filter(r => r)\n // Sort results, first by score descending, then by match, then by length of notation\n results = results.sort((a, b) => {\n if (a.score != b.score) {\n return b.score - a.score\n }\n if (a.match != b.match) {\n if (a.match) {\n return -1\n } else {\n return 1\n }\n }\n return a.id.length - b.id.length\n })\n // Prepare namespace\n let namespace = _.get(toScheme, \"namespace\", \"\")\n // Map results to actual mappings\n let mappings = results.map(result => ({\n fromScheme,\n from: { memberSet: [concept] },\n toScheme,\n to: {\n memberSet: [\n {\n uri: namespace + result.id,\n },\n ],\n },\n type: [\n result.match ?\n \"http://www.w3.org/2004/02/skos/core#exactMatch\" :\n (\n result.score >= 80 ?\n \"http://www.w3.org/2004/02/skos/core#closeMatch\" :\n \"http://www.w3.org/2004/02/skos/core#mappingRelation\"\n ),\n ],\n }))\n if (swap) {\n // Swap mapping sides if only `to` was set\n mappings = mappings.map(mapping => Object.assign(mapping, {\n fromScheme: mapping.toScheme,\n from: mapping.to,\n toScheme: mapping.fromScheme,\n to: mapping.from,\n }))\n }\n mappings._url = url\n return mappings\n }\n\n /**\n * Internal function that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config passthrough of config object for axios request\n * @param {string[]} labels list of labels to get results for\n * @param {string} language language of labels\n */\n async _getReconciliationResults({ labels, language, ...config }) {\n labels = labels.sort()\n // Use local cache.\n let resultsFromCache = this._cache.find(item => {\n return _.isEqual(item.labels, labels) && item.language == language\n })\n if (resultsFromCache) {\n return resultsFromCache\n }\n // Prepare queries\n let queries = {}\n let index = 0\n for (let label of labels) {\n queries[`q${index}`] = {\n query: label,\n }\n index += 1\n }\n let url = this._api.api\n if (language) {\n url = url.replace(\"{language}\", language)\n }\n // Encode data\n const encodedData = `queries=${encodeURIComponent(JSON.stringify(queries))}`\n // Set appropriate header\n _.set(config, [\"headers\", \"Content-Type\"], \"application/x-www-form-urlencoded\")\n let data = await this.axios({\n ...config,\n method: \"post\",\n url,\n data: encodedData,\n })\n data = data || {}\n let newCacheEntry = {\n labels,\n language,\n data,\n url: `${url}${url.includes(\"?\") ? \"&\" : \"?\"}${encodedData}`,\n }\n this._cache.push(newCacheEntry)\n // Make sure there are a maximum of 20 entries in cache\n if (this._cache.length > 20) {\n this._cache = this._cache.slice(this._cache.length - 20)\n }\n return newCacheEntry\n }\n\n}\n\nReconciliationApiProvider.providerName = \"ReconciliationApi\"\nReconciliationApiProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\n\n// TODO: Only keep the last 20 results in cache.\n// TODO: Try to remove dependencies on `selected`, `scheme._registry.registry.uri`, etc.\n\n/**\n * Label search suggestion provider.\n *\n * This provider offers mapping recommendations based on label match via the `/search` endpoint of JSKOS APIs.\n *\n * The provider requires that a list of initialized registries with search endpoints is provided via `cdk` (which refers to the CDK instance that's using this provider).\n *\n * To use it in a registry, specify `provider` as \"LabelSearchSuggestion\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-recommendations\"\n * \"provider\": \"LabelSearchSuggestion\"\n * }\n * ```\n *\n * You can provide a list of excluded schemes as JSKOS objects in `excludedSchemes`.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LabelSearchSuggestionProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this._cache = []\n this.has.mappings = true\n }\n\n /**\n * Override `supportsScheme` to check whether a search URI is available for the scheme's registry.\n *\n * @param {Object} scheme - target scheme to check for support\n * @returns {boolean}\n */\n supportsScheme(scheme) {\n return _.get(scheme, \"_registry.has.search\", false)\n }\n\n /**\n * Returns a list of mappings.\n *\n * @param {Object} config\n * @param {Object} config.from JSKOS concept on from side\n * @param {Object} config.to JSKOS concept on to side\n * @param {Object} config.mode mappings mode\n * @param {Object} config.selected selected mappings in Cocoda\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, to, mode, selected, limit = 10, ...config }) {\n // TODO: Why mode?\n if (mode != \"or\") {\n return []\n }\n if (!selected) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"selected\" })\n }\n let promises = []\n if (from && this.supportsScheme(selected.scheme[false])) {\n promises.push(this._getMappings({ ...config, concept: from, sourceScheme: selected.scheme[true], targetScheme: selected.scheme[false], limit }))\n } else {\n promises.push(Promise.resolve([]))\n }\n if (to && this.supportsScheme(selected.scheme[true])) {\n promises.push(this._getMappings({ ...config, concept: to, sourceScheme: selected.scheme[false], targetScheme: selected.scheme[true], limit, swap: true }))\n } else {\n promises.push(Promise.resolve([]))\n }\n let [fromResult, toResult] = await Promise.all(promises)\n // Filter all duplicates from toResult\n toResult = toResult.filter(m => !fromResult.find(n => jskos.compareMappingMembers(m, n)))\n // Reduce number of results until limit is reached\n while (fromResult.length + toResult.length > limit) {\n if (toResult.length >= fromResult.length) {\n toResult = toResult.slice(0, -1)\n } else {\n fromResult = fromResult.slice(0, -1)\n }\n }\n return _.union(fromResult, toResult)\n }\n\n /**\n * Internal function to get mapping recommendations for a certain concept with sourceScheme and targetScheme.\n *\n * @private\n *\n * @param {Object} config\n * @param {Object} config.concept\n * @param {Object} config.sourceScheme\n * @param {Pbject} config.targetScheme\n * @param {boolean} config.swap - whether to reverse the direction of the mappings\n */\n async _getMappings({ concept, sourceScheme, targetScheme, limit, swap = false, ...config }) {\n if (!concept || !sourceScheme || !targetScheme) {\n return []\n }\n // If source scheme is the same as target scheme, skip\n if (jskos.compare(sourceScheme, targetScheme)) {\n return []\n }\n // Prepare label\n // TODO: Can we use a language prioritiy list like for requests?\n const language = jskos.languagePreference.selectLanguage(concept.prefLabel) || this._defaultLanguages[0]\n let label = jskos.prefLabel(concept, {\n fallbackToUri: false,\n language,\n })\n if (!label) {\n return []\n }\n // Get results from API or cache\n const results = await this._getResults({ ...config, label, targetScheme, limit })\n // Map results to actual mappings\n let mappings = results.map(result => ({\n fromScheme: sourceScheme,\n from: { memberSet: [concept] },\n toScheme: targetScheme,\n to: { memberSet: [result] },\n type: [\"http://www.w3.org/2004/02/skos/core#mappingRelation\"],\n }))\n if (swap) {\n // Swap mapping sides if only `to` was set\n mappings = mappings.map(mapping => Object.assign(mapping, {\n fromScheme: mapping.toScheme,\n from: mapping.to,\n toScheme: mapping.fromScheme,\n to: mapping.from,\n }))\n }\n return mappings\n }\n\n /**\n * Internal function that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config\n * @param {string} config.label\n * @param {Object} config.targetScheme\n */\n async _getResults({ label, targetScheme, limit, ...config }) {\n // Use local cache.\n let resultsFromCache = (this._cache[targetScheme.uri] || {})[label]\n if (resultsFromCache && resultsFromCache._limit >= limit) {\n return resultsFromCache\n }\n // Determine search URI for target scheme's registry\n const registry = _.get(targetScheme, \"_registry\")\n if (!registry || !registry.has.search) {\n return []\n }\n // API request\n const data = await registry.search({\n ...config,\n search: label,\n scheme: targetScheme,\n limit,\n })\n // Save result in cache\n if (!this._cache[targetScheme.uri]) {\n this._cache[targetScheme.uri] = {}\n }\n this._cache[targetScheme.uri][label] = data\n this._cache[targetScheme.uri][label]._limit = limit\n return data\n }\n\n}\n\nLabelSearchSuggestionProvider.providerName = \"LabelSearchSuggestion\"\nLabelSearchSuggestionProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\n\n/**\n * Skosmos API.\n *\n * [Skosmos](http://skosmos.org/) is a web application to publish SKOS-based vocabularies.\n * This class provides access to a Skosmos instance via its REST API.\n *\n * To use it in a registry, specify `provider` as \"SkosmosApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/skosmos-zbw\",\n * \"provider\": \"SkosmosApi\",\n * \"api\": \"https://zbw.eu/beta/skosmos/rest/v1/\",\n * \"schemes\": [\n * {\n * \"uri\": \"http://bartoc.org/en/node/313\",\n * \"VOCID\": \"stw\"\n * }\n * ]\n * }\n * ```\n *\n * Currently, it is not possible to query a list of concept schemes from the API, so you need to provide this list including a `VOCID` for every scheme.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class SkosmosApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this.has.schemes = true\n this.has.top = true\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = true\n this.has.ancestors = true\n this.has.types = true\n this.has.suggest = true\n this.has.search = true\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.url API URL for BARTOC instance\n * @param {Object} options.scheme scheme for which the config is requested\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ url, scheme } = {}) {\n if (!url || !scheme) {\n return null\n }\n const config = {}\n const match = url.match(/(.+\\/)([^/]+)\\/$/)\n if (!match) {\n return null\n }\n config.api = match[1] + \"rest/v1/\"\n scheme.VOCID = match[2]\n config.schemes = [scheme]\n return config\n }\n\n /**\n * @private\n */\n get _language() {\n return this.languages[0] || this._defaultLanguages[0] || \"en\"\n }\n\n /**\n * @private\n */\n _getApiUrl(scheme, endpoint, params) {\n const VOCID = scheme && scheme.VOCID || _.get(this.schemes.find(s => jskos.compare(s, scheme)), \"VOCID\")\n if (!VOCID) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Missing scheme or VOCID property on scheme\" })\n }\n endpoint = endpoint || \"\"\n params = params || {}\n if (!params.lang) {\n params.lang = this._language\n }\n const paramString = Object.keys(params).map(k => `${k}=${encodeURIComponent(params[k])}`).join(\"&\")\n return `${this._api.api}${VOCID}${endpoint}${paramString ? \"?\" + paramString : \"\"}`\n }\n\n /**\n * @private\n */\n _getDataUrl(concept, { addFormatParameter = true } = {}) {\n const scheme = _.get(concept, \"inScheme[0]\")\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\", message: \"Missing concept URI\" })\n }\n return this._getApiUrl(scheme, \"/data\", addFormatParameter ? { format: \"application/json\" } : {})\n }\n\n /**\n * Returns the main vocabulary URI by requesting the scheme info and saving it in a cache.\n *\n * @private\n */\n async _getSchemeUri(scheme) {\n this._approvedSchemes = this._approvedSchemes || []\n this._rejectedSchemes = this._rejectedSchemes || []\n let _scheme = this._approvedSchemes.find(s => jskos.compare(scheme, s))\n if (_scheme) {\n return _scheme.uri\n }\n // Return null if it was already rejected\n if (this._rejectedSchemes.find(s => jskos.compare(scheme, s))) {\n return null\n }\n // Otherwise load scheme data and save in approved/rejected schemes\n const url = this._getApiUrl(scheme, \"/\")\n const data = await this.axios({\n method: \"get\",\n url,\n })\n const resultScheme = data.conceptschemes.find(s => jskos.compare(s, scheme))\n if (resultScheme) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n return resultScheme.uri\n } else {\n this._rejectedSchemes.push({\n uri: scheme.uri,\n identifier: scheme.identifier,\n })\n return null\n }\n }\n\n /**\n * @private\n */\n _toJskosConcept(skosmosConcept, { concept, scheme, result, language } = {}) {\n if (!skosmosConcept) {\n return null\n }\n concept = jskos.deepCopy(concept || {})\n language = language || skosmosConcept.lang || \"en\"\n\n concept.uri = skosmosConcept.uri\n\n // Set inScheme\n if (scheme) {\n concept.inScheme = [scheme]\n }\n\n // Set prefLabel\n let prefLabel = skosmosConcept.matchedPrefLabel || skosmosConcept.prefLabel || skosmosConcept.label\n if (_.isString(prefLabel)) {\n _.set(concept, `prefLabel.${language}`, prefLabel)\n } else {\n if (prefLabel && !_.isArray(prefLabel)) {\n prefLabel = [prefLabel]\n }\n for (let label of prefLabel || []) {\n _.set(concept, `prefLabel.${label.lang}`, label.value)\n }\n }\n\n // Set altLabel\n let altLabel = skosmosConcept.altLabel\n if (_.isString(altLabel)) {\n _.set(concept, `altLabel.${language}`, [altLabel])\n } else {\n if (altLabel && !_.isArray(altLabel)) {\n altLabel = [altLabel]\n }\n for (let label of altLabel || []) {\n if (_.get(concept, `altLabel.${label.lang}`)) {\n concept.altLabel[label.lang].push(label.value)\n concept.altLabel[label.lang] = _.uniq(concept.altLabel[label.lang])\n } else {\n _.set(concept, `altLabel.${label.lang}`, [label.value])\n }\n }\n }\n\n // Set notation\n const notation = skosmosConcept.notation || skosmosConcept[\"skos:notation\"] || jskos.notation(concept)\n if (notation) {\n // notation can be string or object, so we're trying notation.value first\n concept.notation = [notation.value || notation]\n }\n\n // Set broader\n if (skosmosConcept.broader) {\n if (!_.isArray(skosmosConcept.broader)) {\n skosmosConcept.broader = [skosmosConcept.broader]\n }\n concept.broader = skosmosConcept.broader.map(concept => _.isString(concept) ? { uri: concept } : concept)\n }\n\n // Set narrower\n if (skosmosConcept.hasChildren === true) {\n concept.narrower = [null]\n } else if (skosmosConcept.hasChildren === false) {\n concept.narrower = []\n }\n\n // Set type\n if (skosmosConcept.type && !_.isArray(skosmosConcept.type)) {\n skosmosConcept.type = [skosmosConcept.type]\n }\n concept.type = concept.type || []\n for (let type of skosmosConcept.type || []) {\n if (!jskos.isValidUri(type)) {\n continue\n }\n const uriScheme = type.slice(0, type.indexOf(\":\"))\n // Try to find uriScheme in @context\n if (result && result[\"@context\"] && result[\"@context\"][uriScheme]) {\n type = type.replace(uriScheme + \":\", result[\"@context\"][uriScheme])\n }\n concept.type.push(type)\n }\n concept.type = _.uniq(concept.type)\n if (!concept.type.length) {\n concept.type = [\"http://www.w3.org/2004/02/skos/core#Concept\"]\n }\n\n return concept\n }\n\n /**\n * Returns all concept schemes.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes({ ...config }) {\n const schemes = []\n for (let scheme of this.schemes || []) {\n const url = this._getApiUrl(scheme, \"/\")\n const data = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const resultScheme = data.conceptschemes.find(s => jskos.compare(s, scheme))\n const label = resultScheme && (resultScheme.prefLabel || resultScheme.label || resultScheme.title)\n if (label) {\n _.set(scheme, `prefLabel.${this._language}`, label)\n }\n schemes.push(scheme)\n // Also add scheme to approved schemes\n this._approvedSchemes = this._approvedSchemes || []\n if (!this._approvedSchemes.find(s => jskos.compare(scheme, s))) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n }\n }\n return schemes\n }\n\n /**\n * Returns top concepts.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getTop({ scheme, ...config }) {\n const url = this._getApiUrl(scheme, \"/topConcepts\")\n const schemeUri = await this._getSchemeUri(scheme)\n if (!schemeUri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Missing or unsupported scheme or VOCID property on scheme\" })\n }\n _.set(config, \"params.scheme\", schemeUri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = []\n for (let concept of response.topconcepts || []) {\n const newConcept = this._toJskosConcept(concept, {\n scheme,\n language: this._language,\n })\n newConcept.topConceptOf = [scheme]\n concepts.push(newConcept)\n }\n return concepts\n }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts, ...config }) {\n if (!_.isArray(concepts)) {\n concepts = [concepts]\n }\n concepts = concepts.map(c => ({ uri: c.uri, inScheme: c.inScheme }))\n const newConcepts = []\n for (let concept of concepts) {\n const url = this._getDataUrl(concept, { addFormatParameter: false })\n if (!url) {\n continue\n }\n const result = await this.axios({\n ...config,\n method: \"get\",\n url,\n params: {\n uri: concept.uri,\n format: \"application/json\",\n },\n })\n const resultConcept = result && result.graph && result.graph.find(c => jskos.compare(c, concept))\n if (resultConcept) {\n const newConcept = this._toJskosConcept(resultConcept, { concept, result })\n // Set broader/narrower\n for (let type of [\"broader\", \"narrower\"]) {\n let relatives = resultConcept[type] || newConcept[type]\n if (relatives && !_.isArray(relatives)) {\n relatives = [relatives]\n }\n if (!relatives) {\n relatives = []\n }\n newConcept[type] = relatives.map(r => this._toJskosConcept(result.graph.find(c => jskos.compare(c, r)), { scheme: concept.inScheme[0], result }))\n // if (relatives.length) {\n // newConcept[type] = [null]\n // } else {\n // newConcept[type] = []\n // }\n }\n // Set ancestors to empty array\n // ?\n newConcept.ancestors = []\n // Push to array\n newConcepts.push(newConcept)\n }\n }\n return newConcepts\n }\n\n /**\n * Returns narrower concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getNarrower({ concept, ...config }) {\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n const scheme = concept.inScheme[0]\n const url = this._getApiUrl(scheme, \"/children\")\n _.set(config, \"params.uri\", concept.uri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = (response.narrower || []).map(c => this._toJskosConcept(c, { scheme }))\n return concepts\n }\n\n /**\n * Returns ancestor concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getAncestors({ concept, ...config }) {\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n const scheme = concept.inScheme[0]\n const url = this._getApiUrl(scheme, \"/broaderTransitive\")\n _.set(config, \"params.uri\", concept.uri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n let ancestors = []\n let uri = concept.uri\n while (uri) {\n if (uri != concept.uri) {\n const ancestor = _.get(response, `broaderTransitive[\"${uri}\"]`)\n ancestors = ancestors.concat([ancestor])\n }\n uri = _.get(response, `broaderTransitive[\"${uri}\"].broader[0]`)\n }\n const concepts = ancestors.map(c => this._toJskosConcept(c, { scheme })).filter(c => c.uri != concept.uri)\n return concepts\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest(config) {\n config._raw = true\n const concepts = await this.search(config)\n const result = [config.search, [], [], []]\n for (let concept of concepts) {\n const notation = jskos.notation(concept)\n const label = jskos.prefLabel(concept)\n result[1].push((notation ? notation + \" \" : \"\") + label)\n result[2].push(\"\")\n result[3].push(concept.uri)\n }\n if (concepts._totalCount != undefined) {\n result._totalCount = concepts._totalCount\n } else {\n result._totalCount = concepts.length\n }\n return result\n }\n\n /**\n * Returns concept search results.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} array of JSKOS concept objects\n */\n async search({ search, scheme, limit, types = [], ...config }) {\n const url = this._getApiUrl(scheme, \"/search\")\n _.set(config, \"params.query\", `${search}*`)\n _.set(config, \"params.unique\", 1)\n _.set(config, \"params.maxhits\", limit || 100)\n _.set(config, \"params.type\", types.join(\" \"))\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = (response.results || []).map(c => this._toJskosConcept(c, { scheme }))\n return concepts\n }\n\n /**\n * Returns a list of types.\n *\n * @param {Object} config\n * @param {Object} [config.scheme] concept scheme to load types for\n * @returns {Object[]} array of JSKOS type objects\n */\n async getTypes({ scheme, ...config }) {\n const url = this._getApiUrl(scheme, \"/types\")\n const types = []\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n for (let type of (response && response.types) || []) {\n // Skip SKOS type Concept\n if (type.uri == \"http://www.w3.org/2004/02/skos/core#Concept\") {\n continue\n }\n // Set prefLabel if available\n if (type.label) {\n type.prefLabel = {\n [response[\"@context\"][\"@language\"]]: type.label,\n }\n delete type.label\n }\n types.push(type)\n }\n types._url = url\n return types\n }\n\n}\n\nSkosmosApiProvider.providerName = \"SkosmosApi\"\nSkosmosApiProvider.providerType = \"http://bartoc.org/api-type/skosmos\"\n", "import BaseProvider from \"./base-provider.js\"\nimport * as errors from \"../errors/index.js\"\nimport jskos from \"jskos-tools\"\nimport axios from \"axios\"\n\nconst locUriPrefix = \"http://id.loc.gov/authorities/\"\nconst supportedSchemes = [\n {\n uri: `${locUriPrefix}subjects`,\n identifier: [\n \"http://bartoc.org/en/node/454\",\n ],\n notation: [\"LCSH\"],\n concepts: [null],\n topConcepts: [],\n },\n {\n uri: `${locUriPrefix}names`,\n identifier: [\n \"http://bartoc.org/en/node/18536\",\n ],\n notation: [\"LCNAF\"],\n concepts: [null],\n topConcepts: [],\n },\n]\nconst lccUri = `${locUriPrefix}classification`\n\nfunction madsToJskosItem(data) {\n const item = {}\n item.uri = data[\"@id\"]\n // Notation\n item.notation = (data[\"http://www.loc.gov/mads/rdf/v1#code\"] || []).map(n => n[\"@value\"])\n // prefLabel\n const prefLabelArray = data[\"http://www.loc.gov/mads/rdf/v1#authoritativeLabel\"] || data[\"http://www.w3.org/2000/01/rdf-schema#label\"] || []\n if (prefLabelArray.length) {\n item.prefLabel = {}\n item.prefLabel[prefLabelArray[0][\"@language\"] || \"en\"] = prefLabelArray[0][\"@value\"]\n }\n // altLabel\n const altLabelArray = data[\"http://www.w3.org/2004/02/skos/core#altLabel\"] || []\n if (altLabelArray.length) {\n item.altLabel = { en: altLabelArray.map(l => l[\"@value\"]) }\n }\n // definition\n for (let definition of data[\"http://www.w3.org/2000/01/rdf-schema#comment\"] || []) {\n item.definition = item.definition || {}\n item.definition.en = item.definition.en || []\n item.definition.en.push(definition[\"@value\"])\n }\n return item\n}\n\nfunction madsToJskosScheme(data) {\n const scheme = madsToJskosItem(data)\n scheme.namespace = scheme.uri + \"/\"\n scheme.type = [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"]\n // TODO: topConcepts can possibly be reenabled for LCC\n // const topConcepts = data[\"http://www.loc.gov/mads/rdf/v1#hasMADSSchemeMember\"]\n // if (scheme.uri === lccUri && topConcepts) {\n // scheme.topConcepts = topConcepts.map(c => {\n // const concept = madsToJskosItem(c)\n // concept.inScheme = [{ uri: scheme.uri }]\n // return concept\n // })\n // }\n return scheme\n}\n\n\n// TODO: This might not be necessary anymore once LoC fixes their API.\nconst schemeNamespaceFilter = (scheme) => (c) => {\n if (!c || !scheme || !scheme.namespace) {\n // Do not filter if no scheme is given\n return true\n }\n return c.uri.startsWith(scheme.namespace)\n}\n\nfunction madsToJskosConcept(data, { scheme }) {\n const concept = madsToJskosItem(data)\n concept.type = [\"http://www.w3.org/2004/02/skos/core#Concept\"]\n concept.inScheme = scheme ? [scheme] : (data[\"http://www.loc.gov/mads/rdf/v1#isMemberOfMADSScheme\"] || []).map(s => supportedSchemes.find(s2 => s2.uri === s[\"@id\"]))\n if (!concept.inScheme.length || !concept.inScheme[0]) {\n // TODO: Should conversion fail if inScheme couldn't be set?\n delete concept.inScheme\n }\n // narrower\n const narrower = data[\"http://www.loc.gov/mads/rdf/v1#hasNarrowerAuthority\"] || (jskos.compare(concept.inScheme[0], { uri: lccUri }) && data[\"http://www.loc.gov/mads/rdf/v1#hasMADSCollectionMember\"]) || []\n concept.narrower = narrower.map(n => ({ uri: n[\"@id\"] })).filter(schemeNamespaceFilter(concept.inScheme && concept.inScheme[0]))\n // broader\n const broader = data[\"http://www.loc.gov/mads/rdf/v1#hasBroaderAuthority\"] || (jskos.compare(concept.inScheme[0], { uri: lccUri }) && data[\"http://www.loc.gov/mads/rdf/v1#isMemberOfMADSCollection\"]) || []\n concept.broader = broader.map(n => ({ uri: n[\"@id\"] })).filter(schemeNamespaceFilter(concept.inScheme && concept.inScheme[0]))\n return concept\n}\n\n/**\n * Library of Congress API (experimental)\n *\n * This class provides access to concept schemes and their concepts via the Library of Congress Linked Open Data Service (https://id.loc.gov/), in [JSKOS format](https://gbv.github.io/jskos/).\n *\n * To use it in a registry, specify `provider` as \"LocApi\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/loc-concepts\",\n * \"provider\": \"LocApi\",\n * }\n * ```\n *\n * No further configuration is needed. Currently supported are LC Subject Headings (LCSH) and LC Name Authority File (LCNAF), both of which are hardcoded.\n *\n * Additionally, the following JSKOS properties on the registry can be provided: `prefLabel`, `notation`, `definition` (i.e. to be shown in Cocoda)\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LocApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _setup() {\n this.has.schemes = true\n this.has.top = false\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = false\n this.has.ancestors = false\n this.has.suggest = true\n this.has.search = true\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.scheme scheme for which the config is requested\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ scheme } = {}) {\n // Check if scheme is supported\n if (!scheme || !supportedSchemes.find(s => jskos.compare(s, scheme))) {\n return null\n }\n // We don't need any API endpoints because they are hardcoded.\n return {\n schemes: [scheme],\n }\n }\n\n /**\n * Returns all concept schemes.\n *\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes() {\n const schemes = []\n\n for (let scheme of await Promise.all(\n supportedSchemes.filter(s => !this.schemes || !this.schemes.length || this.schemes.find(s2 => jskos.compare(s, s2))).map(s => axios({\n method: \"get\",\n url: `${s.uri.replace(\"http:\", \"https:\")}.json`,\n }).then(({ status, data }) => {\n if (status === 200) {\n let scheme = data.find(d => s.uri === d[\"@id\"])\n if (scheme) {\n scheme = jskos.merge(madsToJskosScheme(scheme), s)\n scheme.topConcepts = (scheme.topConcepts || []).filter(c => c)\n return scheme\n }\n }\n return null\n })))) {\n if (scheme) {\n schemes.push(scheme)\n }\n }\n\n return schemes\n }\n\n /**\n * TODO: Possibly reenable for LCC\n * Returns top concepts for a concept scheme.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme object\n * @returns {Object[]} array of JSKOS concept objects\n */\n // async getTop({ scheme }) {\n // if (scheme.topConcepts && !scheme.topConcepts.includes(null)) {\n // return scheme.topConcepts\n // }\n // const schemes = await this.getSchemes()\n // scheme = schemes.find(s => jskos.compare(s, scheme))\n // return scheme && scheme.topConcepts || []\n // }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts }) {\n if (!Array.isArray(concepts)) {\n concepts = [concepts]\n }\n\n const resultConcepts = []\n\n for (let concept of await Promise.all(concepts.map(c => axios({\n method: \"get\",\n url: `${c.uri.replace(\"http:\", \"https:\")}.json`,\n }).then(({ status, data }) => {\n if (status === 200) {\n let concept = data.find(d => c.uri === d[\"@id\"])\n if (concept) {\n return madsToJskosConcept(concept, { scheme: c.inScheme && c.inScheme[0] })\n }\n return null\n }\n\n })))) {\n if (concept) {\n resultConcepts.push(concept)\n }\n }\n\n return resultConcepts\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} config.scheme concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest(config) {\n const results = await this.search(config)\n return [\n config.search,\n results.map(c => {\n return jskos.prefLabel(c, { fallbackToUri: true })\n }),\n [],\n results.map(c => c.uri),\n ]\n }\n\n /**\n * Returns search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} config.scheme concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in JSKOS Format\n */\n async search({ search, scheme, limit, offset }) {\n const schemeUri = jskos.getAllUris(scheme).find(uri => uri.startsWith(locUriPrefix))\n if (!schemeUri || !supportedSchemes.find(s => jskos.compare(s, { uri: schemeUri }))) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"provided scheme is not supported (yet)\" })\n }\n if (!search) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"search\", message: \"parameter is empty or missing\" })\n }\n limit = limit || this._jskos.suggestResultLimit || 100\n offset = offset || 0\n const { data } = await axios({\n method: \"get\",\n url: `${schemeUri}/suggest2`.replace(\"http:\", \"https:\"),\n params: {\n q: search,\n count: limit || 100,\n offset,\n searchtype: \"keyword\",\n },\n })\n return (data.hits || []).map(d => ({\n uri: d.uri,\n notation: [d.token],\n prefLabel: { en: d.aLabel },\n inScheme: [scheme],\n })).filter(schemeN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IACtB,EAAQ,OAAO,EAAkB,GAGnC,EAAS,WAAM,MAAM,EAAQ,AAAE,WAAK,EAAa,CAAC,WAAY,gBAAiB,CAAE,UAAW,GAAM,UAAW,CAAC,eAEhH,EAAO,UAAY,EAEnB,EAAQ,KAAK,OACR,CAEL,GAAI,GAAQ,EAAQ,UAAU,GAAK,WAAM,QAAQ,EAAG,IACpD,GAAI,GAAS,GAAI,CACf,GAAI,GAAW,EAAQ,GAAO,UAC9B,EAAQ,GAAS,WAAM,MAAM,EAAQ,GAAQ,AAAE,WAAK,EAAQ,CAAC,WAAY,gBAAiB,CAAE,UAAW,GAAM,UAAW,CAAC,eACzH,EAAQ,GAAO,UAAY,OAIhC,MAAM,GAAS,CAEhB,QAAQ,KAAK,qCAAsC,EAAS,IAAK,KAEnE,EAAS,KAAK,GAIlB,YAAM,SAAQ,IAAI,GACX,WAAM,YAAY,EAAQ,OAAO,YAG1C,kBAAkB,EAAQ,CACxB,GAAI,GAAW,EAAO,UACtB,GAAI,EACF,MAAO,GAGT,OAAS,KAAuB,GAAO,KAAO,GAAI,CAA7C,QAAM,SAAN,EAAe,IAAf,EAAe,CAAT,SACT,GAAM,GAAW,OAAO,OAAO,IAAW,KAAK,GAAK,EAAE,eAAiB,GACvE,GAAI,CAAC,GAAY,CAAC,EAAS,kCACzB,SAEF,GAAM,GAAe,EAAS,aAI9B,GAFA,EAAO,OAAS,EAChB,EAAS,GAAU,GAAc,kCAAkC,GAC/D,EAAC,EAGL,GAAO,SAAW,EAElB,GAAI,CACF,SAAW,KAAK,mBAAmB,GAC5B,QACA,EAAP,CACA,WAGJ,MAAO,QFhZX,GAAM,IAAM,GAAI,IA2BT,YAAyB,EAAM,CACpC,OAAO,OAAO,IAAW,QAAQ,GAAa,IAAQ,IAAK,YAAY",
4
+ "sourcesContent": ["'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n", "'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n", "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n", "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n", "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n", "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n", "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n", "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n", "'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n", "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || defaults.transitional;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n", "'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n", "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n", "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n", "module.exports = {\n \"version\": \"0.26.0\"\n};", "'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n", "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n", "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n", "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n", "'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n", "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n", "module.exports = require('./lib/axios');", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n", "var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n", "var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n", "var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n", "var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n", "var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n", "var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n", "var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n", "var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n", "var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n", "var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n", "var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n", "var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n", "var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n", "var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n", "var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n", "var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n", "var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n", "/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n", "var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n", "var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n", "var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n", "var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n", "var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n", "var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n", "var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n", "var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n", "var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n", "var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n", "var baseSet = require('./_baseSet');\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n", "var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n", "/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n", "/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n", "/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n", "var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n", "var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n", "/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n", "/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n", "var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n", "var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n", "var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n", "var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\nfunction baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseIntersection;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n", "var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n", "var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n", "var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n", "var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n", "var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n", "var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n", "var isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\nfunction castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n}\n\nmodule.exports = castArrayLikeObject;\n", "var arrayMap = require('./_arrayMap'),\n baseIntersection = require('./_baseIntersection'),\n baseRest = require('./_baseRest'),\n castArrayLikeObject = require('./_castArrayLikeObject');\n\n/**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\nvar intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n});\n\nmodule.exports = intersection;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n", "var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n", "var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n", "var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n", "var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n", "var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject');\n\n/**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\nvar union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n});\n\nmodule.exports = union;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n", "var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n", "var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n", "var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n", "var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n", "var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n", "var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n", "var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n", "var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n", "var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n", "var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n", "var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n", "var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n", "var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n", "var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n", "var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n", "var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n", "var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n", "var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n", "var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n", "var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n", "var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n", "var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n", "var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n", "var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n", "var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n", "var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n", "var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n", "var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n", "var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n", "var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n", "var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n", "var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n", "var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n", "var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n", "var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n", "var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n", "var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n", "var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n", "var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n", "var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n", "/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n", "var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n", "var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n", "var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n", "var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n", "var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n", "var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n", "var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n", "var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n", "var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n", "var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n", "var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n", "/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n", "var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n", "var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n", "var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n", "var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n", "var flatten = require('./flatten'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n", "var arrayMap = require('./_arrayMap'),\n baseClone = require('./_baseClone'),\n baseUnset = require('./_baseUnset'),\n castPath = require('./_castPath'),\n copyObject = require('./_copyObject'),\n customOmitClone = require('./_customOmitClone'),\n flatRest = require('./_flatRest'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\nvar omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n});\n\nmodule.exports = omit;\n", "var arrayPush = require('./_arrayPush'),\n baseFlatten = require('./_baseFlatten'),\n copyArray = require('./_copyArray'),\n isArray = require('./isArray');\n\n/**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\nfunction concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n}\n\nmodule.exports = concat;\n", "// adapted from from https://locutus.io/php/strings/sha1/\nmodule.exports = function sha1 (str) {\n // discuss at: https://locutus.io/php/sha1/\n // original by: Webtoolkit.info (https://www.webtoolkit.info/)\n // improved by: Michael White (https://getsprink.com)\n // improved by: Kevin van Zonneveld (https://kvz.io)\n // input by: Brett Zamir (https://brett-zamir.me)\n // note 1: Keep in mind that in accordance with PHP, the whole string is buffered and then\n // note 1: hashed. If available, we'd recommend using Node's native crypto modules directly\n // note 1: in a steaming fashion for faster and more efficient hashing\n // example 1: sha1('Kevin van Zonneveld')\n // returns 1: '54916d2e62f65b3afa6e192e6a601cdbe5cb5897'\n\n var _rotLeft = function (n, s) {\n var t4 = (n << s) | (n >>> (32 - s))\n return t4\n }\n\n var _cvtHex = function (val) {\n var str = \"\"\n var i\n var v\n\n for (i = 7; i >= 0; i--) {\n v = (val >>> (i * 4)) & 0x0f\n str += v.toString(16)\n }\n return str\n }\n\n var blockstart\n var i, j\n var W = new Array(80)\n var H0 = 0x67452301\n var H1 = 0xEFCDAB89\n var H2 = 0x98BADCFE\n var H3 = 0x10325476\n var H4 = 0xC3D2E1F0\n var A, B, C, D, E\n var temp\n\n // utf8_encode\n str = unescape(encodeURIComponent(str))\n var strLen = str.length\n\n var wordArray = []\n for (i = 0; i < strLen - 3; i += 4) {\n j = str.charCodeAt(i) << 24 |\n str.charCodeAt(i + 1) << 16 |\n str.charCodeAt(i + 2) << 8 |\n str.charCodeAt(i + 3)\n wordArray.push(j)\n }\n\n switch (strLen % 4) {\n case 0:\n i = 0x080000000\n break\n case 1:\n i = str.charCodeAt(strLen - 1) << 24 | 0x0800000\n break\n case 2:\n i = str.charCodeAt(strLen - 2) << 24 | str.charCodeAt(strLen - 1) << 16 | 0x08000\n break\n case 3:\n i = str.charCodeAt(strLen - 3) << 24 |\n str.charCodeAt(strLen - 2) << 16 |\n str.charCodeAt(strLen - 1) <<\n 8 | 0x80\n break\n }\n\n wordArray.push(i)\n\n while ((wordArray.length % 16) !== 14) {\n wordArray.push(0)\n }\n\n wordArray.push(strLen >>> 29)\n wordArray.push((strLen << 3) & 0x0ffffffff)\n\n for (blockstart = 0; blockstart < wordArray.length; blockstart += 16) {\n for (i = 0; i < 16; i++) {\n W[i] = wordArray[blockstart + i]\n }\n for (i = 16; i <= 79; i++) {\n W[i] = _rotLeft(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)\n }\n\n A = H0\n B = H1\n C = H2\n D = H3\n E = H4\n\n for (i = 0; i <= 19; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 0x5A827999) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 20; i <= 39; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 40; i <= 59; i++) {\n temp = (_rotLeft(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n for (i = 60; i <= 79; i++) {\n temp = (_rotLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff\n E = D\n D = C\n C = _rotLeft(B, 30)\n B = A\n A = temp\n }\n\n H0 = (H0 + A) & 0x0ffffffff\n H1 = (H1 + B) & 0x0ffffffff\n H2 = (H2 + C) & 0x0ffffffff\n H3 = (H3 + D) & 0x0ffffffff\n H4 = (H4 + E) & 0x0ffffffff\n }\n\n temp = _cvtHex(H0) + _cvtHex(H1) + _cvtHex(H2) + _cvtHex(H3) + _cvtHex(H4)\n return temp.toLowerCase()\n}\n", "/**\n * Module to calculate JSKOS mapping identifiers.\n */\n\nconst sha1 = require(\"./sha1.js\")\n\n// Reduce JSKOS set to members with URI.\nfunction reduceSet(set) {\n return set.map(member => member && member.uri).filter(Boolean)\n}\n\n// Tell which concept bundle field is used.\nfunction memberField(bundle) {\n return [\"memberSet\", \"memberList\", \"memberChoice\"].find(f => bundle[f])\n}\n\n// Reduce JSKOS concept bundle to memberSet/List/Choice with member URIs only.\nfunction reduceBundle(bundle) {\n const field = memberField(bundle)\n const set = bundle[field] ? reduceSet(bundle[field]) : []\n return {\n [set.length > 1 ? field : \"memberSet\"]: set.map(uri => ({uri})),\n }\n}\n\n// Reduce mapping to reduced fields from, to, and type.\nfunction mappingContent(mapping) {\n const { from, to, type } = mapping\n let result = {\n from: reduceBundle(from || {}),\n to: reduceBundle(to || {}),\n type: [\n type && type[0] || \"http://www.w3.org/2004/02/skos/core#mappingRelation\",\n ],\n }\n for (let side of [\"from\", \"to\"]) {\n if ((result[side][memberField(result[side])] || []).length == 0) {\n let scheme = mapping[side + \"Scheme\"]\n if (scheme && scheme.uri) {\n // Create new object to remove all unnecessary properties.\n result[side + \"Scheme\"] = { uri: scheme.uri }\n }\n }\n }\n return result\n}\n\n// Get a sorted list of member URIs.\nfunction mappingMembers(mapping) {\n const { from, to } = mapping\n const memberUris = [ from, to ].filter(Boolean)\n .map(bundle => reduceSet(bundle[memberField(bundle)] || []))\n return [].concat(...memberUris).sort()\n}\n\n/**\n * Returns a mapping content identifier. The identifier starts with `urn:jskos:mapping:content:`\n * and takes concepts and type into consideration. It uses the `mappingContent` function to get\n * relevant properties from the mapping.\n * @memberof module:jskos-tools\n */\nfunction mappingContentIdentifier(mapping) {\n const json = JSON.stringify(mappingContent(mapping), [\"from\",\"fromScheme\",\"to\",\"toScheme\",\"type\",\"memberSet\",\"memberList\",\"memberChoice\",\"uri\"])\n return \"urn:jskos:mapping:content:\" + sha1(json+\"\\n\")\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction mappingMembersIdentifier(mapping) {\n const json = JSON.stringify(mappingMembers(mapping))\n return \"urn:jskos:mapping:members:\" + sha1(json+\"\\n\")\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction addMappingIdentifiers(mapping) {\n const identifier = (mapping.identifier || []).filter(\n id => id && !id.startsWith(\"urn:jskos:mapping:\"),\n ).concat([\n mappingMembersIdentifier(mapping),\n mappingContentIdentifier(mapping),\n ]).sort()\n return Object.assign({}, mapping, {identifier})\n}\n\nfunction compare(mapping1, mapping2, prefix) {\n mapping1 = mapping1 && addMappingIdentifiers(mapping1)\n mapping2 = mapping2 && addMappingIdentifiers(mapping2)\n let id1 = mapping1 && mapping1.identifier ? mapping1.identifier.find(element => element.startsWith(prefix)) : null\n let id2 = mapping2 && mapping2.identifier ? mapping2.identifier.find(element => element.startsWith(prefix)) : null\n return id1 == id2\n}\n\n/**\n * @memberof module:jskos-tools\n */\nfunction compareMappings(mapping1, mapping2) {\n return compare(mapping1, mapping2, \"urn:jskos:mapping:content:\")\n}\nconst compareMappingContent = compareMappings\n\n/**\n * @memberof module:jskos-tools\n */\nfunction compareMappingMembers(mapping1, mapping2) {\n return compare(mapping1, mapping2, \"urn:jskos:mapping:members:\")\n}\n\nmodule.exports = {\n mappingContent,\n mappingMembers,\n mappingContentIdentifier,\n mappingMembersIdentifier,\n addMappingIdentifiers,\n compareMappings,\n compareMappingContent,\n compareMappingMembers,\n}\n", "function isEqualWith(a, b, compare) {\n var pSlice = Array.prototype.slice\n var Object_keys = typeof Object.keys === \"function\"\n ? Object.keys\n : function (obj) {\n var keys = []\n for (var key in obj) keys.push(key)\n return keys\n }\n var deepEqual = function (actual, expected) {\n if (actual === expected) {\n return true\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime()\n } else if (typeof actual != \"object\" && typeof expected != \"object\") {\n return actual == expected\n } else {\n return objEquiv(actual, expected)\n }\n }\n function isUndefinedOrNull(value) {\n return value === null || value === undefined\n }\n function isArguments(object) {\n return Object.prototype.toString.call(object) == \"[object Arguments]\"\n }\n function objEquiv(a, b) {\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false\n if (a.prototype !== b.prototype) return false\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false\n }\n a = pSlice.call(a)\n b = pSlice.call(b)\n return deepEqual(a, b)\n }\n try {\n var ka = Object_keys(a),\n kb = Object_keys(b),\n key, i\n } catch (e) {\n return false\n }\n if (ka.length != kb.length)\n return false\n ka.sort()\n kb.sort()\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false\n }\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i]\n if (compare) {\n let result = compare(a[key], b[key], key)\n if (result === undefined) {\n // fallback to method without comparison\n result = isEqualWith(a[key], b[key])\n }\n if (!result) {\n return false\n }\n } else {\n if (!deepEqual(a[key], b[key])) return false\n }\n }\n return true\n }\n return deepEqual(a, b)\n}\n\nmodule.exports = {\n get: (obj, path, defaultValue = undefined) => {\n const travel = regexp =>\n String.prototype.split\n .call(path, regexp)\n .filter(Boolean)\n .reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj)\n const result = travel(/[,[\\]]+?/) || travel(/[,[\\].]+?/)\n return result === undefined || result === obj ? defaultValue : result\n },\n pick: (object, keys) => {\n return keys.reduce((obj, key) => {\n // eslint-disable-next-line no-prototype-builtins\n if (object && object.hasOwnProperty(key)) {\n obj[key] = object[key]\n }\n return obj\n }, {})\n },\n forOwn: (object, cb) => {\n for(let key in object){\n // eslint-disable-next-line no-prototype-builtins\n if (object.hasOwnProperty(key)){\n cb(object[key], key)\n }\n }\n },\n isEqualWith,\n intersection: (...arrays) => arrays.reduce((a, b) => a.filter(c => b.includes(c))),\n isObject: object => typeof object === \"object\" && object !== null,\n isString: (str) => (str && typeof str.valueOf() === \"string\") ? true : false,\n union: (a, b) => [...new Set([...a, ...b])],\n unionWith: (a, b, compare) => [...a, ...b].reduce((p, c) => {\n if (p.findIndex(v => compare(v, c)) !== -1) {\n return p\n }\n p.push(c)\n return p\n }, []),\n omitMod: (obj, paths) => {\n for (let path of paths) {\n if (typeof path === \"string\") {\n path = path.split(\".\")\n }\n for (let i = 0; i < path.length - 1; i++) {\n obj = obj[path[i]]\n if (typeof obj === \"undefined\") {\n continue\n }\n }\n delete obj[path.pop()]\n }\n },\n}\n\n/**\n * Sources:\n * - https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore\n * - https://dustinpfister.github.io/2017/09/24/lodash_forown/\n * - https://stackoverflow.com/a/48666737/11050851\n * - https://github.com/stutrek/node-deep-equal/blob/master/index.js (heavily adapted to integrate isEqualWith)\n * - Own Implementation\n */\n", "const mappingTypes = require(\"./mapping-types.json\")\n\n/**\n * JSKOS Concept Types indexed by primary name.\n * @memberof module:jskos-tools\n */\nconst objectTypes = {\n Concept: {\n type: [\"http://www.w3.org/2004/02/skos/core#Concept\"],\n },\n ConceptScheme: {\n type: [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"],\n },\n ConceptMapping: {\n type: mappingTypes.map(type => type.uri),\n },\n ConceptOccurrence: {\n type: [\n \"http://purl.org/cld/cdtype/CatalogueOrIndex\",\n ],\n },\n Registry: {\n type: [\n \"http://www.w3.org/ns/dcat#Catalog\",\n ],\n },\n Distribution: {\n type: [\n \"http://www.w3.org/ns/dcat#Distribution\",\n ],\n },\n Concordance: {\n type: [\n \"http://rdfs.org/ns/void#Linkset\",\n \"http://rdf-vocabulary.ddialliance.org/xkos#Correspondence\",\n ],\n },\n Resource: {},\n Item: {},\n ConceptBundle: {},\n Annotation: {\n type: [\n \"Annotation\",\n \"http://www.w3.org/ns/oa#Annotation\",\n ],\n },\n}\n\n// build lookup table\nconst objectTypeUris = Object.keys(objectTypes).reduce((map, name) => {\n for (let uri of (objectTypes[name].type || [])) {\n map[uri] = name\n }\n return map\n}, {})\n\n/**\n * Guess the JSKOS Concept Type name from an object or name.\n * @memberof module:jskos-tools\n * @param {object|string} jskos|name|uri object or string to guess from\n * @param {boolean} shortname return short name if enabled (false by default)\n */\nfunction guessObjectType(obj, shortname=false) {\n var type\n if (typeof obj === \"string\" && obj) {\n if (obj in objectTypeUris) {\n // given by URI\n type = objectTypeUris[obj]\n } else {\n // given by name\n obj = obj.toLowerCase().replace(/s$/,\"\")\n type = Object.keys(objectTypes).find(name => {\n const lowercase = name.toLowerCase()\n if (lowercase === obj || lowercase === \"concept\" + obj) {\n return true\n }\n })\n }\n } else if (typeof obj === \"object\") {\n if (obj.type) {\n let types = Array.isArray(obj.type) ? obj.type : [obj.type]\n for (let uri of types) {\n if (uri in objectTypeUris) {\n type = objectTypeUris[uri]\n break\n }\n }\n }\n }\n return (shortname && type) ? type.toLowerCase().replace(/^concept(.+)/, \"$1\") : type\n}\n\nmodule.exports = { objectTypes, guessObjectType }\n", "const regexChars = /[\\\\^$.*+?()[\\]{}|]/g\nconst regexEscape = string => string.replace(regexChars, \"\\\\$&\")\n\n// Special characters that uriPattern can be build with\n// Some other special characters such as [ and ] will not work!\nconst notationEscapeChars = /[% ]/\n\n/**\n * A [JSKOS Concept Scheme](http://gbv.github.io/jskos/jskos.html#concept-schemes).\n * @memberof module:jskos-tools\n * @example\n * const { ConceptScheme } = require('jskos-tools')\n * let scheme = new ConceptScheme({\n * namespace: \"http://example.org/\",\n * notationPattern: \"[0-9]+\"\n * })\n */\nclass ConceptScheme {\n\n /**\n * @param {object} [jskos] - object that's copied as scheme (shallow copy)\n */\n constructor (scheme={}) {\n Object.assign(this, scheme)\n\n if (!this.notationPattern) {\n this.notationPattern = \".+\"\n }\n\n if (!this.uriPattern && this.namespace) {\n this.uriPattern = \"^\" + regexEscape(this.namespace)\n const escaped = this.notationPattern.replace(notationEscapeChars, encodeURI)\n this.uriPattern += \"(\" + escaped + \")$\"\n }\n\n this.NOTATION_REGEX = RegExp(\"^\" + this.notationPattern + \"$\")\n\n if (this.uriPattern) {\n this.URI_REGEX = RegExp(this.uriPattern)\n }\n }\n\n /**\n * Check whether a string is a valid notation as defined by `notationPattern`.\n * @param {string} notation\n * @returns {array|null}\n */\n isValidNotation(notation) {\n return this.NOTATION_REGEX.exec(notation)\n }\n\n /**\n * Check whether URI belongs to the scheme, return local notation on success.\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} uri\n * @returns {string|undefined}\n */\n notationFromUri(uri) {\n if (this.URI_REGEX) {\n const match = this.URI_REGEX.exec(uri)\n if (match) {\n return decodeURI(match[1])\n }\n }\n }\n\n /**\n * Map local notation to URI. Does not check whether notation is valid!\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} notation\n * @example scheme.uriFromNotation(\"123\") // http://example.org/123\n */\n uriFromNotation (notation) {\n if (this.uriPattern) {\n notation = encodeURI(notation)\n return this.uriPattern\n .replace(/^\\^|\\$$/g, \"\").replace(/\\\\/g, \"\").replace(/\\(.*\\)/, notation)\n }\n }\n\n /**\n * Check whether URI belongs to the scheme, return concept on success.\n * Requires scheme to have `uriPattern` or `namespace`.\n * @param {string} uri\n * @param {object} [options] boolean flags `inScheme` and `toConcept`\n */\n conceptFromUri (uri, options={}) {\n const notation = this.notationFromUri(uri)\n if (notation === undefined) {\n return\n }\n const concept = { uri, notation: [notation] }\n if (options.inScheme) {\n concept.inScheme = [{uri: this.uri }]\n }\n if (options.topConcept) {\n concept.topConceptOf = [{uri: this.uri }]\n }\n return concept\n }\n\n /**\n * Map local notation to concept, if notation is valid. Requires scheme to\n * have `uriPattern` or `namespace`.\n * @param {string} notation\n * @param {object} [options] same as conceptFromUri options\n */\n conceptFromNotation (notation, options) {\n if (this.isValidNotation(notation)) {\n return this.conceptFromUri(this.uriFromNotation(notation), options)\n }\n }\n}\n\nmodule.exports = ConceptScheme\n", "const _ = require(\"./utils\")\n\nconst languagePreference = {\n store: null,\n path: \"\",\n defaults: [\"en\"],\n getLanguages,\n selectLanguage,\n}\n\n/**\n * Get the preference list either from store or from defaults (fallback)\n */\nfunction getLanguages() {\n return _.get(languagePreference.store, languagePreference.path) || languagePreference.defaults\n}\n\n/**\n * Selects a language tag from a language map or null if no language was found.\n *\n * @param {object} languageMap map to select language tag from\n */\nfunction selectLanguage(languageMap) {\n\n if (!languageMap) {\n return null\n }\n\n for (let language of getLanguages()) {\n if (languageMap[language]) {\n return language\n }\n }\n\n // fallback: iterate through languages and choose the first one\n for (let language of Object.keys(languageMap)) {\n if (language != \"-\") {\n return language\n }\n }\n\n return null\n}\n\nmodule.exports = languagePreference\n", "const _ = require(\"./utils\")\n\n/**\n * Tests if a string only contains uppercase letters.\n * @private\n * @param {string} str\n */\nconst isUpperCase = str => {\n return (/^[A-Z]*$/).test(str)\n}\n\n/**\n * Safely get a nested property.\n * @private\n * @param {*} object the object to access\n * @param {*} path path expression\n */\nconst getNested = (object, path) => {\n return path.split(\".\").reduce(\n (xs, x) => (xs && xs[x]) ? xs[x] : null, object)\n}\n\n/**\n * Add @context URI to a JSKOS resource or to an array of JSKOS resources.\n * @memberof module:jskos-tools\n * @param {object} jskos object or array of objects\n */\nconst addContext = jskos => {\n let array = jskos instanceof Array ? jskos : [jskos]\n array.forEach(resource => {\n resource[\"@context\"] = \"https://gbv.github.io/jskos/context.json\"\n })\n return jskos\n}\n\n/**\n * Recursively cleans JSKOS object by removing properties starting with _ or containing only uppercase letters.\n * Warning: Works directly on the object without creating a copy!\n * @memberof module:jskos-tools\n * @param {object} jskos\n */\nconst clean = jskos => {\n Object.keys(jskos).forEach(key => {\n if (isUpperCase(key) || key.startsWith(\"_\")) {\n delete jskos[key]\n } else {\n if (jskos[key] != null && typeof jskos[key] === \"object\") {\n jskos[key] = clean(jskos[key])\n }\n }\n })\n return jskos\n}\n\n// cleanJSKOS as alias for clean.\nconst cleanJSKOS = clean\n\n/**\n * Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world [null] statements.\n * All properties starting with an underscore (_) will be ignored.\n * @memberof module:jskos-tools\n * @param {object} object\n * @param {array} replaceCircular - additional property names that should be replace with open world [null] statements\n * @param {bool} skipUnderscore - whether to skip properties starting with `_` (default `true`)\n */\nconst copyDeep = (object, replaceCircular = [], skipUnderscore = true) => {\n replaceCircular = replaceCircular.concat([\n \"ancestors\", \"narrower\", \"broader\", \"mappings\", \"memberList\", \"TOPCONCEPTS\", \"MAPPINGS\", \"PROVIDER\",\n ])\n let clone = Array.isArray(object) ? [] : {}\n for(let i in object) {\n // Ignore all properties starting with _\n if (skipUnderscore && i[0] == \"_\") {\n continue\n }\n if (replaceCircular.includes(i)) {\n // Remove circular structures, replace with [null] if it has elements\n if (object[i] && Array.isArray(object[i])) {\n if (object[i].length > 0) {\n clone[i] = [null]\n } else {\n clone[i] = []\n }\n continue\n } else {\n clone[i] = null\n continue\n }\n }\n if (i == \"inScheme\") {\n // Remove circular structur for inScheme and replace with new object consisting only of URI, notation, and prefLabel\n let inScheme = []\n for (let scheme of object.inScheme) {\n let newScheme = { uri: scheme.uri }\n if (scheme.notation) {\n newScheme.notation = scheme.notation\n }\n if (scheme.prefLabel) {\n newScheme.prefLabel = scheme.prefLabel\n }\n inScheme.push(newScheme)\n }\n clone.inScheme = inScheme\n continue\n }\n if (object[i] != null && typeof(object[i]) == \"object\") {\n clone[i] = copyDeep(object[i])\n } else {\n clone[i] = object[i]\n }\n }\n return clone\n}\n\n// deepCopy as alias for copyDeep.\nconst deepCopy = copyDeep\n\n/**\n * Returns all possible URIs for a JSKOS object. Takes into consideration both the uri and identifier properties.\n *\n * @memberof module:jskos-tools\n * @param {object} object\n */\nconst getAllUris = object => {\n if (!object) return []\n return (object.uri ? [object.uri] : []).concat(object.identifier || [])\n}\n\n/**\n * Compares two objects based on their URIs, using getAllUris.\n *\n * @memberof module:jskos-tools\n * @param {object} object1\n * @param {object} object2\n */\nconst compare = (object1, object2) => {\n // Return true if both objects are null.\n if (object1 == null && object2 == null) {\n return true\n }\n // Compare URIs for objects.\n const replaceUri = uri => uri.replace(\"http://\").replace(\"https://\")\n let object1uris = getAllUris(object1).map(replaceUri)\n let object2uris = getAllUris(object2).map(replaceUri)\n if (_.intersection(object1uris, object2uris).length > 0) {\n return true\n } else {\n return false\n }\n}\n\n// compareObjects, compareSchemes and compareConcepts as aliases for compare, for compatibility.\nconst compareObjects = compare\nconst compareSchemes = compare\nconst compareConcepts = compare\n\n/**\n * Checks whether JSKOS object is a concept based on type property.\n * @memberof module:jskos-tools\n */\nconst isConcept = object => {\n return _.get(object, \"type\", []).includes(\"http://www.w3.org/2004/02/skos/core#Concept\") || _.get(object, \"inScheme\") != null || _.get(object, \"topConceptOf\") != null\n}\n\n/**\n * Checks whether JSKOS object is a concept scheme based on type property.\n * @memberof module:jskos-tools\n */\nconst isScheme = object => {\n return _.get(object, \"type\", []).includes(\"http://www.w3.org/2004/02/skos/core#ConceptScheme\")\n}\n\n/**\n * Checks whether an object is contained in a list of objects using compare.\n * @memberof module:jskos-tools\n */\nconst isContainedIn = (object, objects) => {\n if (!object || !objects) {\n return false\n }\n for (let o of objects) {\n if (compare(object, o)) {\n return true\n }\n }\n return false\n}\n\n// isSchemeInList as alias for isContainedIn.\nconst isSchemeInList = isContainedIn\n\n/**\n * Sorts a list of concepts by their notation, then URI.\n *\n * @memberof module:jskos-tools\n * @param {*} concepts\n */\nconst sortConcepts = (concepts, numerical = false) => {\n return concepts.sort(\n (a, b) => {\n let _a = _.get(a, \"notation[0]\"), _b = _.get(b, \"notation[0]\")\n if (_a && _b) {\n _a = _a.toLowerCase()\n _b = _b.toLowerCase()\n }\n if (numerical) {\n _a = parseFloat(_a) || _a\n _b = parseFloat(_b) || _b\n }\n // Fallback to URI\n if (!_a || !_b || _a == _b) {\n _a = a.uri\n _b = b.uri\n }\n if (_a && _b) {\n if (_a > _b) {\n return 1\n } else if (_a < _b) {\n return -1\n }\n }\n return 0\n },\n )\n}\n\n/**\n * Sorts a list of schemes by their prefLabel (German or English), then notation, then URI.\n *\n * @memberof module:jskos-tools\n * @param {*} schemes\n */\nconst sortSchemes = schemes => {\n let order = [\"notation[0]\", [\"prefLabel.de\", \"prefLabel.en\"], \"uri\"]\n return schemes.sort(\n (a, b) => {\n for (let path of order) {\n let _a, _b\n if (Array.isArray(path)) {\n for (let path2 of path) {\n _a = _a || _.get(a, path2)\n _b = _b || _.get(b, path2)\n }\n } else {\n _a = _.get(a, path)\n _b = _.get(b, path)\n }\n if (_a != null && _b != null) {\n _a = _a.toLowerCase()\n _b = _b.toLowerCase()\n if (_a > _b) {\n return 1\n } else if (_a < _b) {\n return -1\n }\n }\n }\n return 0\n },\n )\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst minifyMapping = mapping => {\n let newMapping = _.pick(copyDeep(mapping), [\"from\", \"to\", \"fromScheme\", \"toScheme\", \"creator\", \"contributor\", \"type\", \"created\", \"modified\", \"note\", \"identifier\", \"uri\"])\n for (let fromTo of [newMapping.from, newMapping.to]) {\n _.forOwn(fromTo, (value, key) => {\n let conceptBundle = []\n for (let concept of value) {\n conceptBundle.push(_.pick(concept, [\"uri\", \"notation\"]))\n }\n fromTo[key] = conceptBundle\n })\n }\n if (newMapping.fromScheme) {\n newMapping.fromScheme = _.pick(newMapping.fromScheme, [\"uri\", \"notation\"])\n }\n if (newMapping.toScheme) {\n newMapping.toScheme = _.pick(newMapping.toScheme, [\"uri\", \"notation\"])\n }\n return newMapping\n}\n\n/**\n * @memberof module:jskos-tools\n *\n * Run `bin/localize-mapping-types` to update labels from Wikidata.\n */\nconst mappingTypes = require(\"./mapping-types.json\")\n\n/**\n * @memberof module:jskos-tools\n */\nconst mappingTypeByUri = function(uri) {\n for(let mappingType of mappingTypes) {\n if (uri == mappingType.uri) {\n return mappingType\n }\n }\n return null\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst defaultMappingType = mappingTypeByUri(\"http://www.w3.org/2004/02/skos/core#mappingRelation\")\n\n/**\n * @memberof module:jskos-tools\n */\nconst mappingTypeByType = function(type, defaultType = defaultMappingType) {\n let uri\n if (Array.isArray(type) && type.length > 0) {\n uri = type[0]\n } else {\n // This is a workaround for the type being a string instead of an array.\n uri = type\n }\n return mappingTypeByUri(uri) || defaultType\n}\n\n/**\n * @memberof module:jskos-tools\n */\nconst flattenMapping = (mapping, options = {}) => {\n const { language } = options\n\n let fromNotation = getNested(mapping, \"from.memberSet.0.notation.0\")\n let toNotation = getNested(mapping, \"to.memberSet.0.notation.0\")\n fromNotation = fromNotation !== null ? fromNotation : \"\"\n toNotation = toNotation !== null ? toNotation : \"\"\n let type = mappingTypeByUri(getNested(mapping, \"type.0\"))\n type = type ? type.SHORT : \"\"\n\n let fromLabel = \"\"\n let toLabel = \"\"\n let creator = \"\"\n if (language) {\n fromLabel = getNested(mapping, `from.memberSet.0.prefLabel.${language}`)\n toLabel = getNested(mapping, `to.memberSet.0.prefLabel.${language}`)\n creator = getNested(mapping, `creator.0.prefLabel.${language}`)\n }\n\n return {fromNotation, toNotation, fromLabel, toLabel, type, creator}\n}\n\n/**\n * Returns a function to serialize an array as CSV row as configured.\n * See CSV Dialect (<https://frictionlessdata.io/specs/csv-dialect/>).\n *\n * @memberof module:jskos-tools\n */\nconst csvSerializer = (options = {}) => {\n const delimiter = options.delimiter || \",\"\n const quoteChar = options.quoteChar || \"\\\"\"\n const lineTerminator = options.lineTerminator || \"\\n\"\n const doubleQuote = quoteChar + quoteChar\n const quote = s => quoteChar + (s == null ? \"\" : s.split(quoteChar).join(doubleQuote)) + quoteChar\n\n return row => row.map(quote).join(delimiter) + lineTerminator\n}\n\n/**\n * Returns a list of concepts for a mapping.\n *\n * @memberof module:jskos-tools\n * @param {*} mapping\n * @param {*} side - Either `from` or `to`. Default is both.\n */\nconst conceptsOfMapping = (mapping, side) => {\n let concepts = []\n for (let s of [\"from\", \"to\"]) {\n if (side == null || s === side) {\n concepts = concepts.concat(\n _.get(mapping, `${s}.memberSet`) ||\n _.get(mapping, `${s}.memberChoice`) ||\n _.get(mapping, `${s}.memberList`) ||\n [],\n )\n }\n }\n return concepts.filter(c => c != null)\n}\n\n/**\n * Returns an object of preconfigured conversion functions to convert mappings into CSV.\n *\n * @memberof module:jskos-tools\n * @param {object} options\n *\n * Possible options:\n * - delimiter: delimiter character (default `,`)\n * - quoteChar: quote character (default `\"`)\n * - lineTerminator: line terminator (default `\\n`)\n * - type: whether to include mapping type in output (default true)\n * - schemes: whether to include scheme notations in output (default false)\n * - labels: whether to include concept labels in output (default false)\n * - creator: whether to include mapping creator in output (default false)\n *\n */\nconst mappingCSV = (options = {}) => {\n const toCSV = csvSerializer(options)\n const language = options.language || \"en\"\n if (options.type == null) {\n options.type = true\n }\n\n const header = (mappings) => {\n mappings = mappings || []\n let fields = []\n for (let side of [\"from\", \"to\"]) {\n // Scheme\n if (options.schemes) {\n fields.push(`${side}Scheme`)\n }\n // Minimum count: 1 (for 1-to-1 mappings)\n let conceptCount = Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, side).length), 1)\n for (let i = 0; i < conceptCount; i += 1) {\n // Notation\n fields.push(`${side}Notation${i ? i + 1 : \"\"}`)\n // Label\n if (options.labels) {\n fields.push(`${side}Label${i ? i + 1 : \"\"}`)\n }\n }\n }\n // Type\n if (options.type) {\n fields.push(\"type\")\n }\n // Creator\n if (options.creator) {\n fields.push(\"creator\")\n }\n return toCSV(fields)\n }\n\n /**\n * Converts a single mapping into a CSV line.\n *\n * @param {*} mapping a single mapping\n * @param {*} options2 an options object with properties `fromCount` and `toCount`\n */\n const fromMapping = (mapping, options2 = {}) => {\n let fields = []\n for (let side of [\"from\", \"to\"]) {\n // Scheme\n if (options.schemes) {\n fields.push(_.get(mapping, `${side}Scheme.notation[0]`, \"\"))\n }\n const concepts = conceptsOfMapping(mapping, side)\n let conceptCount = options2[`${side}Count`]\n if (conceptCount == null) {\n conceptCount = concepts.length\n }\n // Minimum count: 1 (for 1-to-1 mappings)\n conceptCount = Math.max(conceptCount, 1)\n for (let i = 0; i < conceptCount; i += 1) {\n // Notation\n fields.push(_.get(concepts[i], \"notation[0]\", \"\"))\n // Label\n if (options.labels) {\n fields.push(_.get(concepts[i], `prefLabel.${language}`, \"\"))\n }\n }\n }\n // Type\n if (options.type) {\n fields.push(_.get(mappingTypeByUri(_.get(mapping, \"type[0]\")), \"SHORT\", \"\"))\n }\n // Creator\n if (options.creator) {\n fields.push(_.get(mapping, `creator[0].prefLabel.${language}`))\n }\n return toCSV(fields)\n }\n\n /**\n * Converts an array of mappings into CSV.\n *\n * @param {*} mapping an array of mappings\n * @param {*} options2 an options object with optional property `header` (default true)\n */\n const fromMappings = (mappings, options2 = { header: true }) => {\n let result = \"\"\n if (options2.header) {\n result += header(mappings)\n }\n const fromMappingOptions = {\n fromCount: Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, \"from\").length)),\n toCount: Math.max(...mappings.map(mapping => conceptsOfMapping(mapping, \"to\").length)),\n }\n for (let mapping of mappings) {\n result += fromMapping(mapping, fromMappingOptions)\n }\n return result\n }\n\n return {\n header,\n fromMapping,\n fromMappings,\n }\n}\n\n/**\n * Compare two mappings based on their properties. Concept sets and schemes are compared by URI.\n *\n * @memberof module:jskos-tools\n */\nfunction compareMappingsDeep(mapping1, mapping2) {\n return _.isEqualWith(mapping1, mapping2, (object1, object2, prop) => {\n let mapping1 = { [prop]: object1 }\n let mapping2 = { [prop]: object2 }\n if (prop == \"from\" || prop == \"to\") {\n if (!_.isEqualWith(Object.getOwnPropertyNames(_.get(object1, prop, {})), Object.getOwnPropertyNames(_.get(object2, prop, {})))) {\n return false\n }\n return _.isEqualWith(conceptsOfMapping(mapping1, prop), conceptsOfMapping(mapping2, prop), (concept1, concept2, index) => {\n if (index != undefined) {\n return compare(concept1, concept2)\n }\n return undefined\n })\n }\n if (prop == \"fromScheme\" || prop == \"toScheme\") {\n return compare(object1, object2)\n }\n // Let lodash's isEqual do the comparison\n return undefined\n })\n}\n\nconst { objectTypes, guessObjectType } = require(\"./object-types\")\n\n/**\n * Checks if two objects have a matching object type. Returns false only if types for both objects could be guessed and they did not match.\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n */\nconst matchObjectTypes = (a, b) => {\n // Guess object types of both objects\n let aType = guessObjectType(a), bType = guessObjectType(b)\n // If both object types could be guessed, throw an error if they don't match\n if (aType && bType && aType != bType) {\n return false\n }\n return true\n}\n\n/**\n * Sorts an array so that `null` values are at the end.\n *\n * @private\n * @param {*} array\n */\nconst _nullSort = (array) => {\n if (Array.isArray(array)) {\n array.sort((a, b) => {\n if (a === null) {\n return 1\n }\n if (b === null) {\n return -1\n }\n return 0\n })\n }\n}\n\n/**\n * Merge URIs of two objects `a` and `b` into `a` by adding/removing URIs from identifier property.\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n */\nconst mergeUris = (a, b) => {\n if (!a || !b) {\n return a\n }\n // Merge identifier array\n if (Array.isArray(a.identifier) || Array.isArray(b.identifier)) {\n a.identifier = _.union(a.identifier || [], b.identifier || [])\n }\n // Add URI to a if necessary\n if (!a.uri && b.uri) {\n a.uri = b.uri\n }\n // Add b's URI to a's identifier if necessary\n if (a.uri && b.uri && a.uri != b.uri && !(a.identifier || []).includes(b.uri)) {\n a.identifier = (a.identifier || []).concat([b.uri])\n }\n // Remove a's URI from identifier if necessary\n if (Array.isArray(a.identifier) && a.uri) {\n a.identifier = a.identifier.filter(uri => uri !== a.uri)\n }\n // Remove identifier property if empty\n if ((a.identifier || []).length == 0) {\n delete a.identifier\n }\n // Sort null values to end\n _nullSort(a.identifier)\n return a\n}\n\n/**\n * Merges two JSKOS objects. Object properties will be merged deeply. Array properties will be combined (and URIs will be used for comparison if it's an array of objects).\n *\n * The `options` property allows for different options:\n * - `mergeUris` (boolean, default `false`) - appends b's URI to the result's `identifier` property if necessary, removes a's URI from the result's `identifier` property if necessary (useful for merging ConceptSchemes)\n * - `detectMismatch` (array of strings, default `[]`) - throws an error if the value at a certain path does not match between the two objects (allows for deep properties, e.g. `prefLabel.de`)\n * - `skipPaths` (array of strings, default `[]`) - provide paths to completely skip when merging\n *\n * @memberof module:jskos-tools\n * @param {object} a\n * @param {object} b\n * @param {object} options - optional, see above\n */\nconst merge = (a, b, options) => {\n if (!a || !b) {\n return a ? a : b\n }\n options = options || {}\n // Path is used for deep detectMismatch checks\n let path = options._path || \"\"\n // Throw an error if two simple properties do not match between the objects\n let detectMismatch = options.detectMismatch || []\n let skipPaths = options.skipPaths || []\n let result = {}\n // Merge properties that are in both objects\n _.forOwn(a, (value, key) => {\n // Skip path if necessary\n if (skipPaths.includes(path + key)) {\n return\n }\n if (Array.isArray(value) && Array.isArray(b[key])) {\n // Merge array properties\n result[key] = _.unionWith(value, b[key], (first, second) => {\n if (_.isObject(first) && _.isObject(second)) {\n return compare(first, second)\n }\n return first === second\n })\n // Sort null values to the end while keeping the rest of the order the same\n _nullSort(result[key])\n } else if (_.isObject(value) && _.isObject(b[key])) {\n // Merge object properties\n result[key] = merge(value, b[key], Object.assign({ _path: `${path}${key}.` }, options))\n } else {\n if (value && b[key] && detectMismatch.includes(path + key) && !_.isEqualWith(value, b[key])) {\n throw new Error(\"Property mismatch in \" + path + key)\n }\n result[key] = value\n }\n })\n // Add properties that are only in b\n _.forOwn(b, (value, key) => {\n if (!a[key]) {\n result[key] = value\n }\n })\n // Remove paths if necessary\n if (path == \"\") {\n _.omitMod(result, skipPaths)\n }\n // Merge URIs if necessary\n if (options.mergeUris) {\n mergeUris(result, b)\n }\n return result\n}\n\n/**\n * Applies recursive unicode normalization to data.\n *\n * - If data is an array, it will recursively normalize all elements of that array.\n * - If data is an object, it will recursively normalize all property values of that object.\n * - If data is a string, it will apply unicode normalization to that string.\n * - If data is of any other type, it will be returned as is.\n *\n * @param {*} data\n */\nconst normalize = data => {\n if (Array.isArray(data)) {\n return data.map(element => normalize(element))\n } else if (_.isObject(data)) {\n _.forOwn(data, (value, key) => {\n data[key] = normalize(value)\n })\n return data\n } else {\n if (_.isString(data)) {\n return data.normalize()\n } else {\n return data\n }\n }\n}\n\n/**\n * Checks whether a string is a valid URI.\n *\n * @param {string} uri URI to be tested\n */\nlet isValidUri = (uri) => {\n // from: http://jmrware.com/articles/2009/uri_regexp/URI_regex.html\n var re_js_rfc3986_URI = /^[A-Za-z][A-Za-z0-9+\\-.]*:(?:\\/\\/(?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})*@)?(?:\\[(?:(?:(?:(?:[0-9A-Fa-f]{1,4}:){6}|::(?:[0-9A-Fa-f]{1,4}:){5}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::)(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)|[Vv][0-9A-Fa-f]+\\.[A-Za-z0-9\\-._~!$&'()*+,;=:]+)\\]|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[A-Za-z0-9\\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*)(?::[0-9]*)?(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|\\/(?:(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*)?|(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})*)*|)(?:\\?(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?(?:#(?:[A-Za-z0-9\\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})*)?$/\n return uri.match(re_js_rfc3986_URI) !== null\n}\n\n/**\n * An object of compare functions (can be used by array.sort for example).\n *\n * TODO: Add more functions.\n */\nlet compareFunctions = {\n /**\n * Compare mappings by their first concept.\n *\n * @param {*} mapping1 - first mapping\n * @param {*} mapping2 - second mapping\n * @param {*} fromTo - side, either `from` or `to`\n */\n mappingsByConcepts: (mapping1, mapping2, fromTo) => {\n let bundleFields = [\"memberSet\", \"memberList\", \"memberChoice\"], notation1, notation2\n for (let field of bundleFields) {\n notation1 = notation1 || _.get(mapping1, fromTo + \".\" + field + \"[0].notation[0]\")\n notation2 = notation2 || _.get(mapping2, fromTo + \".\" + field + \"[0].notation[0]\")\n }\n if (notation1 == null || notation1 < notation2) {\n return -1\n }\n if (notation2 == null || notation1 > notation2) {\n return 1\n }\n return 0\n },\n}\n\n/**\n * Returns `true` if the user owns the mapping (i.e. is first creator), `false` if not.\n *\n * @param {*} user a login-server compatible user object\n * @param {*} mapping a JSKOS mapping\n */\nconst userOwnsMapping = (user, mapping) => {\n if (!user || !mapping) {\n return false\n }\n return [user.uri].concat(Object.values(user.identities || {}).map(identity => identity.uri)).filter(uri => uri != null).includes(_.get(mapping, \"creator[0].uri\"))\n}\n\nconst ConceptScheme = require(\"./concept-scheme\")\nconst languagePreference = require(\"./language-preference\")\n\n/**\n * Returns the primary notation for a JSKOS Item. If there is no notation, it will return an empty string.\n * Scheme notations will be uppercased.\n *\n * @param {object} item a JSKOS Item\n * @param {string} type type of item (optional)\n */\nfunction notation(item, type) {\n let notation\n if (item && item.notation && item.notation.length) {\n notation = item.notation[0]\n if (isScheme(item) || type == \"scheme\") {\n notation = notation.toUpperCase()\n }\n } else if (item && item.inScheme && item.inScheme[0] && item.uri) {\n // Try to imply notation from scheme and concept URI\n try {\n const scheme = new ConceptScheme(item && item.inScheme && item.inScheme[0])\n notation = scheme.notationFromUri(item.uri)\n } catch (error) {\n // Ignore error\n }\n }\n return notation || \"\"\n}\n\n/**\n * Returns the content of a language map for a JSKOS Item.\n *\n * @param {*} item a JSKOS Item\n * @param {string} prop property of interest in the item\n * @param {object} options options object:\n * - `language`: preferred language\n */\nfunction languageMapContent(item, prop, { language } = {}) {\n let languageMap = (item && prop) ? item[prop] : item\n if (languageMap) {\n if (languageMap[language]) {\n return languageMap[language]\n }\n language = languagePreference.selectLanguage(languageMap)\n if (language) {\n return languageMap[language]\n }\n }\n return null\n}\n\n/**\n * Returns the prefLabel of a JSKOS Item. If there is no label, it will return the URI. If there is no URI, it will return an empty string.\n *\n * @param {*} item\n * @param {object} options options object:\n * - `fallbackToUri`: return URI if no prefLabel can be found (default: true)\n * - `language`: preferred language\n */\nfunction prefLabel(item, options = {}) {\n options = options || {}\n const fallbackToUri = options.fallbackToUri == null ? true : options.fallbackToUri\n return _.get(item, `prefLabel.${options.language}`)\n || languageMapContent(item, \"prefLabel\", options)\n || ((fallbackToUri && item && item.uri) ? item.uri : \"\")\n}\n\n/**\n * Returns the definition of a JSKOS Item as an array. If there is no definition, an empty array will be returned.\n *\n * @param {*} item\n * @param {object} options options object:\n * - `language`: preferred language\n */\nfunction definition(item, options = {}) {\n options = options || {}\n let content = _.get(item, `definition.${options.language}`)\n || languageMapContent(item, \"definition\", options)\n || []\n // Make sure an array is returned\n if (_.isString(content)) {\n content = [content]\n }\n return content\n}\n\n/**\n * Returns whether a mapping registry has stored mappings (`true` = database) or not (`false` = recommendations).\n *\n * @param {object} registry JSKOS registry\n */\nfunction mappingRegistryIsStored(registry) {\n return _.get(registry, \"stored\", _.get(registry, \"constructor.stored\", _.get(registry, \"provider.constructor.stored\", false)))\n}\n\n/**\n * Returns the creator URI for an annotation.\n *\n * @param {object} annotation a JSKOS annotation\n */\nfunction annotationCreatorUri(annotation) {\n if (_.isString(annotation.creator)) {\n return annotation.creator\n }\n return annotation.creator && annotation.creator.id\n}\n\n/**\n * Returns the craetor name for an annotation.\n *\n * @param {object} annotation a JSKOS annotation\n */\nfunction annotationCreatorName(annotation) {\n return _.get(annotation, \"creator.name\") || \"\"\n}\n\n/**\n * Matches an annotation's creator URI against a list of URIs (e.g. from a user).\n *\n * @param {object} annotation a JSKOS annotation\n * @param {array} uris array of user URIs\n */\nfunction annotationCreatorMatches(annotation, uris) {\n return !!(annotation && _.isString(annotation.creator) ? uris && uris.includes(annotation.creator) : uris && annotation.creator && uris.includes(annotation.creator.id))\n}\n\n\nmodule.exports = {\n addContext, clean, cleanJSKOS, copyDeep, deepCopy, getAllUris, compare,compareObjects, compareSchemes, compareConcepts, isConcept, isScheme, isContainedIn, isSchemeInList, sortConcepts, sortSchemes, minifyMapping, mappingTypes, mappingTypeByUri, mappingTypeByType, flattenMapping, mappingCSV, defaultMappingType, conceptsOfMapping, compareMappingsDeep, objectTypes, guessObjectType, matchObjectTypes, mergeUris, merge, normalize, isValidUri, compareFunctions, userOwnsMapping, notation, languageMapContent, prefLabel, definition, mappingRegistryIsStored, annotationCreatorUri, annotationCreatorName, annotationCreatorMatches,\n}\n", "/**\n * JSKOS Tools.\n * @module jskos-tools\n */\n\nconst identifiers = require(\"./lib/identifiers\")\nconst tools = require(\"./lib/tools\")\nconst ConceptScheme = require(\"./lib/concept-scheme\")\nconst languagePreference = require(\"./lib/language-preference\")\n\nmodule.exports = Object.assign({ ConceptScheme, languagePreference }, identifiers, tools)\n", "/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n if (Mutation) {\n var called = 0;\n var observer = new Mutation(nextTick);\n var element = global.document.createTextNode('');\n observer.observe(element, {\n characterData: true\n });\n scheduleDrain = function () {\n element.data = (called = ++called % 2);\n };\n } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n var channel = new global.MessageChannel();\n channel.port1.onmessage = nextTick;\n scheduleDrain = function () {\n channel.port2.postMessage(0);\n };\n } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n scheduleDrain = function () {\n\n // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n", "/**\n * @module cocoda-sdk\n */\n\nimport CocodaSDK from \"./lib/CocodaSDK.js\"\nimport * as errors from \"./errors/index.js\"\nexport * from \"./providers/index.js\"\n\n// Create and export a default instance\nconst cdk = new CocodaSDK()\n\nexport {\n /**\n * Default CocodaSDK instance\n *\n * @type {CocodaSDK}\n */\n cdk,\n /**\n * CocodaSDK class (to create new instances or checks with `instanceof`)\n */\n CocodaSDK,\n /**\n * Object of error classes\n *\n * @type {Object}\n */\n errors,\n}\n\nimport * as providers from \"./providers/index.js\"\n/**\n * Adds all available providers to a CocodaSDK instance.\n *\n * @param {CocodaSDK} [_cdk] CocodaSDK instance to which to add the providers (defaults to default instance)\n */\nexport function addAllProviders(_cdk) {\n Object.values(providers).forEach(provider => (_cdk || cdk).addProvider(provider))\n}\n", "/**\n * CDKError superexport class.\n *\n * @category Errors\n */\nexport class CDKError extends Error {\n\n /**\n * CDKError constructor.\n *\n * @param {Object} options\n * @param {string} [options.message=\"\"] message for the error\n * @param {Error} [options.relatedError=null] related error\n * @param {number} [options.code] HTTP status code for the error\n */\n constructor({ message = \"\", relatedError = null, code = null } = {}) {\n if (!message && relatedError && relatedError.message) {\n message = relatedError.message\n }\n super(message)\n this.name = this.constructor.name\n this.relatedError = relatedError\n this.code = code\n }\n}\n\n/**\n * MethodNotImplementedError is thrown when the called method is valid, but not implemented for the current provider.\n *\n * @category Errors\n */\nexport class MethodNotImplementedError extends CDKError {\n\n /**\n * MethodNotImplementedError constructor.\n *\n * @param {Object} config\n * @param {string} config.method method that this error refers to\n * @param {string} [config.message=\"\"] message for the error\n */\n constructor({ method, message = \"\", ...options }) {\n options.message = `Method not implemented: ${method} (${message})`\n super(options)\n }\n}\n\n/**\n * InvalidOrMissingParameterError is thrown when a parameter is missing or is not valid for the request.\n *\n * @category Errors\n */\nexport class InvalidOrMissingParameterError extends CDKError {\n\n /**\n * InvalidOrMissingParameterError constructor.\n *\n * @param {Object} config\n * @param {string} config.parameter parameter that this error refers to\n * @param {string} [config.message=\"\"] message for the error\n */\n constructor({ parameter, message = \"\", ...options }) {\n options.message = `Invalid or missing parameter: ${parameter} (${message})`\n super(options)\n }\n}\n\n/**\n * InvalidRequestError is thrown when the server responded with a 4xx error (i.e. it's a problem on the client side).\n *\n * @category Errors\n */\nexport class InvalidRequestError extends CDKError { }\n\n/**\n * BackendError is thrown when the server responded with a 5xx error (i.e. it's a problem on the server side).\n *\n * @category Errors\n */\nexport class BackendError extends CDKError { }\n\n/**\n * BackendUnavailableError is thrown when the server did not respond, but the client's internet connection seems to be working.\n *\n * @category Errors\n */\nexport class BackendUnavailableError extends CDKError { }\n\n/**\n * NetworkError is thrown when the request could not be performend (e.g. the network was not available).\n *\n * @category Errors\n */\nexport class NetworkError extends CDKError { }\n\n/**\n * MissingApiUrlError is thrown when the called method is valid, but the required API URL is not available for the current registry.\n *\n * @category Errors\n */\nexport class MissingApiUrlError extends CDKError { }\n\n/**\n * InvalidProviderError is thrown when a provider is added to the provider list that does not inherit from BaseProvider.\n *\n * @category Errors\n */\nexport class InvalidProviderError extends CDKError { }\n", "import * as errors from \"../errors/index.js\"\nimport axios from \"axios\"\nimport * as _ from \"../utils/lodash.js\"\nimport jskos from \"jskos-tools\"\n\nimport { BaseProvider, ConceptApiProvider, MappingsApiProvider } from \"../providers/index.js\"\n\n// Registered providers\nconst providers = {\n [BaseProvider.providerName]: BaseProvider,\n init(registry) {\n if (this[registry.provider]) {\n return new this[registry.provider](registry)\n }\n throw new errors.InvalidProviderError()\n },\n addProvider(provider) {\n if (provider.prototype instanceof BaseProvider || provider === BaseProvider) {\n this[provider.providerName] = provider\n } else {\n throw new errors.InvalidProviderError()\n }\n },\n}\n// Only ConceptApi and MappingsApi are available by default\nproviders.addProvider(ConceptApiProvider)\nproviders.addProvider(MappingsApiProvider)\n\n// For the browser build, add all providers by default\nimport * as allProviders from \"../providers/index.js\"\nObject.values(allProviders).forEach(provider => {\n providers.addProvider(provider)\n})\n\n// Registry cache used by registryForScheme\nconst registryCache = {}\n\n/**\n * CocodaSDK class\n */\nexport default class CocodaSDK {\n\n /**\n * CDK constructor.\n *\n * @param {Object} [config={}] Cocoda-stye config object\n */\n constructor(config) {\n this.config = config\n this.axios = axios.create()\n }\n\n /**\n * Method to set the configuration.\n *\n * @param {Object} config Cocoda-stye config object\n */\n setConfig(config) {\n this.config = config\n }\n\n /**\n * Current configuration.\n *\n * @returns {Object} current configuration\n */\n get config() {\n return this._config\n }\n\n /**\n * Prepares config when set.\n *\n * @param {Object} config Cocoda config object\n * @private\n */\n set config(config) {\n config = config || {}\n // Preparations for config\n // 1. Make sure config.registries exists\n config.registries = config.registries || []\n // 2. Initialize registries\n config.registries = config.registries.map(registry => providers.init(registry)).filter(r => r)\n // 3. Set cdk property for all registries\n config.registries.forEach(registry => {\n registry.cdk = this\n })\n this._config = config\n }\n\n /**\n * Map of registered providers.\n *\n * @returns {Object} map of registered providers (name -> provider)\n */\n get providers() {\n return providers\n }\n\n /**\n * Creates a new CDK instance (same as `new CocodaSDK(config)`).\n *\n * @param {Object} config Cocoda config object\n * @returns {CocodaSDK} new CDK instance\n */\n createInstance(config) {\n return new CocodaSDK(config)\n }\n\n /**\n * Offer method to load a config file from URL.\n *\n * @param {string} url URL of config as JSON\n */\n async loadConfig(url) {\n const response = await this.axios.get(url)\n this.config = response.data\n }\n\n /**\n * Method to load buildInfo.\n *\n * Callback will only be called if buildInfo changes; it will not be called when there is no previous value.\n *\n * @param {Object} config\n * @param {string} [config.url] full URL for build-info.json (default is taken from config.cocodaBaseUrl)\n * @param {Object} [config.buildInfo] current buildInfo\n * @param {number} [config.interval=60000] interval to load buildInfo in ms\n * @param {Function} config.callback callback function called with two parameters (error, buildInfo, previousBuildInfo)\n * @returns {Object} object with two function properties, `stop` to cancel the repeating request, `start` to restart the repeating request, as well as three convenience properties, `isPaused` (whether it is currently paused), `lastResult`, `hasErrored` (whether the last call of the function has errored)\n */\n loadBuildInfo({ url, buildInfo = null, interval = 60000, callback, ...config }) {\n if (!url && !this.config.cocodaBaseUrl) {\n throw new errors.CDKError({ message: \"Could not determine URL to load build config.\" })\n }\n if (!url) {\n url = `${this.config.cocodaBaseUrl}build-info.json`\n }\n return this.repeat({\n ...config,\n function: async () => {\n return (await this.axios.get(url, {\n headers: {\n \"Cache-Control\": \"no-cache\",\n },\n })).data\n },\n interval,\n callback: (error, result, previousResult) => {\n if (error) {\n callback(error)\n } else if (previousResult || (!previousResult && buildInfo && !_.isEqual(result, buildInfo))) {\n callback(null, result, previousResult || buildInfo)\n }\n },\n })\n }\n\n /**\n * Method to get a registry by URI.\n *\n * @param {string} uri URI of registry in config\n * @returns {?Object} initialized registry from config if found\n */\n getRegistryForUri(uri) {\n return this.config.registries.find(r => r.uri == uri)\n }\n\n /**\n * Method to initialize registry.\n *\n * @param {Object} registry JSKOS registry object\n * @returns {Object} initialized registry\n */\n initializeRegistry(registry) {\n registry = providers.init(registry)\n registry.cdk = this\n return registry\n }\n\n /**\n * Method to add custom provider.\n *\n * @param {Object} provider provider class that extends BaseProvider\n */\n addProvider(provider) {\n providers.addProvider(provider)\n }\n\n /**\n * Static method to add custom provider.\n *\n * @param {Object} provider provider class that extends BaseProvider\n */\n static addProvider(provider) {\n providers.addProvider(provider)\n }\n\n /**\n * Repeatedly call a certain function.\n *\n * Notes:\n * - Callback will only be called if the results were changed.\n * - The function will only be repeated after the previous call is resolved. This means that the total interval duration is (interval + duration of function call).\n *\n * Example:\n * ```js\n * cdk.repeat({\n * function: () => registry.getMappings(),\n * callback: (error, result) => console.log(result),\n * })\n * ```\n *\n * @param {Object} config\n * @param {string} config.function a function to be called (can be async)\n * @param {number} [config.interval=15000] interval in ms\n * @param {Function} config.callback callback function called with two parameters (error, result, previousResult)\n * @param {boolean} [config.callImmediately=true] whether to call the function immediately\n * @returns {Object} object with two function properties, `stop` to cancel the repeating request, `start` to restart the repeating request, as well as three convenience properties, `isPaused` (whether it is currently paused), `lastResult`, `hasErrored` (whether the last call of the function has errored)\n */\n repeat({ function: func, interval = 15000, callback, callImmediately = true } = {}) {\n // Check parameters\n // ? Are these thorough checks really necessary?\n if (!func) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"function\" })\n }\n if (typeof func != \"function\") {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"function\", message: \"function needs to be a function\" })\n }\n // Wrap function so that it will definitely be async\n const asyncFunc = async () => func()\n interval = parseInt(interval)\n if (isNaN(interval)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"interval\" })\n }\n if (!callback) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"callback\" })\n }\n if (typeof callback != \"function\") {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"callback\", message: \"callback needs to be a function\" })\n }\n // Prepare repeat cache\n let repeat = {\n timer: null,\n result: null,\n error: null,\n isPaused: false,\n }\n // Functions to handle results and errors\n const handleResult = (result) => {\n const previousResult = repeat.result\n if (!_.isEqual(previousResult, result)) {\n repeat.result = result\n repeat.error = null\n callback(null, result, previousResult)\n }\n }\n const handleError = (error) => {\n repeat.error = error\n callback(error)\n }\n // Method to call a method after timeout if necessary\n const repeatIfNecessary = toCall => {\n if (repeat.isPaused) {\n return\n }\n repeat.timer = setTimeout(() => {\n toCall()\n }, interval)\n }\n // Method to call the function, handle result/error, and repeat if necessary\n const call = () => asyncFunc().then(handleResult).catch(handleError).then(() => repeatIfNecessary(call))\n // Method to set up the repeating call (skip initial call if necessary)\n const setup = (_callImmediately = callImmediately) => {\n if (_callImmediately) {\n call()\n } else {\n repeatIfNecessary(call)\n }\n }\n // Set up\n setup()\n // Return object with methods to start/stop the interval and an indicator whether it is paused\n return {\n start: (...params) => {\n repeat.isPaused = false\n setup(...params)\n },\n stop: () => {\n repeat.isPaused = true\n // If timer is available, clear immediately, if not, wait for one interval\n if (repeat.timer) {\n clearTimeout(repeat.timer)\n } else {\n setTimeout(() => {\n repeat.timer && clearTimeout(repeat.timer)\n }, interval)\n }\n },\n get isPaused() {\n return repeat.isPaused\n },\n get lastResult() {\n return repeat.result\n },\n get hasErrored() {\n return !!repeat.error\n },\n }\n }\n\n /**\n * Gets schemes from all registries that support schemes and merges the results.\n *\n * @param {Object} [config={}] configuration object that will be used as a parameter for internal `getSchemes` calls\n * @returns {Object[]} array of JSKOS schemes\n */\n async getSchemes(config = {}) {\n let schemes = [], promises = []\n\n for (let registry of this.config.registries) {\n if (registry.has.schemes !== false) {\n let promise = registry.getSchemes(config).then(results => {\n for (let scheme of results) {\n // Deal with registry\n const currentSchemeRegistry = scheme._registry\n // Add scheme specific custom properties\n scheme.__DETAILSLOADED__ = 1\n scheme.type = scheme.type || [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"]\n // Check if scheme is already loaded\n let otherScheme = schemes.find(s => jskos.compare(s, scheme)), prio, otherPrio, override = false\n if (otherScheme) {\n // Set priorities as index of registry array\n prio = this.config.registries.indexOf(registry)\n if (prio != -1) {\n prio = this.config.registries.length - prio\n }\n otherPrio = this.config.registries.indexOf(_.get(otherScheme, \"_registry\"))\n if (otherPrio != -1) {\n otherPrio = this.config.registries.length - otherPrio\n }\n let currentHasConcepts = !scheme.concepts ? 0 : (scheme.concepts.length == 0 ? -1 : 1)\n let otherHasConcepts = !otherScheme.concepts ? 0 : (otherScheme.concepts.length == 0 ? -1 : 1)\n // Use existence of concepts first, priority second\n if (currentHasConcepts > otherHasConcepts) {\n override = true\n } else if (currentHasConcepts < otherHasConcepts) {\n override = false\n } else {\n override = otherPrio < prio\n }\n }\n if (!otherScheme || override) {\n if (override) {\n // Find and remove scheme from schemes array\n let otherSchemeIndex = schemes.findIndex(s => jskos.compare(s, otherScheme))\n if (otherSchemeIndex != -1) {\n schemes.splice(otherSchemeIndex, 1)\n }\n // Integrate details from existing scheme\n scheme = jskos.merge(scheme, _.omit(otherScheme, [\"concepts\", \"topConcepts\"]), { mergeUris: true, skipPaths: [\"_registry\"] })\n }\n scheme._registry = currentSchemeRegistry\n // Save scheme in objects and push into schemes array\n schemes.push(scheme)\n } else {\n // Integrate details into existing scheme\n const index = schemes.findIndex(s => jskos.compare(s, scheme))\n if (index != -1) {\n const otherSchemeRegistry = schemes[index]._registry\n schemes[index] = jskos.merge(schemes[index], _.omit(scheme, [\"concepts\", \"topConcepts\"]), { mergeUris: true, skipPaths: [\"_registry\"] })\n schemes[index]._registry = otherSchemeRegistry\n }\n }\n }\n }).catch(error => {\n // TODO\n console.warn(\"Couldn't load schemes for registry\", registry.uri, error)\n })\n promises.push(promise)\n }\n }\n\n await Promise.all(promises)\n return jskos.sortSchemes(schemes.filter(Boolean))\n }\n\n registryForScheme(scheme) {\n let registry = scheme._registry\n if (registry) {\n return registry\n }\n\n for (let { type, ...config } of scheme.API || []) {\n const url = config.url\n\n if (registryCache[url]) {\n // Registry in cache is used\n const registry = registryCache[url]\n // Check if scheme is part of registry already; if not, add it\n if (Array.isArray(registry._jskos.schemes) && !jskos.isContainedIn(scheme, registry._jskos.schemes)) {\n registry._jskos.schemes.push(scheme)\n }\n return registry\n } else {\n // Registry will be initialized\n const provider = Object.values(providers).find(p => p.providerType === type)\n if (!provider || !provider._registryConfigForBartocApiConfig) {\n continue\n }\n const providerName = provider.providerName\n // Some providers need access to the scheme\n config.scheme = scheme\n config = providers[providerName]._registryConfigForBartocApiConfig(config)\n if (!config) {\n continue\n }\n config.provider = providerName\n\n try {\n registry = this.initializeRegistry(config)\n if (registry) {\n registryCache[url] = registry\n return registry\n }\n } catch (error) {\n continue\n }\n }\n }\n return null\n }\n\n}\n", "// Exports a subset of lodash methods\nimport get from \"lodash/get.js\"\nimport set from \"lodash/set.js\"\nimport uniq from \"lodash/uniq.js\"\nimport intersection from \"lodash/intersection.js\"\nimport union from \"lodash/union.js\"\nimport forOwn from \"lodash/forOwn.js\"\nimport isArray from \"lodash/isArray.js\"\nimport isObject from \"lodash/isObject.js\"\nimport isString from \"lodash/isString.js\"\nimport isEmpty from \"lodash/isEmpty.js\"\nimport isEqual from \"lodash/isEqual.js\"\nimport merge from \"lodash/merge.js\"\nimport last from \"lodash/last.js\"\nimport omit from \"lodash/omit.js\"\nimport concat from \"lodash/concat.js\"\n\nexport {\n get,\n set,\n uniq,\n intersection,\n union,\n forOwn,\n isArray,\n isObject,\n isString,\n isEmpty,\n isEqual,\n merge,\n last,\n omit,\n concat,\n}\n", "import BaseProvider from \"./base-provider.js\"\nimport LocalMappingsProvider from \"./local-mappings-provider.js\"\nimport MappingsApiProvider from \"./mappings-api-provider.js\"\nimport OccurrencesApiProvider from \"./occurrences-api-provider.js\"\nimport ConceptApiProvider from \"./concept-api-provider.js\"\nimport ReconciliationApiProvider from \"./reconciliation-api-provider.js\"\nimport LabelSearchSuggestionProvider from \"./label-search-suggestion-provider.js\"\nimport SkosmosApiProvider from \"./skosmos-api-provider.js\"\nimport LocApiProvider from \"./loc-api-provider.js\"\n\nexport {\n BaseProvider,\n LocalMappingsProvider,\n MappingsApiProvider,\n OccurrencesApiProvider,\n ConceptApiProvider,\n ReconciliationApiProvider,\n LabelSearchSuggestionProvider,\n SkosmosApiProvider,\n LocApiProvider,\n}\n", "import jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport axios from \"axios\"\nimport * as utils from \"../utils/index.js\"\nimport * as errors from \"../errors/index.js\"\n\n/**\n * BaseProvider to be subclassed to implement specific providers. Do not initialize a registry directly with this!\n *\n * Prefix all internal method and properties with underscore (e.g. `this._cache`)!\n *\n * Methods that can be overridden:\n * - Do not override the constructor! Use _prepare or _setup instead.\n * - _prepare: will be called before the registry is initialized (i.e. it's `/status` endpoint is queries if necessasry)\n * - _setup: will be called after registry is initialized (i.e. it's `/status` endpoint is queries if necessasry), should be used to set properties on this.has and custom preparations\n * - isAuthorizedFor: override if you want to customize\n * - supportsScheme: override if you want to customize\n * - getRegistries\n * - getSchemes\n * - getTypes\n * - suggest\n * - getConcordances\n * - getOccurrences\n * - getTop\n * - getConcepts\n * - getNarrower\n * - getAncestors\n * - search\n * - getMapping\n * - getMappings\n * - postMapping\n * - postMappings\n * - putMapping\n * - patchMapping\n * - deleteMapping\n * - deleteMappings\n * - getAnnotations\n * - postAnnotation\n * - putAnnotation\n * - patchAnnotation\n * - deleteAnnotation\n *\n * Internal (starting with underscore) and external properties that can be used:\n * - `this.cdk`: a reference to the current CDK instance (can be use to request other registries or initialize a new registry)\n * - `this.has`: an object of functionality of the registry (needs to be set by subclasses)\n * - `this.languages`: an array of language tags provided by the user in order of priority\n * - `this._jskos`: the raw JSKOS object used to initialize this registry\n * - `this._path`: if available, the path of the current browser window\n * - `this._defaultLanguages`: an array of default language tags\n * - `this._auth`: authentication key and token\n * - `this._api`: object of API endpoints for the registry\n * - `this._config`: configuration of the registry as provided by the `/status` endpoint if available\n *\n * All of the request methods take ONE parameter which is a config object. Actual parameters should be properties on this object. The config object should be destructured to remove the properties your method needs, and the remaining config object should be given to the axios request.\n * Example:\n * ```js\n * getConcept({ concept, ...config }) {\n * return this.axios({\n * ...config,\n * method: \"get\",\n * params: {\n * uri: concept.uri,\n * },\n * })\n * }\n * ```\n *\n * Always use `this.axios` like in the example for http requests!\n *\n * @category Providers\n */\nexport default class BaseProvider {\n\n /**\n * Provider constructor.\n *\n * @param {Object} registry the registry for this provider\n */\n constructor(registry = {}) {\n this._jskos = registry\n\n this.axios = axios.create({\n // TODO: Decide on timeout value\n timeout: 20000,\n })\n // Path is used for https check and local mappings\n this._path = typeof window !== \"undefined\" && window.location.pathname\n /**\n * A dictionary with functionality of the registry (e.g. `registry.has.schemes`).\n * @type {Object}\n * @readonly\n */\n this.has = {}\n // Set default language priority list\n this._defaultLanguages = \"en,de,fr,es,nl,it,fi,pl,ru,cs,jp\".split(\",\")\n /**\n * A list of RFC 3066 language tags in lowercase in order of priority.\n * @type {string[]}\n */\n this.languages = []\n // Set auth details to null\n this._auth = {\n key: null,\n bearerToken: null,\n }\n // Set repeating requests array\n this._repeating = []\n\n // Set API URLs from registry object\n this._api = {\n status: registry.status,\n // If `schemes` on registry is an array, remove it because we're only keeping it in this._jskos.schemes\n schemes: Array.isArray(registry.schemes) ? undefined : registry.schemes,\n top: registry.top,\n data: registry.data,\n concepts: registry.concepts,\n narrower: registry.narrower,\n ancestors: registry.ancestors,\n types: registry.types,\n suggest: registry.suggest,\n search: registry.search,\n \"voc-suggest\": registry[\"voc-suggest\"],\n \"voc-search\": registry[\"voc-search\"],\n mappings: registry.mappings,\n concordances: registry.concordances,\n annotations: registry.annotations,\n occurrences: registry.occurrences,\n reconcile: registry.reconcile,\n api: registry.api,\n }\n this._config = {}\n\n // Set default retry config\n this.setRetryConfig()\n\n // Add a request interceptor\n this.axios.interceptors.request.use((config) => {\n // Add language parameter to request\n const language = _.uniq([].concat(_.get(config, \"params.language\", \"\").split(\",\"), this.languages, this._defaultLanguages).filter(lang => lang != \"\")).join(\",\")\n _.set(config, \"params.language\", language)\n // Set auth\n if (this.has.auth && this._auth.bearerToken && !_.get(config, \"headers.Authorization\")) {\n _.set(config, \"headers.Authorization\", `Bearer ${this._auth.bearerToken}`)\n }\n\n // Don't perform http requests if site is used via https\n if (config.url.startsWith(\"http:\") && typeof window !== \"undefined\" && window.location.protocol == \"https:\") {\n // TODO: Return proper error object.\n throw new axios.Cancel(\"Can't call http API from https.\")\n }\n\n return config\n })\n\n // Add a response interceptor\n this.axios.interceptors.response.use(({ data, headers = {}, config = {} }) => {\n // Apply unicode normalization\n data = jskos.normalize(data)\n\n // Add URL to array as prop\n let url = config.url\n if (!url.endsWith(\"?\")) {\n url += \"?\"\n }\n _.forOwn(config.params || {}, (value, key) => {\n url += `${key}=${encodeURIComponent(value)}&`\n })\n\n if (_.isArray(data) || _.isObject(data)) {\n // Add total count to array as prop\n let totalCount = parseInt(headers[\"x-total-count\"])\n if (!isNaN(totalCount)) {\n data._totalCount = totalCount\n }\n data._url = url\n }\n\n // TODO: Return data or whole response here?\n return data\n }, error => {\n const count = _.get(error, \"config._retryCount\", 0)\n const method = _.get(error, \"config.method\")\n const statusCode = _.get(error, \"response.status\")\n if (\n this._retryConfig.methods.includes(method)\n && this._retryConfig.statusCodes.includes(statusCode)\n && count < this._retryConfig.count\n ) {\n error.config._retryCount = count + 1\n // from: https://github.com/axios/axios/issues/934#issuecomment-531463172\n if (error.config.data) error.config.data = JSON.parse(error.config.data)\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this.axios(error.config).then(resolve).catch(reject)\n }, (() => {\n const delay = this._retryConfig.delay\n if (typeof delay === \"function\") {\n return delay(count)\n }\n return delay\n })())\n })\n } else {\n return Promise.reject(error)\n }\n })\n\n const currentRequests = []\n for (let { method, type } of utils.requestMethods) {\n // Make sure all methods exist, but thrown an error if they are not implemented\n const existingMethod = this[method] && this[method].bind(this)\n if (!existingMethod) {\n this[method] = () => { throw new errors.MethodNotImplementedError({ method }) }\n continue\n }\n this[method] = (options = {}) => {\n // Allow calling the \"raw\" method without adjustments\n if (options._raw) {\n delete options._raw\n return existingMethod(options)\n }\n // Return from existing requests if one exists\n const existingRequest = currentRequests.find(r => r.method == method && _.isEqual(r.options, options))\n if (existingRequest) {\n return existingRequest.promise\n }\n // Add an axios cancel token to each request\n let source\n if (!options.cancelToken) {\n source = this.getCancelTokenSource()\n options.cancelToken = source.token\n }\n // Make sure a registry is initialized (see `init` method) before any request\n // TODO: Is this a good solution?\n const promise = this.init()\n .then(() => existingMethod(options))\n // Add totalCount to arrays\n .then(result => {\n if (_.isArray(result) && result._totalCount === undefined) {\n result._totalCount = result.length\n } else if (_.isObject(result) && result._totalCount === undefined) {\n result._totalCount = 1\n }\n if (result && type && this[`adjust${type}`]) {\n result = this[`adjust${type}`](result)\n }\n return result\n }).catch(error => {\n if (error instanceof errors.CDKError) {\n throw error\n } else {\n if (error.response) {\n // 4xx = invalid request\n if (error.response.status.toString().startsWith(4)) {\n throw new errors.InvalidRequestError({ relatedError: error, code: error.response.status })\n } else {\n throw new errors.BackendError({ relatedError: error, code: error.response.status })\n }\n } else if (error.request) {\n if (typeof navigator !== \"undefined\") {\n // If connected, it should be a backend problem\n if (navigator.connection || navigator.mozConnection || navigator.webkitConnection) {\n throw new errors.BackendUnavailableError({ relatedError: error })\n }\n }\n // Otherwise, assume a network error\n throw new errors.NetworkError({ relatedError: error })\n } else {\n // Otherwise, throw generic CDKError\n throw new errors.CDKError({ relatedError: error })\n }\n }\n })\n // Attach cancel method to Promise\n if (source) {\n promise.cancel = (...args) => {\n return source.cancel(...args)\n }\n }\n // Save to list of existing requests\n const request = {\n method,\n options: _.omit(options, [\"cancelToken\"]),\n promise,\n }\n currentRequests.push(request)\n // Remove from list of current requests after promise is done\n promise.catch(() => { }).then(() => currentRequests.splice(currentRequests.indexOf(request), 1))\n // Add adjustment methods\n return promise\n }\n }\n }\n\n // Expose some properties from original registry object as getters\n get uri() { return this._jskos.uri }\n get notation() { return this._jskos.notation }\n get prefLabel() { return this._jskos.prefLabel }\n get definition() { return this._jskos.definition }\n get schemes() { return this._jskos.schemes }\n get excludedSchemes() { return this._jskos.excludedSchemes }\n get stored() { return this._jskos.stored !== undefined ? this._jskos.stored : this.constructor.stored }\n\n /**\n * Load data about registry via the status endpoint.\n *\n * @returns {Promise} Promise that resolves when initialization is complete.\n */\n async init() {\n // Save the actual Promise in _init and return it immediately on a second call\n if (this._init) {\n return this._init\n }\n this._init = (async () => {\n // Call preparation method\n this._prepare()\n let status\n if (_.isString(this._api.status)) {\n // Request status endpoint\n try {\n status = await this.axios({\n method: \"get\",\n url: this._api.status,\n })\n } catch (error) {\n if (_.get(error, \"response.status\") === 404) {\n // If /status is not available, remove from _api\n this._api.status = null\n }\n }\n } else {\n // Assume object\n status = this._api.status\n }\n if (_.isObject(status) && !_.isEmpty(status)) {\n // Set config\n this._config = status.config || {}\n // Merge status result and existing API URLs\n for (let key of Object.keys(this._api)) {\n // Only override if undefined\n if (this._api[key] === undefined) {\n // Fall back to null, i.e. if /status was successful, no endpoints are implied by the provider\n // See also: https://github.com/gbv/cocoda-sdk/issues/21\n this._api[key] = status[key] || null\n }\n }\n }\n this._setup()\n })()\n return this._init\n }\n\n /**\n * Preparation to be executed before init. Should be overwritten by subclasses.\n *\n * @private\n */\n _prepare() { }\n\n /**\n * Setup to be executed after init. Should be overwritten by subclasses.\n *\n * @private\n */\n _setup() { }\n\n /**\n * Returns a source for a axios cancel token.\n *\n * @returns {Object} axios cancel token source\n */\n getCancelTokenSource() {\n return axios.CancelToken.source()\n }\n\n /**\n * Sets authentication credentials.\n *\n * @param {Object} options\n * @param {string} options.key public key of login-server instance the user is authorized for\n * @param {string} options.bearerToken token that is sent with each request\n */\n setAuth({ key = this._auth.key, bearerToken = this._auth.bearerToken }) {\n this._auth.key = key\n this._auth.bearerToken = bearerToken\n }\n\n /**\n * Sets retry configuration.\n *\n * @param {Object} config\n * @param {string[]} [config.methods=[\"get\", \"head\", \"options\"]] HTTP methods to retry (lowercase)\n * @param {number[]} [config.statusCodes=[401, 403]] status codes to retry\n * @param {number} [config.count=3] maximum number of retries\n * @param {number|Function} [config.delay=300*count] a delay in ms or a function that takes the number of current retries and returns a delay in ms\n */\n setRetryConfig(config = {}) {\n this._retryConfig = Object.assign({\n methods: [\"get\", \"head\", \"options\"],\n statusCodes: [401, 403],\n count: 3,\n delay: (count) => {\n return 300 * count\n },\n }, config)\n }\n\n /**\n * Returns whether a user is authorized for a certain request.\n *\n * @param {Object} options\n * @param {string} options.type type of item (e.g. mappings)\n * @param {string} options.action action to be performed (read/create/update/delete)\n * @param {Object} options.user user object\n * @param {boolean} [options.crossUser] whether the request is a crossUser request (i.e. updading/deleting another user's item)\n * @returns {boolean}\n */\n isAuthorizedFor({ type, action, user, crossUser }) {\n if (action == \"read\" && this.has[type] === true) {\n return true\n }\n if (!this.has[type]) {\n return false\n }\n const options = _.get(this._config, `${type}.${action}`)\n if (!options) {\n return !!this.has[type][action]\n }\n if (options.auth && (!user || !this._auth.key)) {\n return false\n }\n // Public key mismatch\n if (options.auth && this._auth.key != _.get(this._config, \"auth.key\")) {\n return false\n }\n if (options.auth && options.identities) {\n // Check if one of the user's identities matches\n const uris = [user.uri].concat(Object.values(user.identities || {}).map(id => id.uri)).filter(uri => uri != null)\n if (_.intersection(uris, options.identities).length == 0) {\n return false\n }\n }\n if (options.auth && options.identityProviders) {\n // Check if user has the required provider\n const providers = Object.keys((user && user.identities) || {})\n if (_.intersection(providers, options.identityProviders).length == 0) {\n return false\n }\n }\n if (crossUser) {\n return !!options.crossUser\n }\n return !!this.has[type][action]\n }\n\n /**\n * Returns a boolean whether a certain target scheme is supported or not.\n *\n * @param {Object} scheme\n * @returns {boolean}\n */\n supportsScheme(scheme) {\n if (!scheme) {\n return false\n }\n let schemes = _.isArray(this.schemes) ? this.schemes : null\n if (schemes == null && !jskos.isContainedIn(scheme, this.excludedSchemes || [])) {\n return true\n }\n return jskos.isContainedIn(scheme, schemes)\n }\n\n adjustConcept(concept) {\n // Don't adjust when already saved in Cocoda\n if (!concept || concept.__SAVED__) {\n return concept\n }\n // Add _getNarrower function to concepts\n concept._getNarrower = (config) => {\n return this.getNarrower({ ...config, concept })\n }\n // Add _getAncestors function to concepts\n concept._getAncestors = (config) => {\n return this.getAncestors({ ...config, concept })\n }\n // Add _getDetails function to concepts\n concept._getDetails = async (config) => {\n return (await this.getConcepts({ ...config, concepts: [concept] }))[0]\n }\n // Adjust broader/narrower/ancestors if necessary\n for (let type of [\"broader\", \"narrower\", \"ancestors\"]) {\n if (Array.isArray(concept[type]) && !concept[type].includes(null)) {\n concept[type] = this.adjustConcepts(concept[type])\n }\n }\n // Add _registry to concepts\n concept._registry = this\n return concept\n }\n adjustConcepts(concepts) {\n return utils.withCustomProps(concepts.map(concept => this.adjustConcept(concept)), concepts)\n }\n adjustRegistries(registries) {\n return registries\n }\n adjustScheme(scheme) {\n // Don't adjust when already saved in Cocoda\n if (!scheme || scheme.__SAVED__) {\n return scheme\n }\n // Add _registry to schemes\n const previousRegistry = scheme._registry\n scheme._registry = this.cdk && this.cdk.registryForScheme(scheme)\n if (!scheme._registry || previousRegistry === scheme._registry) {\n scheme._registry = previousRegistry || this\n } else {\n // Remove scheme's `concepts` and `topConcepts` fields if they are [] or [null]\n // because the registry has changed and they might not be accurate.\n [\"concepts\", \"topConcepts\"].forEach(key => {\n if (Array.isArray(scheme[key]) && (scheme[key].length === 0 || scheme[key][0] === null)) {\n delete scheme[key]\n }\n })\n }\n if (scheme._registry) {\n // Add _getTop function to schemes\n scheme._getTop = (config) => {\n return scheme._registry.getTop({ ...config, scheme })\n }\n // Add _getTypes function to schemes\n scheme._getTypes = (config) => {\n return scheme._registry.getTypes({ ...config, scheme })\n }\n // Add _suggest function to schemes\n scheme._suggest = ({ search, ...config }) => {\n return scheme._registry.suggest({ ...config, search, scheme })\n }\n }\n return scheme\n }\n adjustSchemes(schemes) {\n return utils.withCustomProps(schemes.map(scheme => this.adjustScheme(scheme)), schemes)\n }\n adjustConcordances(concordances) {\n for (let concordance of concordances) {\n // Add _registry to concordance\n concordance._registry = this\n }\n return concordances\n }\n adjustMapping(mapping) {\n // TODO: Add default type\n // Add fromScheme and toScheme if missing\n for (let side of [\"from\", \"to\"]) {\n let sideScheme = `${side}Scheme`\n if (!mapping[sideScheme]) {\n mapping[sideScheme] = _.get(jskos.conceptsOfMapping(mapping, side), \"[0].inScheme[0]\", null)\n }\n }\n mapping._registry = this\n if (!mapping.identifier) {\n // Add mapping identifiers for this mapping\n let identifier = _.get(jskos.addMappingIdentifiers(mapping), \"identifier\")\n if (identifier) {\n mapping.identifier = identifier\n }\n }\n return mapping\n }\n adjustMappings(mappings) {\n return utils.withCustomProps(mappings.map(mapping => this.adjustMapping(mapping)), mappings)\n }\n\n /**\n * POSTs multiple mappings. Do not override in subclass!\n *\n * @param {Object} config\n * @param {Array} config.mappings array of mapping objects\n * @returns {Object[]} array of created mapping objects; in case of failure, consult the `_errors` property on the array at the index of the failed request\n */\n async postMappings({ mappings, ...config } = {}) {\n if (!mappings || !mappings.length) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mappings\" })\n }\n return this._callHelperForArrayWrappers({\n method: \"postMapping\",\n items: mappings,\n itemProperty: \"mapping\",\n config,\n })\n }\n\n /**\n * DELETEs multiple mappings. Do not override in subclass!\n *\n * @param {Object} config\n * @param {Array} config.mappings array of mapping objects\n * @returns {Object[]} array of results (`true` if successful); in case of failure, consult the `_errors` property on the array at the index of the failed request\n */\n async deleteMappings({ mappings, ...config } = {}) {\n if (!mappings || !mappings.length) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mappings\" })\n }\n return this._callHelperForArrayWrappers({\n method: \"deleteMapping\",\n items: mappings,\n itemProperty: \"mapping\",\n config,\n })\n }\n\n /**\n * Calls a method that is for only one item for an array of items. Returns an array of results.\n *\n * If there is an error, that index in the result array will be `null`. There is a property `_errors` on the result array that will contain the respective error at the correct index.\n *\n * @param {Object} options\n * @param {string} options.method instance method to call (e.g. `postMapping`)\n * @param {Object[]} options.items items to call the method for\n * @param {string} options.itemProperty the property name for the item when calling the method (e.g. `mapping`)\n * @param {Object} options.config other properties to pass to the method call\n * @returns {any[]} result array with values returned from individual method calls\n *\n * @private\n */\n async _callHelperForArrayWrappers({ method, items, itemProperty, config }) {\n const errors = []\n const resultItems = await Promise.all(items.map(async item => {\n try {\n const resultItem = await this[method]({ [itemProperty]: item, ...config, _raw: true })\n return resultItem\n } catch (error) {\n errors[items.indexOf(item)] = error\n return null\n }\n }))\n resultItems._errors = errors\n return resultItems\n }\n\n}\n\nBaseProvider.providerName = \"Base\"\n", "export const requestMethods = [\n // General\n {\n method: \"getRegistries\",\n fallback: [],\n type: \"Registries\",\n },\n {\n method: \"getSchemes\",\n fallback: [],\n type: \"Schemes\",\n },\n {\n method: \"vocSearch\",\n fallback: [],\n type: \"Schemes\",\n },\n {\n method: \"getTypes\",\n fallback: [],\n type: \"Types\",\n },\n {\n method: \"suggest\",\n fallback: [\"\", [], [], []],\n },\n {\n method: \"vocSuggest\",\n fallback: [\"\", [], [], []],\n },\n {\n method: \"getConcordances\",\n fallback: [],\n type: \"Concordances\",\n },\n {\n method: \"getOccurrences\",\n fallback: [],\n type: \"Occurrences\",\n },\n // Concepts\n {\n method: \"getTop\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getConcepts\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getNarrower\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"getAncestors\",\n fallback: [],\n type: \"Concepts\",\n },\n {\n method: \"search\",\n fallback: [],\n type: \"Concepts\",\n },\n // Mappings\n {\n method: \"getMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"getMappings\",\n fallback: [],\n type: \"Mappings\",\n },\n {\n method: \"postMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"postMappings\",\n fallback: [],\n type: \"Mapping\",\n },\n {\n method: \"putMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"patchMapping\",\n fallback: null,\n type: \"Mapping\",\n },\n {\n method: \"deleteMapping\",\n fallback: false,\n },\n {\n method: \"deleteMappings\",\n fallback: [],\n },\n // Annotations\n // {\n // method: \"getAnnotation\",\n // fallback: \"\",\n // },\n {\n method: \"getAnnotations\",\n fallback: [],\n type: \"Annotations\",\n },\n {\n method: \"postAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"putAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"patchAnnotation\",\n fallback: null,\n type: \"Annotation\",\n },\n {\n method: \"deleteAnnotation\",\n fallback: false,\n },\n]\n\nexport function concatUrl(...parts) {\n let [url, ...otherParts] = parts\n for (let part of otherParts) {\n if (!url.endsWith(\"/\")) {\n url += \"/\"\n }\n if (part.startsWith(\"/\")) {\n part = part.slice(1)\n }\n url += part\n }\n return url\n}\n\n\n// Retain custom array properties\nexport function withCustomProps(arr, from) {\n arr._totalCount = from._totalCount\n arr._url = from._url\n return arr\n}\n\nexport const listOfCapabilities = [\n \"schemes\",\n \"top\",\n \"data\",\n \"concepts\",\n \"narrower\",\n \"ancestors\",\n \"types\",\n \"suggest\",\n \"search\",\n \"auth\",\n \"mappings\",\n \"concordances\",\n \"annotations\",\n \"occurrences\",\n]\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport localforage from \"localforage\"\nimport { v4 as uuid } from \"uuid\"\nimport * as errors from \"../errors/index.js\"\nimport { listOfCapabilities } from \"../utils/index.js\"\nconst uriPrefix = \"urn:uuid:\"\n\n/**\n * Local Mappings.\n *\n * This class provides read-write access to mappings in the browser's local storage.\n *\n * To use it in a registry, specify `provider` as \"LocalMappings\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/local-mappings\",\n * \"provider\": \"LocalMappings\"\n * }\n * ```\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LocalMappingsProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this.has.mappings = {\n read: true,\n create: true,\n update: true,\n delete: true,\n }\n // Explicitly set other capabilities to false\n listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * @private\n */\n _setup() {\n this.queue = []\n this.localStorageKey = \"cocoda-mappings--\" + this._path\n let oldLocalStorageKey = \"mappings\"\n // Function that adds URIs to all existing local mappings that don't yet have one\n let addUris = () => {\n return localforage.getItem(this.localStorageKey).then(mappings => {\n mappings = mappings || []\n let adjusted = 0\n for (let mapping of mappings.filter(m => !m.uri || !m.uri.startsWith(uriPrefix))) {\n if (mapping.uri) {\n // Keep previous URI in identifier\n if (!mapping.identifier) {\n mapping.identifier = []\n }\n mapping.identifier.push(mapping.uri)\n }\n mapping.uri = `${uriPrefix}${uuid()}`\n adjusted += 1\n }\n if (adjusted) {\n console.warn(`URIs added to ${adjusted} local mappings.`)\n }\n return localforage.setItem(this.localStorageKey, mappings)\n })\n }\n // Show warning if there are mappings in local storage that use the old local storage key.\n localforage.getItem(oldLocalStorageKey).then(results => {\n if (results) {\n console.warn(`Warning: There is old data in local storage (or IndexedDB, depending on the ) with the key \"${oldLocalStorageKey}\". This data will not be used anymore. A manual export is necessary to get this data back.`)\n }\n })\n // Put promise into queue so that getMappings requests are waiting for adjustments to finish\n this.queue.push(\n addUris().catch(error => {\n console.warn(\"Error when adding URIs to local mappings:\", error)\n }),\n )\n }\n\n isAuthorizedFor({ type, action }) {\n // Allow all for mappings\n if (type == \"mappings\" && action != \"anonymous\") {\n return true\n }\n return false\n }\n\n /**\n * Returns a Promise that returns an object { mappings, done } with the local mappings and a done function that is supposed to be called when the transaction is finished.\n * This prevents conflicts when saveMapping is called multiple times simultaneously.\n *\n * TODO: There might be a better solution for this...\n *\n * @private\n */\n _getMappingsQueue() {\n let last = _.last(this.queue) || Promise.resolve()\n return new Promise((resolve) => {\n function defer() {\n var res, rej\n\n var promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n promise.resolve = res\n promise.reject = rej\n\n return promise\n }\n let promise = defer()\n let done = () => {\n promise.resolve()\n }\n this.queue.push(promise)\n\n last.then(() => {\n return localforage.getItem(this.localStorageKey)\n }).then(mappings => {\n resolve({ mappings, done })\n })\n })\n }\n\n /**\n * Returns a single mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async getMapping({ mapping, ...config }) {\n config._raw = true\n if (!mapping || !mapping.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n return (await this.getMappings({ ...config, uri: mapping.uri }))[0]\n }\n\n /**\n * Returns a list of local mappings.\n *\n * TODO: Add support for sort (`created` or `modified`) and order (`asc` or `desc`).\n * TODO: Clean up and use async/await\n *\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, fromScheme, to, toScheme, creator, type, partOf, offset, limit, direction, mode, identifier, uri } = {}) {\n let params = {}\n if (from) {\n params.from = _.isString(from) ? from : from.uri\n }\n if (fromScheme) {\n params.fromScheme = _.isString(fromScheme) ? { uri: fromScheme } : fromScheme\n }\n if (to) {\n params.to = _.isString(to) ? to : to.uri\n }\n if (toScheme) {\n params.toScheme = _.isString(toScheme) ? { uri: toScheme } : toScheme\n }\n if (creator) {\n params.creator = _.isString(creator) ? creator : jskos.prefLabel(creator)\n }\n if (type) {\n params.type = _.isString(type) ? type : type.uri\n }\n if (partOf) {\n params.partOf = _.isString(partOf) ? partOf : partOf.uri\n }\n if (offset) {\n params.offset = offset\n }\n if (limit) {\n params.limit = limit\n }\n if (direction) {\n params.direction = direction\n }\n if (mode) {\n params.mode = mode\n }\n if (identifier) {\n params.identifier = identifier\n }\n if (uri) {\n params.uri = uri\n }\n return this._getMappingsQueue().catch(relatedError => {\n throw new errors.CDKError({ message: \"Could not get mappings from local storage\", relatedError })\n }).then(({ mappings, done }) => {\n done()\n // Check concept with param\n let checkConcept = (concept, param) => concept.uri == param || (param && concept.notation && concept.notation[0].toLowerCase() == param.toLowerCase())\n // Filter mappings according to params (support for from + to)\n // TODO: - Support more parameters.\n // TODO: - Move to its own things.\n // TODO: - Clean all this up.\n if (params.from || params.to) {\n mappings = mappings.filter(mapping => {\n let fromInFrom = null != jskos.conceptsOfMapping(mapping, \"from\").find(concept => checkConcept(concept, params.from))\n let fromInTo = null != jskos.conceptsOfMapping(mapping, \"to\").find(concept => checkConcept(concept, params.from))\n let toInFrom = null != jskos.conceptsOfMapping(mapping, \"from\").find(concept => checkConcept(concept, params.to))\n let toInTo = null != jskos.conceptsOfMapping(mapping, \"to\").find(concept => checkConcept(concept, params.to))\n if (params.direction == \"backward\") {\n if (params.mode == \"or\") {\n return (params.from && fromInTo) || (params.to && toInFrom)\n } else {\n return (!params.from || fromInTo) && (!params.to || toInFrom)\n }\n } else if (params.direction == \"both\") {\n if (params.mode == \"or\") {\n return (params.from && (fromInFrom || fromInTo)) || (params.to && (toInFrom || toInTo))\n } else {\n return ((!params.from || fromInFrom) && (!params.to || toInTo)) || ((!params.from || fromInTo) && (!params.to || toInFrom))\n }\n } else {\n if (params.mode == \"or\") {\n return (params.from && fromInFrom) || (params.to && toInTo)\n } else {\n return (!params.from || fromInFrom) && (!params.to || toInTo)\n }\n }\n })\n }\n if (params.fromScheme || params.toScheme) {\n mappings = mappings.filter(mapping => {\n let fromInFrom = jskos.compare(mapping.fromScheme, params.fromScheme)\n let fromInTo = jskos.compare(mapping.toScheme, params.fromScheme)\n let toInFrom = jskos.compare(mapping.fromScheme, params.toScheme)\n let toInTo = jskos.compare(mapping.toScheme, params.toScheme)\n if (params.direction == \"backward\") {\n if (params.mode == \"or\") {\n return (params.fromScheme && fromInTo) || (params.toScheme && toInFrom)\n } else {\n return (!params.fromScheme || fromInTo) && (!params.toScheme || toInFrom)\n }\n } else if (params.direction == \"both\") {\n if (params.mode == \"or\") {\n return (params.fromScheme && (fromInFrom || fromInTo)) || (params.toScheme && (toInFrom || toInTo))\n } else {\n return ((!params.fromScheme || fromInFrom) && (!params.toScheme || toInTo)) || ((!params.fromScheme || fromInTo) && (!params.toScheme || toInFrom))\n }\n } else {\n if (params.mode == \"or\") {\n return (params.fromScheme && fromInFrom) || (params.toScheme && toInTo)\n } else {\n return (!params.fromScheme || fromInFrom) && (!params.toScheme || toInTo)\n }\n }\n })\n }\n // creator\n if (params.creator) {\n let creators = params.creator.split(\"|\")\n mappings = mappings.filter(mapping => {\n return (mapping.creator && mapping.creator.find(creator => creators.includes(jskos.prefLabel(creator)) || creators.includes(creator.uri))) != null\n })\n }\n // type\n if (params.type) {\n mappings = mappings.filter(mapping => (mapping.type || [jskos.defaultMappingType.uri]).includes(params.type))\n }\n // concordance\n if (params.partOf) {\n mappings = mappings.filter(mapping => {\n return mapping.partOf != null && mapping.partOf.find(partOf => jskos.compare(partOf, { uri: params.partOf })) != null\n })\n }\n // identifier\n if (params.identifier) {\n mappings = mappings.filter(mapping => {\n return params.identifier.split(\"|\").map(identifier => {\n return (mapping.identifier || []).includes(identifier) || mapping.uri == identifier\n }).reduce((current, total) => current || total)\n })\n }\n if (params.uri) {\n mappings = mappings.filter(mapping => mapping.uri == params.uri)\n }\n let totalCount = mappings.length\n // Sort mappings (default: modified/created date descending)\n mappings = mappings.sort((a, b) => {\n let aDate = a.modified || a.created\n let bDate = b.modified || b.created\n if (bDate == null) {\n return -1\n }\n if (aDate == null) {\n return 1\n }\n if (aDate > bDate) {\n return -1\n }\n return 1\n })\n mappings = mappings.slice(params.offset || 0)\n mappings = mappings.slice(0, params.limit)\n mappings._totalCount = totalCount\n return mappings\n })\n }\n\n /**\n * Creates a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async postMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Set URI if necessary\n if (!mapping.uri || !mapping.uri.startsWith(uriPrefix)) {\n if (mapping.uri) {\n // Keep previous URI in identifier\n if (!mapping.identifier) {\n mapping.identifier = []\n }\n mapping.identifier.push(mapping.uri)\n }\n mapping.uri = `${uriPrefix}${uuid()}`\n }\n // Check if mapping already exists => throw error\n if (localMappings.find(m => m.uri == mapping.uri)) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Duplicate URI\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = (new Date()).toISOString()\n }\n if (!mapping.modified) {\n mapping.modified = mapping.created\n }\n // Add to local mappings\n localMappings.push(mapping)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Overwrites a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async putMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Check if mapping already exists => throw error if it doesn't\n const index = localMappings.findIndex(m => m.uri == mapping.uri)\n if (index == -1) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Mapping not found\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = localMappings[index].created\n }\n mapping.modified = (new Date()).toISOString()\n // Add to local mappings\n localMappings[index] = mapping\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Patches a mapping.\n *\n * @param {Object} config\n * @param {Object} mapping JSKOS mapping (or part of mapping)\n * @returns {Object} JSKOS mapping object\n */\n async patchMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n // Check if mapping already exists => throw error if it doesn't\n const index = localMappings.findIndex(m => m.uri == mapping.uri)\n if (index == -1) {\n done()\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"Mapping not found\" })\n }\n // Set created/modified\n if (!mapping.created) {\n mapping.created = localMappings[index].created\n }\n mapping.modified = (new Date()).toISOString()\n // Add to local mappings\n localMappings[index] = Object.assign(localMappings[index], mapping)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n // Write local mappings\n try {\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return mapping\n } catch (error) {\n done()\n throw error\n }\n }\n\n /**\n * Removes a mapping from local storage.\n *\n * @param {Object} config\n * @param {Object} mapping JSKOS mapping\n * @returns {boolean} boolean whether deleting the mapping was successful\n */\n async deleteMapping({ mapping }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n let { mappings: localMappings, done } = await this._getMappingsQueue()\n try {\n // Remove by URI\n localMappings = localMappings.filter(m => m.uri != mapping.uri)\n // Minify mappings before saving back to local storage\n localMappings = localMappings.map(mapping => jskos.minifyMapping(mapping))\n await localforage.setItem(this.localStorageKey, localMappings)\n done()\n return true\n } catch (error) {\n done()\n throw error\n }\n }\n}\n\nLocalMappingsProvider.providerName = \"LocalMappings\"\nLocalMappingsProvider.stored = true\n", "// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}", "export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;", "import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;", "import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;", "import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\n\n// TODO: Check capabilities (`this.has`) and authorization (`this.isAuthorizedFor`) before actions.\n\n/**\n * JSKOS Mappings API.\n *\n * This class provides access to concept mappings via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n * See [jskos-server](https://github.com/gbv/jskos-server) for a JSKOS API reference implementation\n *\n * To use it in a registry, specify `provider` as \"MappingsApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-mappings\",\n * \"provider\": \"MappingsApi\",\n * \"api\": \"https://coli-conc.gbv.de/api/\"\n * }\n * ```\n *\n * If the `/status` endpoint can be queried, the remaining API methods will be taken from that. As a fallback, the default endpoints will be appended to `api`.\n *\n * Alternatively, you can provide the endpoints separately: `status`, `mappings`, `concordances`, `annotations`\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class MappingsApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n // Set status endpoint only\n if (this._api.api && this._api.status === undefined) {\n this._api.status = utils.concatUrl(this._api.api, \"/status\")\n }\n // Preliminarily set capabilties\n this.has.mappings = true\n this.has.concordances = true\n this.has.annotations = true\n // Explicitly set other capabilities to false\n utils.listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * @private\n */\n _setup() {\n // Fill `this._api` if necessary\n if (this._api.api) {\n const endpoints = {\n mappings: \"/mappings\",\n concordances: \"/concordances\",\n annotations: \"/annotations\",\n }\n for (let key of Object.keys(endpoints)) {\n if (this._api[key] === undefined) {\n this._api[key] = utils.concatUrl(this._api.api, endpoints[key])\n }\n }\n }\n this.has.mappings = this._api.mappings ? {} : false\n if (this.has.mappings) {\n this.has.mappings.read = !!_.get(this._config, \"mappings.read\", true)\n this.has.mappings.create = !!_.get(this._config, \"mappings.create\")\n this.has.mappings.update = !!_.get(this._config, \"mappings.update\")\n this.has.mappings.delete = !!_.get(this._config, \"mappings.delete\")\n this.has.mappings.anonymous = !!_.get(this._config, \"mappings.anonymous\")\n }\n this.has.concordances = !!this._api.concordances\n this.has.annotations = this._api.annotations ? {} : false\n if (this.has.annotations) {\n this.has.annotations.read = !!_.get(this._config, \"annotations.read\")\n this.has.annotations.create = !!_.get(this._config, \"annotations.create\")\n this.has.annotations.update = !!_.get(this._config, \"annotations.update\")\n this.has.annotations.delete = !!_.get(this._config, \"annotations.delete\")\n }\n this.has.auth = _.get(this._config, \"auth.key\") != null\n this._defaultParams = {\n properties: \"annotations\",\n }\n }\n\n /**\n * Returns a single mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async getMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n if (!mapping.uri || !mapping.uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n try {\n return await this.axios({\n ...config,\n url: mapping.uri,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n } catch (error) {\n if (_.get(error, \"response.status\") == 404) {\n return null\n }\n throw error\n }\n }\n\n /**\n * Returns a list of mappings.\n *\n * @param {Object} config request config with parameters\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, fromScheme, to, toScheme, creator, type, partOf, offset, limit, direction, mode, identifier, sort, order, ...config }) {\n let params = {}, url = this._api.mappings\n if (from) {\n params.from = _.isString(from) ? from : from.uri\n }\n if (fromScheme) {\n params.fromScheme = _.isString(fromScheme) ? fromScheme : fromScheme.uri\n }\n if (to) {\n params.to = _.isString(to) ? to : to.uri\n }\n if (toScheme) {\n params.toScheme = _.isString(toScheme) ? toScheme : toScheme.uri\n }\n if (creator) {\n params.creator = _.isString(creator) ? creator : jskos.prefLabel(creator)\n }\n if (type) {\n params.type = _.isString(type) ? type : type.uri\n }\n if (partOf) {\n params.partOf = _.isString(partOf) ? partOf : partOf.uri\n }\n if (offset) {\n params.offset = offset\n }\n if (limit) {\n params.limit = limit\n }\n if (direction) {\n params.direction = direction\n }\n if (mode) {\n params.mode = mode\n }\n if (identifier) {\n params.identifier = identifier\n }\n if (sort) {\n params.sort = sort\n }\n if (order) {\n params.order = order\n }\n return this.axios({\n ...config,\n method: \"get\",\n url,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n ...params,\n },\n })\n }\n\n /**\n * Creates a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async postMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n return this.axios({\n ...config,\n method: \"post\",\n url: this._api.mappings,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Overwrites a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {Object} JSKOS mapping object\n */\n async putMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"put\",\n url: uri,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Patches a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping (or part of mapping)\n * @returns {Object} JSKOS mapping object\n */\n async patchMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n mapping = jskos.minifyMapping(mapping)\n mapping = jskos.addMappingIdentifiers(mapping)\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"patch\",\n url: uri,\n data: mapping,\n params: {\n ...this._defaultParams,\n ...(config.params || {}),\n },\n })\n }\n\n /**\n * Deletes a mapping.\n *\n * @param {Object} config\n * @param {Object} config.mapping JSKOS mapping\n * @returns {boolean} `true` if deletion was successful\n */\n async deleteMapping({ mapping, ...config }) {\n if (!mapping) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\" })\n }\n const uri = mapping.uri\n if (!uri || !uri.startsWith(this._api.mappings)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"mapping\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n await this.axios({\n ...config,\n method: \"delete\",\n url: uri,\n })\n return true\n }\n\n /**\n * Returns a list of annotations.\n *\n * @param {Object} config\n * @param {string} [config.target] target URI\n * @returns {Object[]} array of JSKOS annotation objects\n */\n async getAnnotations({ target, ...config }) {\n if (target) {\n _.set(config, \"params.target\", target)\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.annotations,\n })\n }\n\n /**\n * Creates an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async postAnnotation({ annotation, ...config }) {\n return this.axios({\n ...config,\n method: \"post\",\n url: this._api.annotations,\n data: annotation,\n })\n }\n\n /**\n * Overwrites an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async putAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"put\",\n url: uri,\n data: annotation,\n })\n }\n\n /**\n * Patches an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {Object} JSKOS annotation object\n */\n async patchAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n return this.axios({\n ...config,\n method: \"patch\",\n url: uri,\n data: annotation,\n })\n }\n\n /**\n * Deletes an annotation.\n *\n * @param {Object} config\n * @param {Object} config.annotation JSKOS annotation\n * @returns {boolean} `true` if deletion was successful\n */\n async deleteAnnotation({ annotation, ...config }) {\n const uri = annotation.id\n if (!uri || !uri.startsWith(this._api.annotations)) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"annotation\", message: \"URI doesn't seem to be part of this registry.\" })\n }\n await this.axios({\n ...config,\n method: \"delete\",\n url: uri,\n })\n return true\n }\n\n /**\n * Returns a list of concordances.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concordance objects\n */\n async getConcordances(config) {\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.concordances,\n })\n }\n\n}\n\nMappingsApiProvider.providerName = \"MappingsApi\"\nMappingsApiProvider.stored = true\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\n\n// TODO: Modernize.\n\n/**\n * JSKOS Occurrences API.\n *\n * This class provides access to concept occurrences via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n *\n * To use it in a registry, specify `provider` as \"OccurrencesApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/occurrences\",\n * \"provider\": \"OccurrencesApi\",\n * \"api\": \"https://coli-conc.gbv.de/occurrences/api/\"\n * }\n * ```\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class OccurrencesApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this._cache = []\n this._occurrencesSupportedSchemes = []\n this.has.occurrences = true\n this.has.mappings = true\n // Explicitly set other capabilities to false\n utils.listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * Returns whether a concept scheme is supported for occurrences.\n *\n * @private\n *\n * @param {Object} scheme JSKOS scheme to query\n */\n async _occurrencesIsSupported(scheme) {\n if (this._occurrencesSupportedSchemes && this._occurrencesSupportedSchemes.length) {\n // No action needed\n } else {\n // Load supported schemes from API\n try {\n const url = utils.concatUrl(this._api.api, \"voc\")\n const data = await this.axios({\n method: \"get\",\n url,\n })\n this._occurrencesSupportedSchemes = data || []\n } catch (error) {\n // Do nothing so that it is tried again next time\n // TODO: Save number of failures?\n }\n }\n let supported = false\n for (let supportedScheme of this._occurrencesSupportedSchemes) {\n if (jskos.compare(scheme, supportedScheme)) {\n supported = true\n }\n }\n return supported\n }\n\n /**\n * Wrapper around getOccurrences that converts occurrences into mappings.\n *\n * @param {Object} config config object for getOccurrences request\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings(config) {\n const occurrences = await this.getOccurrences(config)\n const fromScheme = _.get(config, \"from.inScheme[0]\") || config.fromScheme\n const toScheme = _.get(config, \"to.inScheme[0]\") || config.toScheme\n const mappings = []\n // Convert occurrences to mappings\n for (let occurrence of occurrences) {\n if (!occurrence) {\n continue\n }\n let mapping = {}\n mapping.from = _.get(occurrence, \"memberSet[0]\")\n if (mapping.from) {\n mapping.from = { memberSet: [mapping.from] }\n } else {\n mapping.from = null\n }\n mapping.fromScheme = _.get(occurrence, \"memberSet[0].inScheme[0]\")\n mapping.to = _.get(occurrence, \"memberSet[1]\")\n if (mapping.to) {\n mapping.to = { memberSet: [mapping.to] }\n } else {\n mapping.to = { memberSet: [] }\n }\n mapping.toScheme = _.get(occurrence, \"memberSet[1].inScheme[0]\")\n // Swap sides if necessary\n if ((fromScheme && mapping.fromScheme && !jskos.compare(mapping.fromScheme, fromScheme)) || (toScheme && mapping.toScheme && !jskos.compare(mapping.toScheme, toScheme))) {\n [mapping.from, mapping.fromScheme, mapping.to, mapping.toScheme] = [mapping.to, mapping.toScheme, mapping.from, mapping.fromScheme]\n }\n // Set fromScheme/toScheme if necessary\n if (!mapping.fromScheme && fromScheme) {\n mapping.fromScheme = fromScheme\n }\n if (!mapping.toScheme && toScheme) {\n mapping.toScheme = toScheme\n }\n mapping.type = [jskos.defaultMappingType.uri]\n mapping._occurrence = occurrence\n mapping = jskos.addMappingIdentifiers(mapping)\n if (occurrence.database) {\n mapping.creator = [occurrence.database]\n }\n mappings.push(mapping)\n }\n return mappings\n }\n\n /**\n * Returns a list of occurrences.\n *\n * @param {Object} config\n * @param {Object} [config.from] JSKOS concept to load occurrences for (from side)\n * @param {Object} [config.to] JSKOS concept to load occurrences for (to side)\n * @param {Object[]} [config.concepts] list of JSKOS concepts to load occurrences for\n * @returns {Object[]} array of JSKOS occurrence objects\n */\n async getOccurrences({ from, to, concepts, ...config }) {\n let promises = []\n concepts = (concepts || []).concat([from, to]).filter(c => !!c)\n for (let concept of concepts) {\n promises.push(this._occurrencesIsSupported(_.get(concept, \"inScheme[0]\")).then(supported => {\n if (supported && concept.uri) {\n return concept.uri\n } else {\n return null\n }\n }))\n }\n let uris = await Promise.all(promises)\n uris = uris.filter(uri => uri != null)\n if (uris.length == 0) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concepts\" })\n }\n promises = []\n for (let uri of uris) {\n promises.push(this._getOccurrences({\n ...config,\n params: {\n member: uri,\n scheme: \"*\",\n threshold: 5,\n },\n }))\n }\n // Another request for co-occurrences between two specific concepts\n if (uris.length > 1) {\n let urisString = uris.join(\" \")\n promises.push(this._getOccurrences({\n ...config,\n params: {\n member: urisString,\n threshold: 5,\n },\n }))\n }\n const results = await Promise.all(promises)\n let occurrences = _.concat([], ...results)\n // Filter duplicates\n let existingUris = []\n let indexesToDelete = []\n for (let i = 0; i < occurrences.length; i += 1) {\n let occurrence = occurrences[i]\n if (!occurrence) {\n continue\n }\n let uris = occurrence.memberSet.reduce((total, current) => total.concat(current.uri), []).sort().join(\" \")\n if (existingUris.includes(uris)) {\n indexesToDelete.push(i)\n } else {\n existingUris.push(uris)\n }\n }\n indexesToDelete.forEach(value => {\n delete occurrences[value]\n })\n // Filter null values\n occurrences = occurrences.filter(o => o != null)\n // Sort occurrences\n return occurrences.sort((a, b) => parseInt(b.count || 0) - parseInt(a.count || 0))\n }\n\n /**\n * Internal function for getOccurrences that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config passthrough of config parameter for axios request\n */\n async _getOccurrences(config) {\n // Use local cache.\n let resultsFromCache = this._cache.find(item => {\n return _.isEqual(item.config.params, config.params)\n })\n if (resultsFromCache) {\n return resultsFromCache.data\n }\n const data = await this.axios({\n ...config,\n method: \"get\",\n url: this._api.api,\n })\n this._cache.push({\n config,\n data,\n })\n if (this._cache.length > 20) {\n this._cache = this._cache.slice(this._cache.length - 20)\n }\n return data\n }\n}\n\nOccurrencesApiProvider.providerName = \"OccurrencesApi\"\nOccurrencesApiProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport * as utils from \"../utils/index.js\"\nimport jskos from \"jskos-tools\"\n\n/**\n * JSKOS Concept API.\n *\n * This class provides access to concept schemes and their concepts via JSKOS API in [JSKOS format](https://gbv.github.io/jskos/).\n * See [jskos-server](https://github.com/gbv/jskos-server) for a JSKOS API reference implementation and [DANTE](https://api.dante.gbv.de/) for another API endpoint.\n *\n * To use it in a registry, specify `provider` as \"ConceptApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-concepts\",\n * \"provider\": \"ConceptApi\",\n * \"api\": \"https://coli-conc.gbv.de/api/\"\n * }\n * ```\n *\n * If the `/status` endpoint can be queried, the remaining API methods will be taken from that. As a fallback, the default endpoints will be appended to `api`.\n *\n * Alternatively, you can provide the endpoints separately: `status`, `schemes`, `top`, `concepts`, `data`, `narrower`, `ancestors`, `types`, `suggest`, `search`\n * Note that `schemes`, `top`, and `types` can also be provided as arrays.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class ConceptApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n // Set status endpoint only\n if (this._api.api && this._api.status === undefined) {\n this._api.status = utils.concatUrl(this._api.api, \"/status\")\n }\n // Set capabilities to true for now; will be overridden by _setup() later\n this.has.schemes = true\n this.has.top = true\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = true\n this.has.ancestors = true\n this.has.types = true\n this.has.suggest = true\n this.has.search = true\n this.has.auth = true\n // Explicitly set other capabilities to false\n utils.listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * @private\n */\n _setup() {\n // Implicitly fill `this._api` if necessary\n if (this._api.api) {\n const endpoints = {\n schemes: \"/voc\",\n top: \"/voc/top\",\n concepts: \"/voc/concepts\",\n data: \"/data\",\n narrower: \"/narrower\",\n ancestors: \"/ancestors\",\n types: \"/types\",\n suggest: \"/suggest\",\n search: \"/search\",\n }\n for (let key of Object.keys(endpoints)) {\n // Only override if undefined\n if (this._api[key] === undefined) {\n this._api[key] = utils.concatUrl(this._api.api, endpoints[key])\n }\n }\n }\n this.has.schemes = !!this._api.schemes\n // If there is no scheme API endpoint, but a list of schemes is given, use that for schemes.\n if (!this.has.schemes && Array.isArray(this.schemes)) {\n this.has.schemes = true\n }\n this.has.top = !!this._api.top\n this.has.data = !!this._api.data\n this.has.concepts = !!this._api.concepts || this.has.data\n this.has.narrower = !!this._api.narrower\n this.has.ancestors = !!this._api.ancestors\n this.has.types = !!this._api.types\n this.has.suggest = !!this._api.suggest\n this.has.search = !!this._api.search\n this.has.auth = _.get(this._config, \"auth.key\") != null\n this._defaultParams = {\n // Default parameters mostly for DANTE\n properties: \"+created,issued,modified,editorialNote,scopeNote\",\n }\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.url API URL for server\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ url, scheme } = {}) {\n if (!url || !scheme) {\n return null\n }\n return {\n api: url,\n schemes: [scheme],\n }\n }\n\n /**\n * Returns the main vocabulary URI by requesting the scheme info and saving it in a cache.\n *\n * @private\n */\n async _getSchemeUri(scheme) {\n this._approvedSchemes = this._approvedSchemes || []\n this._rejectedSchemes = this._rejectedSchemes || []\n let _scheme = this._approvedSchemes.find(s => jskos.compare(scheme, s))\n if (_scheme) {\n return _scheme.uri\n }\n // Return null if it was already rejected\n if (this._rejectedSchemes.find(s => jskos.compare(scheme, s))) {\n return null\n }\n // Otherwise load scheme data and save in approved/rejected schemes\n const schemes = await this.getSchemes({ params: {\n uri: jskos.getAllUris(scheme).join(\"|\"),\n } })\n const resultScheme = schemes.find(s => jskos.compare(s, scheme))\n if (resultScheme) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n return resultScheme.uri\n } else {\n this._rejectedSchemes.push({\n uri: scheme.uri,\n identifier: scheme.identifier,\n })\n return null\n }\n }\n\n /**\n * Returns all concept schemes.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes(config) {\n if (!this._api.schemes) {\n // If an array of schemes is given, return that here\n if (Array.isArray(this.schemes)) {\n return this.schemes\n }\n throw new errors.MissingApiUrlError()\n }\n const schemes = await this.axios({\n ...config,\n method: \"get\",\n url: this._api.schemes,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 500,\n ...(config.params || {}),\n },\n })\n // If schemes were given in registry object, only request those schemes from API\n if (Array.isArray(this.schemes)) {\n return utils.withCustomProps(schemes.filter(s => jskos.isContainedIn(s, this.schemes)), schemes)\n } else {\n return schemes\n }\n }\n\n /**\n * Returns top concepts for a concept scheme.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getTop({ scheme, ...config }) {\n if (!this._api.top) {\n throw new errors.MissingApiUrlError()\n }\n if (!scheme) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\" })\n }\n const schemeUri = await this._getSchemeUri(scheme)\n if (!schemeUri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Requested vocabulary seems to be unsupported by this API.\" })\n }\n if (Array.isArray(this._api.top)) {\n return this._api.top\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.top,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: schemeUri,\n },\n })\n }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts, ...config }) {\n if (this.has.data === false) {\n throw new errors.MissingApiUrlError()\n }\n if (!concepts) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concepts\" })\n }\n if (!Array.isArray(concepts)) {\n concepts = [concepts]\n }\n let uris = concepts.map(concept => concept.uri).filter(uri => uri != null)\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.data,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 500,\n ...(config.params || {}),\n uri: uris.join(\"|\"),\n },\n })\n }\n\n /**\n * Returns narrower concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getNarrower({ concept, ...config }) {\n if (!this._api.narrower) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.narrower,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: concept.uri,\n },\n })\n }\n\n /**\n * Returns ancestor concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getAncestors({ concept, ...config }) {\n if (!this._api.ancestors) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.ancestors,\n params: {\n ...this._defaultParams,\n // ? What should the default limit be?\n limit: 10000,\n ...(config.params || {}),\n uri: concept.uri,\n },\n })\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string} [config.use=notation,label] which fields to search (\"notation\", \"label\" or \"notation,label\")\n * @param {string[]} [config.types=[]] list of type URIs\n * @param {string} [config.sort=score] sorting parameter\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest({ use = \"notation,label\", types = [], sort = \"score\", ...config }) {\n return this._search({\n ...config,\n endpoint: \"suggest\",\n params: {\n ...config.params,\n type: types.join(\"|\"),\n use,\n sort,\n },\n })\n }\n\n /**\n * Returns search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} result in JSKOS Format\n */\n async search({ types = [], ...config }) {\n return this._search({\n ...config,\n endpoint: \"search\",\n params: {\n ...config.params,\n type: types.join(\"|\"),\n },\n })\n }\n\n /**\n * Returns concept scheme suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string} [config.use=notation,label] which fields to search (\"notation\", \"label\" or \"notation,label\")\n * @param {string} [config.sort=score] sorting parameter\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async vocSuggest({ use = \"notation,label\", sort = \"score\", ...config }) {\n return this._search({\n ...config,\n endpoint: \"voc-suggest\",\n params: {\n ...config.params,\n use,\n sort,\n },\n })\n }\n\n /**\n * Returns concept scheme search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in JSKOS Format\n */\n async vocSearch(config) {\n return this._search({\n ...config,\n endpoint: \"voc-search\",\n })\n }\n\n async _search({ endpoint, scheme, search, limit, offset, params, ...config }) {\n let url = this._api[endpoint]\n if (!url) {\n throw new errors.MissingApiUrlError()\n }\n if (!search) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"search\" })\n }\n limit = limit || this._jskos.suggestResultLimit || 100\n offset = offset || 0\n // Scheme to search in\n const voc = scheme && await this._getSchemeUri(scheme)\n // Some registries use URL templates with {searchTerms}\n url = url.replace(\"{searchTerms}\", search)\n return this.axios({\n ...config,\n params: {\n ...this._defaultParams,\n ...params,\n limit: limit,\n count: limit, // Some endpoints use count instead of limit\n offset,\n search,\n query: search,\n voc,\n },\n method: \"get\",\n url,\n })\n }\n\n /**\n * Returns a list of types.\n *\n * @param {Object} config\n * @param {Object} [config.scheme] concept scheme to load types for\n * @returns {Object[]} array of JSKOS type objects\n */\n async getTypes({ scheme, ...config }) {\n if (!this._api.types) {\n throw new errors.MissingApiUrlError()\n }\n if (Array.isArray(this._api.types)) {\n return this._api.types\n }\n const schemeUri = scheme && await this._getSchemeUri(scheme)\n if (schemeUri) {\n _.set(config, \"params.uri\", schemeUri)\n }\n return this.axios({\n ...config,\n method: \"get\",\n url: this._api.types,\n })\n }\n\n}\n\nConceptApiProvider.providerName = \"ConceptApi\"\nConceptApiProvider.providerType = \"http://bartoc.org/api-type/jskos\"\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport { listOfCapabilities } from \"../utils/index.js\"\n\n// TODO: Document namespace etc.\n\n/**\n * Reconciliation Service API.\n *\n * This class provides access to the [Reconciliation Service API](https://reconciliation-api.github.io/specs/).\n *\n * To use it in a registry, specify `provider` as \"ReconciliationApi\", provide the API base URL as `api`, and the compatible scheme or schemes in `schemes`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/wikidata-reconciliation\",\n * \"provider\": \"ReconciliationApi\",\n * \"api\": \"https://tools.wmflabs.org/openrefine-wikidata/{language}/api\",\n * \"schemes\": [\n * {\n * \"uri\": \"http://bartoc.org/en/node/1940\"\n * }\n * ],\n * }\n * ```\n *\n * The string `{language}` in `api` will be replaced with the queried language for the reconciliation request.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class ReconciliationApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this._cache = []\n this.has.mappings = true\n // Explicitly set other capabilities to false\n listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * Returns a list of mappings suggestions.\n *\n * @param {Object} config\n * @param {Object} config.from JSKOS concept on from side\n * @param {Object} config.to JSKOS concept on to side\n * @param {Object} config.mode mappings mode\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, to, mode, ...config }) {\n let schemes = []\n if (_.isArray(this.schemes)) {\n schemes = this.schemes\n }\n let swap\n let concept\n let fromConceptScheme = _.get(from, \"inScheme[0]\")\n let toConceptScheme = _.get(to, \"inScheme[0]\")\n let fromScheme\n let toScheme\n if (!from || jskos.isContainedIn(fromConceptScheme, schemes)) {\n swap = true\n concept = to\n fromScheme = toConceptScheme\n toScheme = schemes.find(scheme => jskos.compare(scheme, fromConceptScheme)) || schemes[0]\n } else {\n swap = false\n concept = from\n fromScheme = fromConceptScheme\n toScheme = schemes.find(scheme => jskos.compare(scheme, toConceptScheme)) || schemes[0]\n }\n // Temporary to filter out GND mapping requests...\n // TODO: Remove?!?\n if (mode != \"or\") {\n return []\n }\n if (!this._api.api) {\n throw new errors.MissingApiUrlError()\n }\n if (!concept) {\n throw new errors.InvalidOrMissingParameterError({ parameter: swap ? \"to\" : \"from\" })\n }\n // Prepare labels\n let language = jskos.languagePreference.selectLanguage(concept.prefLabel)\n if (!language) {\n throw new errors.InvalidOrMissingParameterError({ parameter: swap ? \"to\" : \"from\", message: \"Missing language\" })\n }\n let altLabels = _.get(concept, `altLabel.${language}`, [])\n if (_.isString(altLabels)) {\n altLabels = [altLabels]\n }\n let prefLabel = _.get(concept, `prefLabel.${language}`)\n let labels = altLabels.concat([prefLabel])\n labels = [prefLabel]\n // Get results from API or cache\n let { url, data: results } = await this._getReconciliationResults({ ...config, labels, language })\n results = [].concat(...Object.values(results).map(value => value.result)).filter(r => r)\n // Sort results, first by score descending, then by match, then by length of notation\n results = results.sort((a, b) => {\n if (a.score != b.score) {\n return b.score - a.score\n }\n if (a.match != b.match) {\n if (a.match) {\n return -1\n } else {\n return 1\n }\n }\n return a.id.length - b.id.length\n })\n // Prepare namespace\n let namespace = _.get(toScheme, \"namespace\", \"\")\n // Map results to actual mappings\n let mappings = results.map(result => ({\n fromScheme,\n from: { memberSet: [concept] },\n toScheme,\n to: {\n memberSet: [\n {\n uri: namespace + result.id,\n },\n ],\n },\n type: [\n result.match ?\n \"http://www.w3.org/2004/02/skos/core#exactMatch\" :\n (\n result.score >= 80 ?\n \"http://www.w3.org/2004/02/skos/core#closeMatch\" :\n \"http://www.w3.org/2004/02/skos/core#mappingRelation\"\n ),\n ],\n }))\n if (swap) {\n // Swap mapping sides if only `to` was set\n mappings = mappings.map(mapping => Object.assign(mapping, {\n fromScheme: mapping.toScheme,\n from: mapping.to,\n toScheme: mapping.fromScheme,\n to: mapping.from,\n }))\n }\n mappings._url = url\n return mappings\n }\n\n /**\n * Internal function that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config passthrough of config object for axios request\n * @param {string[]} labels list of labels to get results for\n * @param {string} language language of labels\n */\n async _getReconciliationResults({ labels, language, ...config }) {\n labels = labels.sort()\n // Use local cache.\n let resultsFromCache = this._cache.find(item => {\n return _.isEqual(item.labels, labels) && item.language == language\n })\n if (resultsFromCache) {\n return resultsFromCache\n }\n // Prepare queries\n let queries = {}\n let index = 0\n for (let label of labels) {\n queries[`q${index}`] = {\n query: label,\n }\n index += 1\n }\n let url = this._api.api\n if (language) {\n url = url.replace(\"{language}\", language)\n }\n // Encode data\n const encodedData = `queries=${encodeURIComponent(JSON.stringify(queries))}`\n // Set appropriate header\n _.set(config, [\"headers\", \"Content-Type\"], \"application/x-www-form-urlencoded\")\n let data = await this.axios({\n ...config,\n method: \"post\",\n url,\n data: encodedData,\n })\n data = data || {}\n let newCacheEntry = {\n labels,\n language,\n data,\n url: `${url}${url.includes(\"?\") ? \"&\" : \"?\"}${encodedData}`,\n }\n this._cache.push(newCacheEntry)\n // Make sure there are a maximum of 20 entries in cache\n if (this._cache.length > 20) {\n this._cache = this._cache.slice(this._cache.length - 20)\n }\n return newCacheEntry\n }\n\n}\n\nReconciliationApiProvider.providerName = \"ReconciliationApi\"\nReconciliationApiProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport { listOfCapabilities } from \"../utils/index.js\"\nimport * as errors from \"../errors/index.js\"\n\n// TODO: Only keep the last 20 results in cache.\n// TODO: Try to remove dependencies on `selected`, `scheme._registry.registry.uri`, etc.\n\n/**\n * Label search suggestion provider.\n *\n * This provider offers mapping recommendations based on label match via the `/search` endpoint of JSKOS APIs.\n *\n * The provider requires that a list of initialized registries with search endpoints is provided via `cdk` (which refers to the CDK instance that's using this provider).\n *\n * To use it in a registry, specify `provider` as \"LabelSearchSuggestion\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/coli-conc-recommendations\"\n * \"provider\": \"LabelSearchSuggestion\"\n * }\n * ```\n *\n * You can provide a list of excluded schemes as JSKOS objects in `excludedSchemes`.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LabelSearchSuggestionProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this._cache = []\n this.has.mappings = true\n // Explicitly set other capabilities to false\n listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * Override `supportsScheme` to check whether a search URI is available for the scheme's registry.\n *\n * @param {Object} scheme - target scheme to check for support\n * @returns {boolean}\n */\n supportsScheme(scheme) {\n return _.get(scheme, \"_registry.has.search\", false)\n }\n\n /**\n * Returns a list of mappings.\n *\n * @param {Object} config\n * @param {Object} config.from JSKOS concept on from side\n * @param {Object} config.to JSKOS concept on to side\n * @param {Object} config.mode mappings mode\n * @param {Object} config.selected selected mappings in Cocoda\n * @returns {Object[]} array of JSKOS mapping objects\n */\n async getMappings({ from, to, mode, selected, limit = 10, ...config }) {\n // TODO: Why mode?\n if (mode != \"or\") {\n return []\n }\n if (!selected) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"selected\" })\n }\n let promises = []\n if (from && this.supportsScheme(selected.scheme[false])) {\n promises.push(this._getMappings({ ...config, concept: from, sourceScheme: selected.scheme[true], targetScheme: selected.scheme[false], limit }))\n } else {\n promises.push(Promise.resolve([]))\n }\n if (to && this.supportsScheme(selected.scheme[true])) {\n promises.push(this._getMappings({ ...config, concept: to, sourceScheme: selected.scheme[false], targetScheme: selected.scheme[true], limit, swap: true }))\n } else {\n promises.push(Promise.resolve([]))\n }\n let [fromResult, toResult] = await Promise.all(promises)\n // Filter all duplicates from toResult\n toResult = toResult.filter(m => !fromResult.find(n => jskos.compareMappingMembers(m, n)))\n // Reduce number of results until limit is reached\n while (fromResult.length + toResult.length > limit) {\n if (toResult.length >= fromResult.length) {\n toResult = toResult.slice(0, -1)\n } else {\n fromResult = fromResult.slice(0, -1)\n }\n }\n return _.union(fromResult, toResult)\n }\n\n /**\n * Internal function to get mapping recommendations for a certain concept with sourceScheme and targetScheme.\n *\n * @private\n *\n * @param {Object} config\n * @param {Object} config.concept\n * @param {Object} config.sourceScheme\n * @param {Pbject} config.targetScheme\n * @param {boolean} config.swap - whether to reverse the direction of the mappings\n */\n async _getMappings({ concept, sourceScheme, targetScheme, limit, swap = false, ...config }) {\n if (!concept || !sourceScheme || !targetScheme) {\n return []\n }\n // If source scheme is the same as target scheme, skip\n if (jskos.compare(sourceScheme, targetScheme)) {\n return []\n }\n // Prepare label\n // TODO: Can we use a language prioritiy list like for requests?\n const language = jskos.languagePreference.selectLanguage(concept.prefLabel) || this._defaultLanguages[0]\n let label = jskos.prefLabel(concept, {\n fallbackToUri: false,\n language,\n })\n if (!label) {\n return []\n }\n // Adjust prefLabel by removing everything from the first non-whitespace, non-letter character\n // (copied from Cocoda)\n const regexResult = /^[\\s\\w\u00E4\u00FC\u00F6\u00C4\u00DC\u00D6\u00DF]*\\w/.exec(label)\n label = regexResult ? regexResult[0] : label\n // Get results from API or cache\n const results = await this._getResults({ ...config, label, targetScheme, limit })\n // Map results to actual mappings\n let mappings = results.map(result => ({\n fromScheme: sourceScheme,\n from: { memberSet: [concept] },\n toScheme: targetScheme,\n to: { memberSet: [result] },\n type: [\"http://www.w3.org/2004/02/skos/core#mappingRelation\"],\n }))\n if (swap) {\n // Swap mapping sides if only `to` was set\n mappings = mappings.map(mapping => Object.assign(mapping, {\n fromScheme: mapping.toScheme,\n from: mapping.to,\n toScheme: mapping.fromScheme,\n to: mapping.from,\n }))\n }\n return mappings\n }\n\n /**\n * Internal function that either makes an API request or uses a local cache.\n *\n * @private\n *\n * @param {Object} config\n * @param {string} config.label\n * @param {Object} config.targetScheme\n */\n async _getResults({ label, targetScheme, limit, ...config }) {\n // Use local cache.\n let resultsFromCache = (this._cache[targetScheme.uri] || {})[label]\n if (resultsFromCache && resultsFromCache._limit >= limit) {\n return resultsFromCache\n }\n // Determine search URI for target scheme's registry\n const registry = _.get(targetScheme, \"_registry\")\n if (!registry || registry.has.search === false) {\n return []\n }\n // API request\n const data = await registry.search({\n ...config,\n search: label,\n scheme: targetScheme,\n limit,\n })\n // Save result in cache\n if (!this._cache[targetScheme.uri]) {\n this._cache[targetScheme.uri] = {}\n }\n this._cache[targetScheme.uri][label] = data\n this._cache[targetScheme.uri][label]._limit = limit\n return data\n }\n\n}\n\nLabelSearchSuggestionProvider.providerName = \"LabelSearchSuggestion\"\nLabelSearchSuggestionProvider.stored = false\n", "import BaseProvider from \"./base-provider.js\"\nimport jskos from \"jskos-tools\"\nimport * as _ from \"../utils/lodash.js\"\nimport * as errors from \"../errors/index.js\"\nimport { listOfCapabilities } from \"../utils/index.js\"\n\n/**\n * Skosmos API.\n *\n * [Skosmos](http://skosmos.org/) is a web application to publish SKOS-based vocabularies.\n * This class provides access to a Skosmos instance via its REST API.\n *\n * To use it in a registry, specify `provider` as \"SkosmosApi\" and provide the API base URL as `api`:\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/skosmos-zbw\",\n * \"provider\": \"SkosmosApi\",\n * \"api\": \"https://zbw.eu/beta/skosmos/rest/v1/\",\n * \"schemes\": [\n * {\n * \"uri\": \"http://bartoc.org/en/node/313\",\n * \"VOCID\": \"stw\"\n * }\n * ]\n * }\n * ```\n *\n * Currently, it is not possible to query a list of concept schemes from the API, so you need to provide this list including a `VOCID` for every scheme.\n *\n * Additionally, the following JSKOS properties can be provided: `prefLabel`, `notation`, `definition`\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class SkosmosApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this.has.schemes = true\n this.has.top = true\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = true\n this.has.ancestors = true\n this.has.types = true\n this.has.suggest = true\n this.has.search = true\n // Explicitly set other capabilities to false\n listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.url API URL for BARTOC instance\n * @param {Object} options.scheme scheme for which the config is requested\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ url, scheme } = {}) {\n if (!url || !scheme) {\n return null\n }\n const config = {}\n const match = url.match(/(.+\\/)([^/]+)\\/$/)\n if (!match) {\n return null\n }\n config.api = match[1] + \"rest/v1/\"\n scheme.VOCID = match[2]\n config.schemes = [scheme]\n return config\n }\n\n /**\n * @private\n */\n get _language() {\n return this.languages[0] || this._defaultLanguages[0] || \"en\"\n }\n\n /**\n * @private\n */\n _getApiUrl(scheme, endpoint, params) {\n const VOCID = scheme && scheme.VOCID || _.get(this.schemes.find(s => jskos.compare(s, scheme)), \"VOCID\")\n if (!VOCID) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Missing scheme or VOCID property on scheme\" })\n }\n endpoint = endpoint || \"\"\n params = params || {}\n if (!params.lang) {\n params.lang = this._language\n }\n const paramString = Object.keys(params).map(k => `${k}=${encodeURIComponent(params[k])}`).join(\"&\")\n return `${this._api.api}${VOCID}${endpoint}${paramString ? \"?\" + paramString : \"\"}`\n }\n\n /**\n * @private\n */\n _getDataUrl(concept, { addFormatParameter = true } = {}) {\n const scheme = _.get(concept, \"inScheme[0]\")\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\", message: \"Missing concept URI\" })\n }\n return this._getApiUrl(scheme, \"/data\", addFormatParameter ? { format: \"application/json\" } : {})\n }\n\n /**\n * Returns the main vocabulary URI by requesting the scheme info and saving it in a cache.\n *\n * @private\n */\n async _getSchemeUri(scheme) {\n this._approvedSchemes = this._approvedSchemes || []\n this._rejectedSchemes = this._rejectedSchemes || []\n let _scheme = this._approvedSchemes.find(s => jskos.compare(scheme, s))\n if (_scheme) {\n return _scheme.uri\n }\n // Return null if it was already rejected\n if (this._rejectedSchemes.find(s => jskos.compare(scheme, s))) {\n return null\n }\n // Otherwise load scheme data and save in approved/rejected schemes\n const url = this._getApiUrl(scheme, \"/\")\n const data = await this.axios({\n method: \"get\",\n url,\n })\n const resultScheme = data.conceptschemes.find(s => jskos.compare(s, scheme))\n if (resultScheme) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n return resultScheme.uri\n } else {\n this._rejectedSchemes.push({\n uri: scheme.uri,\n identifier: scheme.identifier,\n })\n return null\n }\n }\n\n /**\n * @private\n */\n _toJskosConcept(skosmosConcept, { concept, scheme, result, language } = {}) {\n if (!skosmosConcept) {\n return null\n }\n concept = jskos.deepCopy(concept || {})\n language = language || skosmosConcept.lang || \"en\"\n\n concept.uri = skosmosConcept.uri\n\n // Set inScheme\n if (scheme) {\n concept.inScheme = [scheme]\n }\n\n // Set prefLabel\n let prefLabel = skosmosConcept.matchedPrefLabel || skosmosConcept.prefLabel || skosmosConcept.label\n if (_.isString(prefLabel)) {\n _.set(concept, `prefLabel.${language}`, prefLabel)\n } else {\n if (prefLabel && !_.isArray(prefLabel)) {\n prefLabel = [prefLabel]\n }\n for (let label of prefLabel || []) {\n _.set(concept, `prefLabel.${label.lang}`, label.value)\n }\n }\n\n // Set altLabel\n let altLabel = skosmosConcept.altLabel\n if (_.isString(altLabel)) {\n _.set(concept, `altLabel.${language}`, [altLabel])\n } else {\n if (altLabel && !_.isArray(altLabel)) {\n altLabel = [altLabel]\n }\n for (let label of altLabel || []) {\n if (_.get(concept, `altLabel.${label.lang}`)) {\n concept.altLabel[label.lang].push(label.value)\n concept.altLabel[label.lang] = _.uniq(concept.altLabel[label.lang])\n } else {\n _.set(concept, `altLabel.${label.lang}`, [label.value])\n }\n }\n }\n\n // Set notation\n const notation = skosmosConcept.notation || skosmosConcept[\"skos:notation\"] || jskos.notation(concept)\n if (notation) {\n // notation can be string or object, so we're trying notation.value first\n concept.notation = [notation.value || notation]\n }\n\n // Set broader\n if (skosmosConcept.broader) {\n if (!_.isArray(skosmosConcept.broader)) {\n skosmosConcept.broader = [skosmosConcept.broader]\n }\n concept.broader = skosmosConcept.broader.map(concept => _.isString(concept) ? { uri: concept } : concept)\n }\n\n // Set narrower\n if (skosmosConcept.hasChildren === true) {\n concept.narrower = [null]\n } else if (skosmosConcept.hasChildren === false) {\n concept.narrower = []\n }\n\n // Set type\n if (skosmosConcept.type && !_.isArray(skosmosConcept.type)) {\n skosmosConcept.type = [skosmosConcept.type]\n }\n concept.type = concept.type || []\n for (let type of skosmosConcept.type || []) {\n if (!jskos.isValidUri(type)) {\n continue\n }\n const uriScheme = type.slice(0, type.indexOf(\":\"))\n // Try to find uriScheme in @context\n if (result && result[\"@context\"] && result[\"@context\"][uriScheme]) {\n type = type.replace(uriScheme + \":\", result[\"@context\"][uriScheme])\n }\n concept.type.push(type)\n }\n concept.type = _.uniq(concept.type)\n if (!concept.type.length) {\n concept.type = [\"http://www.w3.org/2004/02/skos/core#Concept\"]\n }\n\n return concept\n }\n\n /**\n * Returns all concept schemes.\n *\n * @param {Object} config\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes({ ...config }) {\n const schemes = []\n for (let scheme of this.schemes || []) {\n const url = this._getApiUrl(scheme, \"/\")\n const data = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const resultScheme = data.conceptschemes.find(s => jskos.compare(s, scheme))\n const label = resultScheme && (resultScheme.prefLabel || resultScheme.label || resultScheme.title)\n if (label) {\n _.set(scheme, `prefLabel.${this._language}`, label)\n }\n schemes.push(scheme)\n // Also add scheme to approved schemes\n this._approvedSchemes = this._approvedSchemes || []\n if (!this._approvedSchemes.find(s => jskos.compare(scheme, s))) {\n this._approvedSchemes.push({\n uri: resultScheme.uri,\n identifier: jskos.getAllUris(scheme),\n })\n }\n }\n return schemes\n }\n\n /**\n * Returns top concepts.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getTop({ scheme, ...config }) {\n const url = this._getApiUrl(scheme, \"/topConcepts\")\n const schemeUri = await this._getSchemeUri(scheme)\n if (!schemeUri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"Missing or unsupported scheme or VOCID property on scheme\" })\n }\n _.set(config, \"params.scheme\", schemeUri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = []\n for (let concept of response.topconcepts || []) {\n const newConcept = this._toJskosConcept(concept, {\n scheme,\n language: this._language,\n })\n newConcept.topConceptOf = [scheme]\n concepts.push(newConcept)\n }\n return concepts\n }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts, ...config }) {\n if (!_.isArray(concepts)) {\n concepts = [concepts]\n }\n concepts = concepts.map(c => ({ uri: c.uri, inScheme: c.inScheme }))\n const newConcepts = []\n for (let concept of concepts) {\n const url = this._getDataUrl(concept, { addFormatParameter: false })\n if (!url) {\n continue\n }\n const result = await this.axios({\n ...config,\n method: \"get\",\n url,\n params: {\n uri: concept.uri,\n format: \"application/json\",\n },\n })\n const resultConcept = result && result.graph && result.graph.find(c => jskos.compare(c, concept))\n if (resultConcept) {\n const newConcept = this._toJskosConcept(resultConcept, { concept, result })\n // Set broader/narrower\n for (let type of [\"broader\", \"narrower\"]) {\n let relatives = resultConcept[type] || newConcept[type]\n if (relatives && !_.isArray(relatives)) {\n relatives = [relatives]\n }\n if (!relatives) {\n relatives = []\n }\n newConcept[type] = relatives.map(r => this._toJskosConcept(result.graph.find(c => jskos.compare(c, r)), { scheme: concept.inScheme[0], result }))\n // if (relatives.length) {\n // newConcept[type] = [null]\n // } else {\n // newConcept[type] = []\n // }\n }\n // Set ancestors to empty array\n // ?\n newConcept.ancestors = []\n // Push to array\n newConcepts.push(newConcept)\n }\n }\n return newConcepts\n }\n\n /**\n * Returns narrower concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getNarrower({ concept, ...config }) {\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n const scheme = concept.inScheme[0]\n const url = this._getApiUrl(scheme, \"/children\")\n _.set(config, \"params.uri\", concept.uri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = (response.narrower || []).map(c => this._toJskosConcept(c, { scheme }))\n return concepts\n }\n\n /**\n * Returns ancestor concepts for a concept.\n *\n * @param {Object} config\n * @param {Object} config.concept concept object\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getAncestors({ concept, ...config }) {\n if (!concept || !concept.uri) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"concept\" })\n }\n const scheme = concept.inScheme[0]\n const url = this._getApiUrl(scheme, \"/broaderTransitive\")\n _.set(config, \"params.uri\", concept.uri)\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n let ancestors = []\n let uri = concept.uri\n while (uri) {\n if (uri != concept.uri) {\n const ancestor = _.get(response, `broaderTransitive[\"${uri}\"]`)\n ancestors = ancestors.concat([ancestor])\n }\n uri = _.get(response, `broaderTransitive[\"${uri}\"].broader[0]`)\n }\n const concepts = ancestors.map(c => this._toJskosConcept(c, { scheme })).filter(c => c.uri != concept.uri)\n return concepts\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest(config) {\n config._raw = true\n const concepts = await this.search(config)\n const result = [config.search, [], [], []]\n for (let concept of concepts) {\n const notation = jskos.notation(concept)\n const label = jskos.prefLabel(concept)\n result[1].push((notation ? notation + \" \" : \"\") + label)\n result[2].push(\"\")\n result[3].push(concept.uri)\n }\n if (concepts._totalCount != undefined) {\n result._totalCount = concepts._totalCount\n } else {\n result._totalCount = concepts.length\n }\n return result\n }\n\n /**\n * Returns concept search results.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} [config.scheme] concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {string[]} [config.types=[]] list of type URIs\n * @returns {Array} array of JSKOS concept objects\n */\n async search({ search, scheme, limit, types = [], ...config }) {\n const url = this._getApiUrl(scheme, \"/search\")\n _.set(config, \"params.query\", `${search}*`)\n _.set(config, \"params.unique\", 1)\n _.set(config, \"params.maxhits\", limit || 100)\n _.set(config, \"params.type\", types.join(\" \"))\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n const concepts = (response.results || []).map(c => this._toJskosConcept(c, { scheme }))\n return concepts\n }\n\n /**\n * Returns a list of types.\n *\n * @param {Object} config\n * @param {Object} [config.scheme] concept scheme to load types for\n * @returns {Object[]} array of JSKOS type objects\n */\n async getTypes({ scheme, ...config }) {\n const url = this._getApiUrl(scheme, \"/types\")\n const types = []\n const response = await this.axios({\n ...config,\n method: \"get\",\n url,\n })\n for (let type of (response && response.types) || []) {\n // Skip SKOS type Concept\n if (type.uri == \"http://www.w3.org/2004/02/skos/core#Concept\") {\n continue\n }\n // Set prefLabel if available\n if (type.label) {\n type.prefLabel = {\n [response[\"@context\"][\"@language\"]]: type.label,\n }\n delete type.label\n }\n types.push(type)\n }\n types._url = url\n return types\n }\n\n}\n\nSkosmosApiProvider.providerName = \"SkosmosApi\"\nSkosmosApiProvider.providerType = \"http://bartoc.org/api-type/skosmos\"\n", "import BaseProvider from \"./base-provider.js\"\nimport * as errors from \"../errors/index.js\"\nimport { listOfCapabilities } from \"../utils/index.js\"\nimport jskos from \"jskos-tools\"\nimport axios from \"axios\"\n\nconst locUriPrefix = \"http://id.loc.gov/authorities/\"\nconst supportedSchemes = [\n {\n uri: `${locUriPrefix}subjects`,\n identifier: [\n \"http://bartoc.org/en/node/454\",\n ],\n notation: [\"LCSH\"],\n concepts: [null],\n topConcepts: [],\n },\n {\n uri: `${locUriPrefix}names`,\n identifier: [\n \"http://bartoc.org/en/node/18536\",\n ],\n notation: [\"LCNAF\"],\n concepts: [null],\n topConcepts: [],\n },\n]\nconst lccUri = `${locUriPrefix}classification`\n\nfunction madsToJskosItem(data) {\n const item = {}\n item.uri = data[\"@id\"]\n // Notation\n item.notation = (data[\"http://www.loc.gov/mads/rdf/v1#code\"] || []).map(n => n[\"@value\"])\n // prefLabel\n const prefLabelArray = data[\"http://www.loc.gov/mads/rdf/v1#authoritativeLabel\"] || data[\"http://www.w3.org/2000/01/rdf-schema#label\"] || []\n if (prefLabelArray.length) {\n item.prefLabel = {}\n item.prefLabel[prefLabelArray[0][\"@language\"] || \"en\"] = prefLabelArray[0][\"@value\"]\n }\n // altLabel\n const altLabelArray = data[\"http://www.w3.org/2004/02/skos/core#altLabel\"] || []\n if (altLabelArray.length) {\n item.altLabel = { en: altLabelArray.map(l => l[\"@value\"]) }\n }\n // definition\n for (let definition of data[\"http://www.w3.org/2000/01/rdf-schema#comment\"] || []) {\n item.definition = item.definition || {}\n item.definition.en = item.definition.en || []\n item.definition.en.push(definition[\"@value\"])\n }\n return item\n}\n\nfunction madsToJskosScheme(data) {\n const scheme = madsToJskosItem(data)\n scheme.namespace = scheme.uri + \"/\"\n scheme.type = [\"http://www.w3.org/2004/02/skos/core#ConceptScheme\"]\n // TODO: topConcepts can possibly be reenabled for LCC\n // const topConcepts = data[\"http://www.loc.gov/mads/rdf/v1#hasMADSSchemeMember\"]\n // if (scheme.uri === lccUri && topConcepts) {\n // scheme.topConcepts = topConcepts.map(c => {\n // const concept = madsToJskosItem(c)\n // concept.inScheme = [{ uri: scheme.uri }]\n // return concept\n // })\n // }\n return scheme\n}\n\n\n// TODO: This might not be necessary anymore once LoC fixes their API.\nconst schemeNamespaceFilter = (scheme) => (c) => {\n if (!c || !scheme || !scheme.namespace) {\n // Do not filter if no scheme is given\n return true\n }\n return c.uri.startsWith(scheme.namespace)\n}\n\nfunction madsToJskosConcept(data, { scheme }) {\n const concept = madsToJskosItem(data)\n concept.type = [\"http://www.w3.org/2004/02/skos/core#Concept\"]\n concept.inScheme = scheme ? [scheme] : (data[\"http://www.loc.gov/mads/rdf/v1#isMemberOfMADSScheme\"] || []).map(s => supportedSchemes.find(s2 => s2.uri === s[\"@id\"]))\n if (!concept.inScheme.length || !concept.inScheme[0]) {\n // TODO: Should conversion fail if inScheme couldn't be set?\n delete concept.inScheme\n }\n // narrower\n const narrower = data[\"http://www.loc.gov/mads/rdf/v1#hasNarrowerAuthority\"] || (jskos.compare(concept.inScheme[0], { uri: lccUri }) && data[\"http://www.loc.gov/mads/rdf/v1#hasMADSCollectionMember\"]) || []\n concept.narrower = narrower.map(n => ({ uri: n[\"@id\"] })).filter(schemeNamespaceFilter(concept.inScheme && concept.inScheme[0]))\n // broader\n const broader = data[\"http://www.loc.gov/mads/rdf/v1#hasBroaderAuthority\"] || (jskos.compare(concept.inScheme[0], { uri: lccUri }) && data[\"http://www.loc.gov/mads/rdf/v1#isMemberOfMADSCollection\"]) || []\n concept.broader = broader.map(n => ({ uri: n[\"@id\"] })).filter(schemeNamespaceFilter(concept.inScheme && concept.inScheme[0]))\n return concept\n}\n\n/**\n * Library of Congress API (experimental)\n *\n * This class provides access to concept schemes and their concepts via the Library of Congress Linked Open Data Service (https://id.loc.gov/), in [JSKOS format](https://gbv.github.io/jskos/).\n *\n * To use it in a registry, specify `provider` as \"LocApi\":\n * ```json\n * {\n * \"uri\": \"http://coli-conc.gbv.de/registry/loc-concepts\",\n * \"provider\": \"LocApi\",\n * }\n * ```\n *\n * No further configuration is needed. Currently supported are LC Subject Headings (LCSH) and LC Name Authority File (LCNAF), both of which are hardcoded.\n *\n * Additionally, the following JSKOS properties on the registry can be provided: `prefLabel`, `notation`, `definition` (i.e. to be shown in Cocoda)\n *\n * @extends BaseProvider\n * @category Providers\n */\nexport default class LocApiProvider extends BaseProvider {\n\n /**\n * @private\n */\n _prepare() {\n this.has.schemes = true\n this.has.top = false\n this.has.data = true\n this.has.concepts = true\n this.has.narrower = false\n this.has.ancestors = false\n this.has.suggest = true\n this.has.search = true\n // Explicitly set other capabilities to false\n listOfCapabilities.filter(c => !this.has[c]).forEach(c => {\n this.has[c] = false\n })\n }\n\n /**\n * Used by `registryForScheme` (see src/lib/CocodaSDK.js) to determine a provider config for a concept schceme.\n *\n * @param {Object} options\n * @param {Object} options.scheme scheme for which the config is requested\n * @returns {Object} provider configuration\n */\n static _registryConfigForBartocApiConfig({ scheme } = {}) {\n // Check if scheme is supported\n if (!scheme || !supportedSchemes.find(s => jskos.compare(s, scheme))) {\n return null\n }\n // We don't need any API endpoints because they are hardcoded.\n return {\n schemes: [scheme],\n }\n }\n\n /**\n * Returns all concept schemes.\n *\n * @returns {Object[]} array of JSKOS concept scheme objects\n */\n async getSchemes() {\n const schemes = []\n\n for (let scheme of await Promise.all(\n supportedSchemes.filter(s => !this.schemes || !this.schemes.length || this.schemes.find(s2 => jskos.compare(s, s2))).map(s => axios({\n method: \"get\",\n url: `${s.uri.replace(\"http:\", \"https:\")}.json`,\n }).then(({ status, data }) => {\n if (status === 200) {\n let scheme = data.find(d => s.uri === d[\"@id\"])\n if (scheme) {\n scheme = jskos.merge(madsToJskosScheme(scheme), s)\n scheme.topConcepts = (scheme.topConcepts || []).filter(c => c)\n return scheme\n }\n }\n return null\n })))) {\n if (scheme) {\n schemes.push(scheme)\n }\n }\n\n return schemes\n }\n\n /**\n * TODO: Possibly reenable for LCC\n * Returns top concepts for a concept scheme.\n *\n * @param {Object} config\n * @param {Object} config.scheme concept scheme object\n * @returns {Object[]} array of JSKOS concept objects\n */\n // async getTop({ scheme }) {\n // if (scheme.topConcepts && !scheme.topConcepts.includes(null)) {\n // return scheme.topConcepts\n // }\n // const schemes = await this.getSchemes()\n // scheme = schemes.find(s => jskos.compare(s, scheme))\n // return scheme && scheme.topConcepts || []\n // }\n\n /**\n * Returns details for a list of concepts.\n *\n * @param {Object} config\n * @param {Object[]} config.concepts list of concept objects to load\n * @returns {Object[]} array of JSKOS concept objects\n */\n async getConcepts({ concepts }) {\n if (!Array.isArray(concepts)) {\n concepts = [concepts]\n }\n\n const resultConcepts = []\n\n for (let concept of await Promise.all(concepts.map(c => axios({\n method: \"get\",\n url: `${c.uri.replace(\"http:\", \"https:\")}.json`,\n }).then(({ status, data }) => {\n if (status === 200) {\n let concept = data.find(d => c.uri === d[\"@id\"])\n if (concept) {\n return madsToJskosConcept(concept, { scheme: c.inScheme && c.inScheme[0] })\n }\n return null\n }\n\n })))) {\n if (concept) {\n resultConcepts.push(concept)\n }\n }\n\n return resultConcepts\n }\n\n /**\n * Returns suggestion result in OpenSearch Suggest Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} config.scheme concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in OpenSearch Suggest Format\n */\n async suggest(config) {\n const results = await this.search(config)\n return [\n config.search,\n results.map(c => {\n return jskos.prefLabel(c, { fallbackToUri: true })\n }),\n [],\n results.map(c => c.uri),\n ]\n }\n\n /**\n * Returns search results in JSKOS Format.\n *\n * @param {Object} config\n * @param {string} config.search search string\n * @param {Object} config.scheme concept scheme to search in\n * @param {number} [config.limit=100] maximum number of search results (default might be overridden by registry)\n * @param {number} [config.offset=0] offset\n * @returns {Array} result in JSKOS Format\n */\n async search({ search, scheme, limit, offset }) {\n const schemeUri = jskos.getAllUris(scheme).find(uri => uri.startsWith(locUriPrefix))\n if (!schemeUri || !supportedSchemes.find(s => jskos.compare(s, { uri: schemeUri }))) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"scheme\", message: \"provided scheme is not supported (yet)\" })\n }\n if (!search) {\n throw new errors.InvalidOrMissingParameterError({ parameter: \"search\", message: \"parameter is empty or missing\" })\n }\n limit = limit || this._jskos.suggestResultLimit || 100\n offset = offset || 0\n const { data } = await axios({\n method: \"get\",\n url: `${schemeUri}/suggest2`.replace(\"http:\", \"https:\"),\n params: {\n q: search,\n count: limit || 100,\n offset,\n searchtype: \"keyword\",\n },\n })\n return (data.hits || []).map(d => ({\n uri: d.uri,\n notation: [d.token],\n prefLabel: { en: d.aLabel },\n inScheme: [scheme],\n })).filter(schemeNamespaceFilter(scheme))\n }\n\n}\n\nLocApiProvider.providerName = \"LocApi\"\nLocApiProvider.providerType = \"http://bartoc.org/api-type/loc\"\n"],
5
+ "mappings": ";;;;;;;0wDAAA,gCAEA,GAAO,QAAU,SAAc,EAAI,EAAS,CAC1C,MAAO,WAAgB,CAErB,OADI,GAAO,GAAI,OAAM,UAAU,QACtB,EAAI,EAAG,EAAI,EAAK,OAAQ,IAC/B,EAAK,GAAK,UAAU,GAEtB,MAAO,GAAG,MAAM,EAAS,OCR7B,gCAEA,GAAI,IAAO,KAIP,GAAW,OAAO,UAAU,SAQ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