Update docs and rebuild files.

Former-commit-id: 6265fed04ac7d6da6c6ded82095c22c1a60d9193
This commit is contained in:
John-David Dalton
2013-02-04 01:21:22 -08:00
parent 0fb4f7e1c4
commit d58e366c40
7 changed files with 1414 additions and 360 deletions

393
dist/lodash.js vendored
View File

@@ -1314,6 +1314,11 @@
(!b || (otherType != 'function' && otherType != 'object'))) {
return false;
}
// exit early for `null` and `undefined`, avoiding ES3's Function#call behavior
// http://es5.github.com/#x15.3.4.4
if (a == null || b == null) {
return a === b;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
@@ -2032,18 +2037,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is
* the number of times the key was returned by `callback`. The `callback` is
* bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to count by (e.g. 'length').
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to count by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -2073,12 +2085,21 @@
* `collection`. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias all
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if all elements pass the callback check,
* else `false`.
@@ -2092,13 +2113,13 @@
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using callback "where" shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* _.every(stooges, 'age');
* // => true
*
* // using "_.where" callback shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*/
function every(collection, callback, thisArg) {
var result = true;
@@ -2126,18 +2147,40 @@
* the `callback` returns truthy for. The `callback` is bound to `thisArg` and
* invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias select
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that passed the callback check.
* @example
*
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [2, 4, 6]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.filter(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*
* // using "_.where" callback shorthand
* _.filter(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*/
function filter(collection, callback, thisArg) {
var result = [];
@@ -2164,18 +2207,25 @@
}
/**
* Examines each element in a `collection`, returning the first that the
* `callback` returns truthy for. The function returns as soon as it finds
* an acceptable element, and does not iterate over the entire `collection`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
* Examines each element in a `collection`, returning the first that the `callback`
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias detect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the element that passed the callback check,
* else `undefined`.
@@ -2191,11 +2241,11 @@
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using callback "where" shorthand
* // using "_.where" callback shorthand
* var veggie = _.find(food, { 'type': 'vegetable' });
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* var healthy = _.find(food, 'organic');
* // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
*/
@@ -2251,18 +2301,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is an
* array of elements passed to `callback` that returned the key. The `callback`
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to group by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to group by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -2273,6 +2330,7 @@
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
* // => { '4': [4.2], '6': [6.1, 6.4] }
*
* // using "_.pluck" callback shorthand
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
@@ -2324,15 +2382,24 @@
/**
* Creates an array of values by running each element in the `collection`
* through a `callback`. The `callback` is bound to `thisArg` and invoked with
* through the `callback`. The `callback` is bound to `thisArg` and invoked with
* three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias collect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of the results of each `callback` execution.
* @example
@@ -2342,6 +2409,15 @@
*
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
* // => [3, 6, 9] (order is not guaranteed)
*
* var stooges = [
* { 'name': 'moe', 'age': 40 },
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using "_.pluck" callback shorthand
* _.map(stooges, 'name');
* // => ['moe', 'larry']
*/
function map(collection, callback, thisArg) {
var index = -1,
@@ -2367,11 +2443,20 @@
* criterion by which the value is ranked. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the maximum value.
* @example
@@ -2386,6 +2471,10 @@
*
* _.max(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'larry', 'age': 50 };
*
* // using "_.pluck" callback shorthand
* _.max(stooges, 'age');
* // => { 'name': 'larry', 'age': 50 };
*/
function max(collection, callback, thisArg) {
var computed = -Infinity,
@@ -2423,11 +2512,20 @@
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the minimum value.
* @example
@@ -2442,6 +2540,10 @@
*
* _.min(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'moe', 'age': 40 };
*
* // using "_.pluck" callback shorthand
* _.min(stooges, 'age');
* // => { 'name': 'moe', 'age': 40 };
*/
function min(collection, callback, thisArg) {
var computed = Infinity,
@@ -2474,8 +2576,7 @@
}
/**
* Retrieves the value of a specified property from all elements in
* the `collection`.
* Retrieves the value of a specified property from all elements in the `collection`.
*
* @static
* @memberOf _
@@ -2583,11 +2684,20 @@
* The opposite of `_.filter`, this method returns the elements of a
* `collection` that `callback` does **not** return truthy for.
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that did **not** pass the
* callback check.
@@ -2595,6 +2705,19 @@
*
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [1, 3, 5]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.reject(food, 'organic');
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*
* // using "_.where" callback shorthand
* _.reject(food, { 'type': 'fruit' });
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*/
function reject(collection, callback, thisArg) {
callback = createCallback(callback, thisArg);
@@ -2661,12 +2784,21 @@
* does not iterate over the entire `collection`. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias any
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if any element passes the callback check,
* else `false`.
@@ -2674,6 +2806,19 @@
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.some(food, 'organic');
* // => true
*
* // using "_.where" callback shorthand
* _.some(food, { 'type': 'meat' });
* // => false
*/
function some(collection, callback, thisArg) {
var result;
@@ -2698,16 +2843,24 @@
/**
* Creates an array, stable sorted in ascending order by the results of
* running each element of `collection` through a `callback`. The `callback`
* running each element of `collection` through the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to sort by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to sort by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of sorted elements.
* @example
@@ -2718,6 +2871,7 @@
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
* // => [3, 1, 2]
*
* // using "_.pluck" callback shorthand
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
* // => ['apple', 'banana', 'strawberry']
*/
@@ -2771,6 +2925,7 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Object} properties The object of property values to filter by.
@@ -2785,9 +2940,7 @@
* _.where(stooges, { 'age': 40 });
* // => [{ 'name': 'moe', 'age': 40 }]
*/
function where(collection, properties) {
return filter(collection, properties);
}
var where = filter;
/*--------------------------------------------------------------------------*/
@@ -2857,13 +3010,21 @@
* the first elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias head, take
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the first element(s) of `array`.
* @example
@@ -2878,6 +3039,25 @@
* return num < 3;
* });
* // => [1, 2]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.first(food, 'organic');
* // => [{ 'name': 'banana', 'organic': true }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.first(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
*/
function first(array, callback, thisArg) {
if (array) {
@@ -2985,12 +3165,20 @@
* from the result. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -3005,6 +3193,25 @@
* return num > 1;
* });
* // => [1]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.initial(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.initial(food, { 'type': 'vegetable' });
* // => [{ 'name': 'banana', 'type': 'fruit' }]
*/
function initial(array, callback, thisArg) {
if (!array) {
@@ -3081,12 +3288,21 @@
* the last elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the last element(s) of `array`.
* @example
@@ -3101,6 +3317,25 @@
* return num > 1;
* });
* // => [2, 3]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.last(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.last(food, { 'type': 'vegetable' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
*/
function last(array, callback, thisArg) {
if (array) {
@@ -3245,13 +3480,21 @@
* truthy for are excluded from the result. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias drop, tail
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -3266,6 +3509,25 @@
* return num < 3;
* });
* // => [3]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.rest(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.rest(food, { 'type': 'fruit' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }]
*/
function rest(array, callback, thisArg) {
if (typeof callback == 'function') {
@@ -3288,16 +3550,23 @@
* should be inserted into `array` in order to maintain the sort order of the
* sorted `array`. If `callback` is passed, it will be executed for `value` and
* each element in `array` to compute their sort ranking. The `callback` is
* bound to `thisArg` and invoked with one argument; (value). The `callback`
* argument may also be the name of a property to order by.
* bound to `thisArg` and invoked with one argument; (value).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to iterate over.
* @param {Mixed} value The value to evaluate.
* @param {Function|String} [callback=identity|property] The function called
* per iteration or property name to order by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Number} Returns the index at which the value should be inserted
* into `array`.
@@ -3306,6 +3575,7 @@
* _.sortedIndex([20, 30, 50], 40);
* // => 2
*
* // using "_.pluck" callback shorthand
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
* // => 2
*
@@ -3366,13 +3636,22 @@
* element of `array` is passed through a callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias unique
* @category Arrays
* @param {Array} array The array to process.
* @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a duplicate-value-free array.
* @example
@@ -3388,6 +3667,10 @@
*
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniq(array, isSorted, callback, thisArg) {
var index = -1,

66
dist/lodash.min.js vendored
View File

@@ -4,36 +4,36 @@
* Build: `lodash strict modern -o ./dist/lodash.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n,t){"use strict";function r(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=_t(t))&&_t(r);if(r)n=n==r||_t(n)==r&&!h(n);else{var e=W;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!w(t)||t instanceof t?(Yt(n,function(n,t){e=t}),n=e===W||bt.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||et);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";
(bt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return bt.call(o,e)&&-1<P(o[e],r)}return-1<P(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function f(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=Q,a=n.apply(c,a),j(a)?a:c):n.apply(c,a)
}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function a(n,r,e){if(!n)return G;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=tr(n);return function(r){for(var e=o.length,u=W;e--&&(u=b(r[o[e]],n[o[e]],t,t,rt)););return u}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function c(){for(var n,t={g:Ut,b:"k(m)",c:"",h:"",l:"",m:L},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];
return n=t.a,t.d=/^[^,]+/.exec(n)[0],r="'use strict';var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b&&(r+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?r+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(r+="for(i in m){",t.m&&(r+="if(",t.m&&(r+="h.call(m,i)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",Function("e,h,j,k,l,q,o,t","return function("+n+"){"+r+"}")(a,bt,h,nr,A,Ht,qt,jt)}function l(n){return"\\"+Jt[n]}function p(n){return rr[n]
}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return er[n]}function h(n){return xt.call(n)==$t}function y(n){var t=[];return Zt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var f=n;if(typeof r=="function"&&(u=e,e=r,r=W),typeof e=="function"){e=typeof u=="undefined"?e:a(e,u,1);var f=e(f),c=typeof f!="undefined";c||(f=n)}if(u=j(f)){var l=xt.call(f);if(!Vt[l])return f;var p=nr(f)
}if(!u||!r)return u&&!c?p?v(f):ur({},f):f;switch(u=Gt[l],l){case Dt:case Tt:return c?f:new u(+f);case Bt:case zt:return c?f:new u(f);case Mt:return c?f:u(f.source,ct.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(f=p?u(f.length):{},p&&(bt.call(n,"index")&&(f.index=n.index),bt.call(n,"input")&&(f.input=n.input))),o.push(n),i.push(f),(p?R:Zt)(c?f:n,function(n,u){f[u]=m(n,r,e,t,o,i)}),f}function d(n){var t=[];return Yt(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=tr(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function b(n,r,e,u,o,i,f){if(e){e=typeof u=="undefined"?e:a(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return W;if(l=xt.call(n),u=xt.call(r),l==$t&&(l=It),u==$t&&(u=It),l!=u)return W;switch(l){case Dt:case Tt:return+n==+r;case Bt:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Mt:case zt:return n==r+""}if(u=l==Ft,!u){if(n.__wrapped__||r.__wrapped__)return b(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,f);
if(l!=It)return W;var l=n.constructor,p=r.constructor;if(l!=p&&(!w(l)||!(l instanceof l&&w(p)&&p instanceof p)))return W}for(i||(i=[]),f||(f=[]),l=i.length;l--;)if(i[l]==n)return f[l]==r;var s=0,c=L;if(i.push(n),f.push(r),u){if(s=r.length,c=o==rt||s==n.length)for(;s--&&(c=b(n[s],r[s],e,t,o,i,f)););return c}return Yt(r,function(r,u,a){return bt.call(a,u)?(s++,c=bt.call(n,u)&&b(n[u],r,e,t,o,i,f)):void 0}),c&&o!=rt&&Yt(n,function(n,t,r){return bt.call(r,t)?c=-1<--s:void 0}),c}function w(n){return typeof n=="function"
}function j(n){return n?Ht[typeof n]:W}function x(n){return typeof n=="number"||xt.call(n)==Bt}function A(n){return typeof n=="string"||xt.call(n)==zt}function O(n,t,e){var u=arguments,o=0,i=2;if(!j(n))return n;if(e===rt)var f=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length,f=typeof(f=u[i-2])=="function"?a(f,u[--i],2):typeof(f=u[i-1])=="function"&&f);for(;++o<i;)(nr(u[o])?R:Zt)(u[o],function(t,e){var u,o,i=t,a=n[e];if(t&&((o=nr(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){a=l[i];
break}u||(a=o?nr(a)?a:[]:r(a)?a:{},f&&(i=f(a,t),typeof i!="undefined"&&(a=i)),c.push(t),l.push(a),f||(a=O(a,t,rt,f,c,l)))}else f&&(i=f(a,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(a=i);n[e]=a});return n}function E(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?kt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):P(n,t,r)):Xt(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function q(n,t,r){var e=L;
if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Xt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function k(n,t,r){var e=[];if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Xt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function N(n,t,r){var e;return t=a(t,r),R(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function R(n,t,r){if(t&&typeof r=="undefined"&&nr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==W;);}else Xt(n,t,r);
return n}function $(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),nr(n))for(;++e<u;)o[e]=t(n[e],e,n);else Xt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function F(n,t,r){var e=-1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t){return $(n,t+"")}function T(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),nr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
}else Xt(n,function(n,e,o){r=u?(u=W,n):t(r,n,e,o)});return r}function B(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=tr(n),u=i.length;return t=a(t,e,4),R(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=W,n[f]):t(r,n[f],f,a)}),r}function I(n,t,r){var e;if(t=a(t,r),nr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Xt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++
}else if(e=t,e==Q||r)return n[0];return v(n,0,Nt(kt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];nr(o)?wt.apply(u,t?o:z(o)):u.push(o)}return u}function P(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?kt(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==Q||r?1:kt(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u;
for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=W);var c=!t&&75<=o;if(c)var l={};for(r&&(f=[],r=a(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=bt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>P(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function V(n,t){return Kt||At&&2<arguments.length?At.call.apply(At,arguments):f(n,t,v(arguments,2))}function G(n){return n}function H(n){R(d(n),function(t){var r=e[t]=n[t];
e.prototype[t]=function(){var n=[this.__wrapped__];return wt.apply(n,arguments),new e(r.apply(e,n))}})}function J(){return this.__wrapped__}var L=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z=[],nt={},tt=0,rt=nt,et=30,ut=n._,ot=/&(?:amp|lt|gt|quot|#x27);/g,it=/\b__p\+='';/g,ft=/\b(__p\+=)''\+/g,at=/(__e\(.*?\)|\b__t\))\+'';/g,ct=/\w*$/,lt=RegExp("^"+(nt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,st=/<%=([\s\S]+?)%>/g,vt=/($^)/,gt=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,yt=Math.ceil,mt=Z.concat,dt=Math.floor,_t=lt.test(_t=Object.getPrototypeOf)&&_t,bt=nt.hasOwnProperty,wt=Z.push,jt=nt.propertyIsEnumerable,xt=nt.toString,At=lt.test(At=v.bind)&&At,Ot=lt.test(Ot=Array.isArray)&&Ot,Et=n.isFinite,St=n.isNaN,qt=lt.test(qt=Object.keys)&&qt,kt=Math.max,Nt=Math.min,Rt=Math.random,$t="[object Arguments]",Ft="[object Array]",Dt="[object Boolean]",Tt="[object Date]",Bt="[object Number]",It="[object Object]",Mt="[object RegExp]",zt="[object String]",Pt=!!n.attachEvent,Ct=At&&!/\n|true/.test(At+Pt),Kt=At&&!Ct,Ut=qt&&(Pt||Ct),Vt={"[object Function]":W};
Vt[$t]=Vt[Ft]=Vt[Dt]=Vt[Tt]=Vt[Bt]=Vt[It]=Vt[Mt]=Vt[zt]=L;var Gt={};Gt[Ft]=Array,Gt[Dt]=Boolean,Gt[Tt]=Date,Gt[It]=Object,Gt[Bt]=Number,Gt[Mt]=RegExp,Gt[zt]=String;var Ht={"boolean":W,"function":L,object:L,number:W,string:W,undefined:W},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:st,variable:"",imports:{_:e}};var Lt={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},Qt={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},Wt={l:"if(!q[typeof m])return u;"+Qt.l,b:W},Xt=c(Qt),Yt=c(Qt,Wt,{m:W}),Zt=c(Qt,Wt),nr=Ot||function(n){return n instanceof Array||xt.call(n)==Ft
},tr=qt?function(n){return j(n)?qt(n):[]}:y,rr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},er=_(rr),ur=c(Lt),or=c(Lt,{h:"if(u[i]==null)"+Lt.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==xt.call(n)}),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},e.assign=ur,e.at=function(n){for(var t=-1,r=mt.apply(Z,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},e.bind=V,e.bindAll=function(n){for(var t=mt.apply(Z,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];
n[u]=V(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",bt.call(e,r)?e[r]++:e[r]=1}),e},e.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;
return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=or,e.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=mt.apply(Z,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.filter=k,e.flatten=z,e.forEach=R,e.forIn=Yt,e.forOwn=Zt,e.functions=d,e.groupBy=function(n,t,r){var e={};
return t=a(t,r),R(n,function(n,r,u){r=t(n,r,u)+"",(bt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,Nt(kt(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=bt.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>P(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;
a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return R(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=tr,e.map=$,e.max=F,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return bt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&nr(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)
}}else t=!t&&A(n)?o:a(t,r),Xt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=mt.apply(Z,arguments);return Yt(n,function(n,r,i){(e?!t(n,r,i):0>P(o,r,1))&&(u[r]=n)}),u},e.once=function(n){var t,r;return function(){return t?r:(t=L,r=n.apply(this,arguments),n=Q,r)}},e.pairs=function(n){for(var t=-1,r=tr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),Q,rt)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=mt.apply(Z,arguments),i=j(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Yt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=D,e.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=kt(0,yt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),k(n,function(n,r,e){return!t(n,r,e)
})},e.rest=C,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return R(n,function(n){var r=dt(Rt()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),R(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return U(mt.apply(Z,arguments))},e.uniq=U,e.values=E,e.where=function(n,t){return k(n,t)},e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t];e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];
return wt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?F(D(arguments,"length")):0,e=Array(r);++t<r;)e[t]=D(arguments,t);return e},e.collect=$,e.drop=C,e.each=R,e.extend=ur,e.methods=d,e.select=k,e.tail=C,e.unique=U,H(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,L,t,r)},e.contains=S,e.escape=function(n){return n==Q?"":(n+"").replace(gt,p)},e.every=q,e.find=N,e.has=function(n,t){return n?bt.call(n,t):W},e.identity=G,e.indexOf=P,e.isArguments=h,e.isArray=nr,e.isBoolean=function(n){return n===L||n===W||xt.call(n)==Dt
},e.isDate=function(n){return n instanceof Date||xt.call(n)==Tt},e.isElement=function(n){return n?1===n.nodeType:W},e.isEmpty=function(n){var t=L;if(!n)return t;var r=xt.call(n),e=n.length;return r==Ft||r==zt||r==$t||r==It&&typeof e=="number"&&w(n.splice)?!e:(Zt(n,function(){return t=W}),t)},e.isEqual=b,e.isFinite=function(n){return Et(n)&&!St(parseFloat(n))},e.isFunction=w,e.isNaN=function(n){return x(n)&&n!=+n},e.isNull=function(n){return n===Q},e.isNumber=x,e.isObject=j,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||xt.call(n)==Mt
},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kt(0,e+r):Nt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=H,e.noConflict=function(){return n._=ut,this},e.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+dt(Rt()*((+t||0)-n+1))},e.reduce=T,e.reduceRight=B,e.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:tr(n).length
},e.some=I,e.sortedIndex=K,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=or({},u,o);var i,f=or({},u.imports,o.imports),o=tr(f),f=E(f),a=0,c=u.interpolate||vt,p="__p+='";n.replace(RegExp((u.escape||vt).source+"|"+c.source+"|"+(c===st?pt:vt).source+"|"+(u.evaluate||vt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(ht,l),r&&(p+="'+__e("+r+")+'"),o&&(i=L,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(it,""):p).replace(ft,"$1").replace(at,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==Q?"":(n+"").replace(ot,g)},e.uniqueId=function(n){var t=++tt;return(n==Q?"":n+"")+t},e.all=q,e.any=I,e.detect=N,e.foldl=T,e.foldr=B,e.include=S,e.inject=T,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return wt.apply(t,arguments),n.apply(e,t)})}),e.first=M,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,kt(0,u-e))}},e.take=M,e.head=M,Zt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r);return t==Q||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.0-rc.3",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=J,e.prototype.valueOf=J,Xt(["join","pop","shift"],function(n){var t=Z[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}
}),Xt(["push","reverse","sort","unshift"],function(n){var t=Z[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xt(["concat","slice","splice"],function(n){var t=Z[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments))}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=e)._=e:X._=e:n._=e})(this);
;(function(n,t){"use strict";function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||Z);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(yt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return yt.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;
if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=s(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(p.prototype=n.prototype,c=new p,p.prototype=null,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)}var o=b(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,r,e){if(!n)return V;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=Xt(n);return function(r){for(var e=o.length,u=!1;e--&&(u=d(r[o[e]],n[o[e]],t,t,Y)););return u
}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function a(){for(var n,t={g:zt,b:"k(m)",c:"",h:"",l:"",m:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];return n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="'use strict';var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b&&(e+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?e+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(e+="for(i in m){",t.m&&(e+="if(",t.m&&(e+="h.call(m,i)"),e+="){"),e+=t.h+";",t.m&&(e+="}"),e+="}"),t.b&&(e+="}"),e+=t.c+";return u",r("e,h,j,k,l,q,o,t","return function("+n+"){"+e+"}")(f,yt,g,Wt,x,Kt,At,_t)
}function c(n){return"\\"+Ut[n]}function l(n){return Yt[n]}function p(){}function s(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function v(n){return Zt[n]}function g(n){return dt.call(n)==qt}function h(n){var t=[];return Qt(n,function(n,r){t.push(r)}),t}function y(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=!1),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";
c||(a=n)}if(u=w(a)){var l=dt.call(a);if(!Pt[l])return a;var p=Wt(a)}if(!u||!r)return u&&!c?p?s(a):nr({},a):a;switch(u=Ct[l],l){case Nt:case Rt:return c?a:new u(+a);case $t:case Tt:return c?a:new u(a);case Dt:return c?a:u(a.source,ot.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=p?u(a.length):{},p&&(yt.call(n,"index")&&(a.index=n.index),yt.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(p?N:Qt)(c?a:n,function(n,u){a[u]=y(n,r,e,t,o,i)}),a}function m(n){var t=[];
return Lt(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Xt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return!1;if(null==n||null==r)return n===r;if(l=dt.call(n),u=dt.call(r),l==qt&&(l=Ft),u==qt&&(u=Ft),l!=u)return!1;
switch(l){case Nt:case Rt:return+n==+r;case $t:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Dt:case Tt:return n==r+""}if(u=l==kt,!u){if(n.__wrapped__||r.__wrapped__)return d(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);if(l!=Ft)return!1;var l=n.constructor,p=r.constructor;if(l!=p&&(!b(l)||!(l instanceof l&&b(p)&&p instanceof p)))return!1}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var s=0,c=!0;if(i.push(n),a.push(r),u){if(s=r.length,c=o==Y||s==n.length)for(;s--&&(c=d(n[s],r[s],e,t,o,i,a)););return c
}return Lt(r,function(r,u,f){return yt.call(f,u)?(s++,c=yt.call(n,u)&&d(n[u],r,e,t,o,i,a)):void 0}),c&&o!=Y&&Lt(n,function(n,t,r){return yt.call(r,t)?c=-1<--s:void 0}),c}function b(n){return typeof n=="function"}function w(n){return n?Kt[typeof n]:!1}function j(n){return typeof n=="number"||dt.call(n)==$t}function x(n){return typeof n=="string"||dt.call(n)==Tt}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===Y)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?f(i,e[--o],2):typeof(i=e[o-1])=="function"&&i);
for(;++u<o;)(Wt(e[u])?N:Qt)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=Wt(t))||rr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?Wt(f)?f:[]:rr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=A(f,t,Y,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function O(n){for(var t=-1,r=Xt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function E(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?Ot(0,u+r):r)||0,typeof u=="number"?o=-1<(x(n)?n.indexOf(t,r):z(n,t,r)):Jt(n,function(n){return++e<r?void 0:!(o=n===t)
}),o}function S(n,t,r){var e=!0;if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Jt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function q(n,t,r){var e=[];if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Jt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function k(n,t,r){var e;return t=f(t,r),N(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function N(n,t,r){if(t&&typeof r=="undefined"&&Wt(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else Jt(n,t,r);
return n}function R(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),Wt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Jt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function $(n,t,r){var e=-1/0,o=e;if(!t&&Wt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Jt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function F(n,t){return R(n,t+"")}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),Wt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
}else Jt(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Xt(n),u=i.length;return t=f(t,e,4),N(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=!1,n[f]):t(r,n[f],f,a)}),r}function B(n,t,r){var e;if(t=f(t,r),Wt(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Jt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++
}else if(e=t,null==e||r)return n[0];return s(n,0,Et(Ot(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Wt(o)?mt.apply(u,t?o:M(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ot(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=null==t||r?1:Ot(0,t);return s(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u;
for(r=r?f(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=yt.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Mt||bt&&2<arguments.length?bt.call.apply(bt,arguments):i(n,t,s(arguments,2))}function V(n){return n}function G(n){N(m(n),function(t){var e=r[t]=n[t];
r.prototype[t]=function(){var n=[this.__wrapped__];return mt.apply(n,arguments),new r(e.apply(r,n))}})}function H(){return this.__wrapped__}var J=typeof exports=="object"&&exports,L=typeof global=="object"&&global;L.global===L&&(n=L);var Q=[],W={},X=0,Y=W,Z=30,nt=n._,tt=/&(?:amp|lt|gt|quot|#x27);/g,rt=/\b__p\+='';/g,et=/\b(__p\+=)''\+/g,ut=/(__e\(.*?\)|\b__t\))\+'';/g,ot=/\w*$/,it=RegExp("^"+(W.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ft=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,at=/<%=([\s\S]+?)%>/g,ct=/($^)/,lt=/[&<>"']/g,pt=/['\n\r\t\u2028\u2029\\]/g,st=Math.ceil,vt=Q.concat,gt=Math.floor,ht=it.test(ht=Object.getPrototypeOf)&&ht,yt=W.hasOwnProperty,mt=Q.push,_t=W.propertyIsEnumerable,dt=W.toString,bt=it.test(bt=s.bind)&&bt,wt=it.test(wt=Array.isArray)&&wt,jt=n.isFinite,xt=n.isNaN,At=it.test(At=Object.keys)&&At,Ot=Math.max,Et=Math.min,St=Math.random,qt="[object Arguments]",kt="[object Array]",Nt="[object Boolean]",Rt="[object Date]",$t="[object Number]",Ft="[object Object]",Dt="[object RegExp]",Tt="[object String]",Bt=!!n.attachEvent,It=bt&&!/\n|true/.test(bt+Bt),Mt=bt&&!It,zt=At&&(Bt||It),Pt={"[object Function]":!1};
Pt[qt]=Pt[kt]=Pt[Nt]=Pt[Rt]=Pt[$t]=Pt[Ft]=Pt[Dt]=Pt[Tt]=!0;var Ct={};Ct[kt]=Array,Ct[Nt]=Boolean,Ct[Rt]=Date,Ct[Ft]=Object,Ct[$t]=Number,Ct[Dt]=RegExp,Ct[Tt]=String;var Kt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Ut={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:at,variable:"",imports:{_:r}};var Vt={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},Gt={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},Ht={l:"if(!q[typeof m])return u;"+Gt.l,b:!1},Jt=a(Gt),Lt=a(Gt,Ht,{m:!1}),Qt=a(Gt,Ht),Wt=wt||function(n){return n instanceof Array||dt.call(n)==kt
},Xt=At?function(n){return w(n)?At(n):[]}:h,Yt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Zt=_(Yt),nr=a(Vt),tr=a(Vt,{h:"if(u[i]==null)"+Vt.h});b(/x/)&&(b=function(n){return n instanceof Function||"[object Function]"==dt.call(n)});var rr=function(n){if(!n||typeof n!="object")return!1;var t=n.valueOf,r=typeof t=="function"&&(r=ht(t))&&ht(r);if(r)n=n==r||ht(n)==r&&!g(n);else{var e=!1;!n||typeof n!="object"||g(n)?n=e:(t=n.constructor,!b(t)||t instanceof t?(Lt(n,function(n,t){e=t}),n=!1===e||yt.call(n,e)):n=e)
}return n};r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=nr,r.at=function(n){for(var t=-1,r=vt.apply(Q,s(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u},r.bind=U,r.bindAll=function(n){for(var t=vt.apply(Q,arguments),r=1<t.length?0:(t=m(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,s(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];
u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",yt.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=null,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=tr,r.defer=function(n){var r=s(arguments,1);
return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=s(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=vt.apply(Q,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=q,r.flatten=M,r.forEach=N,r.forIn=Lt,r.forOwn=Qt,r.functions=m,r.groupBy=function(n,t,r){var e={};return t=f(t,r),N(n,function(n,r,u){r=t(n,r,u)+"",(yt.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];
var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return s(n,0,Et(Ot(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=yt.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;a.push(l)}}return a},r.invert=_,r.invoke=function(n,t){var r=s(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
return N(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=Xt,r.map=R,r.max=$,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return yt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=A,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&Wt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Jt(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=vt.apply(Q,arguments);return Lt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},r.pairs=function(n){for(var t=-1,r=Xt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,s(arguments,1))},r.partialRight=function(n){return i(n,s(arguments,1),null,Y)
},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=vt.apply(Q,arguments),i=w(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),Lt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=F,r.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Ot(0,st((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),q(n,function(n,r,e){return!t(n,r,e)})},r.rest=P,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
return N(n,function(n){var r=gt(St()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),N(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=null,f=a,u=n.apply(o,e)),u
}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?s(n):O(n)},r.union=function(){return K(vt.apply(Q,arguments))},r.uniq=K,r.values=O,r.where=q,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];return mt.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?$(F(arguments,"length")):0,e=Array(r);++t<r;)e[t]=F(arguments,t);
return e},r.collect=R,r.drop=P,r.each=N,r.extend=nr,r.methods=m,r.select=q,r.tail=P,r.unique=K,G(r),r.clone=y,r.cloneDeep=function(n,t,r){return y(n,!0,t,r)},r.contains=E,r.escape=function(n){return null==n?"":(n+"").replace(lt,l)},r.every=S,r.find=k,r.has=function(n,t){return n?yt.call(n,t):!1},r.identity=V,r.indexOf=z,r.isArguments=g,r.isArray=Wt,r.isBoolean=function(n){return!0===n||!1===n||dt.call(n)==Nt},r.isDate=function(n){return n instanceof Date||dt.call(n)==Rt},r.isElement=function(n){return n?1===n.nodeType:!1
},r.isEmpty=function(n){var t=!0;if(!n)return t;var r=dt.call(n),e=n.length;return r==kt||r==Tt||r==qt||r==Ft&&typeof e=="number"&&b(n.splice)?!e:(Qt(n,function(){return t=!1}),t)},r.isEqual=d,r.isFinite=function(n){return jt(n)&&!xt(parseFloat(n))},r.isFunction=b,r.isNaN=function(n){return j(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=j,r.isObject=w,r.isPlainObject=rr,r.isRegExp=function(n){return n instanceof RegExp||dt.call(n)==Dt},r.isString=x,r.isUndefined=function(n){return typeof n=="undefined"
},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ot(0,e+r):Et(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=G,r.noConflict=function(){return n._=nt,this},r.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+gt(St()*((+t||0)-n+1))},r.reduce=D,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return b(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Xt(n).length},r.some=B,r.sortedIndex=C,r.template=function(n,e,u){var o=r.templateSettings;
n||(n=""),u=tr({},u,o);var i,f=tr({},u.imports,o.imports),o=Xt(f),f=O(f),a=0,l=u.interpolate||ct,p="__p+='";n.replace(RegExp((u.escape||ct).source+"|"+l.source+"|"+(l===at?ft:ct).source+"|"+(u.evaluate||ct).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(pt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=!0,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(rt,""):p).replace(et,"$1").replace(ut,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return null==n?"":(n+"").replace(tt,v)},r.uniqueId=function(n){var t=++X;return(null==n?"":n+"")+t},r.all=S,r.any=B,r.detect=k,r.foldl=D,r.foldr=T,r.include=E,r.inject=D,Qt(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return mt.apply(t,arguments),n.apply(r,t)})}),r.first=I,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return s(n,Ot(0,u-e))}},r.take=I,r.head=I,Qt(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=H,r.prototype.valueOf=H,Jt(["join","pop","shift"],function(n){var t=Q[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
}}),Jt(["push","reverse","sort","unshift"],function(n){var t=Q[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Jt(["concat","slice","splice"],function(n){var t=Q[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):J?typeof module=="object"&&module&&module.exports==J?(module.exports=r)._=r:J._=r:n._=r})(this);

View File

@@ -1127,6 +1127,9 @@
(!b || (otherType != 'function' && otherType != 'object'))) {
return false;
}
if (a == null || b == null) {
return a === b;
}
var className = toString.call(a),
otherClass = toString.call(b);
@@ -1585,18 +1588,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is
* the number of times the key was returned by `callback`. The `callback` is
* bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to count by (e.g. 'length').
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to count by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -1626,12 +1636,21 @@
* `collection`. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias all
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if all elements pass the callback check,
* else `false`.
@@ -1645,13 +1664,13 @@
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using callback "where" shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* _.every(stooges, 'age');
* // => true
*
* // using "_.where" callback shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*/
function every(collection, callback, thisArg) {
var result = true;
@@ -1679,18 +1698,40 @@
* the `callback` returns truthy for. The `callback` is bound to `thisArg` and
* invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias select
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that passed the callback check.
* @example
*
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [2, 4, 6]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.filter(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*
* // using "_.where" callback shorthand
* _.filter(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*/
function filter(collection, callback, thisArg) {
var result = [];
@@ -1717,18 +1758,25 @@
}
/**
* Examines each element in a `collection`, returning the first that the
* `callback` returns truthy for. The function returns as soon as it finds
* an acceptable element, and does not iterate over the entire `collection`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
* Examines each element in a `collection`, returning the first that the `callback`
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias detect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the element that passed the callback check,
* else `undefined`.
@@ -1744,11 +1792,11 @@
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using callback "where" shorthand
* // using "_.where" callback shorthand
* var veggie = _.find(food, { 'type': 'vegetable' });
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* var healthy = _.find(food, 'organic');
* // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
*/
@@ -1807,18 +1855,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is an
* array of elements passed to `callback` that returned the key. The `callback`
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to group by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to group by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -1829,6 +1884,7 @@
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
* // => { '4': [4.2], '6': [6.1, 6.4] }
*
* // using "_.pluck" callback shorthand
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
@@ -1880,15 +1936,24 @@
/**
* Creates an array of values by running each element in the `collection`
* through a `callback`. The `callback` is bound to `thisArg` and invoked with
* through the `callback`. The `callback` is bound to `thisArg` and invoked with
* three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias collect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of the results of each `callback` execution.
* @example
@@ -1898,6 +1963,15 @@
*
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
* // => [3, 6, 9] (order is not guaranteed)
*
* var stooges = [
* { 'name': 'moe', 'age': 40 },
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using "_.pluck" callback shorthand
* _.map(stooges, 'name');
* // => ['moe', 'larry']
*/
function map(collection, callback, thisArg) {
var index = -1,
@@ -1923,11 +1997,20 @@
* criterion by which the value is ranked. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the maximum value.
* @example
@@ -1942,6 +2025,10 @@
*
* _.max(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'larry', 'age': 50 };
*
* // using "_.pluck" callback shorthand
* _.max(stooges, 'age');
* // => { 'name': 'larry', 'age': 50 };
*/
function max(collection, callback, thisArg) {
var computed = -Infinity,
@@ -1977,11 +2064,20 @@
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the minimum value.
* @example
@@ -1996,6 +2092,10 @@
*
* _.min(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'moe', 'age': 40 };
*
* // using "_.pluck" callback shorthand
* _.min(stooges, 'age');
* // => { 'name': 'moe', 'age': 40 };
*/
function min(collection, callback, thisArg) {
var computed = Infinity,
@@ -2026,8 +2126,7 @@
}
/**
* Retrieves the value of a specified property from all elements in
* the `collection`.
* Retrieves the value of a specified property from all elements in the `collection`.
*
* @static
* @memberOf _
@@ -2135,11 +2234,20 @@
* The opposite of `_.filter`, this method returns the elements of a
* `collection` that `callback` does **not** return truthy for.
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that did **not** pass the
* callback check.
@@ -2147,6 +2255,19 @@
*
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [1, 3, 5]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.reject(food, 'organic');
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*
* // using "_.where" callback shorthand
* _.reject(food, { 'type': 'fruit' });
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*/
function reject(collection, callback, thisArg) {
callback = createCallback(callback, thisArg);
@@ -2213,12 +2334,21 @@
* does not iterate over the entire `collection`. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias any
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if any element passes the callback check,
* else `false`.
@@ -2226,6 +2356,19 @@
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.some(food, 'organic');
* // => true
*
* // using "_.where" callback shorthand
* _.some(food, { 'type': 'meat' });
* // => false
*/
function some(collection, callback, thisArg) {
var result;
@@ -2250,16 +2393,24 @@
/**
* Creates an array, stable sorted in ascending order by the results of
* running each element of `collection` through a `callback`. The `callback`
* running each element of `collection` through the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to sort by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to sort by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of sorted elements.
* @example
@@ -2270,6 +2421,7 @@
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
* // => [3, 1, 2]
*
* // using "_.pluck" callback shorthand
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
* // => ['apple', 'banana', 'strawberry']
*/
@@ -2323,6 +2475,7 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Object} properties The object of property values to filter by.
@@ -2410,13 +2563,21 @@
* the first elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias head, take
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the first element(s) of `array`.
* @example
@@ -2431,6 +2592,25 @@
* return num < 3;
* });
* // => [1, 2]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.first(food, 'organic');
* // => [{ 'name': 'banana', 'organic': true }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.first(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
*/
function first(array, callback, thisArg) {
if (array) {
@@ -2538,12 +2718,20 @@
* from the result. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -2558,6 +2746,25 @@
* return num > 1;
* });
* // => [1]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.initial(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.initial(food, { 'type': 'vegetable' });
* // => [{ 'name': 'banana', 'type': 'fruit' }]
*/
function initial(array, callback, thisArg) {
if (!array) {
@@ -2622,12 +2829,21 @@
* the last elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the last element(s) of `array`.
* @example
@@ -2642,6 +2858,25 @@
* return num > 1;
* });
* // => [2, 3]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.last(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.last(food, { 'type': 'vegetable' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
*/
function last(array, callback, thisArg) {
if (array) {
@@ -2786,13 +3021,21 @@
* truthy for are excluded from the result. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias drop, tail
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -2807,6 +3050,25 @@
* return num < 3;
* });
* // => [3]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.rest(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.rest(food, { 'type': 'fruit' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }]
*/
function rest(array, callback, thisArg) {
if (typeof callback == 'function') {
@@ -2829,16 +3091,23 @@
* should be inserted into `array` in order to maintain the sort order of the
* sorted `array`. If `callback` is passed, it will be executed for `value` and
* each element in `array` to compute their sort ranking. The `callback` is
* bound to `thisArg` and invoked with one argument; (value). The `callback`
* argument may also be the name of a property to order by.
* bound to `thisArg` and invoked with one argument; (value).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to iterate over.
* @param {Mixed} value The value to evaluate.
* @param {Function|String} [callback=identity|property] The function called
* per iteration or property name to order by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Number} Returns the index at which the value should be inserted
* into `array`.
@@ -2847,6 +3116,7 @@
* _.sortedIndex([20, 30, 50], 40);
* // => 2
*
* // using "_.pluck" callback shorthand
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
* // => 2
*
@@ -2907,13 +3177,22 @@
* element of `array` is passed through a callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias unique
* @category Arrays
* @param {Array} array The array to process.
* @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a duplicate-value-free array.
* @example
@@ -2929,6 +3208,10 @@
*
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniq(array, isSorted, callback, thisArg) {
var index = -1,

View File

@@ -8,14 +8,15 @@
}return r<e?-1:1}function i(n,t,r){function e(){var a=arguments,f=o?this:t;return u||(n=t[i]),r.length&&(a=a.length?(a=p(a),r.concat(a)):r),this instanceof e?(l.prototype=n.prototype,f=new l,l.prototype=K,a=n.apply(f,a),w(a)?a:f):n.apply(f,a)}var u=j(n),o=!r,i=t;return o&&(r=t),u||(t=n),e}function a(n,t,r){if(!n)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Dt(n);return function(t){for(var r=u.length,e=L;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)
}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function f(n){return"\\"+qt[n]}function c(n){return Mt[n]}function l(){}function p(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function s(n){return $t[n]}function v(n){return st.call(n)==jt}function h(n){var t,r=[],e=function(n,t){r.push(t)};if(n&&Tt[typeof n])for(t in e||(e=G),n)if(lt.call(n,t)&&e(n[t],t,n)===nt)break;
return r}function g(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==K&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function m(n){for(var t=-1,r=Dt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n){if(!n)return J;if(Bt(n)||A(n))return!n.length;for(var t in n)if(lt.call(n,t))return L;
return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(i=st.call(n),o=st.call(t),i!=o)return L;switch(i){case xt:case At:return+n==+t;case Et:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case St:case Nt:return n==t+""}if(o=i==wt,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=Ot)return L;var i=n.constructor,a=t.constructor;if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L
}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return lt.call(o,r)?(c++,!(f=lt.call(n,r)&&b(n[r],t,e,u))&&nt):void 0}),f&&r(n,function(n,t,r){return lt.call(r,t)?!(f=-1<--c)&&nt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Tt[typeof n]:L}function x(n){return typeof n=="number"||st.call(n)==Et}function A(n){return typeof n=="string"||st.call(n)==Nt
}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<C(n,t):e(n,function(n){return(r=n===t)&&nt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&nt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)
});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,nt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==nt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)
});return o}function q(n,t){return R(n,t+"")}function B(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function D(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)}),r}function M(n,t,r){var u;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&nt
});return!!u}function $(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,dt(mt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?pt.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?mt(0,u+r):r||0)-1;else if(r)return e=U(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;
return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:mt(0,t);return p(n,e)}function U(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function V(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>C(f,c))&&(r&&f.push(c),i.push(e))}return i}function W(n,t){return kt||vt&&2<arguments.length?vt.call.apply(vt,arguments):i(n,t,p(arguments,2))
}function G(n){return n}function H(n){F(_(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return pt.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);var Y=[],X={},Z=0,nt=X,tt=n._,rt=/&(?:amp|lt|gt|quot|#x27);/g,et=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ut=/($^)/,ot=/[&<>"']/g,it=/['\n\r\t\u2028\u2029\\]/g,at=Math.ceil,ft=Y.concat,ct=Math.floor,lt=X.hasOwnProperty,pt=Y.push,st=X.toString,vt=et.test(vt=p.bind)&&vt,ht=et.test(ht=Array.isArray)&&ht,gt=n.isFinite,yt=n.isNaN,_t=et.test(_t=Object.keys)&&_t,mt=Math.max,dt=Math.min,bt=Math.random,jt="[object Arguments]",wt="[object Array]",xt="[object Boolean]",At="[object Date]",Et="[object Number]",Ot="[object Object]",St="[object RegExp]",Nt="[object String]",X=!!n.attachEvent,X=vt&&!/\n|true/.test(vt+X),kt=vt&&!X,Ft=(Ft={0:1,length:1},Y.splice.call(Ft,0,1),Ft[0]),Rt=arguments.constructor==Object,Tt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(n==K||t==K)return n===t;if(i=st.call(n),o=st.call(t),i!=o)return L;switch(i){case xt:case At:return+n==+t;case Et:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case St:case Nt:return n==t+""}if(o=i==wt,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=Ot)return L;var i=n.constructor,a=t.constructor;
if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return lt.call(o,r)?(c++,!(f=lt.call(n,r)&&b(n[r],t,e,u))&&nt):void 0}),f&&r(n,function(n,t,r){return lt.call(r,t)?!(f=-1<--c)&&nt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Tt[typeof n]:L}function x(n){return typeof n=="number"||st.call(n)==Et
}function A(n){return typeof n=="string"||st.call(n)==Nt}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<C(n,t):e(n,function(n){return(r=n===t)&&nt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&nt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,nt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==nt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;
for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function q(n,t){return R(n,t+"")}function B(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function D(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)
}),r}function M(n,t,r){var u;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&nt});return!!u}function $(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,dt(mt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?pt.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;
if(typeof r=="number")e=(0>r?mt(0,u+r):r||0)-1;else if(r)return e=U(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:mt(0,t);return p(n,e)}function U(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function V(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];
var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>C(f,c))&&(r&&f.push(c),i.push(e))}return i}function W(n,t){return kt||vt&&2<arguments.length?vt.call.apply(vt,arguments):i(n,t,p(arguments,2))}function G(n){return n}function H(n){F(_(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return pt.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);
var Y=[],X={},Z=0,nt=X,tt=n._,rt=/&(?:amp|lt|gt|quot|#x27);/g,et=RegExp("^"+(X.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ut=/($^)/,ot=/[&<>"']/g,it=/['\n\r\t\u2028\u2029\\]/g,at=Math.ceil,ft=Y.concat,ct=Math.floor,lt=X.hasOwnProperty,pt=Y.push,st=X.toString,vt=et.test(vt=p.bind)&&vt,ht=et.test(ht=Array.isArray)&&ht,gt=n.isFinite,yt=n.isNaN,_t=et.test(_t=Object.keys)&&_t,mt=Math.max,dt=Math.min,bt=Math.random,jt="[object Arguments]",wt="[object Array]",xt="[object Boolean]",At="[object Date]",Et="[object Number]",Ot="[object Object]",St="[object RegExp]",Nt="[object String]",X=!!n.attachEvent,X=vt&&!/\n|true/.test(vt+X),kt=vt&&!X,Ft=(Ft={0:1,length:1},Y.splice.call(Ft,0,1),Ft[0]),Rt=arguments.constructor==Object,Tt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?lt.call(n,"callee"):L});var Bt=ht||function(n){return Rt&&n instanceof Array||st.call(n)==wt},Dt=_t?function(n){return w(n)?_t(n):[]}:h,Mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},$t=m(Mt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==st.call(n)}),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
}},u.bind=W,u.bindAll=function(n){for(var t=ft.apply(Y,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=W(n[u],n)}return n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},u.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",lt.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=K,r||(o=n.apply(i,u))
}var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,t),f&&(o=n.apply(i,u)),o}},u.defaults=y,u.defer=function(n){var r=p(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},u.delay=function(n,r){var e=p(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},u.difference=function(n){for(var t=-1,r=n.length,e=ft.apply(Y,arguments),u=[];++t<r;){var o=n[t];0>C(e,o,r)&&u.push(o)}return u},u.filter=N,u.flatten=z,u.forEach=F,u.functions=_,u.groupBy=function(n,t,r){var e={};

File diff suppressed because it is too large Load Diff

384
lodash.js
View File

@@ -2187,18 +2187,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is
* the number of times the key was returned by `callback`. The `callback` is
* bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to count by (e.g. 'length').
* Creates an object composed of keys returned from running each element of the
* `collection` through the given `callback`. The corresponding value of each key
* is the number of times the key was returned by the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to count by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -2228,12 +2235,21 @@
* `collection`. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias all
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if all elements pass the callback check,
* else `false`.
@@ -2247,13 +2263,13 @@
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using callback "where" shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* _.every(stooges, 'age');
* // => true
*
* // using "_.where" callback shorthand
* _.every(stooges, { 'age': 50 });
* // => false
*/
function every(collection, callback, thisArg) {
var result = true;
@@ -2281,18 +2297,40 @@
* the `callback` returns truthy for. The `callback` is bound to `thisArg` and
* invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias select
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that passed the callback check.
* @example
*
* var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [2, 4, 6]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.filter(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*
* // using "_.where" callback shorthand
* _.filter(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*/
function filter(collection, callback, thisArg) {
var result = [];
@@ -2319,18 +2357,25 @@
}
/**
* Examines each element in a `collection`, returning the first that the
* `callback` returns truthy for. The function returns as soon as it finds
* an acceptable element, and does not iterate over the entire `collection`.
* The `callback` is bound to `thisArg` and invoked with three arguments;
* (value, index|key, collection).
* Examines each element in a `collection`, returning the first that the `callback`
* returns truthy for. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias detect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the element that passed the callback check,
* else `undefined`.
@@ -2346,11 +2391,11 @@
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using callback "where" shorthand
* // using "_.where" callback shorthand
* var veggie = _.find(food, { 'type': 'vegetable' });
* // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' }
*
* // using callback "pluck" shorthand
* // using "_.pluck" callback shorthand
* var healthy = _.find(food, 'organic');
* // => { 'name': 'banana', 'organic': true, 'type': 'fruit' }
*/
@@ -2406,18 +2451,25 @@
}
/**
* Creates an object composed of keys returned from running each element of
* `collection` through a `callback`. The corresponding value of each key is an
* array of elements passed to `callback` that returned the key. The `callback`
* Creates an object composed of keys returned from running each element of the
* `collection` through the `callback`. The corresponding value of each key is
* an array of elements passed to `callback` that returned the key. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to group by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to group by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Object} Returns the composed aggregate object.
* @example
@@ -2428,6 +2480,7 @@
* _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math);
* // => { '4': [4.2], '6': [6.1, 6.4] }
*
* // using "_.pluck" callback shorthand
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
@@ -2479,15 +2532,24 @@
/**
* Creates an array of values by running each element in the `collection`
* through a `callback`. The `callback` is bound to `thisArg` and invoked with
* through the `callback`. The `callback` is bound to `thisArg` and invoked with
* three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias collect
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of the results of each `callback` execution.
* @example
@@ -2497,6 +2559,15 @@
*
* _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; });
* // => [3, 6, 9] (order is not guaranteed)
*
* var stooges = [
* { 'name': 'moe', 'age': 40 },
* { 'name': 'larry', 'age': 50 }
* ];
*
* // using "_.pluck" callback shorthand
* _.map(stooges, 'name');
* // => ['moe', 'larry']
*/
function map(collection, callback, thisArg) {
var index = -1,
@@ -2522,11 +2593,20 @@
* criterion by which the value is ranked. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the maximum value.
* @example
@@ -2541,6 +2621,10 @@
*
* _.max(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'larry', 'age': 50 };
*
* // using "_.pluck" callback shorthand
* _.max(stooges, 'age');
* // => { 'name': 'larry', 'age': 50 };
*/
function max(collection, callback, thisArg) {
var computed = -Infinity,
@@ -2578,11 +2662,20 @@
* criterion by which the value is ranked. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the minimum value.
* @example
@@ -2597,6 +2690,10 @@
*
* _.min(stooges, function(stooge) { return stooge.age; });
* // => { 'name': 'moe', 'age': 40 };
*
* // using "_.pluck" callback shorthand
* _.min(stooges, 'age');
* // => { 'name': 'moe', 'age': 40 };
*/
function min(collection, callback, thisArg) {
var computed = Infinity,
@@ -2629,8 +2726,7 @@
}
/**
* Retrieves the value of a specified property from all elements in
* the `collection`.
* Retrieves the value of a specified property from all elements in the `collection`.
*
* @static
* @memberOf _
@@ -2740,11 +2836,20 @@
* The opposite of `_.filter`, this method returns the elements of a
* `collection` that `callback` does **not** return truthy for.
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of elements that did **not** pass the
* callback check.
@@ -2752,6 +2857,19 @@
*
* var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
* // => [1, 3, 5]
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.reject(food, 'organic');
* // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }]
*
* // using "_.where" callback shorthand
* _.reject(food, { 'type': 'fruit' });
* // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }]
*/
function reject(collection, callback, thisArg) {
callback = createCallback(callback, thisArg);
@@ -2818,12 +2936,21 @@
* does not iterate over the entire `collection`. The `callback` is bound to
* `thisArg` and invoked with three arguments; (value, index|key, collection).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias any
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Boolean} Returns `true` if any element passes the callback check,
* else `false`.
@@ -2831,6 +2958,19 @@
*
* _.some([null, 0, 'yes', false], Boolean);
* // => true
*
* var food = [
* { 'name': 'apple', 'organic': false, 'type': 'fruit' },
* { 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
* ];
*
* // using "_.pluck" callback shorthand
* _.some(food, 'organic');
* // => true
*
* // using "_.where" callback shorthand
* _.some(food, { 'type': 'meat' });
* // => false
*/
function some(collection, callback, thisArg) {
var result;
@@ -2855,16 +2995,24 @@
/**
* Creates an array, stable sorted in ascending order by the results of
* running each element of `collection` through a `callback`. The `callback`
* running each element of `collection` through the `callback`. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index|key, collection).
* The `callback` argument may also be the name of a property to sort by (e.g. 'length').
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|String} callback|property The function called per iteration
* or property name to sort by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a new array of sorted elements.
* @example
@@ -2875,6 +3023,7 @@
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
* // => [3, 1, 2]
*
* // using "_.pluck" callback shorthand
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
* // => ['apple', 'banana', 'strawberry']
*/
@@ -2930,6 +3079,7 @@
*
* @static
* @memberOf _
* @type Function
* @category Collections
* @param {Array|Object|String} collection The collection to iterate over.
* @param {Object} properties The object of property values to filter by.
@@ -3014,13 +3164,21 @@
* the first elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias head, take
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the first element(s) of `array`.
* @example
@@ -3035,6 +3193,25 @@
* return num < 3;
* });
* // => [1, 2]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.first(food, 'organic');
* // => [{ 'name': 'banana', 'organic': true }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.first(food, { 'type': 'fruit' });
* // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }]
*/
function first(array, callback, thisArg) {
if (array) {
@@ -3142,12 +3319,20 @@
* from the result. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -3162,6 +3347,25 @@
* return num > 1;
* });
* // => [1]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.initial(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.initial(food, { 'type': 'vegetable' });
* // => [{ 'name': 'banana', 'type': 'fruit' }]
*/
function initial(array, callback, thisArg) {
if (!array) {
@@ -3238,12 +3442,21 @@
* the last elements the `callback` returns truthy for are returned. The `callback`
* is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n] The function called per element or
* the number of elements to return.
* @param {Function|Object|Number|String} [callback|n] The function called per
* element or the number of elements to return. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Mixed} Returns the last element(s) of `array`.
* @example
@@ -3258,6 +3471,25 @@
* return num > 1;
* });
* // => [2, 3]
*
* var food = [
* { 'name': 'beet', 'organic': false },
* { 'name': 'carrot', 'organic': true }
* ];
*
* // using "_.pluck" callback shorthand
* _.last(food, 'organic');
* // => [{ 'name': 'carrot', 'organic': true }]
*
* var food = [
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' },
* { 'name': 'carrot', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.last(food, { 'type': 'vegetable' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }]
*/
function last(array, callback, thisArg) {
if (array) {
@@ -3402,13 +3634,21 @@
* truthy for are excluded from the result. The `callback` is bound to `thisArg`
* and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias drop, tail
* @category Arrays
* @param {Array} array The array to query.
* @param {Function|Number} [callback|n=1] The function called per element or
* the number of elements to exclude.
* @param {Function|Object|Number|String} [callback|n=1] The function called per
* element or the number of elements to exclude. If a string or object is passed,
* it will be used to create a "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a slice of `array`.
* @example
@@ -3423,6 +3663,25 @@
* return num < 3;
* });
* // => [3]
*
* var food = [
* { 'name': 'banana', 'organic': true },
* { 'name': 'beet', 'organic': false },
* ];
*
* // using "_.pluck" callback shorthand
* _.rest(food, 'organic');
* // => [{ 'name': 'beet', 'organic': false }]
*
* var food = [
* { 'name': 'apple', 'type': 'fruit' },
* { 'name': 'banana', 'type': 'fruit' },
* { 'name': 'beet', 'type': 'vegetable' }
* ];
*
* // using "_.where" callback shorthand
* _.rest(food, { 'type': 'fruit' });
* // => [{ 'name': 'beet', 'type': 'vegetable' }]
*/
function rest(array, callback, thisArg) {
if (typeof callback == 'function') {
@@ -3445,16 +3704,23 @@
* should be inserted into `array` in order to maintain the sort order of the
* sorted `array`. If `callback` is passed, it will be executed for `value` and
* each element in `array` to compute their sort ranking. The `callback` is
* bound to `thisArg` and invoked with one argument; (value). The `callback`
* argument may also be the name of a property to order by.
* bound to `thisArg` and invoked with one argument; (value).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to iterate over.
* @param {Mixed} value The value to evaluate.
* @param {Function|String} [callback=identity|property] The function called
* per iteration or property name to order by.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Number} Returns the index at which the value should be inserted
* into `array`.
@@ -3463,6 +3729,7 @@
* _.sortedIndex([20, 30, 50], 40);
* // => 2
*
* // using "_.pluck" callback shorthand
* _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
* // => 2
*
@@ -3523,13 +3790,22 @@
* element of `array` is passed through a callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
*
* If a property name is passed for `callback`, the created "_.pluck" style
* callback will return the property value of the given element.
*
* If an object is passed for `callback`, the created "_.where" style callback
* will return `true` for elements that have the propeties of the given object,
* else `false`.
*
* @static
* @memberOf _
* @alias unique
* @category Arrays
* @param {Array} array The array to process.
* @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted.
* @param {Function} [callback=identity] The function called per iteration.
* @param {Function|Object|String} [callback=identity] The function called per
* iteration. If a string or object is passed, it will be used to create a
* "_.pluck" or "_.where" style callback, respectively.
* @param {Mixed} [thisArg] The `this` binding of `callback`.
* @returns {Array} Returns a duplicate-value-free array.
* @example
@@ -3545,6 +3821,10 @@
*
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2, 3]
*
* // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
* // => [{ 'x': 1 }, { 'x': 2 }]
*/
function uniq(array, isSorted, callback, thisArg) {
var index = -1,

72
lodash.min.js vendored
View File

@@ -3,39 +3,39 @@
* Lo-Dash 1.0.0-rc.3 lodash.com/license
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||ut);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(wt.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return wt.call(o,e)&&-1<C(o[e],r)}return-1<C(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=null,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,r,e){if(!n)return G;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=lr(n);return function(r){for(var e=o.length,u=!1;e--&&(u=j(r[o[e]],n[o[e]],t,t,et)););return u
}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function a(){for(var n,t={e:X,f:Y,g:Vt,i:Ht,j:Wt,k:mt,b:"k(m)",c:"",h:"",l:"",m:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b?(e+="var n=m.length;i=-1;if("+t.b+"){",t.j&&(e+="if(l(m)){m=m.split('')}"),e+="while(++i<n){"+t.h+"}}else{"):t.i&&(e+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.h+"}}else{"),t.f&&(e+="var v=typeof m=='function'&&t.call(m,'prototype');"),t.g&&t.m?(e+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];",t.f&&(e+="if(!(v&&i=='prototype')){"),e+=t.h+"",t.f&&(e+="}")):(e+="for(i in m){",(t.f||t.m)&&(e+="if(",t.f&&(e+="!(v&&i=='prototype')"),t.f&&t.m&&(e+="&&"),t.m&&(e+="h.call(m,i)"),e+="){"),e+=t.h+";",(t.f||t.m)&&(e+="}")),e+="}",t.e){e+="var f=m.constructor;";
for(var u=0;7>u;u++)e+="i='"+t.k[u]+"';if(","constructor"==t.k[u]&&(e+="!(f&&f.prototype===m)&&"),e+="h.call(m,i)){"+t.h+"}"}return(t.b||t.i)&&(e+="}"),e+=t.c+";return u",r("e,h,j,k,l,q,o,t","return function("+n+"){"+e+"}")(f,wt,h,cr,A,tr,Nt,Ot)}function c(n){return"\\"+rr[n]}function l(n){return pr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];
return u}function g(n){return sr[n]}function h(n){return At.call(n)==Dt}function y(n){var t=!1;if(!n||typeof n!="object"||h(n))return t;var r=n.constructor;return!w(r)&&(!Xt||!p(n))||r instanceof r?Z?(fr(n,function(n,r,e){return t=!wt.call(e,r),!1}),!1===t):(fr(n,function(n,r){t=r}),!1===t||wt.call(n,t)):t}function m(n){var t=[];return ar(n,function(n,r){t.push(r)}),t}function _(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=!1),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";
c||(a=n)}if(u=x(a)){var l=At.call(a);if(!Zt[l]||Xt&&p(a))return a;var s=cr(a)}if(!u||!r)return u&&!c?s?v(a):vr({},a):a;switch(u=nr[l],l){case Tt:case Bt:return c?a:new u(+a);case Mt:case Ct:return c?a:new u(a);case zt:return c?a:u(a.source,lt.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(wt.call(n,"index")&&(a.index=n.index),wt.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?$:ar)(c?a:n,function(n,u){a[u]=_(n,r,e,t,o,i)}),a}function d(n){var t=[];
return fr(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=lr(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function j(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return!1;if(l=At.call(n),u=At.call(r),l==Dt&&(l=Pt),u==Dt&&(u=Pt),l!=u)return!1;switch(l){case Tt:case Bt:return+n==+r;
case Mt:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case zt:case Ct:return n==r+""}if(u=l==It,!u){if(n.__wrapped__||r.__wrapped__)return j(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);if(l!=Pt||Xt&&(p(n)||p(r)))return!1;var l=!Jt&&h(n)?Object:n.constructor,s=!Jt&&h(r)?Object:r.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return!1}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var v=0,c=!0;if(i.push(n),a.push(r),u){if(v=r.length,c=o==et||v==n.length)for(;v--&&(c=j(n[v],r[v],e,t,o,i,a)););return c
}return fr(r,function(r,u,f){return wt.call(f,u)?(v++,c=wt.call(n,u)&&j(n[u],r,e,t,o,i,a)):void 0}),c&&o!=et&&fr(n,function(n,t,r){return wt.call(r,t)?c=-1<--v:void 0}),c}function w(n){return typeof n=="function"}function x(n){return n?tr[typeof n]:!1}function O(n){return typeof n=="number"||At.call(n)==Mt}function A(n){return typeof n=="string"||At.call(n)==Ct}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===et)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?f(i,e[--o],2):typeof(i=e[o-1])=="function"&&i);
for(;++u<o;)(cr(e[u])?$:ar)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=cr(t))||hr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?cr(f)?f:[]:hr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,et,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=lr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?Rt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):C(n,t,r)):ir(n,function(n){return++e<r?void 0:!(o=n===t)
}),o}function q(n,t,r){var e=!0;if(t=f(t,r),cr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else ir(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=f(t,r),cr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else ir(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function R(n,t,r){var e;return t=f(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function $(n,t,r){if(t&&typeof r=="undefined"&&cr(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else ir(n,t,r);
return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),cr(n))for(;++e<u;)o[e]=t(n[e],e,n);else ir(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function D(n,t,r){var e=-1/0,o=e;if(!t&&cr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),ir(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function I(n,t){return F(n,t+"")}function T(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),cr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
}else ir(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)});return r}function B(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=lr(n),o=a.length;else Wt&&A(n)&&(u=n.split(""));return t=f(t,e,4),$(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=!1,u[e]):t(r,u[e],e,f)}),r}function M(n,t,r){var e;if(t=f(t,r),cr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else ir(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function P(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;
for(t=f(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[0];return v(n,0,$t(Rt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];cr(o)?xt.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Rt(0,u+r):r||0)-1;else if(r)return e=L(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function K(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=null==t||r?1:Rt(0,t);
return v(n,e)}function L(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?f(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=wt.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>C(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function V(n,t){return Ut||St&&2<arguments.length?St.call.apply(St,arguments):i(n,t,v(arguments,2))
}function G(n){return n}function H(n){$(d(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return xt.apply(n,arguments),new r(e.apply(r,n))}})}function J(){return this.__wrapped__}var Q=typeof exports=="object"&&exports,W=typeof global=="object"&&global;W.global===W&&(n=W);var X,Y,Z,nt=[],tt={},rt=0,et=tt,ut=30,ot=n._,it=/&(?:amp|lt|gt|quot|#x27);/g,ft=/\b__p\+='';/g,at=/\b(__p\+=)''\+/g,ct=/(__e\(.*?\)|\b__t\))\+'';/g,lt=/\w*$/,pt=RegExp("^"+(tt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),st=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,vt=/<%=([\s\S]+?)%>/g,gt=/($^)/,ht=/[&<>"']/g,yt=/['\n\r\t\u2028\u2029\\]/g,mt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),_t=Math.ceil,dt=nt.concat,bt=Math.floor,jt=pt.test(jt=Object.getPrototypeOf)&&jt,wt=tt.hasOwnProperty,xt=nt.push,Ot=tt.propertyIsEnumerable,At=tt.toString,St=pt.test(St=v.bind)&&St,Et=pt.test(Et=Array.isArray)&&Et,kt=n.isFinite,qt=n.isNaN,Nt=pt.test(Nt=Object.keys)&&Nt,Rt=Math.max,$t=Math.min,Ft=Math.random,Dt="[object Arguments]",It="[object Array]",Tt="[object Boolean]",Bt="[object Date]",Mt="[object Number]",Pt="[object Object]",zt="[object RegExp]",Ct="[object String]",Kt=!!n.attachEvent,Lt=St&&!/\n|true/.test(St+Kt),Ut=St&&!Lt,Vt=Nt&&(Kt||Lt),Gt=(Gt={0:1,length:1},nt.splice.call(Gt,0,1),Gt[0]),Ht=!0;
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Ht=!r;X=!/valueOf/.test(t),Y=Ot.call(n,"prototype"),Z="x"!=t[0]})(1);var Jt=arguments.constructor==Object,Qt=!h(arguments),Wt="xx"!="x"[0]+Object("x")[0];try{var Xt=At.call(document)==Pt&&!1}catch(Yt){}var Zt={"[object Function]":!1};Zt[Dt]=Zt[It]=Zt[Tt]=Zt[Bt]=Zt[Mt]=Zt[Pt]=Zt[zt]=Zt[Ct]=!0;var nr={};nr[It]=Array,nr[Tt]=Boolean,nr[Bt]=Date,nr[Pt]=Object,nr[Mt]=Number,nr[zt]=RegExp,nr[Ct]=String;
var tr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},rr={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:vt,variable:"",imports:{_:r}};var er={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},ur={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},or={l:"if(!q[typeof m])return u;"+ur.l,b:!1},ir=a(ur);
Qt&&(h=function(n){return n?wt.call(n,"callee"):!1});var fr=a(ur,or,{m:!1}),ar=a(ur,or),cr=Et||function(n){return Jt&&n instanceof Array||At.call(n)==It},lr=Nt?function(n){return Y&&typeof n=="function"&&Ot.call(n,"prototype")?m(n):x(n)?Nt(n):[]}:m,pr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},sr=b(pr),vr=a(er),gr=a(er,{h:"if(u[i]==null)"+er.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==At.call(n)});var hr=jt?function(n){if(!n||typeof n!="object")return!1;
var t=n.valueOf,r=typeof t=="function"&&(r=jt(t))&&jt(r);return r?n==r||jt(n)==r&&!h(n):y(n)}:y;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=vr,r.at=function(n){var t=-1,r=dt.apply(nt,v(arguments,1)),e=r.length,u=Array(e);for(Wt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=V,r.bindAll=function(n){for(var t=dt.apply(nt,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=V(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))
},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",wt.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=null,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o
}},r.defaults=gr,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=dt.apply(nt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=z,r.forEach=$,r.forIn=fr,r.forOwn=ar,r.functions=d,r.groupBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",(wt.call(e,r)?e[r]:e[r]=[]).push(n)
}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=null==t||r?1:t||e;return v(n,0,$t(Rt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=wt.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>C(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=lr,r.map=F,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return wt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&cr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),ir(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=dt.apply(nt,arguments);return fr(n,function(n,r,i){(e?!t(n,r,i):0>C(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},r.pairs=function(n){for(var t=-1,r=lr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),null,et)
},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=dt.apply(nt,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),fr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=I,r.range=function(n,t,r){n=+n||0,r=+r||1,null==t&&(t=n,n=0);var e=-1;t=Rt(0,_t((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),N(n,function(n,r,e){return!t(n,r,e)})},r.rest=K,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
return $(n,function(n){var r=bt(Ft()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),$(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=null,f=a,u=n.apply(o,e)),u
}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Wt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return U(dt.apply(nt,arguments))},r.uniq=U,r.values=E,r.where=function(n,t){return N(n,t)},r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];return xt.apply(r,arguments),t.apply(this,r)
}},r.zip=function(n){for(var t=-1,r=n?D(I(arguments,"length")):0,e=Array(r);++t<r;)e[t]=I(arguments,t);return e},r.collect=F,r.drop=K,r.each=$,r.extend=vr,r.methods=d,r.select=N,r.tail=K,r.unique=U,H(r),r.clone=_,r.cloneDeep=function(n,t,r){return _(n,!0,t,r)},r.contains=k,r.escape=function(n){return null==n?"":(n+"").replace(ht,l)},r.every=q,r.find=R,r.has=function(n,t){return n?wt.call(n,t):!1},r.identity=G,r.indexOf=C,r.isArguments=h,r.isArray=cr,r.isBoolean=function(n){return!0===n||!1===n||At.call(n)==Tt
},r.isDate=function(n){return n instanceof Date||At.call(n)==Bt},r.isElement=function(n){return n?1===n.nodeType:!1},r.isEmpty=function(n){var t=!0;if(!n)return t;var r=At.call(n),e=n.length;return r==It||r==Ct||r==Dt||Qt&&h(n)||r==Pt&&typeof e=="number"&&w(n.splice)?!e:(ar(n,function(){return t=!1}),t)},r.isEqual=j,r.isFinite=function(n){return kt(n)&&!qt(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=O,r.isObject=x,r.isPlainObject=hr,r.isRegExp=function(n){return n instanceof RegExp||At.call(n)==zt
},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Rt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=ot,this},r.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+bt(Ft()*((+t||0)-n+1))},r.reduce=T,r.reduceRight=B,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:lr(n).length
},r.some=M,r.sortedIndex=L,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=gr({},u,o);var i,f=gr({},u.imports,o.imports),o=lr(f),f=E(f),a=0,l=u.interpolate||gt,p="__p+='";n.replace(RegExp((u.escape||gt).source+"|"+l.source+"|"+(l===vt?st:gt).source+"|"+(u.evaluate||gt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(yt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=!0,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ft,""):p).replace(at,"$1").replace(ct,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return null==n?"":(n+"").replace(it,g)},r.uniqueId=function(n){var t=++rt;return(null==n?"":n+"")+t},r.all=q,r.any=M,r.detect=R,r.foldl=T,r.foldr=B,r.include=k,r.inject=T,ar(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return xt.apply(t,arguments),n.apply(r,t)})}),r.first=P,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return v(n,Rt(0,u-e))}},r.take=P,r.head=P,ar(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,ir(["join","pop","shift"],function(n){var t=nt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
}}),ir(["push","reverse","sort","unshift"],function(n){var t=nt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ir(["concat","slice","splice"],function(n){var t=nt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Gt&&ir(["pop","shift","splice"],function(n){var t=nt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r
})):Q?typeof module=="object"&&module&&module.exports==Q?(module.exports=r)._=r:Q._=r:n._=r})(this);
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||ft);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(At.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return At.call(o,e)&&-1<C(o[e],r)}return-1<C(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=W,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,r,e){if(!n)return G;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=vr(n);return function(r){for(var e=o.length,u=X;e--&&(u=j(r[o[e]],n[o[e]],t,t,it)););return u
}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function a(){for(var n,t={e:nt,f:tt,g:Jt,i:Wt,j:Zt,k:bt,b:"k(m)",c:"",h:"",l:"",m:Q},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var i,m="+t.d+",u=m;if(!m)return u;"+t.l+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",t.j&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.h+"}}else{"):t.i&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.h+"}}else{"),t.f&&(r+="var v=typeof m=='function'&&t.call(m,'prototype');"),t.g&&t.m?(r+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];",t.f&&(r+="if(!(v&&i=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(i in m){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(v&&i=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="h.call(m,i)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var f=m.constructor;",e=0;7>e;e++)r+="i='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.h+"}";
return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("e,h,j,k,l,q,o,t","return function("+n+"){"+r+"}")(f,At,h,sr,A,ur,Ft,Et)}function c(n){return"\\"+or[n]}function l(n){return gr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return hr[n]}function h(n){return kt.call(n)==Bt}function y(n){var t=X;if(!n||typeof n!="object"||h(n))return t;
var r=n.constructor;return!w(r)&&(!nr||!p(n))||r instanceof r?rt?(lr(n,function(n,r,e){return t=!At.call(e,r),X}),t===X):(lr(n,function(n,r){t=r}),t===X||At.call(n,t)):t}function m(n){var t=[];return pr(n,function(n,r){t.push(r)}),t}function _(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=X),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";c||(a=n)}if(u=x(a)){var l=kt.call(a);if(!rr[l]||nr&&p(a))return a;var s=sr(a)}if(!u||!r)return u&&!c?s?v(a):yr({},a):a;
switch(u=er[l],l){case Pt:case zt:return c?a:new u(+a);case Ct:case Ut:return c?a:new u(a);case Lt:return c?a:u(a.source,vt.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(At.call(n,"index")&&(a.index=n.index),At.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?$:pr)(c?a:n,function(n,u){a[u]=_(n,r,e,t,o,i)}),a}function d(n){var t=[];return lr(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=vr(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function j(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return X;if(n==W||r==W)return n===r;if(l=kt.call(n),u=kt.call(r),l==Bt&&(l=Kt),u==Bt&&(u=Kt),l!=u)return X;switch(l){case Pt:case zt:return+n==+r;case Ct:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Lt:case Ut:return n==r+""}if(u=l==Mt,!u){if(n.__wrapped__||r.__wrapped__)return j(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);
if(l!=Kt||nr&&(p(n)||p(r)))return X;var l=!Xt&&h(n)?Object:n.constructor,s=!Xt&&h(r)?Object:r.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return X}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var v=0,c=Q;if(i.push(n),a.push(r),u){if(v=r.length,c=o==it||v==n.length)for(;v--&&(c=j(n[v],r[v],e,t,o,i,a)););return c}return lr(r,function(r,u,f){return At.call(f,u)?(v++,c=At.call(n,u)&&j(n[u],r,e,t,o,i,a)):void 0}),c&&o!=it&&lr(n,function(n,t,r){return At.call(r,t)?c=-1<--v:void 0
}),c}function w(n){return typeof n=="function"}function x(n){return n?ur[typeof n]:X}function O(n){return typeof n=="number"||kt.call(n)==Ct}function A(n){return typeof n=="string"||kt.call(n)==Ut}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===it)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,i=typeof(i=e[o-2])=="function"?f(i,e[--o],2):typeof(i=e[o-1])=="function"&&i);for(;++u<o;)(sr(e[u])?$:pr)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=sr(t))||_r(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];
break}e||(f=u?sr(f)?f:[]:_r(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,it,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=X;return r=(0>r?Dt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):C(n,t,r)):cr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function q(n,t,r){var e=Q;
if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else cr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else cr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function R(n,t,r){var e;return t=f(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,X):void 0}),e}function $(n,t,r){if(t&&typeof r=="undefined"&&sr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==X;);}else cr(n,t,r);
return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),sr(n))for(;++e<u;)o[e]=t(n[e],e,n);else cr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function D(n,t,r){var e=-1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function I(n,t){return F(n,t+"")}function T(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),sr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)
}else cr(n,function(n,e,o){r=u?(u=X,n):t(r,n,e,o)});return r}function B(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=vr(n),o=a.length;else Zt&&A(n)&&(u=n.split(""));return t=f(t,e,4),$(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=X,u[e]):t(r,u[e],e,f)}),r}function M(n,t,r){var e;if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else cr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function P(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=-1;
for(t=f(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[0];return v(n,0,It(Dt(0,e),u))}}function z(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];sr(o)?St.apply(u,t?o:z(o)):u.push(o)}return u}function C(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Dt(0,u+r):r||0)-1;else if(r)return e=L(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function K(n,t,r){if(typeof t=="function"){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==W||r?1:Dt(0,t);
return v(n,e)}function L(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?f(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=X);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=At.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>C(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function V(n,t){return Ht||qt&&2<arguments.length?qt.call.apply(qt,arguments):i(n,t,v(arguments,2))
}function G(n){return n}function H(n){$(d(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),new r(e.apply(r,n))}})}function J(){return this.__wrapped__}var Q=!0,W=null,X=!1,Y=typeof exports=="object"&&exports,Z=typeof global=="object"&&global;Z.global===Z&&(n=Z);var nt,tt,rt,et=[],ut={},ot=0,it=ut,ft=30,at=n._,ct=/&(?:amp|lt|gt|quot|#x27);/g,lt=/\b__p\+='';/g,pt=/\b(__p\+=)''\+/g,st=/(__e\(.*?\)|\b__t\))\+'';/g,vt=/\w*$/,gt=RegExp("^"+(ut.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ht=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,yt=/<%=([\s\S]+?)%>/g,mt=/($^)/,_t=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),jt=Math.ceil,wt=et.concat,xt=Math.floor,Ot=gt.test(Ot=Object.getPrototypeOf)&&Ot,At=ut.hasOwnProperty,St=et.push,Et=ut.propertyIsEnumerable,kt=ut.toString,qt=gt.test(qt=v.bind)&&qt,Nt=gt.test(Nt=Array.isArray)&&Nt,Rt=n.isFinite,$t=n.isNaN,Ft=gt.test(Ft=Object.keys)&&Ft,Dt=Math.max,It=Math.min,Tt=Math.random,Bt="[object Arguments]",Mt="[object Array]",Pt="[object Boolean]",zt="[object Date]",Ct="[object Number]",Kt="[object Object]",Lt="[object RegExp]",Ut="[object String]",Vt=!!n.attachEvent,Gt=qt&&!/\n|true/.test(qt+Vt),Ht=qt&&!Gt,Jt=Ft&&(Vt||Gt),Qt=(Qt={0:1,length:1},et.splice.call(Qt,0,1),Qt[0]),Wt=Q;
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Wt=!r;nt=!/valueOf/.test(t),tt=Et.call(n,"prototype"),rt="x"!=t[0]})(1);var Xt=arguments.constructor==Object,Yt=!h(arguments),Zt="xx"!="x"[0]+Object("x")[0];try{var nr=kt.call(document)==Kt&&!({toString:0}+"")}catch(tr){}var rr={"[object Function]":X};rr[Bt]=rr[Mt]=rr[Pt]=rr[zt]=rr[Ct]=rr[Kt]=rr[Lt]=rr[Ut]=Q;var er={};er[Mt]=Array,er[Pt]=Boolean,er[zt]=Date,er[Kt]=Object,er[Ct]=Number,er[Lt]=RegExp,er[Ut]=String;
var ur={"boolean":X,"function":Q,object:Q,number:X,string:X,undefined:X},or={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yt,variable:"",imports:{_:r}};var ir={a:"p,w,g",l:"var a=0,b=typeof g=='number'?2:arguments.length;while(++a<b){m=arguments[a];if(m&&q[typeof m]){",h:"u[i]=m[i]",c:"}}"},fr={a:"d,c,x",l:"c=c&&typeof x=='undefined'?c:e(c,x)",b:"typeof n=='number'",h:"if(c(m[i],i,d)===false)return u"},ar={l:"if(!q[typeof m])return u;"+fr.l,b:X},cr=a(fr);
Yt&&(h=function(n){return n?At.call(n,"callee"):X});var lr=a(fr,ar,{m:X}),pr=a(fr,ar),sr=Nt||function(n){return Xt&&n instanceof Array||kt.call(n)==Mt},vr=Ft?function(n){return tt&&typeof n=="function"&&Et.call(n,"prototype")?m(n):x(n)?Ft(n):[]}:m,gr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},hr=b(gr),yr=a(ir),mr=a(ir,{h:"if(u[i]==null)"+ir.h});w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==kt.call(n)});var _r=Ot?function(n){if(!n||typeof n!="object")return X;
var t=n.valueOf,r=typeof t=="function"&&(r=Ot(t))&&Ot(r);return r?n==r||Ot(n)==r&&!h(n):y(n)}:y,dr=N;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=yr,r.at=function(n){var t=-1,r=wt.apply(et,v(arguments,1)),e=r.length,u=Array(e);for(Zt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=V,r.bindAll=function(n){for(var t=wt.apply(et,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=V(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))
},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",At.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=W,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o
}},r.defaults=mr,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=wt.apply(et,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=z,r.forEach=$,r.forIn=lr,r.forOwn=pr,r.functions=d,r.groupBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",(At.call(e,r)?e[r]:e[r]=[]).push(n)
}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==W||r?1:t||e;return v(n,0,It(Dt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=At.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>C(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=vr,r.map=F,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return At.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=wt.apply(et,arguments);return lr(n,function(n,r,i){(e?!t(n,r,i):0>C(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=W,r)}},r.pairs=function(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),W,it)
},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=wt.apply(et,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),lr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=I,r.range=function(n,t,r){n=+n||0,r=+r||1,t==W&&(t=n,n=0);var e=-1;t=Dt(0,jt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),N(n,function(n,r,e){return!t(n,r,e)})},r.rest=K,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);
return $(n,function(n){var r=xt(Tt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),$(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=W,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=W,f=a,u=n.apply(o,e)),u
}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Zt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return U(wt.apply(et,arguments))},r.uniq=U,r.values=E,r.where=dr,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?D(I(arguments,"length")):0,e=Array(r);++t<r;)e[t]=I(arguments,t);
return e},r.collect=F,r.drop=K,r.each=$,r.extend=yr,r.methods=d,r.select=N,r.tail=K,r.unique=U,H(r),r.clone=_,r.cloneDeep=function(n,t,r){return _(n,Q,t,r)},r.contains=k,r.escape=function(n){return n==W?"":(n+"").replace(_t,l)},r.every=q,r.find=R,r.has=function(n,t){return n?At.call(n,t):X},r.identity=G,r.indexOf=C,r.isArguments=h,r.isArray=sr,r.isBoolean=function(n){return n===Q||n===X||kt.call(n)==Pt},r.isDate=function(n){return n instanceof Date||kt.call(n)==zt},r.isElement=function(n){return n?1===n.nodeType:X
},r.isEmpty=function(n){var t=Q;if(!n)return t;var r=kt.call(n),e=n.length;return r==Mt||r==Ut||r==Bt||Yt&&h(n)||r==Kt&&typeof e=="number"&&w(n.splice)?!e:(pr(n,function(){return t=X}),t)},r.isEqual=j,r.isFinite=function(n){return Rt(n)&&!$t(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===W},r.isNumber=O,r.isObject=x,r.isPlainObject=_r,r.isRegExp=function(n){return n instanceof RegExp||kt.call(n)==Lt},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"
},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Dt(0,e+r):It(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=at,this},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+xt(Tt()*((+t||0)-n+1))},r.reduce=T,r.reduceRight=B,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:vr(n).length},r.some=M,r.sortedIndex=L,r.template=function(n,e,u){var o=r.templateSettings;
n||(n=""),u=mr({},u,o);var i,f=mr({},u.imports,o.imports),o=vr(f),f=E(f),a=0,l=u.interpolate||mt,p="__p+='";n.replace(RegExp((u.escape||mt).source+"|"+l.source+"|"+(l===yt?ht:mt).source+"|"+(u.evaluate||mt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=Q,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(lt,""):p).replace(pt,"$1").replace(st,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==W?"":(n+"").replace(ct,g)},r.uniqueId=function(n){var t=++ot;return(n==W?"":n+"")+t},r.all=q,r.any=M,r.detect=R,r.foldl=T,r.foldr=B,r.include=k,r.inject=T,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),n.apply(r,t)})}),r.first=P,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[u-1];return v(n,Dt(0,u-e))}},r.take=P,r.head=P,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,cr(["join","pop","shift"],function(n){var t=et[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
}}),cr(["push","reverse","sort","unshift"],function(n){var t=et[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),cr(["concat","slice","splice"],function(n){var t=et[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Qt&&cr(["pop","shift","splice"],function(n){var t=et[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r
})):Y?typeof module=="object"&&module&&module.exports==Y?(module.exports=r)._=r:Y._=r:n._=r})(this);