From 7dfe69f6a5e775da2c3eb07184e79d0f7e7b0c1b Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 20 Oct 2012 00:08:18 -0700 Subject: [PATCH] Reduce iterator template and `_.bindAll`. Former-commit-id: 2655b7ca336baf9e04c87ff546c4bfc614873b50 --- build.js | 18 ++----- build/pre-compile.js | 13 +++-- lodash.js | 114 +++++++++++++++------------------------ lodash.min.js | 70 ++++++++++++------------ lodash.underscore.min.js | 54 +++++++++---------- 5 files changed, 115 insertions(+), 154 deletions(-) diff --git a/build.js b/build.js index 941ea5c6a..f119ad41f 100755 --- a/build.js +++ b/build.js @@ -65,7 +65,7 @@ var dependencyMap = { 'after': [], 'bind': ['isFunction'], - 'bindAll': ['bind', 'forIn', 'isFunction'], + 'bindAll': ['bind', 'functions'], 'chain': ['mixin'], 'clone': ['extend', 'forEach', 'forOwn', 'isArguments', 'isPlainObject'], 'compact': [], @@ -164,16 +164,14 @@ var iteratorOptions = [ 'args', 'array', - 'arrayBranch', - 'beforeLoop', + 'arrayLoop', 'bottom', 'firstArg', 'hasDontEnumBug', - 'inLoop', - 'init', 'isKeysFast', + 'loop', 'object', - 'objectBranch', + 'objectLoop', 'noArgsEnum', 'noCharByIndex', 'shadowed', @@ -676,10 +674,6 @@ return removeVar(source, 'isKeysFast') // remove optimized branch in `iteratorTemplate` .replace(/(?: *\/\/.*\n)* *'( *)<% *if *\(isKeysFast[\s\S]+?'\1<% *} *else *\{ *%>.+\n([\s\S]+?) *'\1<% *} *%>.+/, "'\\n' +\n$2") - // remove `isKeysFast` from `beforeLoop.object` of `_.map` - .replace(/=\s*'\s*\+\s*\(isKeysFast.+/, "= []'") - // remove `isKeysFast` from `inLoop.object` of `_.map` - .replace(/'\s*\+\s*\(isKeysFast[^)]+?\)\s*\+\s*'/g, '.push') // remove data object property assignment in `createIterator` .replace(/ *'isKeysFast':.+\n/, ''); } @@ -791,9 +785,7 @@ // replace `useStrict` branch in `value` with hard-coded option .replace(/(?: *\/\/.*\n)*(\s*)' *<% *if *\(useStrict\).+/, value ? "$1'\\'use strict\\';\\n' +" : '') // remove `useStrict` from iterator options - .replace(/ *'useStrict': *false,\n/g, '') - // remove `useStrict` data object property assignment in `createIterator` - .replace(/ *'useStrict':.+\n/, ''); + .replace(/(?:,\s*'useStrict':[^,]+?\n| *'useStrict':[^,]+,\n)/g, ''); } /*--------------------------------------------------------------------------*/ diff --git a/build/pre-compile.js b/build/pre-compile.js index 8fb409c9f..beef79689 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -32,6 +32,7 @@ // lesser used variables 'bind', 'funcs', + 'functions', 'isArguments', 'isFunction', 'objectTypes' @@ -41,16 +42,14 @@ var iteratorOptions = [ 'args', 'array', - 'arrayBranch', - 'beforeLoop', + 'arrayLoop', 'bottom', 'firstArg', 'hasDontEnumBug', - 'inLoop', - 'init', 'isKeysFast', + 'loop', 'object', - 'objectBranch', + 'objectLoop', 'noArgsEnum', 'noCharByIndex', 'shadowed', @@ -360,9 +359,9 @@ else { // minify property name strings modified = modified.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'"); - // minify property names in regexes and accessors + // minify property names in accessors if (isCreateIterator) { - modified = modified.replace(RegExp('([\\.|/])' + property + '\\b' , 'g'), '$1' + minNames[index]); + modified = modified.replace(RegExp('\\.' + property + '\\b' , 'g'), '.' + minNames[index]); } } } diff --git a/lodash.js b/lodash.js index c0ed2491b..44bfa3531 100644 --- a/lodash.js +++ b/lodash.js @@ -310,16 +310,16 @@ // the `iteratee` may be reassigned by the `top` snippet 'var index, value, iteratee = <%= firstArg %>, ' + // assign the `result` variable an initial value - 'result = <%= init || firstArg %>;\n' + + 'result = <%= firstArg %>;\n' + // exit early if the first argument is falsey 'if (!<%= firstArg %>) return result;\n' + // add code before the iteration branches '<%= top %>;\n' + // the following branch is for iterating arrays and array-like objects - '<% if (arrayBranch) { %>' + + '<% if (arrayLoop) { %>' + 'var length = iteratee.length; index = -1;' + - ' <% if (objectBranch) { %>\nif (length === +length) {<% } %>' + + ' <% if (objectLoop) { %>\nif (typeof length == \'number\') {<% } %>' + // add support for accessing string characters by index if needed ' <% if (noCharByIndex) { %>\n' + @@ -328,17 +328,16 @@ ' }' + ' <% } %>\n' + - ' <%= arrayBranch.beforeLoop %>;\n' + ' while (++index < length) {\n' + ' value = iteratee[index];\n' + - ' <%= arrayBranch.inLoop %>\n' + + ' <%= arrayLoop %>\n' + ' }' + - ' <% if (objectBranch) { %>\n}<% } %>' + + ' <% if (objectLoop) { %>\n}<% } %>' + '<% } %>' + // the following branch is for iterating an object's own/inherited properties - '<% if (objectBranch) { %>' + - ' <% if (arrayBranch) { %>\nelse {' + + '<% if (objectLoop) { %>' + + ' <% if (arrayLoop) { %>\nelse {' + // add support for iterating over `arguments` objects if needed ' <% } else if (noArgsEnum) { %>\n' + @@ -346,7 +345,7 @@ ' if (length && isArguments(iteratee)) {\n' + ' while (++index < length) {\n' + ' value = iteratee[index += \'\'];\n' + - ' <%= objectBranch.inLoop %>\n' + + ' <%= objectLoop %>\n' + ' }\n' + ' } else {' + ' <% } %>' + @@ -367,18 +366,16 @@ ' var ownIndex = -1,\n' + ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' + ' length = ownProps.length;\n\n' + - ' <%= objectBranch.beforeLoop %>;\n' + ' while (++ownIndex < length) {\n' + ' index = ownProps[ownIndex];\n' + ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' + ' value = iteratee[index];\n' + - ' <%= objectBranch.inLoop %>\n' + + ' <%= objectLoop %>\n' + ' <% if (!hasDontEnumBug) { %>}\n<% } %>' + ' }' + // else using a for-in loop ' <% } else { %>\n' + - ' <%= objectBranch.beforeLoop %>;\n' + ' for (index in iteratee) {<%' + ' if (!hasDontEnumBug || useHas) { %>\n if (<%' + ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + @@ -387,7 +384,7 @@ ' %>) {' + ' <% } %>\n' + ' value = iteratee[index];\n' + - ' <%= objectBranch.inLoop %>;' + + ' <%= objectLoop %>;' + ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' + ' }' + ' <% } %>' + @@ -405,11 +402,11 @@ ' %>!(ctor && ctor.prototype === iteratee) && <%' + ' } %>hasOwnProperty.call(iteratee, index)) {\n' + ' value = iteratee[index];\n' + - ' <%= objectBranch.inLoop %>\n' + + ' <%= objectLoop %>\n' + ' }' + ' <% } %>' + ' <% } %>' + - ' <% if (arrayBranch || noArgsEnum) { %>\n}<% } %>' + + ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>' + '<% } %>\n' + // add code to the bottom of the iteration function @@ -424,7 +421,7 @@ var forEachIteratorOptions = { 'args': 'collection, callback, thisArg', 'top': 'callback = createCallback(callback, thisArg)', - 'inLoop': 'if (callback(value, index, collection) === false) return result' + 'loop': 'if (callback(value, index, collection) === false) return result' }; /** Reusable iterator options for `defaults`, and `extend` */ @@ -435,15 +432,14 @@ 'top': 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' + ' if (iteratee = arguments[argsIndex]) {', - 'inLoop': 'result[index] = value', + 'objectLoop': 'result[index] = value', 'bottom': ' }\n}' }; /** Reusable iterator options for `forIn` and `forOwn` */ var forOwnIteratorOptions = { - 'inLoop': { - 'object': forEachIteratorOptions.inLoop - } + 'loop': null, + 'objectLoop': forEachIteratorOptions.loop }; /*--------------------------------------------------------------------------*/ @@ -594,48 +590,35 @@ } /** - * Creates compiled iteration functions. The iteration function will be created - * to iterate over only objects if the first argument of `options.args` is - * "object" or `options.inLoop.array` is falsey. + * Creates compiled iteration functions. * * @private * @param {Object} [options1, options2, ...] The compile options objects. * * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. - * * useStrict - A boolean to specify including the "use strict" directive. - * * args - A string of comma separated arguments the iteration function will accept. - * - * init - A string to specify the initial value of the `result` variable. - * * top - A string of code to execute before the iteration branches. - * - * beforeLoop - A string or object containing an "array" or "object" property - * of code to execute before the array or object loops. - * - * inLoop - A string or object containing an "array" or "object" property - * of code to execute in the array or object loops. - * - * bottom - A string of code to execute after the iteration branches but - * before the `result` is returned. + * arrayLoop - A string of code to execute in the array loop. + * objectLoop - A string of code to execute in the object loop. + * loop - A string of code to execute in the array or object loops. + * bottom - A string of code to execute after the iteration branches. * * @returns {Function} Returns the compiled function. */ function createIterator() { var data = { + 'arrayLoop': '', 'bottom': '', 'hasDontEnumBug': hasDontEnumBug, - 'init': '', 'isKeysFast': isKeysFast, + 'objectLoop': '', 'noArgsEnum': noArgsEnum, 'noCharByIndex': noCharByIndex, 'shadowed': shadowed, 'top': '', 'useHas': true, - 'useStrict': isStrictFast, - 'arrayBranch': { 'beforeLoop': '' }, - 'objectBranch': { 'beforeLoop': '' } + 'useStrict': isStrictFast }; var object, @@ -645,13 +628,9 @@ while (object = arguments[++index]) { for (var prop in object) { var value = object[prop]; - // keep this regexp explicit for the build pre-process - if (/beforeLoop|inLoop/.test(prop)) { - if (typeof value == 'string') { - value = { 'array': value, 'object': value }; - } - data.arrayBranch[prop] = value.array; - data.objectBranch[prop] = value.object; + if (prop == 'loop') { + data.arrayLoop = value; + data.objectLoop = value; } else { data[prop] = value; } @@ -659,21 +638,17 @@ } // set additional template `data` properties var args = data.args; - if ((data.firstArg = /^[^,]+/.exec(args)[0]) != 'collection' || !data.arrayBranch.inLoop) { - data.arrayBranch = null; - } - if (!data.objectBranch.inLoop) { - data.objectBranch = null; - } + data.firstArg = /^[^,]+/.exec(args)[0]; + // create the function factory var factory = Function( - 'bind, createCallback, forIn, hasOwnProperty, isArguments, isFunction, ' + + 'bind, createCallback, functions, hasOwnProperty, isArguments, isFunction, ' + 'objectTypes, nativeKeys, propertyIsEnumerable, stringClass, toString', 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' ); // return the compiled function return factory( - bind, createCallback, forIn, hasOwnProperty, isArguments, isFunction, + bind, createCallback, functions, hasOwnProperty, isArguments, isFunction, objectTypes, nativeKeys, propertyIsEnumerable, stringClass, toString ); } @@ -1082,7 +1057,7 @@ * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } */ var defaults = createIterator(extendIteratorOptions, { - 'inLoop': 'if (result[index] == null) ' + extendIteratorOptions.inLoop + 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop }); /** @@ -1250,7 +1225,7 @@ if ((className == arrayClass || className == stringClass || className == argsClass || (noArgsClass && isArguments(value))) || - (className == objectClass && length === +length && isFunction(value.splice))) { + (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { return !length; } forOwn(value, function() { @@ -1856,7 +1831,7 @@ */ function contains(collection, target) { var length = collection ? collection.length : 0; - if (length === +length) { + if (typeof length == 'number') { return (toString.call(collection) == stringClass ? collection.indexOf(target) : indexOf(collection, target) @@ -2383,7 +2358,7 @@ */ function size(collection) { var length = collection ? collection.length : 0; - return length === +length ? length : keys(collection).length; + return typeof length == 'number' ? length : keys(collection).length; } /** @@ -2476,8 +2451,7 @@ if (!collection) { return []; } - var length = collection.length; - if (length === +length) { + if (typeof collection.length == 'number') { return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string') ? collection.split('') : slice.call(collection); @@ -3212,17 +3186,13 @@ 'args': 'object', 'top': 'var funcs = arguments,\n' + - ' length = funcs.length;\n' + - 'if (length > 1) {\n' + - ' while (--length) {\n' + - ' index = funcs[length];\n' + - ' result[index] = bind(result[index], result)\n' + - ' }\n' + - ' return result\n' + + ' index = funcs.length > 1 ? 0 : (funcs = functions(object), -1),\n' + + ' length = funcs.length;' + + 'while (++index < length) {\n' + + ' value = funcs[index];\n' + + ' result[value] = bind(result[value], result)\n' + '}\n' + - 'forIn(result, function(value, key) {\n' + - ' if (isFunction(value)) result[key] = bind(value, result)\n' + - '})' + 'return result' }); /** diff --git a/lodash.min.js b/lodash.min.js index 3d88ac7ff..e2501e919 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -3,38 +3,38 @@ Underscore.js 1.4.2 underscorejs.org/LICENSE */ ;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||J),s=i?{}:e;if(i)for(n=t-1;++nn||e===t)return 1;if(es;s++)i+="h='"+e.o[s]+"';if(","constructor"==e.o[s]&&(i+="!(f&&f.prototype===i)&&"),i+="g.call(i,h)){u=i[h];"+ -e.l.h+"}"}if(e.c||e.m)i+="}"}return i+=e.e+";return p",Function("v,e,forIn,g,x,y,z,k,o,r,t","return function("+t+"){"+i+"}")(R,f,Yt,ht,v,m,$t,wt,dt,Mt,mt)}function c(e){return"\\"+Jt[e]}function h(e){return nn[e]}function p(){}function d(e){return rn[e]}function v(e){return mt.call(e)==Tt}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Rt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!m(n)||n instanceof -n)?Bt?(Yt(e,function(e,n,r){return t=!ht.call(r,n),i}),t===i):(Yt(e,function(e,n){t=n}),t===i||ht.call(e,t)):t}function y(e){var t=[];return Zt(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=$t[typeof e]){var u=mt.call(e);if(!Vt[u]||Ft&&v(e))return e;var a=u==Nt,n=a||(u==At?tn(e):n)}if(!n||!t)return n?a?vt.call(e):on({},e):e;n=e.constructor;switch(u){case Ct:case kt:return new n(+e);case Lt:case Mt:return new n(e);case Ot:return n(e.source,tt.exec(e))}s||(s=[]) -,o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?an:Zt)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return Yt(e,function(e,n){m(e)&&t.push(n)}),t.sort()}function E(e){var t={};return Zt(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=mt.call(e);if(u!=mt.call(t))return i;switch(u){case Ct:case kt:return+e==+t;case Lt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ot -:case Mt:return e==t+""}var a=u==Nt||u==Tt;if(Ft&&!a&&(a=v(e))&&!v(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=At||Rt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!m(u)||!(u instanceof u&&m(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push( -t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=S(e[l],t[l],s,o)););return f}for(var c in e)if(ht.call(e,c)&&(l++,!ht.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(ht.call(t,c)&&!(l--))return i;if(Pt)for(;7>++u;)if(c=ut[u],ht.call(e,c)&&(!ht.call(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e,t,n){var i=arguments,s=0,o=2,a=i[3],f=i[4];n!=u&&(a=[],f=[],o=i.length);for(;++sr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function M(e,t){var n=[];return an(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var s=3>arguments.length,t=f(t,r); -return an(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function D(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=un(e),o=a.length;else qt&&mt.call(e)==Mt&&(s=e.split(""));return an(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function P(e,t,n){var r,t=f(t,n);return an(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function H(e,t,n){if(e)return t==r||n?e[0]:vt.call(e,0,t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++nn?Et(0,i+n):n||0)-1;else if(n)return r=I(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])>>1,e[r]j(a,r))a.push(r),u.push(e[s]);return u}function R(e,t){return zt||gt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,G=/&(?:amp|lt|gt|quot|#x27);/g,Y=/\b__p\+='';/g,Z=/\b(__p\+=)''\+/g,et=/(__e\(.*?\)|\b__t\))\+'';/g,tt=/\w*$/,nt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,rt=RegExp("^"+(V.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),it=/($^)/,st=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g -,ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),at=Math.ceil,ft=X.concat,lt=Math.floor,ct=rt.test(ct=Object.getPrototypeOf)&&ct,ht=V.hasOwnProperty,pt=X.push,dt=V.propertyIsEnumerable,vt=X.slice,mt=V.toString,gt=rt.test(gt=vt.bind)&>,yt=rt.test(yt=Array.isArray)&&yt,bt=e.isFinite,wt=rt.test(wt=Object.keys)&&wt,Et=Math.max,St=Math.min,xt=Math.random,Tt="[object Arguments]",Nt="[object Array]",Ct="[object Boolean]",kt="[object Date]", -Lt="[object Number]",At="[object Object]",Ot="[object RegExp]",Mt="[object String]",_t=e.clearTimeout,Dt=e.setTimeout,Pt,Ht,Bt,jt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)jt=!r;Pt=4>(n+"").length,Bt="x"!=n[0],Ht=(n.splice.call(t,0,1),t[0])})(1);var Ft=!v(arguments),It="x"!=vt.call("x")[0],qt="xx"!="x"[0]+Object("x")[0];try{var Rt=("[object Object]",mt.call(e.document||0)==At)}catch(Ut){}var zt=gt&&/\n|Opera/ -.test(gt+mt.call(e.opera)),Wt=wt&&/^.+$|true/.test(wt+!!e.attachEvent),Xt=!zt,Vt={};Vt[Tt]=Vt["[object Function]"]=i,Vt[Nt]=Vt[Ct]=Vt[kt]=Vt[Lt]=Vt[At]=Vt[Ot]=Vt[Mt]=n;var $t={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Kt={a:"d,c,s",p:"c=e(c,s)",h:"if(c(u,h,d)===false)return p" -},Qt={q:i,r:i,a:"l",p:"for(var a=1,b=arguments.length;a":">",'"' -:""","'":"'"},rn=E(nn),sn=l(Qt,{h:"if(p[h]==null)"+Qt.h}),on=l(Qt),un=wt?function(e){var t=typeof e;return"function"==t&&dt.call(e,"prototype")?y(e):e&&$t[t]?wt(e):[]}:y,an=l(Kt),fn=l({r:i,a:"l",p:"var w=arguments,j=w.length;if(j>1){while(--j){h=w[j];p[h]=v(p[h],p)}return p}forIn(p,function(u,key){if(y(u))p[key]=v(u,p)})"});s.VERSION="0.8.2",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=R,s.bindAll=fn,s.chain=function(e){return e=new s( -e),e.__chain__=n,e},s.clone=b,s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++tj(s,u)){for(var a=1;an?Et(0,r+n):St(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,vt.call(arguments,2))},s.map=A,s.max=O,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return ht.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=x,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+ -s)t=f(t,n),an(e,function(e,n,i){n=t(e,n,i),nj(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e -.apply(this,arguments),e=r,t)}},s.pairs=function(e){var t=[];return Zt(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return a(e,vt.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=ft.apply(X,arguments),o=s.length;++i=f?(_t(u),a=r,s=e.apply(o,i)):u||(u=Dt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rj(r,i)&&r.push(i)}return r},s.uniq=q,s.uniqueId=function(e){var t=$++;return e?e+t:t},s.values=T,s.where=function(e,t){var n=[];Yt(t,function(e,t){n.push(t)});var r=n.length,i=[];return an(e,function(e){for(var s=-1;++si;i++)r+="h='"+e.m[i]+"';if(","constructor"==e.m[i]&&(r+="!(f&&f.prototype===i)&&"),r+="g.call(i,h)){u=i[h];"+e.j+"}"}if(e.c||e.k)r+="}"}return r+=e.d+";return p",Function("v,e,x,g,y,z,A,k,o,r,t","return function("+ +t+"){"+r+"}")(R,f,w,ht,v,m,$t,wt,dt,Mt,mt)}function c(e){return"\\"+Jt[e]}function h(e){return nn[e]}function p(){}function d(e){return rn[e]}function v(e){return mt.call(e)==Tt}function m(e){return"function"==typeof e}function g(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Rt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!m(n)||n instanceof n)?Bt?(Yt(e,function(e,n,r){return t=!ht.call(r,n),i}),t===i):(Yt(e,function(e,n){t=n}),t===i||ht.call(e,t)): +t}function y(e){var t=[];return Zt(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=$t[typeof e]){var u=mt.call(e);if(!Vt[u]||Ft&&v(e))return e;var a=u==Nt,n=a||(u==At?tn(e):n)}if(!n||!t)return n?a?vt.call(e):on({},e):e;n=e.constructor;switch(u){case Ct:case kt:return new n(+e);case Lt:case Mt:return new n(e);case Ot:return n(e.source,tt.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?an +:Zt)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return Yt(e,function(e,n){m(e)&&t.push(n)}),t.sort()}function E(e){var t={};return Zt(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=mt.call(e);if(u!=mt.call(t))return i;switch(u){case Ct:case kt:return+e==+t;case Lt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ot:case Mt:return e==t+""}var a=u==Nt||u==Tt;if(Ft&&!a&&(a=v(e))&&!v(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__ +)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=At||Rt&&("function"!=typeof e.toString&&"string"==typeof (e+"")||"function"!=typeof t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!m(u)||!(u instanceof u&&m(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=S(e[l],t[l],s,o)););return f}for(var c in e)if(ht.call(e,c)&&(l++,! +ht.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(ht.call(t,c)&&!(l--))return i;if(Pt)for(;7>++u;)if(c=ut[u],ht.call(e,c)&&(!ht.call(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e,t,n){var i=arguments,s=0,o=2,a=i[3],f=i[4];n!=u&&(a=[],f=[],o=i.length);for(;++sr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function M(e,t){var n=[];return an(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var s=3>arguments.length,t=f(t,r);return an(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function D(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length +;if(o!==+o)var a=un(e),o=a.length;else qt&&mt.call(e)==Mt&&(s=e.split(""));return an(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function P(e,t,n){var r,t=f(t,n);return an(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function H(e,t,n){if(e)return t==r||n?e[0]:vt.call(e,0,t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++nn?Et(0,i+n):n||0 +)-1;else if(n)return r=I(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])>>1,e[r]j(a,r))a.push(r),u.push(e[s]);return u}function R(e,t) +{return zt||gt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,G=/&(?:amp|lt|gt|quot|#x27);/g,Y=/\b__p\+='';/g,Z=/\b(__p\+=)''\+/g,et=/(__e\(.*?\)|\b__t\))\+'';/g,tt=/\w*$/,nt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,rt=RegExp("^"+(V.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),it=/($^)/,st=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,ut="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf" +.split(" "),at=Math.ceil,ft=X.concat,lt=Math.floor,ct=rt.test(ct=Object.getPrototypeOf)&&ct,ht=V.hasOwnProperty,pt=X.push,dt=V.propertyIsEnumerable,vt=X.slice,mt=V.toString,gt=rt.test(gt=vt.bind)&>,yt=rt.test(yt=Array.isArray)&&yt,bt=e.isFinite,wt=rt.test(wt=Object.keys)&&wt,Et=Math.max,St=Math.min,xt=Math.random,Tt="[object Arguments]",Nt="[object Array]",Ct="[object Boolean]",kt="[object Date]",Lt="[object Number]",At="[object Object]",Ot="[object RegExp]",Mt="[object String]",_t=e.clearTimeout +,Dt=e.setTimeout,Pt,Ht,Bt,jt=n;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);for(r in arguments)jt=!r;Pt=4>(n+"").length,Bt="x"!=n[0],Ht=(n.splice.call(t,0,1),t[0])})(1);var Ft=!v(arguments),It="x"!=vt.call("x")[0],qt="xx"!="x"[0]+Object("x")[0];try{var Rt=("[object Object]",mt.call(e.document||0)==At)}catch(Ut){}var zt=gt&&/\n|Opera/.test(gt+mt.call(e.opera)),Wt=wt&&/^.+$|true/.test(wt+!!e.attachEvent),Xt=!zt,Vt={};Vt[Tt]=Vt["[object Function]" +]=i,Vt[Nt]=Vt[Ct]=Vt[kt]=Vt[Lt]=Vt[At]=Vt[Ot]=Vt[Mt]=n;var $t={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Jt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Kt={a:"d,c,s",n:"c=e(c,s)",h:"if(c(u,h,d)===false)return p"},Qt={o:i,p:i,a:"l",n:"for(var a=1,b=arguments.length;a":">",'"':""","'":"'"},rn=E(nn),sn=l(Qt,{j:"if(p[h]==null)"+Qt.j}),on=l(Qt),un=wt?function(e){var t=typeof +e;return"function"==t&&dt.call(e,"prototype")?y(e):e&&$t[t]?wt(e):[]}:y,an=l(Kt),fn=l({p:i,a:"l",n:"var w=arguments,h=w.length>1?0:(w=x(l),-1),j=w.length;while(++he?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=R,s.bindAll=fn,s.chain=function(e){return e=new s(e),e.__chain__=n,e},s.clone=b,s.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++tj(s,u)){for(var a=1;an?Et(0,r+n):St(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return a(t,e,vt.call(arguments,2))},s.map=A,s.max=O,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return ht.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=x,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||s!==+s)t=f(t,n),an(e,function(e,n,i){n=t(e,n,i),nj(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=function(e){var t=[];return Zt(e,function(e,n){t.push([n,e])}),t},s.partial=function(e) +{return a(e,vt.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=ft.apply(X,arguments),o=s.length;++i=f?(_t(u),a=r,s=e.apply(o,i)):u||(u=Dt(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rj(r,i)&&r.push(i)}return r},s.uniq=q,s.uniqueId=function(e){var t=$++;return e?e+t:t},s.values=T,s.where=function(e,t){var n=[];Yt(t,function(e,t){n.push(t)});var r=n.length,i=[];return an(e,function(e){for(var s=-1;++sn||e===t)return 1;if(er&&(r=n,u=e)});else for(;++iu&&(u=e[i -]);return u}function M(e,t){var n=[];return s(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var o=3>arguments.length,t=p(t,r);return s(e,function(e,r,s){n=o?(o=i,e):t(n,e,r,s)}),n}function D(e,t,n,r){var o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=Ot(e),o=a.length;return s(e,function(s,f,l){f=a?a[--o]:--o,n=u?(u=i,e[f]):t.call(r,n,e[f],f,l)}),n}function P(e,t,n){var r,t=p(t,n);return s(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function H(e,t,n){if(e)return t==r||n?e[0]:st.call(e,0, -t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++nn?ct(0,i+n):n||0)-1;else if(n)return r=I(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])>>1,e[r]j(a,r))a.push(r),u.push(e[s]);return u}function R(e,t){return Tt||ut&&2"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,et=Math.ceil,tt=X.concat,nt=Math.floor,rt=V.hasOwnProperty,it=X.push,st=X.slice,ot=V.toString,ut=Q.test( -ut=st.bind)&&ut,at=Q.test(at=Array.isArray)&&at,ft=e.isFinite,lt=Q.test(lt=Object.keys)&<,ct=Math.max,ht=Math.min,pt=Math.random,dt="[object Array]",vt="[object Boolean]",mt="[object Date]",gt="[object Number]",yt="[object Object]",bt="[object RegExp]",wt="[object String]",Et=e.clearTimeout,St=e.setTimeout,xt;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);xt=(n.splice.call(t,0,1),t[0])})(1);var Tt=ut&&/\n|Opera/.test(ut+ot.call(e -.opera)),Nt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Ct={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};l.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},l.isArguments=function(e){return"[object Arguments]"==ot.call(e)},l.isArguments(arguments)||(l.isArguments=function(e){return e?rt.call(e,"callee"):i});var kt=at||function(e){return ot.call(e)==dt};y(/x/)&&(y=function( -e){return"[object Function]"==ot.call(e)});var Lt={"&":"&","<":"<",">":">",'"':""","'":"'"},At=E(Lt),Ot=lt?function(e){return e&&Nt[typeof e]?lt(e):[]}:b;l.VERSION="0.8.2",l.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},l.bind=R,l.bindAll=function(e){var t,n=e;if(!e)return n;var r=arguments,i=r.length;if(1j(r,s,n)&&i.push(s)}return i},l.escape=function(e){return e==r?"":(e+"").replace(Y,v)},l. -every=C,l.extend=o,l.filter=k,l.find=L,l.first=H,l.flatten=B,l.forEach=s,l.functions=w,l.groupBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),(rt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},l.has=function(e,t){return e?rt.call(e,t):i},l.identity=U,l.indexOf=j,l.initial=function(e,t,n){return e?st.call(e,0,-(t==r||n?1:t)):[]},l.intersection=function(e){var t=arguments.length,n=-1,r=e.length,i=[];e:for(;++nj(i,s)){for(var o=1;oj(arguments[o],s))continue e -;i.push(s)}}return i},l.invert=E,l.invoke=function(e,t){var n=st.call(arguments,2),r="function"==typeof t,i=[];return s(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},l.isArray=kt,l.isBoolean=function(e){return e===n||e===i||ot.call(e)==vt},l.isDate=function(e){return ot.call(e)==mt},l.isElement=function(e){return e?1===e.nodeType:i},l.isEmpty=function(e){if(!e)return n;if(kt(e)||x(e))return!e.length;for(var t in e)if(rt.call(e,t))return i;return n},l.isEqual=S,l.isFinite=function(e){return ft( -e)&&ot.call(e)==gt},l.isFunction=y,l.isNaN=function(e){return ot.call(e)==gt&&e!=+e},l.isNull=function(e){return e===r},l.isNumber=function(e){return ot.call(e)==gt},l.isObject=function(e){return e?Nt[typeof e]:i},l.isRegExp=function(e){return ot.call(e)==bt},l.isString=x,l.isUndefined=function(e){return e===t},l.keys=Ot,l.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:st.call(e,-t||i)}},l.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?ct(0,r+n):ht -(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},l.map=A,l.max=O,l.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return rt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},l.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||o!==+o)t=p(t,n),s(e,function(e,n,i){n=t(e,n,i),nj(t,r,1)&&(n[r]=e)}),n},l.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},l.pairs=function(e){var t=[];return a(e,function(e,n){t.push([n,e])}),t},l.pick=function(e){for(var t=0,n=tt.apply(X,arguments),r=n.length,i={};++t=f?(Et(u),a=r,s=e.apply(o,i)):u||(u=St(n,f)),s}},l.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rj(r,i)&&r.push(i)}return r},l.uniq=q,l.uniqueId=function(e){var t=$++;return e? -e+t:t},l.values=T,l.where=function(e,t){var n=[];f(t,function(e,t){n.push(t)});var r=n.length,i=[];return s(e,function(e){for(var s=-1;++sj(arguments,i,1)&&r.push(i)}return r},l.wrap=function(e,t){return function(){var n=[e];return arguments.length&&it.apply(n,arguments),t.apply(this,n)}},l.zip=function(e){for(var t=-1,n=e?O(M(arguments,"length")):0,r=Array(n);++tn||e===t)return 1;if(er&&(r=n,u=e)});else for(;++i< +o;)e[i]>u&&(u=e[i]);return u}function M(e,t){var n=[];return s(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var o=3>arguments.length,t=p(t,r);return s(e,function(e,r,s){n=o?(o=i,e):t(n,e,r,s)}),n}function D(e,t,n,r){var o=e?e.length:0,u=3>arguments.length;if(o!==+o)var a=Ot(e),o=a.length;return s(e,function(s,f,l){f=a?a[--o]:--o,n=u?(u=i,e[f]):t.call(r,n,e[f],f,l)}),n}function P(e,t,n){var r,t=p(t,n);return s(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function H(e,t,n){if(e)return t==r||n? +e[0]:st.call(e,0,t)}function B(e,t){for(var n=-1,r=e?e.length:0,i=[];++nn?ct(0,i+n):n||0)-1;else if(n)return r=I(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])>>1,e[r]j(a,r))a.push(r),u.push(e[s]);return u}function R(e,t){return Tt||ut&&2"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,et=Math.ceil,tt=X.concat,nt=Math.floor,rt=V.hasOwnProperty,it=X.push,st=X.slice,ot=V.toString +,ut=Q.test(ut=st.bind)&&ut,at=Q.test(at=Array.isArray)&&at,ft=e.isFinite,lt=Q.test(lt=Object.keys)&<,ct=Math.max,ht=Math.min,pt=Math.random,dt="[object Array]",vt="[object Boolean]",mt="[object Date]",gt="[object Number]",yt="[object Object]",bt="[object RegExp]",wt="[object String]",Et=e.clearTimeout,St=e.setTimeout,xt;(function(){function e(){this.x=1}var t={0:1,length:1},n=[];e.prototype={valueOf:1,y:1};for(var r in new e)n.push(r);xt=(n.splice.call(t,0,1),t[0])})(1);var Tt=ut&&/\n|Opera/.test(ut+ +ot.call(e.opera)),Nt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i,unknown:n},Ct={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};l.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},l.isArguments=function(e){return"[object Arguments]"==ot.call(e)},l.isArguments(arguments)||(l.isArguments=function(e){return e?rt.call(e,"callee"):i});var kt=at||function(e){return ot.call(e)==dt};y(/x/ +)&&(y=function(e){return"[object Function]"==ot.call(e)});var Lt={"&":"&","<":"<",">":">",'"':""","'":"'"},At=E(Lt),Ot=lt?function(e){return e&&Nt[typeof e]?lt(e):[]}:b;l.VERSION="0.8.2",l.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},l.bind=R,l.bindAll=function(e){var t,n,r=e;if(!e)return r;var i=arguments;t=1j(r,s,n)&&i.push(s)}return i},l.escape=function(e){return e==r?"":(e+"").replace(Y,v)},l.every=C,l.extend= +o,l.filter=k,l.find=L,l.first=H,l.flatten=B,l.forEach=s,l.functions=w,l.groupBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),(rt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},l.has=function(e,t){return e?rt.call(e,t):i},l.identity=U,l.indexOf=j,l.initial=function(e,t,n){return e?st.call(e,0,-(t==r||n?1:t)):[]},l.intersection=function(e){var t=arguments.length,n=-1,r=e.length,i=[];e:for(;++nj(i,s)){for(var o=1;oj(arguments[o],s))continue e;i.push( +s)}}return i},l.invert=E,l.invoke=function(e,t){var n=st.call(arguments,2),r="function"==typeof t,i=[];return s(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},l.isArray=kt,l.isBoolean=function(e){return e===n||e===i||ot.call(e)==vt},l.isDate=function(e){return ot.call(e)==mt},l.isElement=function(e){return e?1===e.nodeType:i},l.isEmpty=function(e){if(!e)return n;if(kt(e)||x(e))return!e.length;for(var t in e)if(rt.call(e,t))return i;return n},l.isEqual=S,l.isFinite=function(e){return ft(e)&&ot.call +(e)==gt},l.isFunction=y,l.isNaN=function(e){return ot.call(e)==gt&&e!=+e},l.isNull=function(e){return e===r},l.isNumber=function(e){return ot.call(e)==gt},l.isObject=function(e){return e?Nt[typeof e]:i},l.isRegExp=function(e){return ot.call(e)==bt},l.isString=x,l.isUndefined=function(e){return e===t},l.keys=Ot,l.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:st.call(e,-t||i)}},l.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?ct(0,r+n):ht(n,r-1))+1) +;r--;)if(e[r]===t)return r;return-1},l.map=A,l.max=O,l.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return rt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},l.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||o!==+o)t=p(t,n),s(e,function(e,n,i){n=t(e,n,i),nj(t,r,1)&&(n[r]=e)}),n},l.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},l.pairs=function(e){var t=[];return a(e,function(e,n){t.push([n,e])}),t},l.pick=function(e){for(var t=0,n=tt.apply(X,arguments),r=n.length,i={};++t=f?(Et(u),a=r,s=e.apply(o,i)):u||(u=St(n,f)),s}},l.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++rj(r,i)&&r.push(i)}return r},l.uniq=q,l.uniqueId=function(e){var t=$++;return e?e+t: +t},l.values=T,l.where=function(e,t){var n=[];f(t,function(e,t){n.push(t)});var r=n.length,i=[];return s(e,function(e){for(var s=-1;++sj(arguments,i,1)&&r.push(i)}return r},l.wrap=function(e,t){return function(){var n=[e];return arguments.length&&it.apply(n,arguments),t.apply(this,n)}},l.zip=function(e){for(var t=-1,n=e?O(M(arguments,"length")):0,r=Array(n);++t