diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index cb5967908..3370ebfbf 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -26,6 +26,9 @@ /** Used as the property name for wrapper metadata */ var expando = '__lodash@' + version + '__'; + /** Used as the TypeError message for "Functions" methods */ + var funcErrorText = 'Expected a function'; + /** Used to generate unique IDs */ var idCounter = 0; @@ -464,69 +467,6 @@ return typeof value.toString != 'function' && typeof (value + '') == 'string'; } - /** - * A fallback implementation of `String#trim` to remove leading and trailing - * whitespace or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrim(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); - } - chars = String(chars); - return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); - } - - /** - * A fallback implementation of `String#trimLeft` to remove leading whitespace - * or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrimLeft(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(trimmedLeftIndex(string)) - } - chars = String(chars); - return string.slice(charsLeftIndex(string, chars)); - } - - /** - * A fallback implementation of `String#trimRight` to remove trailing whitespace - * or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrimRight(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(0, trimmedRightIndex(string) + 1) - } - chars = String(chars); - return string.slice(0, charsRightIndex(string, chars) + 1); - } - /** * Gets the index of the first non-whitespace character of `string`. * @@ -673,10 +613,7 @@ nativeMin = Math.min, nativeNow = isNative(nativeNow = Date.now) && nativeNow, nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeTrim = isNative(nativeTrim = stringProto.trim) && !nativeTrim.call(whitespace) && nativeTrim, - nativeTrimLeft = isNative(nativeTrimLeft = stringProto.trimLeft) && !nativeTrimLeft.call(whitespace) && nativeTrimLeft, - nativeTrimRight = isNative(nativeTrimRight = stringProto.trimRight) && !nativeTrimRight.call(whitespace) && nativeTrimRight; + nativeRandom = Math.random; /** Used to lookup built-in constructors by `[[Class]]` */ var ctorByClass = {}; @@ -2141,7 +2078,7 @@ isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (isPartial && !partialArgs.length) { bitmask &= ~PARTIAL_FLAG; @@ -2224,8 +2161,8 @@ * @returns {Function} Returns the "indexOf" function. */ function getIndexOf() { - var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; - return result; + var result = lodash.indexOf || indexOf; + return result === indexOf ? baseIndexOf : result; } /** @@ -2369,7 +2306,16 @@ * // => [1, 3] */ function difference() { - return baseDifference(arguments[0], baseFlatten(arguments, true, true, 1)); + var index = -1, + length = arguments.length; + + while (++index < length) { + var value = arguments[index]; + if (isArray(value) || isArguments(value)) { + break; + } + } + return baseDifference(arguments[index], baseFlatten(arguments, true, true, ++index)); } /** @@ -4870,7 +4816,7 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -5034,7 +4980,7 @@ while (length--) { if (!isFunction(funcs[length])) { - throw new TypeError; + throw new TypeError(funcErrorText); } } return function() { @@ -5137,7 +5083,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } wait = wait < 0 ? 0 : wait; if (options === true) { @@ -5242,7 +5188,7 @@ */ function defer(func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 1); return setTimeout(function() { func.apply(undefined, args); }, 1); @@ -5266,7 +5212,7 @@ */ function delay(func, wait) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 2); return setTimeout(function() { func.apply(undefined, args); }, wait); @@ -5311,7 +5257,7 @@ */ function memoize(func, resolver) { if (!isFunction(func) || (resolver && !isFunction(resolver))) { - throw new TypeError; + throw new TypeError(funcErrorText); } var memoized = function() { var cache = memoized.cache, @@ -5346,7 +5292,7 @@ */ function negate(predicate) { if (!isFunction(predicate)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { return !predicate.apply(this, arguments); @@ -5375,7 +5321,7 @@ result; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { if (ran) { @@ -5497,7 +5443,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (options === false) { leading = false; @@ -6086,14 +6032,14 @@ * // => false */ function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass) || false; } // fallback for environments without a `[[Class]]` for `arguments` objects if (!support.argsClass) { isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; }; } @@ -6114,8 +6060,8 @@ * // => false */ var isArray = nativeIsArray || function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; }; /** @@ -6135,28 +6081,28 @@ * // => false */ function isBoolean(value) { - return value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass || false; + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; } /** - * Checks if `value` is a date. + * Checks if `value` is a `Date` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date, else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * - * _.isDate('Wed May 23 2012'); + * _.isDate('Mon April 23 2012'); * // => false */ function isDate(value) { - return value && typeof value == 'object' && toString.call(value) == dateClass || false; + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; } /** @@ -6176,14 +6122,14 @@ * // => false */ function isElement(value) { - return value && typeof value == 'object' && value.nodeType === 1 && - (support.nodeClass ? toString.call(value).indexOf('Element') > -1 : isNode(value)) || false; + return (value && typeof value == 'object' && value.nodeType === 1 && + (support.nodeClass ? toString.call(value).indexOf('Element') > -1 : isNode(value))) || false; } // fallback for environments without DOM support if (!support.dom) { isElement = function(value) { - return value && typeof value == 'object' && value.nodeType === 1 && - !isPlainObject(value) || false; + return (value && typeof value == 'object' && value.nodeType === 1 && + !isPlainObject(value)) || false; }; } @@ -6220,7 +6166,7 @@ return result; } var length = value.length; - if (length > -1 && length <= maxSafeInteger && + if ((length > -1 && length <= maxSafeInteger) && (isArray(value) || isString(value) || isArguments(value) || (typeof value == 'object' && isFunction(value.splice)))) { return !length; @@ -6291,6 +6237,27 @@ return baseIsEqual(value, other, callback); } + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; + } + /** * Checks if `value` is, or can be coerced to, a finite number. * @@ -6376,7 +6343,7 @@ // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; - return value && (type == 'function' || type == 'object') || false; + return (value && (type == 'function' || type == 'object')) || false; } /** @@ -6432,7 +6399,7 @@ } /** - * Checks if `value` is a number. + * Checks if `value` is a `Number` primitive or object. * * Note: `NaN` is considered a number. See the [ES5 spec](http://es5.github.io/#x8.5) * for more details. @@ -6456,7 +6423,7 @@ function isNumber(value) { var type = typeof value; return type == 'number' || - value && type == 'object' && toString.call(value) == numberClass || false; + (value && type == 'object' && toString.call(value) == numberClass) || false; } /** @@ -6503,13 +6470,13 @@ }; /** - * Checks if `value` is a regular expression. + * Checks if `value` is a `RegExp` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regular expression, else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp object, else `false`. * @example * * _.isRegExp(/abc/); @@ -6520,12 +6487,12 @@ */ function isRegExp(value) { var type = typeof value; - return value && (type == 'function' || type == 'object') && - toString.call(value) == regexpClass || false; + return (value && (type == 'function' || type == 'object') && + toString.call(value) == regexpClass) || false; } /** - * Checks if `value` is a string. + * Checks if `value` is a `String` primitive or object. * * @static * @memberOf _ @@ -6542,7 +6509,7 @@ */ function isString(value) { return typeof value == 'string' || - value && typeof value == 'object' && toString.call(value) == stringClass || false; + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; } /** @@ -6586,8 +6553,11 @@ * // => ['x', 'y'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { - var length = object ? object.length : 0; - if (typeof length == 'number' && length > 0) { + var ctor = object && object.constructor, + length = object ? object.length : 0; + + if ((typeof length == 'number' && length > 0) || + (ctor && object === ctor.prototype)) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; @@ -6623,7 +6593,9 @@ (support.nonEnumArgs && isArguments(object))) && length) >>> 0; var keyIndex, + ctor = object.constructor, index = -1, + isProto = ctor && object === ctor.prototype, maxIndex = length - 1, result = Array(length), skipIndexes = length > 0, @@ -6634,7 +6606,8 @@ result[index] = String(index); } for (var key in object) { - if (!(skipProto && key == 'prototype') && + if (!(isProto && key == 'constructor') && + !(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name')) && !(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex <= maxIndex && keyIndex % 1 == 0))) { result.push(key); @@ -6645,11 +6618,10 @@ // attribute of an existing property and the `constructor` property of a // prototype defaults to non-enumerable. if (support.nonEnumShadows && object !== objectProto) { - var ctor = object.constructor; index = -1; length = shadowedProps.length; - if (object === (ctor && ctor.prototype)) { + if (isProto) { var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), nonEnum = nonEnumProps[className]; } @@ -7554,12 +7526,17 @@ * _.trim('-_-fred-_-', '_-'); * // => 'fred' */ - var trim = !nativeTrim ? shimTrim : function(string, chars) { - if (string == null) { - return ''; + function trim(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrim.call(string) : shimTrim(string, chars); - }; + if (chars == null) { + return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); + } + chars = String(chars); + return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); + } /** * Removes leading whitespace or specified characters from `string`. @@ -7578,12 +7555,17 @@ * _.trimLeft('-_-fred-_-', '_-'); * // => 'fred-_-' */ - var trimLeft = !nativeTrimLeft ? shimTrimLeft : function(string, chars) { - if (string == null) { - return ''; + function trimLeft(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrimLeft.call(string) : shimTrimLeft(string, chars); - }; + if (chars == null) { + return string.slice(trimmedLeftIndex(string)) + } + chars = String(chars); + return string.slice(charsLeftIndex(string, chars)); + } /** * Removes trailing whitespace or specified characters from `string`. @@ -7602,12 +7584,17 @@ * _.trimRight('-_-fred-_-', '_-'); * // => '-_-fred' */ - var trimRight = !nativeTrimRight ? shimTrimRight : function(string, chars) { - if (string == null) { - return ''; + function trimRight(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrimRight.call(string) : shimTrimRight(string, chars); - }; + if (chars == null) { + return string.slice(0, trimmedRightIndex(string) + 1) + } + chars = String(chars); + return string.slice(0, charsRightIndex(string, chars) + 1); + } /** * Truncates `string` if it is longer than the given maximum string length. @@ -8385,6 +8372,7 @@ lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; + lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isNaN = isNaN; diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 6a1f45386..3f91783dc 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,66 +4,66 @@ * 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(ne||13e||8202r||13r||8202>>0:0,u=Lr(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=Lr(u);++ri?0:i)}function Bt(n,t,e){var u=n?n.length:0;if(typeof e=="number")e=0>e?be(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]:w; -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=be(u+t,0):t>u&&(t=u),r=typeof r=="undefined"?u:+r||0,0>r?r=be(u+r,0):r>u&&(r=u),u=t>r?0:r-t,r=Lr(u);++e>>1,r(n[e])r?0:r);++tr?be(e+r,0):r||0:0,typeof n=="string"||!Fe(n)&&xr(n)?ri&&(i=l)}else t=null==t&&xr(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){return er(n,Tr(t))}function ir(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 lr(n){var t=-1,r=n&&n.length,e=Lr(0>r?0:r>>>0);return vt(n,function(n){var r=At(0,++t);e[t]=e[r],e[r]=n}),e}function fr(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,x,null,t);if(n)var r=n[S]?n[S][2]:n.length,e=Kt(arguments,2),r=r-e.length; -return Lt(n,x|O,r,t,e)}function sr(n,t,r){var e,u,o,i,a,l,f,c=0,s=false,p=true;if(!dr(n))throw new Zr;if(t=0>t?0:t,true===r)var g=true,p=false;else br(r)&&(g=r.leading,s="maxWait"in r&&be(t,+r.maxWait||0),p="trailing"in r?r.trailing:p);var h=function(){var r=t-(Ke()-i);0>=r||r>t?(u&&te(u),r=f,u=l=f=w,r&&(c=Ke(),o=n.apply(a,e),l||u||(e=a=null))):l=fe(h,r)},v=function(){l&&te(l),u=l=f=w,(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=te(u)),c=i,o=n.apply(a,e)):u||(u=fe(v,y))}return m&&l?l=te(l):l||t===s||(l=fe(h,t)),r&&(m=true,o=n.apply(a,e)),!m||l||u||(e=a=null),o}}function pr(n){if(!dr(n))throw new Zr;return function(){return!n.apply(this,arguments)}}function gr(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),gr.apply(null,r)}function vr(n){var t=[];return Ct(n,function(n,r){dr(n)&&t.push(r)}),t.sort()}function yr(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Hr.call(n)==Q||false}function mr(n){return n&&typeof n=="object"&&1===n.nodeType&&(Se.nodeClass?-1>>0,e=-1,u=r-1,o=Lr(r),i=0t||null==n||!ye(t))return r;n=Ur(n);do t%2&&(r+=n),t=re(t/2),n+=n;while(t);return r}function Ar(n,t,r){var e=typeof n;return"function"==e||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||pt(n,t,r):"object"==e?Ir(n):Tr(n)}function Sr(n){return n}function Ir(n){var t=Pe(n),r=t.length,e=t[0],u=r&&n[e];return 1!=r||u!==u||br(u)?function(e){var u=r;if(u&&!e)return false; -for(var o=true;u--&&(o=t[u],o=oe.call(e,o)&&Ot(e[o],n[o],null,true)););return o}:function(n){return n&&oe.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function Rr(n,t,r){var e=true,u=t&&vr(t);t&&(r||u.length)||(null==r&&(r=t),t=n,n=o,u=vr(t)),false===r?e=false:br(r)&&"chain"in r&&(e=r.chain),r=-1;for(var i=dr(n),a=u?u.length:0;++r--n?t.apply(this,arguments):void 0}},o.assign=gr,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),Se.unindexedChars&&xr(n)&&(n=n.split("")),r=Lr(o);++earguments.length?Lt(t,x|C,null,n):Lt(t,x|C|O,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):w}),i},o.keys=Pe,o.keysIn=Cr,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=Ir,o.max=ur,o.memoize=function(n,t){if(!dr(n)||t&&!dr(t))throw new Zr;var r=function(){var e=r.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return oe.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=Lr(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(!dr(n))throw new Zr;return false===r?e=false:br(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ct.leading=e,ct.maxWait=+t,ct.trailing=u,sr(n,t,ct)},o.times=function(n,t,r){n=0>n?0:n>>>0,t=pt(t,r,1),r=-1;for(var e=Lr(n);++rr?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},o.escape=function(n){return null==n?"":Ur(n).replace(F,s)},o.escapeRegExp=Or,o.every=Ht,o.find=nr,o.findIndex=zt,o.findKey=function(n,t,r){return t=o.createCallback(t,r,3),dt(n,t,jt,true)},o.findLast=function(n,t,r){return t=o.createCallback(t,r,3),dt(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),dt(n,t,kt,true)},o.findWhere=function(n,t){return nr(n,Ir(t))},o.has=function(n,t){return n?oe.call(n,t):false},o.identity=Sr,o.indexOf=Bt,o.isArguments=yr,o.isArray=Fe,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Hr.call(n)==tt||false},o.isDate=function(n){return n&&typeof n=="object"&&Hr.call(n)==rt||false -},o.isElement=mr,o.isEmpty=function(n){var t=true;if(!n)return t;var r=n.length;return-1r?be(e+r,0):_e(r||0,e-1))+1);e--;)if(n[e]===t)return e;return-1},o.mixin=Rr,o.noConflict=function(){return t._=Yr,this},o.noop=Nr,o.now=Ke,o.pad=function(n,t,r){n=null==n?"":Ur(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=hr({},r,e),n=Ur(null==n?"":n);var u,i,a=hr({},r.imports,e.imports),e=Pe(a),a=kr(a),l=0,f=r.interpolate||K,c="__p+='",f=qr((r.escape||K).source+"|"+f.source+"|"+(f===z?D:K).source+"|"+(r.evaluate||K).source+"|$","g"); -n.replace(f,function(t,r,e,o,a,f){return e||(e=o),c+=n.slice(l,f).replace(J,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(N,""):c).replace(T,"$1").replace(L,"$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=Pr(e,"return "+c).apply(w,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&&br(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Ur(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Ur(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(wr(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=qr(u.source,(B.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(W,b))},o.uniqueId=function(n){var t=++I;return Ur(null==n?"":n)+t},o.all=Ht,o.any=fr,o.detect=nr,o.foldl=ir,o.foldr=ar,o.include=Gt,o.inject=ir,Rr(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=kr(n):Se.unindexedChars&&xr(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=A,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Yt,o.prototype.toString=function(){return Ur(this.__wrapped__)},o.prototype.value=Yt,o.prototype.valueOf=Yt,c(["join","pop","shift"],function(n){var t=Kr[n]; -o.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new i(r,n):r}}),c(["push","reverse","sort","unshift"],function(n){var t=Kr[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),c(["concat","splice"],function(n){var t=Kr[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Se.spliceObjects||c(["pop","shift","splice"],function(n){var t=Kr[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 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]",rt="[object Date]",et="[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[rt]=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 l(n,r){for(var e=-1,u=n.a,o=r.a,i=u.length;++ee||13e||8202r||13r||8202>>0:0,u=$r(e);++ri(t,l)&&f.push(l);return f}function bt(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 Nt(n,t){for(var r=-1,e=t(n),u=e.length,o=$r(u);++ro?0:o)}function Ut(n,t,e){var u=n?n.length:0;if(typeof e=="number")e=0>e?xe(u+e,0):e||0;else if(e)return e=Jt(n,t),u&&n[e]===t?e:-1;return r(n,t,e)}function Zt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,o=0;for(t=c.createCallback(t,r,3);u--&&t(n[u],u,n);)o++}else o=null==t||r?1:t;return o=e-(o||0),Vt(n,0,0>o?0:o)}function Kt(n,t,r){var e=n?n.length:0;if(typeof t!="number"&&null!=t){var u=e,o=0;for(t=c.createCallback(t,r,3);u--&&t(n[u],u,n);)o++}else if(o=t,null==o||r)return n?n[e-1]:d; +return o=e-(o||0),Vt(n,0>o?0:o)}function Mt(n,t,r){if(typeof t!="number"&&null!=t){var e=-1,u=n?n.length:0,o=0;for(t=c.createCallback(t,r,3);++et?0:t;return Vt(n,o)}function Vt(n,t,r){var e=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=xe(u+t,0):t>u&&(t=u),r=typeof r=="undefined"?u:+r||0,0>r?r=xe(u+r,0):r>u&&(r=u),u=t>r?0:r-t,r=$r(u);++e>>1,r(n[e])r?0:r);++tr?xe(e+r,0):r||0:0,typeof n=="string"||!Fe(n)&&jr(n)?ro&&(o=a)}else t=null==t&&jr(n)?u:c.createCallback(t,r,3),bt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function ar(n,t){return or(n,Fr(t))}function lr(n,t,r,e){var u=3>arguments.length;if(t=c.createCallback(t,e,4),Fe(n)){var o=-1,i=n.length;for(u&&i&&(r=n[++o]);++oarguments.length;return t=c.createCallback(t,e,4),_t(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function cr(n){var t=-1,r=n&&n.length,e=$r(0>r?0:r>>>0);return bt(n,function(n){var r=It(0,++t);e[t]=e[r],e[r]=n}),e}function sr(n,t,r){var e;if(t=c.createCallback(t,r,3),Fe(n)){r=-1;for(var u=n.length;++rarguments.length)return Ft(n,b,null,t);if(n)var r=n[O]?n[O][2]:n.length,e=Vt(arguments,2),r=r-e.length; +return Ft(n,b|C,r,t,e)}function gr(n,t,r){var e,u,o,i,a,l,f,c=0,s=false,p=true;if(!_r(n))throw new Vr(E);if(t=0>t?0:t,true===r)var g=true,p=false;else wr(r)&&(g=r.leading,s="maxWait"in r&&xe(t,+r.maxWait||0),p="trailing"in r?r.trailing:p);var h=function(){var r=t-(qe()-i);0>=r||r>t?(u&&ue(u),r=f,u=l=f=d,r&&(c=qe(),o=n.apply(a,e),l||u||(e=a=null))):l=pe(h,r)},v=function(){l&&ue(l),u=l=f=d,(p||s!==t)&&(c=qe(),o=n.apply(a,e),l||u||(e=a=null))};return function(){if(e=arguments,i=qe(),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=ue(u)),c=i,o=n.apply(a,e)):u||(u=pe(v,y))}return m&&l?l=ue(l):l||t===s||(l=pe(h,t)),r&&(m=true,o=n.apply(a,e)),!m||l||u||(e=a=null),o}}function hr(n){if(!_r(n))throw new Vr(E);return function(){return!n.apply(this,arguments)}}function vr(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=Vt(arguments);return r.push(n),vr.apply(null,r)}function mr(n){var t=[];return kt(n,function(n,r){_r(n)&&t.push(r)}),t.sort()}function dr(n){return n&&typeof n=="object"&&typeof n.length=="number"&&te.call(n)==G||false}function br(n){return n&&typeof n=="object"&&1===n.nodeType&&(Se.nodeClass?-1>>0,e=n.constructor,u=-1,o=e&&n===e.prototype,i=r-1,e=$r(r),a=0t||null==n||!be(t))return r;n=Mr(n);do t%2&&(r+=n),t=oe(t/2),n+=n;while(t);return r}function Ir(n,t){return(n=null==n?"":Mr(n))?null==t?n.slice(h(n),v(n)+1):(t=Mr(t),n.slice(o(n,t),i(n,t)+1)):n}function Rr(n,t,r){var e=typeof n;return"function"==e||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||ht(n,t,r):"object"==e?Tr(n):Fr(n)}function Nr(n){return n}function Tr(n){var t=Pe(n),r=t.length,e=t[0],u=r&&n[e]; +return 1!=r||u!==u||wr(u)?function(e){var u=r;if(u&&!e)return false;for(var o=true;u--&&(o=t[u],o=le.call(e,o)&&At(e[o],n[o],null,true)););return o}:function(n){return n&&le.call(n,e)?(n=n[e],u===n&&(0!==u||1/u==1/n)):false}}function Lr(n,t,r){var e=true,u=t&&mr(t);t&&(r||u.length)||(null==r&&(r=t),t=n,n=c,u=mr(t)),false===r?e=false:wr(r)&&"chain"in r&&(e=r.chain),r=-1;for(var o=_r(n),i=u?u.length:0;++r--n?t.apply(this,arguments):void 0}},c.assign=vr,c.at=function(n,t){var r=arguments,e=-1,u=xt(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),Se.unindexedChars&&jr(n)&&(n=n.split("")),r=$r(o);++earguments.length?Ft(t,b|_,null,n):Ft(t,b|_|C,null,n,Vt(arguments,2))},c.chain=function(n){return new q(n,true)},c.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},c.invert=function(n,t){for(var r=-1,e=Pe(n),u=e.length,o={};++ro?0:o>>>0);return bt(n,function(n){var o=u?t:null!=n&&n[t];i[++e]=o?o.apply(n,r):d}),i},c.keys=Pe,c.keysIn=kr,c.map=or,c.mapValues=function(n,t,r){var e={};return t=c.createCallback(t,r,3),Ot(n,function(n,r,u){e[r]=t(n,r,u) +}),e},c.matches=Tr,c.max=ir,c.memoize=function(n,t){if(!_r(n)||t&&!_r(t))throw new Vr(E);var r=function(){var e=r.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return le.call(e,u)?e[u]:e[u]=n.apply(this,arguments)};return r.cache={},r},c.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(o||(t=c.createCallback(t,r,3)),bt(n,function(n,r,u){if(o)for(r=t.length,u=$r(r);r--;)u[r]=n[t[r]]; +else u=t(n,r,u);i[++e]={a:u,b:e,c:n}}),u=i.length,i.sort(o?l:a);u--;)i[u]=i[u].c;return i},c.tap=function(n,t,r){return t.call(r,n),n},c.throttle=function(n,t,r){var e=true,u=true;if(!_r(n))throw new Vr(E);return false===r?e=false:wr(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),lt.leading=e,lt.maxWait=+t,lt.trailing=u,gr(n,t,lt)},c.times=function(n,t,r){n=0>n?0:n>>>0,t=ht(t,r,1),r=-1;for(var e=$r(n);++rr?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},c.escape=function(n){return null==n?"":Mr(n).replace(L,s)},c.escapeRegExp=Ar,c.every=nr,c.find=rr,c.findIndex=Bt,c.findKey=function(n,t,r){return t=c.createCallback(t,r,3),wt(n,t,Ot,true)},c.findLast=function(n,t,r){return t=c.createCallback(t,r,3),wt(n,t,_t) +},c.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=c.createCallback(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},c.findLastKey=function(n,t,r){return t=c.createCallback(t,r,3),wt(n,t,Et,true)},c.findWhere=function(n,t){return rr(n,Tr(t))},c.has=function(n,t){return n?le.call(n,t):false},c.identity=Nr,c.indexOf=Ut,c.isArguments=dr,c.isArray=Fe,c.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&te.call(n)==Q||false},c.isDate=function(n){return n&&typeof n=="object"&&te.call(n)==nt||false +},c.isElement=br,c.isEmpty=function(n){var t=true;if(!n)return t;var r=n.length;return-1r?xe(e+r,0):Ce(r||0,e-1))+1);e--;)if(n[e]===t)return e;return-1},c.mixin=Lr,c.noConflict=function(){return t._=Qr,this},c.noop=Wr,c.now=qe,c.pad=function(n,t,r){n=null==n?"":Mr(n),t=+t; +var e=n.length;return er?0:+r||0,n.length),n.lastIndexOf(t,r)==r},c.template=function(n,t,r){var e=c.templateSettings;r=yr({},r,e),n=Mr(null==n?"":n);var u,o,i=yr({},r.imports,e.imports),e=Pe(i),i=Er(i),a=0,l=r.interpolate||U,f="__p+='",l=Kr((r.escape||U).source+"|"+l.source+"|"+(l===$?P:U).source+"|"+(r.evaluate||U).source+"|$","g"); +n.replace(l,function(t,r,e,i,l,c){return e||(e=i),f+=n.slice(a,c).replace(M,p),r&&(u=true,f+="'+__e("+r+")+'"),l&&(o=true,f+="';"+l+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),a=c+t.length,t}),f+="';",(r=r.variable)||(f="with(obj){"+f+"}"),f=(o?f.replace(I,""):f).replace(R,"$1").replace(N,"$1;"),f="function("+(r||"obj")+"){"+(r?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var s=Br(e,"return "+f).apply(d,i) +}catch(g){throw g.source=f,g}return t?s(t):(s.source=f,s)},c.trim=Ir,c.trimLeft=function(n,t){return(n=null==n?"":Mr(n))?null==t?n.slice(h(n)):(t=Mr(t),n.slice(o(n,t))):n},c.trimRight=function(n,t){return(n=null==n?"":Mr(n))?null==t?n.slice(0,v(n)+1):(t=Mr(t),n.slice(0,i(n,t)+1)):n},c.truncate=function(n,t){var r=30,e="...";if(t&&wr(t))var u="separator"in t?t.separator:u,r="length"in t?+t.length||0:r,e="omission"in t?Mr(t.omission):e;else null!=t&&(r=+t||0);if(n=null==n?"":Mr(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(Cr(u)){if(n.slice(o).search(u)){var i,a,l=n.slice(0,o);for(u.global||(u=Kr(u.source,(z.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(T,y))},c.uniqueId=function(n){var t=++A;return Mr(null==n?"":n)+t},c.all=nr,c.any=sr,c.detect=rr,c.foldl=lr,c.foldr=fr,c.include=Qt,c.inject=lr,Lr(function(){var n={}; +return Ot(c,function(t,r){c.prototype[r]||(n[r]=t)}),n}(),false),c.first=qt,c.last=Kt,c.sample=function(n,t,r){return n&&typeof n.length!="number"?n=Er(n):Se.unindexedChars&&jr(n)&&(n=n.split("")),null==t||r?(t=n?n.length:0,0t?0:+t||0,n.length),n)},c.take=qt,c.takeRight=Kt,c.takeRightWhile=Kt,c.takeWhile=qt,c.head=qt,Ot(c,function(n,t){var r="sample"!==t;c.prototype[t]||(c.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 q(o,u):o +})}),c.VERSION=k,c.prototype.chain=function(){return this.__chain__=true,this},c.prototype.toJSON=Ht,c.prototype.toString=function(){return Mr(this.__wrapped__)},c.prototype.value=Ht,c.prototype.valueOf=Ht,V(["join","pop","shift"],function(n){var t=Jr[n];c.prototype[n]=function(){var n=this.__chain__,r=t.apply(this.__wrapped__,arguments);return n?new q(r,n):r}}),V(["push","reverse","sort","unshift"],function(n){var t=Jr[n];c.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),V(["concat","splice"],function(n){var t=Jr[n]; +c.prototype[n]=function(){return new q(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Se.spliceObjects||V(["pop","shift","splice"],function(n){var t=Jr[n],r="splice"==n;c.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 q(u,n):u}}),c}var d,b=1,_=2,w=4,x=8,C=16,j=32,k="2.4.1",O="__lodash@"+k+"__",E="Expected a function",A=0,S=/^[A-Z]+$/,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,T=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,W=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,P=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,D=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,q=/[\xC0-\xFF]/g,U=/($^)/,Z=/[.*+?^${}()|[\]\\]/g,K=/\bthis\b/,M=/['\n\r\u2028\u2029\\]/g,V=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,J=" \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",X="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",Q="[object Boolean]",nt="[object Date]",tt="[object Error]",rt="[object Function]",et="[object Number]",ut="[object Object]",ot="[object RegExp]",it="[object String]",at={}; +at[rt]=false,at[G]=at[H]=at[Q]=at[nt]=at[et]=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={"&":"&","<":"<",">":">",'"':""","'":"'"},st={"&":"&","<":"<",">":">",""":'"',"'":"'"},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":" "},gt={"function":true,object:true},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},vt=gt[typeof window]&&window||this,yt=gt[typeof exports]&&exports&&!exports.nodeType&&exports,gt=gt[typeof module]&&module&&!module.nodeType&&module,mt=yt&>&&typeof global=="object"&&global; +!mt||mt.global!==mt&&mt.window!==mt&&mt.self!==mt||(vt=mt);var mt=gt&>.exports===yt&&yt,dt=m();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(vt._=dt, define(function(){return dt})):yt&>?mt?(gt.exports=dt)._=dt:yt._=dt:vt._=dt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 0dfe610fa..3c05af05e 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -26,6 +26,9 @@ /** Used as the property name for wrapper metadata */ var expando = '__lodash@' + version + '__'; + /** Used as the TypeError message for "Functions" methods */ + var funcErrorText = 'Expected a function'; + /** Used to generate unique IDs */ var idCounter = 0; @@ -111,6 +114,7 @@ arrayClass = '[object Array]', boolClass = '[object Boolean]', dateClass = '[object Date]', + errorClass = '[object Error]', funcClass = '[object Function]', numberClass = '[object Number]', objectClass = '[object Object]', @@ -444,69 +448,6 @@ return '\\' + stringEscapes[chr]; } - /** - * A fallback implementation of `String#trim` to remove leading and trailing - * whitespace or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrim(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); - } - chars = String(chars); - return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); - } - - /** - * A fallback implementation of `String#trimLeft` to remove leading whitespace - * or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrimLeft(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(trimmedLeftIndex(string)) - } - chars = String(chars); - return string.slice(charsLeftIndex(string, chars)); - } - - /** - * A fallback implementation of `String#trimRight` to remove trailing whitespace - * or specified characters from `string`. - * - * @private - * @param {string} string The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @returns {string} Returns the trimmed string. - */ - function shimTrimRight(string, chars) { - string = string == null ? '' : String(string); - if (!string) { - return string; - } - if (chars == null) { - return string.slice(0, trimmedRightIndex(string) + 1) - } - chars = String(chars); - return string.slice(0, charsRightIndex(string, chars) + 1); - } - /** * Gets the index of the first non-whitespace character of `string`. * @@ -651,10 +592,7 @@ nativeMin = Math.min, nativeNow = isNative(nativeNow = Date.now) && nativeNow, nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeTrim = isNative(nativeTrim = stringProto.trim) && !nativeTrim.call(whitespace) && nativeTrim, - nativeTrimLeft = isNative(nativeTrimLeft = stringProto.trimLeft) && !nativeTrimLeft.call(whitespace) && nativeTrimLeft, - nativeTrimRight = isNative(nativeTrimRight = stringProto.trimRight) && !nativeTrimRight.call(whitespace) && nativeTrimRight; + nativeRandom = Math.random; /** Used to lookup built-in constructors by `[[Class]]` */ var ctorByClass = {}; @@ -1972,7 +1910,7 @@ isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isBindKey && !isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (isPartial && !partialArgs.length) { bitmask &= ~PARTIAL_FLAG; @@ -2055,8 +1993,8 @@ * @returns {Function} Returns the "indexOf" function. */ function getIndexOf() { - var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; - return result; + var result = lodash.indexOf || indexOf; + return result === indexOf ? baseIndexOf : result; } /** @@ -2187,7 +2125,16 @@ * // => [1, 3] */ function difference() { - return baseDifference(arguments[0], baseFlatten(arguments, true, true, 1)); + var index = -1, + length = arguments.length; + + while (++index < length) { + var value = arguments[index]; + if (isArray(value) || isArguments(value)) { + break; + } + } + return baseDifference(arguments[index], baseFlatten(arguments, true, true, ++index)); } /** @@ -4690,7 +4637,7 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -4854,7 +4801,7 @@ while (length--) { if (!isFunction(funcs[length])) { - throw new TypeError; + throw new TypeError(funcErrorText); } } return function() { @@ -4957,7 +4904,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } wait = wait < 0 ? 0 : wait; if (options === true) { @@ -5062,7 +5009,7 @@ */ function defer(func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 1); return setTimeout(function() { func.apply(undefined, args); }, 1); @@ -5086,7 +5033,7 @@ */ function delay(func, wait) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 2); return setTimeout(function() { func.apply(undefined, args); }, wait); @@ -5131,7 +5078,7 @@ */ function memoize(func, resolver) { if (!isFunction(func) || (resolver && !isFunction(resolver))) { - throw new TypeError; + throw new TypeError(funcErrorText); } var memoized = function() { var cache = memoized.cache, @@ -5166,7 +5113,7 @@ */ function negate(predicate) { if (!isFunction(predicate)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { return !predicate.apply(this, arguments); @@ -5195,7 +5142,7 @@ result; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { if (ran) { @@ -5317,7 +5264,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (options === false) { leading = false; @@ -5906,8 +5853,8 @@ * // => false */ function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass) || false; } /** @@ -5927,8 +5874,8 @@ * // => false */ var isArray = nativeIsArray || function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; }; /** @@ -5948,28 +5895,28 @@ * // => false */ function isBoolean(value) { - return value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass || false; + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; } /** - * Checks if `value` is a date. + * Checks if `value` is a `Date` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date, else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * - * _.isDate('Wed May 23 2012'); + * _.isDate('Mon April 23 2012'); * // => false */ function isDate(value) { - return value && typeof value == 'object' && toString.call(value) == dateClass || false; + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; } /** @@ -5989,14 +5936,14 @@ * // => false */ function isElement(value) { - return value && typeof value == 'object' && value.nodeType === 1 && - toString.call(value).indexOf('Element') > -1 || false; + return (value && typeof value == 'object' && value.nodeType === 1 && + toString.call(value).indexOf('Element') > -1) || false; } // fallback for environments without DOM support if (!support.dom) { isElement = function(value) { - return value && typeof value == 'object' && value.nodeType === 1 && - !isPlainObject(value) || false; + return (value && typeof value == 'object' && value.nodeType === 1 && + !isPlainObject(value)) || false; }; } @@ -6033,7 +5980,7 @@ return result; } var length = value.length; - if (length > -1 && length <= maxSafeInteger && + if ((length > -1 && length <= maxSafeInteger) && (isArray(value) || isString(value) || isArguments(value) || (typeof value == 'object' && isFunction(value.splice)))) { return !length; @@ -6104,6 +6051,27 @@ return baseIsEqual(value, other, callback); } + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @category Objects + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + return (value && typeof value == 'object' && toString.call(value) == errorClass) || false; + } + /** * Checks if `value` is, or can be coerced to, a finite number. * @@ -6183,7 +6151,7 @@ // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; - return value && (type == 'function' || type == 'object') || false; + return (value && (type == 'function' || type == 'object')) || false; } /** @@ -6239,7 +6207,7 @@ } /** - * Checks if `value` is a number. + * Checks if `value` is a `Number` primitive or object. * * Note: `NaN` is considered a number. See the [ES5 spec](http://es5.github.io/#x8.5) * for more details. @@ -6263,7 +6231,7 @@ function isNumber(value) { var type = typeof value; return type == 'number' || - value && type == 'object' && toString.call(value) == numberClass || false; + (value && type == 'object' && toString.call(value) == numberClass) || false; } /** @@ -6310,13 +6278,13 @@ }; /** - * Checks if `value` is a regular expression. + * Checks if `value` is a `RegExp` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regular expression, else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp object, else `false`. * @example * * _.isRegExp(/abc/); @@ -6326,11 +6294,11 @@ * // => false */ function isRegExp(value) { - return value && typeof value == 'object' && toString.call(value) == regexpClass || false; + return (value && typeof value == 'object' && toString.call(value) == regexpClass) || false; } /** - * Checks if `value` is a string. + * Checks if `value` is a `String` primitive or object. * * @static * @memberOf _ @@ -6347,7 +6315,7 @@ */ function isString(value) { return typeof value == 'string' || - value && typeof value == 'object' && toString.call(value) == stringClass || false; + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; } /** @@ -6391,8 +6359,11 @@ * // => ['x', 'y'] (property order is not guaranteed across environments) */ var keys = !nativeKeys ? shimKeys : function(object) { - var length = object ? object.length : 0; - if (typeof length == 'number' && length > 0) { + var ctor = object && object.constructor, + length = object ? object.length : 0; + + if ((typeof length == 'number' && length > 0) || + (ctor && object === ctor.prototype)) { return shimKeys(object); } return isObject(object) ? nativeKeys(object) : []; @@ -6427,7 +6398,9 @@ (isArray(object) || (support.nonEnumArgs && isArguments(object))) && length) >>> 0; var keyIndex, + ctor = object.constructor, index = -1, + isProto = ctor && object === ctor.prototype, maxIndex = length - 1, result = Array(length), skipIndexes = length > 0; @@ -6436,7 +6409,8 @@ result[index] = String(index); } for (var key in object) { - if (!(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex <= maxIndex && keyIndex % 1 == 0))) { + if (!(isProto && key == 'constructor') && + !(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex <= maxIndex && keyIndex % 1 == 0))) { result.push(key); } } @@ -7334,12 +7308,17 @@ * _.trim('-_-fred-_-', '_-'); * // => 'fred' */ - var trim = !nativeTrim ? shimTrim : function(string, chars) { - if (string == null) { - return ''; + function trim(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrim.call(string) : shimTrim(string, chars); - }; + if (chars == null) { + return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1); + } + chars = String(chars); + return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1); + } /** * Removes leading whitespace or specified characters from `string`. @@ -7358,12 +7337,17 @@ * _.trimLeft('-_-fred-_-', '_-'); * // => 'fred-_-' */ - var trimLeft = !nativeTrimLeft ? shimTrimLeft : function(string, chars) { - if (string == null) { - return ''; + function trimLeft(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrimLeft.call(string) : shimTrimLeft(string, chars); - }; + if (chars == null) { + return string.slice(trimmedLeftIndex(string)) + } + chars = String(chars); + return string.slice(charsLeftIndex(string, chars)); + } /** * Removes trailing whitespace or specified characters from `string`. @@ -7382,12 +7366,17 @@ * _.trimRight('-_-fred-_-', '_-'); * // => '-_-fred' */ - var trimRight = !nativeTrimRight ? shimTrimRight : function(string, chars) { - if (string == null) { - return ''; + function trimRight(string, chars) { + string = string == null ? '' : String(string); + if (!string) { + return string; } - return chars == null ? nativeTrimRight.call(string) : shimTrimRight(string, chars); - }; + if (chars == null) { + return string.slice(0, trimmedRightIndex(string) + 1) + } + chars = String(chars); + return string.slice(0, charsRightIndex(string, chars) + 1); + } /** * Truncates `string` if it is longer than the given maximum string length. @@ -8165,6 +8154,7 @@ lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; + lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isNaN = isNaN; diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 02124fdd0..bf06ce32d 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,62 +4,63 @@ * 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||8202>>0:0,u=Ne(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=Ne(u);++ei?0:i)}function zt(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?gr(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]:_;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=gr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=gr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=Ne(u);++r>>1,e(n[r])e?0:e);++te?gr(r+e,0):e||0:0,typeof n=="string"||!Rr(n)&&be(n)?ei&&(i=l)}else t=null==t&&be(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){return ne(n,Re(t))}function re(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 oe(n){var t=-1,e=n&&n.length,r=Ne(0>e?0:e>>>0);return st(n,function(n){var e=Ct(0,++t);r[t]=r[e],r[e]=n}),r}function ie(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,w,null,t);if(n)var e=n[E]?n[E][2]:n.length,r=Ut(arguments,2),e=e-r.length; -return Nt(n,w|C,e,t,r)}function le(n,t,e){var r,u,o,i,a,l,f,c=0,p=false,s=true;if(!ve(n))throw new Be;if(t=0>t?0:t,true===e)var h=true,s=false;else ye(e)&&(h=e.leading,p="maxWait"in e&&gr(t,+e.maxWait||0),s="trailing"in e?e.trailing:s);var g=function(){var e=t-(Dr()-i);0>=e||e>t?(u&&Ye(u),e=f,u=l=f=_,e&&(c=Dr(),o=n.apply(a,r),l||u||(r=a=null))):l=ur(g,e)},v=function(){l&&Ye(l),u=l=f=_,(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=Ye(u)),c=i,o=n.apply(a,r)):u||(u=ur(v,y))}return m&&l?l=Ye(l):l||t===p||(l=ur(g,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 se(n){var t=[];return _t(n,function(n,e){ve(n)&&t.push(e)}),t.sort()}function he(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ve.call(n)==G||false}function ge(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=-1,u=e-1,o=Ne(e),i=0t||null==n||!pr(t))return e;n=De(n);do t%2&&(e+=n),t=Ge(t/2),n+=n;while(t);return e}function Ce(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||ft(n,t,e):"object"==r?Ae(n):Re(n) -}function Oe(n){return n}function Ae(n){var t=Sr(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||ye(u)?function(r){var u=e;if(u&&!r)return false;for(var o=true;u--&&(o=t[u],o=nr.call(r,o)&&jt(r[o],n[o],null,true)););return o}:function(n){return n&&nr.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Ee(n,t,e){var r=true,u=t&&se(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=o,u=se(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),e=Ne(o);++rarguments.length?Nt(t,w|x,null,n):Nt(t,w|x|C,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):_}),i},o.keys=Sr,o.keysIn=_e,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=Ae,o.max=te,o.memoize=function(n,t){if(!ve(n)||t&&!ve(t))throw new Be;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return nr.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=Ne(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),at.leading=r,at.maxWait=+t,at.trailing=u,le(n,t,at)},o.times=function(n,t,e){n=0>n?0:n>>>0,t=ft(t,e,1),e=-1;for(var r=Ne(n);++ee?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},o.escape=function(n){return null==n?"":De(n).replace(F,p)},o.escapeRegExp=je,o.every=Xt,o.find=Gt,o.findIndex=$t,o.findKey=function(n,t,e){return t=o.createCallback(t,e,3),vt(n,t,wt,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,xt,true)},o.findWhere=function(n,t){return Gt(n,Ae(t))},o.has=function(n,t){return n?nr.call(n,t):false},o.identity=Oe,o.indexOf=zt,o.isArguments=he,o.isArray=Rr,o.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Ve.call(n)==Q||false -},o.isDate=function(n){return n&&typeof n=="object"&&Ve.call(n)==nt||false},o.isElement=ge,o.isEmpty=function(n){var t=true;if(!n)return t;var e=n.length;return-1e?gr(r+e,0):vr(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},o.mixin=Ee,o.noConflict=function(){return t._=Ke,this},o.noop=Ie,o.now=Dr,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=pe({},e,r),n=De(null==n?"":n);var u,i,a=pe({},e.imports,r.imports),r=Sr(a),a=xe(a),l=0,f=e.interpolate||P,c="__p+='",f=ze((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=We(r,"return "+c).apply(_,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&&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,d))},o.uniqueId=function(n){var t=++I;return De(null==n?"":n)+t},o.all=Xt,o.any=ie,o.detect=Gt,o.foldl=re,o.foldr=ue,o.include=Jt,o.inject=re,Ee(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=xe(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=A,o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.toJSON=Vt,o.prototype.toString=function(){return De(this.__wrapped__)},o.prototype.value=Vt,o.prototype.valueOf=Vt,c(["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}}),c(["push","reverse","sort","unshift"],function(n){var t=qe[n];o.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),c(["concat","splice"],function(n){var t=qe[n];o.prototype[n]=function(){return new i(t.apply(this.__wrapped__,arguments),this.__chain__)}}),o}var _,w=1,x=2,j=4,k=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 f(n,e){for(var r=-1,u=n.a,o=e.a,i=u.length;++rr||13r||8202e||13e||8202>>0:0,u=Fe(r);++ei(t,f)&&l.push(f);return l}function mt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number"&&-1a(p,h)&&((u||l)&&p.push(h),c.push(s))}return c}function Rt(n,t){for(var e=-1,r=t(n),u=r.length,o=Fe(u);++eo?0:o)}function qt(n,t,r){var u=n?n.length:0;if(typeof r=="number")r=0>r?dr(u+r,0):r||0;else if(r)return r=Mt(n,t),u&&n[r]===t?r:-1;return e(n,t,r)}function Ut(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,o=0;for(t=c.createCallback(t,e,3);u--&&t(n[u],u,n);)o++}else o=null==t||e?1:t;return o=r-(o||0),Kt(n,0,0>o?0:o)}function Zt(n,t,e){var r=n?n.length:0;if(typeof t!="number"&&null!=t){var u=r,o=0; +for(t=c.createCallback(t,e,3);u--&&t(n[u],u,n);)o++}else if(o=t,null==o||e)return n?n[r-1]:m;return o=r-(o||0),Kt(n,0>o?0:o)}function Pt(n,t,e){if(typeof t!="number"&&null!=t){var r=-1,u=n?n.length:0,o=0;for(t=c.createCallback(t,e,3);++rt?0:t;return Kt(n,o)}function Kt(n,t,e){var r=-1,u=n?n.length:0;for(t=typeof t=="undefined"?0:+t||0,0>t?t=dr(u+t,0):t>u&&(t=u),e=typeof e=="undefined"?u:+e||0,0>e?e=dr(u+e,0):e>u&&(e=u),u=t>e?0:e-t,e=Fe(u);++r>>1,e(n[r])e?0:e);++te?dr(r+e,0):e||0:0,typeof n=="string"||!Nr(n)&&je(n)?eo&&(o=a)}else t=null==t&&je(n)?u:c.createCallback(t,e,3),mt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,o=n)});return o}function oe(n,t){return re(n,We(t))}function ie(n,t,e,r){var u=3>arguments.length;t=c.createCallback(t,r,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return t=c.createCallback(t,r,4),dt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o) +}),e}function fe(n){var t=-1,e=n&&n.length,r=Fe(0>e?0:e>>>0);return mt(n,function(n){var e=Et(0,++t);r[t]=r[e],r[e]=n}),r}function le(n,t,e){var r;t=c.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length)return Wt(n,d,null,t);if(n)var e=n[C]?n[C][2]:n.length,r=Kt(arguments,2),e=e-r.length;return Wt(n,d|j,e,t,r)}function pe(n,t,e){function r(){c&&nr(c),i=c=p=m,(g||h!==t)&&(s=zr(),a=n.apply(l,o),c||i||(o=l=null)) +}function u(){var e=t-(zr()-f);0>=e||e>t?(i&&nr(i),e=p,i=c=p=m,e&&(s=zr(),a=n.apply(l,o),c||i||(o=l=null))):c=fr(u,e)}var o,i,a,f,l,c,p,s=0,h=false,g=true;if(!de(n))throw new Pe(O);if(t=0>t?0:t,true===e)var v=true,g=false;else be(e)&&(v=e.leading,h="maxWait"in e&&dr(t,+e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=zr(),l=this,p=g&&(c||!v),false===h)var e=v&&!c;else{i||v||(s=f);var y=h-(f-s),m=0>=y||y>h;m?(i&&(i=nr(i)),s=f,a=n.apply(l,o)):i||(i=fr(r,y))}return m&&c?c=nr(c):c||t===h||(c=fr(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a +}}function se(n){if(!de(n))throw new Pe(O);return function(){return!n.apply(this,arguments)}}function he(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=Kt(arguments);return e.push(n),he.apply(null,e)}function ve(n){var t=[];return xt(n,function(n,e){de(n)&&t.push(e)}),t.sort()}function ye(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ge.call(n)==X||false}function me(n){return n&&typeof n=="object"&&1===n.nodeType&&-1>>0,r=n.constructor,u=-1,r=r&&n===r.prototype,o=e-1,i=Fe(e),a=0t||null==n||!vr(t))return e;n=Ze(n);do t%2&&(e+=n),t=tr(t/2),n+=n;while(t);return e}function Ee(n,t){return(n=null==n?"":Ze(n))?null==t?n.slice(h(n),g(n)+1):(t=Ze(t),n.slice(o(n,t),i(n,t)+1)):n}function Ie(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||st(n,t,e):"object"==r?Ne(n):We(n) +}function Re(n){return n}function Ne(n){var t=Tr(n),e=t.length,r=t[0],u=e&&n[r];return 1!=e||u!==u||be(u)?function(r){var u=e;if(u&&!r)return false;for(var o=true;u--&&(o=t[u],o=ur.call(r,o)&&Ot(r[o],n[o],null,true)););return o}:function(n){return n&&ur.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Se(n,t,e){var r=true,u=t&&ve(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=c,u=ve(t)),false===e?r=false:be(e)&&"chain"in e&&(r=e.chain),e=-1;for(var o=de(n),i=u?u.length:0;++e--n?t.apply(this,arguments):void 0 +}},c.assign=he,c.at=function(n,t){var e=arguments,r=-1,u=_t(e,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!e[2]||e[2][t]!==n||(o=1),e=Fe(o);++rarguments.length?Wt(t,d|b,null,n):Wt(t,d|b|j,null,n,Kt(arguments,2))},c.chain=function(n){return new q(n,true)},c.compact=function(n){for(var t=-1,e=n?n.length:0,r=0,u=[];++t(s?r(s,f):i(p,f))){for(t=u;--t;){var h=o[t];if(0>(h?r(h,f):i(n[t],f)))continue n}s&&s.push(f),p.push(f)}return p},c.invert=function(n,t){for(var e=-1,r=Tr(n),u=r.length,o={};++eo?0:o>>>0);return mt(n,function(n){var o=u?t:null!=n&&n[t];i[++r]=o?o.apply(n,e):m +}),i},c.keys=Tr,c.keysIn=xe,c.map=re,c.mapValues=function(n,t,e){var r={};return t=c.createCallback(t,e,3),kt(n,function(n,e,u){r[e]=t(n,e,u)}),r},c.matches=Ne,c.max=ue,c.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):"_"+arguments[0];return ur.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!de(n)||t&&!de(t))throw new Pe(O);return e.cache={},e},c.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(o||(t=c.createCallback(t,e,3)),mt(n,function(n,e,u){if(o)for(e=t.length,u=Fe(e);e--;)u[e]=n[t[e]]; +else u=t(n,e,u);i[++r]={a:u,b:r,c:n}}),u=i.length,i.sort(o?f:a);u--;)i[u]=i[u].c;return i},c.tap=function(n,t,e){return t.call(e,n),n},c.throttle=function(n,t,e){var r=true,u=true;if(!de(n))throw new Pe(O);return false===e?r=false:be(e)&&(r="leading"in e?!!e.leading:r,u="trailing"in e?!!e.trailing:u),it.leading=r,it.maxWait=+t,it.trailing=u,pe(n,t,it)},c.times=function(n,t,e){n=0>n?0:n>>>0,t=st(t,e,1),e=-1;for(var r=Fe(n);++ee?0:+e||0,r))-t.length,0<=e&&n.indexOf(t,e)==e},c.escape=function(n){return null==n?"":Ze(n).replace(T,p)},c.escapeRegExp=Oe,c.every=Ht,c.find=ne,c.findIndex=Lt,c.findKey=function(n,t,e){return t=c.createCallback(t,e,3),bt(n,t,kt,true)},c.findLast=function(n,t,e){return t=c.createCallback(t,e,3),bt(n,t,dt) +},c.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=c.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},c.findLastKey=function(n,t,e){return t=c.createCallback(t,e,3),bt(n,t,Ct,true)},c.findWhere=function(n,t){return ne(n,Ne(t))},c.has=function(n,t){return n?ur.call(n,t):false},c.identity=Re,c.indexOf=qt,c.isArguments=ye,c.isArray=Nr,c.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Ge.call(n)==G||false},c.isDate=function(n){return n&&typeof n=="object"&&Ge.call(n)==H||false +},c.isElement=me,c.isEmpty=function(n){var t=true;if(!n)return t;var e=n.length;return-1e?dr(r+e,0):br(e||0,r-1))+1);r--;)if(n[r]===t)return r;return-1},c.mixin=Se,c.noConflict=function(){return t._=Xe,this},c.noop=Te,c.now=zr,c.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},c.template=function(n,t,e){var r=c.templateSettings;e=ge({},e,r),n=Ze(null==n?"":n);var u,o,i=ge({},e.imports,r.imports),r=Tr(i),i=Ce(i),a=0,f=e.interpolate||U,l="__p+='",f=Ue((e.escape||U).source+"|"+f.source+"|"+(f===$?z:U).source+"|"+(e.evaluate||U).source+"|$","g"); +n.replace(f,function(t,e,r,i,f,c){return r||(r=i),l+=n.slice(a,c).replace(K,s),e&&(u=true,l+="'+__e("+e+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';",(e=e.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(I,""):l).replace(R,"$1").replace(N,"$1;"),l="function("+(e||"obj")+"){"+(e?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var p=De(r,"return "+l).apply(m,i) +}catch(h){throw h.source=l,h}return t?p(t):(p.source=l,p)},c.trim=Ee,c.trimLeft=function(n,t){return(n=null==n?"":Ze(n))?null==t?n.slice(h(n)):(t=Ze(t),n.slice(o(n,t))):n},c.trimRight=function(n,t){return(n=null==n?"":Ze(n))?null==t?n.slice(0,g(n)+1):(t=Ze(t),n.slice(0,i(n,t)+1)):n},c.truncate=function(n,t){var e=30,r="...";if(t&&be(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(we(u)){if(n.slice(o).search(u)){var i,a,f=n.slice(0,o);for(u.global||(u=Ue(u.source,(D.exec(u)||"")+"g")),u.lastIndex=0;i=u.exec(f);)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(S,v))},c.uniqueId=function(n){var t=++A;return Ze(null==n?"":n)+t},c.all=Ht,c.any=le,c.detect=ne,c.foldl=ie,c.foldr=ae,c.include=Gt,c.inject=ie,Se(function(){var n={}; +return kt(c,function(t,e){c.prototype[e]||(n[e]=t)}),n}(),false),c.first=Bt,c.last=Zt,c.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ce(n)),null==t||e?(t=n?n.length:0,0t?0:+t||0,n.length),n)},c.take=Bt,c.takeRight=Zt,c.takeRightWhile=Zt,c.takeWhile=Bt,c.head=Bt,kt(c,function(n,t){var e="sample"!==t;c.prototype[t]||(c.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 q(o,u):o +})}),c.VERSION=k,c.prototype.chain=function(){return this.__chain__=true,this},c.prototype.toJSON=Yt,c.prototype.toString=function(){return Ze(this.__wrapped__)},c.prototype.value=Yt,c.prototype.valueOf=Yt,M(["join","pop","shift"],function(n){var t=Ke[n];c.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new q(e,n):e}}),M(["push","reverse","sort","unshift"],function(n){var t=Ke[n];c.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),M(["concat","splice"],function(n){var t=Ke[n]; +c.prototype[n]=function(){return new q(t.apply(this.__wrapped__,arguments),this.__chain__)}}),c}var m,d=1,b=2,_=4,w=8,j=16,x=32,k="2.4.1",C="__lodash@"+k+"__",O="Expected a function",A=0,E=/^[A-Z]+$/,I=/\b__p\+='';/g,R=/\b(__p\+=)''\+/g,N=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,T=/[&<>"']/g,W=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,L=/^\s*function[ \n\r\t]+\w/,B=/^0[xX]/,q=/[\xC0-\xFF]/g,U=/($^)/,Z=/[.*+?^${}()|[\]\\]/g,P=/\bthis\b/,K=/['\n\r\u2028\u2029\\]/g,M=/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[a-z]+|[0-9]+/g,V=" \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",J="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),X="[object Arguments]",Y="[object Array]",G="[object Boolean]",H="[object Date]",Q="[object Error]",nt="[object Function]",tt="[object Number]",et="[object Object]",rt="[object RegExp]",ut="[object String]",ot={}; +ot[nt]=false,ot[X]=ot[Y]=ot[G]=ot[H]=ot[tt]=ot[et]=ot[rt]=ot[ut]=true;var it={leading:false,maxWait:0,trailing:false},at={configurable:false,enumerable:false,value:null,writable:false},ft={"&":"&","<":"<",">":">",'"':""","'":"'"},lt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ct={\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":" "},pt={"function":true,object:true},st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ht=pt[typeof window]&&window||this,gt=pt[typeof exports]&&exports&&!exports.nodeType&&exports,pt=pt[typeof module]&&module&&!module.nodeType&&module,vt=gt&&pt&&typeof global=="object"&&global; +!vt||vt.global!==vt&&vt.window!==vt&&vt.self!==vt||(ht=vt);var vt=pt&&pt.exports===gt&>,yt=y();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(ht._=yt, define(function(){return yt})):gt&&pt?vt?(pt.exports=yt)._=yt:gt._=yt:ht._=yt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 771394f36..c9dd79032 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -29,6 +29,9 @@ /** Used by methods to exit iteration */ var breakIndicator = expando + 'breaker__'; + /** Used as the TypeError message for "Functions" methods */ + var funcErrorText = 'Expected a function'; + /** Used to generate unique IDs */ var idCounter = 0; @@ -1093,7 +1096,7 @@ isPartialRight = bitmask & PARTIAL_RIGHT_FLAG; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (isPartial && !partialArgs.length) { bitmask &= ~PARTIAL_FLAG; @@ -1141,8 +1144,8 @@ * @returns {Function} Returns the "indexOf" function. */ function getIndexOf() { - var result = (result = lodash.indexOf) === indexOf ? baseIndexOf : result; - return result; + var result = lodash.indexOf || indexOf; + return result === indexOf ? baseIndexOf : result; } /** @@ -1226,7 +1229,16 @@ * // => [1, 3] */ function difference() { - return baseDifference(arguments[0], baseFlatten(arguments, true, true, 1)); + var index = -1, + length = arguments.length; + + while (++index < length) { + var value = arguments[index]; + if (isArray(value) || isArguments(value)) { + break; + } + } + return baseDifference(arguments[index], baseFlatten(arguments, true, true, ++index)); } /** @@ -3138,7 +3150,7 @@ */ function after(n, func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } n = nativeIsFinite(n = +n) ? n : 0; return function() { @@ -3254,7 +3266,7 @@ while (length--) { if (!isFunction(funcs[length])) { - throw new TypeError; + throw new TypeError(funcErrorText); } } return function() { @@ -3320,7 +3332,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } wait = wait < 0 ? 0 : wait; if (options === true) { @@ -3425,7 +3437,7 @@ */ function defer(func) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 1); return setTimeout(function() { func.apply(undefined, args); }, 1); @@ -3449,7 +3461,7 @@ */ function delay(func, wait) { if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } var args = slice(arguments, 2); return setTimeout(function() { func.apply(undefined, args); }, wait); @@ -3494,7 +3506,7 @@ */ function memoize(func, resolver) { if (!isFunction(func) || (resolver && !isFunction(resolver))) { - throw new TypeError; + throw new TypeError(funcErrorText); } var cache = {}; return function() { @@ -3526,7 +3538,7 @@ */ function negate(predicate) { if (!isFunction(predicate)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { return !predicate.apply(this, arguments); @@ -3555,7 +3567,7 @@ result; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } return function() { if (ran) { @@ -3631,7 +3643,7 @@ trailing = true; if (!isFunction(func)) { - throw new TypeError; + throw new TypeError(funcErrorText); } if (options === false) { leading = false; @@ -3914,14 +3926,14 @@ * // => false */ function isArguments(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == argsClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == argsClass) || false; } // fallback for environments without a `[[Class]]` for `arguments` objects if (!isArguments(arguments)) { isArguments = function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee') || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; }; } @@ -3942,8 +3954,8 @@ * // => false */ var isArray = nativeIsArray || function(value) { - return value && typeof value == 'object' && typeof value.length == 'number' && - toString.call(value) == arrayClass || false; + return (value && typeof value == 'object' && typeof value.length == 'number' && + toString.call(value) == arrayClass) || false; }; /** @@ -3963,28 +3975,28 @@ * // => false */ function isBoolean(value) { - return value === true || value === false || - value && typeof value == 'object' && toString.call(value) == boolClass || false; + return (value === true || value === false || + value && typeof value == 'object' && toString.call(value) == boolClass) || false; } /** - * Checks if `value` is a date. + * Checks if `value` is a `Date` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a date, else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * - * _.isDate('Wed May 23 2012'); + * _.isDate('Mon April 23 2012'); * // => false */ function isDate(value) { - return value && typeof value == 'object' && toString.call(value) == dateClass || false; + return (value && typeof value == 'object' && toString.call(value) == dateClass) || false; } /** @@ -4004,7 +4016,7 @@ * // => false */ function isElement(value) { - return value && value.nodeType === 1 || false; + return (value && value.nodeType === 1) || false; } /** @@ -4039,7 +4051,7 @@ return true; } var length = value.length; - if (length > -1 && length <= maxSafeInteger && + if ((length > -1 && length <= maxSafeInteger) && (isArray(value) || isString(value) || isArguments(value))) { return !length; } @@ -4179,7 +4191,7 @@ // and avoid a V8 bug // https://code.google.com/p/v8/issues/detail?id=2291 var type = typeof value; - return value && (type == 'function' || type == 'object') || false; + return (value && (type == 'function' || type == 'object')) || false; } /** @@ -4235,7 +4247,7 @@ } /** - * Checks if `value` is a number. + * Checks if `value` is a `Number` primitive or object. * * Note: `NaN` is considered a number. See the [ES5 spec](http://es5.github.io/#x8.5) * for more details. @@ -4259,17 +4271,17 @@ function isNumber(value) { var type = typeof value; return type == 'number' || - value && type == 'object' && toString.call(value) == numberClass || false; + (value && type == 'object' && toString.call(value) == numberClass) || false; } /** - * Checks if `value` is a regular expression. + * Checks if `value` is a `RegExp` object. * * @static * @memberOf _ * @category Objects * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a regular expression, else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp object, else `false`. * @example * * _.isRegExp(/abc/); @@ -4280,12 +4292,12 @@ */ function isRegExp(value) { var type = typeof value; - return value && (type == 'function' || type == 'object') && - toString.call(value) == regexpClass || false; + return (value && (type == 'function' || type == 'object') && + toString.call(value) == regexpClass) || false; } /** - * Checks if `value` is a string. + * Checks if `value` is a `String` primitive or object. * * @static * @memberOf _ @@ -4302,7 +4314,7 @@ */ function isString(value) { return typeof value == 'string' || - value && typeof value == 'object' && toString.call(value) == stringClass || false; + (value && typeof value == 'object' && toString.call(value) == stringClass) || false; } /** @@ -4924,22 +4936,6 @@ return this; } - /** - * A no-operation function. - * - * @static - * @memberOf _ - * @category Utilities - * @example - * - * var object = { 'name': 'fred' }; - * _.noop(object) === undefined; - * // => true - */ - function noop() { - // no operation performed - } - /** * Gets the number of milliseconds that have elapsed since the Unix epoch * (1 January 1970 00:00:00 UTC). diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 4b1f72d3b..62aa71494 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,39 +3,39 @@ * 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(t>>0:0,u=Array(e);++tu(r,i)&&o.push(i)}return o}function g(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 j(n,r){return function(t,e,u){var o=r?r():{};e=or(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r) -}function k(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?tt(u+e,0):e||0;else if(e)return e=q(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function S(n,r,t){return N(n,null==r||t?1:0>r?0:r)}function N(n,r,t){var e=-1,u=n?n.length:0;for(r=typeof r=="undefined"?0:+r||0,0>r?r=tt(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=tt(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=or(r,t,3),g(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function z(n,r){return D(n,cr(r))}function C(n,r,t,e){var u=3>arguments.length; -r=or(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return r=or(r,e,4),h(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function U(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return g(n,function(n){var t=_(++r);e[r]=e[t],e[t]=n}),e}function V(n,r,t){var e;r=or(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length?x(n,pr,r):x(n,pr|gr,r,N(arguments,2))}function H(n,r,t){function e(){l&&clearTimeout(l),i=l=p=lr,(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=lr,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(!Y(n))throw new TypeError;if(r=0>r?0:r,true===t)var v=true,h=false;else Z(t)&&(v=t.leading,g="maxWait"in t&&tt(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 J(n){if(!Y(n))throw new TypeError;return function(){return!n.apply(this,arguments)}}function K(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,br=/($^)/,dr=/[.*+?^${}()|[\]\\]/g,_r=/['\n\r\u2028\u2029\\]/g,wr="[object Arguments]",jr="[object Array]",xr="[object Boolean]",Tr="[object Date]",Ar="[object Number]",Er="[object Object]",Or="[object RegExp]",kr="[object String]",Sr={"&":"&","<":"<",">":">",'"':""","'":"'"},Nr={"&":"&","<":"<",">":">",""":'"',"'":"'"},qr={"function":true,object:true},Fr={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Br=qr[typeof window]&&window||this,Mr=qr[typeof exports]&&exports&&!exports.nodeType&&exports,Rr=qr[typeof module]&&module&&!module.nodeType&&module,$r=Mr&&Rr&&typeof global=="object"&&global; -!$r||$r.global!==$r&&$r.window!==$r&&$r.self!==$r||(Br=$r);var Ir=Rr&&Rr.exports===Mr&&Mr,Dr=Array.prototype,Wr=Object.prototype,zr=Br._,Cr=Math.pow(2,53)-1,Pr=Wr.toString,Ur=RegExp("^"+(null==Pr?"":(Pr+"").replace(dr,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vr=Math.ceil,Gr=Math.floor,Hr=Function.prototype.toString,Jr=Wr.hasOwnProperty,Kr=Dr.push,Lr=Wr.propertyIsEnumerable,Qr=Dr.splice,Xr=A(Xr=Object.create)&&Xr,Yr=A(Yr=Array.isArray)&&Yr,Zr=Br.isFinite,nt=Br.isNaN,rt=A(rt=Object.keys)&&rt,tt=Math.max,et=Math.min,ut=A(ut=Date.now)&&ut,ot=Math.random; -i.prototype=o.prototype;var it={};!function(){var n={0:1,length:1};it.spliceObjects=(Qr.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Xr||(c=function(){function n(){}return function(r){if(Z(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Br.Object()}}());var ft=S,at=O,ct=j(function(n,r,t){Jr.call(n,t)?n[t]++:n[t]=1}),lt=j(function(n,r,t){Jr.call(n,t)?n[t].push(r):n[t]=[r]}),pt=j(function(n,r,t){n[t]=r -}),st=j(function(n,r,t){n[t?0:1].push(r)},function(){return[[],[]]});X(arguments)||(X=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Jr.call(n,"callee")&&!Lr.call(n,"callee")||false});var gt=Yr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Pr.call(n)==jr||false};Y(/x/)&&(Y=function(n){return typeof n=="function"&&"[object Function]"==Pr.call(n)});var ht=rt?function(n){return Z(n)?rt(n):[]}:E,vt=ut||function(){return(new Date).getTime()};o.after=function(n,r){if(!Y(r))throw new TypeError; -return n=Zr(n=+n)?n:0,function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=G,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 g(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):lr}),i},o.keys=ht,o.map=D,o.matches=fr,o.max=W,o.memoize=function(n,r){if(!Y(n)||r&&!Y(r))throw new TypeError;var t={};return function(){var e=r?r.apply(this,arguments):"_"+arguments[0];return Jr.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=or(t,e,3),g(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(!Y(n))throw new TypeError;return false===t?e=false:Z(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),H(n,r,{leading:e,maxWait:r,trailing:u})},o.times=function(n,r,t){n=0>n?0:n>>>0,r=l(r,t,1),t=-1;for(var e=Array(n);++tr?0:r);++nt?tt(e+t,0):et(t||0,e-1))+1);e--;)if(n[e]===r)return e; -return-1},o.mixin=ar,o.noConflict=function(){return Br._=zr,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+Gr(ot()*(r-n+1))},o.reduce=C,o.reduceRight=P,o.result=function(n,r){if(null!=n){var t=n[r];return Y(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"&&-1n.indexOf(";")?n:n.replace(yr,u))},o.uniqueId=function(n){var r=++vr+"";return n?n+r:r},o.all=M,o.any=V,o.detect=$,o.foldl=C,o.foldr=P,o.include=B,o.inject=C,o.first=O,o.last=function(n,r,t){var e=n?n.length:0;return null==r||t?n?n[e-1]:lr:(r=e-(r||0),N(n,0>r?0:r))},o.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=ur(n)),null==r||t?(r=n?n.length:0,0r?0:+r||0,n.length),n) -},o.take=at,o.head=O,ar(K({},o)),o.VERSION="2.4.1",o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(n){var r=Dr[n];o.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),it.spliceObjects||0!==n.length||delete n[0],this}}),f(["concat","join","slice"],function(n){var r=Dr[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?(Br._=o, define("underscore",function(){return o})):Mr&&Rr?Ir?(Rr.exports=o)._=o:Mr._=o:Br._=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 g(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 j(n,r){return function(t,e,u){var o=r?r():{};e=or(e,u,3),u=-1;var i=t?t.length:0;if(typeof i=="number"&&-1r?0:r) +}function k(r,t,e){var u=r?r.length:0;if(typeof e=="number")e=0>e?et(u+e,0):e||0;else if(e)return e=q(r,t),u&&r[e]===t?e:-1;return n(r,t,e)}function S(n,r,t){return N(n,null==r||t?1:0>r?0:r)}function N(n,r,t){var e=-1,u=n?n.length:0;for(r=typeof r=="undefined"?0:+r||0,0>r?r=et(u+r,0):r>u&&(r=u),t=typeof t=="undefined"?u:+t||0,0>t?t=et(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=or(r,t,3),g(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function z(n,r){return D(n,cr(r))}function C(n,r,t,e){var u=3>arguments.length; +r=or(r,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number"&&-1arguments.length;return r=or(r,e,4),h(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function U(n){var r=-1,t=n&&n.length,e=Array(0>t?0:t>>>0);return g(n,function(n){var t=_(++r);e[r]=e[t],e[t]=n}),e}function V(n,r,t){var e;r=or(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"&&-1arguments.length?x(n,pr,r):x(n,pr|gr,r,N(arguments,2))}function H(n,r,t){function e(){l&&clearTimeout(l),i=l=p=lr,(h||g!==r)&&(s=yt(),f=n.apply(c,o),l||i||(o=c=null))}function u(){var t=r-(yt()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=l=p=lr,t&&(s=yt(),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(!Y(n))throw new TypeError(vr);if(r=0>r?0:r,true===t)var v=true,h=false;else Z(t)&&(v=t.leading,g="maxWait"in t&&et(r,+t.maxWait||0),h="trailing"in t?t.trailing:h); +return function(){if(o=arguments,a=yt(),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 J(n){if(!Y(n))throw new TypeError(vr);return function(){return!n.apply(this,arguments)}}function K(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,dr=/($^)/,_r=/[.*+?^${}()|[\]\\]/g,wr=/['\n\r\u2028\u2029\\]/g,jr="[object Arguments]",xr="[object Array]",Tr="[object Boolean]",Ar="[object Date]",Er="[object Number]",Or="[object Object]",kr="[object RegExp]",Sr="[object String]",Nr={"&":"&","<":"<",">":">",'"':""","'":"'"},qr={"&":"&","<":"<",">":">",""":'"',"'":"'"},Fr={"function":true,object:true},Br={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Mr=Fr[typeof window]&&window||this,Rr=Fr[typeof exports]&&exports&&!exports.nodeType&&exports,$r=Fr[typeof module]&&module&&!module.nodeType&&module,Ir=Rr&&$r&&typeof global=="object"&&global; +!Ir||Ir.global!==Ir&&Ir.window!==Ir&&Ir.self!==Ir||(Mr=Ir);var Dr=$r&&$r.exports===Rr&&Rr,Wr=Array.prototype,zr=Object.prototype,Cr=Mr._,Pr=Math.pow(2,53)-1,Ur=zr.toString,Vr=RegExp("^"+(null==Ur?"":(Ur+"").replace(_r,"\\$&")).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gr=Math.ceil,Hr=Math.floor,Jr=Function.prototype.toString,Kr=zr.hasOwnProperty,Lr=Wr.push,Qr=zr.propertyIsEnumerable,Xr=Wr.splice,Yr=A(Yr=Object.create)&&Yr,Zr=A(Zr=Array.isArray)&&Zr,nt=Mr.isFinite,rt=Mr.isNaN,tt=A(tt=Object.keys)&&tt,et=Math.max,ut=Math.min,ot=A(ot=Date.now)&&ot,it=Math.random; +i.prototype=o.prototype;var ft={};!function(){var n={0:1,length:1};ft.spliceObjects=(Xr.call(n,0,1),!n[0])}(0,0),o.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Yr||(c=function(){function n(){}return function(r){if(Z(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Mr.Object()}}());var at=S,ct=O,lt=j(function(n,r,t){Kr.call(n,t)?n[t]++:n[t]=1}),pt=j(function(n,r,t){Kr.call(n,t)?n[t].push(r):n[t]=[r]}),st=j(function(n,r,t){n[t]=r +}),gt=j(function(n,r,t){n[t?0:1].push(r)},function(){return[[],[]]});X(arguments)||(X=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Kr.call(n,"callee")&&!Qr.call(n,"callee")||false});var ht=Zr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ur.call(n)==xr||false};Y(/x/)&&(Y=function(n){return typeof n=="function"&&"[object Function]"==Ur.call(n)});var vt=tt?function(n){return Z(n)?tt(n):[]}:E,yt=ot||function(){return(new Date).getTime()};o.after=function(n,r){if(!Y(r))throw new TypeError(vr); +return n=nt(n=+n)?n:0,function(){return 1>--n?r.apply(this,arguments):void 0}},o.bind=G,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=vt(n),e=t.length,u={};++ro?0:o>>>0);return g(n,function(n){var o=u?r:null!=n&&n[r];i[++e]=o?o.apply(n,t):lr}),i},o.keys=vt,o.map=D,o.matches=fr,o.max=W,o.memoize=function(n,r){if(!Y(n)||r&&!Y(r))throw new TypeError(vr);var t={};return function(){var e=r?r.apply(this,arguments):"_"+arguments[0];return Kr.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=or(t,e,3),g(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(!Y(n))throw new TypeError(vr);return false===t?e=false:Z(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),H(n,r,{leading:e,maxWait:r,trailing:u})},o.times=function(n,r,t){n=0>n?0:n>>>0,r=l(r,t,1),t=-1;for(var e=Array(n);++tr?0:r);++nt?et(e+t,0):ut(t||0,e-1))+1);e--;)if(n[e]===r)return e; +return-1},o.mixin=ar,o.noConflict=function(){return Mr._=Cr,this},o.now=yt,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+Hr(it()*(r-n+1))},o.reduce=C,o.reduceRight=P,o.result=function(n,r){if(null!=n){var t=n[r];return Y(t)?n[r]():t}},o.size=function(n){var r=n?n.length:0;return typeof r=="number"&&-1n.indexOf(";")?n:n.replace(mr,u))},o.uniqueId=function(n){var r=++yr+"";return n?n+r:r},o.all=M,o.any=V,o.detect=$,o.foldl=C,o.foldr=P,o.include=B,o.inject=C,o.first=O,o.last=function(n,r,t){var e=n?n.length:0;return null==r||t?n?n[e-1]:lr:(r=e-(r||0),N(n,0>r?0:r))},o.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=ur(n)),null==r||t?(r=n?n.length:0,0r?0:+r||0,n.length),n) +},o.take=ct,o.head=O,ar(K({},o)),o.VERSION="2.4.1",o.prototype.chain=function(){return this.__chain__=true,this},o.prototype.value=function(){return this.__wrapped__},f("pop push reverse shift sort splice unshift".split(" "),function(n){var r=Wr[n];o.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),ft.spliceObjects||0!==n.length||delete n[0],this}}),f(["concat","join","slice"],function(n){var r=Wr[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?(Mr._=o, define("underscore",function(){return o})):Rr&&$r?Dr?($r.exports=o)._=o:Rr._=o:Mr._=o}).call(this); \ No newline at end of file