' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\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 */\n function eq(value, other) {\n return value === other || value !== value && other !== other;\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function (value, other) {\n return value >= other;\n });\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 */\n var isArguments = baseIsArguments(function () {\n return arguments;\n }()) ? baseIsArguments : function (value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\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 */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` 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 an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\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 */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\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 */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or 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 boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;\n }\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 */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` 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 date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\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 DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\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 */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 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\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 */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\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 * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\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 an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag || typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\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 finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\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 */\n function 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\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\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 integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\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 */\n function isLength(value) {\n return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\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 */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\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 */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\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 */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\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 `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\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 native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\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 `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\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 nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\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 number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' || isObjectLike(value) && baseGetTag(value) == numberTag;\n }\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 */\n function 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 && funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` 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 regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\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 safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\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 */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\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 */\n function isString(value) {\n return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;\n }\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 */\n function isSymbol(value) {\n return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;\n }\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 */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\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 `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` 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 weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` 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 weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.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 `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function (value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = value < 0 ? -1 : 1;\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n return result === result ? remainder ? result - remainder : result : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is 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 convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? other + '' : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;\n }\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 */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;\n }\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 */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function (object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function (object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function (object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function (object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function (object, sources) {\n object = Object(object);\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {\n object[key] = source[key];\n }\n }\n }\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function (args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration 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 _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.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 _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\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 */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.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 _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\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 */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function (result, value, key) {\n if (value != null && typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function (result, value, key) {\n if (value != null && typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\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 */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\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 */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.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 the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n baseForOwn(object, function (value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.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 the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n baseForOwn(object, function (value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\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 */\n var merge = createAssigner(function (object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function (object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\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 */\n var 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\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\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 pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function (object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function (prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function (value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\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 */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.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 * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.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 * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor() : [];\n } else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n } else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function (value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.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 {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.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 {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values 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 values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n } else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n } else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function (result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n var length = string.length;\n position = position === undefined ? length : baseClamp(toInteger(position), 0, length);\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\\\$&') : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function (result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function (result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n var strLength = length ? stringSize(string) : 0;\n return length && strLength < length ? string + createPadding(length - strLength, chars) : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n var strLength = length ? stringSize(string) : 0;\n return length && strLength < length ? createPadding(length - strLength, chars) + string : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if (guard ? isIterateeCall(string, n, guard) : n === undefined) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function (result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (typeof separator == 'string' || separator != null && !isRegExp(separator))) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function (result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '\n","import { render, staticRenderFns } from \"./EditIcon.vue?vue&type=template&id=109a222a&\"\nimport script from \"./EditIcon.vue?vue&type=script&lang=js&\"\nexport * from \"./EditIcon.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/**\n * vee-validate v3.4.5\n * (c) 2020 Abdelrahman Awad\n * @license MIT\n */\nimport Vue from 'vue';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\nvar __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nfunction __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nfunction __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n}\nfunction isNaN(value) {\n // NaN is the one value that does not equal itself.\n // eslint-disable-next-line\n return value !== value;\n}\nfunction isNullOrUndefined(value) {\n return value === null || value === undefined;\n}\nfunction isEmptyArray(arr) {\n return Array.isArray(arr) && arr.length === 0;\n}\nvar isObject = function (obj) {\n return obj !== null && obj && typeof obj === 'object' && !Array.isArray(obj);\n};\n/**\r\n * A reference comparison function with NaN support\r\n */\nfunction isRefEqual(lhs, rhs) {\n if (isNaN(lhs) && isNaN(rhs)) {\n return true;\n }\n return lhs === rhs;\n}\n/**\r\n * Shallow object comparison.\r\n */\nfunction isEqual(lhs, rhs) {\n if (lhs instanceof RegExp && rhs instanceof RegExp) {\n return isEqual(lhs.source, rhs.source) && isEqual(lhs.flags, rhs.flags);\n }\n if (Array.isArray(lhs) && Array.isArray(rhs)) {\n if (lhs.length !== rhs.length) return false;\n for (var i = 0; i < lhs.length; i++) {\n if (!isEqual(lhs[i], rhs[i])) {\n return false;\n }\n }\n return true;\n }\n // if both are objects, compare each key recursively.\n if (isObject(lhs) && isObject(rhs)) {\n return Object.keys(lhs).every(function (key) {\n return isEqual(lhs[key], rhs[key]);\n }) && Object.keys(rhs).every(function (key) {\n return isEqual(lhs[key], rhs[key]);\n });\n }\n return isRefEqual(lhs, rhs);\n}\n// Checks if a given value is not an empty string or null or undefined.\nfunction isSpecified(val) {\n if (val === '') {\n return false;\n }\n return !isNullOrUndefined(val);\n}\nfunction isCallable(fn) {\n return typeof fn === 'function';\n}\nfunction isLocator(value) {\n return isCallable(value) && !!value.__locatorRef;\n}\nfunction findIndex(arrayLike, predicate) {\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\n if (isCallable(array.findIndex)) {\n return array.findIndex(predicate);\n }\n /* istanbul ignore next */\n for (var i = 0; i < array.length; i++) {\n if (predicate(array[i], i)) {\n return i;\n }\n }\n /* istanbul ignore next */\n return -1;\n}\n/**\r\n * finds the first element that satisfies the predicate callback, polyfills array.find\r\n */\nfunction find(arrayLike, predicate) {\n var array = Array.isArray(arrayLike) ? arrayLike : toArray(arrayLike);\n var idx = findIndex(array, predicate);\n return idx === -1 ? undefined : array[idx];\n}\nfunction includes(collection, item) {\n return collection.indexOf(item) !== -1;\n}\n/**\r\n * Converts an array-like object to array, provides a simple polyfill for Array.from\r\n */\nfunction toArray(arrayLike) {\n if (isCallable(Array.from)) {\n return Array.from(arrayLike);\n }\n /* istanbul ignore next */\n return _copyArray(arrayLike);\n}\n/* istanbul ignore next */\nfunction _copyArray(arrayLike) {\n var array = [];\n var length = arrayLike.length;\n for (var i = 0; i < length; i++) {\n array.push(arrayLike[i]);\n }\n return array;\n}\nfunction values(obj) {\n if (isCallable(Object.values)) {\n return Object.values(obj);\n }\n // fallback to keys()\n /* istanbul ignore next */\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n}\nfunction merge(target, source) {\n Object.keys(source).forEach(function (key) {\n if (isObject(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n merge(target[key], source[key]);\n return;\n }\n target[key] = source[key];\n });\n return target;\n}\nfunction createFlags() {\n return {\n untouched: true,\n touched: false,\n dirty: false,\n pristine: true,\n valid: false,\n invalid: false,\n validated: false,\n pending: false,\n required: false,\n changed: false,\n passed: false,\n failed: false\n };\n}\nfunction identity(x) {\n return x;\n}\nfunction debounce(fn, wait, token) {\n if (wait === void 0) {\n wait = 0;\n }\n if (token === void 0) {\n token = {\n cancelled: false\n };\n }\n if (wait === 0) {\n return fn;\n }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var later = function () {\n timeout = undefined;\n // check if the fn call was cancelled.\n if (!token.cancelled) fn.apply(void 0, args);\n };\n // because we might want to use Node.js setTimout for SSR.\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n };\n}\n\n/**\r\n * Emits a warning to the console\r\n */\nfunction warn(message) {\n console.warn(\"[vee-validate] \" + message);\n}\n/**\r\n * Replaces placeholder values in a string with their actual values\r\n */\nfunction interpolate(template, values) {\n return template.replace(/{([^}]+)}/g, function (_, p) {\n return p in values ? values[p] : \"{\" + p + \"}\";\n });\n}\nvar RULES = {};\nfunction normalizeSchema(schema) {\n var _a;\n if ((_a = schema.params) === null || _a === void 0 ? void 0 : _a.length) {\n schema.params = schema.params.map(function (param) {\n if (typeof param === 'string') {\n return {\n name: param\n };\n }\n return param;\n });\n }\n return schema;\n}\nvar RuleContainer = /** @class */function () {\n function RuleContainer() {}\n RuleContainer.extend = function (name, schema) {\n // if rule already exists, overwrite it.\n var rule = normalizeSchema(schema);\n if (RULES[name]) {\n RULES[name] = merge(RULES[name], schema);\n return;\n }\n RULES[name] = __assign({\n lazy: false,\n computesRequired: false\n }, rule);\n };\n RuleContainer.isLazy = function (name) {\n var _a;\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.lazy);\n };\n RuleContainer.isRequireRule = function (name) {\n var _a;\n return !!((_a = RULES[name]) === null || _a === void 0 ? void 0 : _a.computesRequired);\n };\n RuleContainer.getRuleDefinition = function (ruleName) {\n return RULES[ruleName];\n };\n return RuleContainer;\n}();\n/**\r\n * Adds a custom validator to the list of validation rules.\r\n */\nfunction extend(name, schema) {\n // makes sure new rules are properly formatted.\n guardExtend(name, schema);\n // Full schema object.\n if (typeof schema === 'object') {\n RuleContainer.extend(name, schema);\n return;\n }\n RuleContainer.extend(name, {\n validate: schema\n });\n}\n/**\r\n * Guards from extension violations.\r\n */\nfunction guardExtend(name, validator) {\n if (isCallable(validator)) {\n return;\n }\n if (isCallable(validator.validate)) {\n return;\n }\n if (RuleContainer.getRuleDefinition(name)) {\n return;\n }\n throw new Error(\"Extension Error: The validator '\" + name + \"' must be a function or have a 'validate' method.\");\n}\nvar DEFAULT_CONFIG = {\n defaultMessage: \"{_field_} is not valid.\",\n skipOptional: true,\n classes: {\n touched: 'touched',\n untouched: 'untouched',\n valid: 'valid',\n invalid: 'invalid',\n pristine: 'pristine',\n dirty: 'dirty' // control has been interacted with\n },\n\n bails: true,\n mode: 'aggressive',\n useConstraintAttrs: true\n};\nvar currentConfig = __assign({}, DEFAULT_CONFIG);\nvar getConfig = function () {\n return currentConfig;\n};\nvar setConfig = function (newConf) {\n currentConfig = __assign(__assign({}, currentConfig), newConf);\n};\nvar configure = function (cfg) {\n setConfig(cfg);\n};\n\n/**\r\n * Normalizes the given rules expression.\r\n */\nfunction normalizeRules(rules) {\n // if falsy value return an empty object.\n var acc = {};\n Object.defineProperty(acc, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n if (!rules) {\n return acc;\n }\n // Object is already normalized, skip.\n if (isObject(rules) && rules._$$isNormalized) {\n return rules;\n }\n if (isObject(rules)) {\n return Object.keys(rules).reduce(function (prev, curr) {\n var params = [];\n if (rules[curr] === true) {\n params = [];\n } else if (Array.isArray(rules[curr])) {\n params = rules[curr];\n } else if (isObject(rules[curr])) {\n params = rules[curr];\n } else {\n params = [rules[curr]];\n }\n if (rules[curr] !== false) {\n prev[curr] = buildParams(curr, params);\n }\n return prev;\n }, acc);\n }\n /* istanbul ignore if */\n if (typeof rules !== 'string') {\n warn('rules must be either a string or an object.');\n return acc;\n }\n return rules.split('|').reduce(function (prev, rule) {\n var parsedRule = parseRule(rule);\n if (!parsedRule.name) {\n return prev;\n }\n prev[parsedRule.name] = buildParams(parsedRule.name, parsedRule.params);\n return prev;\n }, acc);\n}\nfunction buildParams(ruleName, provided) {\n var ruleSchema = RuleContainer.getRuleDefinition(ruleName);\n if (!ruleSchema) {\n return provided;\n }\n var params = {};\n if (!ruleSchema.params && !Array.isArray(provided)) {\n throw new Error('You provided an object params to a rule that has no defined schema.');\n }\n // Rule probably uses an array for their args, keep it as is.\n if (Array.isArray(provided) && !ruleSchema.params) {\n return provided;\n }\n var definedParams;\n // collect the params schema.\n if (!ruleSchema.params || ruleSchema.params.length < provided.length && Array.isArray(provided)) {\n var lastDefinedParam_1;\n // collect any additional parameters in the last item.\n definedParams = provided.map(function (_, idx) {\n var _a;\n var param = (_a = ruleSchema.params) === null || _a === void 0 ? void 0 : _a[idx];\n lastDefinedParam_1 = param || lastDefinedParam_1;\n if (!param) {\n param = lastDefinedParam_1;\n }\n return param;\n });\n } else {\n definedParams = ruleSchema.params;\n }\n // Match the provided array length with a temporary schema.\n for (var i = 0; i < definedParams.length; i++) {\n var options = definedParams[i];\n var value = options.default;\n // if the provided is an array, map element value.\n if (Array.isArray(provided)) {\n if (i in provided) {\n value = provided[i];\n }\n } else {\n // If the param exists in the provided object.\n if (options.name in provided) {\n value = provided[options.name];\n // if the provided is the first param value.\n } else if (definedParams.length === 1) {\n value = provided;\n }\n }\n // if the param is a target, resolve the target value.\n if (options.isTarget) {\n value = createLocator(value, options.cast);\n }\n // A target param using interpolation\n if (typeof value === 'string' && value[0] === '@') {\n value = createLocator(value.slice(1), options.cast);\n }\n // If there is a transformer defined.\n if (!isLocator(value) && options.cast) {\n value = options.cast(value);\n }\n // already been set, probably multiple values.\n if (params[options.name]) {\n params[options.name] = Array.isArray(params[options.name]) ? params[options.name] : [params[options.name]];\n params[options.name].push(value);\n } else {\n // set the value.\n params[options.name] = value;\n }\n }\n return params;\n}\n/**\r\n * Parses a rule string expression.\r\n */\nvar parseRule = function (rule) {\n var params = [];\n var name = rule.split(':')[0];\n if (includes(rule, ':')) {\n params = rule.split(':').slice(1).join(':').split(',');\n }\n return {\n name: name,\n params: params\n };\n};\nfunction createLocator(value, castFn) {\n var locator = function (crossTable) {\n var val = crossTable[value];\n return castFn ? castFn(val) : val;\n };\n locator.__locatorRef = value;\n return locator;\n}\nfunction extractLocators(params) {\n if (Array.isArray(params)) {\n return params.filter(function (param) {\n return isLocator(param) || typeof param === 'string' && param[0] === '@';\n });\n }\n return Object.keys(params).filter(function (key) {\n return isLocator(params[key]);\n }).map(function (key) {\n return params[key];\n });\n}\n\n/**\r\n * Validates a value against the rules.\r\n */\nfunction validate(value, rules, options) {\n if (options === void 0) {\n options = {};\n }\n return __awaiter(this, void 0, void 0, function () {\n var shouldBail, skipIfEmpty, field, result, errors, failedRules, regenerateMap;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n shouldBail = options === null || options === void 0 ? void 0 : options.bails;\n skipIfEmpty = options === null || options === void 0 ? void 0 : options.skipIfEmpty;\n field = {\n name: (options === null || options === void 0 ? void 0 : options.name) || '{field}',\n rules: normalizeRules(rules),\n bails: shouldBail !== null && shouldBail !== void 0 ? shouldBail : true,\n skipIfEmpty: skipIfEmpty !== null && skipIfEmpty !== void 0 ? skipIfEmpty : true,\n forceRequired: false,\n crossTable: (options === null || options === void 0 ? void 0 : options.values) || {},\n names: (options === null || options === void 0 ? void 0 : options.names) || {},\n customMessages: (options === null || options === void 0 ? void 0 : options.customMessages) || {}\n };\n return [4 /*yield*/, _validate(field, value, options)];\n case 1:\n result = _a.sent();\n errors = [];\n failedRules = {};\n regenerateMap = {};\n result.errors.forEach(function (e) {\n var msg = e.msg();\n errors.push(msg);\n failedRules[e.rule] = msg;\n regenerateMap[e.rule] = e.msg;\n });\n return [2 /*return*/, {\n valid: result.valid,\n errors: errors,\n failedRules: failedRules,\n regenerateMap: regenerateMap\n }];\n }\n });\n });\n}\n/**\r\n * Starts the validation process.\r\n */\nfunction _validate(field, value, _a) {\n var _b = (_a === void 0 ? {} : _a).isInitial,\n isInitial = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n var _c, shouldSkip, errors, rules, length, i, rule, result;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n return [4 /*yield*/, _shouldSkip(field, value)];\n case 1:\n _c = _d.sent(), shouldSkip = _c.shouldSkip, errors = _c.errors;\n if (shouldSkip) {\n return [2 /*return*/, {\n valid: !errors.length,\n errors: errors\n }];\n }\n rules = Object.keys(field.rules).filter(function (rule) {\n return !RuleContainer.isRequireRule(rule);\n });\n length = rules.length;\n i = 0;\n _d.label = 2;\n case 2:\n if (!(i < length)) return [3 /*break*/, 5];\n if (isInitial && RuleContainer.isLazy(rules[i])) {\n return [3 /*break*/, 4];\n }\n rule = rules[i];\n return [4 /*yield*/, _test(field, value, {\n name: rule,\n params: field.rules[rule]\n })];\n case 3:\n result = _d.sent();\n if (!result.valid && result.error) {\n errors.push(result.error);\n if (field.bails) {\n return [2 /*return*/, {\n valid: false,\n errors: errors\n }];\n }\n }\n _d.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n return [2 /*return*/, {\n valid: !errors.length,\n errors: errors\n }];\n }\n });\n });\n}\nfunction _shouldSkip(field, value) {\n return __awaiter(this, void 0, void 0, function () {\n var requireRules, length, errors, isEmpty, isEmptyAndOptional, isRequired, i, rule, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n requireRules = Object.keys(field.rules).filter(RuleContainer.isRequireRule);\n length = requireRules.length;\n errors = [];\n isEmpty = isNullOrUndefined(value) || value === '' || isEmptyArray(value);\n isEmptyAndOptional = isEmpty && field.skipIfEmpty;\n isRequired = false;\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < length)) return [3 /*break*/, 4];\n rule = requireRules[i];\n return [4 /*yield*/, _test(field, value, {\n name: rule,\n params: field.rules[rule]\n })];\n case 2:\n result = _a.sent();\n if (!isObject(result)) {\n throw new Error('Require rules has to return an object (see docs)');\n }\n if (result.required) {\n isRequired = true;\n }\n if (!result.valid && result.error) {\n errors.push(result.error);\n // Exit early as the field is required and failed validation.\n if (field.bails) {\n return [2 /*return*/, {\n shouldSkip: true,\n errors: errors\n }];\n }\n }\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4:\n if (isEmpty && !isRequired && !field.skipIfEmpty) {\n return [2 /*return*/, {\n shouldSkip: false,\n errors: errors\n }];\n }\n // field is configured to run through the pipeline regardless\n if (!field.bails && !isEmptyAndOptional) {\n return [2 /*return*/, {\n shouldSkip: false,\n errors: errors\n }];\n }\n // skip if the field is not required and has an empty value.\n return [2 /*return*/, {\n shouldSkip: !isRequired && isEmpty,\n errors: errors\n }];\n }\n });\n });\n}\n/**\r\n * Tests a single input value against a rule.\r\n */\nfunction _test(field, value, rule) {\n return __awaiter(this, void 0, void 0, function () {\n var ruleSchema, normalizedValue, params, result, values_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n ruleSchema = RuleContainer.getRuleDefinition(rule.name);\n if (!ruleSchema || !ruleSchema.validate) {\n throw new Error(\"No such validator '\" + rule.name + \"' exists.\");\n }\n normalizedValue = ruleSchema.castValue ? ruleSchema.castValue(value) : value;\n params = fillTargetValues(rule.params, field.crossTable);\n return [4 /*yield*/, ruleSchema.validate(normalizedValue, params)];\n case 1:\n result = _a.sent();\n if (typeof result === 'string') {\n values_1 = __assign(__assign({}, params || {}), {\n _field_: field.name,\n _value_: value,\n _rule_: rule.name\n });\n return [2 /*return*/, {\n valid: false,\n error: {\n rule: rule.name,\n msg: function () {\n return interpolate(result, values_1);\n }\n }\n }];\n }\n if (!isObject(result)) {\n result = {\n valid: result\n };\n }\n return [2 /*return*/, {\n valid: result.valid,\n required: result.required,\n error: result.valid ? undefined : _generateFieldError(field, value, ruleSchema, rule.name, params)\n }];\n }\n });\n });\n}\n/**\r\n * Generates error messages.\r\n */\nfunction _generateFieldError(field, value, ruleSchema, ruleName, params) {\n var _a;\n var message = (_a = field.customMessages[ruleName]) !== null && _a !== void 0 ? _a : ruleSchema.message;\n var ruleTargets = _getRuleTargets(field, ruleSchema, ruleName);\n var _b = _getUserTargets(field, ruleSchema, ruleName, message),\n userTargets = _b.userTargets,\n userMessage = _b.userMessage;\n var values = __assign(__assign(__assign(__assign({}, params || {}), {\n _field_: field.name,\n _value_: value,\n _rule_: ruleName\n }), ruleTargets), userTargets);\n return {\n msg: function () {\n return _normalizeMessage(userMessage || getConfig().defaultMessage, field.name, values);\n },\n rule: ruleName\n };\n}\nfunction _getRuleTargets(field, ruleSchema, ruleName) {\n var params = ruleSchema.params;\n if (!params) {\n return {};\n }\n var numTargets = params.filter(function (param) {\n return param.isTarget;\n }).length;\n if (numTargets <= 0) {\n return {};\n }\n var names = {};\n var ruleConfig = field.rules[ruleName];\n if (!Array.isArray(ruleConfig) && isObject(ruleConfig)) {\n ruleConfig = params.map(function (param) {\n return ruleConfig[param.name];\n });\n }\n for (var index = 0; index < params.length; index++) {\n var param = params[index];\n var key = ruleConfig[index];\n if (!isLocator(key)) {\n continue;\n }\n key = key.__locatorRef;\n var name_1 = field.names[key] || key;\n names[param.name] = name_1;\n names[\"_\" + param.name + \"_\"] = field.crossTable[key];\n }\n return names;\n}\nfunction _getUserTargets(field, ruleSchema, ruleName, userMessage) {\n var userTargets = {};\n var rules = field.rules[ruleName];\n var params = ruleSchema.params || [];\n // early return if no rules\n if (!rules) {\n return {};\n }\n // check all rules to convert targets\n Object.keys(rules).forEach(function (key, index) {\n // get the rule\n var rule = rules[key];\n if (!isLocator(rule)) {\n return {};\n }\n // get associated parameter\n var param = params[index];\n if (!param) {\n return {};\n }\n // grab the name of the target\n var name = rule.__locatorRef;\n userTargets[param.name] = field.names[name] || name;\n userTargets[\"_\" + param.name + \"_\"] = field.crossTable[name];\n });\n return {\n userTargets: userTargets,\n userMessage: userMessage\n };\n}\nfunction _normalizeMessage(template, field, values) {\n if (typeof template === 'function') {\n return template(field, values);\n }\n return interpolate(template, __assign(__assign({}, values), {\n _field_: field\n }));\n}\nfunction fillTargetValues(params, crossTable) {\n if (Array.isArray(params)) {\n return params.map(function (param) {\n var targetPart = typeof param === 'string' && param[0] === '@' ? param.slice(1) : param;\n if (targetPart in crossTable) {\n return crossTable[targetPart];\n }\n return param;\n });\n }\n var values = {};\n var normalize = function (value) {\n if (isLocator(value)) {\n return value(crossTable);\n }\n return value;\n };\n Object.keys(params).forEach(function (param) {\n values[param] = normalize(params[param]);\n });\n return values;\n}\nvar aggressive = function () {\n return {\n on: ['input', 'blur']\n };\n};\nvar lazy = function () {\n return {\n on: ['change', 'blur']\n };\n};\nvar eager = function (_a) {\n var errors = _a.errors;\n if (errors.length) {\n return {\n on: ['input', 'change']\n };\n }\n return {\n on: ['change', 'blur']\n };\n};\nvar passive = function () {\n return {\n on: []\n };\n};\nvar modes = {\n aggressive: aggressive,\n eager: eager,\n passive: passive,\n lazy: lazy\n};\nvar setInteractionMode = function (mode, implementation) {\n setConfig({\n mode: mode\n });\n if (!implementation) {\n return;\n }\n if (!isCallable(implementation)) {\n throw new Error('A mode implementation must be a function');\n }\n modes[mode] = implementation;\n};\nvar EVENT_BUS = new Vue();\nfunction localeChanged() {\n EVENT_BUS.$emit('change:locale');\n}\nvar Dictionary = /** @class */function () {\n function Dictionary(locale, dictionary) {\n this.container = {};\n this.locale = locale;\n this.merge(dictionary);\n }\n Dictionary.prototype.resolve = function (field, rule, values) {\n return this.format(this.locale, field, rule, values);\n };\n Dictionary.prototype.format = function (locale, field, rule, values) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n var message;\n // find if specific message for that field was specified.\n var fieldContainer = (_c = (_b = (_a = this.container[locale]) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b[field]) === null || _c === void 0 ? void 0 : _c[rule];\n var messageContainer = (_e = (_d = this.container[locale]) === null || _d === void 0 ? void 0 : _d.messages) === null || _e === void 0 ? void 0 : _e[rule];\n message = fieldContainer || messageContainer || '';\n if (!message) {\n message = '{_field_} is not valid';\n }\n field = (_h = (_g = (_f = this.container[locale]) === null || _f === void 0 ? void 0 : _f.names) === null || _g === void 0 ? void 0 : _g[field]) !== null && _h !== void 0 ? _h : field;\n return isCallable(message) ? message(field, values) : interpolate(message, __assign(__assign({}, values), {\n _field_: field\n }));\n };\n Dictionary.prototype.merge = function (dictionary) {\n merge(this.container, dictionary);\n };\n Dictionary.prototype.hasRule = function (name) {\n var _a, _b;\n return !!((_b = (_a = this.container[this.locale]) === null || _a === void 0 ? void 0 : _a.messages) === null || _b === void 0 ? void 0 : _b[name]);\n };\n return Dictionary;\n}();\nvar DICTIONARY;\nfunction localize(locale, dictionary) {\n var _a;\n if (!DICTIONARY) {\n DICTIONARY = new Dictionary('en', {});\n setConfig({\n defaultMessage: function (field, values) {\n return DICTIONARY.resolve(field, values === null || values === void 0 ? void 0 : values._rule_, values || {});\n }\n });\n }\n if (typeof locale === 'string') {\n DICTIONARY.locale = locale;\n if (dictionary) {\n DICTIONARY.merge((_a = {}, _a[locale] = dictionary, _a));\n }\n localeChanged();\n return;\n }\n DICTIONARY.merge(locale);\n}\nvar isEvent = function (evt) {\n if (!evt) {\n return false;\n }\n if (typeof Event !== 'undefined' && isCallable(Event) && evt instanceof Event) {\n return true;\n }\n // this is for IE\n /* istanbul ignore next */\n if (evt && evt.srcElement) {\n return true;\n }\n return false;\n};\nfunction normalizeEventValue(value) {\n var _a, _b;\n if (!isEvent(value)) {\n return value;\n }\n var input = value.target;\n if (input.type === 'file' && input.files) {\n return toArray(input.files);\n }\n // If the input has a `v-model.number` modifier applied.\n if ((_a = input._vModifiers) === null || _a === void 0 ? void 0 : _a.number) {\n // as per the spec the v-model.number uses parseFloat\n var valueAsNumber = parseFloat(input.value);\n if (isNaN(valueAsNumber)) {\n return input.value;\n }\n return valueAsNumber;\n }\n if ((_b = input._vModifiers) === null || _b === void 0 ? void 0 : _b.trim) {\n var trimmedValue = typeof input.value === 'string' ? input.value.trim() : input.value;\n return trimmedValue;\n }\n return input.value;\n}\nvar isTextInput = function (vnode) {\n var _a;\n var attrs = ((_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs) || vnode.elm;\n // it will fallback to being a text input per browsers spec.\n if (vnode.tag === 'input' && (!attrs || !attrs.type)) {\n return true;\n }\n if (vnode.tag === 'textarea') {\n return true;\n }\n return includes(['text', 'password', 'search', 'email', 'tel', 'url', 'number'], attrs === null || attrs === void 0 ? void 0 : attrs.type);\n};\n// export const isCheckboxOrRadioInput = (vnode: VNode): boolean => {\n// const attrs = (vnode.data && vnode.data.attrs) || vnode.elm;\n// return includes(['radio', 'checkbox'], attrs && attrs.type);\n// };\n// Gets the model object on the vnode.\nfunction findModel(vnode) {\n if (!vnode.data) {\n return undefined;\n }\n // Component Model\n // THIS IS NOT TYPED IN OFFICIAL VUE TYPINGS\n // eslint-disable-next-line\n var nonStandardVNodeData = vnode.data;\n if ('model' in nonStandardVNodeData) {\n return nonStandardVNodeData.model;\n }\n if (!vnode.data.directives) {\n return undefined;\n }\n return find(vnode.data.directives, function (d) {\n return d.name === 'model';\n });\n}\nfunction findValue(vnode) {\n var _a, _b;\n var model = findModel(vnode);\n if (model) {\n return {\n value: model.value\n };\n }\n var config = findModelConfig(vnode);\n var prop = (config === null || config === void 0 ? void 0 : config.prop) || 'value';\n if (((_a = vnode.componentOptions) === null || _a === void 0 ? void 0 : _a.propsData) && prop in vnode.componentOptions.propsData) {\n var propsDataWithValue = vnode.componentOptions.propsData;\n return {\n value: propsDataWithValue[prop]\n };\n }\n if (((_b = vnode.data) === null || _b === void 0 ? void 0 : _b.domProps) && 'value' in vnode.data.domProps) {\n return {\n value: vnode.data.domProps.value\n };\n }\n return undefined;\n}\nfunction extractChildren(vnode) {\n if (Array.isArray(vnode)) {\n return vnode;\n }\n if (Array.isArray(vnode.children)) {\n return vnode.children;\n }\n /* istanbul ignore next */\n if (vnode.componentOptions && Array.isArray(vnode.componentOptions.children)) {\n return vnode.componentOptions.children;\n }\n return [];\n}\nfunction findInputNodes(vnode) {\n if (!Array.isArray(vnode) && findValue(vnode) !== undefined) {\n return [vnode];\n }\n var children = extractChildren(vnode);\n return children.reduce(function (nodes, node) {\n var candidates = findInputNodes(node);\n if (candidates.length) {\n nodes.push.apply(nodes, candidates);\n }\n return nodes;\n }, []);\n}\n// Resolves v-model config if exists.\nfunction findModelConfig(vnode) {\n /* istanbul ignore next */\n if (!vnode.componentOptions) return null;\n // This is also not typed in the standard Vue TS.\n return vnode.componentOptions.Ctor.options.model;\n}\n// Adds a listener to vnode listener object.\nfunction mergeVNodeListeners(obj, eventName, handler) {\n // no listener at all.\n if (isNullOrUndefined(obj[eventName])) {\n obj[eventName] = [handler];\n return;\n }\n // Is an invoker.\n if (isCallable(obj[eventName]) && obj[eventName].fns) {\n var invoker = obj[eventName];\n invoker.fns = Array.isArray(invoker.fns) ? invoker.fns : [invoker.fns];\n if (!includes(invoker.fns, handler)) {\n invoker.fns.push(handler);\n }\n return;\n }\n if (isCallable(obj[eventName])) {\n var prev = obj[eventName];\n obj[eventName] = [prev];\n }\n if (Array.isArray(obj[eventName]) && !includes(obj[eventName], handler)) {\n obj[eventName].push(handler);\n }\n}\n// Adds a listener to a native HTML vnode.\nfunction addNativeNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.data) {\n node.data = {};\n }\n if (isNullOrUndefined(node.data.on)) {\n node.data.on = {};\n }\n mergeVNodeListeners(node.data.on, eventName, handler);\n}\n// Adds a listener to a Vue component vnode.\nfunction addComponentNodeListener(node, eventName, handler) {\n /* istanbul ignore next */\n if (!node.componentOptions) {\n return;\n }\n /* istanbul ignore next */\n if (!node.componentOptions.listeners) {\n node.componentOptions.listeners = {};\n }\n mergeVNodeListeners(node.componentOptions.listeners, eventName, handler);\n}\nfunction addVNodeListener(vnode, eventName, handler) {\n if (vnode.componentOptions) {\n addComponentNodeListener(vnode, eventName, handler);\n return;\n }\n addNativeNodeListener(vnode, eventName, handler);\n}\n// Determines if `change` should be used over `input` for listeners.\nfunction getInputEventName(vnode, model) {\n var _a;\n // Is a component.\n if (vnode.componentOptions) {\n var event_1 = (findModelConfig(vnode) || {\n event: 'input'\n }).event;\n return event_1;\n }\n // Lazy Models typically use change event\n if ((_a = model === null || model === void 0 ? void 0 : model.modifiers) === null || _a === void 0 ? void 0 : _a.lazy) {\n return 'change';\n }\n // is a textual-type input.\n if (isTextInput(vnode)) {\n return 'input';\n }\n return 'change';\n}\nfunction isHTMLNode(node) {\n return includes(['input', 'select', 'textarea'], node.tag);\n}\n// TODO: Type this one properly.\nfunction normalizeSlots(slots, ctx) {\n var acc = [];\n return Object.keys(slots).reduce(function (arr, key) {\n slots[key].forEach(function (vnode) {\n if (!vnode.context) {\n slots[key].context = ctx;\n if (!vnode.data) {\n vnode.data = {};\n }\n vnode.data.slot = key;\n }\n });\n return arr.concat(slots[key]);\n }, acc);\n}\nfunction resolveTextualRules(vnode) {\n var _a;\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\n var rules = {};\n if (!attrs) return rules;\n if (attrs.type === 'email' && RuleContainer.getRuleDefinition('email')) {\n rules.email = ['multiple' in attrs];\n }\n if (attrs.pattern && RuleContainer.getRuleDefinition('regex')) {\n rules.regex = attrs.pattern;\n }\n if (attrs.maxlength >= 0 && RuleContainer.getRuleDefinition('max')) {\n rules.max = attrs.maxlength;\n }\n if (attrs.minlength >= 0 && RuleContainer.getRuleDefinition('min')) {\n rules.min = attrs.minlength;\n }\n if (attrs.type === 'number') {\n if (isSpecified(attrs.min) && RuleContainer.getRuleDefinition('min_value')) {\n rules.min_value = Number(attrs.min);\n }\n if (isSpecified(attrs.max) && RuleContainer.getRuleDefinition('max_value')) {\n rules.max_value = Number(attrs.max);\n }\n }\n return rules;\n}\nfunction resolveRules(vnode) {\n var _a;\n var htmlTags = ['input', 'select', 'textarea'];\n var attrs = (_a = vnode.data) === null || _a === void 0 ? void 0 : _a.attrs;\n if (!includes(htmlTags, vnode.tag) || !attrs) {\n return {};\n }\n var rules = {};\n if ('required' in attrs && attrs.required !== false && RuleContainer.getRuleDefinition('required')) {\n rules.required = attrs.type === 'checkbox' ? [true] : true;\n }\n if (isTextInput(vnode)) {\n return normalizeRules(__assign(__assign({}, rules), resolveTextualRules(vnode)));\n }\n return normalizeRules(rules);\n}\nfunction normalizeChildren(context, slotProps) {\n if (context.$scopedSlots.default) {\n return context.$scopedSlots.default(slotProps) || [];\n }\n return context.$slots.default || [];\n}\n\n/**\r\n * Determines if a provider needs to run validation.\r\n */\nfunction shouldValidate(ctx, value) {\n // when an immediate/initial validation is needed and wasn't done before.\n if (!ctx._ignoreImmediate && ctx.immediate) {\n return true;\n }\n // when the value changes for whatever reason.\n if (!isRefEqual(ctx.value, value) && ctx.normalizedEvents.length) {\n return true;\n }\n // when it needs validation due to props/cross-fields changes.\n if (ctx._needsValidation) {\n return true;\n }\n // when the initial value is undefined and the field wasn't rendered yet.\n if (!ctx.initialized && value === undefined) {\n return true;\n }\n return false;\n}\nfunction createValidationCtx(ctx) {\n return __assign(__assign({}, ctx.flags), {\n errors: ctx.errors,\n classes: ctx.classes,\n failedRules: ctx.failedRules,\n reset: function () {\n return ctx.reset();\n },\n validate: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return ctx.validate.apply(ctx, args);\n },\n ariaInput: {\n 'aria-invalid': ctx.flags.invalid ? 'true' : 'false',\n 'aria-required': ctx.isRequired ? 'true' : 'false',\n 'aria-errormessage': \"vee_\" + ctx.id\n },\n ariaMsg: {\n id: \"vee_\" + ctx.id,\n 'aria-live': ctx.errors.length ? 'assertive' : 'off'\n }\n });\n}\nfunction onRenderUpdate(vm, value) {\n if (!vm.initialized) {\n vm.initialValue = value;\n }\n var validateNow = shouldValidate(vm, value);\n vm._needsValidation = false;\n vm.value = value;\n vm._ignoreImmediate = true;\n if (!validateNow) {\n return;\n }\n var validate = function () {\n if (vm.immediate || vm.flags.validated) {\n return triggerThreadSafeValidation(vm);\n }\n vm.validateSilent();\n };\n if (vm.initialized) {\n validate();\n return;\n }\n vm.$once('hook:mounted', function () {\n return validate();\n });\n}\nfunction computeModeSetting(ctx) {\n var compute = isCallable(ctx.mode) ? ctx.mode : modes[ctx.mode];\n return compute(ctx);\n}\nfunction triggerThreadSafeValidation(vm) {\n var pendingPromise = vm.validateSilent();\n // avoids race conditions between successive validations.\n vm._pendingValidation = pendingPromise;\n return pendingPromise.then(function (result) {\n if (pendingPromise === vm._pendingValidation) {\n vm.applyResult(result);\n vm._pendingValidation = undefined;\n }\n return result;\n });\n}\n// Creates the common handlers for a validatable context.\nfunction createCommonHandlers(vm) {\n if (!vm.$veeOnInput) {\n vm.$veeOnInput = function (e) {\n vm.syncValue(e); // track and keep the value updated.\n vm.setFlags({\n dirty: true,\n pristine: false\n });\n };\n }\n var onInput = vm.$veeOnInput;\n if (!vm.$veeOnBlur) {\n vm.$veeOnBlur = function () {\n vm.setFlags({\n touched: true,\n untouched: false\n });\n };\n }\n // Blur event listener.\n var onBlur = vm.$veeOnBlur;\n var onValidate = vm.$veeHandler;\n var mode = computeModeSetting(vm);\n // Handle debounce changes.\n if (!onValidate || vm.$veeDebounce !== vm.debounce) {\n onValidate = debounce(function () {\n vm.$nextTick(function () {\n if (!vm._pendingReset) {\n triggerThreadSafeValidation(vm);\n }\n vm._pendingReset = false;\n });\n }, mode.debounce || vm.debounce);\n // Cache the handler so we don't create it each time.\n vm.$veeHandler = onValidate;\n // cache the debounce value so we detect if it was changed.\n vm.$veeDebounce = vm.debounce;\n }\n return {\n onInput: onInput,\n onBlur: onBlur,\n onValidate: onValidate\n };\n}\n// Adds all plugin listeners to the vnode.\nfunction addListeners(vm, node) {\n var value = findValue(node);\n // cache the input eventName.\n vm._inputEventName = vm._inputEventName || getInputEventName(node, findModel(node));\n onRenderUpdate(vm, value === null || value === void 0 ? void 0 : value.value);\n var _a = createCommonHandlers(vm),\n onInput = _a.onInput,\n onBlur = _a.onBlur,\n onValidate = _a.onValidate;\n addVNodeListener(node, vm._inputEventName, onInput);\n addVNodeListener(node, 'blur', onBlur);\n // add the validation listeners.\n vm.normalizedEvents.forEach(function (evt) {\n addVNodeListener(node, evt, onValidate);\n });\n vm.initialized = true;\n}\nvar PROVIDER_COUNTER = 0;\nfunction data() {\n var errors = [];\n var fieldName = '';\n var defaultValues = {\n errors: errors,\n value: undefined,\n initialized: false,\n initialValue: undefined,\n flags: createFlags(),\n failedRules: {},\n isActive: true,\n fieldName: fieldName,\n id: ''\n };\n return defaultValues;\n}\nvar ValidationProvider = Vue.extend({\n inject: {\n $_veeObserver: {\n from: '$_veeObserver',\n default: function () {\n if (!this.$vnode.context.$_veeObserver) {\n this.$vnode.context.$_veeObserver = createObserver();\n }\n return this.$vnode.context.$_veeObserver;\n }\n }\n },\n props: {\n vid: {\n type: String,\n default: ''\n },\n name: {\n type: String,\n default: null\n },\n mode: {\n type: [String, Function],\n default: function () {\n return getConfig().mode;\n }\n },\n rules: {\n type: [Object, String],\n default: null\n },\n immediate: {\n type: Boolean,\n default: false\n },\n bails: {\n type: Boolean,\n default: function () {\n return getConfig().bails;\n }\n },\n skipIfEmpty: {\n type: Boolean,\n default: function () {\n return getConfig().skipOptional;\n }\n },\n debounce: {\n type: Number,\n default: 0\n },\n tag: {\n type: String,\n default: 'span'\n },\n slim: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n customMessages: {\n type: Object,\n default: function () {\n return {};\n }\n },\n detectInput: {\n type: Boolean,\n default: true\n }\n },\n watch: {\n rules: {\n deep: true,\n handler: function (val, oldVal) {\n this._needsValidation = !isEqual(val, oldVal);\n }\n }\n },\n data: data,\n computed: {\n fieldDeps: function () {\n var _this = this;\n return Object.keys(this.normalizedRules).reduce(function (acc, rule) {\n var deps = extractLocators(_this.normalizedRules[rule]).map(function (dep) {\n return isLocator(dep) ? dep.__locatorRef : dep.slice(1);\n });\n acc.push.apply(acc, deps);\n deps.forEach(function (depName) {\n watchCrossFieldDep(_this, depName);\n });\n return acc;\n }, []);\n },\n normalizedEvents: function () {\n var _this = this;\n var on = computeModeSetting(this).on;\n return (on || []).map(function (e) {\n if (e === 'input') {\n return _this._inputEventName;\n }\n return e;\n });\n },\n isRequired: function () {\n var rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\n var isRequired = Object.keys(rules).some(RuleContainer.isRequireRule);\n this.flags.required = !!isRequired;\n return isRequired;\n },\n classes: function () {\n var names = getConfig().classes;\n return computeClassObj(names, this.flags);\n },\n normalizedRules: function () {\n return normalizeRules(this.rules);\n }\n },\n mounted: function () {\n var _this = this;\n var onLocaleChanged = function () {\n if (!_this.flags.validated) {\n return;\n }\n var regenerateMap = _this._regenerateMap;\n if (regenerateMap) {\n var errors_1 = [];\n var failedRules_1 = {};\n Object.keys(regenerateMap).forEach(function (rule) {\n var msg = regenerateMap[rule]();\n errors_1.push(msg);\n failedRules_1[rule] = msg;\n });\n _this.applyResult({\n errors: errors_1,\n failedRules: failedRules_1,\n regenerateMap: regenerateMap\n });\n return;\n }\n _this.validate();\n };\n EVENT_BUS.$on('change:locale', onLocaleChanged);\n this.$on('hook:beforeDestroy', function () {\n EVENT_BUS.$off('change:locale', onLocaleChanged);\n });\n },\n render: function (h) {\n var _this = this;\n this.registerField();\n var ctx = createValidationCtx(this);\n var children = normalizeChildren(this, ctx);\n // Automatic v-model detection\n if (this.detectInput) {\n var inputs = findInputNodes(children);\n if (inputs.length) {\n inputs.forEach(function (input, idx) {\n var _a, _b, _c, _d, _e, _f;\n // If the elements are not checkboxes and there are more input nodes\n if (!includes(['checkbox', 'radio'], (_b = (_a = input.data) === null || _a === void 0 ? void 0 : _a.attrs) === null || _b === void 0 ? void 0 : _b.type) && idx > 0) {\n return;\n }\n var resolved = getConfig().useConstraintAttrs ? resolveRules(input) : {};\n if (!isEqual(_this._resolvedRules, resolved)) {\n _this._needsValidation = true;\n }\n if (isHTMLNode(input)) {\n _this.fieldName = ((_d = (_c = input.data) === null || _c === void 0 ? void 0 : _c.attrs) === null || _d === void 0 ? void 0 : _d.name) || ((_f = (_e = input.data) === null || _e === void 0 ? void 0 : _e.attrs) === null || _f === void 0 ? void 0 : _f.id);\n }\n _this._resolvedRules = resolved;\n addListeners(_this, input);\n });\n }\n }\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, children);\n },\n beforeDestroy: function () {\n // cleanup reference.\n this.$_veeObserver.unobserve(this.id);\n },\n activated: function () {\n this.isActive = true;\n },\n deactivated: function () {\n this.isActive = false;\n },\n methods: {\n setFlags: function (flags) {\n var _this = this;\n Object.keys(flags).forEach(function (flag) {\n _this.flags[flag] = flags[flag];\n });\n },\n syncValue: function (v) {\n var value = normalizeEventValue(v);\n this.value = value;\n this.flags.changed = this.initialValue !== value;\n },\n reset: function () {\n var _this = this;\n this.errors = [];\n this.initialValue = this.value;\n var flags = createFlags();\n flags.required = this.isRequired;\n this.setFlags(flags);\n this.failedRules = {};\n this.validateSilent();\n this._pendingValidation = undefined;\n this._pendingReset = true;\n setTimeout(function () {\n _this._pendingReset = false;\n }, this.debounce);\n },\n validate: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (args.length > 0) {\n this.syncValue(args[0]);\n }\n return [2 /*return*/, triggerThreadSafeValidation(this)];\n });\n });\n },\n validateSilent: function () {\n return __awaiter(this, void 0, void 0, function () {\n var rules, result;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.setFlags({\n pending: true\n });\n rules = __assign(__assign({}, this._resolvedRules), this.normalizedRules);\n Object.defineProperty(rules, '_$$isNormalized', {\n value: true,\n writable: false,\n enumerable: false,\n configurable: false\n });\n return [4 /*yield*/, validate(this.value, rules, __assign(__assign({\n name: this.name || this.fieldName\n }, createLookup(this)), {\n bails: this.bails,\n skipIfEmpty: this.skipIfEmpty,\n isInitial: !this.initialized,\n customMessages: this.customMessages\n }))];\n case 1:\n result = _a.sent();\n this.setFlags({\n pending: false,\n valid: result.valid,\n invalid: !result.valid\n });\n return [2 /*return*/, result];\n }\n });\n });\n },\n setErrors: function (errors) {\n this.applyResult({\n errors: errors,\n failedRules: {}\n });\n },\n applyResult: function (_a) {\n var errors = _a.errors,\n failedRules = _a.failedRules,\n regenerateMap = _a.regenerateMap;\n this.errors = errors;\n this._regenerateMap = regenerateMap;\n this.failedRules = __assign({}, failedRules || {});\n this.setFlags({\n valid: !errors.length,\n passed: !errors.length,\n invalid: !!errors.length,\n failed: !!errors.length,\n validated: true,\n changed: this.value !== this.initialValue\n });\n },\n registerField: function () {\n updateRenderingContextRefs(this);\n }\n }\n});\nfunction computeClassObj(names, flags) {\n var acc = {};\n var keys = Object.keys(flags);\n var length = keys.length;\n var _loop_1 = function (i) {\n var flag = keys[i];\n var className = names && names[flag] || flag;\n var value = flags[flag];\n if (isNullOrUndefined(value)) {\n return \"continue\";\n }\n if ((flag === 'valid' || flag === 'invalid') && !flags.validated) {\n return \"continue\";\n }\n if (typeof className === 'string') {\n acc[className] = value;\n } else if (Array.isArray(className)) {\n className.forEach(function (cls) {\n acc[cls] = value;\n });\n }\n };\n for (var i = 0; i < length; i++) {\n _loop_1(i);\n }\n return acc;\n}\nfunction createLookup(vm) {\n var providers = vm.$_veeObserver.refs;\n var reduced = {\n names: {},\n values: {}\n };\n return vm.fieldDeps.reduce(function (acc, depName) {\n if (!providers[depName]) {\n return acc;\n }\n acc.values[depName] = providers[depName].value;\n acc.names[depName] = providers[depName].name;\n return acc;\n }, reduced);\n}\nfunction extractId(vm) {\n if (vm.vid) {\n return vm.vid;\n }\n if (vm.name) {\n return vm.name;\n }\n if (vm.id) {\n return vm.id;\n }\n if (vm.fieldName) {\n return vm.fieldName;\n }\n PROVIDER_COUNTER++;\n return \"_vee_\" + PROVIDER_COUNTER;\n}\nfunction updateRenderingContextRefs(vm) {\n var providedId = extractId(vm);\n var id = vm.id;\n // Nothing has changed.\n if (!vm.isActive || id === providedId && vm.$_veeObserver.refs[id]) {\n return;\n }\n // vid was changed.\n if (id !== providedId && vm.$_veeObserver.refs[id] === vm) {\n vm.$_veeObserver.unobserve(id);\n }\n vm.id = providedId;\n vm.$_veeObserver.observe(vm);\n}\nfunction createObserver() {\n return {\n refs: {},\n observe: function (vm) {\n this.refs[vm.id] = vm;\n },\n unobserve: function (id) {\n delete this.refs[id];\n }\n };\n}\nfunction watchCrossFieldDep(ctx, depName, withHooks) {\n if (withHooks === void 0) {\n withHooks = true;\n }\n var providers = ctx.$_veeObserver.refs;\n if (!ctx._veeWatchers) {\n ctx._veeWatchers = {};\n }\n if (!providers[depName] && withHooks) {\n return ctx.$once('hook:mounted', function () {\n watchCrossFieldDep(ctx, depName, false);\n });\n }\n if (!isCallable(ctx._veeWatchers[depName]) && providers[depName]) {\n ctx._veeWatchers[depName] = providers[depName].$watch('value', function () {\n if (ctx.flags.validated) {\n ctx._needsValidation = true;\n ctx.validate();\n }\n });\n }\n}\nvar FLAGS_STRATEGIES = [['pristine', 'every'], ['dirty', 'some'], ['touched', 'some'], ['untouched', 'every'], ['valid', 'every'], ['invalid', 'some'], ['pending', 'some'], ['validated', 'every'], ['changed', 'some'], ['passed', 'every'], ['failed', 'some']];\nvar OBSERVER_COUNTER = 0;\nfunction data$1() {\n var refs = {};\n var errors = {};\n var flags = createObserverFlags();\n var fields = {};\n // FIXME: Not sure of this one can be typed, circular type reference.\n var observers = [];\n return {\n id: '',\n refs: refs,\n observers: observers,\n errors: errors,\n flags: flags,\n fields: fields\n };\n}\nfunction provideSelf() {\n return {\n $_veeObserver: this\n };\n}\nvar ValidationObserver = Vue.extend({\n name: 'ValidationObserver',\n provide: provideSelf,\n inject: {\n $_veeObserver: {\n from: '$_veeObserver',\n default: function () {\n if (!this.$vnode.context.$_veeObserver) {\n return null;\n }\n return this.$vnode.context.$_veeObserver;\n }\n }\n },\n props: {\n tag: {\n type: String,\n default: 'span'\n },\n vid: {\n type: String,\n default: function () {\n return \"obs_\" + OBSERVER_COUNTER++;\n }\n },\n slim: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n }\n },\n data: data$1,\n created: function () {\n var _this = this;\n this.id = this.vid;\n register(this);\n var onChange = debounce(function (_a) {\n var errors = _a.errors,\n flags = _a.flags,\n fields = _a.fields;\n _this.errors = errors;\n _this.flags = flags;\n _this.fields = fields;\n }, 16);\n this.$watch(computeObserverState, onChange);\n },\n activated: function () {\n register(this);\n },\n deactivated: function () {\n unregister(this);\n },\n beforeDestroy: function () {\n unregister(this);\n },\n render: function (h) {\n var children = normalizeChildren(this, prepareSlotProps(this));\n return this.slim && children.length <= 1 ? children[0] : h(this.tag, {\n on: this.$listeners\n }, children);\n },\n methods: {\n observe: function (subscriber, kind) {\n var _a;\n if (kind === void 0) {\n kind = 'provider';\n }\n if (kind === 'observer') {\n this.observers.push(subscriber);\n return;\n }\n this.refs = __assign(__assign({}, this.refs), (_a = {}, _a[subscriber.id] = subscriber, _a));\n },\n unobserve: function (id, kind) {\n if (kind === void 0) {\n kind = 'provider';\n }\n if (kind === 'provider') {\n var provider = this.refs[id];\n if (!provider) {\n return;\n }\n this.$delete(this.refs, id);\n return;\n }\n var idx = findIndex(this.observers, function (o) {\n return o.id === id;\n });\n if (idx !== -1) {\n this.observers.splice(idx, 1);\n }\n },\n validateWithInfo: function (_a) {\n var _b = (_a === void 0 ? {} : _a).silent,\n silent = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n var results, isValid, _c, errors, flags, fields;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n return [4 /*yield*/, Promise.all(__spreadArrays(values(this.refs).filter(function (r) {\n return !r.disabled;\n }).map(function (ref) {\n return ref[silent ? 'validateSilent' : 'validate']().then(function (r) {\n return r.valid;\n });\n }), this.observers.filter(function (o) {\n return !o.disabled;\n }).map(function (obs) {\n return obs.validate({\n silent: silent\n });\n })))];\n case 1:\n results = _d.sent();\n isValid = results.every(function (r) {\n return r;\n });\n _c = computeObserverState.call(this), errors = _c.errors, flags = _c.flags, fields = _c.fields;\n this.errors = errors;\n this.flags = flags;\n this.fields = fields;\n return [2 /*return*/, {\n errors: errors,\n flags: flags,\n fields: fields,\n isValid: isValid\n }];\n }\n });\n });\n },\n validate: function (_a) {\n var _b = (_a === void 0 ? {} : _a).silent,\n silent = _b === void 0 ? false : _b;\n return __awaiter(this, void 0, void 0, function () {\n var isValid;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n return [4 /*yield*/, this.validateWithInfo({\n silent: silent\n })];\n case 1:\n isValid = _c.sent().isValid;\n return [2 /*return*/, isValid];\n }\n });\n });\n },\n handleSubmit: function (cb) {\n return __awaiter(this, void 0, void 0, function () {\n var isValid;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.validate()];\n case 1:\n isValid = _a.sent();\n if (!isValid || !cb) {\n return [2 /*return*/];\n }\n\n return [2 /*return*/, cb()];\n }\n });\n });\n },\n reset: function () {\n return __spreadArrays(values(this.refs), this.observers).forEach(function (ref) {\n return ref.reset();\n });\n },\n setErrors: function (errors) {\n var _this = this;\n Object.keys(errors).forEach(function (key) {\n var provider = _this.refs[key];\n if (!provider) return;\n var errorArr = errors[key] || [];\n errorArr = typeof errorArr === 'string' ? [errorArr] : errorArr;\n provider.setErrors(errorArr);\n });\n this.observers.forEach(function (observer) {\n observer.setErrors(errors);\n });\n }\n }\n});\nfunction unregister(vm) {\n if (vm.$_veeObserver) {\n vm.$_veeObserver.unobserve(vm.id, 'observer');\n }\n}\nfunction register(vm) {\n if (vm.$_veeObserver) {\n vm.$_veeObserver.observe(vm, 'observer');\n }\n}\nfunction prepareSlotProps(vm) {\n return __assign(__assign({}, vm.flags), {\n errors: vm.errors,\n fields: vm.fields,\n validate: vm.validate,\n validateWithInfo: vm.validateWithInfo,\n passes: vm.handleSubmit,\n handleSubmit: vm.handleSubmit,\n reset: vm.reset\n });\n}\n// Creates a modified version of validation flags\nfunction createObserverFlags() {\n return __assign(__assign({}, createFlags()), {\n valid: true,\n invalid: false\n });\n}\nfunction computeObserverState() {\n var vms = __spreadArrays(values(this.refs), this.observers.filter(function (o) {\n return !o.disabled;\n }));\n var errors = {};\n var flags = createObserverFlags();\n var fields = {};\n var length = vms.length;\n for (var i = 0; i < length; i++) {\n var vm = vms[i];\n // validation provider\n if (Array.isArray(vm.errors)) {\n errors[vm.id] = vm.errors;\n fields[vm.id] = __assign({\n id: vm.id,\n name: vm.name,\n failedRules: vm.failedRules\n }, vm.flags);\n continue;\n }\n // Nested observer, merge errors and fields\n errors = __assign(__assign({}, errors), vm.errors);\n fields = __assign(__assign({}, fields), vm.fields);\n }\n FLAGS_STRATEGIES.forEach(function (_a) {\n var flag = _a[0],\n method = _a[1];\n flags[flag] = vms[method](function (vm) {\n return vm.flags[flag];\n });\n });\n return {\n errors: errors,\n flags: flags,\n fields: fields\n };\n}\nfunction withValidation(component, mapProps) {\n var _a;\n if (mapProps === void 0) {\n mapProps = identity;\n }\n var options = 'options' in component ? component.options : component;\n var providerOpts = ValidationProvider.options;\n var hoc = {\n name: (options.name || 'AnonymousHoc') + \"WithValidation\",\n props: __assign({}, providerOpts.props),\n data: providerOpts.data,\n computed: __assign({}, providerOpts.computed),\n methods: __assign({}, providerOpts.methods),\n beforeDestroy: providerOpts.beforeDestroy,\n inject: providerOpts.inject\n };\n var eventName = ((_a = options === null || options === void 0 ? void 0 : options.model) === null || _a === void 0 ? void 0 : _a.event) || 'input';\n hoc.render = function (h) {\n var _a;\n this.registerField();\n var vctx = createValidationCtx(this);\n var listeners = __assign({}, this.$listeners);\n var model = findModel(this.$vnode);\n this._inputEventName = this._inputEventName || getInputEventName(this.$vnode, model);\n var value = findValue(this.$vnode);\n onRenderUpdate(this, value === null || value === void 0 ? void 0 : value.value);\n var _b = createCommonHandlers(this),\n onInput = _b.onInput,\n onBlur = _b.onBlur,\n onValidate = _b.onValidate;\n mergeVNodeListeners(listeners, eventName, onInput);\n mergeVNodeListeners(listeners, 'blur', onBlur);\n this.normalizedEvents.forEach(function (evt) {\n mergeVNodeListeners(listeners, evt, onValidate);\n });\n // Props are any attrs not associated with ValidationProvider Plus the model prop.\n // WARNING: Accidental prop overwrite will probably happen.\n var prop = (findModelConfig(this.$vnode) || {\n prop: 'value'\n }).prop;\n var props = __assign(__assign(__assign({}, this.$attrs), (_a = {}, _a[prop] = model === null || model === void 0 ? void 0 : model.value, _a)), mapProps(vctx));\n return h(options, {\n attrs: this.$attrs,\n props: props,\n on: listeners,\n scopedSlots: this.$scopedSlots\n }, normalizeSlots(this.$slots, this.$vnode.context));\n };\n return hoc;\n}\nvar version = '3.4.5';\nexport { ValidationObserver, ValidationProvider, configure, extend, localeChanged, localize, normalizeRules, setInteractionMode, validate, version, withValidation };","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\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 toString.call(val) === '[object Array]';\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) && 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 typeof FormData !== 'undefined' && val instanceof 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 && val.buffer instanceof ArrayBuffer;\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 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 typeof URLSearchParams !== 'undefined' && val instanceof 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.replace(/^\\s*/, '').replace(/\\s*$/, '');\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' || navigator.product === 'NativeScript' || navigator.product === 'NS')) {\n return false;\n }\n return typeof window !== 'undefined' && typeof document !== 'undefined';\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 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) {\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 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}\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 * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n(function (global, factory) {\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n // For CommonJS and CommonJS-like environments where a proper `window`\n // is present, execute the factory and get jQuery.\n // For environments that do not have a `window` with a `document`\n // (such as Node.js), expose a factory as module.exports.\n // This accentuates the need for the creation of a real `window`.\n // e.g. var jQuery = require(\"jquery\")(window);\n // See ticket #14549 for more info.\n module.exports = global.document ? factory(global, true) : function (w) {\n if (!w.document) {\n throw new Error(\"jQuery requires a window with a document\");\n }\n return factory(w);\n };\n } else {\n factory(global);\n }\n\n // Pass this if window is not defined yet\n})(typeof window !== \"undefined\" ? window : this, function (window, noGlobal) {\n // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n // enough that all such attempts are guarded in a try block.\n \"use strict\";\n\n var arr = [];\n var getProto = Object.getPrototypeOf;\n var slice = arr.slice;\n var flat = arr.flat ? function (array) {\n return arr.flat.call(array);\n } : function (array) {\n return arr.concat.apply([], array);\n };\n var push = arr.push;\n var indexOf = arr.indexOf;\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var fnToString = hasOwn.toString;\n var ObjectFunctionString = fnToString.call(Object);\n var support = {};\n var isFunction = function isFunction(obj) {\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML