From 2712f17262df10435d04f476964e74d74863cfd5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 6 Nov 2012 03:04:36 -0800 Subject: [PATCH] Tweak capturing spaces in build.js regexes and update lodash.min.js. Former-commit-id: a5d30941945150251a6fc4342840d906a3af1ad9 --- build.js | 54 ++++++++++++++++++++-------------------- lodash.min.js | 68 +++++++++++++++++++++++++-------------------------- 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/build.js b/build.js index 3d9a2e3a2..1fc34370b 100755 --- a/build.js +++ b/build.js @@ -469,7 +469,7 @@ * @returns {String} Returns the `isArguments` fallback. */ function getIsArgumentsFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( +)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0]; + return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(noArgsClass\)[\s\S]+?};\n\1}/) || [''])[0]; } /** @@ -480,7 +480,7 @@ * @returns {String} Returns the `isFunction` fallback. */ function getIsFunctionFallback(source) { - return (source.match(/(?:\s*\/\/.*)*\n( +)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0]; + return (source.match(/(?:\s*\/\/.*)*\n( *)if *\(isFunction\(\/x\/[\s\S]+?};\n\1}/) || [''])[0]; } /** @@ -538,11 +538,11 @@ // begin non-capturing group '(?:' + // match a function declaration - '( +)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + + '( *)function ' + funcName + '\\b[\\s\\S]+?\\n\\1}|' + // match a variable declaration with `createIterator` ' +var ' + funcName + ' *=.*?createIterator\\((?:{|[a-zA-Z])[\\s\\S]+?\\);|' + // match a variable declaration with function expression - '( +)var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\2};' + + '( *)var ' + funcName + ' *=.*?function[\\s\\S]+?\\n\\2};' + // end non-capturing group ')\\n' )); @@ -728,7 +728,7 @@ // match multi-line comment block '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + // match a variable declaration that's not part of a declaration list - '( +)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' + + '( *)var ' + varName + ' *= *(?:.+?(?:;|&&\\n[^;]+;)|(?:\\w+\\(|{)[\\s\\S]+?\\n\\1.+?;)\\n|' + // match a variable in a declaration list '\\n +' + varName + ' *=.+?,' ), ''); @@ -757,7 +757,7 @@ function replaceVar(source, varName, varValue) { // replace a variable that's not part of a declaration list var result = source.replace(RegExp( - '(( +)var ' + varName + ' *= *)' + + '(( *)var ' + varName + ' *= *)' + '(?:.+?;|(?:Function\\(.+?|.*?[^,])\\n[\\s\\S]+?\\n\\2.+?;)\\n' ), '$1' + varValue + ';\n'); @@ -1057,7 +1057,7 @@ // replace `_.clone` if (useUnderscoreClone) { - source = source.replace(/^( +)function clone[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function clone[\s\S]+?\n\1}/m, [ ' function clone(value) {', ' return value && objectTypes[typeof value]', ' ? (isArray(value) ? slice.call(value) : extend({}, value))', @@ -1067,7 +1067,7 @@ } // replace `_.contains` - source = source.replace(/^( +)function contains[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function contains[\s\S]+?\n\1}/m, [ ' function contains(collection, target) {', ' var length = collection ? collection.length : 0;', " return typeof length == 'number'", @@ -1077,7 +1077,7 @@ ].join('\n')); // replace `_.difference` - source = source.replace(/^( +)function difference[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function difference[\s\S]+?\n\1}/m, [ ' function difference(array) {', ' var index = -1,', ' length = array.length,', @@ -1095,7 +1095,7 @@ ].join('\n')); // replace `_.intersection` - source = source.replace(/^( +)function intersection[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function intersection[\s\S]+?\n\1}/m, [ ' function intersection(array) {', ' var args = arguments,', ' argsLength = args.length,', @@ -1117,7 +1117,7 @@ ].join('\n')); // replace `_.isEmpty` - source = source.replace(/^( +)function isEmpty[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function isEmpty[\s\S]+?\n\1}/m, [ ' function isEmpty(value) {', ' if (!value) {', ' return true;', @@ -1135,14 +1135,14 @@ ].join('\n')); // replace `_.isFinite` - source = source.replace(/^( +)function isFinite[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function isFinite[\s\S]+?\n\1}/m, [ ' function isFinite(value) {', ' return nativeIsFinite(value) && toString.call(value) == numberClass;', ' }' ].join('\n')); // replace `_.omit` - source = source.replace(/^( +)function omit[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function omit[\s\S]+?\n\1}/m, [ ' function omit(object) {', ' var props = concat.apply(arrayRef, arguments),', ' result = {};', @@ -1157,7 +1157,7 @@ ].join('\n')); // replace `_.pick` - source = source.replace(/^( +)function pick[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function pick[\s\S]+?\n\1}/m, [ ' function pick(object) {', ' var index = 0,', ' props = concat.apply(arrayRef, arguments),', @@ -1175,7 +1175,7 @@ ].join('\n')); // replace `_.uniq` - source = source.replace(/^( +)function uniq[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function uniq[\s\S]+?\n\1}/m, [ ' function uniq(array, isSorted, callback, thisArg) {', ' var index = -1,', ' length = array ? array.length : 0,', @@ -1205,7 +1205,7 @@ ].join('\n')); // replace `_.without` - source = source.replace(/^( +)function without[\s\S]+?\n\1}/m, [ + source = source.replace(/^( *)function without[\s\S]+?\n\1}/m, [ ' function without(array) {', ' var index = -1,', ' length = array.length,', @@ -1228,7 +1228,7 @@ source = source.replace(/(if *\(className *!= *objectClass).+?noNodeClass[\s\S]+?{/, '$1) {'); // remove string collection callback definition from `_.max` and `_.min` - source = source.replace(/( +)if *\(!callback *&& *isString\(collection\)\)[\s\S]+?\n\1}\n/g, ''); + source = source.replace(/( *)if *\(!callback *&& *isString\(collection\)\)[\s\S]+?\n\1}\n/g, ''); // remove unused features from `createBound` if (buildMethods.indexOf('partial') == -1) { @@ -1244,7 +1244,7 @@ source = removeKeysOptimization(source); // remove `prototype` [[Enumerable]] fix from `_.keys` - source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(.+?propertyIsEnumerable[\s\S]+?\n\1}/, ''); + source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(.+?propertyIsEnumerable[\s\S]+?\n\1}/, ''); // remove `prototype` [[Enumerable]] fix from `iteratorTemplate` source = source @@ -1397,7 +1397,7 @@ }); // replace `_.template` - source = source.replace(/^( +)function template[\s\S]+?\n\1}/m, function() { + source = source.replace(/^( *)function template[\s\S]+?\n\1}/m, function() { return [ ' function template(text, data, options) {', " text || (text = '');", @@ -1461,7 +1461,7 @@ source = removeVar(source, 'hasObjectSpliceBug'); // remove `hasObjectSpliceBug` fix from the mutator Array functions mixin - source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(hasObjectSpliceBug[\s\S]+?\n\1}/, ''); + source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?\n\1}/, ''); } // remove `thisArg` from unexposed `forIn` and `forOwn` @@ -1482,10 +1482,10 @@ .replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *var (?:hasDontEnumBug|iteratesOwnLast|noArgsEnum).+\n/g, ''); // remove `iteratesOwnLast` from `isPlainObject` - source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(iteratesOwnLast[\s\S]+?\n\1}/, ''); + source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(iteratesOwnLast[\s\S]+?\n\1}/, ''); // remove JScript [[DontEnum]] fix from `_.isEqual` - source = source.replace(/(?:\s*\/\/.*)*\n( +)if *\(hasDontEnumBug[\s\S]+?\n\1}/, ''); + source = source.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasDontEnumBug[\s\S]+?\n\1}/, ''); // remove `noArraySliceOnStrings` from `_.toArray` source = source.replace(/noArraySliceOnStrings *\?[^:]+: *([^)]+)/g, '$1'); @@ -1502,7 +1502,7 @@ } else { // inline `iteratorTemplate` template - source = source.replace(/(( +)var iteratorTemplate *= *)[\s\S]+?\n\2.+?;\n/, (function() { + source = source.replace(/(( *)var iteratorTemplate *= *)[\s\S]+?\n\2.+?;\n/, (function() { var snippet = getFunctionSource(lodash._iteratorTemplate); // prepend data object references to property names to avoid having to @@ -1562,16 +1562,16 @@ isNode = exportsOptions.indexOf('node') > -1; if (!isAMD) { - source = source.replace(/(?: *\/\/.*\n)*( +)if *\(typeof +define[\s\S]+?else /, '$1'); + source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1'); } if (!isNode) { - source = source.replace(/(?: *\/\/.*\n)*( +)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); + source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); } if (!isCommonJS) { - source = source.replace(/(?: *\/\/.*\n)*(?:( +)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, ''); + source = source.replace(/(?: *\/\/.*\n)*(?:( *)else *{)?\s*freeExports\.\w+ *=[\s\S]+?(?:\n\1})?\n/, ''); } if (!isGlobal) { - source = source.replace(/(?:( +)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n'); + source = source.replace(/(?:( *)(})? *else(?: *if *\(_\))? *{)?(?:\s*\/\/.*)*\s*(?:window\._|_\.templates) *=[\s\S]+?(?:\n\1})?\n/g, '$1$2\n'); } // remove `if (freeExports) {...}` if it's empty if (isAMD && isGlobal) { diff --git a/lodash.min.js b/lodash.min.js index d7d88ec3a..1b3f94147 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -2,38 +2,38 @@ Lo-Dash 0.9.1 lodash.com/license 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||Q);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(en||e===t)return 1;if(ei;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===j)&&"),r+="g.call(j,h)){w=j[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return r",Function("e,g,i,n,l,q,t,v","return function("+t+"){"+r+"}")(f,mt,v,Kt,Nt,yt,Bt,wt)}function c(e){return"\\"+Qt[e]}function h(e){return nn -[e]}function p(){}function d(e){return rn[e]}function v(e){return wt.call(e)==At}function m(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Wt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!S(n)||n instanceof n)?Ft?(en(e,function(e,n,r){return t=!mt.call(r,n),i}),t===i):(en(e,function(e,n){t=n}),t===i||mt.call(e,t)):t}function g(e){var t=[];return tn(e,function(e,n){t.push(n)}),t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Kt[typeof e]){var u= -wt.call(e);if(!Jt[u]||Rt&&v(e))return e;var a=u==Ot,n=a||(u==Pt?an(e):n)}if(!n||!t)return n?a?bt.call(e):on({},e):e;n=e.constructor;switch(u){case Mt:case _t:return new n(+e);case Dt:case Bt:return new n(e);case Ht:return n(e.source,rt.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?ln:tn)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e){var t=[];return en(e,function(e,n){S(e)&&t.push(n)}),t.sort()}function w(e){var t= -{};return tn(e,function(e,n){t[e]=n}),t}function E(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=wt.call(e);if(u!=wt.call(t))return i;switch(u){case Mt:case _t:return+e==+t;case Dt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ht:case Bt:return e==t+""}var a=u==Ot||u==At;if(Rt&&!a&&(a=v(e))&&!v(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return E(e.__wrapped__||e,t.__wrapped__||t);if(u!=Pt||Wt&&("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&&(!S(u)||!(u instanceof u&&S(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=E(e[l],t[l],s,o)););return f}for(var c in e)if(mt.call(e,c)&&(l++,!mt.call(t,c)||!E(e[c],t[c],s,o)))return i;for(c in t)if(mt.call(t,c)&&!(l--))return i;if(jt)for(;7>++u;)if(c=ct[u],mt.call(e,c)&&(!mt.call -(t,c)||!E(e[c],t[c],s,o)))return i;return n}function S(e){return"function"==typeof e}function x(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==K&&(u=[],a=[],o=i.length);for(;++sn?Ct(0,i+n):n)||0;return"number"==typeof i?-1<(wt.call(e)==Bt?e.indexOf(t,n):j(e,t,n)):P(e,function(e){return++r>=n&&e===t})}function C(e,t,r){var i=n,t=f(t,r);return ln(e,function(e,n,r){return i=!!t(e,n,r)}),i}function k(e,t,n){var r=[],t=f(t,n);return ln(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function L(e,t,r){var i,t=f(t,r);return P(e,function(e,r,s){return t(e,r,s)&&(i=e,n)}),i}function A(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=f(t,n);if(un(e))for(;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function M(e,t){var n=[];return ln(e,function(e){n.push(e[t])}),n}function _(e,t,n,r){var s=3>arguments.length,t=f(t,r);return ln(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("number"!=typeof o) -var a=fn(e),o=a.length;else zt&&wt.call(e)==Bt&&(s=e.split(""));return ln(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 ln(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]:bt.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])j(a,h))(n||l)&&a.push( -h),u.push(r)}return u}function R(e,t){return Vt||Et&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/ -,Z=/&(?:amp|lt|gt|quot|#x27);/g,et=/\b__p\+='';/g,tt=/\b(__p\+=)''\+/g,nt=/(__e\(.*?\)|\b__t\))\+'';/g,rt=/\w*$/,it=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,st=RegExp("^"+($.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ot=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ut=/<%=([\s\S]+?)%>/g,at=/($^)/,ft=/[&<>"']/g,lt=/['\n\r\t\u2028\u2029\\]/g,ct="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ht=Math.ceil -,pt=V.concat,dt=Math.floor,vt=st.test(vt=Object.getPrototypeOf)&&vt,mt=$.hasOwnProperty,gt=V.push,yt=$.propertyIsEnumerable,bt=V.slice,wt=$.toString,Et=st.test(Et=bt.bind)&&Et,St=st.test(St=Array.isArray)&&St,xt=e.isFinite,Tt=e.isNaN,Nt=st.test(Nt=Object.keys)&&Nt,Ct=Math.max,kt=Math.min,Lt=Math.random,At="[object Arguments]",Ot="[object Array]",Mt="[object Boolean]",_t="[object Date]",Dt="[object Number]",Pt="[object Object]",Ht="[object RegExp]",Bt="[object String]",jt,Ft,It=(It={0:1,length:1}, -V.splice.call(It,0,1),It[0]),qt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)qt=!n;jt=!/valueOf/.test(t),Ft="x"!=t[0]})(1);var Rt=!v(arguments),Ut="x"!=bt.call("x")[0],zt="xx"!="x"[0]+Object("x")[0];try{var Wt=("[object Object]",wt.call(e.document||0)==Pt)}catch(Xt){}var Vt=Et&&/\n|Opera/.test(Et+wt.call(e.opera)),$t=Nt&&/^.+$|true/.test(Nt+!!e.attachEvent),Jt={};Jt[At]=Jt["[object Function]"]=i,Jt[Ot]=Jt[Mt]=Jt[_t]=Jt[Dt -]=Jt[Pt]=Jt[Ht]=Jt[Bt]=n;var Kt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ut,variable:""};var Gt={a:"d,c,u",k:"c=e(c,u)",b:"if(c(w,h,d)===false)return r",g:"if(c(w,h,d)===false)return r"},Yt={l:i,a:"m",k:"for(var a=1,b=arguments.length;a":">",'"':""","'":"'"},rn=w(nn),sn=l(Yt,{g:"if(r[h]==null)"+Yt.g}),on=l(Yt),un=St||function(e){return wt.call(e)==Ot};S(/x/)&&(S=function(e){return"[object Function]"==wt.call(e)});var an=vt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=vt(t))&&vt(n);return n?e==n||vt(e)==n&&!v(e):m(e)}:m,fn=Nt?function(e){var t=typeof e;return"function"==t&&yt -.call(e,"prototype")?g(e):e&&Kt[t]?Nt(e):[]}:g,ln=l(Gt);s.VERSION="0.9.1",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=R,s.bindAll=function(e){for(var t=arguments,n=1j(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=w,s.invoke=function(e,t){var n=bt.call(arguments,2),r="function"==typeof t,i=[];return ln(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=v,s. -isArray=un,s.isBoolean=function(e){return e===n||e===i||wt.call(e)==Mt},s.isDate=function(e){return wt.call(e)==_t},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=wt.call(e),s=e.length;return r==Ot||r==Bt||r==At||Rt&&v(e)||r==Pt&&"number"==typeof s&&S(e.splice)?!s:(tn(e,function(){return t=i}),t)},s.isEqual=E,s.isFinite=function(e){return xt(e)&&!Tt(parseFloat(e))},s.isFunction=S,s.isNaN=function(e){return wt.call(e)==Dt&&e!=+e},s.isNull=function( -e){return e===r},s.isNumber=function(e){return wt.call(e)==Dt},s.isObject=function(e){return e?Kt[typeof e]:i},s.isPlainObject=an,s.isRegExp=function(e){return wt.call(e)==Ht},s.isString=function(e){return wt.call(e)==Bt},s.isUndefined=function(e){return e===t},s.keys=fn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:bt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Ct(0,r+n):kt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind= -function(e,t){return a(t,e,bt.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 mt.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||!un(e))t=f(t,n),ln(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 tn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return a(e,bt.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof -t)for(var i=0,s=pt.apply(V,arguments),o=s.length;++i=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++ri;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===j)&&"),r+="g.call(j,h)){w=j[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return r",Function("e,g,i,n,l,q,t,v","return function("+t+"){"+r+"}")(f,gt,v,Qt,Ct,bt,jt,Et)}function c(e){return"\\"+Gt[e]}function h(e){return rn +[e]}function p(){}function d(e){return sn[e]}function v(e){return Et.call(e)==Ot}function m(e){var t=i;if(!e||"object"!=typeof e||v(e))return t;var n=e.constructor;return(!Xt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!S(n)||n instanceof n)?It?(tn(e,function(e,n,r){return t=!gt.call(r,n),i}),t===i):(tn(e,function(e,n){t=n}),t===i||gt.call(e,t)):t}function g(e){var t=[];return nn(e,function(e,n){t.push(n)}),t}function y(e,t,n,s,o){if(e==r)return e;n&&(t=i);if(n=Qt[typeof e]){var u= +Et.call(e);if(!Kt[u]||Ut&&v(e))return e;var a=u==Mt,n=a||(u==Ht?fn(e):n)}if(!n||!t)return n?a?wt.call(e):un({},e):e;n=e.constructor;switch(u){case _t:case Dt:return new n(+e);case Pt:case jt:return new n(e);case Bt:return n(e.source,it.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?cn:nn)(e,function(e,n){f[n]=y(e,t,r,s,o)}),f}function b(e){var t=[];return tn(e,function(e,n){S(e)&&t.push(n)}),t.sort()}function w(e){var t= +{};return nn(e,function(e,n){t[e]=n}),t}function E(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=Et.call(e);if(u!=Et.call(t))return i;switch(u){case _t:case Dt:return+e==+t;case Pt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Bt:case jt:return e==t+""}var a=u==Mt||u==Ot;if(Ut&&!a&&(a=v(e))&&!v(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return E(e.__wrapped__||e,t.__wrapped__||t);if(u!=Ht||Xt&&("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&&(!S(u)||!(u instanceof u&&S(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=E(e[l],t[l],s,o)););return f}for(var c in e)if(gt.call(e,c)&&(l++,!gt.call(t,c)||!E(e[c],t[c],s,o)))return i;for(c in t)if(gt.call(t,c)&&!(l--))return i;if(Ft)for(;7>++u;)if(c=ht[u],gt.call(e,c)&&(!gt.call +(t,c)||!E(e[c],t[c],s,o)))return i;return n}function S(e){return"function"==typeof e}function x(e){return Et.call(e)==jt}function T(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Q&&(u=[],a=[],o=i.length);for(;++sn?kt(0,i+n):n)||0;return"number"==typeof i?-1<(x(e)?e.indexOf(t,n):F(e,t,n)):H(e,function(e){return++r>=n&&e===t})}function k(e,t,r){var i=n,t=f(t,r);return cn(e,function(e,n,r){return i=!!t(e,n,r)}),i}function L(e,t,n){var r=[],t=f(t,n);return cn(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function A(e,t,r){var i,t=f(t,r);return H(e,function(e,r,s){return t(e,r,s)&&(i=e,n)}),i}function O(e,t,n){var r=-1,i=e?e.length:0,s=Array("number"==typeof i?i:0),t=f(t,n);if( +an(e))for(;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function _(e,t){var n=[];return cn(e,function(e){n.push(e[t])}),n}function D(e,t,n,r){var s=3>arguments.length,t=f(t,r);return cn(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function P(e,t,n +,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=ln(e),o=a.length;else Wt&&x(e)&&(s=e.split(""));return cn(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 H(e,t,n){var r,t=f(t,n);return cn(e,function(e,n,i){return!(r=t(e,n,i))}),!!r}function B(e,t,n){if(e)return t==r||n?e[0]:wt.call(e,0,t)}function j(e,t){for(var n=-1,r=e?e.length:0,i=[];++nn?kt(0,i+n):n||0)-1;else if(n)return r=q(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])F(a,h))(n||l)&&a.push(h),u.push(r)}return u}function U(e,t){return $t||St&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,et=/&(?:amp|lt|gt|quot|#x27);/g,tt=/\b__p\+='';/g,nt=/\b(__p\+=)''\+/g,rt=/(__e\(.*?\)|\b__t\))\+'';/g,it=/\w*$/,st=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ot=RegExp("^"+(J.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ut=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,at=/<%=([\s\S]+?)%>/g,ft=/($^)/,lt=/[&<>"']/g,ct=/['\n\r\t\u2028\u2029\\]/g,ht="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf" +.split(" "),pt=Math.ceil,dt=$.concat,vt=Math.floor,mt=ot.test(mt=Object.getPrototypeOf)&&mt,gt=J.hasOwnProperty,yt=$.push,bt=J.propertyIsEnumerable,wt=$.slice,Et=J.toString,St=ot.test(St=wt.bind)&&St,xt=ot.test(xt=Array.isArray)&&xt,Tt=e.isFinite,Nt=e.isNaN,Ct=ot.test(Ct=Object.keys)&&Ct,kt=Math.max,Lt=Math.min,At=Math.random,Ot="[object Arguments]",Mt="[object Array]",_t="[object Boolean]",Dt="[object Date]",Pt="[object Number]",Ht="[object Object]",Bt="[object RegExp]",jt="[object String]",Ft,It +,qt=(qt={0:1,length:1},$.splice.call(qt,0,1),qt[0]),Rt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Rt=!n;Ft=!/valueOf/.test(t),It="x"!=t[0]})(1);var Ut=!v(arguments),zt="x"!=wt.call("x")[0],Wt="xx"!="x"[0]+Object("x")[0];try{var Xt=("[object Object]",Et.call(e.document||0)==Ht)}catch(Vt){}var $t=St&&/\n|Opera/.test(St+Et.call(e.opera)),Jt=Ct&&/^.+$|true/.test(Ct+!!e.attachEvent),Kt={};Kt[Ot]=Kt["[object Function]"]=i,Kt[ +Mt]=Kt[_t]=Kt[Dt]=Kt[Pt]=Kt[Ht]=Kt[Bt]=Kt[jt]=n;var Qt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:at,variable:""};var Yt={a:"d,c,u",k:"c=e(c,u)",b:"if(c(w,h,d)===false)return r",g:"if(c(w,h,d)===false)return r"},Zt={l:i,a:"m",k:"for(var a=1,b=arguments.length;a":">",'"':""","'":"'"},sn=w(rn),on=l(Zt,{g:"if(r[h]==null)"+Zt.g}),un=l(Zt),an=xt||function(e){return Et.call(e)==Mt};S(/x/)&&(S=function(e){return"[object Function]"==Et.call(e)});var fn=mt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=mt(t))&&mt(n);return n?e==n||mt(e)==n&&!v(e):m(e)}:m,ln=Ct?function(e){var t=typeof +e;return"function"==t&&bt.call(e,"prototype")?g(e):e&&Qt[t]?Ct(e):[]}:g,cn=l(Yt);s.VERSION="0.9.1",s.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=U,s.bindAll=function(e){for(var t=arguments,n=1F(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=w,s.invoke=function(e,t){var n=wt.call(arguments,2),r="function"==typeof t,i=[];return cn(e,function(e){i.push((r?t:e[t]).apply +(e,n))}),i},s.isArguments=v,s.isArray=an,s.isBoolean=function(e){return e===n||e===i||Et.call(e)==_t},s.isDate=function(e){return Et.call(e)==Dt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=Et.call(e),s=e.length;return r==Mt||r==jt||r==Ot||Ut&&v(e)||r==Ht&&"number"==typeof s&&S(e.splice)?!s:(nn(e,function(){return t=i}),t)},s.isEqual=E,s.isFinite=function(e){return Tt(e)&&!Nt(parseFloat(e))},s.isFunction=S,s.isNaN=function(e){return Et.call +(e)==Pt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return Et.call(e)==Pt},s.isObject=function(e){return e?Qt[typeof e]:i},s.isPlainObject=fn,s.isRegExp=function(e){return Et.call(e)==Bt},s.isString=x,s.isUndefined=function(e){return e===t},s.keys=ln,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:wt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?kt(0,r+n):Lt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s. +lateBind=function(e,t){return a(t,e,wt.call(arguments,2))},s.map=O,s.max=M,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return gt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=T,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!an(e))!t&&x(e)&&(t=function(e){return e.charCodeAt(0)}),t=f(t,n),cn(e,function(e,n,i){n=t(e,n,i),nF(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 nn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return a(e,wt.call +(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=dt.apply($,arguments),o=s.length;++i=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r