From 5a47eb85594666f310c3ce36f8060f0fb48a1171 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 12 Apr 2014 01:03:27 -0700 Subject: [PATCH] Rebuild dist. --- dist/lodash.compat.js | 232 ++++++++++++++++++++------------- dist/lodash.compat.min.js | 128 +++++++++---------- dist/lodash.js | 233 ++++++++++++++++++++++------------ dist/lodash.min.js | 118 ++++++++--------- dist/lodash.underscore.js | 161 +++++++++++++++-------- dist/lodash.underscore.min.js | 70 +++++----- 6 files changed, 561 insertions(+), 381 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 5c7b8130a..c86a15196 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -464,6 +464,16 @@ return typeof value.toString != 'function' && typeof (value + '') == 'string'; } + /** + * Used by `_.partition` to create partitioned arrays. + * + * @private + * @returns {Array} Returns the new array. + */ + function partitionInitializer() { + return [[], []]; + } + /** * A fallback implementation of `String#trim` to remove leading and trailing * whitespace or specified characters from `string`. @@ -1042,6 +1052,66 @@ /*--------------------------------------------------------------------------*/ + /** + * A specialized version of `_.forEach` for arrays without support for + * callback shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, callback) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (callback(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * callback shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, callback) { + var length = array ? array.length : 0; + while (length--) { + if (callback(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.map` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, callback) { + var index = -1, + length = array ? array.length >>> 0 : 0, + result = Array(length); + + while (++index < length) { + result[index] = callback(array[index], index, array); + } + return result; + } + /** * The base implementation of `_.bind` that creates the bound function and * sets its metadata. @@ -1980,22 +2050,22 @@ } /** - * Creates a function that aggregates a collection, creating an object or - * array composed from the results of running each element in the collection + * Creates a function that aggregates a collection, creating an accumulator + * object composed from the results of running each element in the collection * through a callback. The given setter function sets the keys and values of - * the composed object or array. + * the accumulator object. If `initializer` is provided will be used to + * initialize the accumulator object. * * @private - * @param {Function} setter The setter function. - * @param {boolean} [retArray=false] A flag to indicate that the aggregator - * function should return an array. + * @param {Function} setter The function to set keys and values of the accumulator object. + * @param {Function} [initializer] The function to initialize the accumulator object. * @returns {Function} Returns the new aggregator function. */ - function createAggregator(setter, retArray) { + function createAggregator(setter, initializer) { return function(collection, callback, thisArg) { - var result = retArray ? [[], []] : {}; - + var result = initializer ? initializer() : {}; callback = lodash.createCallback(callback, thisArg, 3); + if (isArray(collection)) { var index = -1, length = collection.length; @@ -2867,6 +2937,8 @@ * Removes all provided values from `array` using strict equality for * comparisons, i.e. `===`. * + * Note: Unlike `_.without`, this method mutates `array`. + * * @static * @memberOf _ * @category Arrays @@ -2900,7 +2972,7 @@ } /** - * Removes all elements from an array that the predicate returns truthy for + * Removes all elements from `array` that the predicate returns truthy for * and returns an array of removed elements. The predicate is bound to `thisArg` * and invoked with three arguments; (value, index, array). * @@ -2911,6 +2983,8 @@ * will return `true` for elements that have the properties of the given object, * else `false`. * + * Note: Unlike `_.filter`, this method mutates `array`. + * * @static * @memberOf _ * @category Arrays @@ -3542,7 +3616,7 @@ * * @name valueOf * @memberOf _ - * @alias value, toJSON + * @alias toJSON, value * @category Chaining * @returns {*} Returns the wrapped value. * @example @@ -3626,31 +3700,34 @@ */ function contains(collection, target, fromIndex) { var length = collection ? collection.length : 0; - fromIndex = (typeof fromIndex == 'number' && fromIndex) || 0; - - if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - if (typeof collection == 'string' || !isArray(collection) && isString(collection)) { - if (fromIndex >= length) { - return false; - } - return nativeContains - ? nativeContains.call(collection, target, fromIndex) - : collection.indexOf(target, fromIndex) > -1; - } - var indexOf = getIndexOf(); - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - return indexOf(collection, target, fromIndex) > -1; + if (!(typeof length == 'number' && length > -1 && length <= maxSafeInteger)) { + var props = keys(collection); + length = props.length; } - var index = -1, - result = false; - - baseEach(collection, function(value) { - if (++index >= fromIndex) { - return !(result = value === target); + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); + } else { + fromIndex = 0; + } + if (props) { + while (fromIndex < length) { + var value = collection[props[fromIndex++]]; + if (value === target) { + return true; + } } - }); - - return result; + return false; + } + if (typeof collection == 'string' || !isArray(collection) && isString(collection)) { + if (fromIndex >= length) { + return false; + } + return nativeContains + ? nativeContains.call(collection, target, fromIndex) + : collection.indexOf(target, fromIndex) > -1; + } + var indexOf = getIndexOf(); + return indexOf(collection, target, fromIndex) > -1; } /** @@ -3734,8 +3811,8 @@ */ function every(collection, predicate, thisArg) { var result = true; - predicate = lodash.createCallback(predicate, thisArg, 3); + if (isArray(collection)) { var index = -1, length = collection.length; @@ -3795,8 +3872,8 @@ */ function filter(collection, predicate, thisArg) { var result = []; - predicate = lodash.createCallback(predicate, thisArg, 3); + if (isArray(collection)) { var index = -1, length = collection.length; @@ -3921,19 +3998,9 @@ * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { - if (callback && typeof thisArg == 'undefined' && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (callback(collection[index], index, collection) === false) { - break; - } - } - } else { - baseEach(collection, baseCreateCallback(callback, thisArg, 3)); - } - return collection; + return (callback && typeof thisArg == 'undefined' && isArray(collection)) + ? arrayEach(collection, callback) + : baseEach(collection, baseCreateCallback(callback, thisArg, 3)); } /** @@ -3954,17 +4021,9 @@ * // => logs each number from right to left and returns '3,2,1' */ function forEachRight(collection, callback, thisArg) { - if (callback && typeof thisArg == 'undefined' && isArray(collection)) { - var length = collection.length; - while (length--) { - if (callback(collection[length], length, collection) === false) { - break; - } - } - } else { - baseEachRight(collection, baseCreateCallback(callback, thisArg, 3)); - } - return collection; + return (callback && typeof thisArg == 'undefined' && isArray(collection)) + ? arrayEachRight(collection, callback) + : baseEachRight(collection, baseCreateCallback(callback, thisArg, 3)); } /** @@ -4129,20 +4188,17 @@ * // => ['barney', 'fred'] */ function map(collection, callback, thisArg) { - var index = -1, - length = collection && collection.length, - result = Array(length < 0 ? 0 : length >>> 0); - callback = lodash.createCallback(callback, thisArg, 3); + if (isArray(collection)) { - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - baseEach(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); + return arrayMap(collection, callback, thisArg); } + var index = -1, + result = []; + + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); return result; } @@ -4342,7 +4398,7 @@ */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); - }, true); + }, partitionInitializer); /** * Retrieves the value of a specified property from all elements in the collection. @@ -4398,8 +4454,8 @@ */ function reduce(collection, callback, accumulator, thisArg) { var noaccum = arguments.length < 3; - callback = lodash.createCallback(callback, thisArg, 4); + if (isArray(collection)) { var index = -1, length = collection.length; @@ -4441,8 +4497,8 @@ */ function reduceRight(collection, callback, accumulator, thisArg) { var noaccum = arguments.length < 3; - callback = lodash.createCallback(callback, thisArg, 4); + baseEachRight(collection, function(value, index, collection) { accumulator = noaccum ? (noaccum = false, value) @@ -4552,7 +4608,6 @@ result[index] = result[rand]; result[rand] = value; }); - return result; } @@ -4627,8 +4682,8 @@ */ function some(collection, predicate, thisArg) { var result; - predicate = lodash.createCallback(predicate, thisArg, 3); + if (isArray(collection)) { var index = -1, length = collection.length; @@ -6176,6 +6231,11 @@ * by the method instead. The callback is bound to `thisArg` and invoked * with two arguments; (value, other). * + * Note: This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. A callback may be used to extend support for + * comparing other values. + * * @static * @memberOf _ * @category Objects @@ -6627,8 +6687,8 @@ */ function mapValues(object, callback, thisArg) { var result = {}; - callback = lodash.createCallback(callback, thisArg, 3); + baseForOwn(object, function(value, key, object) { result[key] = callback(value, key, object); }); @@ -6764,7 +6824,7 @@ * @memberOf _ * @category Objects * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. + * @returns {Array} Returns the new array of key-value pairs. * @example * * _.pairs({ 'barney': 36, 'fred': 40 }); @@ -7749,17 +7809,16 @@ * // => { 'name': 'barney', 'age': 36 } */ function matches(source) { - source || (source = {}); var props = keys(source), propsLength = props.length, key = props[0], - value = source[key]; + value = propsLength && source[key]; // fast path the common case of providing an object with a single // property containing a primitive value if (propsLength == 1 && value === value && !isObject(value)) { return function(object) { - if (!hasOwnProperty.call(object, key)) { + if (!(object && hasOwnProperty.call(object, key))) { return false; } // treat `-0` vs. `+0` as not equal @@ -7768,9 +7827,11 @@ }; } return function(object) { - var length = propsLength, - result = true; - + var length = propsLength; + if (length && !object) { + return false; + } + var result = true; while (length--) { var key = props[length]; if (!(result = hasOwnProperty.call(object, key) && @@ -8149,10 +8210,11 @@ */ function times(n, callback, thisArg) { n = n < 0 ? 0 : n >>> 0; + callback = baseCreateCallback(callback, thisArg, 1); + var index = -1, result = Array(n); - callback = baseCreateCallback(callback, thisArg, 1); while (++index < n) { result[index] = callback(index); } diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 948da1119..70011762c 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -3,67 +3,67 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE * Build: `lodash -o ./dist/lodash.compat.js` */ -;(function(){function n(n,t){return typeof n=="undefined"?t:n}function t(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(nr||13r||8202e||13e||8202i(t,l)&&f.push(l);return f}function gt(n,t){var e=-1,r=n,u=n?n.length:0;if(typeof u=="number"&&-1a(s,g)&&((u||f)&&s.push(g),c.push(p))}return c}function At(n,t){for(var e=-1,r=t(n),u=r.length,o=Re(u);++ei?0:i)}function zt(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?yr(u+r,0):r||0;else if(r)return r=Zt(n,t),u&&n[r]===t?r:-1;return e(n,t,r)}function Dt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0;for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else i=null==t||e?1:t;return i=r-(i||0),Ut(n,0,0>i?0:i)}function Bt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0;for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else if(i=t,null==i||e)return n?n[r-1]:w; -return i=r-(i||0),Ut(n,0>i?0:i)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=-1,u=n?n.length:0,i=0;for(t=o.createCallback(t,e,3);++rt?0:t;return Ut(n,i)}function Ut(n,t,e){var r=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=yr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=yr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=Re(u);++r>>1,e(n[r])e?0:e);++te?yr(r+e,0):e,-1u?0:u>>>0);if(t=o.createCallback(t,e,3),Lr(n))for(;++ri&&(i=l)}else t=null==t&&be(n)?u:o.createCallback(t,e,3),gt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,i=n)});return i}function re(n,t,e,r){var u=3>arguments.length;if(t=o.createCallback(t,r,4),Lr(n)){var i=-1,a=n.length; -for(u&&a&&(e=n[++i]);++iarguments.length;return t=o.createCallback(t,r,4),ht(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function oe(n){var t=-1,e=n&&n.length,r=Re(0>e?0:e>>>0);return gt(n,function(n){var e=Ot(0,++t);r[t]=r[e],r[e]=n}),r}function ie(n,t,e){var r;if(t=o.createCallback(t,e,3),Lr(n)){e=-1;for(var u=n.length;++earguments.length)return Nt(n,x,null,t);if(n)var e=n[S]?n[S][2]:n.length,r=Ut(arguments,2),e=e-r.length;return Nt(n,x|O,e,t,r)}function le(n,t,e){var r,u,o,i,a,l,f,c=0,s=false,p=true;if(!ve(n))throw new Be;if(t=0>t?0:t,true===e)var g=true,p=false;else ye(e)&&(g=e.leading,s="maxWait"in e&&yr(t,+e.maxWait||0),p="trailing"in e?e.trailing:p);var h=function(){var e=t-(Ur()-i);0>=e||e>t?(u&&He(u),e=f,u=l=f=w,e&&(c=Ur(),o=n.apply(a,r),l||u||(r=a=null))):l=ir(h,e)},v=function(){l&&He(l),u=l=f=w,(p||s!==t)&&(c=Ur(),o=n.apply(a,r),l||u||(r=a=null)) -};return function(){if(r=arguments,i=Ur(),a=this,f=p&&(l||!g),false===s)var e=g&&!l;else{u||g||(c=i);var y=s-(i-c),m=0>=y||y>s;m?(u&&(u=He(u)),c=i,o=n.apply(a,r)):u||(u=ir(v,y))}return m&&l?l=He(l):l||t===s||(l=ir(h,t)),e&&(m=true,o=n.apply(a,r)),!m||l||u||(r=a=null),o}}function fe(n){if(!ve(n))throw new Be;return function(){return!n.apply(this,arguments)}}function ce(n,t,e){var r=arguments;if(!n||2>r.length)return n;var u=0,o=r.length,i=typeof e;if("number"!=i&&"string"!=i||!r[3]||r[3][e]!==t||(o=2),3arguments.length)return t;var e=Ut(arguments);return e.push(n),ce.apply(null,e)}function pe(n){var t=[];return wt(n,function(n,e){ve(n)&&t.push(e)}),t.sort()}function ge(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Xe.call(n)==Q||false}function he(n){return n&&typeof n=="object"&&1===n.nodeType&&(Or.nodeClass?-1>>0,r=-1,u=e-1,o=Re(e),i=0t||null==n||!gr(t))return e;n=De(n);do t%2&&(e+=n),t=Qe(t/2),n+=n;while(t);return e}function ke(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||Z(n,t,e):"object"!=r?Ie(n):Ee(n)}function Oe(n){return n}function Ee(n){n||(n={});var t=Fr(n),e=t.length,r=t[0],u=n[r];return 1!=e||u!==u||ye(u)?function(r){for(var u=e,o=true;u--&&(o=t[u],o=er.call(r,o)&&jt(r[o],n[o],null,true)););return o -}:function(n){return er.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Ae(n,t,e){var r=true,u=t&&pe(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=o,u=pe(t)),false===e?r=false:ye(e)&&"chain"in e&&(r=e.chain),e=-1;for(var i=ve(n),a=u?u.length:0;++e--n?t.apply(this,arguments):void 0}},o.assign=ce,o.at=function(n,t){var e=arguments,r=-1,u=yt(e,true,false,1),o=u.length,i=typeof t; -for("number"!=i&&"string"!=i||!e[2]||e[2][t]!==n||(o=1),Or.unindexedChars&&be(n)&&(n=n.split("")),e=Re(o);++rarguments.length?Nt(t,x|C,null,n):Nt(t,x|C|O,null,n,Ut(arguments,2))},o.chain=function(n){return new i(n,true)},o.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(p?r(p,l):i(s,l))){for(t=u;--t;){var g=o[t]; -if(0>(g?r(g,l):i(n[t],l)))continue n}p&&p.push(l),s.push(l)}return s},o.invert=function(n,t){for(var e=-1,r=Fr(n),u=r.length,o={};++eo?0:o>>>0);return gt(n,function(n){var o=u?t:null!=n&&n[t];i[++r]=o?o.apply(n,e):w}),i},o.keys=Fr,o.keysIn=_e,o.map=te,o.mapValues=function(n,t,e){var r={};return t=o.createCallback(t,e,3),xt(n,function(n,e,u){r[e]=t(n,e,u) -}),r},o.matches=Ee,o.max=ee,o.memoize=function(n,t){if(!ve(n))throw new Be;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return er.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},o.merge=function(n,t,e){if(!n)return n;var r=arguments,u=r.length,o=typeof e;if("number"!=o&&"string"!=o||!r[3]||r[3][e]!==t||(u=2),3u?0:u>>>0);for(i||(t=o.createCallback(t,e,3)),gt(n,function(n,e,u){if(i)for(e=t.length,u=Re(e);e--;)u[e]=n[t[e]]; -else u=t(n,e,u);f[++r]={a:u,b:r,c:n}}),u=f.length,f.sort(i?l:a);u--;)f[u]=f[u].c;return f},o.tap=function(n,t,e){return t.call(e,n),n},o.throttle=function(n,t,e){var r=true,u=true;if(!ve(n))throw new Be;return false===e?r=false:ye(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),ct.leading=r,ct.maxWait=+t,ct.trailing=u,le(n,t,ct)},o.times=function(n,t,e){n=0>n?0:n>>>0;var r=-1,u=Re(n);for(t=Z(t,e,1);++re?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},o.escape=function(n){return null==n?"":De(n).replace(F,s)},o.escapeRegExp=Ce,o.every=Yt,o.find=Ht,o.findIndex=$t,o.findKey=function(n,t,e){return t=o.createCallback(t,e,3),vt(n,t,xt,true)},o.findLast=function(n,t,e){return t=o.createCallback(t,e,3),vt(n,t,ht) -},o.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=o.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},o.findLastKey=function(n,t,e){return t=o.createCallback(t,e,3),vt(n,t,Ct,true)},o.has=function(n,t){return n?er.call(n,t):false},o.identity=Oe,o.indexOf=zt,o.isArguments=ge,o.isArray=Lr,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Xe.call(n)==tt||false},o.isDate=function(n){return n&&typeof n=="object"&&Xe.call(n)==et||false},o.isElement=he,o.isEmpty=function(n){var t=true; -if(!n)return t;var e=Xe.call(n),r=n.length;return-1e?yr(r+e,0):mr(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},o.mixin=Ae,o.noConflict=function(){return t._=Ve,this},o.noop=Se,o.now=Ur,o.pad=function(n,t,e){n=null==n?"":De(n),t=+t;var r=n.length;return re?0:+e||0,n.length),n.lastIndexOf(t,e)==e},o.template=function(n,t,e){var r=o.templateSettings;e=se({},e,r),n=De(null==n?"":n);var u,i,a=se({},e.imports,r.imports),r=Fr(a),a=xe(a),l=0,f=e.interpolate||K,c="__p+='",f=ze((e.escape||K).source+"|"+f.source+"|"+(f===z?D:K).source+"|"+(e.evaluate||K).source+"|$","g"); -n.replace(f,function(t,e,r,o,a,f){return r||(r=o),c+=n.slice(l,f).replace(J,p),e&&(u=true,c+="'+__e("+e+")+'"),a&&(i=true,c+="';"+a+";\n__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),l=f+t.length,t}),c+="';",(e=e.variable)||(c="with(obj){"+c+"}"),c=(i?c.replace(N,""):c).replace(T,"$1").replace(L,"$1;"),c="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var s=We(r,"return "+c).apply(w,a) -}catch(g){throw g.source=c,g}return t?s(t):(s.source=c,s)},o.trim=Dr,o.trimLeft=Br,o.trimRight=qr,o.truncate=function(n,t){var e=30,r="...";if(t&&ye(t))var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e,r="omission"in t?De(t.omission):r;else null!=t&&(e=+t||0);if(n=null==n?"":De(n),e>=n.length)return n;var o=e-r.length;if(1>o)return r;if(e=n.slice(0,o),null==u)return e+r;if(de(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=ze(u.source,(B.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(l);)a=i.index; -e=e.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=e.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(W,b))},o.uniqueId=function(n){var t=++I;return De(null==n?"":n)+t},o.all=Yt,o.any=ie,o.detect=Ht,o.findWhere=Ht,o.foldl=re,o.foldr=ue,o.include=Xt,o.inject=re,Ae(function(){var n={};return xt(o,function(t,e){o.prototype[e]||(n[e]=t)}),n}(),false),o.first=Pt,o.last=Bt,o.sample=function(n,t,e){return n&&typeof n.length!="number"?n=xe(n):Or.unindexedChars&&be(n)&&(n=n.split("")),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n) -},o.take=Pt,o.takeRight=Bt,o.takeRightWhile=Bt,o.takeWhile=Pt,o.head=Pt,xt(o,function(n,t){var e="sample"!==t;o.prototype[t]||(o.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new i(o,u):o})}),o.VERSION=A,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Jt,o.prototype.toString=function(){return De(this.__wrapped__)},o.prototype.value=Jt,o.prototype.valueOf=Jt,gt(["join","pop","shift"],function(n){var t=qe[n]; -o.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new i(e,n):e}}),gt(["push","reverse","sort","unshift"],function(n){var t=qe[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),gt(["concat","splice"],function(n){var t=qe[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Or.spliceObjects||gt(["pop","shift","splice"],function(n){var t=qe[n],e="splice"==n;o.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments); -return 0===r.length&&delete r[0],n||e?new i(u,n):u}}),o}var w,x=1,C=2,j=4,k=8,O=16,E=32,A="2.4.1",S="__lodash@"+A+"__",I=0,R=/^[A-Z]+$/,N=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,L=/(__e\(.*?\)|\b__t\))\+'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,$=/<%-([\s\S]+?)%>/g,P=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,D=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,q=/^\s*function[ \n\r\t]+\w/,U=/^0[xX]/,Z=/[\xC0-\xFF]/g,K=/($^)/,M=/[.*+?^${}()|[\]\\]/g,V=/\bthis\b/,J=/['\n\r\u2028\u2029\\]/g,X=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,Y=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",G="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),H="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Q="[object Arguments]",nt="[object Array]",tt="[object Boolean]",et="[object Date]",rt="[object Error]",ut="[object Function]",ot="[object Number]",it="[object Object]",at="[object RegExp]",lt="[object String]",ft={}; -ft[ut]=false,ft[Q]=ft[nt]=ft[tt]=ft[et]=ft[ot]=ft[it]=ft[at]=ft[lt]=true;var ct={leading:false,maxWait:0,trailing:false},st={configurable:false,enumerable:false,value:null,writable:false},pt={"&":"&","<":"<",">":">",'"':""","'":"'"},gt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ht={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},vt={"function":true,object:true},yt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},mt=vt[typeof window]&&window||this,dt=vt[typeof exports]&&exports&&!exports.nodeType&&exports,vt=vt[typeof module]&&module&&!module.nodeType&&module,bt=dt&&vt&&typeof global=="object"&&global; -!bt||bt.global!==bt&&bt.window!==bt&&bt.self!==bt||(mt=bt);var bt=vt&&vt.exports===dt&&dt,_t=_();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(mt._=_t, define(function(){return _t})):dt&&vt?bt?(vt.exports=_t)._=_t:dt._=_t:mt._=_t}).call(this); \ No newline at end of file +;(function(){function n(n,t){return typeof n=="undefined"?t:n}function t(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202>>0:0,u=Tr(e);++ri(t,l)&&f.push(l);return f}function vt(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number"&&-1a(s,g)&&((u||f)&&s.push(g),c.push(p))}return c}function It(n,t){for(var r=-1,e=t(n),u=e.length,o=Tr(u);++ri?0:i)}function Bt(n,t,e){var u=n?n.length:0;if(typeof e=="number")e=0>e?de(u+e,0):e||0;else if(e)return e=Mt(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function qt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,i=0;for(t=o.createCallback(t,r,3);u--&&t(n[u],u,n);)i++}else i=null==t||r?1:t;return i=e-(i||0),Kt(n,0,0>i?0:i)}function Ut(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,i=0;for(t=o.createCallback(t,r,3);u--&&t(n[u],u,n);)i++}else if(i=t,null==i||r)return n?n[e-1]:x; +return i=e-(i||0),Kt(n,0>i?0:i)}function Zt(n,t,r){if(typeof t!="number"&&null!=t){var e=-1,u=n?n.length:0,i=0;for(t=o.createCallback(t,r,3);++et?0:t;return Kt(n,i)}function Kt(n,t,r){var e=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=de(u+t,0):t>u&&(t=u),r=typeof r=="undefined"?u:+r||0,0>r?r=de(u+r,0):r>u&&(r=u),u=t>r?0:r-t,r=Tr(u);++e>>1,r(n[e])r?0:r);++t=e||e>Yr)var u=Pe(n),e=u.length;if(r=typeof r=="number"?0>r?de(e+r,0):r||0:0,u){for(;ri&&(i=l)}else t=null==t&&wr(n)?u:o.createCallback(t,r,3),vt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,i=n)});return i}function or(n,t,r,e){var u=3>arguments.length;if(t=o.createCallback(t,e,4),Fe(n)){var i=-1,a=n.length;for(u&&a&&(r=n[++i]);++iarguments.length;return t=o.createCallback(t,e,4),yt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function ar(n){var t=-1,r=n&&n.length,e=Tr(0>r?0:r>>>0);return vt(n,function(n){var r=At(0,++t);e[t]=e[r],e[r]=n}),e}function lr(n,t,r){var e;if(t=o.createCallback(t,r,3),Fe(n)){r=-1;for(var u=n.length;++rarguments.length)return Lt(n,C,null,t);if(n)var r=n[I]?n[I][2]:n.length,e=Kt(arguments,2),r=r-e.length; +return Lt(n,C|E,r,t,e)}function cr(n,t,r){var e,u,o,i,a,l,f,c=0,s=false,p=true;if(!mr(n))throw new Ur;if(t=0>t?0:t,true===r)var g=true,p=false;else dr(r)&&(g=r.leading,s="maxWait"in r&&de(t,+r.maxWait||0),p="trailing"in r?r.trailing:p);var h=function(){var r=t-(Ke()-i);0>=r||r>t?(u&&ne(u),r=f,u=l=f=x,r&&(c=Ke(),o=n.apply(a,e),l||u||(e=a=null))):l=le(h,r)},v=function(){l&&ne(l),u=l=f=x,(p||s!==t)&&(c=Ke(),o=n.apply(a,e),l||u||(e=a=null))};return function(){if(e=arguments,i=Ke(),a=this,f=p&&(l||!g),false===s)var r=g&&!l; +else{u||g||(c=i);var y=s-(i-c),m=0>=y||y>s;m?(u&&(u=ne(u)),c=i,o=n.apply(a,e)):u||(u=le(v,y))}return m&&l?l=ne(l):l||t===s||(l=le(h,t)),r&&(m=true,o=n.apply(a,e)),!m||l||u||(e=a=null),o}}function sr(n){if(!mr(n))throw new Ur;return function(){return!n.apply(this,arguments)}}function pr(n,t,r){var e=arguments;if(!n||2>e.length)return n;var u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3arguments.length)return t;var r=Kt(arguments);return r.push(n),pr.apply(null,r)}function hr(n){var t=[];return Ct(n,function(n,r){mr(n)&&t.push(r)}),t.sort()}function vr(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Gr.call(n)==nt||false}function yr(n){return n&&typeof n=="object"&&1===n.nodeType&&(Ae.nodeClass?-1>>0,e=-1,u=r-1,o=Tr(r),i=0t||null==n||!ve(t))return r;n=qr(n);do t%2&&(r+=n),t=te(t/2),n+=n;while(t);return r}function Er(n,t,r){var e=typeof n;return"function"==e||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||Y(n,t,r):"object"!=e?Nr(n):Sr(n)}function Ar(n){return n}function Sr(n){var t=Pe(n),r=t.length,e=t[0],u=r&&n[e];return 1!=r||u!==u||dr(u)?function(e){var u=r;if(u&&!e)return false; +for(var o=true;u--&&(o=t[u],o=ue.call(e,o)&&Ot(e[o],n[o],null,true)););return o}:function(n){return n&&ue.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function Ir(n,t,r){var e=true,u=t&&hr(t);t&&(r||u.length)||(null==r&&(r=t),t=n,n=o,u=hr(t)),false===r?e=false:dr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var i=mr(n),a=u?u.length:0;++r--n?t.apply(this,arguments):void 0}},o.assign=pr,o.at=function(n,t){var r=arguments,e=-1,u=bt(r,true,false,1),o=u.length,i=typeof t; +for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),Ae.unindexedChars&&wr(n)&&(n=n.split("")),r=Tr(o);++earguments.length?Lt(t,C|j,null,n):Lt(t,C|j|E,null,n,Kt(arguments,2))},o.chain=function(n){return new i(n,true)},o.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t(p?e(p,l):i(s,l))){for(t=u;--t;){var g=o[t]; +if(0>(g?e(g,l):i(n[t],l)))continue n}p&&p.push(l),s.push(l)}return s},o.invert=function(n,t){for(var r=-1,e=Pe(n),u=e.length,o={};++ro?0:o>>>0);return vt(n,function(n){var o=u?t:null!=n&&n[t];i[++e]=o?o.apply(n,r):x}),i},o.keys=Pe,o.keysIn=xr,o.map=er,o.mapValues=function(n,t,r){var e={};return t=o.createCallback(t,r,3),jt(n,function(n,r,u){e[r]=t(n,r,u) +}),e},o.matches=Sr,o.max=ur,o.memoize=function(n,t){if(!mr(n))throw new Ur;var r=function(){var e=r.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return ue.call(e,u)?e[u]:e[u]=n.apply(this,arguments)};return r.cache={},r},o.merge=function(n,t,r){if(!n)return n;var e=arguments,u=e.length,o=typeof r;if("number"!=o&&"string"!=o||!e[3]||e[3][r]!==t||(u=2),3u?0:u>>>0);for(i||(t=o.createCallback(t,r,3)),vt(n,function(n,r,u){if(i)for(r=t.length,u=Tr(r);r--;)u[r]=n[t[r]]; +else u=t(n,r,u);f[++e]={a:u,b:e,c:n}}),u=f.length,f.sort(i?l:a);u--;)f[u]=f[u].c;return f},o.tap=function(n,t,r){return t.call(r,n),n},o.throttle=function(n,t,r){var e=true,u=true;if(!mr(n))throw new Ur;return false===r?e=false:dr(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),st.leading=e,st.maxWait=+t,st.trailing=u,cr(n,t,st)},o.times=function(n,t,r){n=0>n?0:n>>>0,t=Y(t,r,1),r=-1;for(var e=Tr(n);++rr?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},o.escape=function(n){return null==n?"":qr(n).replace($,s)},o.escapeRegExp=kr,o.every=Ht,o.find=nr,o.findIndex=zt,o.findKey=function(n,t,r){return t=o.createCallback(t,r,3),mt(n,t,jt,true)},o.findLast=function(n,t,r){return t=o.createCallback(t,r,3),mt(n,t,yt) +},o.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=o.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},o.findLastKey=function(n,t,r){return t=o.createCallback(t,r,3),mt(n,t,kt,true)},o.has=function(n,t){return n?ue.call(n,t):false},o.identity=Ar,o.indexOf=Bt,o.isArguments=vr,o.isArray=Fe,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Gr.call(n)==rt||false},o.isDate=function(n){return n&&typeof n=="object"&&Gr.call(n)==et||false},o.isElement=yr,o.isEmpty=function(n){var t=true; +if(!n)return t;var r=Gr.call(n),e=n.length;return-1r?de(e+r,0):be(r||0,e-1))+1);e--;)if(n[e]===t)return e;return-1},o.mixin=Ir,o.noConflict=function(){return t._=Xr,this},o.noop=Rr,o.now=Ke,o.pad=function(n,t,r){n=null==n?"":qr(n),t=+t;var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r},o.template=function(n,t,r){var e=o.templateSettings;r=gr({},r,e),n=qr(null==n?"":n);var u,i,a=gr({},r.imports,e.imports),e=Pe(a),a=jr(a),l=0,f=r.interpolate||M,c="__p+='",f=Br((r.escape||M).source+"|"+f.source+"|"+(f===D?B:M).source+"|"+(r.evaluate||M).source+"|$","g"); +n.replace(f,function(t,r,e,o,a,f){return e||(e=o),c+=n.slice(l,f).replace(X,p),r&&(u=true,c+="'+__e("+r+")+'"),a&&(i=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),l=f+t.length,t}),c+="';",(r=r.variable)||(c="with(obj){"+c+"}"),c=(i?c.replace(T,""):c).replace(L,"$1").replace(W,"$1;"),c="function("+(r||"obj")+"){"+(r?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var s=$r(e,"return "+c).apply(x,a) +}catch(g){throw g.source=c,g}return t?s(t):(s.source=c,s)},o.trim=qe,o.trimLeft=Ue,o.trimRight=Ze,o.truncate=function(n,t){var r=30,e="...";if(t&&dr(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?qr(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":qr(n),r>=n.length)return n;var o=r-e.length;if(1>o)return e;if(r=n.slice(0,o),null==u)return r+e;if(_r(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=Br(u.source,(q.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(l);)a=i.index; +r=r.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(F,_))},o.uniqueId=function(n){var t=++R;return qr(null==n?"":n)+t},o.all=Ht,o.any=lr,o.detect=nr,o.findWhere=nr,o.foldl=or,o.foldr=ir,o.include=Gt,o.inject=or,Ir(function(){var n={};return jt(o,function(t,r){o.prototype[r]||(n[r]=t)}),n}(),false),o.first=Dt,o.last=Ut,o.sample=function(n,t,r){return n&&typeof n.length!="number"?n=jr(n):Ae.unindexedChars&&wr(n)&&(n=n.split("")),null==t||r?(t=n?n.length:0,0t?0:+t||0,n.length),n) +},o.take=Dt,o.takeRight=Ut,o.takeRightWhile=Ut,o.takeWhile=Dt,o.head=Dt,jt(o,function(n,t){var r="sample"!==t;o.prototype[t]||(o.prototype[t]=function(t,e){var u=this.__chain__,o=n(this.__wrapped__,t,e);return u||null!=t&&(!e||r&&typeof t=="function")?new i(o,u):o})}),o.VERSION=S,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Yt,o.prototype.toString=function(){return qr(this.__wrapped__)},o.prototype.value=Yt,o.prototype.valueOf=Yt,vt(["join","pop","shift"],function(n){var t=Zr[n]; +o.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new i(r,n):r}}),vt(["push","reverse","sort","unshift"],function(n){var t=Zr[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),vt(["concat","splice"],function(n){var t=Zr[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Ae.spliceObjects||vt(["pop","shift","splice"],function(n){var t=Zr[n],r="splice"==n;o.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments); +return 0===e.length&&delete e[0],n||r?new i(u,n):u}}),o}var x,C=1,j=2,k=4,O=8,E=16,A=32,S="2.4.1",I="__lodash@"+S+"__",R=0,N=/^[A-Z]+$/,T=/\b__p\+='';/g,L=/\b(__p\+=)''\+/g,W=/(__e\(.*?\)|\b__t\))\+'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,P=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,B=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,q=/\w*$/,U=/^\s*function[ \n\r\t]+\w/,Z=/^0[xX]/,K=/[\xC0-\xFF]/g,M=/($^)/,V=/[.*+?^${}()|[\]\\]/g,J=/\bthis\b/,X=/['\n\r\u2028\u2029\\]/g,Y=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,G=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",H="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Q="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),nt="[object Arguments]",tt="[object Array]",rt="[object Boolean]",et="[object Date]",ut="[object Error]",ot="[object Function]",it="[object Number]",at="[object Object]",lt="[object RegExp]",ft="[object String]",ct={}; +ct[ot]=false,ct[nt]=ct[tt]=ct[rt]=ct[et]=ct[it]=ct[at]=ct[lt]=ct[ft]=true;var st={leading:false,maxWait:0,trailing:false},pt={configurable:false,enumerable:false,value:null,writable:false},gt={"&":"&","<":"<",">":">",'"':""","'":"'"},ht={"&":"&","<":"<",">":">",""":'"',"'":"'"},vt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},yt={"function":true,object:true},mt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=yt[typeof window]&&window||this,bt=yt[typeof exports]&&exports&&!exports.nodeType&&exports,yt=yt[typeof module]&&module&&!module.nodeType&&module,_t=bt&&yt&&typeof global=="object"&&global; +!_t||_t.global!==_t&&_t.window!==_t&&_t.self!==_t||(dt=_t);var _t=yt&&yt.exports===bt&&bt,wt=w();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(dt._=wt, define(function(){return wt})):bt&&yt?_t?(yt.exports=wt)._=wt:bt._=wt:dt._=wt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index bb99cf939..8f7410aff 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -444,6 +444,16 @@ return '\\' + stringEscapes[chr]; } + /** + * Used by `_.partition` to create partitioned arrays. + * + * @private + * @returns {Array} Returns the new array. + */ + function partitionInitializer() { + return [[], []]; + } + /** * A fallback implementation of `String#trim` to remove leading and trailing * whitespace or specified characters from `string`. @@ -883,6 +893,66 @@ /*--------------------------------------------------------------------------*/ + /** + * A specialized version of `_.forEach` for arrays without support for + * callback shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, callback) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (callback(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * callback shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, callback) { + var length = array ? array.length : 0; + while (length--) { + if (callback(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.map` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, callback) { + var index = -1, + length = array ? array.length >>> 0 : 0, + result = Array(length); + + while (++index < length) { + result[index] = callback(array[index], index, array); + } + return result; + } + /** * The base implementation of `_.bind` that creates the bound function and * sets its metadata. @@ -1811,20 +1881,20 @@ } /** - * Creates a function that aggregates a collection, creating an object or - * array composed from the results of running each element in the collection + * Creates a function that aggregates a collection, creating an accumulator + * object composed from the results of running each element in the collection * through a callback. The given setter function sets the keys and values of - * the composed object or array. + * the accumulator object. If `initializer` is provided will be used to + * initialize the accumulator object. * * @private - * @param {Function} setter The setter function. - * @param {boolean} [retArray=false] A flag to indicate that the aggregator - * function should return an array. + * @param {Function} setter The function to set keys and values of the accumulator object. + * @param {Function} [initializer] The function to initialize the accumulator object. * @returns {Function} Returns the new aggregator function. */ - function createAggregator(setter, retArray) { + function createAggregator(setter, initializer) { return function(collection, callback, thisArg) { - var result = retArray ? [[], []] : {}; + var result = initializer ? initializer() : {}; callback = lodash.createCallback(callback, thisArg, 3); var index = -1, @@ -2685,6 +2755,8 @@ * Removes all provided values from `array` using strict equality for * comparisons, i.e. `===`. * + * Note: Unlike `_.without`, this method mutates `array`. + * * @static * @memberOf _ * @category Arrays @@ -2718,7 +2790,7 @@ } /** - * Removes all elements from an array that the predicate returns truthy for + * Removes all elements from `array` that the predicate returns truthy for * and returns an array of removed elements. The predicate is bound to `thisArg` * and invoked with three arguments; (value, index, array). * @@ -2729,6 +2801,8 @@ * will return `true` for elements that have the properties of the given object, * else `false`. * + * Note: Unlike `_.filter`, this method mutates `array`. + * * @static * @memberOf _ * @category Arrays @@ -3360,7 +3434,7 @@ * * @name valueOf * @memberOf _ - * @alias value, toJSON + * @alias toJSON, value * @category Chaining * @returns {*} Returns the wrapped value. * @example @@ -3441,31 +3515,34 @@ */ function contains(collection, target, fromIndex) { var length = collection ? collection.length : 0; - fromIndex = (typeof fromIndex == 'number' && fromIndex) || 0; - - if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - if (typeof collection == 'string' || !isArray(collection) && isString(collection)) { - if (fromIndex >= length) { - return false; - } - return nativeContains - ? nativeContains.call(collection, target, fromIndex) - : collection.indexOf(target, fromIndex) > -1; - } - var indexOf = getIndexOf(); - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - return indexOf(collection, target, fromIndex) > -1; + if (!(typeof length == 'number' && length > -1 && length <= maxSafeInteger)) { + var props = keys(collection); + length = props.length; } - var index = -1, - result = false; - - baseEach(collection, function(value) { - if (++index >= fromIndex) { - return !(result = value === target); + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); + } else { + fromIndex = 0; + } + if (props) { + while (fromIndex < length) { + var value = collection[props[fromIndex++]]; + if (value === target) { + return true; + } } - }); - - return result; + return false; + } + if (typeof collection == 'string' || !isArray(collection) && isString(collection)) { + if (fromIndex >= length) { + return false; + } + return nativeContains + ? nativeContains.call(collection, target, fromIndex) + : collection.indexOf(target, fromIndex) > -1; + } + var indexOf = getIndexOf(); + return indexOf(collection, target, fromIndex) > -1; } /** @@ -3549,8 +3626,8 @@ */ function every(collection, predicate, thisArg) { var result = true; - predicate = lodash.createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -3610,8 +3687,8 @@ */ function filter(collection, predicate, thisArg) { var result = []; - predicate = lodash.createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -3738,20 +3815,12 @@ * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0; - + var length = collection ? collection.length : 0; callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); - if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - while (++index < length) { - if (callback(collection[index], index, collection) === false) { - break; - } - } - } else { - baseEach(collection, callback); - } - return collection; + + return (typeof length == 'number' && length > -1 && length <= maxSafeInteger) + ? arrayEach(collection, callback) + : baseEach(collection, callback); } /** @@ -3773,18 +3842,11 @@ */ function forEachRight(collection, callback, thisArg) { var length = collection ? collection.length : 0; - callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); - if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - while (length--) { - if (callback(collection[length], length, collection) === false) { - break; - } - } - } else { - baseEachRight(collection, callback); - } - return collection; + + return (typeof length == 'number' && length > -1 && length <= maxSafeInteger) + ? arrayEachRight(collection, callback) + : baseEachRight(collection, callback); } /** @@ -3949,21 +4011,18 @@ * // => ['barney', 'fred'] */ function map(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0; - + var length = collection ? collection.length : 0; callback = lodash.createCallback(callback, thisArg, 3); + if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - var result = Array(length); - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - result = []; - baseEach(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); + return arrayMap(collection, callback); } + var index = -1, + result = []; + + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); return result; } @@ -4163,7 +4222,7 @@ */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); - }, true); + }, partitionInitializer); /** * Retrieves the value of a specified property from all elements in the collection. @@ -4262,8 +4321,8 @@ */ function reduceRight(collection, callback, accumulator, thisArg) { var noaccum = arguments.length < 3; - callback = lodash.createCallback(callback, thisArg, 4); + baseEachRight(collection, function(value, index, collection) { accumulator = noaccum ? (noaccum = false, value) @@ -4371,7 +4430,6 @@ result[index] = result[rand]; result[rand] = value; }); - return result; } @@ -4446,8 +4504,8 @@ */ function some(collection, predicate, thisArg) { var result; - predicate = lodash.createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -5985,6 +6043,11 @@ * by the method instead. The callback is bound to `thisArg` and invoked * with two arguments; (value, other). * + * Note: This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. A callback may be used to extend support for + * comparing other values. + * * @static * @memberOf _ * @category Objects @@ -6403,8 +6466,8 @@ */ function mapValues(object, callback, thisArg) { var result = {}; - callback = lodash.createCallback(callback, thisArg, 3); + baseForOwn(object, function(value, key, object) { result[key] = callback(value, key, object); }); @@ -6540,7 +6603,7 @@ * @memberOf _ * @category Objects * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. + * @returns {Array} Returns the new array of key-value pairs. * @example * * _.pairs({ 'barney': 36, 'fred': 40 }); @@ -7525,17 +7588,16 @@ * // => { 'name': 'barney', 'age': 36 } */ function matches(source) { - source || (source = {}); var props = keys(source), propsLength = props.length, key = props[0], - value = source[key]; + value = propsLength && source[key]; // fast path the common case of providing an object with a single // property containing a primitive value if (propsLength == 1 && value === value && !isObject(value)) { return function(object) { - if (!hasOwnProperty.call(object, key)) { + if (!(object && hasOwnProperty.call(object, key))) { return false; } // treat `-0` vs. `+0` as not equal @@ -7544,9 +7606,11 @@ }; } return function(object) { - var length = propsLength, - result = true; - + var length = propsLength; + if (length && !object) { + return false; + } + var result = true; while (length--) { var key = props[length]; if (!(result = hasOwnProperty.call(object, key) && @@ -7925,10 +7989,11 @@ */ function times(n, callback, thisArg) { n = n < 0 ? 0 : n >>> 0; + callback = baseCreateCallback(callback, thisArg, 1); + var index = -1, result = Array(n); - callback = baseCreateCallback(callback, thisArg, 1); while (++index < n) { result[index] = callback(index); } diff --git a/dist/lodash.min.js b/dist/lodash.min.js index b5867d7e3..fe8699189 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,62 +4,62 @@ * Build: `lodash modern -o ./dist/lodash.js` */ ;(function(){function n(n,t){return typeof n=="undefined"?t:n}function t(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(nr||13r||8202e||13e||8202i(t,l)&&f.push(l);return f}function ct(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number"&&-1a(p,h)&&((u||f)&&p.push(h),c.push(s))}return c}function Ct(n,t){for(var e=-1,r=t(n),u=r.length,o=Ee(u);++ei?0:i)}function $t(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?pr(u+r,0):r||0;else if(r)return r=qt(n,t),u&&n[r]===t?r:-1;return e(n,t,r)}function Lt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0;for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else i=null==t||e?1:t;return i=r-(i||0),Bt(n,0,0>i?0:i)}function zt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0; -for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else if(i=t,null==i||e)return n?n[r-1]:_;return i=r-(i||0),Bt(n,0>i?0:i)}function Dt(n,t,e){if(typeof t!="number"&&null!=t){var r=-1,u=n?n.length:0,i=0;for(t=o.createCallback(t,e,3);++rt?0:t;return Bt(n,i)}function Bt(n,t,e){var r=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=pr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=pr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=Ee(u);++r>>1,e(n[r])e?0:e);++te?pr(r+e,0):e,-1i&&(i=l)}else t=null==t&&ye(n)?u:o.createCallback(t,e,3),ct(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,i=n)});return i}function ne(n,t,e,r){var u=3>arguments.length;t=o.createCallback(t,r,4);var i=-1,a=n?n.length:0;if(typeof a=="number"&&-1arguments.length; -return t=o.createCallback(t,r,4),pt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function ee(n){var t=-1,e=n&&n.length,r=Ee(0>e?0:e>>>0);return ct(n,function(n){var e=kt(0,++t);r[t]=r[e],r[e]=n}),r}function re(n,t,e){var r;t=o.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length)return It(n,w,null,t);if(n)var e=n[E]?n[E][2]:n.length,r=Bt(arguments,2),e=e-r.length; -return It(n,w|C,e,t,r)}function oe(n,t,e){var r,u,o,i,a,l,f,c=0,p=false,s=true;if(!se(n))throw new Le;if(t=0>t?0:t,true===e)var h=true,s=false;else he(e)&&(h=e.leading,p="maxWait"in e&&pr(t,+e.maxWait||0),s="trailing"in e?e.trailing:s);var g=function(){var e=t-(Lr()-i);0>=e||e>t?(u&&Ve(u),e=f,u=l=f=_,e&&(c=Lr(),o=n.apply(a,r),l||u||(r=a=null))):l=tr(g,e)},v=function(){l&&Ve(l),u=l=f=_,(s||p!==t)&&(c=Lr(),o=n.apply(a,r),l||u||(r=a=null))};return function(){if(r=arguments,i=Lr(),a=this,f=s&&(l||!h),false===p)var e=h&&!l; -else{u||h||(c=i);var y=p-(i-c),m=0>=y||y>p;m?(u&&(u=Ve(u)),c=i,o=n.apply(a,r)):u||(u=tr(v,y))}return m&&l?l=Ve(l):l||t===p||(l=tr(g,t)),e&&(m=true,o=n.apply(a,r)),!m||l||u||(r=a=null),o}}function ie(n){if(!se(n))throw new Le;return function(){return!n.apply(this,arguments)}}function ae(n,t,e){var r=arguments;if(!n||2>r.length)return n;var u=0,o=r.length,i=typeof e;if("number"!=i&&"string"!=i||!r[3]||r[3][e]!==t||(o=2),3arguments.length)return t;var e=Bt(arguments);return e.push(n),ae.apply(null,e)}function fe(n){var t=[];return dt(n,function(n,e){se(n)&&t.push(e)}),t.sort()}function ce(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Pe.call(n)==G||false}function pe(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=-1,u=e-1,o=Ee(e),i=0t||null==n||!lr(t))return e;n=$e(n);do t%2&&(e+=n),t=Je(t/2),n+=n;while(t);return e}function xe(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||Z(n,t,e):"object"!=r?Ae(n):je(n) -}function ke(n){return n}function je(n){n||(n={});var t=Rr(n),e=t.length,r=t[0],u=n[r];return 1!=e||u!==u||he(u)?function(r){for(var u=e,o=true;u--&&(o=t[u],o=Ge.call(r,o)&&wt(r[o],n[o],null,true)););return o}:function(n){return Ge.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Ce(n,t,e){var r=true,u=t&&fe(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=o,u=fe(t)),false===e?r=false:he(e)&&"chain"in e&&(r=e.chain),e=-1;for(var i=se(n),a=u?u.length:0;++e--n?t.apply(this,arguments):void 0}},o.assign=ae,o.at=function(n,t){var e=arguments,r=-1,u=ht(e,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!e[2]||e[2][t]!==n||(o=1),e=Ee(o);++rarguments.length?It(t,w|x,null,n):It(t,w|x|C,null,n,Bt(arguments,2))},o.chain=function(n){return new i(n,true)},o.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(s?r(s,l):i(p,l))){for(t=u;--t;){var h=o[t];if(0>(h?r(h,l):i(n[t],l)))continue n}s&&s.push(l),p.push(l)}return p},o.invert=function(n,t){for(var e=-1,r=Rr(n),u=r.length,o={};++eo?0:o>>>0); -return ct(n,function(n){var o=u?t:null!=n&&n[t];i[++r]=o?o.apply(n,e):_}),i},o.keys=Rr,o.keysIn=me,o.map=Ht,o.mapValues=function(n,t,e){var r={};return t=o.createCallback(t,e,3),bt(n,function(n,e,u){r[e]=t(n,e,u)}),r},o.matches=je,o.max=Qt,o.memoize=function(n,t){if(!se(n))throw new Le;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return Ge.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},o.merge=function(n,t,e){if(!n)return n;var r=arguments,u=r.length,o=typeof e; -if("number"!=o&&"string"!=o||!r[3]||r[3][e]!==t||(u=2),3u?0:u>>>0);for(i||(t=o.createCallback(t,e,3)),ct(n,function(n,e,u){if(i)for(e=t.length,u=Ee(e);e--;)u[e]=n[t[e]];else u=t(n,e,u);f[++r]={a:u,b:r,c:n}}),u=f.length,f.sort(i?l:a);u--;)f[u]=f[u].c;return f},o.tap=function(n,t,e){return t.call(e,n),n},o.throttle=function(n,t,e){var r=true,u=true;if(!se(n))throw new Le; -return false===e?r=false:he(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),at.leading=r,at.maxWait=+t,at.trailing=u,oe(n,t,at)},o.times=function(n,t,e){n=0>n?0:n>>>0;var r=-1,u=Ee(n);for(t=Z(t,e,1);++re?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},o.escape=function(n){return null==n?"":$e(n).replace(F,p)},o.escapeRegExp=_e,o.every=Vt,o.find=Xt,o.findIndex=Wt,o.findKey=function(n,t,e){return t=o.createCallback(t,e,3),st(n,t,bt,true) -},o.findLast=function(n,t,e){return t=o.createCallback(t,e,3),st(n,t,pt)},o.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=o.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},o.findLastKey=function(n,t,e){return t=o.createCallback(t,e,3),st(n,t,_t,true)},o.has=function(n,t){return n?Ge.call(n,t):false},o.identity=ke,o.indexOf=$t,o.isArguments=ce,o.isArray=Er,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Pe.call(n)==Q||false},o.isDate=function(n){return n&&typeof n=="object"&&Pe.call(n)==nt||false -},o.isElement=pe,o.isEmpty=function(n){var t=true;if(!n)return t;var e=Pe.call(n),r=n.length;return-1e?pr(r+e,0):sr(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},o.mixin=Ce,o.noConflict=function(){return t._=Ue,this},o.noop=Oe,o.now=Lr,o.pad=function(n,t,e){n=null==n?"":$e(n),t=+t;var r=n.length;return re?0:+e||0,n.length),n.lastIndexOf(t,e)==e},o.template=function(n,t,e){var r=o.templateSettings;e=le({},e,r),n=$e(null==n?"":n);var u,i,a=le({},e.imports,r.imports),r=Rr(a),a=be(a),l=0,f=e.interpolate||P,c="__p+='",f=Fe((e.escape||P).source+"|"+f.source+"|"+(f===z?D:P).source+"|"+(e.evaluate||P).source+"|$","g"); -n.replace(f,function(t,e,r,o,a,f){return r||(r=o),c+=n.slice(l,f).replace(V,s),e&&(u=true,c+="'+__e("+e+")+'"),a&&(i=true,c+="';"+a+";\n__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),l=f+t.length,t}),c+="';",(e=e.variable)||(c="with(obj){"+c+"}"),c=(i?c.replace(N,""):c).replace(S,"$1").replace(T,"$1;"),c="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=Ne(r,"return "+c).apply(_,a) -}catch(h){throw h.source=c,h}return t?p(t):(p.source=c,p)},o.trim=Wr,o.trimLeft=Fr,o.trimRight=$r,o.truncate=function(n,t){var e=30,r="...";if(t&&he(t))var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e,r="omission"in t?$e(t.omission):r;else null!=t&&(e=+t||0);if(n=null==n?"":$e(n),e>=n.length)return n;var o=e-r.length;if(1>o)return r;if(e=n.slice(0,o),null==u)return e+r;if(ve(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=Fe(u.source,(B.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(l);)a=i.index; -e=e.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=e.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(W,d))},o.uniqueId=function(n){var t=++I;return $e(null==n?"":n)+t},o.all=Vt,o.any=re,o.detect=Xt,o.findWhere=Xt,o.foldl=ne,o.foldr=te,o.include=Mt,o.inject=ne,Ce(function(){var n={};return bt(o,function(t,e){o.prototype[e]||(n[e]=t)}),n}(),false),o.first=Ft,o.last=zt,o.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=be(n)),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n) -},o.take=Ft,o.takeRight=zt,o.takeRightWhile=zt,o.takeWhile=Ft,o.head=Ft,bt(o,function(n,t){var e="sample"!==t;o.prototype[t]||(o.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new i(o,u):o})}),o.VERSION=A,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Kt,o.prototype.toString=function(){return $e(this.__wrapped__)},o.prototype.value=Kt,o.prototype.valueOf=Kt,ct(["join","pop","shift"],function(n){var t=ze[n]; -o.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new i(e,n):e}}),ct(["push","reverse","sort","unshift"],function(n){var t=ze[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ct(["concat","splice"],function(n){var t=ze[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),o}var _,w=1,x=2,k=4,j=8,C=16,O=32,A="2.4.1",E="__lodash@"+A+"__",I=0,R=/^[A-Z]+$/,N=/\b__p\+='';/g,S=/\b(__p\+=)''\+/g,T=/(__e\(.*?\)|\b__t\))\+'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,$=/<%-([\s\S]+?)%>/g,L=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,D=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,B=/\w*$/,q=/^\s*function[ \n\r\t]+\w/,U=/^0[xX]/,Z=/[\xC0-\xFF]/g,P=/($^)/,K=/[.*+?^${}()|[\]\\]/g,M=/\bthis\b/,V=/['\n\r\u2028\u2029\\]/g,J=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,X=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",Y="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),G="[object Arguments]",H="[object Array]",Q="[object Boolean]",nt="[object Date]",tt="[object Function]",et="[object Number]",rt="[object Object]",ut="[object RegExp]",ot="[object String]",it={}; -it[tt]=false,it[G]=it[H]=it[Q]=it[nt]=it[et]=it[rt]=it[ut]=it[ot]=true;var at={leading:false,maxWait:0,trailing:false},lt={configurable:false,enumerable:false,value:null,writable:false},ft={"&":"&","<":"<",">":">",'"':""","'":"'"},ct={"&":"&","<":"<",">":">",""":'"',"'":"'"},pt={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},st={"function":true,object:true},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gt=st[typeof window]&&window||this,vt=st[typeof exports]&&exports&&!exports.nodeType&&exports,st=st[typeof module]&&module&&!module.nodeType&&module,yt=vt&&st&&typeof global=="object"&&global; -!yt||yt.global!==yt&&yt.window!==yt&&yt.self!==yt||(gt=yt);var yt=st&&st.exports===vt&&vt,mt=b();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(gt._=mt, define(function(){return mt})):vt&&st?yt?(st.exports=mt)._=mt:vt._=mt:gt._=mt}).call(this); \ No newline at end of file +}function l(n,e){for(var r=-1,u=n.a,o=e.a,i=u.length;++rr||13r||8202e||13e||8202>>0:0,u=Re(r);++ei(t,l)&&f.push(l);return f}function st(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number"&&-1a(p,h)&&((u||f)&&p.push(h),c.push(s))}return c}function At(n,t){for(var e=-1,r=t(n),u=r.length,o=Re(u);++ei?0:i)}function zt(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?hr(u+r,0):r||0;else if(r)return r=Zt(n,t),u&&n[r]===t?r:-1;return e(n,t,r) +}function Dt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0;for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else i=null==t||e?1:t;return i=r-(i||0),Ut(n,0,0>i?0:i)}function Bt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,i=0;for(t=o.createCallback(t,e,3);u--&&t(n[u],u,n);)i++}else if(i=t,null==i||e)return n?n[r-1]:w;return i=r-(i||0),Ut(n,0>i?0:i)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=-1,u=n?n.length:0,i=0;for(t=o.createCallback(t,e,3);++rt?0:t;return Ut(n,i)}function Ut(n,t,e){var r=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=hr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=hr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=Re(u);++r>>1,e(n[r])e?0:e);++t=r||r>Ke)var u=Sr(n),r=u.length;if(e=typeof e=="number"?0>e?hr(r+e,0):e||0:0,u){for(;ei&&(i=l)}else t=null==t&&de(n)?u:o.createCallback(t,e,3),st(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,i=n)});return i}function ee(n,t,e,r){var u=3>arguments.length;t=o.createCallback(t,r,4);var i=-1,a=n?n.length:0;if(typeof a=="number"&&-1arguments.length;return t=o.createCallback(t,r,4),ht(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function ue(n){var t=-1,e=n&&n.length,r=Re(0>e?0:e>>>0);return st(n,function(n){var e=Ct(0,++t);r[t]=r[e],r[e]=n}),r}function oe(n,t,e){var r;t=o.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length)return Nt(n,x,null,t); +if(n)var e=n[I]?n[I][2]:n.length,r=Ut(arguments,2),e=e-r.length;return Nt(n,x|O,e,t,r)}function ae(n,t,e){var r,u,o,i,a,l,f,c=0,p=false,s=true;if(!ge(n))throw new De;if(t=0>t?0:t,true===e)var h=true,s=false;else ve(e)&&(h=e.leading,p="maxWait"in e&&hr(t,+e.maxWait||0),s="trailing"in e?e.trailing:s);var g=function(){var e=t-(Dr()-i);0>=e||e>t?(u&&Xe(u),e=f,u=l=f=w,e&&(c=Dr(),o=n.apply(a,r),l||u||(r=a=null))):l=rr(g,e)},v=function(){l&&Xe(l),u=l=f=w,(s||p!==t)&&(c=Dr(),o=n.apply(a,r),l||u||(r=a=null))};return function(){if(r=arguments,i=Dr(),a=this,f=s&&(l||!h),false===p)var e=h&&!l; +else{u||h||(c=i);var y=p-(i-c),m=0>=y||y>p;m?(u&&(u=Xe(u)),c=i,o=n.apply(a,r)):u||(u=rr(v,y))}return m&&l?l=Xe(l):l||t===p||(l=rr(g,t)),e&&(m=true,o=n.apply(a,r)),!m||l||u||(r=a=null),o}}function le(n){if(!ge(n))throw new De;return function(){return!n.apply(this,arguments)}}function fe(n,t,e){var r=arguments;if(!n||2>r.length)return n;var u=0,o=r.length,i=typeof e;if("number"!=i&&"string"!=i||!r[3]||r[3][e]!==t||(o=2),3arguments.length)return t;var e=Ut(arguments);return e.push(n),fe.apply(null,e)}function pe(n){var t=[];return _t(n,function(n,e){ge(n)&&t.push(e)}),t.sort()}function se(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Me.call(n)==H||false}function he(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=-1,u=e-1,o=Re(e),i=0t||null==n||!cr(t))return e;n=ze(n);do t%2&&(e+=n),t=Ye(t/2),n+=n;while(t);return e}function je(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||X(n,t,e):"object"!=r?Ie(n):Oe(n) +}function Ce(n){return n}function Oe(n){var t=Sr(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||ve(u)?function(r){var u=e;if(u&&!r)return false;for(var o=true;u--&&(o=t[u],o=Qe.call(r,o)&&kt(r[o],n[o],null,true)););return o}:function(n){return n&&Qe.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Ae(n,t,e){var r=true,u=t&&pe(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=o,u=pe(t)),false===e?r=false:ve(e)&&"chain"in e&&(r=e.chain),e=-1;for(var i=ge(n),a=u?u.length:0;++e--n?t.apply(this,arguments):void 0}},o.assign=fe,o.at=function(n,t){var e=arguments,r=-1,u=yt(e,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!e[2]||e[2][t]!==n||(o=1),e=Re(o);++rarguments.length?Nt(t,x|k,null,n):Nt(t,x|k|O,null,n,Ut(arguments,2))},o.chain=function(n){return new i(n,true)},o.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(s?r(s,l):i(p,l))){for(t=u;--t;){var h=o[t];if(0>(h?r(h,l):i(n[t],l)))continue n}s&&s.push(l),p.push(l)}return p},o.invert=function(n,t){for(var e=-1,r=Sr(n),u=r.length,o={};++eo?0:o>>>0); +return st(n,function(n){var o=u?t:null!=n&&n[t];i[++r]=o?o.apply(n,e):w}),i},o.keys=Sr,o.keysIn=be,o.map=ne,o.mapValues=function(n,t,e){var r={};return t=o.createCallback(t,e,3),wt(n,function(n,e,u){r[e]=t(n,e,u)}),r},o.matches=Oe,o.max=te,o.memoize=function(n,t){if(!ge(n))throw new De;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return Qe.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},o.merge=function(n,t,e){if(!n)return n;var r=arguments,u=r.length,o=typeof e; +if("number"!=o&&"string"!=o||!r[3]||r[3][e]!==t||(u=2),3u?0:u>>>0);for(i||(t=o.createCallback(t,e,3)),st(n,function(n,e,u){if(i)for(e=t.length,u=Re(e);e--;)u[e]=n[t[e]];else u=t(n,e,u);f[++r]={a:u,b:r,c:n}}),u=f.length,f.sort(i?l:a);u--;)f[u]=f[u].c;return f},o.tap=function(n,t,e){return t.call(e,n),n},o.throttle=function(n,t,e){var r=true,u=true;if(!ge(n))throw new De; +return false===e?r=false:ve(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),lt.leading=r,lt.maxWait=+t,lt.trailing=u,ae(n,t,lt)},o.times=function(n,t,e){n=0>n?0:n>>>0,t=X(t,e,1),e=-1;for(var r=Re(n);++ee?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},o.escape=function(n){return null==n?"":ze(n).replace($,p)},o.escapeRegExp=xe,o.every=Xt,o.find=Gt,o.findIndex=$t,o.findKey=function(n,t,e){return t=o.createCallback(t,e,3),gt(n,t,wt,true) +},o.findLast=function(n,t,e){return t=o.createCallback(t,e,3),gt(n,t,ht)},o.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=o.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},o.findLastKey=function(n,t,e){return t=o.createCallback(t,e,3),gt(n,t,xt,true)},o.has=function(n,t){return n?Qe.call(n,t):false},o.identity=Ce,o.indexOf=zt,o.isArguments=se,o.isArray=Rr,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Me.call(n)==nt||false},o.isDate=function(n){return n&&typeof n=="object"&&Me.call(n)==tt||false +},o.isElement=he,o.isEmpty=function(n){var t=true;if(!n)return t;var e=Me.call(n),r=n.length;return-1e?hr(r+e,0):gr(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},o.mixin=Ae,o.noConflict=function(){return t._=Pe,this},o.noop=Ee,o.now=Dr,o.pad=function(n,t,e){n=null==n?"":ze(n),t=+t;var r=n.length;return re?0:+e||0,n.length),n.lastIndexOf(t,e)==e},o.template=function(n,t,e){var r=o.templateSettings;e=ce({},e,r),n=ze(null==n?"":n);var u,i,a=ce({},e.imports,r.imports),r=Sr(a),a=we(a),l=0,f=e.interpolate||K,c="__p+='",f=Le((e.escape||K).source+"|"+f.source+"|"+(f===D?B:K).source+"|"+(e.evaluate||K).source+"|$","g"); +n.replace(f,function(t,e,r,o,a,f){return r||(r=o),c+=n.slice(l,f).replace(J,s),e&&(u=true,c+="'+__e("+e+")+'"),a&&(i=true,c+="';"+a+";\n__p+='"),r&&(c+="'+((__t=("+r+"))==null?'':__t)+'"),l=f+t.length,t}),c+="';",(e=e.variable)||(c="with(obj){"+c+"}"),c=(i?c.replace(S,""):c).replace(T,"$1").replace(W,"$1;"),c="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=Te(r,"return "+c).apply(w,a) +}catch(h){throw h.source=c,h}return t?p(t):(p.source=c,p)},o.trim=$r,o.trimLeft=Lr,o.trimRight=zr,o.truncate=function(n,t){var e=30,r="...";if(t&&ve(t))var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e,r="omission"in t?ze(t.omission):r;else null!=t&&(e=+t||0);if(n=null==n?"":ze(n),e>=n.length)return n;var o=e-r.length;if(1>o)return r;if(e=n.slice(0,o),null==u)return e+r;if(me(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=Le(u.source,(q.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(l);)a=i.index; +e=e.slice(0,null==a?o:a)}}else n.indexOf(u,o)!=o&&(u=e.lastIndexOf(u),-1n.indexOf(";")?n:n.replace(F,b))},o.uniqueId=function(n){var t=++R;return ze(null==n?"":n)+t},o.all=Xt,o.any=oe,o.detect=Gt,o.findWhere=Gt,o.foldl=ee,o.foldr=re,o.include=Jt,o.inject=ee,Ae(function(){var n={};return wt(o,function(t,e){o.prototype[e]||(n[e]=t)}),n}(),false),o.first=Lt,o.last=Bt,o.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=we(n)),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n) +},o.take=Lt,o.takeRight=Bt,o.takeRightWhile=Bt,o.takeWhile=Lt,o.head=Lt,wt(o,function(n,t){var e="sample"!==t;o.prototype[t]||(o.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new i(o,u):o})}),o.VERSION=E,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Vt,o.prototype.toString=function(){return ze(this.__wrapped__)},o.prototype.value=Vt,o.prototype.valueOf=Vt,st(["join","pop","shift"],function(n){var t=Be[n]; +o.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new i(e,n):e}}),st(["push","reverse","sort","unshift"],function(n){var t=Be[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),st(["concat","splice"],function(n){var t=Be[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),o}var w,x=1,k=2,j=4,C=8,O=16,A=32,E="2.4.1",I="__lodash@"+E+"__",R=0,N=/^[A-Z]+$/,S=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,W=/(__e\(.*?\)|\b__t\))\+'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,L=/<%-([\s\S]+?)%>/g,z=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,B=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,q=/\w*$/,U=/^\s*function[ \n\r\t]+\w/,Z=/^0[xX]/,P=/[\xC0-\xFF]/g,K=/($^)/,M=/[.*+?^${}()|[\]\\]/g,V=/\bthis\b/,J=/['\n\r\u2028\u2029\\]/g,X=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,Y=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",G="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),H="[object Arguments]",Q="[object Array]",nt="[object Boolean]",tt="[object Date]",et="[object Function]",rt="[object Number]",ut="[object Object]",ot="[object RegExp]",it="[object String]",at={}; +at[et]=false,at[H]=at[Q]=at[nt]=at[tt]=at[rt]=at[ut]=at[ot]=at[it]=true;var lt={leading:false,maxWait:0,trailing:false},ft={configurable:false,enumerable:false,value:null,writable:false},ct={"&":"&","<":"<",">":">",'"':""","'":"'"},pt={"&":"&","<":"<",">":">",""":'"',"'":"'"},st={\u00c0:"A",\u00c1:"A",\u00c2:"A",\u00c3:"A",\u00c4:"A",\u00c5:"A",\u00e0:"a",\u00e1:"a",\u00e2:"a",\u00e3:"a",\u00e4:"a",\u00e5:"a",\u00c7:"C",\u00e7:"c",\u00d0:"D",\u00f0:"d",\u00c8:"E",\u00c9:"E",\u00ca:"E",\u00cb:"E",\u00e8:"e",\u00e9:"e",\u00ea:"e",\u00eb:"e",\u00cc:"I",\u00cd:"I",\u00ce:"I",\u00cf:"I",\u00ec:"i",\u00ed:"i",\u00ee:"i",\u00ef:"i",\u00d1:"N",\u00f1:"n",\u00d2:"O",\u00d3:"O",\u00d4:"O",\u00d5:"O",\u00d6:"O",\u00d8:"O",\u00f2:"o",\u00f3:"o",\u00f4:"o",\u00f5:"o",\u00f6:"o",\u00f8:"o",\u00d9:"U",\u00da:"U",\u00db:"U",\u00dc:"U",\u00f9:"u",\u00fa:"u",\u00fb:"u",\u00fc:"u",\u00dd:"Y",\u00fd:"y",\u00ff:"y",\u00c6:"AE",\u00e6:"ae",\u00de:"Th",\u00fe:"th",\u00df:"ss","\xd7":" ","\xf7":" "},ht={"function":true,object:true},gt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vt=ht[typeof window]&&window||this,yt=ht[typeof exports]&&exports&&!exports.nodeType&&exports,ht=ht[typeof module]&&module&&!module.nodeType&&module,mt=yt&&ht&&typeof global=="object"&&global; +!mt||mt.global!==mt&&mt.window!==mt&&mt.self!==mt||(vt=mt);var mt=ht&&ht.exports===yt&&yt,dt=_();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(vt._=dt, define(function(){return dt})):yt&&ht?mt?(ht.exports=dt)._=dt:yt._=dt:vt._=dt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 62085e206..75509ed18 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -205,6 +205,16 @@ return '\\' + stringEscapes[chr]; } + /** + * Used by `_.partition` to create partitioned arrays. + * + * @private + * @returns {Array} Returns the new array. + */ + function partitionInitializer() { + return [[], []]; + } + /** * Used by `_.unescape` to convert HTML entities to characters. * @@ -426,6 +436,47 @@ /*--------------------------------------------------------------------------*/ + /** + * A specialized version of `_.forEach` for arrays without support for + * callback shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, callback) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (callback(array[index], index, array) === breakIndicator) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.map` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function called per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, callback) { + var index = -1, + length = array ? array.length >>> 0 : 0, + result = Array(length); + + while (++index < length) { + result[index] = callback(array[index], index, array); + } + return result; + } + /** * The base implementation of `_.create` without support for assigning * properties to the created object. @@ -990,20 +1041,20 @@ } /** - * Creates a function that aggregates a collection, creating an object or - * array composed from the results of running each element in the collection + * Creates a function that aggregates a collection, creating an accumulator + * object composed from the results of running each element in the collection * through a callback. The given setter function sets the keys and values of - * the composed object or array. + * the accumulator object. If `initializer` is provided will be used to + * initialize the accumulator object. * * @private - * @param {Function} setter The setter function. - * @param {boolean} [retArray=false] A flag to indicate that the aggregator - * function should return an array. + * @param {Function} setter The function to set keys and values of the accumulator object. + * @param {Function} [initializer] The function to initialize the accumulator object. * @returns {Function} Returns the new aggregator function. */ - function createAggregator(setter, retArray) { + function createAggregator(setter, initializer) { return function(collection, callback, thisArg) { - var result = retArray ? [[], []] : {}; + var result = initializer ? initializer() : {}; callback = createCallback(callback, thisArg, 3); var index = -1, @@ -1941,7 +1992,7 @@ * * @name valueOf * @memberOf _ - * @alias value, toJSON + * @alias toJSON, value * @category Chaining * @returns {*} Returns the wrapped value. * @example @@ -1983,17 +2034,21 @@ * // => true */ function contains(collection, target) { - var indexOf = getIndexOf(), - length = collection ? collection.length : 0, - result = false; - + var length = collection ? collection.length : 0; if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { + var indexOf = getIndexOf(); return indexOf(collection, target) > -1; } - baseEach(collection, function(value) { - return (result = value === target) && breakIndicator; - }); - return result; + var props = keys(collection); + length = props.length; + + while (length--) { + var value = collection[props[length]]; + if (value === target) { + return true; + } + } + return false; } /** @@ -2077,8 +2132,8 @@ */ function every(collection, predicate, thisArg) { var result = true; - predicate = createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -2138,8 +2193,8 @@ */ function filter(collection, predicate, thisArg) { var result = []; - predicate = createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -2241,20 +2296,12 @@ * // => logs each number and returns the object (property order is not guaranteed across environments) */ function forEach(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0; - + var length = collection ? collection.length : 0; callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); - if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - while (++index < length) { - if (callback(collection[index], index, collection) === breakIndicator) { - break; - } - } - } else { - baseEach(collection, callback); - } - return collection; + + return (typeof length == 'number' && length > -1 && length <= maxSafeInteger) + ? arrayEach(collection, callback) + : baseEach(collection, callback); } /** @@ -2419,21 +2466,18 @@ * // => ['barney', 'fred'] */ function map(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0; - + var length = collection ? collection.length : 0; callback = createCallback(callback, thisArg, 3); + if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) { - var result = Array(length); - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - result = []; - baseEach(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); + return arrayMap(collection, callback); } + var index = -1, + result = []; + + baseEach(collection, function(value, key, collection) { + result[++index] = callback(value, key, collection); + }); return result; } @@ -2629,7 +2673,7 @@ */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); - }, true); + }, partitionInitializer); /** * Retrieves the value of a specified property from all elements in the collection. @@ -2728,8 +2772,8 @@ */ function reduceRight(collection, callback, accumulator, thisArg) { var noaccum = arguments.length < 3; - callback = createCallback(callback, thisArg, 4); + baseEachRight(collection, function(value, index, collection) { accumulator = noaccum ? (noaccum = false, value) @@ -2837,7 +2881,6 @@ result[index] = result[rand]; result[rand] = value; }); - return result; } @@ -2912,8 +2955,8 @@ */ function some(collection, predicate, thisArg) { var result; - predicate = createCallback(predicate, thisArg, 3); + var index = -1, length = collection ? collection.length : 0; @@ -3435,6 +3478,9 @@ * // => { 'name': 'penelope', 'age': 1 } */ function memoize(func, resolver) { + if (!isFunction(func)) { + throw new TypeError; + } var cache = {}; return function() { var key = resolver ? resolver.apply(this, arguments) : '_' + arguments[0]; @@ -3995,6 +4041,11 @@ * by the method instead. The callback is bound to `thisArg` and invoked * with two arguments; (value, other). * + * Note: This method supports comparing arrays, booleans, `Date` objects, + * numbers, `Object` objects, regexes, and strings. Functions and DOM nodes + * are **not** supported. A callback may be used to extend support for + * comparing other values. + * * @static * @memberOf _ * @category Objects @@ -4357,7 +4408,7 @@ * @memberOf _ * @category Objects * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. + * @returns {Array} Returns the new array of key-value pairs. * @example * * _.pairs({ 'barney': 36, 'fred': 40 }); @@ -4766,14 +4817,15 @@ * // => { 'name': 'barney', 'age': 36 } */ function matches(source) { - source || (source = {}); var props = keys(source), propsLength = props.length; return function(object) { - var length = propsLength, - result = true; - + var length = propsLength; + if (length && !object) { + return false; + } + var result = true; while (length--) { var key = props[length]; if (!(result = hasOwnProperty.call(object, key) && @@ -5079,10 +5131,11 @@ */ function times(n, callback, thisArg) { n = n < 0 ? 0 : n >>> 0; + callback = baseCreateCallback(callback, thisArg, 1); + var index = -1, result = Array(n); - callback = baseCreateCallback(callback, thisArg, 1); while (++index < n) { result[index] = callback(index); } diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 1198f3d41..feeb60017 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,38 +3,38 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE * Build: `lodash underscore -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(tu(r,i)&&o.push(i)}return o}function p(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number"&&-1o(f,c)&&(t&&f.push(c),i.push(a))}return i}function _(n,r){return function(t,e,u){var o=r?[[],[]]:{};e=tr(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r)}function E(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?Zr(u+e,0):e||0;else if(e)return e=S(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function O(n,r,t){return k(n,null==r||t?1:0>r?0:r)}function k(n,r,t){var e=-1,u=n?n.length:0; -for(r=typeof r=="undefined"?0:+r||0,0>r?r=Zr(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=Zr(u+t,0):t>u&&(t=u),u=r>t?0:t-r,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=tr(r,t,3),p(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function D(n,r,t,e){var u=3>arguments.length;r=tr(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length; -return r=tr(r,e,4),s(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function z(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return p(n,function(n){var t=b(0,++r);e[r]=e[t],e[t]=n}),e}function C(n,r,t){var e;r=tr(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length?w(n,ar,null,r):w(n,ar|lr,null,r,k(arguments,2))}function U(n,r,t){var e,u,o,i,f,a,c,l=0,p=false,s=true; -if(!L(n))throw new TypeError;if(r=0>r?0:r,true===t)var g=true,s=false;else Q(t)&&(g=t.leading,p="maxWait"in t&&Zr(r,+t.maxWait||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(ht()-i);0>=t||t>r?(u&&clearTimeout(u),t=c,u=a=c=fr,t&&(l=ht(),o=n.apply(f,e),a||u||(e=f=null))):a=setTimeout(h,t)},v=function(){a&&clearTimeout(a),u=a=c=fr,(s||p!==r)&&(l=ht(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=ht(),f=this,c=s&&(a||!g),false===p)var t=g&&!a;else{u||g||(l=i);var y=p-(i-l),m=0>=y||y>p; -m?(u&&(u=clearTimeout(u)),l=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function V(n){if(!L(n))throw new TypeError;return function(){return!n.apply(this,arguments)}}function G(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,vr=/($^)/,yr=/[.*+?^${}()|[\]\\]/g,mr=/['\n\r\u2028\u2029\\]/g,br="[object Arguments]",dr="[object Array]",_r="[object Boolean]",wr="[object Date]",jr="[object Number]",xr="[object Object]",Ar="[object RegExp]",Tr="[object String]",Er={"&":"&","<":"<",">":">",'"':""","'":"'"},Or={"&":"&","<":"<",">":">",""":'"',"'":"'"},kr={"function":true,object:true},Sr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Nr=kr[typeof window]&&window||this,qr=kr[typeof exports]&&exports&&!exports.nodeType&&exports,Fr=kr[typeof module]&&module&&!module.nodeType&&module,Br=qr&&Fr&&typeof global=="object"&&global; -!Br||Br.global!==Br&&Br.window!==Br&&Br.self!==Br||(Nr=Br);var Mr=Fr&&Fr.exports===qr&&qr,Rr=Array.prototype,$r=Object.prototype,Ir=Nr._,Dr=Math.pow(2,53)-1,Wr=$r.toString,zr=RegExp("^"+(null==Wr?"":(Wr+"").replace(yr,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Cr=Math.ceil,Pr=Math.floor,Ur=Function.prototype.toString,Vr=$r.hasOwnProperty,Gr=Rr.push,Hr=$r.propertyIsEnumerable,Jr=Rr.splice,Kr=x(Kr=Object.create)&&Kr,Lr=x(Lr=Array.isArray)&&Lr,Qr=Nr.isFinite,Xr=Nr.isNaN,Yr=x(Yr=Object.keys)&&Yr,Zr=Math.max,nt=Math.min,rt=x(rt=Date.now)&&rt,tt=Math.random; -i.prototype=o.prototype;var et={};!function(n){n={0:1,length:1},et.spliceObjects=(Jr.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Kr||(f=function(){function n(){}return function(r){if(Q(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Nr.Object()}}());var ut=O,ot=T,it=_(function(n,r,t){Vr.call(n,t)?n[t]++:n[t]=1}),ft=_(function(n,r,t){Vr.call(n,t)?n[t].push(r):n[t]=[r]}),at=_(function(n,r,t){n[t]=r -}),ct=_(function(n,r,t){n[t?0:1].push(r)},true),lt=$,pt=B;K(arguments)||(K=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Vr.call(n,"callee")&&!Hr.call(n,"callee")||false});var st=Lr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Wr.call(n)==dr||false};L(/x/)&&(L=function(n){return typeof n=="function"&&"[object Function]"==Wr.call(n)});var gt=Yr?function(n){return Q(n)?Yr(n):[]}:A,ht=rt||function(){return(new Date).getTime()};o.after=function(n,r){if(!L(r))throw new TypeError; -return n=Qr(n=+n)?n:0,function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=P,o.bindAll=function(n){for(var r=1r?0:r)},o.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=gt(n),e=t.length,u={};++ro?0:o>>>0);return p(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):fr}),i},o.keys=gt,o.map=$,o.matches=ur,o.max=I,o.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):"_"+arguments[0];return Vr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},o.min=function(n,r,t){var e=1/0,u=e,o=typeof r;"number"!=o&&"string"!=o||!t||t[r]!==n||(r=null);var o=-1,i=n?n.length:0; -if(null==r&&typeof i=="number"&&-1o?0:o>>>0);for(t=tr(t,e,3),p(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].c;return i},o.tap=function(n,r){return r(n),n},o.throttle=function(n,r,t){var e=true,u=true; -if(!L(n))throw new TypeError;return false===t?e=false:Q(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),U(n,r,{leading:e,maxWait:r,trailing:u})},o.times=function(n,r,t){n=0>n?0:n>>>0;var e=-1,u=Array(n);for(r=a(r,t,1);++er?0:r);++nt?Zr(e+t,0):nt(t||0,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=or,o.noConflict=function(){return Nr._=Ir,this},o.now=ht,o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Pr(tt()*(r-n+1)) -},o.reduce=D,o.reduceRight=W,o.result=function(n,r){if(null!=n){var t=n[r];return L(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"&&-1n.indexOf(";")?n:n.replace(gr,u))},o.uniqueId=function(n){var r=++sr+"";return n?n+r:r},o.all=F,o.any=C,o.detect=M,o.findWhere=M,o.foldl=D,o.foldr=W,o.include=q,o.inject=D,o.first=T,o.last=function(n,r,t){var e=n?n.length:0; -return null==r||t?n?n[e-1]:fr:(r=e-(r||0),k(n,0>r?0:r))},o.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=rr(n)),null==r||t?(r=n?n.length:0,0r?0:+r||0,n.length),n)},o.take=ot,o.head=T,or(G({},o)),o.VERSION="2.4.1",o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.value=function(){return this.__wrapped__},p("pop push reverse shift sort splice unshift".split(" "),function(n){var r=Rr[n];o.prototype[n]=function(){var n=this.__wrapped__; -return r.apply(n,arguments),et.spliceObjects||0!==n.length||delete n[0],this}}),p(["concat","join","slice"],function(n){var r=Rr[n];o.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nr._=o, define("underscore",function(){return o})):qr&&Fr?Mr?(Fr.exports=o)._=o:qr._=o:Nr._=o}).call(this); \ No newline at end of file +;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(t>>0:0,u=Array(e);++tu(r,i)&&o.push(i)}return o}function s(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number"&&-1o(f,c)&&(t&&f.push(c),i.push(a))}return i}function w(n,r){return function(t,e,u){var o=r?r():{};e=er(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r)}function O(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?nt(u+e,0):e||0;else if(e)return e=N(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function k(n,r,t){return S(n,null==r||t?1:0>r?0:r)}function S(n,r,t){var e=-1,u=n?n.length:0; +for(r=typeof r=="undefined"?0:+r||0,0>r?r=nt(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=nt(u+t,0):t>u&&(t=u),u=r>t?0:t-r,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=er(r,t,3),s(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){var u=3>arguments.length;r=er(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return r=er(r,e,4),g(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function C(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return s(n,function(n){var t=d(++r);e[r]=e[t],e[t]=n}),e}function P(n,r,t){var e;r=er(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length?j(n,cr,r):j(n,cr|pr,r,S(arguments,2)) +}function V(n,r,t){function e(){l&&clearTimeout(l),i=l=p=ar,(h||g!==r)&&(s=vt(),f=n.apply(c,o),l||i||(o=c=null))}function u(){var t=r-(vt()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=l=p=ar,t&&(s=vt(),f=n.apply(c,o),l||i||(o=c=null))):l=setTimeout(u,t)}var o,i,f,a,c,l,p,s=0,g=false,h=true;if(!Q(n))throw new TypeError;if(r=0>r?0:r,true===t)var v=true,h=false;else X(t)&&(v=t.leading,g="maxWait"in t&&nt(r,+t.maxWait||0),h="trailing"in t?t.trailing:h);return function(){if(o=arguments,a=vt(),c=this,p=h&&(l||!v),false===g)var t=v&&!l; +else{i||v||(s=a);var y=g-(a-s),m=0>=y||y>g;m?(i&&(i=clearTimeout(i)),s=a,f=n.apply(c,o)):i||(i=setTimeout(e,y))}return m&&l?l=clearTimeout(l):l||r===g||(l=setTimeout(u,r)),t&&(m=true,f=n.apply(c,o)),!m||l||i||(o=c=null),f}}function G(n){if(!Q(n))throw new TypeError;return function(){return!n.apply(this,arguments)}}function H(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t;for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,yr=/($^)/,mr=/[.*+?^${}()|[\]\\]/g,br=/['\n\r\u2028\u2029\\]/g,dr="[object Arguments]",_r="[object Array]",wr="[object Boolean]",jr="[object Date]",xr="[object Number]",Tr="[object Object]",Ar="[object RegExp]",Er="[object String]",Or={"&":"&","<":"<",">":">",'"':""","'":"'"},kr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Sr={"function":true,object:true},Nr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qr=Sr[typeof window]&&window||this,Fr=Sr[typeof exports]&&exports&&!exports.nodeType&&exports,Br=Sr[typeof module]&&module&&!module.nodeType&&module,Mr=Fr&&Br&&typeof global=="object"&&global; +!Mr||Mr.global!==Mr&&Mr.window!==Mr&&Mr.self!==Mr||(qr=Mr);var Rr=Br&&Br.exports===Fr&&Fr,$r=Array.prototype,Ir=Object.prototype,Dr=qr._,Wr=Math.pow(2,53)-1,zr=Ir.toString,Cr=RegExp("^"+(null==zr?"":(zr+"").replace(mr,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pr=Math.ceil,Ur=Math.floor,Vr=Function.prototype.toString,Gr=Ir.hasOwnProperty,Hr=$r.push,Jr=Ir.propertyIsEnumerable,Kr=$r.splice,Lr=T(Lr=Object.create)&&Lr,Qr=T(Qr=Array.isArray)&&Qr,Xr=qr.isFinite,Yr=qr.isNaN,Zr=T(Zr=Object.keys)&&Zr,nt=Math.max,rt=Math.min,tt=T(tt=Date.now)&&tt,et=Math.random; +i.prototype=o.prototype;var ut={};!function(){var n={0:1,length:1};ut.spliceObjects=(Kr.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Lr||(a=function(){function n(){}return function(r){if(X(r)){n.prototype=r;var t=new n;n.prototype=null}return t||qr.Object()}}());var ot=k,it=E,ft=w(function(n,r,t){Gr.call(n,t)?n[t]++:n[t]=1}),at=w(function(n,r,t){Gr.call(n,t)?n[t].push(r):n[t]=[r]}),ct=w(function(n,r,t){n[t]=r +}),lt=w(function(n,r,t){n[t?0:1].push(r)},function(){return[[],[]]}),pt=I,st=M;L(arguments)||(L=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Gr.call(n,"callee")&&!Jr.call(n,"callee")||false});var gt=Qr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&zr.call(n)==_r||false};Q(/x/)&&(Q=function(n){return typeof n=="function"&&"[object Function]"==zr.call(n)});var ht=Zr?function(n){return X(n)?Zr(n):[]}:A,vt=tt||function(){return(new Date).getTime()};o.after=function(n,r){if(!Q(r))throw new TypeError; +return n=Xr(n=+n)?n:0,function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=U,o.bindAll=function(n){for(var r=1r?0:r)},o.intersection=function(){for(var n=[],r=-1,t=arguments.length;++ri(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},o.invert=function(n){for(var r=-1,t=ht(n),e=t.length,u={};++ro?0:o>>>0);return s(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):ar}),i},o.keys=ht,o.map=I,o.matches=or,o.max=D,o.memoize=function(n,r){if(!Q(n))throw new TypeError;var t={};return function(){var e=r?r.apply(this,arguments):"_"+arguments[0];return Gr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},o.min=function(n,r,t){var e=1/0,u=e,o=typeof r;"number"!=o&&"string"!=o||!t||t[r]!==n||(r=null); +var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number"&&-1o?0:o>>>0);for(t=er(t,e,3),s(n,function(n,r,e){i[++u]={a:t(n,r,e),b:u,c:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].c; +return i},o.tap=function(n,r){return r(n),n},o.throttle=function(n,r,t){var e=true,u=true;if(!Q(n))throw new TypeError;return false===t?e=false:X(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),V(n,r,{leading:e,maxWait:r,trailing:u})},o.times=function(n,r,t){n=0>n?0:n>>>0,r=c(r,t,1),t=-1;for(var e=Array(n);++tr?0:r);++nt?nt(e+t,0):rt(t||0,e-1))+1);e--;)if(n[e]===r)return e;return-1},o.mixin=ir,o.noConflict=function(){return qr._=Dr,this},o.now=vt,o.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Ur(et()*(r-n+1)) +},o.reduce=W,o.reduceRight=z,o.result=function(n,r){if(null!=n){var t=n[r];return Q(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"&&-1n.indexOf(";")?n:n.replace(hr,u))},o.uniqueId=function(n){var r=++gr+"";return n?n+r:r},o.all=B,o.any=P,o.detect=R,o.findWhere=R,o.foldl=W,o.foldr=z,o.include=F,o.inject=W,o.first=E,o.last=function(n,r,t){var e=n?n.length:0; +return null==r||t?n?n[e-1]:ar:(r=e-(r||0),S(n,0>r?0:r))},o.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=tr(n)),null==r||t?(r=n?n.length:0,0r?0:+r||0,n.length),n)},o.take=it,o.head=E,ir(H({},o)),o.VERSION="2.4.1",o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.value=function(){return this.__wrapped__},s("pop push reverse shift sort splice unshift".split(" "),function(n){var r=$r[n];o.prototype[n]=function(){var n=this.__wrapped__; +return r.apply(n,arguments),ut.spliceObjects||0!==n.length||delete n[0],this}}),s(["concat","join","slice"],function(n){var r=$r[n];o.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(qr._=o, define("underscore",function(){return o})):Fr&&Br?Rr?(Br.exports=o)._=o:Fr._=o:qr._=o}).call(this); \ No newline at end of file