mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
54 lines
27 KiB
JavaScript
54 lines
27 KiB
JavaScript
/**
|
|
* @license
|
|
* Lo-Dash 2.2.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
|
* Build: `lodash modern -o ./dist/lodash.js`
|
|
*/
|
|
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:_+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:_+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=!0
|
|
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[0|r/2],i=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return!1;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=!1,o=f(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+G[n]}function a(){return g.pop()||[]}function f(){return y.pop()||{k:null,l:null,m:null,"false":!1,n:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,o:null}
|
|
}function l(){}function c(n){n.length=0,g.length<d&&g.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<d&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function v(e){function g(n){if(!n||se.call(n)!=z)return!1;var t=n.valueOf,e=typeof t=="function"&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:gt(n)}function y(n,t,e){if(!n||!V[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);
|
|
for(var r=-1,u=V[typeof n]&&qe(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function d(n,t,e){var r;if(!n||!V[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function G(n,t,e){var r,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof e=="number"?2:i.length;++a<f;)if((u=i[a])&&V[typeof u])for(var l=-1,c=V[typeof u]&&qe(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);return o}function J(n,t,e){var r,u=n,o=u;
|
|
if(!u)return o;var i=arguments,a=0,f=typeof e=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var l=ut(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&V[typeof u])for(var c=-1,p=V[typeof u]&&qe(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function Q(n){var t,e=[];if(!n||!V[typeof n])return e;for(t in n)be.call(n,t)&&e.push(t);return e}function Y(n){return n&&typeof n=="object"&&!We(n)&&be.call(n,"__wrapped__")?n:new nt(n)}function nt(n,t){this.__chain__=!!t,this.__wrapped__=n
|
|
}function tt(n,t,e){function r(){if(e){var u=e.slice();we.apply(u,arguments)}if(this instanceof r){var o=rt(n.prototype),u=n.apply(o,u||arguments);return jt(u)?u:o}return n.apply(t,u||arguments)}return r}function et(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!jt(n))return n;var i=se.call(n);if(!L[i])return n;var f=Fe[i];switch(i){case T:case B:return new f(+n);case q:case K:return new f(n);case P:return o=f(n.source,O.exec(n)),o.lastIndex=n.lastIndex,o}if(i=We(n),t){var l=!r;
|
|
r||(r=a()),u||(u=a());for(var p=r.length;p--;)if(r[p]==n)return u[p];o=i?f(n.length):{}}else o=i?s(n):J({},n);return i&&(be.call(n,"index")&&(o.index=n.index),be.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(i?St:y)(n,function(n,i){o[i]=et(n,t,e,r,u)}),l&&(c(r),c(u)),o):o}function rt(n){return jt(n)?Ce(n):{}}function ut(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Te.funcNames&&(r=!n.name),r=r||!Te.funcDecomp,!r)){var u=me.call(n);
|
|
Te.funcNames||(r=!I.test(u)),r||(r=R.test(u),Be(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Gt(n,t)}function ot(n,t,e,r,u,o){function i(){var g=a?u:this;if(l||p||v){if(p){var y=e.slice();we.apply(y,arguments)}if((v||l)&&(y||(y=s(arguments)),v&&we.apply(y,r),l&&y.length<o))return t|=16,st(n,c?t:-4&t,y,null,u,o)
|
|
}return y||(y=arguments),f&&(n=g[h]),this instanceof i?(g=rt(n.prototype),y=n.apply(g,y),jt(y)?y:g):n.apply(g,y)}var a=1&t,f=2&t,l=4&t,c=8&t,p=16&t,v=32&t,h=n;return i}function it(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var i=n[r];if(i&&typeof i=="object"&&typeof i.length=="number"&&(We(i)||mt(i))){t||(i=it(i,t,e));var a=-1,f=i.length,l=o.length;for(o.length+=f;++a<f;)o[l++]=i[a]}else e||o.push(i)}return o}function at(n,t,e,r,u,o){if(e){var i=e(n,t);if(typeof i!="undefined")return!!i
|
|
}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&V[typeof n]||t&&V[typeof t]))return!1;if(null==n||null==t)return n===t;var f=se.call(n),l=se.call(t);if(f==$&&(f=z),l==$&&(l=z),f!=l)return!1;switch(f){case T:case B:return+n==+t;case q:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case P:case K:return n==ae(t)}if(l=f==F,!l){if(be.call(n,"__wrapped__")||be.call(t,"__wrapped__"))return at(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(f!=z)return!1;var f=n.constructor,p=t.constructor;if(f!=p&&!(wt(f)&&f instanceof f&&wt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in t)return!1
|
|
}for(p=!u,u||(u=a()),o||(o=a()),f=u.length;f--;)if(u[f]==n)return o[f]==t;var s=0,i=!0;if(u.push(n),o.push(t),l){if(f=n.length,s=t.length,i=s==n.length,!i&&!r)return i;for(;s--;)if(l=f,p=t[s],r)for(;l--&&!(i=at(n[l],p,e,r,u,o)););else if(!(i=at(n[s],p,e,r,u,o)))break;return i}return d(t,function(t,a,f){return be.call(f,a)?(s++,i=be.call(n,a)&&at(n[a],t,e,r,u,o)):void 0}),i&&!r&&d(n,function(n,t,e){return be.call(e,t)?i=-1<--s:void 0}),p&&(c(u),c(o)),i}function ft(n,t,e,r,u){(We(t)?St:y)(t,function(t,o){var i,a,f=t,l=n[o];
|
|
if(t&&((a=We(t))||g(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?We(l)?l:[]:g(l)?l:{}),r.push(t),u.push(l),c||ft(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function lt(n,t){return n+ye(De()*(t-n+1))}function ct(e,r,u){var i=-1,f=ht(),l=e?e.length:0,s=[],v=!r&&l>=b&&f===n,h=u||v?a():s;if(v){var g=o(h);g?(f=t,h=g):(v=!1,h=u?h:(c(h),s))}for(;++i<l;){var g=e[i],y=u?u(g,i,e):g;
|
|
(r?!i||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(c(h.k),p(h)):u&&c(h),s}function pt(n){return function(t,e,r){var u={};e=Y.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var i=t[r];n(u,i,e(i,r,t),t)}else y(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function st(n,t,e,r,u,o){var i=1&t,a=4&t,f=16&t,l=32&t;if(!(2&t||wt(n)))throw new fe;f&&!e.length&&(t&=-17,f=e=!1),l&&!r.length&&(t&=-33,l=r=!1);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(t|=8),!a||4&c[1]||(c[5]=o),f&&we.apply(c[2]||(c[2]=[]),e),l&&we.apply(c[3]||(c[3]=[]),r),c[1]|=t,st.apply(null,c)):(i=1==t||17===t?tt(n,u,e):ot(n,t,e,r,u,o),Be(i,[n,t,e,r,u,o]),i)
|
|
}function vt(n){return ze[n]}function ht(){var t=(t=Y.indexOf)===Pt?n:t;return t}function gt(n){var t,e;return n&&se.call(n)==z&&(t=n.constructor,!wt(t)||t instanceof t)?(d(n,function(n,t){e=t}),typeof e=="undefined"||be.call(n,e)):!1}function yt(n){return Pe[n]}function mt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&se.call(n)==$||!1}function _t(n,t,e){var r=qe(n),u=r.length;for(t=ut(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function bt(n){var t=[];return d(n,function(n,e){wt(n)&&t.push(e)
|
|
}),t.sort()}function dt(n){for(var t=-1,e=qe(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function wt(n){return typeof n=="function"}function jt(n){return!(!n||!V[typeof n])}function kt(n){return typeof n=="number"||n&&typeof n=="object"&&se.call(n)==q||!1}function xt(n){return typeof n=="string"||n&&typeof n=="object"&&se.call(n)==K||!1}function Ct(n){for(var t=-1,e=qe(n),r=e.length,u=Zt(r);++t<r;)u[t]=n[e[t]];return u}function Ot(n,t,e){var r=-1,u=ht(),o=n?n.length:0,i=!1;return e=(0>e?Se(0,o+e):e)||0,We(n)?i=-1<u(n,t,e):typeof o=="number"?i=-1<(xt(n)?n.indexOf(t,e):u(n,t,e)):y(n,function(n){return++r<e?void 0:!(i=n===t)
|
|
}),i}function It(n,t,e){var r=!0;t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else y(n,function(n,e,u){return r=!!t(n,e,u)});return r}function Nt(n,t,e){var r=[];t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else y(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Et(n,t,e){t=Y.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return y(n,function(n,e,r){return t(n,e,r)?(u=n,!1):void 0
|
|
}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function St(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else y(n,t);return n}function Rt(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=qe(n),r=u.length;y(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function At(n,t,e){var r=-1,u=n?n.length:0;if(t=Y.createCallback(t,e,3),typeof u=="number")for(var o=Zt(u);++r<u;)o[r]=t(n[r],r,n);
|
|
else o=[],y(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Dt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a>o&&(o=a)}}else t=null==t&&xt(n)?r:Y.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function $t(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Zt(r);++e<r;)u[e]=n[e][t];return u||At(n,t)}function Ft(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=ut(t,r,4);
|
|
var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else y(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)});return e}function Tt(n,t,e,r){var u=3>arguments.length;return t=ut(t,r,4),Rt(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Bt(n){var t=-1,e=n?n.length:0,r=Zt(typeof e=="number"?e:0);return St(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function Wt(n,t,e){var r;t=Y.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else y(n,function(n,e,u){return!(r=t(n,e,u))
|
|
});return!!r}function qt(e){var r=-1,u=ht(),i=e?e.length:0,a=it(arguments,!0,!0,1),f=[],l=i>=b&&u===n;if(l){var c=o(a);c?(u=t,a=c):l=!1}for(;++r<i;)c=e[r],0>u(a,c)&&f.push(c);return l&&p(a),f}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Y.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Re(Se(0,r),u))}function Pt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Se(0,u+r):r||0}else if(r)return r=Lt(t,e),t[r]===e?r:-1;
|
|
return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Y.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Se(0,t);return s(n,r)}function Lt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Y.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Mt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=!1),null!=e&&(e=Y.createCallback(e,r,3)),ct(n,t,e)}function Ut(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Dt($t(n,"length")):0,r=Zt(0>e?0:e);++t<e;)r[t]=$t(n,t);
|
|
return r}function Vt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Gt(n,t){return 2<arguments.length?st(n,17,s(arguments,2),null,t):st(n,1,null,null,t)}function Ht(n,t,e){function r(){c&&ge(c),i=c=p=h,(g||v!==t)&&(s=de(),a=n.apply(l,o))}function u(){var e=t-(de()-f);0<e?c=je(u,e):(i&&ge(i),e=p,i=c=p=h,e&&(s=de(),a=n.apply(l,o)))}var o,i,a,f,l,c,p,s=0,v=!1,g=!0;if(!wt(n))throw new fe;if(t=Se(0,t)||0,true===e)var y=!0,g=!1;else jt(e)&&(y=e.leading,v="maxWait"in e&&(Se(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);
|
|
return function(){if(o=arguments,f=de(),l=this,p=g&&(c||!y),false===v)var e=y&&!c;else{i||y||(s=f);var h=v-(f-s);0<h?i||(i=je(r,h)):(i&&(i=ge(i)),s=f,a=n.apply(l,o))}return c||t===v||(c=je(u,t)),e&&(a=n.apply(l,o)),a}}function Jt(n){if(!wt(n))throw new fe;var t=s(arguments,1);return je(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||wt(e);t||(e=nt,t=n,n=Y),St(bt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return we.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)
|
|
})})}function Yt(){return this.__wrapped__}e=e?Z.defaults(H.Object(),e,Z.pick(H,D)):H;var Zt=e.Array,ne=e.Boolean,te=e.Date,ee=e.Function,re=e.Math,ue=e.Number,oe=e.Object,ie=e.RegExp,ae=e.String,fe=e.TypeError,le=[],ce=oe.prototype,pe=e._,se=ce.toString,ve=ie("^"+ae(se).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),he=re.ceil,ge=e.clearTimeout,ye=re.floor,me=ee.prototype.toString,_e=ve.test(_e=oe.getPrototypeOf)&&_e,be=ce.hasOwnProperty,de=ve.test(de=te.now)&&de||function(){return+new te
|
|
},we=le.push,je=e.setTimeout,ke=le.splice,xe=function(){try{var n={},t=ve.test(t=oe.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ce=ve.test(Ce=oe.create)&&Ce,Oe=ve.test(Oe=Zt.isArray)&&Oe,Ie=e.isFinite,Ne=e.isNaN,Ee=ve.test(Ee=oe.keys)&&Ee,Se=re.max,Re=re.min,Ae=e.parseInt,De=re.random,$e=typeof($e=Ce&&"function"==!/\n/.test(Ce)&&!ve.test(e.attachEvent)&&X&&e.setImmediate)&&$e,Fe={};Fe[F]=Zt,Fe[T]=ne,Fe[B]=te,Fe[W]=ee,Fe[z]=oe,Fe[q]=ue,Fe[P]=ie,Fe[K]=ae,nt.prototype=Y.prototype;var Te=Y.support={};
|
|
Te.funcDecomp=!ve.test(e.a)&&R.test(v),Te.funcNames=typeof ee.name=="string",Y.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Y}},Ce||(rt=function(n){if(jt(n)){l.prototype=n;var t=new l;l.prototype=null}return t||{}});var Be=xe?function(n,t){U.value=t,xe(n,"__bindData__",U)}:l,We=Oe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&se.call(n)==F||!1},qe=Ee?function(n){return jt(n)?Ee(n):[]}:Q,ze={"&":"&","<":"<",">":">",'"':""","'":"'"},Pe=dt(ze),Ke=ie("("+qe(Pe).join("|")+")","g"),Le=ie("["+qe(ze).join("")+"]","g"),Me=pt(function(n,t,e){be.call(n,e)?n[e]++:n[e]=1
|
|
}),Ue=pt(function(n,t,e){(be.call(n,e)?n[e]:n[e]=[]).push(t)}),Ve=pt(function(n,t,e){n[e]=t});$e&&(Jt=function(n){if(!wt(n))throw new fe;return $e.apply(e,arguments)});var Ge=8==Ae(w+"08")?Ae:function(n,t){return Ae(xt(n)?n.replace(E,""):n,t||0)};return Y.after=function(n,t){if(!wt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},Y.assign=J,Y.at=function(n){for(var t=arguments,e=-1,r=it(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Zt(t);++e<t;)u[e]=n[r[e]];return u
|
|
},Y.bind=Gt,Y.bindAll=function(n){for(var t=1<arguments.length?it(arguments,!0,!1,1):bt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=st(n[u],1,null,null,n)}return n},Y.bindKey=function(n,t){return 2<arguments.length?st(t,19,s(arguments,2),null,n):st(t,3,null,null,n)},Y.chain=function(n){return n=new nt(n),n.__chain__=!0,n},Y.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},Y.compose=function(){for(var n=arguments,t=n.length;t--;)if(!wt(n[t]))throw new fe;
|
|
return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Y.countBy=Me,Y.create=function(n,t){var e=rt(n);return t?J(e,t):e},Y.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return ut(n,t,e);if("object"!=r)return function(t){return t[n]};var u=qe(n),o=u[0],i=n[o];return 1!=u.length||i!==i||jt(i)?function(t){for(var e=u.length,r=!1;e--&&(r=at(t[u[e]],n[u[e]],null,!0)););return r}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)}},Y.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,st(n,4,null,null,null,t)
|
|
},Y.debounce=Ht,Y.defaults=G,Y.defer=Jt,Y.delay=function(n,t){if(!wt(n))throw new fe;var e=s(arguments,2);return je(function(){n.apply(h,e)},t)},Y.difference=qt,Y.filter=Nt,Y.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=!1),null!=e&&(n=At(n,e,r)),it(n,t)},Y.forEach=St,Y.forEachRight=Rt,Y.forIn=d,Y.forInRight=function(n,t,e){var r=[];d(n,function(n,t){r.push(t,n)});var u=r.length;for(t=ut(t,e,3);u--&&false!==t(r[u--],r[u],n););return n
|
|
},Y.forOwn=y,Y.forOwnRight=_t,Y.functions=bt,Y.groupBy=Ue,Y.indexBy=Ve,Y.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Re(Se(0,u-r),u))},Y.intersection=function(e){for(var r=arguments,u=r.length,i=-1,f=a(),l=-1,s=ht(),v=e?e.length:0,h=[],g=a();++i<u;){var y=r[i];f[i]=s===n&&(y?y.length:0)>=b&&o(i?r[i]:g)}n:for(;++l<v;){var m=f[0],y=e[l];if(0>(m?t(m,y):s(g,y))){for(i=u,(m||g).push(y);--i;)if(m=f[i],0>(m?t(m,y):s(r[i],y)))continue n;
|
|
h.push(y)}}for(;u--;)(m=f[u])&&p(m);return c(f),c(g),h},Y.invert=dt,Y.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Zt(typeof o=="number"?o:0);return St(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},Y.keys=qe,Y.map=At,Y.max=Dt,Y.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):_+arguments[0];return be.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!wt(n))throw new fe;return e.cache={},e},Y.merge=function(n){var t=arguments,e=2;
|
|
if(!jt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=ut(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=a(),i=a();++u<e;)ft(n,t[u],r,o,i);return c(o),c(i),n},Y.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a<o&&(o=a)}}else t=null==t&&xt(n)?r:Y.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
|
|
});return o},Y.omit=function(n,t,e){var r=ht(),u=typeof t=="function",o={};if(u)t=Y.createCallback(t,e,3);else var i=it(arguments,!0,!1,1);return d(n,function(n,e,a){(u?!t(n,e,a):0>r(i,e))&&(o[e]=n)}),o},Y.once=function(n){var t,e;if(!wt(n))throw new fe;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},Y.pairs=function(n){for(var t=-1,e=qe(n),r=e.length,u=Zt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Y.partial=function(n){return st(n,16,s(arguments,1))},Y.partialRight=function(n){return st(n,32,null,s(arguments,1))
|
|
},Y.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=it(arguments,!0,!1,1),i=jt(n)?o.length:0;++u<i;){var a=o[u];a in n&&(r[a]=n[a])}else t=Y.createCallback(t,e,3),d(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Y.pluck=$t,Y.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,i=t[e];++o<u;)n[o]===i&&(ke.call(n,o--,1),u--);return n},Y.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Se(0,he((t-n)/(e||1)));
|
|
for(var u=Zt(t);++r<t;)u[r]=n,n+=e;return u},Y.reject=function(n,t,e){return t=Y.createCallback(t,e,3),Nt(n,function(n,e,r){return!t(n,e,r)})},Y.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=Y.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),ke.call(n,r--,1),u--);return o},Y.rest=Kt,Y.shuffle=Bt,Y.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,i=Zt(typeof o=="number"?o:0);for(t=Y.createCallback(t,e,3),St(n,function(n,e,u){var o=i[++r]=f();o.m=t(n,e,u),o.n=r,o.o=n}),o=i.length,i.sort(u);o--;)n=i[o],i[o]=n.o,p(n);
|
|
return i},Y.tap=function(n,t){return t(n),n},Y.throttle=function(n,t,e){var r=!0,u=!0;if(!wt(n))throw new fe;return false===e?r=!1:jt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),M.leading=r,M.maxWait=t,M.trailing=u,Ht(n,t,M)},Y.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Zt(n);for(t=ut(t,e,1);++r<n;)u[r]=t(r);return u},Y.toArray=function(n){return n&&typeof n.length=="number"?s(n):Ct(n)},Y.transform=function(n,t,e,r){var u=We(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;
|
|
e=rt(o&&o.prototype)}return t&&(t=ut(t,r,4),(u?St:y)(n,function(n,r,u){return t(e,n,r,u)})),e},Y.union=function(){return ct(it(arguments,!0,!0))},Y.uniq=Mt,Y.values=Ct,Y.where=Nt,Y.without=function(n){return qt(n,s(arguments,1))},Y.wrap=function(n,t){return st(t,16,[n])},Y.zip=Ut,Y.zipObject=Vt,Y.collect=At,Y.drop=Kt,Y.each=St,Y.eachRight=Rt,Y.extend=J,Y.methods=bt,Y.object=Vt,Y.select=Nt,Y.tail=Kt,Y.unique=Mt,Y.unzip=Ut,Xt(Y),Y.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),et(n,t,typeof e=="function"&&ut(e,r,1))
|
|
},Y.cloneDeep=function(n,t,e){return et(n,!0,typeof t=="function"&&ut(t,e,1))},Y.contains=Ot,Y.escape=function(n){return null==n?"":ae(n).replace(Le,vt)},Y.every=It,Y.find=Et,Y.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Y.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Y.findKey=function(n,t,e){var r;return t=Y.createCallback(t,e,3),y(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},Y.findLast=function(n,t,e){var r;return t=Y.createCallback(t,e,3),Rt(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0
|
|
}),r},Y.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Y.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Y.findLastKey=function(n,t,e){var r;return t=Y.createCallback(t,e,3),_t(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},Y.has=function(n,t){return n?be.call(n,t):!1},Y.identity=Qt,Y.indexOf=Pt,Y.isArguments=mt,Y.isArray=We,Y.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&se.call(n)==T||!1},Y.isDate=function(n){return n&&typeof n=="object"&&se.call(n)==B||!1
|
|
},Y.isElement=function(n){return n&&1===n.nodeType||!1},Y.isEmpty=function(n){var t=!0;if(!n)return t;var e=se.call(n),r=n.length;return e==F||e==K||e==$||e==z&&typeof r=="number"&&wt(n.splice)?!r:(y(n,function(){return t=!1}),t)},Y.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&ut(e,r,2))},Y.isFinite=function(n){return Ie(n)&&!Ne(parseFloat(n))},Y.isFunction=wt,Y.isNaN=function(n){return kt(n)&&n!=+n},Y.isNull=function(n){return null===n},Y.isNumber=kt,Y.isObject=jt,Y.isPlainObject=g,Y.isRegExp=function(n){return n&&typeof n=="object"&&se.call(n)==P||!1
|
|
},Y.isString=xt,Y.isUndefined=function(n){return typeof n=="undefined"},Y.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Se(0,r+e):Re(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Y.mixin=Xt,Y.noConflict=function(){return e._=pe,this},Y.parseInt=Ge,Y.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=!0)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=De(),Re(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)
|
|
},Y.reduce=Ft,Y.reduceRight=Tt,Y.result=function(n,t){if(n){var e=n[t];return wt(e)?n[t]():e}},Y.runInContext=v,Y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:qe(n).length},Y.some=Wt,Y.sortedIndex=Lt,Y.template=function(n,t,e){var r=Y.templateSettings;n=ae(n||""),e=G({},e,r);var u,o=G({},e.imports,r.imports),r=qe(o),o=Ct(o),a=0,f=e.interpolate||S,l="__p+='",f=ie((e.escape||S).source+"|"+f.source+"|"+(f===N?C:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(A,i),e&&(l+="'+__e("+e+")+'"),f&&(u=!0,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t
|
|
}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(j,""):l).replace(k,"$1").replace(x,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ee(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Y.unescape=function(n){return null==n?"":ae(n).replace(Ke,yt)},Y.uniqueId=function(n){var t=++m;return ae(null==n?"":n)+t
|
|
},Y.all=It,Y.any=Wt,Y.detect=Et,Y.findWhere=Et,Y.foldl=Ft,Y.foldr=Tt,Y.include=Ot,Y.inject=Ft,y(Y,function(n,t){Y.prototype[t]||(Y.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return we.apply(t,arguments),t=n.apply(Y,t),e?new nt(t,e):t})}),Y.first=zt,Y.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Y.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Se(0,u-r))},Y.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ct(n)),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Bt(n),n.length=Re(Se(0,t),n.length),n)
|
|
},Y.take=zt,Y.head=zt,y(Y,function(n,t){var e="sample"!==t;Y.prototype[t]||(Y.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 nt(o,u):o})}),Y.VERSION="2.2.1",Y.prototype.chain=function(){return this.__chain__=!0,this},Y.prototype.toString=function(){return ae(this.__wrapped__)},Y.prototype.value=Yt,Y.prototype.valueOf=Yt,St(["join","pop","shift"],function(n){var t=le[n];Y.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
|
return n?new nt(e,n):e}}),St(["push","reverse","sort","unshift"],function(n){var t=le[n];Y.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),St(["concat","slice","splice"],function(n){var t=le[n];Y.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Y}var h,g=[],y=[],m=0,_=+new Date+"",b=75,d=40,w=" \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=/\b__p\+='';/g,k=/\b(__p\+=)''\+/g,x=/(__e\(.*?\)|\b__t\))\+'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,I=/^function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,E=RegExp("^["+w+"]*0+(?=.$)"),S=/($^)/,R=/\bthis\b/,A=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),$="[object Arguments]",F="[object Array]",T="[object Boolean]",B="[object Date]",W="[object Function]",q="[object Number]",z="[object Object]",P="[object RegExp]",K="[object String]",L={};
|
|
L[W]=!1,L[$]=L[F]=L[T]=L[B]=L[q]=L[z]=L[P]=L[K]=!0;var M={leading:!1,maxWait:0,trailing:!1},U={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},H=V[typeof window]&&window||this,J=V[typeof exports]&&exports&&!exports.nodeType&&exports,Q=V[typeof module]&&module&&!module.nodeType&&module,X=Q&&Q.exports===J&&J,Y=V[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(H=Y);
|
|
var Z=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(H._=Z, define(function(){return Z})):J&&Q?X?(Q.exports=Z)._=Z:J._=Z:H._=Z}).call(this); |