From d255f8400fad56ba67d3313b170cdab278e62960 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 8 Nov 2012 09:01:47 -0800 Subject: [PATCH] Work around a Closure Compiler bug without a pre/post process. [via @phated] Former-commit-id: 2b9ead74c8c29357a7d8af965b6e0702e77872a5 --- build/post-compile.js | 9 ++---- build/pre-compile.js | 5 --- lodash.js | 9 +++--- lodash.min.js | 66 ++++++++++++++++++++-------------------- lodash.underscore.min.js | 36 +++++++++++----------- 5 files changed, 58 insertions(+), 67 deletions(-) diff --git a/build/post-compile.js b/build/post-compile.js index 63ed8b7f2..89a8f2029 100644 --- a/build/post-compile.js +++ b/build/post-compile.js @@ -29,13 +29,8 @@ // move vars exposed by the Closure Compiler into the IIFE source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1'); - // avoid bugs with the Closure Compiler - source = source - // correct overly aggressive Closure Compiler minification - .replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}') - // restore `arrayRef` and `objectRef` values modified by pre-compile.js - .replace(/= *Array.prototype/, '=[]') - .replace(/= *Object.prototype/, '={}'); + // correct overly aggressive Closure Compiler minification + source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}'); // unescape properties (i.e. foo["bar"] => foo.bar) source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) { diff --git a/build/pre-compile.js b/build/pre-compile.js index b0cfa086d..1c13cef96 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -215,11 +215,6 @@ // remove copyright to add later in post-compile.js source = source.replace(/\/\*![\s\S]+?\*\//, ''); - // replace `arrayRef` and `objectRef` values to avoid a bug in the Closure Compiler - source = source - .replace(/(arrayRef *= *)\[\]/, '$1Array.prototype') - .replace(/(objectRef *= *)\{\}/, '$1Object.prototype'); - // add brackets to whitelisted properties so the Closure Compiler won't mung them // http://code.google.com/closure/compiler/docs/api-tutorial3.html#export source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), "['$1']"); diff --git a/lodash.js b/lodash.js index 8ee9a9c10..43176a50f 100644 --- a/lodash.js +++ b/lodash.js @@ -18,13 +18,14 @@ /** Used for array and object method references */ var arrayRef = [], - objectRef = {}; + // avoid a Closure Compiler bug by creatively creating an object + objectRef = new function(){}; /** Used to generate unique IDs */ var idCounter = 0; /** Used internally to indicate various things */ - var indicatorObject = {}; + var indicatorObject = objectRef; /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ var largeArraySize = 30; @@ -1629,7 +1630,7 @@ stackA = args[3], stackB = args[4]; - if (indicator !== indicatorObject) { + if (indicator !== objectRef) { stackA = []; stackB = []; length = args.length; @@ -1657,7 +1658,7 @@ : (isPlainObject(value) ? value : {}) ); // recursively merge objects and arrays (susceptible to call stack limits) - object[key] = merge(value, source, indicatorObject, stackA, stackB); + object[key] = merge(value, source, objectRef, stackA, stackB); } } else if (source != null) { object[key] = source; diff --git a/lodash.min.js b/lodash.min.js index ede8d5ac9..ad333785c 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -2,39 +2,39 @@ 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||Z);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(e=(n||Y);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(ei;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===k)&&"),r+="g.call(k,h)){v=k[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return s",Function("e,g,i,j,o,m,r","return function("+t+"){"+r+"}")(l,bt,m,N,Yt,Lt,Et)}function h(e){return"\\"+Zt[e]}function p -(e){return on[e]}function d(){}function v(e){return un[e]}function m(e){return xt.call(e)==_t}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!$t||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?Rt?(rn(e,function(e,n,r){return t=!bt.call(r,n),i}),t===i):(rn(e,function(e,n){t=n}),t===i||bt.call(e,t)):t}function y(e){var t=[];return sn(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(e)){var u= -xt.call(e);if(!Gt[u]||Wt&&m(e))return e;var a=u==Dt,n=a||(u==jt?cn(e):n)}if(!n||!t)return n?a?St.call(e):fn({},e):e;n=e.constructor;switch(u){case Pt:case Ht:return new n(+e);case Bt:case It:return new n(e);case Ft:return n(e.source,ot.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?pn:sn)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return rn(e,function(e,n){x(e)&&t.push(n)}),t.sort()}function E(e){var t= -{};return sn(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=xt.call(e);if(u!=xt.call(t))return i;switch(u){case Pt:case Ht:return+e==+t;case Bt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ft:case It:return e==t+""}var a=u==Dt||u==_t;if(Wt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=jt||$t&&("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&&(!x(u)||!(u instanceof u&&x(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(bt.call(e,c)&&(l++,!bt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(bt.call(t,c)&&!(l--))return i;if(qt)for(;7>++u;)if(c=dt[u],bt.call(e,c)&&(!bt.call -(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Yt[typeof e]:i}function N(e){return xt.call(e)==It}function C(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Y&&(u=[],a=[],o=i.length);for(;++sn?At(0,i+n):n)||0;return"number"==typeof i?-1<(N(e)?e.indexOf(t,n):q(e,t,n)):j(e,function(e){return++r>=n&&e===t})}function A(e,t,r){var i=n,t=l(t,r);if(ln(e))for(var r=-1,s=e.length;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function P(e,t){var n=[];return pn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return pn -(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=hn(e),o=a.length;else Vt&&N(e)&&(s=e.split(""));return pn(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 j(e,t,n){var r,t=l(t,n);if(ln(e))for(var n=-1,i=e.length;++nn?At(0,i+n):n||0)-1;else if(n)return r=U(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Kt||Tt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,nt=/&(?:amp|lt|gt|quot|#x27);/g,rt=/\b__p\+='';/g,it=/\b(__p\+=)''\+/g,st=/(__e\(.*?\)|\b__t\))\+'';/g,ot=/\w*$/,ut=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,at=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g -,".+?")+"$"),ft=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,lt=/<%=([\s\S]+?)%>/g,ct=/($^)/,ht=/[&<>"']/g,pt=/['\n\r\t\u2028\u2029\\]/g,dt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),vt=Math.ceil,mt=K.concat,gt=Math.floor,yt=at.test(yt=Object.getPrototypeOf)&&yt,bt=Q.hasOwnProperty,wt=K.push,Et=Q.propertyIsEnumerable,St=K.slice,xt=Q.toString,Tt=at.test(Tt=St.bind)&&Tt,Nt=at.test(Nt=Array.isArray)&&Nt,Ct=e.isFinite,kt=e.isNaN,Lt=at.test(Lt=Object -.keys)&&Lt,At=Math.max,Ot=Math.min,Mt=Math.random,_t="[object Arguments]",Dt="[object Array]",Pt="[object Boolean]",Ht="[object Date]",Bt="[object Number]",jt="[object Object]",Ft="[object RegExp]",It="[object String]",qt,Rt,Ut=(Ut={0:1,length:1},K.splice.call(Ut,0,1),Ut[0]),zt=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)zt=!n;qt=!/valueOf/.test(t),Rt="x"!=t[0]})(1);var Wt=!m(arguments),Xt="x"!=St.call("x")[0],Vt="xx"!="x" -[0]+Object("x")[0];try{var $t=("[object Object]",xt.call(e.document||0)==jt)}catch(Jt){}var Kt=Tt&&/\n|Opera/.test(Tt+xt.call(e.opera)),Qt=Lt&&/^.+$|true/.test(Lt+!!e.attachEvent),Gt={};Gt[_t]=Gt["[object Function]"]=i,Gt[Dt]=Gt[Pt]=Gt[Ht]=Gt[Bt]=Gt[jt]=Gt[Ft]=Gt[It]=n;var Yt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Zt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g, -interpolate:lt,variable:""};var en={a:"d,c,u",k:"c=e(c,u)",b:"if(c(v,h,d)===false)return s",g:"if(c(v,h,d)===false)return s"},tn={l:i,a:"n",k:"for(var a=1,b=arguments.length;a":">",'"':""","'":"'"},un=E(on),an=c(tn,{g:"if(s[h]==null)"+tn.g}),fn=c(tn),ln=Nt||function(e){return xt.call(e)==Dt};x(/x/)&&(x=function(e){ -return"[object Function]"==xt.call(e)});var cn=yt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=yt(t))&&yt(n);return n?e==n||yt(e)==n&&!m(e):g(e)}:g,hn=Lt?function(e){return"function"==typeof e&&Et.call(e,"prototype")?y(e):T(e)?Lt(e):[]}:y,pn=c(en);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=W,s.bindAll=function(e){for(var t=arguments,n=1q(i,e) -){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=St.call(arguments,2),r="function"==typeof t,i=[];return pn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=ln,s.isBoolean=function(e){return e===n||e===i||xt.call(e)==Pt},s.isDate=function(e){return xt.call(e)==Ht},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=xt.call(e),s=e.length;return r==Dt||r==It||r== -_t||Wt&&m(e)||r==jt&&"number"==typeof s&&x(e.splice)?!s:(sn(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return Ct(e)&&!kt(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return xt.call(e)==Bt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return xt.call(e)==Bt},s.isObject=T,s.isPlainObject=cn,s.isRegExp=function(e){return xt.call(e)==Ft},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=hn,s.last=function(e,t,n){if(e){var i=e.length;return t==r|| -n?e[i-1]:St.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?At(0,r+n):Ot(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return f(t,e,St.call(arguments,2))},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return bt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!ln(e))t=!t&&N(e)?u:l(t,n) -,pn(e,function(e,n,i){n=t(e,n,i),nq(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 sn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,St.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=mt.apply(K,arguments),o=s.length;++ii;i++)r+="h='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===k)&&"),r+="g.call(k,h)){v=k[h];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return s",Function("e,g,i,j,o,m,r","return function("+t+"){"+r+"}")(l,yt,m,N,Gt,kt,wt)}function h(e){return"\\"+Yt[e]}function p +(e){return sn[e]}function d(){}function v(e){return on[e]}function m(e){return St.call(e)==Mt}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!Vt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?qt?(nn(e,function(e,n,r){return t=!yt.call(r,n),i}),t===i):(nn(e,function(e,n){t=n}),t===i||yt.call(e,t)):t}function y(e){var t=[];return rn(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(e)){var u= +St.call(e);if(!Qt[u]||zt&&m(e))return e;var a=u==_t,n=a||(u==Bt?ln(e):n)}if(!n||!t)return n?a?Et.call(e):an({},e):e;n=e.constructor;switch(u){case Dt:case Pt:return new n(+e);case Ht:case Ft:return new n(e);case jt:return n(e.source,st.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?hn:rn)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return nn(e,function(e,n){x(e)&&t.push(n)}),t.sort()}function E(e){var t= +{};return rn(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=St.call(e);if(u!=St.call(t))return i;switch(u){case Dt:case Pt:return+e==+t;case Ht:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case jt:case Ft:return e==t+""}var a=u==_t||u==Mt;if(zt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=Bt||Vt&&("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&&(!x(u)||!(u instanceof u&&x(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(yt.call(e,c)&&(l++,!yt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(yt.call(t,c)&&!(l--))return i;if(It)for(;7>++u;)if(c=pt[u],yt.call(e,c)&&(!yt.call +(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Gt[typeof e]:i}function N(e){return St.call(e)==Ft}function C(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?Lt(0,i+n):n)||0;return"number"==typeof i?-1<(N(e)?e.indexOf(t,n):q(e,t,n)):j(e,function(e){return++r>=n&&e===t})}function A(e,t,r){var i=n,t=l(t,r);if(fn(e))for(var r=-1,s=e.length;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function P(e,t){var n=[];return hn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return hn +(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=cn(e),o=a.length;else Xt&&N(e)&&(s=e.split(""));return hn(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 j(e,t,n){var r,t=l(t,n);if(fn(e))for(var n=-1,i=e.length;++nn?Lt(0,i+n):n||0)-1;else if(n)return r=U(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Jt||xt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,tt=/&(?:amp|lt|gt|quot|#x27);/g,nt=/\b__p\+='';/g,rt=/\b(__p\+=)''\+/g,it=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,ot=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ut=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g +,".+?")+"$"),at=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ft=/<%=([\s\S]+?)%>/g,lt=/($^)/,ct=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,pt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),dt=Math.ceil,vt=K.concat,mt=Math.floor,gt=ut.test(gt=Object.getPrototypeOf)&>,yt=Q.hasOwnProperty,bt=K.push,wt=Q.propertyIsEnumerable,Et=K.slice,St=Q.toString,xt=ut.test(xt=Et.bind)&&xt,Tt=ut.test(Tt=Array.isArray)&&Tt,Nt=e.isFinite,Ct=e.isNaN,kt=ut.test(kt=Object +.keys)&&kt,Lt=Math.max,At=Math.min,Ot=Math.random,Mt="[object Arguments]",_t="[object Array]",Dt="[object Boolean]",Pt="[object Date]",Ht="[object Number]",Bt="[object Object]",jt="[object RegExp]",Ft="[object String]",It,qt,Rt=(Rt={0:1,length:1},K.splice.call(Rt,0,1),Rt[0]),Ut=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)Ut=!n;It=!/valueOf/.test(t),qt="x"!=t[0]})(1);var zt=!m(arguments),Wt="x"!=Et.call("x")[0],Xt="xx"!="x" +[0]+Object("x")[0];try{var Vt=("[object Object]",St.call(e.document||0)==Bt)}catch($t){}var Jt=xt&&/\n|Opera/.test(xt+St.call(e.opera)),Kt=kt&&/^.+$|true/.test(kt+!!e.attachEvent),Qt={};Qt[Mt]=Qt["[object Function]"]=i,Qt[_t]=Qt[Dt]=Qt[Pt]=Qt[Ht]=Qt[Bt]=Qt[jt]=Qt[Ft]=n;var Gt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Yt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g, +interpolate:ft,variable:""};var Zt={a:"d,c,u",k:"c=e(c,u)",b:"if(c(v,h,d)===false)return s",g:"if(c(v,h,d)===false)return s"},en={l:i,a:"n",k:"for(var a=1,b=arguments.length;a":">",'"':""","'":"'"},on=E(sn),un=c(en,{g:"if(s[h]==null)"+en.g}),an=c(en),fn=Tt||function(e){return St.call(e)==_t};x(/x/)&&(x=function(e){ +return"[object Function]"==St.call(e)});var ln=gt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=gt(t))&>(n);return n?e==n||gt(e)==n&&!m(e):g(e)}:g,cn=kt?function(e){return"function"==typeof e&&wt.call(e,"prototype")?y(e):T(e)?kt(e):[]}:y,hn=c(Zt);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=W,s.bindAll=function(e){for(var t=arguments,n=1q(i,e) +){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=Et.call(arguments,2),r="function"==typeof t,i=[];return hn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=fn,s.isBoolean=function(e){return e===n||e===i||St.call(e)==Dt},s.isDate=function(e){return St.call(e)==Pt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=St.call(e),s=e.length;return r==_t||r==Ft||r== +Mt||zt&&m(e)||r==Bt&&"number"==typeof s&&x(e.splice)?!s:(rn(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return Nt(e)&&!Ct(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return St.call(e)==Ht&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return St.call(e)==Ht},s.isObject=T,s.isPlainObject=ln,s.isRegExp=function(e){return St.call(e)==jt},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=cn,s.last=function(e,t,n){if(e){var i=e.length;return t==r|| +n?e[i-1]:Et.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Lt(0,r+n):At(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.lateBind=function(e,t){return f(t,e,Et.call(arguments,2))},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return yt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!fn(e))t=!t&&N(e)?u:l(t,n) +,hn(e,function(e,n,i){n=t(e,n,i),nq(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 rn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,Et.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=vt.apply(K,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);++rr&&(r=n,u=e)});else for(;++iu&&(u=e[i]);return u}function _(e,t){var n=[];return s(e,function(e){n.push(e[t])}),n}function D(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 P(e,t,n,r){var o=e?e.length:0,u=3>arguments.length;if("number"!=typeof 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 H(e,t,n){var r,t=p(t,n);if(At(e))for(var n=-1,i=e.length;++nn?pt(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(u,a))n&&u.push(a),o.push(r)}return o}function U(e,t){return Tt||ft&&2"']/g,tt=/['\n\r\t\u2028\u2029\\]/g -,nt=Math.ceil,rt=$.concat,it=Math.floor,st=V.hasOwnProperty,ot=$.push,ut=$.slice,at=V.toString,ft=Y.test(ft=ut.bind)&&ft,lt=Y.test(lt=Array.isArray)&<,ct=e.isFinite,ht=Y.test(ht=Object.keys)&&ht,pt=Math.max,dt=Math.min,vt=Math.random,mt="[object Array]",gt="[object Boolean]",yt="[object Date]",bt="[object Number]",wt="[object Object]",Et="[object RegExp]",St="[object String]",xt=(xt={0:1,length:1},$.splice.call(xt,0,1),xt[0]),Tt=ft&&/\n|Opera/.test(ft+at.call(e.opera)),Nt={"boolean":i,"function" -:n,object:n,number:i,string:i,"undefined":i},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]"==at.call(e)},l.isArguments(arguments)||(l.isArguments=function(e){return e?st.call(e,"callee"):i});var kt={"&":"&","<":"<",">":">",'"':""","'":"'"},Lt=w(kt),At=lt||function(e){return at -.call(e)==mt};S(/x/)&&(S=function(e){return"[object Function]"==at.call(e)});var Ot=ht?function(e){return x(e)?ht(e):[]}:y;l.VERSION="0.9.1",l.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},l.bind=U,l.bindAll=function(e){for(var t=arguments,n=1F(r,s,n)&&i.push(s)}return i},l.escape=function(e){return e==r?"":(e+"").replace(et,v)},l.every=k,l.extend=o,l.filter=L,l.find=A,l.first=B,l.flatten=j,l.forEach=s,l.functions=b,l -.groupBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),(st.call(r,n)?r[n]:r[n]=[]).push(e)}),r},l.has=function(e,t){return e?st.call(e,t):i},l.identity=z,l.indexOf=F,l.initial=function(e,t,n){return e?ut.call(e,0,-(t==r||n?1:t)):[]},l.intersection=function(e){var t=arguments,n=t.length,r=[];return s(e,function(e){if(0>F(r,e)){for(var i=n;--i;)if(0>F(t[i],e))return;r.push(e)}}),r},l.invert=w,l.invoke=function(e,t){var n=ut.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=At,l.isBoolean=function(e){return e===n||e===i||at.call(e)==gt},l.isDate=function(e){return at.call(e)==yt},l.isElement=function(e){return e?1===e.nodeType:i},l.isEmpty=function(e){if(!e)return n;if(At(e)||T(e))return!e.length;for(var t in e)if(st.call(e,t))return i;return n},l.isEqual=E,l.isFinite=function(e){return ct(e)&&at.call(e)==bt},l.isFunction=S,l.isNaN=function(e){return at.call(e)==bt&&e!=+e},l.isNull=function(e){return e===r} -,l.isNumber=function(e){return at.call(e)==bt},l.isObject=x,l.isRegExp=function(e){return at.call(e)==Et},l.isString=T,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]:ut.call(e,-t||i)}},l.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?pt(0,r+n):dt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},l.map=O,l.max=M,l.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments -[0];return st.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||!At(e))t=p(t,n),s(e,function(e,n,i){n=t(e,n,i),nF(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=rt.apply($,arguments),r=n.length,i={};++t=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},l.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array( -e);++rF(arguments,i,1)&&r.push(i)}return r},l.wrap=function(e,t){return function(){var n=[e];return ot.apply(n,arguments),t.apply(this,n)}},l.zip=function(e){for(var t=-1,n=e?M(_(arguments,"length")):0,r=Array(n);++t"']/g +,tt=/['\n\r\t\u2028\u2029\\]/g,nt=Math.ceil,rt=$.concat,it=Math.floor,st=V.hasOwnProperty,ot=$.push,ut=$.slice,at=V.toString,ft=Y.test(ft=ut.bind)&&ft,lt=Y.test(lt=Array.isArray)&<,ct=e.isFinite,ht=Y.test(ht=Object.keys)&&ht,pt=Math.max,dt=Math.min,vt=Math.random,mt="[object Array]",gt="[object Boolean]",yt="[object Date]",bt="[object Number]",wt="[object Object]",Et="[object RegExp]",St="[object String]",xt=(xt={0:1,length:1},$.splice.call(xt,0,1),xt[0]),Tt=ft&&/\n|Opera/.test(ft+at.call(e.opera +)),Nt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},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]"==at.call(e)},l.isArguments(arguments)||(l.isArguments=function(e){return e?st.call(e,"callee"):i});var kt={"&":"&","<":"<",">":">",'"':""","'":"'"},Lt=w(kt +),At=lt||function(e){return at.call(e)==mt};S(/x/)&&(S=function(e){return"[object Function]"==at.call(e)});var Ot=ht?function(e){return x(e)?ht(e):[]}:y;l.VERSION="0.9.1",l.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},l.bind=U,l.bindAll=function(e){for(var t=arguments,n=1F(r,s,n)&&i.push(s)}return i},l.escape=function(e){return e==r?"":(e+"").replace(et,v)},l.every=k,l.extend=o,l.filter=L,l.find=A,l.first=B,l +.flatten=j,l.forEach=s,l.functions=b,l.groupBy=function(e,t,n){var r={},t=p(t,n);return s(e,function(e,n,i){n=t(e,n,i),(st.call(r,n)?r[n]:r[n]=[]).push(e)}),r},l.has=function(e,t){return e?st.call(e,t):i},l.identity=z,l.indexOf=F,l.initial=function(e,t,n){return e?ut.call(e,0,-(t==r||n?1:t)):[]},l.intersection=function(e){var t=arguments,n=t.length,r=[];return s(e,function(e){if(0>F(r,e)){for(var i=n;--i;)if(0>F(t[i],e))return;r.push(e)}}),r},l.invert=w,l.invoke=function(e,t){var n=ut.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=At,l.isBoolean=function(e){return e===n||e===i||at.call(e)==gt},l.isDate=function(e){return at.call(e)==yt},l.isElement=function(e){return e?1===e.nodeType:i},l.isEmpty=function(e){if(!e)return n;if(At(e)||T(e))return!e.length;for(var t in e)if(st.call(e,t))return i;return n},l.isEqual=E,l.isFinite=function(e){return ct(e)&&at.call(e)==bt},l.isFunction=S,l.isNaN=function(e){return at.call(e)==bt&&e!=+ +e},l.isNull=function(e){return e===r},l.isNumber=function(e){return at.call(e)==bt},l.isObject=x,l.isRegExp=function(e){return at.call(e)==Et},l.isString=T,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]:ut.call(e,-t||i)}},l.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?pt(0,r+n):dt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},l.map=O,l.max=M,l.memoize=function(e,t){var n={};return function(){var r= +t?t.apply(this,arguments):arguments[0];return st.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||!At(e))t=p(t,n),s(e,function(e,n,i){n=t(e,n,i),nF(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=rt.apply($,arguments),r=n.length,i={};++t=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},l.times=function(e, +t,n){for(var e=+e||0,r=-1,i=Array(e);++rF(arguments,i,1)&&r.push(i)}return r},l.wrap=function(e,t){return function(){var n=[e];return ot.apply(n,arguments),t.apply(this,n)}},l.zip=function(e){for(var t=-1,n=e?M(_(arguments,"length")):0,r=Array(n);++t