' + 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() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !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 ||\n (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) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\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 ||\n (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' &&\n 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' ||\n (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 &&\n 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' ||\n (!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' ||\n (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\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\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 = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (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\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (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\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\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\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\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\n ? object\n : 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\n ? object\n : 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 &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\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 &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\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\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\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\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\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\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 }\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 }\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\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\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))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : 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))\n ? string.replace(reRegExpChar, '\\\\$&')\n : 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\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\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\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : 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\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : 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\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 && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\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\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\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': '\r\n * @example String.2\r\n * \r\n * \r\n * @example String.dd.mmm.yyyy\r\n * \r\n * \r\n * @example String.dd.mmmm.yyyy\r\n * \r\n * \r\n * @example String.HH:MM\r\n * \r\n * \r\n * @example ASP.NET.JSON.Date\r\n * \r\n * \r\n * @example UNIX.Timestamp\r\n * \r\n * \r\n */\r\n parseDate: function (value, format, locale) {\r\n var i, year = 0, month = 0, date = 1, hour = 0, minute = 0, dateParts, formatParts, result;\r\n\r\n if (value && typeof value === 'string') {\r\n if (/^\\d+$/.test(value)) {\r\n result = new Date(value);\r\n } else if (value.indexOf('/Date(') > -1) {\r\n result = new Date(parseInt(value.substr(6), 10));\r\n } else if (value) {\r\n formatParts = format.split(/[\\s,-\\.//\\:]+/);\r\n // Split only by spaces\r\n dateParts = value.split(/[\\s]+/);\r\n // Split by other chars if the split by spaces doesn't work\r\n if (dateParts.length != formatParts.length) {\r\n dateParts = value.split(/[\\s,-\\.//\\:]+/);\r\n }\r\n for (i = 0; i < formatParts.length; i++) {\r\n if (['d', 'dd'].indexOf(formatParts[i]) > -1) {\r\n date = parseInt(dateParts[i], 10);\r\n } else if (['m', 'mm'].indexOf(formatParts[i]) > -1) {\r\n month = parseInt(dateParts[i], 10) - 1;\r\n } else if ('mmm' === formatParts[i]) {\r\n month = gj.core.messages[locale || 'en-us'].monthShortNames.indexOf(dateParts[i]);\r\n } else if ('mmmm' === formatParts[i]) {\r\n month = gj.core.messages[locale || 'en-us'].monthNames.indexOf(dateParts[i]);\r\n } else if (['yy', 'yyyy'].indexOf(formatParts[i]) > -1) {\r\n year = parseInt(dateParts[i], 10);\r\n if (formatParts[i] === 'yy') {\r\n year += 2000;\r\n }\r\n } else if (['h', 'hh', 'H', 'HH'].indexOf(formatParts[i]) > -1) {\r\n hour = parseInt(dateParts[i], 10);\r\n } else if (['M', 'MM'].indexOf(formatParts[i]) > -1) {\r\n minute = parseInt(dateParts[i], 10);\r\n }\r\n }\r\n result = new Date(year, month, date, hour, minute);\r\n }\r\n } else if (typeof value === 'number') {\r\n result = new Date(value);\r\n } else if (value instanceof Date) {\r\n result = value;\r\n }\r\n\r\n return result;\r\n },\r\n\r\n /** \r\n * @method\r\n * @example Sample.1\r\n * \r\n * \r\n * @example Sample.2\r\n * \r\n * \r\n * @example Sample.dd.mmm.yyyy\r\n * \r\n * \r\n * @example Sample.dd.mmmm.yyyy\r\n * \r\n * \r\n * @example Sample.5\r\n * \r\n * \r\n * @example Sample.6\r\n * \r\n * \r\n * @example Short.WeekDay\r\n * \r\n * \r\n * @example Full.WeekDay\r\n * \r\n * \r\n */\r\n formatDate: function (date, format, locale) {\r\n var result = '', separator, tmp,\r\n formatParts = format.split(/[\\s,-\\.//\\:]+/),\r\n separators = format.split(/s+|M+|H+|h+|t+|T+|d+|m+|y+/);\r\n\r\n separators = separators.splice(1, separators.length - 2);\r\n\r\n for (i = 0; i < formatParts.length; i++) {\r\n separator = (separators[i] || '');\r\n switch (formatParts[i]) {\r\n case 's':\r\n result += date.getSeconds() + separator;\r\n break;\r\n case 'ss':\r\n result += gj.core.pad(date.getSeconds()) + separator;\r\n break;\r\n case 'M':\r\n result += date.getMinutes() + separator;\r\n break;\r\n case 'MM':\r\n result += gj.core.pad(date.getMinutes()) + separator;\r\n break;\r\n case 'H':\r\n result += date.getHours() + separator;\r\n break;\r\n case 'HH':\r\n result += gj.core.pad(date.getHours()) + separator;\r\n break;\r\n case 'h':\r\n tmp = date.getHours() > 12 ? date.getHours() % 12 : date.getHours();\r\n result += tmp + separator;\r\n break;\r\n case 'hh':\r\n tmp = date.getHours() > 12 ? date.getHours() % 12 : date.getHours();\r\n result += gj.core.pad(tmp) + separator;\r\n break;\r\n case 'tt':\r\n result += (date.getHours() >= 12 ? 'pm' : 'am') + separator;\r\n break;\r\n case 'TT':\r\n result += (date.getHours() >= 12 ? 'PM' : 'AM') + separator;\r\n break;\r\n case 'd':\r\n result += date.getDate() + separator;\r\n break;\r\n case 'dd':\r\n result += gj.core.pad(date.getDate()) + separator;\r\n break;\r\n case 'ddd':\r\n result += gj.core.messages[locale || 'en-us'].weekDaysShort[date.getDay()] + separator;\r\n break;\r\n case 'dddd':\r\n result += gj.core.messages[locale || 'en-us'].weekDays[date.getDay()] + separator;\r\n break;\r\n case 'm' :\r\n result += (date.getMonth() + 1) + separator;\r\n break;\r\n case 'mm':\r\n result += gj.core.pad(date.getMonth() + 1) + separator;\r\n break;\r\n case 'mmm':\r\n result += gj.core.messages[locale || 'en-us'].monthShortNames[date.getMonth()] + separator;\r\n break;\r\n case 'mmmm':\r\n result += gj.core.messages[locale || 'en-us'].monthNames[date.getMonth()] + separator;\r\n break;\r\n case 'yy' :\r\n result += date.getFullYear().toString().substr(2) + separator;\r\n break;\r\n case 'yyyy':\r\n result += date.getFullYear() + separator;\r\n break;\r\n }\r\n }\r\n\r\n return result;\r\n },\r\n\r\n pad: function (val, len) {\r\n val = String(val);\r\n len = len || 2;\r\n while (val.length < len) {\r\n val = '0' + val;\r\n }\r\n return val;\r\n },\r\n\r\n center: function ($dialog) {\r\n var left = ($(window).width() / 2) - ($dialog.width() / 2),\r\n top = ($(window).height() / 2) - ($dialog.height() / 2);\r\n $dialog.css('position', 'absolute');\r\n $dialog.css('left', left > 0 ? left : 0);\r\n $dialog.css('top', top > 0 ? top : 0);\r\n },\r\n\r\n isIE: function () {\r\n return !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g);\r\n },\r\n\r\n setChildPosition: function (mainEl, childEl) {\r\n var mainElRect = mainEl.getBoundingClientRect(),\r\n mainElHeight = gj.core.height(mainEl, true),\r\n childElHeight = gj.core.height(childEl, true),\r\n mainElWidth = gj.core.width(mainEl, true),\r\n childElWidth = gj.core.width(childEl, true),\r\n scrollY = window.scrollY || window.pageYOffset || 0,\r\n scrollX = window.scrollX || window.pageXOffset || 0;\r\n\r\n if ((mainElRect.top + mainElHeight + childElHeight) > window.innerHeight && mainElRect.top > childElHeight) {\r\n childEl.style.top = Math.round(mainElRect.top + scrollY - childElHeight - 3) + 'px';\r\n } else {\r\n childEl.style.top = Math.round(mainElRect.top + scrollY + mainElHeight + 3) + 'px';\r\n }\r\n\r\n if (mainElRect.left + childElWidth > document.body.clientWidth) {\r\n childEl.style.left = Math.round(mainElRect.left + scrollX + mainElWidth - childElWidth) + 'px';\r\n } else {\r\n childEl.style.left = Math.round(mainElRect.left + scrollX) + 'px';\r\n }\r\n },\r\n\r\n height: function (el, margin) {\r\n var result, style = window.getComputedStyle(el);\r\n\r\n if (style.boxSizing === 'border-box') { // border-box include padding and border within the height\r\n result = parseInt(style.height, 10);\r\n if (gj.core.isIE()) {\r\n result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);\r\n result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);\r\n }\r\n } else {\r\n result = parseInt(style.height, 10);\r\n result += parseInt(style.paddingTop || 0, 10) + parseInt(style.paddingBottom || 0, 10);\r\n result += parseInt(style.borderTopWidth || 0, 10) + parseInt(style.borderBottomWidth || 0, 10);\r\n }\r\n\r\n if (margin) {\r\n result += parseInt(style.marginTop || 0, 10) + parseInt(style.marginBottom || 0, 10);\r\n }\r\n\r\n return result;\r\n },\r\n\r\n width: function (el, margin) {\r\n var result, style = window.getComputedStyle(el);\r\n\r\n if (style.boxSizing === 'border-box') { // border-box include padding and border within the width\r\n result = parseInt(style.width, 10);\r\n } else {\r\n result = parseInt(style.width, 10);\r\n result += parseInt(style.paddingLeft || 0, 10) + parseInt(style.paddingRight || 0, 10);\r\n result += parseInt(style.borderLeftWidth || 0, 10) + parseInt(style.borderRightWidth || 0, 10);\r\n }\r\n\r\n if (margin) {\r\n result += parseInt(style.marginLeft || 0, 10) + parseInt(style.marginRight || 0, 10);\r\n }\r\n\r\n return result;\r\n },\r\n\r\n addClasses: function (el, classes) {\r\n var i, arr;\r\n if (classes) {\r\n arr = classes.split(' ');\r\n for (i = 0; i < arr.length; i++) {\r\n el.classList.add(arr[i]);\r\n }\r\n }\r\n },\r\n\r\n position: function (el) {\r\n var xScroll, yScroll, left = 0, top = 0,\r\n height = gj.core.height(el),\r\n width = gj.core.width(el);\r\n\r\n while (el) {\r\n if (el.tagName == \"BODY\") {\r\n xScroll = el.scrollLeft || document.documentElement.scrollLeft;\r\n yScroll = el.scrollTop || document.documentElement.scrollTop;\r\n left += el.offsetLeft - xScroll; // + el.clientLeft);\r\n top += el.offsetTop - yScroll; // + el.clientTop);\r\n } else {\r\n left += el.offsetLeft - el.scrollLeft; // + el.clientLeft;\r\n top += el.offsetTop - el.scrollTop; // + el.clientTop;\r\n }\r\n\r\n el = el.offsetParent;\r\n }\r\n\r\n return { top: top, left: left, bottom: top + height, right: left + width };\r\n },\r\n\r\n setCaretAtEnd: function (elem) {\r\n var elemLen;\r\n if (elem) {\r\n elemLen = elem.value.length;\r\n if (document.selection) { // For IE Only\r\n elem.focus();\r\n var oSel = document.selection.createRange();\r\n oSel.moveStart('character', -elemLen);\r\n oSel.moveStart('character', elemLen);\r\n oSel.moveEnd('character', 0);\r\n oSel.select();\r\n } else if (elem.selectionStart || elem.selectionStart == '0') { // Firefox/Chrome \r\n elem.selectionStart = elemLen;\r\n elem.selectionEnd = elemLen;\r\n elem.focus();\r\n }\r\n }\r\n },\r\n getScrollParent: function (node) {\r\n if (node == null) {\r\n return null;\r\n } else if (node.scrollHeight > node.clientHeight) {\r\n return node;\r\n } else {\r\n return gj.core.getScrollParent(node.parentNode);\r\n }\r\n }\r\n};\r\ngj.picker = {\r\n messages: {\r\n 'en-us': {\r\n }\r\n }\r\n};\r\n\r\ngj.picker.methods = {\r\n\r\n initialize: function ($input, data, methods) {\r\n var $calendar, $rightIcon,\r\n $picker = methods.createPicker($input, data),\r\n $wrapper = $input.parent('div[role=\"wrapper\"]');\r\n\r\n if (data.uiLibrary === 'bootstrap') {\r\n $rightIcon = $('' + data.icons.rightIcon + '');\r\n } else if (data.uiLibrary === 'bootstrap4') {\r\n $rightIcon = $('');\r\n } else {\r\n $rightIcon = $(data.icons.rightIcon);\r\n }\r\n $rightIcon.attr('role', 'right-icon');\r\n\r\n if ($wrapper.length === 0) {\r\n $wrapper = $('').addClass(data.style.wrapper); // The css class needs to be added before the wrapping, otherwise doesn't work.\r\n $input.wrap($wrapper);\r\n } else {\r\n $wrapper.addClass(data.style.wrapper);\r\n }\r\n $wrapper = $input.parent('div[role=\"wrapper\"]');\r\n\r\n data.width && $wrapper.css('width', data.width);\r\n\r\n $input.val(data.value).addClass(data.style.input).attr('role', 'input');\r\n\r\n data.fontSize && $input.css('font-size', data.fontSize);\r\n\r\n if (data.uiLibrary === 'bootstrap' || data.uiLibrary === 'bootstrap4') {\r\n if (data.size === 'small') {\r\n $wrapper.addClass('input-group-sm');\r\n $input.addClass('form-control-sm');\r\n } else if (data.size === 'large') {\r\n $wrapper.addClass('input-group-lg');\r\n $input.addClass('form-control-lg');\r\n }\r\n } else {\r\n if (data.size === 'small') {\r\n $wrapper.addClass('small');\r\n } else if (data.size === 'large') {\r\n $wrapper.addClass('large');\r\n }\r\n }\r\n\r\n $rightIcon.on('click', function (e) {\r\n if ($picker.is(':visible')) {\r\n $input.close();\r\n } else {\r\n $input.open();\r\n }\r\n });\r\n $wrapper.append($rightIcon);\r\n\r\n if (data.footer !== true) {\r\n $input.on('blur', function () {\r\n $input.timeout = setTimeout(function () {\r\n $input.close();\r\n }, 500);\r\n });\r\n $picker.mousedown(function () {\r\n clearTimeout($input.timeout);\r\n $input.focus();\r\n return false;\r\n });\r\n $picker.on('click', function () {\r\n clearTimeout($input.timeout);\r\n $input.focus();\r\n });\r\n }\r\n }\r\n};\r\n\r\n\r\ngj.picker.widget = function ($element, jsConfig) {\r\n var self = this,\r\n methods = gj.picker.methods;\r\n\r\n self.destroy = function () {\r\n return methods.destroy(this);\r\n };\r\n\r\n return $element;\r\n};\r\n\r\ngj.picker.widget.prototype = new gj.widget();\r\ngj.picker.widget.constructor = gj.picker.widget;\r\n\r\ngj.picker.widget.prototype.init = function (jsConfig, type, methods) {\r\n gj.widget.prototype.init.call(this, jsConfig, type);\r\n this.attr('data-' + type, 'true');\r\n gj.picker.methods.initialize(this, this.data(), gj[type].methods);\r\n return this;\r\n};\r\n\r\ngj.picker.widget.prototype.open = function (type) {\r\n var data = this.data(),\r\n $picker = $('body').find('[role=\"picker\"][guid=\"' + this.attr('data-guid') + '\"]');\r\n\r\n $picker.show();\r\n $picker.closest('div[role=\"modal\"]').show();\r\n if (data.modal) {\r\n gj.core.center($picker);\r\n } else {\r\n gj.core.setChildPosition(this[0], $picker[0]);\r\n this.focus();\r\n }\r\n clearTimeout(this.timeout);\r\n\r\n gj[type].events.open(this);\r\n\r\n return this;\r\n};\r\n\r\ngj.picker.widget.prototype.close = function (type) {\r\n var $picker = $('body').find('[role=\"picker\"][guid=\"' + this.attr('data-guid') + '\"]');\r\n $picker.hide();\r\n $picker.closest('div[role=\"modal\"]').hide();\r\n gj[type].events.close(this);\r\n return this;\r\n};\r\n\r\ngj.picker.widget.prototype.destroy = function (type) {\r\n var data = this.data(),\r\n $parent = this.parent(),\r\n $picker = $('body').find('[role=\"picker\"][guid=\"' + this.attr('data-guid') + '\"]');\r\n if (data) {\r\n this.off();\r\n if ($picker.parent('[role=\"modal\"]').length > 0) {\r\n $picker.unwrap();\r\n }\r\n $picker.remove();\r\n this.removeData();\r\n this.removeAttr('data-type').removeAttr('data-guid').removeAttr('data-' + type);\r\n this.removeClass();\r\n $parent.children('[role=\"right-icon\"]').remove();\r\n this.unwrap();\r\n }\r\n return this;\r\n};\r\n/* global window alert jQuery */\r\n/** \r\n * @widget Dialog \r\n * @plugin Base\r\n */\r\ngj.dialog = {\r\n plugins: {},\r\n messages: {}\r\n};\r\n\r\ngj.dialog.config = {\r\n base: {\r\n /** If set to true, the dialog will automatically open upon initialization.\r\n * If false, the dialog will stay hidden until the open() method is called.\r\n * @type boolean\r\n * @default true\r\n * @example True \r\n *# | \r\n *Name | \r\n *PlaceOfBirth | \r\n *
---|
# | \r\n *Name | \r\n *Place Of Birth | \r\n *
---|---|---|
1 | \r\n *Hristo Stoichkov | \r\n *Plovdiv, Bulgaria | \r\n *
2 | \r\n *Ronaldo Luis Nazario de Lima | \r\n *Rio de Janeiro, Brazil | \r\n *
3 | \r\n *David Platt | \r\n *Chadderton, Lancashire, England | \r\n *
ID | \r\n *Name | \r\n *Place Of Birth | \r\n *\r\n * |
---|
Expand row, then change the page and return back to the page with expanded row in order to see that the expansion is kept.
\r\n *Change browser window size in order to fire resize event.
\r\n *Resize browser window in order to see his responsive behaviour.
\r\n *Drag and Drop rows in order to reorder them.
\r\n *Drag and Drop rows in order to reorder them.
\r\n *Drag and Drop rows in order to reorder them.
\r\n *Drag and Drop column headers in order to reorder the columns.
\r\n *Drag and Drop column headers in order to reorder the columns.
\r\n *Drag and Drop column headers in order to reorder the columns.
\r\n *Select a node to see the key.
\r\n * \r\n * \r\n * @example undefined \r\n *Select a node to see the key.
\r\n * \r\n * \r\n */\r\n primaryKey: undefined,\r\n\r\n /** Text field name.\r\n * @type string\r\n * @default 'text'\r\n * @example sample \r\n * \r\n * \r\n */\r\n textField: 'text',\r\n\r\n /** Children field name.\r\n * @type string\r\n * @default 'children'\r\n * @example Custom.FieldName \r\n * \r\n * \r\n */\r\n childrenField: 'children',\r\n\r\n /** The name of the field that indicates if the node has children. Shows expand icon if the node has children.\r\n * @type string\r\n * @default 'hasChildren'\r\n * @example Custom.FieldName \r\n * \r\n * \r\n */\r\n hasChildrenField: 'hasChildren',\r\n\r\n /** Image css class field name.\r\n * @type string\r\n * @default 'imageCssClass'\r\n * @example Default.Name \r\n * \r\n * \r\n * @example Custom.Name \r\n * \r\n * \r\n * \r\n */\r\n imageCssClassField: 'imageCssClass',\r\n\r\n /** Image url field name.\r\n * @type string\r\n * @default 'imageUrl'\r\n * @example Default.HTML.Field.Name \r\n * \r\n * \r\n * @example Custom.HTML.Field.Name \r\n * \r\n * \r\n */\r\n imageUrlField: 'imageUrl',\r\n\r\n /** Image html field name.\r\n * @type string\r\n * @default 'imageHtml'\r\n * @example Default.HTML.Field.Name \r\n * \r\n * \r\n * @example Custom.HTML.Field.Name \r\n * \r\n * \r\n */\r\n imageHtmlField: 'imageHtml',\r\n\r\n /** Disabled field name. Assume that the item is not disabled if not set.\r\n * @type string\r\n * @default 'disabled'\r\n * @example Default.Value \r\n * \r\n * \r\n * @example Custom.Value \r\n * \r\n * \r\n * @example Bootstrap \r\n * \r\n * \r\n * @example Bootstrap.4 \r\n * \r\n * \r\n */\r\n disabledField: 'disabled',\r\n\r\n /** Width of the tree.\r\n * @type number\r\n * @default undefined\r\n * @example JS.Config \r\n * \r\n * \r\n * @example HTML.Config \r\n * \r\n * \r\n */\r\n width: undefined,\r\n\r\n /** When this setting is enabled the content of the tree will be wrapped by borders.\r\n * @type boolean\r\n * @default false\r\n * @example Material.Design.True \r\n * \r\n * \r\n * @example Material.Design.False \r\n * \r\n * \r\n * @example Bootstrap.3.True \r\n * \r\n * \r\n * @example Bootstrap.3.False \r\n * \r\n * \r\n * @example Bootstrap.4.True \r\n * \r\n * \r\n * @example Bootstrap.4.False \r\n * \r\n * \r\n */\r\n border: false,\r\n\r\n /** The name of the UI library that is going to be in use.\r\n * @additionalinfo The css file for bootstrap should be manually included if you use bootstrap.\r\n * @type (materialdesign|bootstrap|bootstrap4)\r\n * @default materialdesign\r\n * @example MaterialDesign \r\n * \r\n * \r\n * @example Bootstrap.3 \r\n * \r\n * \r\n * @example Bootstrap.4 \r\n * \r\n * \r\n */\r\n uiLibrary: 'materialdesign',\r\n\r\n /** The name of the icons library that is going to be in use. Currently we support Material Icons, Font Awesome and Glyphicons.\r\n * @additionalinfo If you use Bootstrap 3 as uiLibrary, then the iconsLibrary is set to Glyphicons by default.Select tree node in order to fire the event.
\r\n * \r\n * \r\n */\r\n select: function ($tree, $node, id) {\r\n return $tree.triggerHandler('select', [$node, id]);\r\n },\r\n\r\n /**\r\n * Event fires on un selection of tree node\r\n * @event unselect\r\n * @param {object} e - event data\r\n * @param {object} node - the node as jquery object\r\n * @param {string} id - the id of the record\r\n * @example Event.Sample \r\n *Select/Unselect tree node in order to fire the event.
\r\n * \r\n * \r\n */\r\n unselect: function ($tree, $node, id) {\r\n return $tree.triggerHandler('unselect', [$node, id]);\r\n },\r\n\r\n /**\r\n * Event fires before node expand.\r\n * @event expand\r\n * @param {object} e - event data\r\n * @param {object} node - the node as jquery object\r\n * @param {string} id - the id of the record\r\n * @example Event.Sample \r\n * \r\n * \r\n */\r\n expand: function ($tree, $node, id) {\r\n return $tree.triggerHandler('expand', [$node, id]);\r\n },\r\n\r\n /**\r\n * Event fires before node collapse.\r\n * @event collapse\r\n * @param {object} e - event data\r\n * @param {object} node - the node as jquery object\r\n * @param {string} id - the id of the record\r\n * @example Event.Sample \r\n * \r\n * \r\n */\r\n collapse: function ($tree, $node, id) {\r\n return $tree.triggerHandler('collapse', [$node, id]);\r\n },\r\n\r\n /**\r\n * Event fires on enable of tree node.\r\n * @event enable\r\n * @param {object} e - event data\r\n * @param {object} node - the node as jquery object\r\n * @example Event.Sample \r\n * \r\n * \r\n *Note: Minimize the window in order to enable scrolling for the drop down list.
\r\n *\r\n *
\r\n *
\r\n * \r\n * @example Bootstrap.4.Font.Awesome \r\n *
\r\n *
\r\n *
\r\n * \r\n * @example Bootstrap.3 \r\n *
\r\n *
\r\n *
\r\n * \r\n * @example Material.Design \r\n *
\r\n *
\r\n *
\r\n * \r\n */\r\n size: 'default',\r\n\r\n /** If set to true, the datepicker will have modal behavior.\r\n * @type Boolean\r\n * @default false\r\n * @example Material.Design \r\n * \r\n * \r\n * @example Bootstrap \r\n * \r\n * \r\n * @example Bootstrap.4 \r\n * \r\n * \r\n */\r\n modal: false,\r\n\r\n /** If set to true, add header to the datepicker.\r\n * @type Boolean\r\n * @default false\r\n * @example True \r\n * \r\n * \r\n * @example False \r\n * \r\n * \r\n */\r\n header: false,\r\n\r\n /** If set to true, add footer with ok and cancel buttons to the datepicker.\r\n * @type Boolean\r\n * @default false\r\n * @example True \r\n * \r\n * \r\n * @example False \r\n * \r\n * \r\n */\r\n footer: false,\r\n\r\n /** If set to true, show datepicker on input focus.\r\n * @type Boolean\r\n * @default true\r\n * @example True \r\n * \r\n * \r\n * @example False \r\n * \r\n * \r\n */\r\n showOnFocus: true,\r\n\r\n /** If set to true, show datepicker icon on the right side of the input.\r\n * @type Boolean\r\n * @default true\r\n * @example False \r\n * \r\n * \r\n * @example True \r\n * \r\n * \r\n */\r\n showRightIcon: true,\r\n\r\n style: {\r\n modal: 'gj-modal',\r\n wrapper: 'gj-datepicker gj-datepicker-md gj-unselectable',\r\n input: 'gj-textbox-md',\r\n calendar: 'gj-picker gj-picker-md datepicker gj-unselectable',\r\n footer: '',\r\n button: 'gj-button-md'\r\n }\r\n },\r\n\r\n bootstrap: {\r\n style: {\r\n wrapper: 'gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group',\r\n input: 'form-control',\r\n calendar: 'gj-picker gj-picker-bootstrap datepicker gj-unselectable',\r\n footer: 'modal-footer',\r\n button: 'btn btn-default'\r\n },\r\n iconsLibrary: 'glyphicons',\r\n showOtherMonths: true\r\n },\r\n\r\n bootstrap4: {\r\n style: {\r\n wrapper: 'gj-datepicker gj-datepicker-bootstrap gj-unselectable input-group',\r\n input: 'form-control',\r\n calendar: 'gj-picker gj-picker-bootstrap datepicker gj-unselectable',\r\n footer: 'modal-footer',\r\n button: 'btn btn-default'\r\n },\r\n showOtherMonths: true\r\n },\r\n\r\n fontawesome: {\r\n icons: {\r\n rightIcon: '',\r\n previousMonth: '',\r\n nextMonth: ''\r\n }\r\n },\r\n\r\n glyphicons: {\r\n icons: {\r\n rightIcon: '',\r\n previousMonth: '',\r\n nextMonth: ''\r\n }\r\n }\r\n};\r\n\r\ngj.datepicker.methods = {\r\n init: function (jsConfig) {\r\n gj.widget.prototype.init.call(this, jsConfig, 'datepicker');\r\n this.attr('data-datepicker', 'true');\r\n gj.datepicker.methods.initialize(this, this.data());\r\n return this;\r\n },\r\n\r\n initialize: function ($datepicker, data) {\r\n var $calendar, $rightIcon,\r\n $wrapper = $datepicker.parent('div[role=\"wrapper\"]');\r\n\r\n if ($wrapper.length === 0) {\r\n $wrapper = $('').addClass(data.style.wrapper); // The css class needs to be added before the wrapping, otherwise doesn't work.\r\n $datepicker.wrap($wrapper);\r\n } else {\r\n $wrapper.addClass(data.style.wrapper);\r\n }\r\n $wrapper = $datepicker.parent('div[role=\"wrapper\"]');\r\n\r\n data.width && $wrapper.css('width', data.width);\r\n\r\n $datepicker.val(data.value).addClass(data.style.input).attr('role', 'input');\r\n\r\n data.fontSize && $datepicker.css('font-size', data.fontSize);\r\n \r\n if (data.uiLibrary === 'bootstrap' || data.uiLibrary === 'bootstrap4') {\r\n if (data.size === 'small') {\r\n $wrapper.addClass('input-group-sm');\r\n $datepicker.addClass('form-control-sm');\r\n } else if (data.size === 'large') {\r\n $wrapper.addClass('input-group-lg');\r\n $datepicker.addClass('form-control-lg');\r\n }\r\n } else {\r\n if (data.size === 'small') {\r\n $wrapper.addClass('small');\r\n } else if (data.size === 'large') {\r\n $wrapper.addClass('large');\r\n }\r\n }\r\n\r\n if (data.showRightIcon) {\r\n if (data.uiLibrary === 'bootstrap') {\r\n $rightIcon = $('' + data.icons.rightIcon + '');\r\n } else if (data.uiLibrary === 'bootstrap4') {\r\n $rightIcon = $('');\r\n } else {\r\n $rightIcon = $(data.icons.rightIcon);\r\n }\r\n $rightIcon.attr('role', 'right-icon');\r\n $rightIcon.on('click', function (e) {\r\n var $calendar = $('body').find('[role=\"calendar\"][guid=\"' + $datepicker.attr('data-guid') + '\"]');\r\n if ($calendar.is(':visible')) {\r\n gj.datepicker.methods.close($datepicker);\r\n } else {\r\n gj.datepicker.methods.open($datepicker, data);\r\n }\r\n });\r\n $wrapper.append($rightIcon);\r\n }\r\n\r\n if (data.showOnFocus) {\r\n $datepicker.on('focus', function () {\r\n gj.datepicker.methods.open($datepicker, data);\r\n });\r\n }\r\n\r\n $calendar = gj.datepicker.methods.createCalendar($datepicker, data);\r\n\r\n if (data.footer !== true) {\r\n $datepicker.on('blur', function () {\r\n $datepicker.timeout = setTimeout(function () {\r\n gj.datepicker.methods.close($datepicker);\r\n }, 500);\r\n });\r\n $calendar.mousedown(function () {\r\n clearTimeout($datepicker.timeout);\r\n document.activeElement !== $datepicker[0] && $datepicker.focus();\r\n return false;\r\n });\r\n $calendar.on('click', function () {\r\n clearTimeout($datepicker.timeout);\r\n document.activeElement !== $datepicker[0] && $datepicker.focus();\r\n });\r\n }\r\n\r\n if (data.keyboardNavigation) {\r\n $(document).on('keydown', gj.datepicker.methods.createKeyDownHandler($datepicker, $calendar, data));\r\n }\r\n },\r\n\r\n createCalendar: function ($datepicker, data) {\r\n var date, $body, $footer, $btnCancel, $btnOk,\r\n $calendar = $('
Click on the month name in order to select another month.
\r\n * \r\n */\r\n select: function ($datepicker, type) {\r\n return $datepicker.triggerHandler('select', [type]);\r\n },\r\n\r\n /**\r\n * Event fires when the calendar is opened.\r\n * @event open\r\n * @param {object} e - event data\r\n * @example sample \r\n * \r\n * \r\n */\r\n open: function ($datepicker) {\r\n return $datepicker.triggerHandler('open');\r\n },\r\n\r\n /**\r\n * Event fires when the calendar is closed.\r\n * @event close\r\n * @param {object} e - event data\r\n * @example sample \r\n * \r\n * \r\n */\r\n close: function ($datepicker) {\r\n return $datepicker.triggerHandler('close');\r\n }\r\n};\r\n\r\ngj.datepicker.widget = function ($element, jsConfig) {\r\n var self = this,\r\n methods = gj.datepicker.methods;\r\n\r\n /** Gets or sets the value of the datepicker.\r\n * @method\r\n * @param {string} value - The value that needs to be selected.\r\n * @return string | datepicker object\r\n * @example Get \r\n * \r\n *\r\n *
\r\n *
\r\n * \r\n * @example Bootstrap.3 \r\n *
\r\n *
\r\n *
\r\n * \r\n * @example Material.Design \r\n *
\r\n *
\r\n *
\r\n * \r\n */\r\n size: 'default',\r\n\r\n icons: {\r\n rightIcon: ''\r\n },\r\n\r\n style: {\r\n modal: 'gj-modal',\r\n wrapper: 'gj-timepicker gj-timepicker-md gj-unselectable',\r\n input: 'gj-textbox-md',\r\n clock: 'gj-picker gj-picker-md timepicker',\r\n footer: '',\r\n button: 'gj-button-md'\r\n }\r\n },\r\n\r\n bootstrap: {\r\n style: {\r\n wrapper: 'gj-timepicker gj-timepicker-bootstrap gj-unselectable input-group',\r\n input: 'form-control',\r\n clock: 'gj-picker gj-picker-bootstrap timepicker',\r\n footer: 'modal-footer',\r\n button: 'btn btn-default'\r\n },\r\n iconsLibrary: 'glyphicons'\r\n },\r\n\r\n bootstrap4: {\r\n style: {\r\n wrapper: 'gj-timepicker gj-timepicker-bootstrap gj-unselectable input-group',\r\n input: 'form-control border',\r\n clock: 'gj-picker gj-picker-bootstrap timepicker',\r\n footer: 'modal-footer',\r\n button: 'btn btn-default'\r\n }\r\n }\r\n};\r\n\r\ngj.timepicker.methods = {\r\n init: function (jsConfig) {\r\n gj.picker.widget.prototype.init.call(this, jsConfig, 'timepicker');\r\n return this;\r\n },\r\n\r\n initialize: function () {\r\n\r\n },\r\n\r\n initMouse: function ($body, $input, $picker, data) {\r\n $body.off();\r\n $body.on('mousedown', gj.timepicker.methods.mouseDownHandler($input, $picker));\r\n $body.on('mousemove', gj.timepicker.methods.mouseMoveHandler($input, $picker, data));\r\n $body.on('mouseup', gj.timepicker.methods.mouseUpHandler($input, $picker, data));\r\n },\r\n\r\n createPicker: function ($timepicker) {\r\n var date, data = $timepicker.data(),\r\n $clock = $('').addClass(data.style.clock).attr('guid', $timepicker.attr('data-guid')),\r\n $hour = $(''),\r\n $minute = $(''),\r\n $header = $(''),\r\n $mode = $(''),\r\n $body = $(''),\r\n $btnOk = $(''),\r\n $btnCancel = $(''),\r\n $footer = $('');\r\n\r\n date = gj.core.parseDate(data.value, data.format, data.locale);\r\n if (!date || isNaN(date.getTime())) {\r\n date = new Date();\r\n } else {\r\n $timepicker.attr('hours', date.getHours());\r\n }\r\n\r\n gj.timepicker.methods.initMouse($body, $timepicker, $clock, data);\r\n\r\n if (data.header) {\r\n $hour.on('click', function () {\r\n gj.timepicker.methods.renderHours($timepicker, $clock, data);\r\n });\r\n $minute.on('click', function () {\r\n gj.timepicker.methods.renderMinutes($timepicker, $clock, data);\r\n });\r\n $header.append($hour).append(':').append($minute);\r\n if (data.mode === 'ampm') {\r\n $mode.append($('' + gj.core.messages[data.locale].am + '').on('click', function () {\r\n var hour = gj.timepicker.methods.getHour($clock);\r\n $clock.attr('mode', 'am');\r\n $(this).addClass('selected');\r\n $(this).parent().children('[role=\"pm\"]').removeClass('selected');\r\n if (hour >= 12) {\r\n $clock.attr('hour', hour - 12);\r\n }\r\n if (!data.modal) {\r\n clearTimeout($timepicker.timeout);\r\n $timepicker.focus();\r\n }\r\n }));\r\n $mode.append('
\r\n *
\r\n *
\r\n * \r\n * @example Bootstrap.4.Font.Awesome \r\n *
\r\n *
\r\n *
\r\n * \r\n * @example Bootstrap.3 \r\n *
\r\n *
\r\n *
\r\n * \r\n * @example Material.Design \r\n *
\r\n *
\r\n *
\r\n * \r\n */\r\n size: 'default',\r\n \r\n /** The language that needs to be in use.\r\n * @type string\r\n * @default 'en-us'\r\n * @example German \r\n * \r\n * \r\n * @example Bulgarian \r\n * \r\n * \r\n */\r\n locale: 'en-us',\r\n\r\n icons: {},\r\n\r\n style: {\r\n calendar: 'gj-picker gj-picker-md datetimepicker gj-unselectable'\r\n }\r\n },\r\n\r\n bootstrap: {\r\n style: {\r\n calendar: 'gj-picker gj-picker-bootstrap datetimepicker gj-unselectable'\r\n },\r\n iconsLibrary: 'glyphicons'\r\n },\r\n\r\n bootstrap4: {\r\n style: {\r\n calendar: 'gj-picker gj-picker-bootstrap datetimepicker gj-unselectable'\r\n }\r\n }\r\n};\r\n\r\ngj.datetimepicker.methods = {\r\n init: function (jsConfig) {\r\n gj.widget.prototype.init.call(this, jsConfig, 'datetimepicker');\r\n this.attr('data-datetimepicker', 'true');\r\n gj.datetimepicker.methods.initialize(this);\r\n return this;\r\n },\r\n\r\n getConfig: function (clientConfig, type) {\r\n var config = gj.widget.prototype.getConfig.call(this, clientConfig, type);\r\n\r\n uiLibrary = clientConfig.hasOwnProperty('uiLibrary') ? clientConfig.uiLibrary : config.uiLibrary;\r\n if (gj.datepicker.config[uiLibrary]) {\r\n $.extend(true, config.datepicker, gj.datepicker.config[uiLibrary]);\r\n }\r\n if (gj.timepicker.config[uiLibrary]) {\r\n $.extend(true, config.timepicker, gj.timepicker.config[uiLibrary]);\r\n }\r\n\r\n iconsLibrary = clientConfig.hasOwnProperty('iconsLibrary') ? clientConfig.iconsLibrary : config.iconsLibrary;\r\n if (gj.datepicker.config[iconsLibrary]) {\r\n $.extend(true, config.datepicker, gj.datepicker.config[iconsLibrary]);\r\n }\r\n if (gj.timepicker.config[iconsLibrary]) {\r\n $.extend(true, config.timepicker, gj.timepicker.config[iconsLibrary]);\r\n }\r\n\r\n return config;\r\n },\r\n\r\n initialize: function ($datetimepicker) {\r\n var $picker, $header, $date, $time, date,\r\n $switch, $calendarMode, $clockMode,\r\n data = $datetimepicker.data();\r\n\r\n // Init datepicker\r\n data.datepicker.uiLibrary = data.uiLibrary;\r\n data.datepicker.iconsLibrary = data.iconsLibrary;\r\n data.datepicker.width = data.width;\r\n data.datepicker.format = data.format;\r\n data.datepicker.locale = data.locale;\r\n data.datepicker.modal = data.modal;\r\n data.datepicker.footer = data.footer;\r\n data.datepicker.style.calendar = data.style.calendar;\r\n data.datepicker.value = data.value;\r\n data.datepicker.size = data.size;\r\n data.datepicker.autoClose = false;\r\n gj.datepicker.methods.initialize($datetimepicker, data.datepicker);\r\n $datetimepicker.on('select', function (e, type) {\r\n var date, value;\r\n if (type === 'day') {\r\n gj.datetimepicker.methods.createShowHourHandler($datetimepicker, $picker, data)();\r\n } else if (type === 'minute') {\r\n if ($picker.attr('selectedDay') && data.footer !== true) {\r\n selectedDay = $picker.attr('selectedDay').split('-');\r\n date = new Date(selectedDay[0], selectedDay[1], selectedDay[2], $picker.attr('hour') || 0, $picker.attr('minute') || 0);\r\n value = gj.core.formatDate(date, data.format, data.locale);\r\n $datetimepicker.val(value);\r\n gj.datetimepicker.events.change($datetimepicker);\r\n gj.datetimepicker.methods.close($datetimepicker);\r\n }\r\n }\r\n });\r\n $datetimepicker.on('open', function () {\r\n var $header = $picker.children('[role=\"header\"]');\r\n $header.find('[role=\"calendarMode\"]').addClass(\"selected\");\r\n $header.find('[role=\"clockMode\"]').removeClass(\"selected\");\r\n });\r\n\r\n $picker = $('body').find('[role=\"calendar\"][guid=\"' + $datetimepicker.attr('data-guid') + '\"]');\r\n date = data.value ? gj.core.parseDate(data.value, data.format, data.locale) : new Date();\r\n $picker.attr('hour', date.getHours());\r\n $picker.attr('minute', date.getMinutes());\r\n\r\n // Init timepicker\r\n data.timepicker.uiLibrary = data.uiLibrary;\r\n data.timepicker.iconsLibrary = data.iconsLibrary;\r\n data.timepicker.format = data.format;\r\n data.timepicker.locale = data.locale;\r\n data.timepicker.header = true;\r\n data.timepicker.footer = data.footer;\r\n data.timepicker.size = data.size;\r\n data.timepicker.mode = '24hr';\r\n data.timepicker.autoClose = false;\r\n\r\n // Init header \r\n $header = $('');\r\n $date = $('');\r\n $date.on('click', gj.datetimepicker.methods.createShowDateHandler($datetimepicker, $picker, data));\r\n $date.html(gj.core.formatDate(new Date(), 'ddd, mmm dd', data.locale));\r\n $header.append($date);\r\n\r\n $switch = $('');\r\n\r\n $calendarMode = $('event');\r\n $calendarMode.on('click', gj.datetimepicker.methods.createShowDateHandler($datetimepicker, $picker, data));\r\n $switch.append($calendarMode);\r\n\r\n $time = $('');\r\n $time.append($('').on('click', gj.datetimepicker.methods.createShowHourHandler($datetimepicker, $picker, data)).html(gj.core.formatDate(new Date(), 'HH', data.locale)));\r\n $time.append(':');\r\n $time.append($('').on('click', gj.datetimepicker.methods.createShowMinuteHandler($datetimepicker, $picker, data)).html(gj.core.formatDate(new Date(), 'MM', data.locale)));\r\n $switch.append($time);\r\n\r\n $clockMode = $('clock');\r\n $clockMode.on('click', gj.datetimepicker.methods.createShowHourHandler($datetimepicker, $picker, data));\r\n $switch.append($clockMode);\r\n $header.append($switch);\r\n\r\n $picker.prepend($header);\r\n },\r\n\r\n createShowDateHandler: function ($datetimepicker, $picker, data) {\r\n return function (e) {\r\n var $header = $picker.children('[role=\"header\"]');\r\n $header.find('[role=\"calendarMode\"]').addClass(\"selected\");\r\n $header.find('[role=\"date\"]').addClass(\"selected\");\r\n $header.find('[role=\"clockMode\"]').removeClass(\"selected\");\r\n $header.find('[role=\"hour\"]').removeClass(\"selected\");\r\n $header.find('[role=\"minute\"]').removeClass(\"selected\");\r\n gj.datepicker.methods.renderMonth($datetimepicker, $picker, data.datepicker);\r\n };\r\n },\r\n\r\n createShowHourHandler: function ($datetimepicker, $picker, data) {\r\n return function () {\r\n var $header = $picker.children('[role=\"header\"]');\r\n $header.find('[role=\"calendarMode\"]').removeClass(\"selected\");\r\n $header.find('[role=\"date\"]').removeClass(\"selected\");\r\n $header.find('[role=\"clockMode\"]').addClass(\"selected\");\r\n $header.find('[role=\"hour\"]').addClass(\"selected\");\r\n $header.find('[role=\"minute\"]').removeClass(\"selected\");\r\n\r\n gj.timepicker.methods.initMouse($picker.children('[role=\"body\"]'), $datetimepicker, $picker, data.timepicker);\r\n gj.timepicker.methods.renderHours($datetimepicker, $picker, data.timepicker);\r\n };\r\n },\r\n\r\n createShowMinuteHandler: function ($datetimepicker, $picker, data) {\r\n return function () {\r\n var $header = $picker.children('[role=\"header\"]');\r\n $header.find('[role=\"calendarMode\"]').removeClass(\"selected\");\r\n $header.find('[role=\"date\"]').removeClass(\"selected\");\r\n $header.find('[role=\"clockMode\"]').addClass(\"selected\");\r\n $header.find('[role=\"hour\"]').removeClass(\"selected\");\r\n $header.find('[role=\"minute\"]').addClass(\"selected\");\r\n gj.timepicker.methods.initMouse($picker.children('[role=\"body\"]'), $datetimepicker, $picker, data.timepicker);\r\n gj.timepicker.methods.renderMinutes($datetimepicker, $picker, data.timepicker);\r\n };\r\n },\r\n\r\n close: function ($datetimepicker) {\r\n var $calendar = $('body').find('[role=\"calendar\"][guid=\"' + $datetimepicker.attr('data-guid') + '\"]');\r\n $calendar.hide();\r\n $calendar.closest('div[role=\"modal\"]').hide();\r\n //gj.datepicker.events.close($datepicker);\r\n },\r\n\r\n value: function ($datetimepicker, value) {\r\n var $calendar, date, hour, data = $datetimepicker.data();\r\n if (typeof (value) === \"undefined\") {\r\n return $datetimepicker.val();\r\n } else {\r\n date = gj.core.parseDate(value, data.format, data.locale);\r\n if (date) {\r\n $calendar = $('body').find('[role=\"calendar\"][guid=\"' + $datetimepicker.attr('data-guid') + '\"]');\r\n gj.datepicker.methods.dayClickHandler($datetimepicker, $calendar, data, date)();\r\n // Set Time\r\n hour = date.getHours();\r\n if (data.mode === 'ampm') {\r\n $calendar.attr('mode', hour > 12 ? 'pm' : 'am');\r\n }\r\n $calendar.attr('hour', hour);\r\n $calendar.attr('minute', date.getMinutes());\r\n $datetimepicker.val(value);\r\n } else {\r\n $datetimepicker.val('');\r\n }\r\n return $datetimepicker;\r\n }\r\n },\r\n\r\n destroy: function ($datetimepicker) {\r\n var data = $datetimepicker.data(),\r\n $parent = $datetimepicker.parent(),\r\n $picker = $('body').find('[role=\"calendar\"][guid=\"' + $datetimepicker.attr('data-guid') + '\"]');\r\n if (data) {\r\n $datetimepicker.off();\r\n if ($picker.parent('[role=\"modal\"]').length > 0) {\r\n $picker.unwrap();\r\n }\r\n $picker.remove();\r\n $datetimepicker.removeData();\r\n $datetimepicker.removeAttr('data-type').removeAttr('data-guid').removeAttr('data-datetimepicker');\r\n $datetimepicker.removeClass();\r\n $parent.children('[role=\"right-icon\"]').remove();\r\n $datetimepicker.unwrap();\r\n }\r\n return $datetimepicker;\r\n }\r\n};\r\n\r\ngj.datetimepicker.events = {\r\n /**\r\n * Fires when the datetimepicker value changes as a result of selecting a new value.\r\n *\r\n * @event change\r\n * @param {object} e - event data\r\n * @example sample \r\n * \r\n * \r\n */\r\n change: function ($datetimepicker) {\r\n return $datetimepicker.triggerHandler('change');\r\n }\r\n};\r\n\r\ngj.datetimepicker.widget = function ($element, jsConfig) {\r\n var self = this,\r\n methods = gj.datetimepicker.methods;\r\n\r\n self.mouseMove = false;\r\n\r\n /** Gets or sets the value of the datetimepicker.\r\n * @method\r\n * @param {string} value - The value that needs to be selected.\r\n * @return string\r\n * @example Get \r\n * \r\n *