Compare commits

...

23 Commits
1.0.0 ... 1.0.2

Author SHA1 Message Date
jdalton
7467a2a2eb Bump to v1.0.2. 2013-02-18 03:13:40 -07:00
John-David Dalton
2459a53350 Bump to v1.0.1.
Former-commit-id: b2536f9a226c7418ad3aaa7b5fb88282b77d20e5
2013-02-18 02:13:39 -08:00
John-David Dalton
7093e9c0d4 Add PhantomJS not to CONTRIBUTING.md.
Former-commit-id: e7c81af0fb6e1ede8f89d50ffdc5ec671e124252
2013-02-17 23:54:19 -08:00
John-David Dalton
4bc49978d1 Avoid using setImmediate in IE because it cannot be cleared with clearTimeout.
Former-commit-id: 836d49c6440b2313f1885456645ed4a00ab82ae6
2013-02-17 23:45:26 -08:00
John-David Dalton
96bac9c149 Add legacy underscore build test.
Former-commit-id: f56e254f7c2fb4c4adeac16b56c789dd8af8a986
2013-02-17 20:44:28 -08:00
John-David Dalton
8dcc15f4d3 Ensure setImmediate is not minified by the Closure Compiler.
Former-commit-id: 74c121d45854dba2aaaa65558c3e1ca8effd3096
2013-02-17 18:15:41 -08:00
John-David Dalton
8183740c04 Update vendors.
Former-commit-id: 6ab66f9ea6fd881e8c5ed18e84b9a24656496e10
2013-02-17 16:38:23 -08:00
John-David Dalton
25e4231d7b Update _.defer build dependencies.
Former-commit-id: 159f541373b01f259c9509e16c3fc0c2018e6d51
2013-02-17 16:13:42 -08:00
John-David Dalton
3ed9e0e905 Add support for specifying a source map URL in the to the -p/--source-map build options.
Former-commit-id: 2098da69d7902497e2e67210d778b8f99a5ff8f0
2013-02-17 16:02:53 -08:00
John-David Dalton
45bec0c440 Remove setImmediate use in the lodash legacy build and cleanup patterns.
Former-commit-id: a3c942e3545c278b7cac2112ed1a5417212048d9
2013-02-17 14:30:22 -08:00
John-David Dalton
5133e39d45 Make _.defer use setImmediate if available.
Former-commit-id: b3898d78725a4b203856916b1b071ab9c6f40b83
2013-02-17 14:29:40 -08:00
John-David Dalton
cb3b4e446e Ensure _.isEqual returns boolean values even if callback doesn't.
Former-commit-id: b2c31ee1711a436e5400c8e80c9f54a9680301b7
2013-02-17 10:41:05 -08:00
John-David Dalton
9829a2f3b4 Rebuild files.
Former-commit-id: c381088f55093f25067d0284319975c868e6e3bf
2013-02-16 23:18:05 -08:00
John-David Dalton
7eadf11145 Optimize the ES6 template delimiter regexp and regexp to detect strings.
Former-commit-id: 6177f2b32f27515cf8edcac6036d0adb58ebfcd0
2013-02-16 23:17:17 -08:00
John-David Dalton
2a2bc44f43 Make _.where search arrays for values.
Former-commit-id: b942c6a44680c78fae1a41f2cf994be09ffcfbb9
2013-02-16 00:39:45 -08:00
John-David Dalton
9ccfa5cec9 Convert map files via JSON.parse instead of using string manipulation in minify.js.
Former-commit-id: 185b77d45995f17c586f35d6ad447074d677a6ae
2013-02-15 08:58:20 -08:00
John-David Dalton
02687f3c78 Ensure the second argument passed to _.assign is not treated as a callback. [closes #184]
Former-commit-id: 1254e11ab02d1d5055c08400cd0a4786ed71aef2
2013-02-15 08:11:19 -08:00
John-David Dalton
7ea7a6cbb1 Automatically set a source map's "sources" key based on the build performed.
Former-commit-id: c02c88dfd1db097a3f98113ee57c3da850da5abb
2013-02-15 00:23:03 -08:00
John-David Dalton
a15a28fe5b Add -p and --source-map unit tests.
Former-commit-id: c7416ca507ce9376adb31e91a294e2e40073788c
2013-02-14 20:47:23 -08:00
Kit Cambridge
265dedfae1 Fix typo that caused sourceMappingURL to be undefined in source map builds.
Former-commit-id: ff3b22a7965c15a1ae072f8e9d51009e095ec443
2013-02-14 17:36:43 -08:00
John-David Dalton
5ddbb8bc56 Remove unneeded __d variable from _.template.
Former-commit-id: 4ff32444d7e96f8b9cc39e61c1ce17fb34fa357c
2013-02-14 09:21:06 -08:00
John-David Dalton
4101b8e937 Remove reInsertVariable cleanup in build/pre-compile.js.
Former-commit-id: 1fa75107e8c43362b57021292e26397145e62e39
2013-02-14 09:03:47 -08:00
John-David Dalton
56b6d50479 Tweak _.at docs.
Former-commit-id: 505e34b0a151287d78da73a1140d4aefdf45b43b
2013-02-14 09:03:06 -08:00
22 changed files with 1562 additions and 1560 deletions

View File

@@ -7,7 +7,7 @@ Please make sure to [search the issue tracker](https://github.com/bestiejs/lodas
Include updated unit tests in the `test` directory as part of your pull request. Include updated unit tests in the `test` directory as part of your pull request.
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser. You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [RingoJS](http://ringojs.org/), [Narwhal](https://github.com/280north/narwhal), and [Node](http://nodejs.org/), before running them in your default browser. The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well. The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
## Contributor License Agreement ## Contributor License Agreement

251
README.md
View File

@@ -1,186 +1,30 @@
# Lo-Dash <sup>v1.0.0</sup> # Lo-Dash v1.0.2
[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)
An alternative to Underscore.js, delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features). A utility library delivering consistency, [customization](https://lodash.com/custom-builds), [performance](https://lodash.com/benchmarks), & [extras](https://lodash.com/#features).
## Download ## Download
* Lo-Dash builds (for modern environments):<br> * Lo-Dash builds (for modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.js) and [Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.min.js) [Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.min.js)
* Lo-Dash compatibility builds (for legacy and modern environments):<br> * Lo-Dash compatibility builds (for legacy and modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.compat.js) and [Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.compat.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.compat.min.js) [Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.compat.min.js)
* Underscore compatibility builds:<br> * Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.underscore.js) and [Development](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0/dist/lodash.underscore.min.js) [Production](https://raw.github.com/lodash/lodash/1.0.2/dist/lodash.underscore.min.js)
* CDN copies of ≤ v1.0.0s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br> * For optimal file size, [create a custom build](https://lodash.com/custom-builds) with only the features you need
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.min.js),<br>
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.compat.js),
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.compat.min.js),<br>
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0/lodash.underscore.min.js)
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
## Dive in ## Dive in
Weve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). Weve got [API docs](https://lodash.com/docs), [benchmarks](https://lodash.com/benchmarks), and [unit tests](https://lodash.com/tests).
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap). For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
## Screencasts The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).
For more information check out these screencasts over Lo-Dash:
* [Introducing Lo-Dash](https://vimeo.com/44154599)
* [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
* [Lo-Dashs origin and why its a better utility belt](https://vimeo.com/44154600)
* [Unit testing in Lo-Dash](https://vimeo.com/45865290)
* [Lo-Dashs approach to native method use](https://vimeo.com/48576012)
* [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
## Features
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an objects own and inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an objects own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
* [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
[and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
[and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
* [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map),
[and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
## Support
Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.19, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
## Custom builds
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you.
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash
lodash backbone
```
* CSP builds, supporting default [Content Security Policy](https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
The `csp` modifier is an alais of the `mobile` modifier. Lo-Dash may be used in Chrome extensions by using either the `csp`, `mobile`, or `underscore` build and using precompiled templates, or loading Lo-Dash in a [sandbox](http://developer.chrome.com/stable/extensions/sandboxingEval.html).
```bash
lodash csp
```
* Legacy builds, tailored for older environments without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
```bash
lodash legacy
```
* Modern builds, tailored for newer environments with ES5 support, may be created using the `modern` modifier argument.
```bash
lodash modern
```
* Mobile builds, without method compilation and most bug fixes for old browsers, may be created using the `mobile` modifier argument.
```bash
lodash mobile
```
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
```bash
lodash strict
```
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
```bash
lodash underscore
```
Custom builds may be created using the following commands:
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
```bash
lodash category=collections,functions
lodash category="collections, functions"
```
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
```bash
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
```
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
```bash
lodash iife="!function(window,undefined){%output%}(this)"
```
* Use the `include` argument to pass comma separated method/category names to include in the build.
```bash
lodash include=each,filter,map
lodash include="each, filter, map"
```
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
```bash
lodash underscore minus=result,shuffle
lodash underscore minus="result, shuffle"
```
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
```bash
lodash backbone plus=random,template
lodash backbone plus="random, template"
```
* Use the `template` argument to pass the file path pattern used to match template files to precompile.
```bash
lodash template="./*.jst"
```
* Use the `settings` argument to pass the template settings used when precompiling templates.
```bash
lodash settings="{interpolate:/\{\{([\s\S]+?)\}\}/g}"
```
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
```bash
lodash moduleId="underscore"
```
All arguments, except `legacy` with `csp`, `mobile`, `modern`, or `underscore`, may be combined.<br>
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
The following options are also supported:
* `-c`, `--stdout` ......... Write output to standard output
* `-d`, `--debug` ........... Write only the non-minified development output
* `-h`, `--help` ............. Display help information
* `-m`, `--minify` ......... Write only the minified production output
* `-o`, `--output` ......... Write output to a given path/filename
* `-p`, `--source-map` .. Generate a source map for the minified output
* `-s`, `--silent` ......... Skip status updates normally logged to the console
* `-V`, `--version` ....... Output current version of Lo-Dash
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
## Installation and usage ## Installation and usage
@@ -241,47 +85,44 @@ require({
}); });
``` ```
## Release Notes ## Resources
### <sup>v1.0.0</sup> For more information check out these articles, screencasts, and other videos over Lo-Dash:
#### Compatibility Warnings * Posts
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
* Made `_.defaults` preserve `null` values, instead of overwriting them * Videos
- [Introducing Lo-Dash](https://vimeo.com/44154599)
- [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
- [Lo-Dashs origin and why its a better utility belt](https://vimeo.com/44154600)
- [Unit testing in Lo-Dash](https://vimeo.com/45865290)
- [Lo-Dashs approach to native method use](https://vimeo.com/48576012)
- [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
#### Changes ## Features
* Added [_.at](http://lodash.com/docs#at) and [_.partialRight](http://lodash.com/docs#partialRight) * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
* Added [*“imports”*](http://lodash.com/docs#templateSettings_imports) option to `_.templateSettings` * [_(…)](https://lodash.com/docs#_) supports intuitive chaining
* Added `modern` and `--source-map`/`-p` build options * [_.at](https://lodash.com/docs#at) for cherry-picking collection values
* Added support for *“_.pluck”* and *“_.where”* `callback` shorthands * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
* Ensured `_.assign` and `_.defaults` support arrays * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays and objects
* Ensured `_.merge` assigns `null` values and produces dense arrays * [_.contains](https://lodash.com/docs#contains) accepts a `fromIndex` argument
* Deferred minifier downloads until the `lodash` utility requires them * [_.forEach](https://lodash.com/docs#forEach) is chainable and supports exiting iteration early
* Flipped `noNodeClass` test to avoid triggering Firebugs *“break on all errors”* feature * [_.forIn](https://lodash.com/docs#forIn) for iterating over an objects own and inherited properties
* Made `_.where` support deep object comparisons * [_.forOwn](https://lodash.com/docs#forOwn) for iterating over an objects own properties
* Optimized `_.invert`, `_.pairs`, and `_.values` * [_.isPlainObject](https://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
* Reduced `_.max`, `_.min`, `_.pluck`, `_.toArray`, and `_.where` * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend)
* Simplified `createIterator` and `iteratorTemplate` * [_.partial](https://lodash.com/docs#partial) and [_.partialRight](https://lodash.com/docs#partialRight) for partial application without `this` binding
* Tweaked `_.uniqueId` to avoid problems with buggy minifiers * [_.template](https://lodash.com/docs#template) supports [*“imports”* options](https://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* Updated `underscore` build compatibility to v1.4.4 * [_.where](https://lodash.com/docs#where) supports deep object comparisons
* Added support for `callback` and `thisArg` arguments to `_.assign`, `_.clone`,<br> * [_.clone](https://lodash.com/docs#clone), [_.omit](https://lodash.com/docs#omit), [_.pick](https://lodash.com/docs#pick),
`_.cloneDeep`, `_.first`, `_.last`, `_.initial`, `_.isEqual`, `_.merge`, and `_.rest` [and more…](https://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments
* [_.contains](https://lodash.com/docs#contains), [_.size](https://lodash.com/docs#size), [_.toArray](https://lodash.com/docs#toArray),
[and more…](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
* [_.filter](https://lodash.com/docs#filter), [_.find](https://lodash.com/docs#find), [_.map](https://lodash.com/docs#map),
[and more…](https://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). ## Support
## BestieJS Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5.
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Author
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

View File

@@ -79,7 +79,7 @@
'countBy': ['forEach', 'identity', 'isEqual', 'keys'], 'countBy': ['forEach', 'identity', 'isEqual', 'keys'],
'debounce': [], 'debounce': [],
'defaults': ['isArray', 'forEach', 'forOwn'], 'defaults': ['isArray', 'forEach', 'forOwn'],
'defer': [], 'defer': ['bind'],
'delay': [], 'delay': [],
'difference': ['indexOf'], 'difference': ['indexOf'],
'escape': [], 'escape': [],
@@ -472,8 +472,14 @@
var source = [ var source = [
';(function(window) {', ';(function(window) {',
" var freeExports = typeof exports == 'object' && exports &&", " var freeExports = typeof exports == 'object' && exports;",
" (typeof global == 'object' && global && global == global.global && (window = global), exports);", '',
" var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;",
'',
" var freeGlobal = typeof global == 'object' && global;",
' if (freeGlobal.global === freeGlobal) {',
' window = freeGlobal;',
' }',
'', '',
' var templates = {},', ' var templates = {},',
' _ = window._;', ' _ = window._;',
@@ -505,8 +511,8 @@
' lodash.templates = lodash.extend(lodash.templates || {}, templates);', ' lodash.templates = lodash.extend(lodash.templates || {}, templates);',
' });', ' });',
" } else if (freeExports) {", " } else if (freeExports) {",
" if (typeof module == 'object' && module && module.exports == freeExports) {", " if (freeModule) {",
' (module.exports = templates).templates = templates;', ' (freeModule.exports = templates).templates = templates;',
' } else {', ' } else {',
' freeExports.templates = templates;', ' freeExports.templates = templates;',
' }', ' }',
@@ -594,7 +600,7 @@
' -h, --help Display help information', ' -h, --help Display help information',
' -m, --minify Write only the minified production output', ' -m, --minify Write only the minified production output',
' -o, --output Write output to a given path/filename', ' -o, --output Write output to a given path/filename',
' -p, --source-map Generate a source map for the minified output', ' -p, --source-map Generate a source map for the minified output, using an optional source map URL',
' -s, --silent Skip status updates normally logged to the console', ' -s, --silent Skip status updates normally logged to the console',
' -V, --version Output current version of Lo-Dash', ' -V, --version Output current version of Lo-Dash',
'' ''
@@ -989,7 +995,7 @@
source = source.replace(getIteratorTemplate(source), function(match) { source = source.replace(getIteratorTemplate(source), function(match) {
return match return match
.replace(/(?: *\/\/.*\n)* *["'] *(?:<% *)?if *\(hasEnumPrototype *(?:&&|\))[\s\S]+?<% *} *(?:%>|["']).+/g, '') .replace(/(?: *\/\/.*\n)* *["'] *(?:<% *)?if *\(hasEnumPrototype *(?:&&|\))[\s\S]+?<% *} *(?:%>|["']).+/g, '')
.replace(/hasEnumPrototype *\|\|/g, ''); .replace(/hasEnumPrototype *\|\|\s*/g, '');
}); });
return source; return source;
@@ -1071,7 +1077,7 @@
// remove `noArgsClass` from `_.isEmpty` // remove `noArgsClass` from `_.isEmpty`
source = source.replace(matchFunction(source, 'isEmpty'), function(match) { source = source.replace(matchFunction(source, 'isEmpty'), function(match) {
return match.replace(/ *\|\| *\(noArgsClass *&&[^)]+?\)\)/g, ''); return match.replace(/ *\|\|\s*\(noArgsClass *&&[^)]+?\)\)/g, '');
}); });
return source; return source;
@@ -1136,7 +1142,7 @@
source = source.replace(getIteratorTemplate(source), function(match) { source = source.replace(getIteratorTemplate(source), function(match) {
return match return match
.replace(/(?: *\/\/.*\n)*( *["'] *)<% *} *else *if *\(nonEnumArgs[\s\S]+?(\1<% *} *%>.+)/, '$2') .replace(/(?: *\/\/.*\n)*( *["'] *)<% *} *else *if *\(nonEnumArgs[\s\S]+?(\1<% *} *%>.+)/, '$2')
.replace(/ *\|\| *nonEnumArgs/, ''); .replace(/ *\|\|\s*nonEnumArgs/, '');
}); });
return source; return source;
@@ -1160,12 +1166,12 @@
// remove `noNodeClass` from `_.clone` // remove `noNodeClass` from `_.clone`
source = source.replace(matchFunction(source, 'clone'), function(match) { source = source.replace(matchFunction(source, 'clone'), function(match) {
return match.replace(/ *\|\| *\(noNodeClass[\s\S]+?\)\)/, ''); return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)/, '');
}); });
// remove `noNodeClass` from `_.isEqual` // remove `noNodeClass` from `_.isEqual`
source = source.replace(matchFunction(source, 'isEqual'), function(match) { source = source.replace(matchFunction(source, 'isEqual'), function(match) {
return match.replace(/ *\|\| *\(noNodeClass[\s\S]+?\)\)\)/, ''); return match.replace(/ *\|\|\s*\(noNodeClass[\s\S]+?\)\)\)/, '');
}); });
return source; return source;
@@ -1184,6 +1190,17 @@
.replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, ''); .replace(/(?:\s*\/\/.*)*\n( *)if *\(hasObjectSpliceBug[\s\S]+?(?:{\s*}|\n\1})/, '');
} }
/**
* Removes the `setImmediate` fork of `_.defer`.
*
* @private
* @param {String} source The source to process.
* @returns {String} Returns the modified source.
*/
function removeSetImmediate(source) {
return source.replace(/(?:\s*\/\/.*)*\n( *)if *\(isV8 *&& *freeModule[\s\S]+?\n\1}/, '');
}
/** /**
* Removes a given variable from `source`. * Removes a given variable from `source`.
* *
@@ -1304,13 +1321,16 @@
// the debug version of `source` // the debug version of `source`
var debugSource; var debugSource;
// used to specify the source map URL
var sourceMapURL;
// used to report invalid command-line arguments // used to report invalid command-line arguments
var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) { var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) {
if (/^(?:-o|--output)$/.test(options[index - 1]) || if (/^(?:-o|--output)$/.test(options[index - 1]) ||
/^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/.test(value)) { /^(?:category|exclude|exports|iife|include|moduleId|minus|plus|settings|template)=.*$/.test(value)) {
return true; return true;
} }
return [ var result = [
'backbone', 'backbone',
'csp', 'csp',
'legacy', 'legacy',
@@ -1328,6 +1348,12 @@
'-s', '--silent', '-s', '--silent',
'-V', '--version' '-V', '--version'
].indexOf(value) > -1; ].indexOf(value) > -1;
if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) {
result = true;
sourceMapURL = value;
}
return result;
}); });
// report invalid arguments // report invalid arguments
@@ -1517,8 +1543,8 @@
useUnderscoreClone = methods.indexOf('clone') < 0; useUnderscoreClone = methods.indexOf('clone') < 0;
} }
// update dependencies // update dependencies
if (isModern || isUnderscore) { if (isLegacy) {
dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isEqual', 'isString'); dependencyMap.defer = _.without(dependencyMap.defer, 'bind');
} }
if (isUnderscore) { if (isUnderscore) {
dependencyMap.contains = _.without(dependencyMap.contains, 'isString'); dependencyMap.contains = _.without(dependencyMap.contains, 'isString');
@@ -1546,6 +1572,9 @@
dependencyMap.clone = _.without(dependencyMap.clone, 'forEach', 'forOwn'); dependencyMap.clone = _.without(dependencyMap.clone, 'forEach', 'forOwn');
} }
} }
if (isModern || isUnderscore) {
dependencyMap.reduceRight = _.without(dependencyMap.reduceRight, 'isEqual', 'isString');
}
// add method names explicitly // add method names explicitly
if (includeMethods.length) { if (includeMethods.length) {
@@ -2098,6 +2127,8 @@
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
if (isLegacy) { if (isLegacy) {
source = removeSetImmediate(source);
_.each(['isBindFast', 'isV8', 'nativeBind', 'nativeIsArray', 'nativeKeys', 'reNative'], function(varName) { _.each(['isBindFast', 'isV8', 'nativeBind', 'nativeIsArray', 'nativeKeys', 'reNative'], function(varName) {
source = removeVar(source, varName); source = removeVar(source, varName);
}); });
@@ -2109,7 +2140,7 @@
// remove native `Array.isArray` branch in `_.isArray` // remove native `Array.isArray` branch in `_.isArray`
source = source.replace(matchFunction(source, 'isArray'), function(match) { source = source.replace(matchFunction(source, 'isArray'), function(match) {
return match.replace(/nativeIsArray * \|\|/, ''); return match.replace(/nativeIsArray * \|\|\s*/, '');
}); });
// replace `_.keys` with `shimKeys` // replace `_.keys` with `shimKeys`
@@ -2245,7 +2276,7 @@
// minor cleanup // minor cleanup
snippet = snippet snippet = snippet
.replace(/obj *\|\| *\(obj *= *{}\);/, '') .replace(/obj *\|\|\s*\(obj *= *{}\);/, '')
.replace(/var __p = '';\s*__p \+=/, 'var __p ='); .replace(/var __p = '';\s*__p \+=/, 'var __p =');
// remove comments, including sourceURLs // remove comments, including sourceURLs
@@ -2279,7 +2310,7 @@
source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1'); source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +define[\s\S]+?else /, '$1');
} }
if (!isNode) { if (!isNode) {
source = source.replace(/(?: *\/\/.*\n)*( *)if *\(typeof +module[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2'); source = source.replace(/(?: *\/\/.*\n)*( *)if *\(freeModule[\s\S]+?else *{([\s\S]+?\n)\1}\n/, '$1$2');
} }
if (!isCommonJS) { 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/, '');
@@ -2293,9 +2324,6 @@
} else { } else {
source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{([\s\S]+?) *})?\n/, '$1\n'); source = source.replace(/(?: *\/\/.*\n)* *(?:else )?if *\(freeExports\) *{\s*}(?:\s*else *{([\s\S]+?) *})?\n/, '$1\n');
} }
if ((source.match(/\bfreeExports\b/g) || []).length < 2) {
source = removeVar(source, 'freeExports');
}
}()); }());
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@@ -2363,6 +2391,7 @@
source = removeHasEnumPrototype(source); source = removeHasEnumPrototype(source);
} }
if (isRemoved(source, 'createIterator', 'bind', 'keys')) { if (isRemoved(source, 'createIterator', 'bind', 'keys')) {
source = removeSetImmediate(source);
source = removeVar(source, 'isBindFast'); source = removeVar(source, 'isBindFast');
source = removeVar(source, 'isV8'); source = removeVar(source, 'isV8');
source = removeVar(source, 'nativeBind'); source = removeVar(source, 'nativeBind');
@@ -2377,6 +2406,12 @@
source = source.replace(/^ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/m, ''); source = source.replace(/^ *\(function\(\) *{[\s\S]+?}\(1\)\);\n/m, '');
} }
} }
if ((source.match(/\bfreeModule\b/g) || []).length < 2) {
source = removeVar(source, 'freeModule');
}
if ((source.match(/\bfreeExports\b/g) || []).length < 2) {
source = removeVar(source, 'freeExports');
}
debugSource = cleanupSource(source); debugSource = cleanupSource(source);
source = cleanupSource(source); source = cleanupSource(source);
@@ -2413,10 +2448,11 @@
}); });
} }
else if (!isStdOut) { else if (!isStdOut) {
filePath = outputPath || path.join(cwd, basename + '.js');
outputUsed = true; outputUsed = true;
callback({ callback({
'source': debugSource, 'source': debugSource,
'outputPath': outputPath || path.join(cwd, basename + '.js') 'outputPath': filePath
}); });
} }
} }
@@ -2434,6 +2470,7 @@
'isTemplate': isTemplate, 'isTemplate': isTemplate,
'modes': isIIFE && ['simple', 'hybrid'], 'modes': isIIFE && ['simple', 'hybrid'],
'outputPath': outputPath, 'outputPath': outputPath,
'sourceMapURL': sourceMapURL,
'onComplete': function(data) { 'onComplete': function(data) {
if (isCustom) { if (isCustom) {
data.source = addCommandsToHeader(data.source, options); data.source = addCommandsToHeader(data.source, options);

View File

@@ -7,8 +7,9 @@
https = require('https'), https = require('https'),
path = require('path'), path = require('path'),
spawn = require('child_process').spawn, spawn = require('child_process').spawn,
zlib = require('zlib'),
tar = require('../vendor/tar/tar.js'), tar = require('../vendor/tar/tar.js'),
zlib = require('zlib'); _ = require('../lodash.js');
/** Load other modules */ /** Load other modules */
var preprocess = require('./pre-compile.js'), var preprocess = require('./pre-compile.js'),
@@ -18,7 +19,7 @@
var closureId = '23cf67d0f0b979d97631fc108a2a43bb82225994'; var closureId = '23cf67d0f0b979d97631fc108a2a43bb82225994';
/** The Git object ID of `uglifyjs.tar.gz` */ /** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = '326ede8f4a3d8e0ae82cec7b9579d45892836629'; var uglifyId = 'a934fb18f8fa2768c6a68de44b6e035fe96a268b';
/** The path of the directory that is the base of the repository */ /** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..')); var basePath = fs.realpathSync(path.join(__dirname, '..'));
@@ -80,7 +81,12 @@
* onComplete - The function called once minification has finished. * onComplete - The function called once minification has finished.
*/ */
function minify(source, options) { function minify(source, options) {
// used to specify the source map URL
var sourceMapURL;
// used to specify the default minifer modes
var modes = ['simple', 'advanced', 'hybrid']; var modes = ['simple', 'advanced', 'hybrid'];
source || (source = ''); source || (source = '');
options || (options = {}); options || (options = {});
@@ -89,6 +95,35 @@
// convert commands to an options object // convert commands to an options object
options = source; options = source;
// used to report invalid command-line arguments
var invalidArgs = _.reject(options.slice(options[0] == 'node' ? 2 : 0), function(value, index, options) {
if (/^(?:-o|--output)$/.test(options[index - 1]) ||
/^modes=.*$/.test(value)) {
return true;
}
var result = [
'-o', '--output',
'-p', '--source-map',
'-s', '--silent',
'-t', '--template'
].indexOf(value) > -1;
if (!result && /^(?:-p|--source-map)$/.test(options[index - 1])) {
result = true;
sourceMapURL = value;
}
return result;
});
// report invalid arguments
if (invalidArgs.length) {
console.log(
'\n' +
'Invalid argument' + (invalidArgs.length > 1 ? 's' : '') +
' passed: ' + invalidArgs.join(', ')
);
return;
}
var filePath = options[options.length - 1], var filePath = options[options.length - 1],
isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1, isMapped = options.indexOf('-p') > -1 || options.indexOf('--source-map') > -1,
isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1, isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1,
@@ -114,7 +149,8 @@
'isSilent': isSilent, 'isSilent': isSilent,
'isTemplate': isTemplate, 'isTemplate': isTemplate,
'modes': modes, 'modes': modes,
'outputPath': outputPath 'outputPath': outputPath,
'sourceMapURL': sourceMapURL
}; };
source = fs.readFileSync(filePath, 'utf8'); source = fs.readFileSync(filePath, 'utf8');
@@ -186,6 +222,7 @@
this.isSilent = !!options.isSilent; this.isSilent = !!options.isSilent;
this.isTemplate = !!options.isTemplate; this.isTemplate = !!options.isTemplate;
this.outputPath = options.outputPath; this.outputPath = options.outputPath;
this.sourceMapURL = options.sourceMapURL;
var modes = this.modes = options.modes; var modes = this.modes = options.modes;
source = this.source = preprocess(source, options); source = this.source = preprocess(source, options);
@@ -305,9 +342,10 @@
var filePath = this.filePath, var filePath = this.filePath,
isAdvanced = mode == 'advanced', isAdvanced = mode == 'advanced',
isMapped = this.isMapped, isMapped = this.isMapped,
mapPath = getMapPath(outputPath),
options = closureOptions.slice(), options = closureOptions.slice(),
outputPath = this.outputPath; outputPath = this.outputPath,
mapPath = getMapPath(outputPath),
sourceMapURL = this.sourceMapURL || path.basename(mapPath);
// remove copyright header to make other modifications easier // remove copyright header to make other modifications easier
var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0]; var license = (/^(?:\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*/.exec(source) || [''])[0];
@@ -369,13 +407,12 @@
if (isMapped) { if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8'); var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath); fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
output = output mapOutput = JSON.parse(mapOutput);
.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + path.basename(mapPath)) + '\n*/'; mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = mapOutput mapOutput = JSON.stringify(mapOutput, null, 2);
.replace(/("file":)""/, '$1"' + path.basename(outputPath) + '"')
.replace(/("sources":)\["stdin"\]/, '$1["' + path.basename(filePath) + '"]');
} }
callback(exception, output, mapOutput); callback(exception, output, mapOutput);
}); });

View File

@@ -70,6 +70,7 @@
'bind', 'bind',
'bindAll', 'bindAll',
'bindKey', 'bindKey',
'clearTimeout',
'clone', 'clone',
'cloneDeep', 'cloneDeep',
'collect', 'collect',
@@ -164,6 +165,8 @@
'rest', 'rest',
'result', 'result',
'select', 'select',
'setImmediate',
'setTimeout',
'shuffle', 'shuffle',
'size', 'size',
'some', 'some',
@@ -233,7 +236,7 @@
source = source.replace("result[length]['value']", 'result[length].value'); source = source.replace("result[length]['value']", 'result[length].value');
// remove whitespace from string literals // remove whitespace from string literals
source = source.replace(/^([ "'\w]+:)? *"(?:(?=(\\?))\2.)*?"|'(?:(?=(\\?))\3.)*?'/gm, function(string, captured) { source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) {
// remove object literal property name // remove object literal property name
if (/:$/.test(captured)) { if (/:$/.test(captured)) {
string = string.slice(captured.length); string = string.slice(captured.length);
@@ -247,7 +250,7 @@
}); });
// remove whitespace from `_.template` related regexes // remove whitespace from `_.template` related regexes
source = source.replace(/(?:reEmptyString\w+|reInsertVariable) *=.+/g, function(match) { source = source.replace(/reEmptyString\w+ *=.+/g, function(match) {
return match.replace(/ |\\n/g, ''); return match.replace(/ |\\n/g, '');
}); });

74
dist/lodash.compat.js vendored
View File

@@ -1,17 +1,20 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) <http://lodash.com/> * Lo-Dash 1.0.2 (Custom Build) <https://lodash.com/>
* Build: `lodash -o ./dist/lodash.compat.js` * Build: `lodash -o ./dist/lodash.compat.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license> * Available under MIT license <https://lodash.com/license>
*/ */
;(function(window, undefined) { ;(function(window, undefined) {
/** Detect free variable `exports` */ /** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports; var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global` and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal) {
@@ -56,7 +59,7 @@
* Used to match ES6 template delimiters * Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
*/ */
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match "interpolate" template delimiters */ /** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g; var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -183,7 +186,7 @@
var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx';
/** /**
* Detect if a node's [[Class]] is unresolvable (IE < 9) * Detect if a DOM node's [[Class]] is unresolvable (IE < 9)
* and that the JS engine won't error when attempting to coerce an object to * and that the JS engine won't error when attempting to coerce an object to
* a string without a `toString` function. * a string without a `toString` function.
*/ */
@@ -1053,12 +1056,10 @@
'top': 'top':
defaultsIteratorOptions.top.replace(';', defaultsIteratorOptions.top.replace(';',
';\n' + ';\n' +
'if (argsLength > 2) {\n' + "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" +
" if (typeof args[argsLength - 2] == 'function') {\n" + ' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" +
" } else if (typeof args[argsLength - 1] == 'function') {\n" + ' callback = args[--argsLength];\n' +
' callback = args[--argsLength];\n' +
' }\n' +
'}' '}'
), ),
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
@@ -1563,16 +1564,27 @@
// recursively compare objects and arrays (susceptible to call stack limits) // recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) { if (isArr) {
// compare lengths to determine if a deep comparison is necessary length = a.length;
size = b.length; size = b.length;
result = whereIndicator || size == a.length;
if (result) { // compare lengths to determine if a deep comparison is necessary
// deep compare the contents, ignoring non-numeric properties result = size == a.length;
while (size--) { if (!result && !whereIndicator) {
if (!(result = isEqual(a[size], b[size], callback, thisArg, stackA, stackB))) { return result;
break; }
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (whereIndicator) {
while (index--) {
if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) {
break;
}
} }
} else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) {
break;
} }
} }
return result; return result;
@@ -1915,12 +1927,10 @@
if (typeof deepIndicator != 'number') { if (typeof deepIndicator != 'number') {
length = args.length; length = args.length;
} }
if (length > 2) { if (length > 3 && typeof args[length - 2] == 'function') {
if (typeof args[length - 2] == 'function') { callback = createCallback(args[--length - 1], args[length--], 2);
callback = createCallback(args[--length - 1], args[length--], 2); } else if (length > 2 && typeof args[length - 1] == 'function') {
} else if (typeof args[length - 1] == 'function') { callback = args[--length];
callback = args[--length];
}
} }
} }
while (++index < length) { while (++index < length) {
@@ -2127,7 +2137,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates an array of elements from the specified index(es), or keys, of the * Creates an array of elements from the specified indexes, or keys, of the
* `collection`. Indexes may be specified as individual arguments or as arrays * `collection`. Indexes may be specified as individual arguments or as arrays
* of indexes. * of indexes.
* *
@@ -2135,7 +2145,7 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Array|Number|String} [index1, index2, ...] The index(es) of * @param {Array|Number|String} [index1, index2, ...] The indexes of
* `collection` to retrieve, either as individual arguments or arrays. * `collection` to retrieve, either as individual arguments or arrays.
* @returns {Array} Returns a new array of elements corresponding to the * @returns {Array} Returns a new array of elements corresponding to the
* provided indexes. * provided indexes.
@@ -4221,6 +4231,10 @@
var args = slice(arguments, 1); var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js
if (isV8 && freeModule && typeof setImmediate == 'function') {
defer = bind(setImmediate, window);
}
/** /**
* Creates a function that memoizes the result of `func`. If `resolver` is * Creates a function that memoizes the result of `func`. If `resolver` is
@@ -4578,7 +4592,7 @@
* build and using precompiled templates, or loading Lo-Dash in a sandbox. * build and using precompiled templates, or loading Lo-Dash in a sandbox.
* *
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * https://lodash.com/#custom-builds
* *
* For more information on Chrome extension sandboxes see: * For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html * http://developer.chrome.com/stable/extensions/sandboxingEval.html
@@ -4726,7 +4740,7 @@
(isEvaluating (isEvaluating
? ', __j = Array.prototype.join;\n' + ? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n" "function print() { __p += __j.call(arguments, '') }\n"
: (hasVariable ? '' : ', __d = ' + variable + '.' + variable + ' || ' + variable) + ';\n' : ';\n'
) + ) +
source + source +
'return __p\n}'; 'return __p\n}';
@@ -5052,7 +5066,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.0.0'; lodash.VERSION = '1.0.2';
// add "Chaining" functions to the wrapper // add "Chaining" functions to the wrapper
lodash.prototype.toString = wrapperToString; lodash.prototype.toString = wrapperToString;
@@ -5123,8 +5137,8 @@
// check for `exports` after `define` in case a build optimizer adds an `exports` object // check for `exports` after `define` in case a build optimizer adds an `exports` object
else if (freeExports) { else if (freeExports) {
// in Node.js or RingoJS v0.8.0+ // in Node.js or RingoJS v0.8.0+
if (typeof module == 'object' && module && module.exports == freeExports) { if (freeModule) {
(module.exports = lodash)._ = lodash; (freeModule.exports = lodash)._ = lodash;
} }
// in Narwhal or RingoJS v0.7.0- // in Narwhal or RingoJS v0.7.0-
else { else {

View File

@@ -1,42 +1,42 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) lodash.com/license * Lo-Dash 1.0.2 (Custom Build) lodash.com/license
* Build: `lodash -o ./dist/lodash.compat.js` * Build: `lodash -o ./dist/lodash.compat.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||it);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(Ot.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return Ot.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1 ;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||at);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(St.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return St.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=Q,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(n==Q)return V;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=pr(n);return function(t){for(var r=u.length,e=W;r--&&(e=j(t[u[r]],n[u[r]],ot)););return e }return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=W,a=n.apply(c,a),x(a)?a:c):n.apply(c,a)}var o=w(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(n==W)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=vr(n);return function(t){for(var r=u.length,e=X;r--&&(e=j(t[u[r]],n[u[r]],ft)););return e
}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function a(){for(var n,t={e:Z,f:nt,g:Gt,i:Jt,j:Xt,k:_t,b:"l(n)",c:"",h:"",l:"",m:J},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b?(r+="var o=n.length;j=-1;if("+t.b+"){",t.j&&(r+="if(m(n)){n=n.split('')}"),r+="while(++j<o){"+t.h+"}}else{"):t.i&&(r+="var o=n.length;j=-1;if(o&&k(n)){while(++j<o){j+='';"+t.h+"}}else{"),t.f&&(r+="var v=typeof n=='function';"),t.g&&t.m?(r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];",t.f&&(r+="if(!(v&&j=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(j in n){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(v&&j=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var g=n.constructor;",e=0;7>e;e++)r+="j='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(g&&g.prototype===n)&&"),r+="i.call(n,j)){"+t.h+"}"; }}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function a(){for(var n,t={e:tt,f:rt,g:Jt,i:Wt,j:Zt,k:jt,b:"l(n)",c:"",h:"",l:"",m:Q},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b?(r+="var o=n.length;j=-1;if("+t.b+"){",t.j&&(r+="if(m(n)){n=n.split('')}"),r+="while(++j<o){"+t.h+"}}else{"):t.i&&(r+="var o=n.length;j=-1;if(o&&k(n)){while(++j<o){j+='';"+t.h+"}}else{"),t.f&&(r+="var v=typeof n=='function';"),t.g&&t.m?(r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];",t.f&&(r+="if(!(v&&j=='prototype')){"),r+=t.h+"",t.f&&(r+="}")):(r+="for(j in n){",(t.f||t.m)&&(r+="if(",t.f&&(r+="!(v&&j=='prototype')"),t.f&&t.m&&(r+="&&"),t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",(t.f||t.m)&&(r+="}")),r+="}",t.e)for(r+="var g=n.constructor;",e=0;7>e;e++)r+="j='"+t.k[e]+"';if(","constructor"==t.k[e]&&(r+="!(g&&g.prototype===n)&&"),r+="i.call(n,j)){"+t.h+"}";
return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(f,Ot,y,lr,A,rr,$t)}function c(n){return"\\"+er[n]}function l(n){return sr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return vr[n]}function y(n){return St.call(n)==It}function h(n){var t=W;if(!n||typeof n!="object"||y(n))return t; return(t.b||t.i)&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(f,St,y,sr,A,ur,Ft)}function c(n){return"\\"+or[n]}function l(n){return gr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return yr[n]}function y(n){return kt.call(n)==Bt}function h(n){var t=X;if(!n||typeof n!="object"||y(n))return t;
var r=n.constructor;return!w(r)&&(!Yt||!p(n))||r instanceof r?tt?(ar(n,function(n,r,e){return t=!Ot.call(e,r),W}),t===W):(ar(n,function(n,r){t=r}),t===W||Ot.call(n,t)):t}function m(n){var t=[];return cr(n,function(n,r){t.push(r)}),t}function d(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=W),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";c||(a=n)}if(u=x(a)){var l=St.call(a);if(!nr[l]||Yt&&p(a))return a;var s=lr(a)}if(!u||!r)return u&&!c?s?v(a):gr({},a):a; var r=n.constructor;return!w(r)&&(!nr||!p(n))||r instanceof r?et?(lr(n,function(n,r,e){return t=!St.call(e,r),X}),t===X):(lr(n,function(n,r){t=r}),t===X||St.call(n,t)):t}function m(n){var t=[];return pr(n,function(n,r){t.push(r)}),t}function d(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=X),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";c||(a=n)}if(u=x(a)){var l=kt.call(a);if(!rr[l]||nr&&p(a))return a;var s=sr(a)}if(!u||!r)return u&&!c?s?v(a):hr({},a):a;
switch(u=tr[l],l){case Bt:case Mt:return c?a:new u(+a);case Pt:case Kt:return c?a:new u(a);case Ct:return c?a:u(a.source,st.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(Ot.call(n,"index")&&(a.index=n.index),Ot.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?F:cr)(c?a:n,function(n,u){a[u]=d(n,r,e,t,o,i)}),a}function _(n){var t=[];return ar(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=pr(n),e=r.length,u={};++t<e;){var o=r[t]; switch(u=er[l],l){case Pt:case zt:return c?a:new u(+a);case Ct:case Ut:return c?a:new u(a);case Lt:return c?a:u(a.source,gt.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=s?u(a.length):{},s&&(St.call(n,"index")&&(a.index=n.index),St.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(s?$:pr)(c?a:n,function(n,u){a[u]=d(n,r,e,t,o,i)}),a}function _(n){var t=[];return lr(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function b(n){for(var t=-1,r=vr(n),e=r.length,u={};++t<e;){var o=r[t];
u[n[o]]=o}return u}function j(n,t,r,e,u,o){var i=r===ot;if(r&&!i){r=typeof e=="undefined"?r:f(r,e,2);var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return W;if(n==Q||t==Q)return n===t;if(l=St.call(n),c=St.call(t),l==It&&(l=zt),c==It&&(c=zt),l!=c)return W;switch(l){case Bt:case Mt:return+n==+t;case Pt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Ct:case Kt:return n==t+"" u[n[o]]=o}return u}function j(n,t,r,e,u,o){var i=r===ft;if(r&&!i){r=typeof e=="undefined"?r:f(r,e,2);var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return X;if(n==W||t==W)return n===t;if(l=kt.call(n),c=kt.call(t),l==Bt&&(l=Kt),c==Bt&&(c=Kt),l!=c)return X;switch(l){case Pt:case zt:return+n==+t;case Ct:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Lt:case Ut:return n==t+""
}if(c=l==Tt,!c){if(n.__wrapped__||t.__wrapped__)return j(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=zt||Yt&&(p(n)||p(t)))return W;var l=!Qt&&y(n)?Object:n.constructor,s=!Qt&&y(t)?Object:t.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return W}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var v=0,a=J;if(u.push(n),o.push(t),c){if(v=t.length,a=i||v==n.length)for(;v--&&(a=j(n[v],t[v],r,e,u,o)););return a}return ar(t,function(t,i,f){return Ot.call(f,i)?(v++,a=Ot.call(n,i)&&j(n[i],t,r,e,u,o)):void 0 }if(c=l==Mt,!c){if(n.__wrapped__||t.__wrapped__)return j(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Kt||nr&&(p(n)||p(t)))return X;var l=!Xt&&y(n)?Object:n.constructor,s=!Xt&&y(t)?Object:t.constructor;if(l!=s&&(!w(l)||!(l instanceof l&&w(s)&&s instanceof s)))return X}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var v=0,a=Q;if(u.push(n),o.push(t),c){if(l=n.length,v=t.length,a=v==n.length,!a&&!i)return a;for(;v--;)if(c=l,s=t[v],i)for(;c--&&!(a=j(n[c],s,r,e,u,o)););else if(!(a=j(n[v],s,r,e,u,o)))break;
}),a&&!i&&ar(n,function(n,t,r){return Ot.call(r,t)?a=-1<--v:void 0}),a}function w(n){return typeof n=="function"}function x(n){return n?rr[typeof n]:W}function O(n){return typeof n=="number"||St.call(n)==Pt}function A(n){return typeof n=="string"||St.call(n)==Kt}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===ot)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length),2<o&&("function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):"function"==typeof e[o-1]&&(i=e[--o]));for(;++u<o;)(lr(e[u])?F:cr)(e[u],function(t,r){var e,u,o=t,f=n[r]; return a}return lr(t,function(t,i,f){return St.call(f,i)?(v++,a=St.call(n,i)&&j(n[i],t,r,e,u,o)):void 0}),a&&!i&&lr(n,function(n,t,r){return St.call(r,t)?a=-1<--v:void 0}),a}function w(n){return typeof n=="function"}function x(n){return n?ur[typeof n]:X}function O(n){return typeof n=="number"||kt.call(n)==Ct}function A(n){return typeof n=="string"||kt.call(n)==Ut}function S(n,t,r){var e=arguments,u=0,o=2;if(!x(n))return n;if(r===ft)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length),3<o&&"function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):2<o&&"function"==typeof e[o-1]&&(i=e[--o]);
if(t&&((u=lr(t))||hr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?lr(f)?f:[]:hr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,ot,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=W;return r=(0>r?Ft(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):fr(n,function(n){return++e<r?void 0:!(o=n===t) for(;++u<o;)(sr(e[u])?$:pr)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=sr(t))||dr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?sr(f)?f:[]:dr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=S(f,t,ft,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function E(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function k(n,t,r){var e=-1,u=n?n.length:0,o=X;return r=(0>r?qt(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):cr(n,function(n){return++e<r?void 0:!(o=n===t)
}),o}function N(n,t,r){var e=J;if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else fr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function R(n,t,r){var e=[];if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else fr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function $(n,t,r){var e;return t=f(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,W):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&lr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==W;);}else fr(n,t,r); }),o}function I(n,t,r){var e=Q;if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else cr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function N(n,t,r){var e=[];if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else cr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function R(n,t,r){var e;return t=f(t,r),$(n,function(n,r,u){return t(n,r,u)?(e=n,X):void 0}),e}function $(n,t,r){if(t&&typeof r=="undefined"&&sr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==X;);}else cr(n,t,r);
return n}function q(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),lr(n))for(;++e<u;)o[e]=t(n[e],e,n);else fr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function D(n,t,r){var e=-1/0,o=e;if(!t&&lr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),fr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function I(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),lr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else fr(n,function(n,e,o){r=u?(u=W,n):t(r,n,e,o) return n}function F(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),sr(n))for(;++e<u;)o[e]=t(n[e],e,n);else cr(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function q(n,t,r){var e=-1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function D(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),sr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else cr(n,function(n,e,o){r=u?(u=X,n):t(r,n,e,o)
});return r}function T(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=pr(n),o=a.length;else Xt&&A(n)&&(u=n.split(""));return t=f(t,e,4),F(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=W,u[e]):t(r,u[e],e,f)}),r}function B(n,t,r){var e;if(t=f(t,r),lr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else fr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++ });return r}function T(n,t,r,e){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var a=vr(n),o=a.length;else Zt&&A(n)&&(u=n.split(""));return t=f(t,e,4),$(n,function(n,e,f){e=a?a[--o]:--o,r=i?(i=X,u[e]):t(r,u[e],e,f)}),r}function B(n,t,r){var e;if(t=f(t,r),sr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else cr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=-1;for(t=f(t,r);++o<u&&t(n[o],o,n);)e++
}else if(e=t,e==Q||r)return n[0];return v(n,0,qt(Ft(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];lr(o)?At.apply(u,t?o:P(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?Ft(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=Q){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==Q||r?1:Ft(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u; }else if(e=t,e==W||r)return n[0];return v(n,0,Dt(qt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];sr(o)?Et.apply(u,t?o:P(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?qt(0,u+r):r||0)-1;else if(r)return e=K(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=W){var e=0,u=-1,o=n?n.length:0;for(t=f(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==W||r?1:qt(0,t);return v(n,e)}function K(n,t,r,e){var u=0,o=n?n.length:u;
for(r=r?f(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function L(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=W);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=Ot.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Vt||Et&&2<arguments.length?Et.call.apply(Et,arguments):i(n,t,v(arguments,2))}function V(n){return n}function G(n){F(_(n),function(t){var e=r[t]=n[t]; for(r=r?f(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function L(n,t,r,e){var u=-1,o=n?n.length:0,i=[],a=i;typeof t=="function"&&(e=r,r=t,t=X);var c=!t&&75<=o;if(c)var l={};for(r&&(a=[],r=f(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=St.call(l,s)?!(a=l[s]):a=l[s]=[];(t?!u||a[a.length-1]!==p:s||0>z(a,p))&&((r||c)&&a.push(p),i.push(e))}return i}function U(n,t){return Ht||It&&2<arguments.length?It.call.apply(It,arguments):i(n,t,v(arguments,2))}function V(n){var r=v(arguments,1);
r.prototype[t]=function(){var n=[this.__wrapped__];return At.apply(n,arguments),new r(e.apply(r,n))}})}function H(){return this.__wrapped__}var J=!0,Q=null,W=!1,X=typeof exports=="object"&&exports,Y=typeof global=="object"&&global;Y.global===Y&&(n=Y);var Z,nt,tt,rt=[],et={},ut=0,ot=et,it=30,ft=n._,at=/&(?:amp|lt|gt|quot|#39);/g,ct=/\b__p\+='';/g,lt=/\b(__p\+=)''\+/g,pt=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,vt=RegExp("^"+(et.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),gt=/\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g,yt=/<%=([\s\S]+?)%>/g,ht=/($^)/,mt=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,_t="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),bt=Math.ceil,jt=rt.concat,wt=Math.floor,xt=vt.test(xt=Object.getPrototypeOf)&&xt,Ot=et.hasOwnProperty,At=rt.push,St=et.toString,Et=vt.test(Et=v.bind)&&Et,kt=vt.test(kt=Array.isArray)&&kt,Nt=n.isFinite,Rt=n.isNaN,$t=vt.test($t=Object.keys)&&$t,Ft=Math.max,qt=Math.min,Dt=Math.random,It="[object Arguments]",Tt="[object Array]",Bt="[object Boolean]",Mt="[object Date]",Pt="[object Number]",zt="[object Object]",Ct="[object RegExp]",Kt="[object String]",Lt=!!n.attachEvent,Ut=Et&&!/\n|true/.test(Et+Lt),Vt=Et&&!Ut,Gt=$t&&(Lt||Ut),Ht=(Ht={0:1,length:1},rt.splice.call(Ht,0,1),Ht[0]),Jt=J; return setTimeout(function(){n.apply(t,r)},1)}function G(n){return n}function H(n){$(_(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return Et.apply(n,arguments),new r(e.apply(r,n))}})}function J(){return this.__wrapped__}var Q=!0,W=null,X=!1,Y=typeof exports=="object"&&exports,Z=typeof module=="object"&&module&&module.exports==Y&&module,nt=typeof global=="object"&&global;nt.global===nt&&(n=nt);var tt,rt,et,ut=[],ot={},it=0,ft=ot,at=30,ct=n._,lt=/&(?:amp|lt|gt|quot|#39);/g,pt=/\b__p\+='';/g,st=/\b(__p\+=)''\+/g,vt=/(__e\(.*?\)|\b__t\))\+'';/g,gt=/\w*$/,yt=RegExp("^"+(ot.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/<%=([\s\S]+?)%>/g,dt=/($^)/,_t=/[&<>"']/g,bt=/['\n\r\t\u2028\u2029\\]/g,jt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),wt=Math.ceil,xt=ut.concat,Ot=Math.floor,At=yt.test(At=Object.getPrototypeOf)&&At,St=ot.hasOwnProperty,Et=ut.push,kt=ot.toString,It=yt.test(It=v.bind)&&It,Nt=yt.test(Nt=Array.isArray)&&Nt,Rt=n.isFinite,$t=n.isNaN,Ft=yt.test(Ft=Object.keys)&&Ft,qt=Math.max,Dt=Math.min,Tt=Math.random,Bt="[object Arguments]",Mt="[object Array]",Pt="[object Boolean]",zt="[object Date]",Ct="[object Number]",Kt="[object Object]",Lt="[object RegExp]",Ut="[object String]",Vt=!!n.attachEvent,Gt=It&&!/\n|true/.test(It+Vt),Ht=It&&!Gt,Jt=Ft&&(Vt||Gt),Qt=(Qt={0:1,length:1},ut.splice.call(Qt,0,1),Qt[0]),Wt=Q;
(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Jt=!r;Z=!/valueOf/.test(t),nt=n.propertyIsEnumerable("prototype"),tt="x"!=t[0]})(1);var Qt=arguments.constructor==Object,Wt=!y(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Yt=St.call(document)==zt&&!({toString:0}+"")}catch(Zt){}var nr={"[object Function]":W};nr[It]=nr[Tt]=nr[Bt]=nr[Mt]=nr[Pt]=nr[zt]=nr[Ct]=nr[Kt]=J;var tr={};tr[Tt]=Array,tr[Bt]=Boolean,tr[Mt]=Date,tr[zt]=Object,tr[Pt]=Number,tr[Ct]=RegExp,tr[Kt]=String; (function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Wt=!r;tt=!/valueOf/.test(t),rt=n.propertyIsEnumerable("prototype"),et="x"!=t[0]})(1);var Xt=arguments.constructor==Object,Yt=!y(arguments),Zt="xx"!="x"[0]+Object("x")[0];try{var nr=kt.call(document)==Kt&&!({toString:0}+"")}catch(tr){}var rr={"[object Function]":X};rr[Bt]=rr[Mt]=rr[Pt]=rr[zt]=rr[Ct]=rr[Kt]=rr[Lt]=rr[Ut]=Q;var er={};er[Mt]=Array,er[Pt]=Boolean,er[zt]=Date,er[Kt]=Object,er[Ct]=Number,er[Lt]=RegExp,er[Ut]=String;
var rr={"boolean":W,"function":J,object:J,number:W,string:W,undefined:W},er={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yt,variable:"",imports:{_:r}};var ur={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},or={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},ir={l:"if(!r[typeof n])return u;"+or.l,b:W},fr=a(or); var ur={"boolean":X,"function":Q,object:Q,number:X,string:X,undefined:X},or={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:mt,variable:"",imports:{_:r}};var ir={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},fr={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},ar={l:"if(!r[typeof n])return u;"+fr.l,b:X},cr=a(fr);
Wt&&(y=function(n){return n?Ot.call(n,"callee"):W});var ar=a(or,ir,{m:W}),cr=a(or,ir),lr=kt||function(n){return Qt&&n instanceof Array||St.call(n)==Tt},pr=$t?function(n){return x(n)?nt&&typeof n=="function"||Jt&&n.length&&y(n)?m(n):$t(n):[]}:m,sr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vr=b(sr),gr=a(ur,{l:ur.l.replace(";",";if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),yr=a(ur); Yt&&(y=function(n){return n?St.call(n,"callee"):X});var lr=a(fr,ar,{m:X}),pr=a(fr,ar),sr=Nt||function(n){return Xt&&n instanceof Array||kt.call(n)==Mt},vr=Ft?function(n){return x(n)?rt&&typeof n=="function"||Wt&&n.length&&y(n)?m(n):Ft(n):[]}:m,gr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},yr=b(gr),hr=a(ir,{l:ir.l.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),mr=a(ir);
w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==St.call(n)});var hr=xt?function(n){if(!n||typeof n!="object")return W;var t=n.valueOf,r=typeof t=="function"&&(r=xt(t))&&xt(r);return r?n==r||xt(n)==r&&!y(n):h(n)}:h,mr=q,dr=R;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=gr,r.at=function(n){var t=-1,r=jt.apply(rt,v(arguments,1)),e=r.length,u=Array(e);for(Xt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];return u},r.bind=U,r.bindAll=function(n){for(var t=jt.apply(rt,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r]; w(/x/)&&(w=function(n){return n instanceof Function||"[object Function]"==kt.call(n)});var dr=At?function(n){if(!n||typeof n!="object")return X;var t=n.valueOf,r=typeof t=="function"&&(r=At(t))&&At(r);return r?n==r||At(n)==r&&!y(n):h(n)}:h,_r=F,br=N;Gt&&Z&&typeof setImmediate=="function"&&(V=U(setImmediate,n)),r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=hr,r.at=function(n){var t=-1,r=xt.apply(ut,v(arguments,1)),e=r.length,u=Array(e);for(Zt&&A(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Ot.call(e,r)?e[r]++:e[r]=1}),e},r.debounce=function(n,t,r){function e(){f=Q,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f; return u},r.bind=U,r.bindAll=function(n){for(var t=xt.apply(ut,arguments),r=1<t.length?0:(t=_(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},r.bindKey=function(n,t){return i(n,t,v(arguments,2))},r.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},r.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},r.countBy=function(n,t,r){var e={};return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",St.call(e,r)?e[r]++:e[r]=1
return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=yr,r.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=jt.apply(rt,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=R,r.flatten=P,r.forEach=F,r.forIn=ar,r.forOwn=cr,r.functions=_,r.groupBy=function(n,t,r){var e={}; }),e},r.debounce=function(n,t,r){function e(){f=W,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},r.defaults=mr,r.defer=V,r.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},r.difference=function(n){for(var t=-1,r=n?n.length:0,u=xt.apply(ut,arguments),u=e(u,r),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.filter=N,r.flatten=P,r.forEach=$,r.forIn=lr,r.forOwn=pr,r.functions=_,r.groupBy=function(n,t,r){var e={};
return t=f(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Ot.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==Q||r?1:t||e;return v(n,0,qt(Ft(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=Ot.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n; return t=f(t,r),$(n,function(n,r,u){r=t(n,r,u)+"",(St.call(e,r)?e[r]:e[r]=[]).push(n)}),e},r.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=u;for(t=f(t,r);o--&&t(n[o],o,n);)e++}else e=t==W||r?1:t||e;return v(n,0,Dt(qt(0,u-e),u))},r.intersection=function(n){var t=arguments,r=t.length,u={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o];if(f)var p=l+"",p=St.call(u[0],p)?!(c=u[0][p]):c=u[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n;
a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=pr,r.map=q,r.max=D,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return Ot.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&lr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a) a.push(l)}}return a},r.invert=b,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return $(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=vr,r.map=F,r.max=q,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return St.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=S,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a<o&&(o=a)
}}else t=!t&&A(n)?u:f(t,r),fr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=jt.apply(rt,arguments);return ar(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=Q,r)}},r.pairs=function(n){for(var t=-1,r=pr(n),e=r.length,u=Array(e);++t<e;){var o=r[t]; }}else t=!t&&A(n)?u:f(t,r),cr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,o=n)});return o},r.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},r.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=f(t,r);else var o=xt.apply(ut,arguments);return lr(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=W,r)}},r.pairs=function(n){for(var t=-1,r=vr(n),e=r.length,u=Array(e);++t<e;){var o=r[t];
u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),Q,ot)},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=jt.apply(rt,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),ar(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=mr,r.range=function(n,t,r){n=+n||0,r=+r||1,t==Q&&(t=n,n=0);var e=-1;t=Ft(0,bt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),R(n,function(n,r,e){return!t(n,r,e) u[t]=[o,n[o]]}return u},r.partial=function(n){return i(n,v(arguments,1))},r.partialRight=function(n){return i(n,v(arguments,1),W,ft)},r.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=xt.apply(ut,arguments),i=x(n)?o.length:0;++u<i;){var a=o[u];a in n&&(e[a]=n[a])}else t=f(t,r),lr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},r.pluck=_r,r.range=function(n,t,r){n=+n||0,r=+r||1,t==W&&(t=n,n=0);var e=-1;t=qt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},r.reject=function(n,t,r){return t=f(t,r),N(n,function(n,r,e){return!t(n,r,e)
})},r.rest=C,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=wt(Dt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),F(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=Q,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f); })},r.rest=C,r.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return $(n,function(n){var r=Ot(Tt()*(++t+1));e[t]=e[r],e[r]=n}),e},r.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=f(t,r),$(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i},r.tap=function(n,t){return t(n),n},r.throttle=function(n,t){function r(){f=new Date,i=W,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);
return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=Q,f=a,u=n.apply(o,e)),u}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Xt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return L(jt.apply(rt,arguments))},r.uniq=L,r.values=E,r.where=dr,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n]; return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=W,f=a,u=n.apply(o,e)),u}},r.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},r.toArray=function(n){return n&&typeof n.length=="number"?Zt&&A(n)?n.split(""):v(n):E(n)},r.union=function(){return L(xt.apply(ut,arguments))},r.uniq=L,r.values=E,r.where=br,r.without=function(n){for(var t=-1,r=n?n.length:0,u=e(arguments,1),o=[];++t<r;){var i=n[t];u(i)||o.push(i)}return o},r.wrap=function(n,t){return function(){var r=[n];
return At.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?D(mr(arguments,"length")):0,e=Array(r);++t<r;)e[t]=mr(arguments,t);return e},r.collect=q,r.drop=C,r.each=F,r.extend=gr,r.methods=_,r.select=R,r.tail=C,r.unique=L,G(r),r.clone=d,r.cloneDeep=function(n,t,r){return d(n,J,t,r)},r.contains=k,r.escape=function(n){return n==Q?"":(n+"").replace(mt,l)},r.every=N,r.find=$,r.has=function(n,t){return n?Ot.call(n,t):W},r.identity=V,r.indexOf=z,r.isArguments=y,r.isArray=lr,r.isBoolean=function(n){return n===J||n===W||St.call(n)==Bt return Et.apply(r,arguments),t.apply(this,r)}},r.zip=function(n){for(var t=-1,r=n?q(_r(arguments,"length")):0,e=Array(r);++t<r;)e[t]=_r(arguments,t);return e},r.collect=F,r.drop=C,r.each=$,r.extend=hr,r.methods=_,r.select=N,r.tail=C,r.unique=L,H(r),r.clone=d,r.cloneDeep=function(n,t,r){return d(n,Q,t,r)},r.contains=k,r.escape=function(n){return n==W?"":(n+"").replace(_t,l)},r.every=I,r.find=R,r.has=function(n,t){return n?St.call(n,t):X},r.identity=G,r.indexOf=z,r.isArguments=y,r.isArray=sr,r.isBoolean=function(n){return n===Q||n===X||kt.call(n)==Pt
},r.isDate=function(n){return n instanceof Date||St.call(n)==Mt},r.isElement=function(n){return n?1===n.nodeType:W},r.isEmpty=function(n){var t=J;if(!n)return t;var r=St.call(n),e=n.length;return r==Tt||r==Kt||r==It||Wt&&y(n)||r==zt&&typeof e=="number"&&w(n.splice)?!e:(cr(n,function(){return t=W}),t)},r.isEqual=j,r.isFinite=function(n){return Nt(n)&&!Rt(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===Q},r.isNumber=O,r.isObject=x,r.isPlainObject=hr,r.isRegExp=function(n){return n instanceof RegExp||St.call(n)==Ct },r.isDate=function(n){return n instanceof Date||kt.call(n)==zt},r.isElement=function(n){return n?1===n.nodeType:X},r.isEmpty=function(n){var t=Q;if(!n)return t;var r=kt.call(n),e=n.length;return r==Mt||r==Ut||r==Bt||Yt&&y(n)||r==Kt&&typeof e=="number"&&w(n.splice)?!e:(pr(n,function(){return t=X}),t)},r.isEqual=j,r.isFinite=function(n){return Rt(n)&&!$t(parseFloat(n))},r.isFunction=w,r.isNaN=function(n){return O(n)&&n!=+n},r.isNull=function(n){return n===W},r.isNumber=O,r.isObject=x,r.isPlainObject=dr,r.isRegExp=function(n){return n instanceof RegExp||kt.call(n)==Lt
},r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Ft(0,e+r):qt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=G,r.noConflict=function(){return n._=ft,this},r.random=function(n,t){return n==Q&&t==Q&&(t=1),n=+n||0,t==Q&&(t=n,n=0),n+wt(Dt()*((+t||0)-n+1))},r.reduce=I,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:pr(n).length },r.isString=A,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?qt(0,e+r):Dt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=H,r.noConflict=function(){return n._=ct,this},r.random=function(n,t){return n==W&&t==W&&(t=1),n=+n||0,t==W&&(t=n,n=0),n+Ot(Tt()*((+t||0)-n+1))},r.reduce=D,r.reduceRight=T,r.result=function(n,r){var e=n?n[r]:t;return w(e)?n[r]():e},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:vr(n).length
},r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=yr({},u,o);var i,f=yr({},u.imports,o.imports),o=pr(f),f=E(f),a=0,l=u.interpolate||ht,p="__p+='";n.replace(RegExp((u.escape||ht).source+"|"+l.source+"|"+(l===yt?gt:ht).source+"|"+(u.evaluate||ht).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ct,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(l?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}"; },r.some=B,r.sortedIndex=K,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=mr({},u,o);var i,f=mr({},u.imports,o.imports),o=vr(f),f=E(f),a=0,l=u.interpolate||dt,p="__p+='";n.replace(RegExp((u.escape||dt).source+"|"+l.source+"|"+(l===mt?ht:dt).source+"|"+(u.evaluate||dt).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(bt,c),r&&(p+="'+__e("+r+")+'"),o&&(i=Q,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t}),p+="';\n",l=u=u.variable,l||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(pt,""):p).replace(st,"$1").replace(vt,"$1;"),p="function("+u+"){"+(l?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+p+"return __p}";
try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==Q?"":(n+"").replace(at,g)},r.uniqueId=function(n){var t=++ut;return(n==Q?"":n+"")+t},r.all=N,r.any=B,r.detect=$,r.foldl=I,r.foldr=T,r.include=k,r.inject=I,cr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return At.apply(t,arguments),n.apply(r,t)})}),r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=Q){var o=u; try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return e?s(e):(s.source=p,s)},r.unescape=function(n){return n==W?"":(n+"").replace(lt,g)},r.uniqueId=function(n){var t=++it;return(n==W?"":n+"")+t},r.all=I,r.any=B,r.detect=R,r.foldl=D,r.foldr=T,r.include=k,r.inject=D,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return Et.apply(t,arguments),n.apply(r,t)})}),r.first=M,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=W){var o=u;
for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==Q||r)return n[u-1];return v(n,Ft(0,u-e))}},r.take=M,r.head=M,cr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==Q||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=H,r.prototype.valueOf=H,fr(["join","pop","shift"],function(n){var t=rt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),fr(["push","reverse","sort","unshift"],function(n){var t=rt[n]; for(t=f(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==W||r)return n[u-1];return v(n,qt(0,u-e))}},r.take=M,r.head=M,pr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return t==W||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.2",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=J,r.prototype.valueOf=J,cr(["join","pop","shift"],function(n){var t=ut[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),cr(["push","reverse","sort","unshift"],function(n){var t=ut[n];
r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),fr(["concat","slice","splice"],function(n){var t=rt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Ht&&fr(["pop","shift","splice"],function(n){var t=rt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),cr(["concat","slice","splice"],function(n){var t=ut[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Qt&&cr(["pop","shift","splice"],function(n){var t=ut[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r
})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=r)._=r:X._=r:n._=r})(this); })):Y?Z?(Z.exports=r)._=r:Y._=r:n._=r})(this);

78
dist/lodash.js vendored
View File

@@ -1,17 +1,20 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) <http://lodash.com/> * Lo-Dash 1.0.2 (Custom Build) <https://lodash.com/>
* Build: `lodash modern -o ./dist/lodash.js` * Build: `lodash modern -o ./dist/lodash.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license> * Available under MIT license <https://lodash.com/license>
*/ */
;(function(window, undefined) { ;(function(window, undefined) {
/** Detect free variable `exports` */ /** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports; var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global` and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal) {
@@ -56,7 +59,7 @@
* Used to match ES6 template delimiters * Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
*/ */
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match "interpolate" template delimiters */ /** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g; var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -292,7 +295,7 @@
'\n } '; '\n } ';
} else { } else {
__p += '\n for (index in iterable) {'; __p += '\n for (index in iterable) {';
if ( obj.useHas) { if (obj.useHas) {
__p += '\n if ('; __p += '\n if (';
if (obj.useHas) { if (obj.useHas) {
__p += 'hasOwnProperty.call(iterable, index)'; __p += 'hasOwnProperty.call(iterable, index)';
@@ -302,7 +305,7 @@
__p += __p +=
(obj.loop ) + (obj.loop ) +
'; '; '; ';
if ( obj.useHas) { if (obj.useHas) {
__p += '\n }'; __p += '\n }';
} ; } ;
__p += '\n } '; __p += '\n } ';
@@ -910,12 +913,10 @@
'top': 'top':
defaultsIteratorOptions.top.replace(';', defaultsIteratorOptions.top.replace(';',
';\n' + ';\n' +
'if (argsLength > 2) {\n' + "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" +
" if (typeof args[argsLength - 2] == 'function') {\n" + ' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" +
" } else if (typeof args[argsLength - 1] == 'function') {\n" + ' callback = args[--argsLength];\n' +
' callback = args[--argsLength];\n' +
' }\n' +
'}' '}'
), ),
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
@@ -1420,16 +1421,27 @@
// recursively compare objects and arrays (susceptible to call stack limits) // recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) { if (isArr) {
// compare lengths to determine if a deep comparison is necessary length = a.length;
size = b.length; size = b.length;
result = whereIndicator || size == a.length;
if (result) { // compare lengths to determine if a deep comparison is necessary
// deep compare the contents, ignoring non-numeric properties result = size == a.length;
while (size--) { if (!result && !whereIndicator) {
if (!(result = isEqual(a[size], b[size], callback, thisArg, stackA, stackB))) { return result;
break; }
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (whereIndicator) {
while (index--) {
if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) {
break;
}
} }
} else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) {
break;
} }
} }
return result; return result;
@@ -1632,7 +1644,7 @@
* _.isPlainObject({ 'name': 'moe', 'age': 40 }); * _.isPlainObject({ 'name': 'moe', 'age': 40 });
* // => true * // => true
*/ */
var isPlainObject = function(value) { var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) {
if (!(value && typeof value == 'object')) { if (!(value && typeof value == 'object')) {
return false; return false;
} }
@@ -1772,12 +1784,10 @@
if (typeof deepIndicator != 'number') { if (typeof deepIndicator != 'number') {
length = args.length; length = args.length;
} }
if (length > 2) { if (length > 3 && typeof args[length - 2] == 'function') {
if (typeof args[length - 2] == 'function') { callback = createCallback(args[--length - 1], args[length--], 2);
callback = createCallback(args[--length - 1], args[length--], 2); } else if (length > 2 && typeof args[length - 1] == 'function') {
} else if (typeof args[length - 1] == 'function') { callback = args[--length];
callback = args[--length];
}
} }
} }
while (++index < length) { while (++index < length) {
@@ -1984,7 +1994,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates an array of elements from the specified index(es), or keys, of the * Creates an array of elements from the specified indexes, or keys, of the
* `collection`. Indexes may be specified as individual arguments or as arrays * `collection`. Indexes may be specified as individual arguments or as arrays
* of indexes. * of indexes.
* *
@@ -1992,7 +2002,7 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Array|Number|String} [index1, index2, ...] The index(es) of * @param {Array|Number|String} [index1, index2, ...] The indexes of
* `collection` to retrieve, either as individual arguments or arrays. * `collection` to retrieve, either as individual arguments or arrays.
* @returns {Array} Returns a new array of elements corresponding to the * @returns {Array} Returns a new array of elements corresponding to the
* provided indexes. * provided indexes.
@@ -4071,6 +4081,10 @@
var args = slice(arguments, 1); var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js
if (isV8 && freeModule && typeof setImmediate == 'function') {
defer = bind(setImmediate, window);
}
/** /**
* Creates a function that memoizes the result of `func`. If `resolver` is * Creates a function that memoizes the result of `func`. If `resolver` is
@@ -4428,7 +4442,7 @@
* build and using precompiled templates, or loading Lo-Dash in a sandbox. * build and using precompiled templates, or loading Lo-Dash in a sandbox.
* *
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * https://lodash.com/#custom-builds
* *
* For more information on Chrome extension sandboxes see: * For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html * http://developer.chrome.com/stable/extensions/sandboxingEval.html
@@ -4576,7 +4590,7 @@
(isEvaluating (isEvaluating
? ', __j = Array.prototype.join;\n' + ? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n" "function print() { __p += __j.call(arguments, '') }\n"
: (hasVariable ? '' : ', __d = ' + variable + '.' + variable + ' || ' + variable) + ';\n' : ';\n'
) + ) +
source + source +
'return __p\n}'; 'return __p\n}';
@@ -4902,7 +4916,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.0.0'; lodash.VERSION = '1.0.2';
// add "Chaining" functions to the wrapper // add "Chaining" functions to the wrapper
lodash.prototype.toString = wrapperToString; lodash.prototype.toString = wrapperToString;
@@ -4954,8 +4968,8 @@
// check for `exports` after `define` in case a build optimizer adds an `exports` object // check for `exports` after `define` in case a build optimizer adds an `exports` object
else if (freeExports) { else if (freeExports) {
// in Node.js or RingoJS v0.8.0+ // in Node.js or RingoJS v0.8.0+
if (typeof module == 'object' && module && module.exports == freeExports) { if (freeModule) {
(module.exports = lodash)._ = lodash; (freeModule.exports = lodash)._ = lodash;
} }
// in Narwhal or RingoJS v0.7.0- // in Narwhal or RingoJS v0.7.0-
else { else {

71
dist/lodash.min.js vendored
View File

@@ -1,40 +1,41 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) lodash.com/license * Lo-Dash 1.0.2 (Custom Build) lodash.com/license
* Build: `lodash modern -o ./dist/lodash.js` * Build: `lodash modern -o ./dist/lodash.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n,t){function r(n){if(!n||typeof n!="object")return Q;var t=n.valueOf,r=typeof t=="function"&&(r=dt(t))&&dt(r);if(r)n=n==r||dt(n)==r&&!h(n);else{var e=Q;!n||typeof n!="object"||h(n)?n=e:(t=n.constructor,!j(t)||t instanceof t?(Wt(n,function(n,t){e=t}),n=e===Q||_t.call(n,e)):n=e)}return n}function e(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof e?(this.__wrapped__=n,void 0):new e(n)}function u(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||rt);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+""; ;(function(n,r){function t(n){return n&&"object"==typeof n&&n.__wrapped__?n:this instanceof t?(this.__wrapped__=n,r):new t(n)}function e(n,r,t){r||(r=0);var e=n.length,u=e-r>=(t||ut);if(u)for(var a={},o=r-1;++o<e;){var i=n[o]+"";(wt.call(a,i)?a[i]:a[i]=[]).push(n[o])}return function(t){if(u){var e=t+"";return wt.call(a,e)&&sr(a[e],t)>-1}return sr(n,t,r)>-1}}function u(n){return n.charCodeAt(0)}function a(n,r){var t=n.index,e=r.index;if(n=n.criteria,r=r.criteria,n!==r){if(n>r||"undefined"==typeof n)return 1;
(_t.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return _t.call(o,e)&&-1<z(o[e],r)}return-1<z(n,r,t)}}function o(n){return n.charCodeAt(0)}function i(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function f(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=v(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(s.prototype=n.prototype,c=new s,s.prototype=L,a=n.apply(c,a),w(a)?a:c):n.apply(c,a) if(n<r||"undefined"==typeof r)return-1}return t<e?-1:1}function o(n,r,t,e){function u(){var f=arguments,l=o?this:r;if(a||(n=r[i]),t.length&&(f=f.length?(f=p(f),e?f.concat(t):t.concat(f)):t),this instanceof u){s.prototype=n.prototype,l=new s,s.prototype=null;var c=n.apply(l,f);return S(c)?c:l}return n.apply(l,f)}var a=E(n),o=!t,i=r;return o&&(t=r),a||(r=n),u}function i(n,r,t){if(null==n)return Br;var e=typeof n;if("function"!=e){if("object"!=e)return function(r){return r[n]};var u=ue(n);return function(r){for(var t=u.length,e=!1;t--&&(e=O(r[u[t]],n[u[t]],et)););return e
}var o=j(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function a(n,t,r){if(n==L)return V;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Zt(n);return function(t){for(var r=u.length,e=Q;r--&&(e=b(t[u[r]],n[u[r]],tt)););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function c(){for(var n,t={g:Ct,b:"l(n)",c:"",h:"",l:"",m:J},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e]; }}return"undefined"!=typeof r?1===t?function(t){return n.call(r,t)}:2===t?function(t,e){return n.call(r,t,e)}:4===t?function(t,e,u,a){return n.call(r,t,e,u,a)}:function(t,e,u){return n.call(r,t,e,u)}:n}function f(){for(var n,r={isKeysFast:Ut,arrays:"isArray(iterable)",bottom:"",loop:"",top:"",useHas:!0},t=0;n=arguments[t];t++)for(var e in n)r[e]=n[e];var u=r.args;r.firstArg=/^[^,]+/.exec(u)[0];var a=Function("createCallback, hasOwnProperty, isArguments, isArray, isString, objectTypes, nativeKeys","return function("+u+") {\n"+Wt(r)+"\n}");
return n=t.a,t.d=/^[^,]+/.exec(n)[0],r="var j,n="+t.d+",u=n;if(!n)return u;"+t.l+";",t.b&&(r+="var o=n.length;j=-1;if("+t.b+"){while(++j<o){"+t.h+"}}else{"),t.g&&t.m?r+="var s=-1,t=r[typeof n]?p(n):[],o=t.length;while(++s<o){j=t[s];"+t.h+"}":(r+="for(j in n){",t.m&&(r+="if(",t.m&&(r+="i.call(n,j)"),r+="){"),r+=t.h+";",t.m&&(r+="}"),r+="}"),t.b&&(r+="}"),r+=t.c+";return u",Function("f,i,k,l,m,r,p","return function("+n+"){"+r+"}")(a,_t,h,Yt,A,Vt,Et)}function l(n){return"\\"+Gt[n]}function p(n){return nr[n] return a(i,wt,v,ee,N,Jt,St)}function l(n){return"\\"+Qt[n]}function c(n){return ae[n]}function s(){}function p(n,r,t){r||(r=0),"undefined"==typeof t&&(t=n?n.length:0);for(var e=-1,u=t-r||0,a=Array(u<0?0:u);++e<u;)a[e]=n[r+e];return a}function g(n){return oe[n]}function v(n){return At.call(n)==Ft}function y(n){var r=!1;if(!n||"object"!=typeof n||v(n))return r;var t=n.constructor;return!E(t)||t instanceof t?(re(n,function(n,t){r=t}),r===!1||wt.call(n,r)):r}function h(n){var r=[];return te(n,function(n,t){r.push(t)
}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function g(n){return tr[n]}function h(n){return jt.call(n)==$t}function y(n){var t=[];return Xt(n,function(n,r){t.push(r)}),t}function m(n,r,e,u,o,i){var f=n;if(typeof r=="function"&&(u=e,e=r,r=Q),typeof e=="function"){e=typeof u=="undefined"?e:a(e,u,1);var f=e(f),c=typeof f!="undefined";c||(f=n)}if(u=w(f)){var l=jt.call(f);if(!Kt[l])return f;var p=Yt(f) }),r}function d(n,t,e,u,a,o){var f=n;if("function"==typeof t&&(u=e,e=t,t=!1),"function"==typeof e){e="undefined"==typeof u?e:i(e,u,1),f=e(f);var l="undefined"!=typeof f;l||(f=n)}var c=S(f);if(c){var s=At.call(f);if(!Vt[s])return f;var g=ee(f)}if(!c||!t)return c&&!l?g?p(f):ie({},f):f;var v=Gt[s];switch(s){case $t:case Pt:return l?f:new v(+f);case qt:case Ct:return l?f:new v(f);case Ht:return l?f:v(f.source,ct.exec(f))}a||(a=[]),o||(o=[]);for(var y=a.length;y--;)if(a[y]==n)return o[y];return l||(f=g?v(f.length):{},g&&(wt.call(n,"index")&&(f.index=n.index),wt.call(n,"input")&&(f.input=n.input))),a.push(n),o.push(f),(g?G:te)(l?f:n,function(n,u){f[u]=d(n,t,e,r,a,o)
}if(!u||!r)return u&&!c?p?v(f):rr({},f):f;switch(u=Ut[l],l){case kt:case qt:return c?f:new u(+f);case Dt:case It:return c?f:new u(f);case Bt:return c?f:u(f.source,at.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(f=p?u(f.length):{},p&&(_t.call(n,"index")&&(f.index=n.index),_t.call(n,"input")&&(f.input=n.input))),o.push(n),i.push(f),(p?F:Xt)(c?f:n,function(n,u){f[u]=m(n,r,e,t,o,i)}),f}function d(n){var t=[];return Wt(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Zt(n),e=r.length,u={};++t<e;){var o=r[t]; }),f}function m(n,r,t){return d(n,!0,r,t)}function b(n){var r=[];return re(n,function(n,t){E(n)&&r.push(t)}),r.sort()}function _(n,r){return n?wt.call(n,r):!1}function x(n){for(var r=-1,t=ue(n),e=t.length,u={};++r<e;){var a=t[r];u[n[a]]=a}return u}function w(n){return n===!0||n===!1||At.call(n)==$t}function j(n){return n instanceof Date||At.call(n)==Pt}function A(n){return n?1===n.nodeType:!1}function k(n){var r=!0;if(!n)return r;var t=At.call(n),e=n.length;return t==Nt||t==Ct||t==Ft||t==Bt&&"number"==typeof e&&E(n.splice)?!e:(te(n,function(){return r=!1
u[n[o]]=o}return u}function b(n,t,r,e,u,o){var i=r===tt;if(r&&!i){r=typeof e=="undefined"?r:a(r,e,2);var f=r(n,t);if(typeof f!="undefined")return!!f}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return Q;if(n==L||t==L)return n===t;if(l=jt.call(n),c=jt.call(t),l==$t&&(l=Tt),c==$t&&(c=Tt),l!=c)return Q;switch(l){case kt:case qt:return+n==+t;case Dt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Bt:case It:return n==t+"" }),r)}function O(n,t,e,u,a,o){var f=e===et;if(e&&!f){e="undefined"==typeof u?e:i(e,u,2);var l=e(n,t);if("undefined"!=typeof l)return!!l}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,s=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=s&&"object"!=s))return!1;if(null==n||null==t)return n===t;var p=At.call(n),g=At.call(t);if(p==Ft&&(p=Bt),g==Ft&&(g=Bt),p!=g)return!1;switch(p){case $t:case Pt:return+n==+t;case qt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Ht:case Ct:return n==t+""
}if(c=l==Ft,!c){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Tt)return Q;var l=n.constructor,p=t.constructor;if(l!=p&&(!j(l)||!(l instanceof l&&j(p)&&p instanceof p)))return Q}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var s=0,f=J;if(u.push(n),o.push(t),c){if(s=t.length,f=i||s==n.length)for(;s--&&(f=b(n[s],t[s],r,e,u,o)););return f}return Wt(t,function(t,i,a){return _t.call(a,i)?(s++,f=_t.call(n,i)&&b(n[i],t,r,e,u,o)):void 0}),f&&!i&&Wt(n,function(n,t,r){return _t.call(r,t)?f=-1<--s:void 0 }var v=p==Nt;if(!v){if(n.__wrapped__||t.__wrapped__)return O(n.__wrapped__||n,t.__wrapped__||t,e,u,a,o);if(p!=Bt)return!1;var y=n.constructor,h=t.constructor;if(y!=h&&!(E(y)&&y instanceof y&&E(h)&&h instanceof h))return!1}a||(a=[]),o||(o=[]);for(var d=a.length;d--;)if(a[d]==n)return o[d]==t;var m=0;if(l=!0,a.push(n),o.push(t),v){if(d=n.length,m=t.length,l=m==n.length,!l&&!f)return l;for(;m--;){var b=d,_=t[m];if(f)for(;b--&&!(l=O(n[b],_,e,u,a,o)););else if(!(l=O(n[m],_,e,u,a,o)))break}return l}return re(t,function(t,i,f){return wt.call(f,i)?(m++,l=wt.call(n,i)&&O(n[i],t,e,u,a,o)):r
}),f}function j(n){return typeof n=="function"}function w(n){return n?Vt[typeof n]:Q}function x(n){return typeof n=="number"||jt.call(n)==Dt}function A(n){return typeof n=="string"||jt.call(n)==It}function O(n,t,e){var u=arguments,o=0,i=2;if(!w(n))return n;if(e===tt)var f=u[3],c=u[4],l=u[5];else c=[],l=[],typeof e!="number"&&(i=u.length),2<i&&("function"==typeof u[i-2]?f=a(u[--i-1],u[i--],2):"function"==typeof u[i-1]&&(f=u[--i]));for(;++o<i;)(Yt(u[o])?F:Xt)(u[o],function(t,e){var u,o,i=t,a=n[e];if(t&&((o=Yt(t))||r(t))){for(i=c.length;i--;)if(u=c[i]==t){a=l[i]; }),l&&!f&&re(n,function(n,t,e){return wt.call(e,t)?l=--m>-1:r}),l}function I(n){return It(n)&&!Et(parseFloat(n))}function E(n){return"function"==typeof n}function S(n){return n?Jt[typeof n]:!1}function L(n){return T(n)&&n!=+n}function R(n){return null===n}function T(n){return"number"==typeof n||At.call(n)==qt}function F(n){return n instanceof RegExp||At.call(n)==Ht}function N(n){return"string"==typeof n||At.call(n)==Ct}function $(n){return"undefined"==typeof n}function P(n,r,t){var e=arguments,u=0,a=2;
break}u||(a=o?Yt(a)?a:[]:r(a)?a:{},f&&(i=f(a,t),typeof i!="undefined"&&(a=i)),c.push(t),l.push(a),f||(a=O(a,t,tt,f,c,l)))}else f&&(i=f(a,t),typeof i=="undefined"&&(i=t)),typeof i!="undefined"&&(a=i);n[e]=a});return n}function E(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,t,r){var e=-1,u=n?n.length:0,o=Q;return r=(0>r?St(0,u+r):r)||0,typeof u=="number"?o=-1<(A(n)?n.indexOf(t,r):z(n,t,r)):Qt(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function N(n,t,r){var e=J; if(!S(n))return n;if(t===et)var o=e[3],f=e[4],l=e[5];else f=[],l=[],"number"!=typeof t&&(a=e.length),a>3&&"function"==typeof e[a-2]?o=i(e[--a-1],e[a--],2):a>2&&"function"==typeof e[a-1]&&(o=e[--a]);for(;++u<a;)(ee(e[u])?G:te)(e[u],function(r,t){var e,u,a=r,i=n[t];if(r&&((u=ee(r))||le(r))){for(var c=f.length;c--;)if(e=f[c]==r){i=l[c];break}e||(i=u?ee(i)?i:[]:le(i)?i:{},o&&(a=o(i,r),"undefined"!=typeof a&&(i=a)),f.push(r),l.push(i),o||(i=P(i,r,et,o,f,l)))}else o&&(a=o(i,r),"undefined"==typeof a&&(a=r)),"undefined"!=typeof a&&(i=a);
if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Qt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function R(n,t,r){var e=[];if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Qt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function $(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,Q):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Yt(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==Q;);}else Qt(n,t,r); n[t]=i});return n}function D(n,r,t){var e="function"==typeof r,u={};if(e)r=i(r,t);else var a=bt.apply(nt,arguments);return re(n,function(n,t,o){(e?!r(n,t,o):sr(a,t,1)<0)&&(u[t]=n)}),u}function q(n){for(var r=-1,t=ue(n),e=t.length,u=Array(e);++r<e;){var a=t[r];u[r]=[a,n[a]]}return u}function B(n,r,t){var e={};if("function"!=typeof r)for(var u=0,a=bt.apply(nt,arguments),o=S(n)?a.length:0;++u<o;){var f=a[u];f in n&&(e[f]=n[f])}else r=i(r,t),re(n,function(n,t,u){r(n,t,u)&&(e[t]=n)});return e}function H(n){for(var r=-1,t=ue(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];
return n}function k(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=a(t,r),Yt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Qt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function q(n,t,r){var e=-1/0,u=e;if(!t&&Yt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f>u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Qt(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});return u}function D(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,4),Yt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else Qt(n,function(n,e,o){r=u?(u=Q,n):t(r,n,e,o) return u}function C(n){for(var r=-1,t=bt.apply(nt,p(arguments,1)),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function K(n,t,e){var u=-1,a=n?n.length:0,o=!1;return e=(e<0?Lt(0,a+e):e)||0,"number"==typeof a?o=(N(n)?n.indexOf(t,e):sr(n,t,e))>-1:ne(n,function(n){return++u<e?r:!(o=n===t)}),o}function M(n,r,t){var e={};return r=i(r,t),G(n,function(n,t,u){t=r(n,t,u)+"",wt.call(e,t)?e[t]++:e[t]=1}),e}function z(n,r,t){var e=!0;if(r=i(r,t),ee(n))for(var u=-1,a=n.length;++u<a&&(e=!!r(n[u],u,n)););else ne(n,function(n,t,u){return e=!!r(n,t,u)
});return r}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Zt(n),u=i.length;return t=a(t,e,4),F(n,function(e,f,a){f=i?i[--u]:--u,r=o?(o=Q,n[f]):t(r,n[f],f,a)}),r}function B(n,t,r){var e;if(t=a(t,r),Yt(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Qt(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function I(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[0]; });return e}function U(n,r,t){var e=[];if(r=i(r,t),ee(n))for(var u=-1,a=n.length;++u<a;){var o=n[u];r(o,u,n)&&e.push(o)}else ne(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function V(n,t,e){var u;return t=i(t,e),G(n,function(n,e,a){return t(n,e,a)?(u=n,!1):r}),u}function G(n,r,t){if(r&&"undefined"==typeof t&&ee(n))for(var e=-1,u=n.length;++e<u&&r(n[e],e,n)!==!1;);else ne(n,r,t);return n}function J(n,r,t){var e={};return r=i(r,t),G(n,function(n,t,u){t=r(n,t,u)+"",(wt.call(e,t)?e[t]:e[t]=[]).push(n)
return v(n,0,Nt(St(0,e),u))}}function M(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Yt(o)?bt.apply(u,t?o:M(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;if(typeof r=="number")e=(0>r?St(0,u+r):r||0)-1;else if(r)return e=C(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function P(n,t,r){if(typeof t!="number"&&t!=L){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==L||r?1:St(0,t);return v(n,e)}function C(n,t,r,e){var u=0,o=n?n.length:u; }),e}function Q(n,r){var t=p(arguments,2),e=-1,u="function"==typeof r,a=n?n.length:0,o=Array("number"==typeof a?a:0);return G(n,function(n){o[++e]=(u?r:n[r]).apply(n,t)}),o}function W(n,r,t){var e=-1,u=n?n.length:0,a=Array("number"==typeof u?u:0);if(r=i(r,t),ee(n))for(;++e<u;)a[e]=r(n[e],e,n);else ne(n,function(n,t,u){a[++e]=r(n,t,u)});return a}function X(n,r,t){var e=-1/0,a=e;if(!r&&ee(n))for(var o=-1,f=n.length;++o<f;){var l=n[o];l>a&&(a=l)}else r=!r&&N(n)?u:i(r,t),ne(n,function(n,t,u){var o=r(n,t,u);
for(r=r?a(r,e,1):V,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function K(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;typeof t=="function"&&(e=r,r=t,t=Q);var c=!t&&75<=o;if(c)var l={};for(r&&(f=[],r=a(r,e));++u<o;){e=n[u];var p=r?r(e,u,n):e;if(c)var s=p+"",s=_t.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>z(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function U(n,t){return Pt||wt&&2<arguments.length?wt.call.apply(wt,arguments):f(n,t,v(arguments,2))}function V(n){return n}function G(n){F(d(n),function(t){var r=e[t]=n[t]; o>e&&(e=o,a=n)});return a}function Y(n,r,t){var e=1/0,a=e;if(!r&&ee(n))for(var o=-1,f=n.length;++o<f;){var l=n[o];l<a&&(a=l)}else r=!r&&N(n)?u:i(r,t),ne(n,function(n,t,u){var o=r(n,t,u);o<e&&(e=o,a=n)});return a}function Z(n,r,t,e){var u=arguments.length<3;if(r=i(r,e,4),ee(n)){var a=-1,o=n.length;for(u&&(t=n[++a]);++a<o;)t=r(t,n[a],a,n)}else ne(n,function(n,e,a){t=u?(u=!1,n):r(t,n,e,a)});return t}function nr(n,r,t,e){var u=n,a=n?n.length:0,o=arguments.length<3;if("number"!=typeof a){var f=ue(n);a=f.length
e.prototype[t]=function(){var n=[this.__wrapped__];return bt.apply(n,arguments),new e(r.apply(e,n))}})}function H(){return this.__wrapped__}var J=!0,L=null,Q=!1,W=typeof exports=="object"&&exports,X=typeof global=="object"&&global;X.global===X&&(n=X);var Y=[],Z={},nt=0,tt=Z,rt=30,et=n._,ut=/&(?:amp|lt|gt|quot|#39);/g,ot=/\b__p\+='';/g,it=/\b(__p\+=)''\+/g,ft=/(__e\(.*?\)|\b__t\))\+'';/g,at=/\w*$/,ct=RegExp("^"+(Z.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),lt=/\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g,pt=/<%=([\s\S]+?)%>/g,st=/($^)/,vt=/[&<>"']/g,gt=/['\n\r\t\u2028\u2029\\]/g,ht=Math.ceil,yt=Y.concat,mt=Math.floor,dt=ct.test(dt=Object.getPrototypeOf)&&dt,_t=Z.hasOwnProperty,bt=Y.push,jt=Z.toString,wt=ct.test(wt=v.bind)&&wt,xt=ct.test(xt=Array.isArray)&&xt,At=n.isFinite,Ot=n.isNaN,Et=ct.test(Et=Object.keys)&&Et,St=Math.max,Nt=Math.min,Rt=Math.random,$t="[object Arguments]",Ft="[object Array]",kt="[object Boolean]",qt="[object Date]",Dt="[object Number]",Tt="[object Object]",Bt="[object RegExp]",It="[object String]",Mt=!!n.attachEvent,zt=wt&&!/\n|true/.test(wt+Mt),Pt=wt&&!zt,Ct=Et&&(Mt||zt),Kt={"[object Function]":Q}; }return r=i(r,e,4),G(n,function(n,e,i){e=f?f[--a]:--a,t=o?(o=!1,u[e]):r(t,u[e],e,i)}),t}function rr(n,r,t){return r=i(r,t),U(n,function(n,t,e){return!r(n,t,e)})}function tr(n){var r=-1,t=n?n.length:0,e=Array("number"==typeof t?t:0);return G(n,function(n){var t=_t(Tt()*(++r+1));e[r]=e[t],e[t]=n}),e}function er(n){var r=n?n.length:0;return"number"==typeof r?r:ue(n).length}function ur(n,r,t){var e;if(r=i(r,t),ee(n))for(var u=-1,a=n.length;++u<a&&!(e=r(n[u],u,n)););else ne(n,function(n,t,u){return!(e=r(n,t,u))
Kt[$t]=Kt[Ft]=Kt[kt]=Kt[qt]=Kt[Dt]=Kt[Tt]=Kt[Bt]=Kt[It]=J;var Ut={};Ut[Ft]=Array,Ut[kt]=Boolean,Ut[qt]=Date,Ut[Tt]=Object,Ut[Dt]=Number,Ut[Bt]=RegExp,Ut[It]=String;var Vt={"boolean":Q,"function":J,object:J,number:Q,string:Q,undefined:Q},Gt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:pt,variable:"",imports:{_:e}};var Ht={a:"q,w,h",l:"var a=arguments,b=0,c=typeof h=='number'?2:a.length;while(++b<c){n=a[b];if(n&&r[typeof n]){",h:"if(typeof u[j]=='undefined')u[j]=n[j]",c:"}}"},Jt={a:"e,d,x",l:"d=d&&typeof x=='undefined'?d:f(d,x)",b:"typeof o=='number'",h:"if(d(n[j],j,e)===false)return u"},Lt={l:"if(!r[typeof n])return u;"+Jt.l,b:Q},Qt=c(Jt),Wt=c(Jt,Lt,{m:Q}),Xt=c(Jt,Lt),Yt=xt||function(n){return n instanceof Array||jt.call(n)==Ft });return!!e}function ar(n,r,t){var e=-1,u=n?n.length:0,o=Array("number"==typeof u?u:0);for(r=i(r,t),G(n,function(n,t,u){o[++e]={criteria:r(n,t,u),index:e,value:n}}),u=o.length,o.sort(a);u--;)o[u]=o[u].value;return o}function or(n){return n&&"number"==typeof n.length?p(n):H(n)}function ir(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e}function fr(n){for(var r=-1,t=n?n.length:0,u=bt.apply(nt,arguments),a=e(u,t),o=[];++r<t;){var i=n[r];a(i)||o.push(i)}return o}function lr(n,r,t){if(n){var e=0,u=n.length;
},Zt=Et?function(n){return w(n)?Et(n):[]}:y,nr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tr=_(nr),rr=c(Ht,{l:Ht.l.replace(";",";if(c>2){if(typeof a[c-2]=='function'){var d=f(a[--c-1],a[c--],2);}else if(typeof a[c-1]=='function'){d=a[--c];}}"),h:"u[j]=d?d(u[j],n[j]):n[j]"}),er=c(Ht);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==jt.call(n)}),e.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},e.assign=rr,e.at=function(n){for(var t=-1,r=yt.apply(Y,v(arguments,1)),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]]; if("number"!=typeof r&&null!=r){var a=-1;for(r=i(r,t);++a<u&&r(n[a],a,n);)e++}else if(e=r,null==e||t)return n[0];return p(n,0,Rt(Lt(0,e),u))}}function cr(n,r){for(var t=-1,e=n?n.length:0,u=[];++t<e;){var a=n[t];ee(a)?jt.apply(u,r?a:cr(a)):u.push(a)}return u}function sr(n,r,t){var e=-1,u=n?n.length:0;if("number"==typeof t)e=(t<0?Lt(0,u+t):t||0)-1;else if(t)return e=br(n,r),n[e]===r?e:-1;for(;++e<u;)if(n[e]===r)return e;return-1}function pr(n,r,t){if(!n)return[];var e=0,u=n.length;if("number"!=typeof r&&null!=r){var a=u;
return u},e.bind=U,e.bindAll=function(n){for(var t=yt.apply(Y,arguments),r=1<t.length?0:(t=d(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=U(n[u],n)}return n},e.bindKey=function(n,t){return f(n,t,v(arguments,2))},e.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},e.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},e.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",_t.call(e,r)?e[r]++:e[r]=1 for(r=i(r,t);a--&&r(n[a],a,n);)e++}else e=null==r||t?1:r||e;return p(n,0,Rt(Lt(0,u-e),u))}function gr(n){var r=arguments,t=r.length,u={0:{}},a=-1,o=n?n.length:0,i=o>=100,f=[],l=f;n:for(;++a<o;){var c=n[a];if(i)var s=c+"",p=wt.call(u[0],s)?!(l=u[0][s]):l=u[0][s]=[];if(p||sr(l,c)<0){i&&l.push(c);for(var g=t;--g;)if(!(u[g]||(u[g]=e(r[g],0,100)))(c))continue n;f.push(c)}}return f}function vr(n,r,t){if(n){var e=0,u=n.length;if("number"!=typeof r&&null!=r){var a=u;for(r=i(r,t);a--&&r(n[a],a,n);)e++}else if(e=r,null==e||t)return n[u-1];
}),e},e.debounce=function(n,t,r){function e(){f=L,r||(o=n.apply(i,u))}var u,o,i,f;return function(){var a=r&&!f;return u=arguments,i=this,clearTimeout(f),f=setTimeout(e,t),a&&(o=n.apply(i,u)),o}},e.defaults=er,e.defer=function(n){var r=v(arguments,1);return setTimeout(function(){n.apply(t,r)},1)},e.delay=function(n,r){var e=v(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},e.difference=function(n){for(var t=-1,r=n?n.length:0,e=yt.apply(Y,arguments),e=u(e,r),o=[];++t<r;){var i=n[t];e(i)||o.push(i) return p(n,Lt(0,u-e))}}function yr(n,r,t){var e=n?n.length:0;for("number"==typeof t&&(e=(t<0?Lt(0,e+t):Rt(t,e-1))+1);e--;)if(n[e]===r)return e;return-1}function hr(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var a=n[t];r?u[a]=r[t]:u[a[0]]=a[1]}return u}function dr(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);for(var e=-1,u=Lt(0,mt((r-n)/t)),a=Array(u);++e<u;)a[e]=n,n+=t;return a}function mr(n,r,t){if("number"!=typeof r&&null!=r){var e=0,u=-1,a=n?n.length:0;for(r=i(r,t);++u<a&&r(n[u],u,n);)e++}else e=null==r||t?1:Lt(0,r);
}return o},e.filter=R,e.flatten=M,e.forEach=F,e.forIn=Wt,e.forOwn=Xt,e.functions=d,e.groupBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(_t.call(e,r)?e[r]:e[r]=[]).push(n)}),e},e.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==L||r?1:t||e;return v(n,0,Nt(St(0,u-e),u))},e.intersection=function(n){var t=arguments,r=t.length,e={0:{}},o=-1,i=n?n.length:0,f=100<=i,a=[],c=a;n:for(;++o<i;){var l=n[o]; return p(n,e)}function br(n,r,t,e){var u=0,a=n?n.length:u;for(t=t?i(t,e,1):Br,r=t(r);u<a;){var o=u+a>>>1;t(n[o])<r?u=o+1:a=o}return u}function _r(){return xr(bt.apply(nt,arguments))}function xr(n,r,t,e){var u=-1,a=n?n.length:0,o=[],f=o;"function"==typeof r&&(e=t,t=r,r=!1);var l=!r&&a>=75;if(l)var c={};for(t&&(f=[],t=i(t,e));++u<a;){var s=n[u],p=t?t(s,u,n):s;if(l)var g=p+"",v=wt.call(c,g)?!(f=c[g]):f=c[g]=[];(r?!u||f[f.length-1]!==p:v||sr(f,p)<0)&&((t||l)&&f.push(p),o.push(s))}return o}function wr(n){for(var r=-1,t=n?n.length:0,u=e(arguments,1),a=[];++r<t;){var o=n[r];
if(f)var p=l+"",p=_t.call(e[0],p)?!(c=e[0][p]):c=e[0][p]=[];if(p||0>z(c,l)){f&&c.push(l);for(var s=r;--s;)if(!(e[s]||(e[s]=u(t[s],0,100)))(l))continue n;a.push(l)}}return a},e.invert=_,e.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},e.keys=Zt,e.map=k,e.max=q,e.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return _t.call(r,e)?r[e]:r[e]=n.apply(this,arguments) u(o)||a.push(o)}return a}function jr(n){for(var r=-1,t=n?X(ce(arguments,"length")):0,e=Array(t);++r<t;)e[r]=ce(arguments,r);return e}function Ar(n,t){return n<1?t():function(){return--n<1?t.apply(this,arguments):r}}function kr(n,r){return zt||kt&&arguments.length>2?kt.call.apply(kt,arguments):o(n,r,p(arguments,2))}function Or(n){for(var r=bt.apply(nt,arguments),t=r.length>1?0:(r=b(n),-1),e=r.length;++t<e;){var u=r[t];n[u]=kr(n[u],n)}return n}function Ir(n,r){return o(n,r,p(arguments,2))}function Er(){var n=arguments;
}},e.merge=O,e.min=function(n,t,r){var e=1/0,u=e;if(!t&&Yt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<u&&(u=f)}}else t=!t&&A(n)?o:a(t,r),Qt(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});return u},e.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]}return u},e.omit=function(n,t,r){var e=typeof t=="function",u={};if(e)t=a(t,r);else var o=yt.apply(Y,arguments);return Wt(n,function(n,r,i){(e?!t(n,r,i):0>z(o,r,1))&&(u[r]=n)}),u},e.once=function(n){var t,r; return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}}function Sr(n,r,t){function e(){i=null,t||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=t&&!i;return u=arguments,o=this,clearTimeout(i),i=setTimeout(e,r),f&&(a=n.apply(o,u)),a}}function Lr(n,t){var e=p(arguments,2);return setTimeout(function(){n.apply(r,e)},t)}function Rr(n){var t=p(arguments,1);return setTimeout(function(){n.apply(r,t)},1)}function Tr(n,r){var t={};return function(){var e=(r?r.apply(this,arguments):arguments[0])+"";
return function(){return t?r:(t=J,r=n.apply(this,arguments),n=L,r)}},e.pairs=function(n){for(var t=-1,r=Zt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},e.partial=function(n){return f(n,v(arguments,1))},e.partialRight=function(n){return f(n,v(arguments,1),L,tt)},e.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=0,o=yt.apply(Y,arguments),i=w(n)?o.length:0;++u<i;){var f=o[u];f in n&&(e[f]=n[f])}else t=a(t,r),Wt(n,function(n,r,u){t(n,r,u)&&(e[r]=n)});return e},e.pluck=k,e.range=function(n,t,r){n=+n||0,r=+r||1,t==L&&(t=n,n=0); return wt.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}}function Fr(n){var r,t;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}}function Nr(n){return o(n,p(arguments,1))}function $r(n){return o(n,p(arguments,1),null,et)}function Pr(n,r){function t(){i=new Date,o=null,u=n.apply(a,e)}var e,u,a,o,i=0;return function(){var f=new Date,l=r-(f-i);return e=arguments,a=this,l>0?o||(o=setTimeout(t,l)):(clearTimeout(o),o=null,i=f,u=n.apply(a,e)),u}}function Dr(n,r){return function(){var t=[n];
var e=-1;t=St(0,ht((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},e.reject=function(n,t,r){return t=a(t,r),R(n,function(n,r,e){return!t(n,r,e)})},e.rest=P,e.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=mt(Rt()*(++t+1));e[t]=e[r],e[r]=n}),e},e.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);for(t=a(t,r),F(n,function(n,r,u){o[++e]={a:t(n,r,u),b:e,c:n}}),u=o.length,o.sort(i);u--;)o[u]=o[u].c;return o return jt.apply(t,arguments),r.apply(this,t)}}function qr(n){return null==n?"":(n+"").replace(yt,c)}function Br(n){return n}function Hr(n){G(b(n),function(r){var e=t[r]=n[r];t.prototype[r]=function(){var n=[this.__wrapped__];return jt.apply(n,arguments),new t(e.apply(t,n))}})}function Cr(){return n._=at,this}function Kr(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r&&(r=n,n=0),n+_t(Tt()*((+r||0)-n+1))}function Mr(n,t){var e=n?n[t]:r;return E(e)?n[t]():e}function zr(n,e,u){var a=t.templateSettings;
},e.tap=function(n,t){return t(n),n},e.throttle=function(n,t){function r(){f=new Date,i=L,u=n.apply(o,e)}var e,u,o,i,f=0;return function(){var a=new Date,c=t-(a-f);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=L,f=a,u=n.apply(o,e)),u}},e.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},e.toArray=function(n){return n&&typeof n.length=="number"?v(n):E(n)},e.union=function(){return K(yt.apply(Y,arguments))},e.uniq=K,e.values=E,e.where=R,e.without=function(n){for(var t=-1,r=n?n.length:0,e=u(arguments,1),o=[];++t<r;){var i=n[t]; n||(n=""),u=fe({},u,a);var o,i=fe({},u.imports,a.imports),f=ue(i),c=H(i),s=0,p=u.interpolate||vt,g="__p += '",v=RegExp((u.escape||vt).source+"|"+p.source+"|"+(p===gt?pt:vt).source+"|"+(u.evaluate||vt).source+"|$","g");n.replace(v,function(r,t,e,u,a,i){return e||(e=u),g+=n.slice(s,i).replace(ht,l),t&&(g+="' +\n__e("+t+") +\n'"),a&&(o=!0,g+="';\n"+a+";\n__p += '"),e&&(g+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),s=i+r.length,r}),g+="';\n";var y=u.variable,h=y;h||(y="obj",g="with ("+y+") {\n"+g+"\n}\n"),g=(o?g.replace(it,""):g).replace(ft,"$1").replace(lt,"$1;"),g="function("+y+") {\n"+(h?"":y+" || ("+y+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+g+"return __p\n}";
e(i)||o.push(i)}return o},e.wrap=function(n,t){return function(){var r=[n];return bt.apply(r,arguments),t.apply(this,r)}},e.zip=function(n){for(var t=-1,r=n?q(k(arguments,"length")):0,e=Array(r);++t<r;)e[t]=k(arguments,t);return e},e.collect=k,e.drop=P,e.each=F,e.extend=rr,e.methods=d,e.select=R,e.tail=P,e.unique=K,G(e),e.clone=m,e.cloneDeep=function(n,t,r){return m(n,J,t,r)},e.contains=S,e.escape=function(n){return n==L?"":(n+"").replace(vt,p)},e.every=N,e.find=$,e.has=function(n,t){return n?_t.call(n,t):Q var d="\n/*\n//@ sourceURL="+(u.sourceURL||"/lodash/template/source["+dt++ +"]")+"\n*/";try{var m=Function(f,"return "+g+d).apply(r,c)}catch(b){throw b.source=g,b}return e?m(e):(m.source=g,m)}function Ur(n,r,t){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=r.call(t,e);return u}function Vr(n){return null==n?"":(n+"").replace(ot,g)}function Gr(n){var r=++tt;return(null==n?"":n+"")+r}function Jr(n,r){return r(n),n}function Qr(){return this.__wrapped__+""}function Wr(){return this.__wrapped__}var Xr="object"==typeof exports&&exports,Yr="object"==typeof module&&module&&module.exports==Xr&&module,Zr="object"==typeof global&&global;
},e.identity=V,e.indexOf=z,e.isArguments=h,e.isArray=Yt,e.isBoolean=function(n){return n===J||n===Q||jt.call(n)==kt},e.isDate=function(n){return n instanceof Date||jt.call(n)==qt},e.isElement=function(n){return n?1===n.nodeType:Q},e.isEmpty=function(n){var t=J;if(!n)return t;var r=jt.call(n),e=n.length;return r==Ft||r==It||r==$t||r==Tt&&typeof e=="number"&&j(n.splice)?!e:(Xt(n,function(){return t=Q}),t)},e.isEqual=b,e.isFinite=function(n){return At(n)&&!Ot(parseFloat(n))},e.isFunction=j,e.isNaN=function(n){return x(n)&&n!=+n Zr.global===Zr&&(n=Zr);var nt=[],rt={},tt=0,et=rt,ut=30,at=n._,ot=/&(?:amp|lt|gt|quot|#39);/g,it=/\b__p \+= '';/g,ft=/\b(__p \+=) '' \+/g,lt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ct=/\w*$/,st=RegExp("^"+(rt.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,gt=/<%=([\s\S]+?)%>/g,vt=/($^)/,yt=/[&<>"']/g,ht=/['\n\r\t\u2028\u2029\\]/g,dt=0,mt=Math.ceil,bt=nt.concat,_t=Math.floor,xt=st.test(xt=Object.getPrototypeOf)&&xt,wt=rt.hasOwnProperty,jt=nt.push,At=rt.toString,kt=st.test(kt=p.bind)&&kt,Ot=st.test(Ot=Array.isArray)&&Ot,It=n.isFinite,Et=n.isNaN,St=st.test(St=Object.keys)&&St,Lt=Math.max,Rt=Math.min,Tt=Math.random,Ft="[object Arguments]",Nt="[object Array]",$t="[object Boolean]",Pt="[object Date]",Dt="[object Function]",qt="[object Number]",Bt="[object Object]",Ht="[object RegExp]",Ct="[object String]",Kt=!!n.attachEvent,Mt=kt&&!/\n|true/.test(kt+Kt),zt=kt&&!Mt,Ut=St&&(Kt||Mt),Vt={};
},e.isNull=function(n){return n===L},e.isNumber=x,e.isObject=w,e.isPlainObject=r,e.isRegExp=function(n){return n instanceof RegExp||jt.call(n)==Bt},e.isString=A,e.isUndefined=function(n){return typeof n=="undefined"},e.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?St(0,e+r):Nt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},e.mixin=G,e.noConflict=function(){return n._=et,this},e.random=function(n,t){return n==L&&t==L&&(t=1),n=+n||0,t==L&&(t=n,n=0),n+mt(Rt()*((+t||0)-n+1)) Vt[Dt]=!1,Vt[Ft]=Vt[Nt]=Vt[$t]=Vt[Pt]=Vt[qt]=Vt[Bt]=Vt[Ht]=Vt[Ct]=!0;var Gt={};Gt[Nt]=Array,Gt[$t]=Boolean,Gt[Pt]=Date,Gt[Bt]=Object,Gt[qt]=Number,Gt[Ht]=RegExp,Gt[Ct]=String;var Jt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Qt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};t.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:gt,variable:"",imports:{_:t}};var Wt=function(n){var r="var index, iterable = "+n.firstArg+", result = iterable;\nif (!iterable) return result;\n"+n.top+";\n";
},e.reduce=D,e.reduceRight=T,e.result=function(n,r){var e=n?n[r]:t;return j(e)?n[r]():e},e.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Zt(n).length},e.some=B,e.sortedIndex=C,e.template=function(n,r,u){var o=e.templateSettings;n||(n=""),u=er({},u,o);var i,f=er({},u.imports,o.imports),o=Zt(f),f=E(f),a=0,c=u.interpolate||st,p="__p+='";n.replace(RegExp((u.escape||st).source+"|"+c.source+"|"+(c===pt?lt:st).source+"|"+(u.evaluate||st).source+"|$","g"),function(t,r,e,u,o,f){return e||(e=u),p+=n.slice(a,f).replace(gt,l),r&&(p+="'+__e("+r+")+'"),o&&(i=J,p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),a=f+t.length,t return n.arrays&&(r+="var length = iterable.length; index = -1;\nif ("+n.arrays+") {\n while (++index < length) {\n "+n.loop+"\n }\n}\nelse { "),n.isKeysFast&&n.useHas?r+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n "+n.loop+"\n } ":(r+="\n for (index in iterable) {",n.useHas&&(r+="\n if (",n.useHas&&(r+="hasOwnProperty.call(iterable, index)"),r+=") { "),r+=n.loop+"; ",n.useHas&&(r+="\n }"),r+="\n } "),n.arrays&&(r+="\n}"),r+=n.bottom+";\nreturn result"
}),p+="';\n",c=u=u.variable,c||(u="obj",p="with("+u+"){"+p+"}"),p=(i?p.replace(ot,""):p).replace(it,"$1").replace(ft,"$1;"),p="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(c?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";try{var s=Function(o,"return "+p).apply(t,f)}catch(v){throw v.source=p,v}return r?s(r):(s.source=p,s)},e.unescape=function(n){return n==L?"":(n+"").replace(ut,g)},e.uniqueId=function(n){var t=++nt; },Xt={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},Yt={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)",arrays:"typeof length == 'number'",loop:"if (callback(iterable[index], index, collection) === false) return result"},Zt={top:"if (!objectTypes[typeof iterable]) return result;\n"+Yt.top,arrays:!1},ne=f(Yt),re=f(Yt,Zt,{useHas:!1}),te=f(Yt,Zt),ee=Ot||function(n){return n instanceof Array||At.call(n)==Nt
return(n==L?"":n+"")+t},e.all=N,e.any=B,e.detect=$,e.foldl=D,e.foldr=T,e.include=S,e.inject=D,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(){var t=[this.__wrapped__];return bt.apply(t,arguments),n.apply(e,t)})}),e.first=I,e.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=L){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==L||r)return n[u-1];return v(n,St(0,u-e))}},e.take=I,e.head=I,Xt(e,function(n,t){e.prototype[t]||(e.prototype[t]=function(t,r){var u=n(this.__wrapped__,t,r); },ue=St?function(n){return S(n)?St(n):[]}:h,ae={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},oe=x(ae),ie=f(Xt,{top:Xt.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),fe=f(Xt);
return t==L||r&&typeof t!="function"?u:new e(u)})}),e.VERSION="1.0.0",e.prototype.toString=function(){return this.__wrapped__+""},e.prototype.value=H,e.prototype.valueOf=H,Qt(["join","pop","shift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Qt(["push","reverse","sort","unshift"],function(n){var t=Y[n];e.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Qt(["concat","slice","splice"],function(n){var t=Y[n];e.prototype[n]=function(){return new e(t.apply(this.__wrapped__,arguments)) E(/x/)&&(E=function(n){return n instanceof Function||At.call(n)==Dt});var le=xt?function(n){if(!n||"object"!=typeof n)return!1;var r=n.valueOf,t="function"==typeof r&&(t=xt(r))&&xt(t);return t?n==t||xt(n)==t&&!v(n):y(n)}:y,ce=W,se=U;Mt&&Yr&&"function"==typeof setImmediate&&(Rr=kr(setImmediate,n)),t.after=Ar,t.assign=ie,t.at=C,t.bind=kr,t.bindAll=Or,t.bindKey=Ir,t.compact=ir,t.compose=Er,t.countBy=M,t.debounce=Sr,t.defaults=fe,t.defer=Rr,t.delay=Lr,t.difference=fr,t.filter=U,t.flatten=cr,t.forEach=G,t.forIn=re,t.forOwn=te,t.functions=b,t.groupBy=J,t.initial=pr,t.intersection=gr,t.invert=x,t.invoke=Q,t.keys=ue,t.map=W,t.max=X,t.memoize=Tr,t.merge=P,t.min=Y,t.object=hr,t.omit=D,t.once=Fr,t.pairs=q,t.partial=Nr,t.partialRight=$r,t.pick=B,t.pluck=ce,t.range=dr,t.reject=rr,t.rest=mr,t.shuffle=tr,t.sortBy=ar,t.tap=Jr,t.throttle=Pr,t.times=Ur,t.toArray=or,t.union=_r,t.uniq=xr,t.values=H,t.where=se,t.without=wr,t.wrap=Dr,t.zip=jr,t.collect=W,t.drop=mr,t.each=G,t.extend=ie,t.methods=b,t.select=U,t.tail=mr,t.unique=xr,Hr(t),t.clone=d,t.cloneDeep=m,t.contains=K,t.escape=qr,t.every=z,t.find=V,t.has=_,t.identity=Br,t.indexOf=sr,t.isArguments=v,t.isArray=ee,t.isBoolean=w,t.isDate=j,t.isElement=A,t.isEmpty=k,t.isEqual=O,t.isFinite=I,t.isFunction=E,t.isNaN=L,t.isNull=R,t.isNumber=T,t.isObject=S,t.isPlainObject=le,t.isRegExp=F,t.isString=N,t.isUndefined=$,t.lastIndexOf=yr,t.mixin=Hr,t.noConflict=Cr,t.random=Kr,t.reduce=Z,t.reduceRight=nr,t.result=Mr,t.size=er,t.some=ur,t.sortedIndex=br,t.template=zr,t.unescape=Vr,t.uniqueId=Gr,t.all=z,t.any=ur,t.detect=V,t.foldl=Z,t.foldr=nr,t.include=K,t.inject=Z,te(t,function(n,r){t.prototype[r]||(t.prototype[r]=function(){var r=[this.__wrapped__];
}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=e,define(function(){return e})):W?typeof module=="object"&&module&&module.exports==W?(module.exports=e)._=e:W._=e:n._=e})(this); return jt.apply(r,arguments),n.apply(t,r)})}),t.first=lr,t.last=vr,t.take=lr,t.head=lr,te(t,function(n,r){t.prototype[r]||(t.prototype[r]=function(r,e){var u=n(this.__wrapped__,r,e);return null==r||e&&"function"!=typeof r?u:new t(u)})}),t.VERSION="1.0.2",t.prototype.toString=Qr,t.prototype.value=Wr,t.prototype.valueOf=Wr,ne(["join","pop","shift"],function(n){var r=nt[n];t.prototype[n]=function(){return r.apply(this.__wrapped__,arguments)}}),ne(["push","reverse","sort","unshift"],function(n){var r=nt[n];
t.prototype[n]=function(){return r.apply(this.__wrapped__,arguments),this}}),ne(["concat","slice","splice"],function(n){var r=nt[n];t.prototype[n]=function(){return new t(r.apply(this.__wrapped__,arguments))}}),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(n._=t,define(function(){return t})):Xr?Yr?(Yr.exports=t)._=t:Xr._=t:n._=t})(this);

View File

@@ -1,17 +1,20 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) <http://lodash.com/> * Lo-Dash 1.0.2 (Custom Build) <https://lodash.com/>
* Build: `lodash underscore -o ./dist/lodash.underscore.js` * Build: `lodash underscore -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license> * Available under MIT license <https://lodash.com/license>
*/ */
;(function(window, undefined) { ;(function(window, undefined) {
/** Detect free variable `exports` */ /** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports; var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global` and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal) {
@@ -53,7 +56,7 @@
* Used to match ES6 template delimiters * Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
*/ */
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match "interpolate" template delimiters */ /** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g; var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -3467,6 +3470,10 @@
var args = slice(arguments, 1); var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js
if (isV8 && freeModule && typeof setImmediate == 'function') {
defer = bind(setImmediate, window);
}
/** /**
* Creates a function that memoizes the result of `func`. If `resolver` is * Creates a function that memoizes the result of `func`. If `resolver` is
@@ -3799,7 +3806,7 @@
* build and using precompiled templates, or loading Lo-Dash in a sandbox. * build and using precompiled templates, or loading Lo-Dash in a sandbox.
* *
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * https://lodash.com/#custom-builds
* *
* For more information on Chrome extension sandboxes see: * For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html * http://developer.chrome.com/stable/extensions/sandboxingEval.html
@@ -4241,7 +4248,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.0.0'; lodash.VERSION = '1.0.2';
// add functions to `lodash.prototype` // add functions to `lodash.prototype`
mixin(lodash); mixin(lodash);
@@ -4285,8 +4292,8 @@
if (freeExports) { if (freeExports) {
// in Node.js or RingoJS v0.8.0+ // in Node.js or RingoJS v0.8.0+
if (typeof module == 'object' && module && module.exports == freeExports) { if (freeModule) {
(module.exports = lodash)._ = lodash; (freeModule.exports = lodash)._ = lodash;
} }
// in Narwhal or RingoJS v0.7.0- // in Narwhal or RingoJS v0.7.0-
else { else {

View File

@@ -1,34 +1,34 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 (Custom Build) lodash.com/license * Lo-Dash 1.0.2 (Custom Build) lodash.com/license
* Build: `lodash underscore -o ./dist/lodash.underscore.js` * Build: `lodash underscore -o ./dist/lodash.underscore.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n,r){function t(n,r){var t;if(n&&Rr[typeof n])for(t in r||(r=W),n)if(r(n[t],t,n)===Z)break}function e(n,r,t){if(n){r=r&&typeof t=="undefined"?r:a(r,t);var e=n.length;if(t=-1,typeof e=="number")for(;++t<e&&r(n[t],t,n)!==Z;);else for(t in n)if(cr.call(n,t)&&r(n[t],t,n)===Z)break}}function u(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof u?(this.__wrapped__=n,void 0):new u(n)}function o(n,r){var t=n.b,e=r.b;if(n=n.a,r=r.a,n!==r){if(n>r||typeof n=="undefined")return 1;if(n<r||typeof r=="undefined")return-1 ;(function(n,t){function r(n,t){var r;if(n&&qt[typeof n])for(r in t||(t=G),n)if(t(n[r],r,n)===tt)break}function e(n,t,r){if(n){t=t&&typeof r=="undefined"?t:a(t,r);var e=n.length;if(r=-1,typeof e=="number")for(;++r<e&&t(n[r],r,n)!==tt;);else for(r in n)if(pt.call(n,r)&&t(n[r],r,n)===tt)break}}function u(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof u?(this.__wrapped__=n,void 0):new u(n)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return t<e?-1:1}function i(n,r,t){function e(){var a=arguments,f=o?this:r;return u||(n=r[i]),t.length&&(a=a.length?(a=p(a),t.concat(a)):t),this instanceof e?(l.prototype=n.prototype,f=new l,l.prototype=J,a=n.apply(f,a),w(a)?a:f):n.apply(f,a)}var u=j(n),o=!t,i=r;return o&&(t=r),u||(r=n),e}function a(n,r,t){if(n==J)return W;var e=typeof n;if("function"!=e){if("object"!=e)return function(r){return r[n]};var u=Br(n);return function(r){for(var t=u.length,e=K;t--&&(e=r[u[t]]===n[u[t]]););return e}}return typeof r!="undefined"?1===t?function(t){return n.call(r,t) }return r<e?-1:1}function i(n,t,r){function e(){var a=arguments,f=o?this:t;return u||(n=t[i]),r.length&&(a=a.length?(a=p(a),r.concat(a)):r),this instanceof e?(l.prototype=n.prototype,f=new l,l.prototype=K,a=n.apply(f,a),w(a)?a:f):n.apply(f,a)}var u=j(n),o=!r,i=t;return o&&(r=t),u||(t=n),e}function a(n,t,r){if(n==K)return G;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Dt(n);return function(t){for(var r=u.length,e=L;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)
}:2===t?function(t,e){return n.call(r,t,e)}:4===t?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function f(n){return"\\"+Tr[n]}function c(n){return Dr[n]}function l(){}function p(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function s(n){return Mr[n]}function v(n){return pr.call(n)==br}function h(n){var r,t=[],e=function(n,r){t.push(r)};if(n&&Rr[typeof n])for(r in e||(e=W),n)if(cr.call(n,r)&&e(n[r],r,n)===Z)break; }:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function f(n){return"\\"+It[n]}function c(n){return Mt[n]}function l(){}function p(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function s(n){return $t[n]}function v(n){return vt.call(n)==wt}function h(n){var t,r=[],e=function(n,t){r.push(t)};if(n&&qt[typeof n])for(t in e||(e=G),n)if(pt.call(n,t)&&e(n[t],t,n)===tt)break;
return t}function g(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n}function y(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]==J&&(n[u]=e[u])}return n}function m(n){var r=[];return t(n,function(n,t){j(n)&&r.push(t)}),r.sort()}function _(n){for(var r=-1,t=Br(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function d(n){if(!n)return H;if(qr(n)||x(n))return!n.length;for(var r in n)if(cr.call(n,r))return K; return r}function g(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==K&&(n[u]=e[u])}return n}function m(n){var t=[];return r(n,function(n,r){j(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Dt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n){if(!n)return J;if(Bt(n)||x(n))return!n.length;for(var t in n)if(pt.call(n,t))return L;
return H}function b(n,r,e,u){if(n===r)return 0!==n||1/n==1/r;var o=typeof n,i=typeof r;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!r||"function"!=i&&"object"!=i))return K;if(n==J||r==J)return n===r;if(i=pr.call(n),o=pr.call(r),i!=o)return K;switch(i){case wr:case Ar:return+n==+r;case xr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case Or:case Sr:return n==r+""}if(o=i==jr,!o){if(n.__wrapped__||r.__wrapped__)return b(n.__wrapped__||n,r.__wrapped__||r,e,u);if(i!=Er)return K;var i=n.constructor,a=r.constructor; return J}function b(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return L;if(n==K||t==K)return n===t;if(i=vt.call(n),o=vt.call(t),i!=o)return L;switch(i){case xt:case Et:return+n==+t;case Ot:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case Nt:case kt:return n==t+""}if(o=i==At,!o){if(n.__wrapped__||t.__wrapped__)return b(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=St)return L;var i=n.constructor,a=t.constructor;
if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return K}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==r;var f=H,c=0;if(e.push(n),u.push(r),o){if(c=r.length,f=c==n.length)for(;c--&&(f=b(n[c],r[c],e,u)););return f}return t(r,function(r,t,o){return cr.call(o,t)?(c++,!(f=cr.call(n,t)&&b(n[t],r,e,u))&&Z):void 0}),f&&t(n,function(n,r,t){return cr.call(t,r)?!(f=-1<--c)&&Z:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?Rr[typeof n]:K}function A(n){return typeof n=="number"||pr.call(n)==xr if(i!=a&&(!j(i)||!(i instanceof i&&j(a)&&a instanceof a)))return L}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=J,c=0;if(e.push(n),u.push(t),o){if(c=t.length,f=c==n.length)for(;c--&&(f=b(n[c],t[c],e,u)););return f}return r(t,function(t,r,o){return pt.call(o,r)?(c++,!(f=pt.call(n,r)&&b(n[r],t,e,u))&&tt):void 0}),f&&r(n,function(n,t,r){return pt.call(r,t)?!(f=-1<--c)&&tt:void 0}),f}function j(n){return typeof n=="function"}function w(n){return n?qt[typeof n]:L}function A(n){return typeof n=="number"||vt.call(n)==Ot
}function x(n){return typeof n=="string"||pr.call(n)==Sr}function E(n){for(var r=-1,t=Br(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function O(n,r){var t=K;return typeof(n?n.length:0)=="number"?t=-1<z(n,r):e(n,function(n){return(t=n===r)&&Z}),t}function S(n,r,t){var u=H;if(r=a(r,t),qr(n)){t=-1;for(var o=n.length;++t<o&&(u=!!r(n[t],t,n)););}else e(n,function(n,t,e){return!(u=!!r(n,t,e))&&Z});return u}function N(n,r,t){var u=[];if(r=a(r,t),qr(n)){t=-1;for(var o=n.length;++t<o;){var i=n[t]; }function x(n){return typeof n=="string"||vt.call(n)==kt}function E(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function O(n,t){var r=L;return typeof(n?n.length:0)=="number"?r=-1<z(n,t):e(n,function(n){return(r=n===t)&&tt}),r}function S(n,t,r){var u=J;if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&(u=!!t(n[r],r,n)););}else e(n,function(n,r,e){return!(u=!!t(n,r,e))&&tt});return u}function N(n,t,r){var u=[];if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
r(i,t,n)&&u.push(i)}}else e(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function k(n,r,t){var e;return r=a(r,t),F(n,function(n,t,u){return r(n,t,u)?(e=n,Z):void 0}),e}function F(n,r,t){if(r&&typeof t=="undefined"&&qr(n)){t=-1;for(var u=n.length;++t<u&&r(n[t],t,n)!==Z;);}else e(n,r,t)}function R(n,r,t){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(r=a(r,t),qr(n))for(;++u<o;)i[u]=r(n[u],u,n);else e(n,function(n,t,e){i[++u]=r(n,t,e)});return i}function T(n,r,t){var u=-1/0,o=u;if(!r&&qr(n)){t=-1; t(i,r,n)&&u.push(i)}}else e(n,function(n,r,e){t(n,r,e)&&u.push(n)});return u}function k(n,t,r){var e;return t=a(t,r),F(n,function(n,r,u){return t(n,r,u)?(e=n,tt):void 0}),e}function F(n,t,r){if(t&&typeof r=="undefined"&&Bt(n)){r=-1;for(var u=n.length;++r<u&&t(n[r],r,n)!==tt;);}else e(n,t,r)}function R(n,t,r){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);if(t=a(t,r),Bt(n))for(;++u<o;)i[u]=t(n[u],u,n);else e(n,function(n,r,e){i[++u]=t(n,r,e)});return i}function T(n,t,r){var u=-1/0,o=u;if(!t&&Bt(n)){r=-1;
for(var i=n.length;++t<i;){var f=n[t];f>o&&(o=f)}}else r=a(r,t),e(n,function(n,t,e){t=r(n,t,e),t>u&&(u=t,o=n)});return o}function q(n,r,t,u){var o=3>arguments.length;if(r=a(r,u,4),qr(n)){var i=-1,f=n.length;for(o&&(t=n[++i]);++i<f;)t=r(t,n[i],i,n)}else e(n,function(n,e,u){t=o?(o=K,n):r(t,n,e,u)});return t}function B(n,r,t,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Br(n),u=i.length;return r=a(r,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,t=o?(o=K,n[a]):r(t,n[a],a,f)}),t}function D(n,r,t){var u; for(var i=n.length;++r<i;){var f=n[r];f>o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function q(n,t,r,u){var o=3>arguments.length;if(t=a(t,u,4),Bt(n)){var i=-1,f=n.length;for(o&&(r=n[++i]);++i<f;)r=t(r,n[i],i,n)}else e(n,function(n,e,u){r=o?(o=L,n):t(r,n,e,u)});return r}function I(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Dt(n),u=i.length;return t=a(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=L,n[a]):t(r,n[a],a,f)}),r}function B(n,t,r){var u;
if(r=a(r,t),qr(n)){t=-1;for(var o=n.length;++t<o&&!(u=r(n[t],t,n)););}else e(n,function(n,t,e){return(u=r(n,t,e))&&Z});return!!u}function M(n,r,t){return t&&d(r)?J:(t?k:N)(n,r)}function $(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&r!=J){var o=-1;for(r=a(r,t);++o<u&&r(n[o],o,n);)e++}else if(e=r,e==J||t)return n[0];return p(n,0,_r(mr(0,e),u))}}function I(n,r){for(var t=-1,e=n?n.length:0,u=[];++t<e;){var o=n[t];qr(o)?lr.apply(u,r?o:I(o)):u.push(o)}return u}function z(n,r,t){var e=-1,u=n?n.length:0; if(t=a(t,r),Bt(n)){r=-1;for(var o=n.length;++r<o&&!(u=t(n[r],r,n)););}else e(n,function(n,r,e){return(u=t(n,r,e))&&tt});return!!u}function D(n,t,r){return r&&d(t)?K:(r?k:N)(n,t)}function M(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=-1;for(t=a(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[0];return p(n,0,bt(dt(0,e),u))}}function $(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Bt(o)?st.apply(u,t?o:$(o)):u.push(o)}return u}function z(n,t,r){var e=-1,u=n?n.length:0;
if(typeof t=="number")e=(0>t?mr(0,u+t):t||0)-1;else if(t)return e=P(n,r),n[e]===r?e:-1;for(;++e<u;)if(n[e]===r)return e;return-1}function C(n,r,t){if(typeof r!="number"&&r!=J){var e=0,u=-1,o=n?n.length:0;for(r=a(r,t);++u<o&&r(n[u],u,n);)e++}else e=r==J||t?1:mr(0,r);return p(n,e)}function P(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?a(t,e,1):W,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function U(n,r,t,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof r=="function"&&(e=t,t=r,r=K),t&&(f=[],t=a(t,e));++u<o;){e=n[u]; if(typeof r=="number")e=(0>r?dt(0,u+r):r||0)-1;else if(r)return e=P(n,t),n[e]===t?e:-1;for(;++e<u;)if(n[e]===t)return e;return-1}function C(n,t,r){if(typeof t!="number"&&t!=K){var e=0,u=-1,o=n?n.length:0;for(t=a(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==K||r?1:dt(0,t);return p(n,e)}function P(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?a(r,e,1):G,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function U(n,t,r,e){var u=-1,o=n?n.length:0,i=[],f=i;for(typeof t=="function"&&(e=r,r=t,t=L),r&&(f=[],r=a(r,e));++u<o;){e=n[u];
var c=t?t(e,u,n):e;(r?!u||f[f.length-1]!==c:0>z(f,c))&&(t&&f.push(c),i.push(e))}return i}function V(n,r){return Nr||sr&&2<arguments.length?sr.call.apply(sr,arguments):i(n,r,p(arguments,2))}function W(n){return n}function G(n){F(m(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return lr.apply(n,arguments),n=t.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=H),n}})}var H=!0,J=null,K=!1,L=typeof exports=="object"&&exports,Q=typeof global=="object"&&global;Q.global===Q&&(n=Q); var c=r?r(e,u,n):e;(t?!u||f[f.length-1]!==c:0>z(f,c))&&(r&&f.push(c),i.push(e))}return i}function V(n,t){return Ft||ht&&2<arguments.length?ht.call.apply(ht,arguments):i(n,t,p(arguments,2))}function W(n){var r=p(arguments,1);return setTimeout(function(){n.apply(t,r)},1)}function G(n){return n}function H(n){F(m(n),function(t){var r=u[t]=n[t];u.prototype[t]=function(){var n=[this.__wrapped__];return st.apply(n,arguments),n=r.apply(u,n),this.__chain__&&(n=new u(n),n.__chain__=J),n}})}var J=!0,K=null,L=!1,Q=typeof exports=="object"&&exports,X=typeof module=="object"&&module&&module.exports==Q&&module,Y=typeof global=="object"&&global;
var X=[],Q={},Y=0,Z=Q,nr=n._,rr=/&(?:amp|lt|gt|quot|#39);/g,tr=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),er=/($^)/,ur=/[&<>"']/g,or=/['\n\r\t\u2028\u2029\\]/g,ir=Math.ceil,ar=X.concat,fr=Math.floor,cr=Q.hasOwnProperty,lr=X.push,pr=Q.toString,sr=tr.test(sr=p.bind)&&sr,vr=tr.test(vr=Array.isArray)&&vr,hr=n.isFinite,gr=n.isNaN,yr=tr.test(yr=Object.keys)&&yr,mr=Math.max,_r=Math.min,dr=Math.random,br="[object Arguments]",jr="[object Array]",wr="[object Boolean]",Ar="[object Date]",xr="[object Number]",Er="[object Object]",Or="[object RegExp]",Sr="[object String]",Q=!!n.attachEvent,Q=sr&&!/\n|true/.test(sr+Q),Nr=sr&&!Q,kr=(kr={0:1,length:1},X.splice.call(kr,0,1),kr[0]),Fr=arguments.constructor==Object,Rr={"boolean":K,"function":H,object:H,number:K,string:K,undefined:K},Tr={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"}; Y.global===Y&&(n=Y);var Z=[],Y={},nt=0,tt=Y,rt=n._,et=/&(?:amp|lt|gt|quot|#39);/g,ut=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ot=/($^)/,it=/[&<>"']/g,at=/['\n\r\t\u2028\u2029\\]/g,ft=Math.ceil,ct=Z.concat,lt=Math.floor,pt=Y.hasOwnProperty,st=Z.push,vt=Y.toString,ht=ut.test(ht=p.bind)&&ht,gt=ut.test(gt=Array.isArray)&&gt,yt=n.isFinite,mt=n.isNaN,_t=ut.test(_t=Object.keys)&&_t,dt=Math.max,bt=Math.min,jt=Math.random,wt="[object Arguments]",At="[object Array]",xt="[object Boolean]",Et="[object Date]",Ot="[object Number]",St="[object Object]",Nt="[object RegExp]",kt="[object String]",Y=!!n.attachEvent,Y=ht&&!/\n|true/.test(ht+Y),Ft=ht&&!Y,Rt=(Rt={0:1,length:1},Z.splice.call(Rt,0,1),Rt[0]),Tt=arguments.constructor==Object,qt={"boolean":L,"function":J,object:J,number:L,string:L,undefined:L},It={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};
u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?cr.call(n,"callee"):K});var qr=vr||function(n){return Fr&&n instanceof Array||pr.call(n)==jr},Br=yr?function(n){return w(n)?yr(n):[]}:h,Dr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Mr=_(Dr);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==pr.call(n)});var $r=R;u.after=function(n,r){return 1>n?r():function(){return 1>--n?r.apply(this,arguments):void 0 u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},v(arguments)||(v=function(n){return n?pt.call(n,"callee"):L});var Bt=gt||function(n){return Tt&&n instanceof Array||vt.call(n)==At},Dt=_t?function(n){return w(n)?_t(n):[]}:h,Mt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$t=_(Mt);j(/x/)&&(j=function(n){return n instanceof Function||"[object Function]"==vt.call(n)});var zt=R;Y&&X&&typeof setImmediate=="function"&&(W=V(setImmediate,n)),u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
}},u.bind=V,u.bindAll=function(n){for(var r=ar.apply(X,arguments),t=1<r.length?0:(r=m(n),-1),e=r.length;++t<e;){var u=r[t];n[u]=V(n[u],n)}return n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=function(n,r,t){var e={};return r=a(r,t),F(n,function(n,t,u){t=r(n,t,u)+"",cr.call(e,t)?e[t]++:e[t]=1}),e},u.debounce=function(n,r,t){function e(){a=J,t||(o=n.apply(i,u)) }},u.bind=V,u.bindAll=function(n){for(var t=ct.apply(Z,arguments),r=1<t.length?0:(t=m(n),-1),e=t.length;++r<e;){var u=t[r];n[u]=V(n[u],n)}return n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},u.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},u.countBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",pt.call(e,r)?e[r]++:e[r]=1}),e},u.debounce=function(n,t,r){function e(){a=K,r||(o=n.apply(i,u))
}var u,o,i,a;return function(){var f=t&&!a;return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,r),f&&(o=n.apply(i,u)),o}},u.defaults=y,u.defer=function(n){var t=p(arguments,1);return setTimeout(function(){n.apply(r,t)},1)},u.delay=function(n,t){var e=p(arguments,2);return setTimeout(function(){n.apply(r,e)},t)},u.difference=function(n){for(var r=-1,t=n.length,e=ar.apply(X,arguments),u=[];++r<t;){var o=n[r];0>z(e,o,t)&&u.push(o)}return u},u.filter=N,u.flatten=I,u.forEach=F,u.functions=m,u.groupBy=function(n,r,t){var e={}; }var u,o,i,a;return function(){var f=r&&!a;return u=arguments,i=this,clearTimeout(a),a=setTimeout(e,t),f&&(o=n.apply(i,u)),o}},u.defaults=y,u.defer=W,u.delay=function(n,r){var e=p(arguments,2);return setTimeout(function(){n.apply(t,e)},r)},u.difference=function(n){for(var t=-1,r=n.length,e=ct.apply(Z,arguments),u=[];++t<r;){var o=n[t];0>z(e,o,r)&&u.push(o)}return u},u.filter=N,u.flatten=$,u.forEach=F,u.functions=m,u.groupBy=function(n,t,r){var e={};return t=a(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(pt.call(e,r)?e[r]:e[r]=[]).push(n)
return r=a(r,t),F(n,function(n,t,u){t=r(n,t,u)+"",(cr.call(e,t)?e[t]:e[t]=[]).push(n)}),e},u.initial=function(n,r,t){if(!n)return[];var e=0,u=n.length;if(typeof r!="number"&&r!=J){var o=u;for(r=a(r,t);o--&&r(n[o],o,n);)e++}else e=r==J||t?1:r||e;return p(n,0,_r(mr(0,u-e),u))},u.intersection=function(n){var r=arguments,t=r.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>z(o,i)){for(var a=t;--a;)if(0>z(r[a],i))continue n;o.push(i)}}return o},u.invert=_,u.invoke=function(n,r){var t=p(arguments,2),e=-1,u=typeof r=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0); }),e},u.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else e=t==K||r?1:t||e;return p(n,0,bt(dt(0,u-e),u))},u.intersection=function(n){var t=arguments,r=t.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>z(o,i)){for(var a=r;--a;)if(0>z(t[a],i))continue n;o.push(i)}}return o},u.invert=_,u.invoke=function(n,t){var r=p(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);
return F(n,function(n){i[++e]=(u?r:n[r]).apply(n,t)}),i},u.keys=Br,u.map=R,u.max=T,u.memoize=function(n,r){var t={};return function(){var e=(r?r.apply(this,arguments):arguments[0])+"";return cr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var u=1/0,o=u;if(!r&&qr(n)){t=-1;for(var i=n.length;++t<i;){var f=n[t];f<o&&(o=f)}}else r=a(r,t),e(n,function(n,t,e){t=r(n,t,e),t<u&&(u=t,o=n)});return o},u.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var o=n[t];r?u[o]=r[t]:u[o[0]]=o[1] return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},u.keys=Dt,u.map=R,u.max=T,u.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return pt.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},u.min=function(n,t,r){var u=1/0,o=u;if(!t&&Bt(n)){r=-1;for(var i=n.length;++r<i;){var f=n[r];f<o&&(o=f)}}else t=a(t,r),e(n,function(n,r,e){r=t(n,r,e),r<u&&(u=r,o=n)});return o},u.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];t?u[o]=t[r]:u[o[0]]=o[1]
}return u},u.omit=function(n){var r=ar.apply(X,arguments),e={};return t(n,function(n,t){0>z(r,t,1)&&(e[t]=n)}),e},u.once=function(n){var r,t;return function(){return r?t:(r=H,t=n.apply(this,arguments),n=J,t)}},u.pairs=function(n){for(var r=-1,t=Br(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return i(n,p(arguments,1))},u.pick=function(n){for(var r=0,t=ar.apply(X,arguments),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=$r,u.range=function(n,r,t){n=+n||0,t=+t||1,r==J&&(r=n,n=0); }return u},u.omit=function(n){var t=ct.apply(Z,arguments),e={};return r(n,function(n,r){0>z(t,r,1)&&(e[r]=n)}),e},u.once=function(n){var t,r;return function(){return t?r:(t=J,r=n.apply(this,arguments),n=K,r)}},u.pairs=function(n){for(var t=-1,r=Dt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},u.partial=function(n){return i(n,p(arguments,1))},u.pick=function(n){for(var t=0,r=ct.apply(Z,arguments),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},u.pluck=zt,u.range=function(n,t,r){n=+n||0,r=+r||1,t==K&&(t=n,n=0);
var e=-1;r=mr(0,ir((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=a(r,t),N(n,function(n,t,e){return!r(n,t,e)})},u.rest=C,u.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return F(n,function(n){var t=fr(dr()*(++r+1));e[r]=e[t],e[t]=n}),e},u.sortBy=function(n,r,t){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(r=a(r,t),F(n,function(n,t,u){i[++e]={a:r(n,t,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i var e=-1;t=dt(0,ft((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},u.reject=function(n,t,r){return t=a(t,r),N(n,function(n,r,e){return!t(n,r,e)})},u.rest=C,u.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=lt(jt()*(++t+1));e[t]=e[r],e[r]=n}),e},u.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=a(t,r),F(n,function(n,r,u){i[++e]={a:t(n,r,u),b:e,c:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].c;return i
},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r){function t(){a=new Date,i=J,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=r-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(t,c)):(clearTimeout(i),i=J,a=f,u=n.apply(o,e)),u}},u.times=function(n,r,t){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=r.call(t,e);return u},u.toArray=function(n){return n&&typeof n.length=="number"?p(n):E(n)},u.union=function(){return U(ar.apply(X,arguments))},u.uniq=U,u.values=E,u.where=M,u.without=function(n){for(var r=-1,t=n.length,e=[];++r<t;){var u=n[r]; },u.tap=function(n,t){return t(n),n},u.throttle=function(n,t){function r(){a=new Date,i=K,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,c=t-(f-a);return e=arguments,o=this,0<c?i||(i=setTimeout(r,c)):(clearTimeout(i),i=K,a=f,u=n.apply(o,e)),u}},u.times=function(n,t,r){n=+n||0;for(var e=-1,u=Array(n);++e<n;)u[e]=t.call(r,e);return u},u.toArray=function(n){return n&&typeof n.length=="number"?p(n):E(n)},u.union=function(){return U(ct.apply(Z,arguments))},u.uniq=U,u.values=E,u.where=D,u.without=function(n){for(var t=-1,r=n.length,e=[];++t<r;){var u=n[t];
0>z(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,r){return function(){var t=[n];return lr.apply(t,arguments),r.apply(this,t)}},u.zip=function(n){for(var r=-1,t=n?T($r(arguments,"length")):0,e=Array(t);++r<t;)e[r]=$r(arguments,r);return e},u.collect=R,u.drop=C,u.each=F,u.extend=g,u.methods=m,u.select=N,u.tail=C,u.unique=U,u.clone=function(n){return w(n)?qr(n)?p(n):g({},n):n},u.contains=O,u.escape=function(n){return n==J?"":(n+"").replace(ur,c)},u.every=S,u.find=k,u.findWhere=function(n,r){return M(n,r,H) 0>z(arguments,u,1)&&e.push(u)}return e},u.wrap=function(n,t){return function(){var r=[n];return st.apply(r,arguments),t.apply(this,r)}},u.zip=function(n){for(var t=-1,r=n?T(zt(arguments,"length")):0,e=Array(r);++t<r;)e[t]=zt(arguments,t);return e},u.collect=R,u.drop=C,u.each=F,u.extend=g,u.methods=m,u.select=N,u.tail=C,u.unique=U,u.clone=function(n){return w(n)?Bt(n)?p(n):g({},n):n},u.contains=O,u.escape=function(n){return n==K?"":(n+"").replace(it,c)},u.every=S,u.find=k,u.findWhere=function(n,t){return D(n,t,J)
},u.has=function(n,r){return n?cr.call(n,r):K},u.identity=W,u.indexOf=z,u.isArguments=v,u.isArray=qr,u.isBoolean=function(n){return n===H||n===K||pr.call(n)==wr},u.isDate=function(n){return n instanceof Date||pr.call(n)==Ar},u.isElement=function(n){return n?1===n.nodeType:K},u.isEmpty=d,u.isEqual=b,u.isFinite=function(n){return hr(n)&&!gr(parseFloat(n))},u.isFunction=j,u.isNaN=function(n){return A(n)&&n!=+n},u.isNull=function(n){return n===J},u.isNumber=A,u.isObject=w,u.isRegExp=function(n){return n instanceof RegExp||pr.call(n)==Or },u.has=function(n,t){return n?pt.call(n,t):L},u.identity=G,u.indexOf=z,u.isArguments=v,u.isArray=Bt,u.isBoolean=function(n){return n===J||n===L||vt.call(n)==xt},u.isDate=function(n){return n instanceof Date||vt.call(n)==Et},u.isElement=function(n){return n?1===n.nodeType:L},u.isEmpty=d,u.isEqual=b,u.isFinite=function(n){return yt(n)&&!mt(parseFloat(n))},u.isFunction=j,u.isNaN=function(n){return A(n)&&n!=+n},u.isNull=function(n){return n===K},u.isNumber=A,u.isObject=w,u.isRegExp=function(n){return n instanceof RegExp||vt.call(n)==Nt
},u.isString=x,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?mr(0,e+t):_r(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=G,u.noConflict=function(){return n._=nr,this},u.random=function(n,r){return n==J&&r==J&&(r=1),n=+n||0,r==J&&(r=n,n=0),n+fr(dr()*((+r||0)-n+1))},u.reduce=q,u.reduceRight=B,u.result=function(n,r){var t=n?n[r]:J;return j(t)?n[r]():t},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Br(n).length },u.isString=x,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?dt(0,e+r):bt(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=H,u.noConflict=function(){return n._=rt,this},u.random=function(n,t){return n==K&&t==K&&(t=1),n=+n||0,t==K&&(t=n,n=0),n+lt(jt()*((+t||0)-n+1))},u.reduce=q,u.reduceRight=I,u.result=function(n,t){var r=n?n[t]:K;return j(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Dt(n).length
},u.some=D,u.sortedIndex=P,u.template=function(n,r,t){n||(n=""),t=y({},t,u.templateSettings);var e=0,o="__p+='",i=t.variable;n.replace(RegExp((t.escape||er).source+"|"+(t.interpolate||er).source+"|"+(t.evaluate||er).source+"|$","g"),function(r,t,u,i,a){return o+=n.slice(e,a).replace(or,f),t&&(o+="'+_['escape']("+t+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=a+r.length,r}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}"; },u.some=B,u.sortedIndex=P,u.template=function(n,t,r){n||(n=""),r=y({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||ot).source+"|"+(r.interpolate||ot).source+"|"+(r.evaluate||ot).source+"|$","g"),function(t,r,u,i,a){return o+=n.slice(e,a).replace(at,f),r&&(o+="'+_['escape']("+r+")+'"),i&&(o+="';"+i+";__p+='"),u&&(o+="'+((__t=("+u+"))==null?'':__t)+'"),e=a+t.length,t}),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";
try{var a=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return r?a(r):(a.source=o,a)},u.unescape=function(n){return n==J?"":(n+"").replace(rr,s)},u.uniqueId=function(n){var r=++Y+"";return n?n+r:r},u.all=S,u.any=D,u.detect=k,u.foldl=q,u.foldr=B,u.include=O,u.inject=q,u.first=$,u.last=function(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&r!=J){var o=u;for(r=a(r,t);o--&&r(n[o],o,n);)e++}else if(e=r,e==J||t)return n[u-1];return p(n,mr(0,u-e))}},u.take=$,u.head=$,u.chain=function(n){return n=new u(n),n.__chain__=H,n try{var a=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},u.unescape=function(n){return n==K?"":(n+"").replace(et,s)},u.uniqueId=function(n){var t=++nt+"";return n?n+t:t},u.all=S,u.any=B,u.detect=k,u.foldl=q,u.foldr=I,u.include=O,u.inject=q,u.first=M,u.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=K){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==K||r)return n[u-1];return p(n,dt(0,u-e))}},u.take=M,u.head=M,u.chain=function(n){return n=new u(n),n.__chain__=J,n
},u.VERSION="1.0.0",G(u),u.prototype.chain=function(){return this.__chain__=H,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var r=X[n];u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),kr&&0===n.length&&delete n[0],this}}),e(["concat","join","slice"],function(n){var r=X[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=H),n },u.VERSION="1.0.2",H(u),u.prototype.chain=function(){return this.__chain__=J,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=Z[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Rt&&0===n.length&&delete n[0],this}}),e(["concat","join","slice"],function(n){var t=Z[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=J),n
}}),L?typeof module=="object"&&module&&module.exports==L?(module.exports=u)._=u:L._=u:n._=u})(this); }}),Q?X?(X.exports=u)._=u:Q._=u:n._=u})(this);

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,38 @@
<?php <?php
// cleanup requested filepath // cleanup requested file path
$file = isset($_GET['f']) ? $_GET['f'] : 'lodash'; $filePath = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$file = preg_replace('#(\.*[\/])+#', '', $file); $filePath = preg_replace('#(\.*[\/])+#', '', $filePath);
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js'; $filePath .= preg_match('/\.[a-z]+$/', $filePath) ? '' : '.js';
// output filename // output filename
if (isset($_GET['o'])) { if (isset($_GET['o'])) {
$output = $_GET['o']; $outputName = $_GET['o'];
} else if (isset($_SERVER['argv'][1])) { } else if (isset($_SERVER['argv'][1])) {
$output = $_SERVER['argv'][1]; $outputName = $_SERVER['argv'][1];
} else { } else {
$output = basename($file); $outputName = basename($filePath);
} }
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
require('../vendor/docdown/docdown.php'); require('../vendor/docdown/docdown.php');
// get package version
$version = json_decode(file_get_contents('../package.json'))->version;
// generate Markdown // generate Markdown
$markdown = docdown(array( $markdown = docdown(array(
'path' => '../' . $file, 'path' => '../' . $filePath,
'title' => 'Lo-Dash <sup>v1.0.0</sup>', 'title' => '<a href="http://lodash.com/">Lo-Dash</a> <span>v' . $version . '</span>',
'toc' => 'categories', 'toc' => 'categories',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js' 'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js'
)); ));
// save to a .md file // save to a `.md` file
file_put_contents($output . '.md', $markdown); file_put_contents($outputName . '.md', $markdown);
// print // print
header('Content-Type: text/plain;charset=utf-8'); header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL; echo $markdown . PHP_EOL;
?>
?>

View File

@@ -1,16 +1,19 @@
/** /**
* @license * @license
* Lo-Dash 1.0.0 <http://lodash.com/> * Lo-Dash 1.0.2 <https://lodash.com/>
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
* Available under MIT license <http://lodash.com/license> * Available under MIT license <https://lodash.com/license>
*/ */
;(function(window, undefined) { ;(function(window, undefined) {
/** Detect free variable `exports` */ /** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports; var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global` and use it as `window` */ /** Detect free variable `global` and use it as `window` */
var freeGlobal = typeof global == 'object' && global; var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal) { if (freeGlobal.global === freeGlobal) {
@@ -55,7 +58,7 @@
* Used to match ES6 template delimiters * Used to match ES6 template delimiters
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
*/ */
var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)\}/g; var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
/** Used to match "interpolate" template delimiters */ /** Used to match "interpolate" template delimiters */
var reInterpolate = /<%=([\s\S]+?)%>/g; var reInterpolate = /<%=([\s\S]+?)%>/g;
@@ -182,7 +185,7 @@
var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx';
/** /**
* Detect if a node's [[Class]] is unresolvable (IE < 9) * Detect if a DOM node's [[Class]] is unresolvable (IE < 9)
* and that the JS engine won't error when attempting to coerce an object to * and that the JS engine won't error when attempting to coerce an object to
* a string without a `toString` function. * a string without a `toString` function.
*/ */
@@ -1060,12 +1063,10 @@
'top': 'top':
defaultsIteratorOptions.top.replace(';', defaultsIteratorOptions.top.replace(';',
';\n' + ';\n' +
'if (argsLength > 2) {\n' + "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" +
" if (typeof args[argsLength - 2] == 'function') {\n" + ' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' +
' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" +
" } else if (typeof args[argsLength - 1] == 'function') {\n" + ' callback = args[--argsLength];\n' +
' callback = args[--argsLength];\n' +
' }\n' +
'}' '}'
), ),
'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]'
@@ -1570,16 +1571,27 @@
// recursively compare objects and arrays (susceptible to call stack limits) // recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) { if (isArr) {
// compare lengths to determine if a deep comparison is necessary length = a.length;
size = b.length; size = b.length;
result = whereIndicator || size == a.length;
if (result) { // compare lengths to determine if a deep comparison is necessary
// deep compare the contents, ignoring non-numeric properties result = size == a.length;
while (size--) { if (!result && !whereIndicator) {
if (!(result = isEqual(a[size], b[size], callback, thisArg, stackA, stackB))) { return result;
break; }
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (whereIndicator) {
while (index--) {
if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) {
break;
}
} }
} else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) {
break;
} }
} }
return result; return result;
@@ -1922,12 +1934,10 @@
if (typeof deepIndicator != 'number') { if (typeof deepIndicator != 'number') {
length = args.length; length = args.length;
} }
if (length > 2) { if (length > 3 && typeof args[length - 2] == 'function') {
if (typeof args[length - 2] == 'function') { callback = createCallback(args[--length - 1], args[length--], 2);
callback = createCallback(args[--length - 1], args[length--], 2); } else if (length > 2 && typeof args[length - 1] == 'function') {
} else if (typeof args[length - 1] == 'function') { callback = args[--length];
callback = args[--length];
}
} }
} }
while (++index < length) { while (++index < length) {
@@ -2134,7 +2144,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** /**
* Creates an array of elements from the specified index(es), or keys, of the * Creates an array of elements from the specified indexes, or keys, of the
* `collection`. Indexes may be specified as individual arguments or as arrays * `collection`. Indexes may be specified as individual arguments or as arrays
* of indexes. * of indexes.
* *
@@ -2142,7 +2152,7 @@
* @memberOf _ * @memberOf _
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Array|Number|String} [index1, index2, ...] The index(es) of * @param {Array|Number|String} [index1, index2, ...] The indexes of
* `collection` to retrieve, either as individual arguments or arrays. * `collection` to retrieve, either as individual arguments or arrays.
* @returns {Array} Returns a new array of elements corresponding to the * @returns {Array} Returns a new array of elements corresponding to the
* provided indexes. * provided indexes.
@@ -4228,6 +4238,10 @@
var args = slice(arguments, 1); var args = slice(arguments, 1);
return setTimeout(function() { func.apply(undefined, args); }, 1); return setTimeout(function() { func.apply(undefined, args); }, 1);
} }
// use `setImmediate` if it's available in Node.js
if (isV8 && freeModule && typeof setImmediate == 'function') {
defer = bind(setImmediate, window);
}
/** /**
* Creates a function that memoizes the result of `func`. If `resolver` is * Creates a function that memoizes the result of `func`. If `resolver` is
@@ -4585,7 +4599,7 @@
* build and using precompiled templates, or loading Lo-Dash in a sandbox. * build and using precompiled templates, or loading Lo-Dash in a sandbox.
* *
* For more information on precompiling templates see: * For more information on precompiling templates see:
* http://lodash.com/#custom-builds * https://lodash.com/#custom-builds
* *
* For more information on Chrome extension sandboxes see: * For more information on Chrome extension sandboxes see:
* http://developer.chrome.com/stable/extensions/sandboxingEval.html * http://developer.chrome.com/stable/extensions/sandboxingEval.html
@@ -4733,7 +4747,7 @@
(isEvaluating (isEvaluating
? ', __j = Array.prototype.join;\n' + ? ', __j = Array.prototype.join;\n' +
"function print() { __p += __j.call(arguments, '') }\n" "function print() { __p += __j.call(arguments, '') }\n"
: (hasVariable ? '' : ', __d = ' + variable + '.' + variable + ' || ' + variable) + ';\n' : ';\n'
) + ) +
source + source +
'return __p\n}'; 'return __p\n}';
@@ -5059,7 +5073,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.0.0'; lodash.VERSION = '1.0.2';
// add "Chaining" functions to the wrapper // add "Chaining" functions to the wrapper
lodash.prototype.toString = wrapperToString; lodash.prototype.toString = wrapperToString;
@@ -5134,8 +5148,8 @@
// check for `exports` after `define` in case a build optimizer adds an `exports` object // check for `exports` after `define` in case a build optimizer adds an `exports` object
else if (freeExports) { else if (freeExports) {
// in Node.js or RingoJS v0.8.0+ // in Node.js or RingoJS v0.8.0+
if (typeof module == 'object' && module && module.exports == freeExports) { if (freeModule) {
(module.exports = lodash)._ = lodash; (freeModule.exports = lodash)._ = lodash;
} }
// in Narwhal or RingoJS v0.7.0- // in Narwhal or RingoJS v0.7.0-
else { else {

View File

@@ -1,52 +1,20 @@
{ {
"name": "lodash", "name": "lodash",
"version": "1.0.0", "version": "1.0.2",
"description": "An alternative to Underscore.js, delivering consistency, customization, performance, and extra features.", "description": "A utility library delivering consistency, customization, performance, and extras.",
"homepage": "http://lodash.com", "homepage": "https://lodash.com/",
"main": "./dist/lodash", "license": "MIT",
"keywords": [ "main": "./dist/lodash.js",
"browser", "keywords": ["browser", "client", "functional", "performance", "server", "speed", "util"],
"client", "author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"functional", "contributors": [
"performance", "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"server", "Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
"speed", "Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
"util" "Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
],
"licenses": [
{
"type": "MIT",
"url": "http://lodash.com/license"
}
],
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"web": "http://allyoucanleet.com/"
},
"bugs": {
"url": "https://github.com/bestiejs/lodash/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/bestiejs/lodash.git"
},
"bin": {
"lodash": "./build.js"
},
"directories": {
"doc": "./doc",
"test": "./test"
},
"engines": [
"node",
"rhino"
], ],
"repository": "lodash/lodash",
"jam": { "jam": {
"main": "./lodash.js" "main": "./dist/lodash.compat.js"
},
"scripts": {
"build": "node ./build.js",
"test": "node ./test/test.js ./dist/lodash.js && node ./test/test.js ./dist/lodash.min.js && node ./test/test-build.js"
} }
} }

View File

@@ -537,7 +537,7 @@
commands.forEach(function(command) { commands.forEach(function(command) {
var expectedId = /underscore/.test(command) ? 'underscore' : 'lodash'; var expectedId = /underscore/.test(command) ? 'underscore' : 'lodash';
asyncTest('`lodash template=*.jst` exports=amd' + (command ? ' ' + command : ''), function() { asyncTest('`lodash template=*.jst exports=amd' + (command ? ' ' + command : '') + '`', function() {
var start = _.after(2, _.once(QUnit.start)); var start = _.after(2, _.once(QUnit.start));
build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(data) { build(['-s', 'template=' + templatePath + '/*.jst', 'exports=amd'].concat(command || []), function(data) {
@@ -562,7 +562,7 @@
}); });
}); });
asyncTest('`lodash settings=...`' + (command ? ' ' + command : ''), function() { asyncTest('`lodash settings=...' + (command ? ' ' + command : '') + '`', function() {
var start = _.after(2, _.once(QUnit.start)); var start = _.after(2, _.once(QUnit.start));
build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/{{([\\s\\S]+?)}}/}'].concat(command || []), function(data) { build(['-s', 'template=' + templatePath + '/*.tpl', 'settings={interpolate:/{{([\\s\\S]+?)}}/}'].concat(command || []), function(data) {
@@ -640,6 +640,51 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('source maps');
(function() {
var mapCommands = [
'-p',
'-p custom.map',
'--source-map',
'--source-map custom.map'
];
var outputCommands = [
'',
'-o foo.js',
'-m -o bar.js'
];
mapCommands.forEach(function(mapCommand) {
outputCommands.forEach(function(outputCommand) {
asyncTest('`lodash ' + mapCommand + (outputCommand ? ' ' + outputCommand : '') + '`', function() {
var callback = _.once(function(data) {
var basename = path.basename(data.outputPath, '.js'),
comment = (/(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)$/.exec(data.source) || [])[0],
sources = /foo.js/.test(outputCommand) ? ['foo.js'] : ['lodash' + (outputCommand.length ? '' : '.custom') + '.js'],
sourceMap = JSON.parse(data.sourceMap),
sourceMapURL = (/\w+(?=\.map$)/.exec(mapCommand) || [basename])[0];
ok(RegExp('/\\*\\n//@ sourceMappingURL=' + sourceMapURL + '.map\\n\\*/').test(comment), basename);
equal(sourceMap.file, basename + '.js', basename);
deepEqual(sourceMap.sources, sources, basename);
QUnit.start();
});
outputCommand = outputCommand ? outputCommand.split(' ') : [];
if (outputCommand.indexOf('-m') < 0) {
callback = _.after(2, callback);
}
build(['-s'].concat(mapCommand.split(' '), outputCommand), callback);
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('strict modifier'); QUnit.module('strict modifier');
(function() { (function() {
@@ -648,7 +693,12 @@
'b': undefined 'b': undefined
}); });
['non-strict', 'strict'].forEach(function(strictMode, index) { var modes = [
'non-strict',
'strict'
];
modes.forEach(function(strictMode, index) {
asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() { asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() {
var commands = ['-s', 'include=bindAll,defaults,extend'], var commands = ['-s', 'include=bindAll,defaults,extend'],
start = _.after(2, _.once(QUnit.start)); start = _.after(2, _.once(QUnit.start));
@@ -1150,6 +1200,8 @@
'include=once plus=bind,Chaining', 'include=once plus=bind,Chaining',
'category=collections,functions', 'category=collections,functions',
'backbone legacy category=utilities minus=first,last', 'backbone legacy category=utilities minus=first,last',
'legacy include=defer',
'legacy underscore',
'underscore include=debounce,throttle plus=after minus=throttle', 'underscore include=debounce,throttle plus=after minus=throttle',
'underscore mobile strict category=functions exports=amd,global plus=pick,uniq', 'underscore mobile strict category=functions exports=amd,global plus=pick,uniq',
] ]
@@ -1164,19 +1216,19 @@
var command = origCommand; var command = origCommand;
if (index == 1) { if (index == 1) {
if (/mobile/.test(command)) { if (/legacy|mobile/.test(command)) {
return; return;
} }
command = 'mobile ' + command; command = 'mobile ' + command;
} }
if (index == 2) { if (index == 2) {
if (/modern/.test(command)) { if (/legacy|modern/.test(command)) {
return; return;
} }
command = 'modern ' + command; command = 'modern ' + command;
} }
if (index == 3) { if (index == 3) {
if (/category|underscore/.test(command)) { if (/category|legacy|underscore/.test(command)) {
return; return;
} }
command = 'underscore ' + command; command = 'underscore ' + command;

View File

@@ -545,6 +545,19 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.defer');
(function() {
asyncTest('should accept additional arguments', function() {
_.defer(function() {
deepEqual(slice.call(arguments), [1, 2, 3]);
QUnit.start();
}, 1, 2, 3);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.difference'); QUnit.module('lodash.difference');
(function() { (function() {
@@ -952,12 +965,15 @@
deepEqual(actual, { 'a': 2 }); deepEqual(actual, { 'a': 2 });
}); });
test('lodash.' + methodName + ' should not treat a function as a `callback` if less than two arguments are passed', function() { test('lodash.' + methodName + ' should not treat the second argument as a `callback`', function() {
function callback() {} function callback() {}
callback.b = 2; callback.b = 2;
var actual = func({ 'a': 1 }, callback); var actual = func({ 'a': 1 }, callback);
deepEqual(actual, { 'a': 1, 'b': 2 }); deepEqual(actual, { 'a': 1, 'b': 2 });
actual = func({ 'a': 1 }, callback, { 'c': 3 });
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3 });
}); });
}); });
@@ -1259,6 +1275,16 @@
var actual = _.isEqual('a', 'a', function() { }); var actual = _.isEqual('a', 'a', function() { });
strictEqual(actual, true); strictEqual(actual, true);
}); });
test('should return a boolean value even if `callback` does not', function() {
var actual = _.isEqual('a', 'a', function() { return 'a'; });
strictEqual(actual, true);
_.each(falsey, function(value) {
var actual = _.isEqual('a', 'b', function() { return value; });
strictEqual(actual, false);
});
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -2604,6 +2630,14 @@
deepEqual(_.where(collection, { 'a': { 'b': { 'c': 1 } } }), expected); deepEqual(_.where(collection, { 'a': { 'b': { 'c': 1 } } }), expected);
}); });
test('should search of arrays for values', function() {
var collection = [{ 'a': [1, 2] }],
expected = _.cloneDeep(collection);
deepEqual(_.where(collection, { 'a': [] }), []);
deepEqual(_.where(collection, { 'a': [2] }), expected);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
Permission is hereby granted, free of charge, to any person Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,6 +1,6 @@
// Backbone.js 0.9.10 // Backbone.js 0.9.10
// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc. // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license. // Backbone may be freely distributed under the MIT license.
// For all details and documentation: // For all details and documentation:
// http://backbonejs.org // http://backbonejs.org
@@ -89,15 +89,15 @@
// Optimized internal dispatch function for triggering events. Tries to // Optimized internal dispatch function for triggering events. Tries to
// keep the usual cases speedy (most Backbone events have 3 arguments). // keep the usual cases speedy (most Backbone events have 3 arguments).
var triggerEvents = function(events, args) { var triggerEvents = function(events, args) {
var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2]; var ev, i = -1, l = events.length;
switch (args.length) { switch (args.length) {
case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx);
return; return;
case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0]);
return; return;
case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1]);
return; return;
case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1], args[2]);
return; return;
default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
} }
@@ -119,24 +119,25 @@
// to a `callback` function. Passing `"all"` will bind the callback to // to a `callback` function. Passing `"all"` will bind the callback to
// all events fired. // all events fired.
on: function(name, callback, context) { on: function(name, callback, context) {
if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this; if (!(eventsApi(this, 'on', name, [callback, context]) && callback)) return this;
this._events || (this._events = {}); this._events || (this._events = {});
var events = this._events[name] || (this._events[name] = []); var list = this._events[name] || (this._events[name] = []);
events.push({callback: callback, context: context, ctx: context || this}); list.push({callback: callback, context: context, ctx: context || this});
return this; return this;
}, },
// Bind events to only be triggered a single time. After the first time // Bind events to only be triggered a single time. After the first time
// the callback is invoked, it will be removed. // the callback is invoked, it will be removed.
once: function(name, callback, context) { once: function(name, callback, context) {
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this; if (!(eventsApi(this, 'once', name, [callback, context]) && callback)) return this;
var self = this; var self = this;
var once = _.once(function() { var once = _.once(function() {
self.off(name, once); self.off(name, once);
callback.apply(this, arguments); callback.apply(this, arguments);
}); });
once._callback = callback; once._callback = callback;
return this.on(name, once, context); this.on(name, once, context);
return this;
}, },
// Remove one or many callbacks. If `context` is null, removes all // Remove one or many callbacks. If `context` is null, removes all
@@ -144,7 +145,7 @@
// callbacks for the event. If `name` is null, removes all bound // callbacks for the event. If `name` is null, removes all bound
// callbacks for all events. // callbacks for all events.
off: function(name, callback, context) { off: function(name, callback, context) {
var retain, ev, events, names, i, l, j, k; var list, ev, events, names, i, l, j, k;
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this; if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
if (!name && !callback && !context) { if (!name && !callback && !context) {
this._events = {}; this._events = {};
@@ -154,19 +155,19 @@
names = name ? [name] : _.keys(this._events); names = name ? [name] : _.keys(this._events);
for (i = 0, l = names.length; i < l; i++) { for (i = 0, l = names.length; i < l; i++) {
name = names[i]; name = names[i];
if (events = this._events[name]) { if (list = this._events[name]) {
this._events[name] = retain = []; events = [];
if (callback || context) { if (callback || context) {
for (j = 0, k = events.length; j < k; j++) { for (j = 0, k = list.length; j < k; j++) {
ev = events[j]; ev = list[j];
if ((callback && callback !== ev.callback && if ((callback && callback !== ev.callback &&
callback !== ev.callback._callback) || callback !== ev.callback._callback) ||
(context && context !== ev.context)) { (context && context !== ev.context)) {
retain.push(ev); events.push(ev);
} }
} }
} }
if (!retain.length) delete this._events[name]; this._events[name] = events;
} }
} }
@@ -188,37 +189,35 @@
return this; return this;
}, },
// An inversion-of-control version of `on`. Tell *this* object to listen to
// an event in another object ... keeping track of what it's listening to.
listenTo: function(obj, name, callback) {
var listeners = this._listeners || (this._listeners = {});
var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
listeners[id] = obj;
obj.on(name, typeof name === 'object' ? this : callback, this);
return this;
},
// Tell this object to stop listening to either specific events ... or // Tell this object to stop listening to either specific events ... or
// to every object it's currently listening to. // to every object it's currently listening to.
stopListening: function(obj, name, callback) { stopListening: function(obj, name, callback) {
var listeners = this._listeners; var listeners = this._listeners;
if (!listeners) return this; if (!listeners) return;
var deleteListener = !name && !callback; if (obj) {
if (typeof name === 'object') callback = this; obj.off(name, typeof name === 'object' ? this : callback, this);
if (obj) (listeners = {})[obj._listenerId] = obj; if (!name && !callback) delete listeners[obj._listenerId];
for (var id in listeners) { } else {
listeners[id].off(name, callback, this); if (typeof name === 'object') callback = this;
if (deleteListener) delete this._listeners[id]; for (var id in listeners) {
listeners[id].off(name, callback, this);
}
this._listeners = {};
} }
return this; return this;
} }
}; };
var listenMethods = {listenTo: 'on', listenToOnce: 'once'};
// An inversion-of-control versions of `on` and `once`. Tell *this* object to listen to
// an event in another object ... keeping track of what it's listening to.
_.each(listenMethods, function(implementation, method) {
Events[method] = function(obj, name, callback) {
var listeners = this._listeners || (this._listeners = {});
var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
listeners[id] = obj;
if (typeof name === 'object') callback = this;
obj[implementation](name, callback, this);
return this;
};
});
// Aliases for backwards compatibility. // Aliases for backwards compatibility.
Events.bind = Events.on; Events.bind = Events.on;
Events.unbind = Events.off; Events.unbind = Events.off;
@@ -253,9 +252,6 @@
// A hash of attributes whose current and previous value differ. // A hash of attributes whose current and previous value differ.
changed: null, changed: null,
// The value returned during the last failed validation.
validationError: null,
// The default name for the JSON `id` attribute is `"id"`. MongoDB and // The default name for the JSON `id` attribute is `"id"`. MongoDB and
// CouchDB users may want to set this to `"_id"`. // CouchDB users may want to set this to `"_id"`.
idAttribute: 'id', idAttribute: 'id',
@@ -418,14 +414,11 @@
fetch: function(options) { fetch: function(options) {
options = options ? _.clone(options) : {}; options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true; if (options.parse === void 0) options.parse = true;
var model = this;
var success = options.success; var success = options.success;
options.success = function(resp) { options.success = function(model, resp, options) {
if (!model.set(model.parse(resp, options), options)) return false; if (!model.set(model.parse(resp, options), options)) return false;
if (success) success(model, resp, options); if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
}; };
wrapError(this, options);
return this.sync('read', this, options); return this.sync('read', this, options);
}, },
@@ -433,7 +426,7 @@
// If the server returns an attributes hash that differs, the model's // If the server returns an attributes hash that differs, the model's
// state will be `set` again. // state will be `set` again.
save: function(key, val, options) { save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes; var attrs, success, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments. // Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') { if (key == null || typeof key === 'object') {
@@ -459,9 +452,8 @@
// After a successful server-side save, the client is (optionally) // After a successful server-side save, the client is (optionally)
// updated with the server-side state. // updated with the server-side state.
if (options.parse === void 0) options.parse = true; if (options.parse === void 0) options.parse = true;
var model = this; success = options.success;
var success = options.success; options.success = function(model, resp, options) {
options.success = function(resp) {
// Ensure attributes are restored during synchronous saves. // Ensure attributes are restored during synchronous saves.
model.attributes = attributes; model.attributes = attributes;
var serverAttrs = model.parse(resp, options); var serverAttrs = model.parse(resp, options);
@@ -470,10 +462,9 @@
return false; return false;
} }
if (success) success(model, resp, options); if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
}; };
wrapError(this, options);
// Finish configuring and sending the Ajax request.
method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update'); method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
if (method === 'patch') options.attrs = attrs; if (method === 'patch') options.attrs = attrs;
xhr = this.sync(method, this, options); xhr = this.sync(method, this, options);
@@ -496,17 +487,15 @@
model.trigger('destroy', model, model.collection, options); model.trigger('destroy', model, model.collection, options);
}; };
options.success = function(resp) { options.success = function(model, resp, options) {
if (options.wait || model.isNew()) destroy(); if (options.wait || model.isNew()) destroy();
if (success) success(model, resp, options); if (success) success(model, resp, options);
if (!model.isNew()) model.trigger('sync', model, resp, options);
}; };
if (this.isNew()) { if (this.isNew()) {
options.success(); options.success(this, null, options);
return false; return false;
} }
wrapError(this, options);
var xhr = this.sync('delete', this, options); var xhr = this.sync('delete', this, options);
if (!options.wait) destroy(); if (!options.wait) destroy();
@@ -544,8 +533,8 @@
}, },
// Run validation against the next complete set of model attributes, // Run validation against the next complete set of model attributes,
// returning `true` if all is well. Otherwise, fire an // returning `true` if all is well. Otherwise, fire a general
// `"invalid"` event and call the invalid callback, if specified. // `"error"` event and call the error callback, if specified.
_validate: function(attrs, options) { _validate: function(attrs, options) {
if (!options.validate || !this.validate) return true; if (!options.validate || !this.validate) return true;
attrs = _.extend({}, this.attributes, attrs); attrs = _.extend({}, this.attributes, attrs);
@@ -567,6 +556,7 @@
options || (options = {}); options || (options = {});
if (options.model) this.model = options.model; if (options.model) this.model = options.model;
if (options.comparator !== void 0) this.comparator = options.comparator; if (options.comparator !== void 0) this.comparator = options.comparator;
this.models = [];
this._reset(); this._reset();
this.initialize.apply(this, arguments); this.initialize.apply(this, arguments);
if (models) this.reset(models, _.extend({silent: true}, options)); if (models) this.reset(models, _.extend({silent: true}, options));
@@ -601,13 +591,16 @@
var i, l, model, attrs, existing, doSort, add, at, sort, sortAttr; var i, l, model, attrs, existing, doSort, add, at, sort, sortAttr;
add = []; add = [];
at = options.at; at = options.at;
sort = this.comparator && (at == null) && options.sort !== false; sort = this.comparator && (at == null) && options.sort != false;
sortAttr = _.isString(this.comparator) ? this.comparator : null; sortAttr = _.isString(this.comparator) ? this.comparator : null;
// Turn bare objects into model references, and prevent invalid models // Turn bare objects into model references, and prevent invalid models
// from being added. // from being added.
for (i = 0, l = models.length; i < l; i++) { for (i = 0, l = models.length; i < l; i++) {
if (!(model = this._prepareModel(attrs = models[i], options))) continue; if (!(model = this._prepareModel(attrs = models[i], options))) {
this.trigger('invalid', this, attrs, options);
continue;
}
// If a duplicate is found, prevent it from being added and // If a duplicate is found, prevent it from being added and
// optionally merge it into the existing model. // optionally merge it into the existing model.
@@ -714,7 +707,8 @@
// Get a model from the set by id. // Get a model from the set by id.
get: function(obj) { get: function(obj) {
if (obj == null) return void 0; if (obj == null) return void 0;
return this._byId[obj.id || obj.cid || obj]; this._idAttr || (this._idAttr = this.model.prototype.idAttribute);
return this._byId[obj.id || obj.cid || obj[this._idAttr] || obj];
}, },
// Get the model at the given index. // Get the model at the given index.
@@ -722,11 +716,10 @@
return this.models[index]; return this.models[index];
}, },
// Return models with matching attributes. Useful for simple cases of // Return models with matching attributes. Useful for simple cases of `filter`.
// `filter`. where: function(attrs) {
where: function(attrs, first) { if (_.isEmpty(attrs)) return [];
if (_.isEmpty(attrs)) return first ? void 0 : []; return this.filter(function(model) {
return this[first ? 'find' : 'filter'](function(model) {
for (var key in attrs) { for (var key in attrs) {
if (attrs[key] !== model.get(key)) return false; if (attrs[key] !== model.get(key)) return false;
} }
@@ -734,12 +727,6 @@
}); });
}, },
// Return the first model with matching attributes. Useful for simple cases
// of `find`.
findWhere: function(attrs) {
return this.where(attrs, true);
},
// Force the collection to re-sort itself. You don't need to call this under // Force the collection to re-sort itself. You don't need to call this under
// normal circumstances, as the set will maintain sort order as each item // normal circumstances, as the set will maintain sort order as each item
// is added. // is added.
@@ -770,7 +757,7 @@
update: function(models, options) { update: function(models, options) {
options = _.extend({add: true, merge: true, remove: true}, options); options = _.extend({add: true, merge: true, remove: true}, options);
if (options.parse) models = this.parse(models, options); if (options.parse) models = this.parse(models, options);
var attrs, model, i, l, existing; var model, i, l, existing;
var add = [], remove = [], modelMap = {}; var add = [], remove = [], modelMap = {};
// Allow a single model (or no argument) to be passed. // Allow a single model (or no argument) to be passed.
@@ -781,12 +768,11 @@
// Determine which models to add and merge, and which to remove. // Determine which models to add and merge, and which to remove.
for (i = 0, l = models.length; i < l; i++) { for (i = 0, l = models.length; i < l; i++) {
if (!((attrs = models[i]) instanceof Model)) attrs = _.clone(attrs); model = models[i];
if (!(model = this._prepareModel(attrs, options))) continue;
existing = this.get(model); existing = this.get(model);
if (options.remove && existing) modelMap[existing.cid] = true; if (options.remove && existing) modelMap[existing.cid] = true;
if ((options.add && !existing) || (options.merge && existing)) { if ((options.add && !existing) || (options.merge && existing)) {
add.push(models[i]); add.push(model);
} }
} }
if (options.remove) { if (options.remove) {
@@ -811,7 +797,7 @@
for (var i = 0, l = this.models.length; i < l; i++) { for (var i = 0, l = this.models.length; i < l; i++) {
this._removeReference(this.models[i]); this._removeReference(this.models[i]);
} }
options.previousModels = this.models; options.previousModels = this.models.slice();
this._reset(); this._reset();
if (models) this.add(models, _.extend({silent: true}, options)); if (models) this.add(models, _.extend({silent: true}, options));
if (!options.silent) this.trigger('reset', this, options); if (!options.silent) this.trigger('reset', this, options);
@@ -825,14 +811,11 @@
options = options ? _.clone(options) : {}; options = options ? _.clone(options) : {};
if (options.parse === void 0) options.parse = true; if (options.parse === void 0) options.parse = true;
var success = options.success; var success = options.success;
var collection = this; options.success = function(collection, resp, options) {
options.success = function(resp) {
var method = options.update ? 'update' : 'reset'; var method = options.update ? 'update' : 'reset';
collection[method](resp, options); collection[method](resp, options);
if (success) success(collection, resp, options); if (success) success(collection, resp, options);
collection.trigger('sync', collection, resp, options);
}; };
wrapError(this, options);
return this.sync('read', this, options); return this.sync('read', this, options);
}, },
@@ -845,7 +828,7 @@
if (!options.wait) this.add(model, options); if (!options.wait) this.add(model, options);
var collection = this; var collection = this;
var success = options.success; var success = options.success;
options.success = function(resp) { options.success = function(model, resp, options) {
if (options.wait) collection.add(model, options); if (options.wait) collection.add(model, options);
if (success) success(model, resp, options); if (success) success(model, resp, options);
}; };
@@ -867,7 +850,7 @@
// Reset all internal state. Called when the collection is reset. // Reset all internal state. Called when the collection is reset.
_reset: function() { _reset: function() {
this.length = 0; this.length = 0;
this.models = []; this.models.length = 0;
this._byId = {}; this._byId = {};
}, },
@@ -880,10 +863,7 @@
options || (options = {}); options || (options = {});
options.collection = this; options.collection = this;
var model = new this.model(attrs, options); var model = new this.model(attrs, options);
if (!model._validate(attrs, options)) { if (!model._validate(attrs, options)) return false;
this.trigger('invalid', this, attrs, options);
return false;
}
return model; return model;
}, },
@@ -1320,7 +1300,7 @@
// This only works for delegate-able events: not `focus`, `blur`, and // This only works for delegate-able events: not `focus`, `blur`, and
// not `change`, `submit`, and `reset` in Internet Explorer. // not `change`, `submit`, and `reset` in Internet Explorer.
delegateEvents: function(events) { delegateEvents: function(events) {
if (!(events || (events = _.result(this, 'events')))) return this; if (!(events || (events = _.result(this, 'events')))) return;
this.undelegateEvents(); this.undelegateEvents();
for (var key in events) { for (var key in events) {
var method = events[key]; var method = events[key];
@@ -1336,7 +1316,6 @@
this.$el.on(eventName, selector, method); this.$el.on(eventName, selector, method);
} }
} }
return this;
}, },
// Clears all callbacks previously bound to the view with `delegateEvents`. // Clears all callbacks previously bound to the view with `delegateEvents`.
@@ -1344,7 +1323,6 @@
// Backbone views attached to the same DOM element. // Backbone views attached to the same DOM element.
undelegateEvents: function() { undelegateEvents: function() {
this.$el.off('.delegateEvents' + this.cid); this.$el.off('.delegateEvents' + this.cid);
return this;
}, },
// Performs the initial configuration of a View with a set of options. // Performs the initial configuration of a View with a set of options.
@@ -1447,6 +1425,18 @@
params.processData = false; params.processData = false;
} }
var success = options.success;
options.success = function(resp) {
if (success) success(model, resp, options);
model.trigger('sync', model, resp, options);
};
var error = options.error;
options.error = function(xhr) {
if (error) error(model, xhr, options);
model.trigger('error', model, xhr, options);
};
// Make the request, allowing the user to override any Ajax options. // Make the request, allowing the user to override any Ajax options.
var xhr = options.xhr = Backbone.ajax(_.extend(params, options)); var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
model.trigger('request', model, xhr, options); model.trigger('request', model, xhr, options);
@@ -1505,13 +1495,4 @@
throw new Error('A "url" property or function must be specified'); throw new Error('A "url" property or function must be specified');
}; };
// Wrap an optional error callback with a fallback error event.
var wrapError = function (model, options) {
var error = options.error;
options.error = function(resp) {
if (error) error(model, resp, options);
model.trigger('error', model, resp, options);
};
};
}).call(this); }).call(this);

View File

@@ -70,20 +70,22 @@ $(document).ready(function() {
equal(col.get(col.first().cid), col.first()); equal(col.get(col.first().cid), col.first());
}); });
test("get with non-default ids", 5, function() { test("get with non-default ids", 4, function() {
var col = new Backbone.Collection(); var col = new Backbone.Collection();
var MongoModel = Backbone.Model.extend({idAttribute: '_id'}); var MongoModel = Backbone.Model.extend({
idAttribute: '_id'
});
var model = new MongoModel({_id: 100}); var model = new MongoModel({_id: 100});
col.add(model); col.push(model);
equal(col.get(100), model); equal(col.get(100), model);
equal(col.get(model.cid), model); model.set({_id: 101});
equal(col.get(model), model); equal(col.get(101), model);
equal(col.get(101), void 0);
var col2 = new Backbone.Collection(); var Col2 = Backbone.Collection.extend({ model: MongoModel });
col2.model = MongoModel; var col2 = new Col2();
col2.add(model.attributes); col2.push(model);
equal(col2.get(model.clone()), col2.first()); equal(col2.get({_id: 101}), model);
equal(col2.get(model.clone()), model);
}); });
test("update index when id changes", 3, function() { test("update index when id changes", 3, function() {
@@ -360,7 +362,9 @@ $(document).ready(function() {
test("model destroy removes from all collections", 3, function() { test("model destroy removes from all collections", 3, function() {
var e = new Backbone.Model({id: 5, title: 'Othello'}); var e = new Backbone.Model({id: 5, title: 'Othello'});
e.sync = function(method, model, options) { options.success(); }; e.sync = function(method, model, options) {
options.success(model, [], options);
};
var colE = new Backbone.Collection([e]); var colE = new Backbone.Collection([e]);
var colF = new Backbone.Collection([e]); var colF = new Backbone.Collection([e]);
e.destroy(); e.destroy();
@@ -392,15 +396,6 @@ $(document).ready(function() {
equal(this.syncArgs.options.parse, false); equal(this.syncArgs.options.parse, false);
}); });
test("fetch with an error response triggers an error event", 1, function () {
var collection = new Backbone.Collection();
collection.on('error', function () {
ok(true);
});
collection.sync = function (method, model, options) { options.error(); };
collection.fetch();
});
test("ensure fetch only parses once", 1, function() { test("ensure fetch only parses once", 1, function() {
var collection = new Backbone.Collection; var collection = new Backbone.Collection;
var counter = 0; var counter = 0;
@@ -410,7 +405,7 @@ $(document).ready(function() {
}; };
collection.url = '/test'; collection.url = '/test';
collection.fetch(); collection.fetch();
this.syncArgs.options.success(); this.syncArgs.options.success([]);
equal(counter, 1); equal(counter, 1);
}); });
@@ -466,10 +461,9 @@ $(document).ready(function() {
equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]'); equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
}); });
test("where and findWhere", 8, function() { test("where", 6, function() {
var model = new Backbone.Model({a: 1});
var coll = new Backbone.Collection([ var coll = new Backbone.Collection([
model, {a: 1},
{a: 1}, {a: 1},
{a: 1, b: 2}, {a: 1, b: 2},
{a: 2, b: 2}, {a: 2, b: 2},
@@ -481,8 +475,6 @@ $(document).ready(function() {
equal(coll.where({b: 1}).length, 0); equal(coll.where({b: 1}).length, 0);
equal(coll.where({b: 2}).length, 2); equal(coll.where({b: 2}).length, 2);
equal(coll.where({a: 1, b: 2}).length, 1); equal(coll.where({a: 1, b: 2}).length, 1);
equal(coll.findWhere({a: 1}), model);
equal(coll.findWhere({a: 4}), void 0);
}); });
test("Underscore methods", 13, function() { test("Underscore methods", 13, function() {
@@ -492,10 +484,10 @@ $(document).ready(function() {
equal(col.indexOf(b), 1); equal(col.indexOf(b), 1);
equal(col.size(), 4); equal(col.size(), 4);
equal(col.rest().length, 3); equal(col.rest().length, 3);
ok(!_.include(col.rest(), a)); ok(!_.include(col.rest()), a);
ok(_.include(col.rest(), d)); ok(!_.include(col.rest()), d);
ok(!col.isEmpty()); ok(!col.isEmpty());
ok(!_.include(col.without(d), d)); ok(!_.include(col.without(d)), d);
equal(col.max(function(model){ return model.id; }).id, 3); equal(col.max(function(model){ return model.id; }).id, 3);
equal(col.min(function(model){ return model.id; }).id, 0); equal(col.min(function(model){ return model.id; }).id, 0);
deepEqual(col.chain() deepEqual(col.chain()
@@ -519,7 +511,7 @@ $(document).ready(function() {
test("reset", 10, function() { test("reset", 10, function() {
var resetCount = 0; var resetCount = 0;
var models = col.models; var models = col.models.slice();
col.on('reset', function() { resetCount += 1; }); col.on('reset', function() { resetCount += 1; });
col.reset([]); col.reset([]);
equal(resetCount, 1); equal(resetCount, 1);
@@ -710,7 +702,9 @@ $(document).ready(function() {
test("#1447 - create with wait adds model.", 1, function() { test("#1447 - create with wait adds model.", 1, function() {
var collection = new Backbone.Collection; var collection = new Backbone.Collection;
var model = new Backbone.Model; var model = new Backbone.Model;
model.sync = function(method, model, options){ options.success(); }; model.sync = function(method, model, options){
options.success(model, [], options);
};
collection.on('add', function(){ ok(true); }); collection.on('add', function(){ ok(true); });
collection.create(model, {wait: true}); collection.create(model, {wait: true});
}); });
@@ -934,35 +928,6 @@ $(document).ready(function() {
equal(col.length, 1); equal(col.length, 1);
}); });
test("`update` and model level `parse`", function() {
var Model = Backbone.Model.extend({
parse: function (res) { return res.model; }
});
var Collection = Backbone.Collection.extend({
model: Model,
parse: function (res) { return res.models; }
});
var model = new Model({id: 1});
var collection = new Collection(model);
collection.update({models: [
{model: {id: 1}},
{model: {id: 2}}
]}, {parse: true});
equal(collection.first(), model);
});
test("`update` data is only parsed once", function() {
var collection = new Backbone.Collection();
collection.model = Backbone.Model.extend({
parse: function (data) {
equal(data.parsed, void 0);
data.parsed = true;
return data;
}
});
collection.update({}, {parse: true});
});
test("#1894 - Push should not trigger a sort", 0, function() { test("#1894 - Push should not trigger a sort", 0, function() {
var Collection = Backbone.Collection.extend({ var Collection = Backbone.Collection.extend({
comparator: 'id', comparator: 'id',

View File

@@ -99,43 +99,6 @@ $(document).ready(function() {
a.listenTo(b, 'event2', cb); a.listenTo(b, 'event2', cb);
a.stopListening(null, {event: cb}); a.stopListening(null, {event: cb});
b.trigger('event event2'); b.trigger('event event2');
b.off();
a.listenTo(b, 'event event2', cb);
a.stopListening(null, 'event');
a.stopListening();
b.trigger('event2');
});
test("listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenToOnce(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
test("listenTo, listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenTo(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
test("listenTo and stopListening with event maps", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenTo(b, {change: function(){ ok(true); }});
b.trigger('change');
a.listenTo(b, {change: function(){ ok(false); }});
a.stopListening();
b.trigger('change');
}); });
test("listenTo yourself", 1, function(){ test("listenTo yourself", 1, function(){
@@ -296,6 +259,18 @@ $(document).ready(function() {
obj.trigger('x y'); obj.trigger('x y');
}); });
test("off is chainable", 3, function() {
var obj = _.extend({}, Backbone.Events);
// With no events
ok(obj.off() === obj);
// When removing all events
obj.on('event', function(){}, obj);
ok(obj.off() === obj);
// When removing some events
obj.on('event', function(){}, obj);
ok(obj.off('event') === obj);
});
test("#1310 - off does not skip consecutive events", 0, function() { test("#1310 - off does not skip consecutive events", 0, function() {
var obj = _.extend({}, Backbone.Events); var obj = _.extend({}, Backbone.Events);
obj.on('event', function() { ok(false); }, obj); obj.on('event', function() { ok(false); }, obj);
@@ -425,21 +400,4 @@ $(document).ready(function() {
_.extend({}, Backbone.Events).once('event').trigger('event'); _.extend({}, Backbone.Events).once('event').trigger('event');
}); });
test("event functions are chainable", function() {
var obj = _.extend({}, Backbone.Events);
var obj2 = _.extend({}, Backbone.Events);
var fn = function() {};
equal(obj, obj.trigger('noeventssetyet'));
equal(obj, obj.off('noeventssetyet'));
equal(obj, obj.stopListening('noeventssetyet'));
equal(obj, obj.on('a', fn));
equal(obj, obj.once('c', fn));
equal(obj, obj.trigger('a'));
equal(obj, obj.listenTo(obj2, 'a', fn));
equal(obj, obj.listenToOnce(obj2, 'b', fn));
equal(obj, obj.off('a c'));
equal(obj, obj.stopListening(obj2, 'a'));
equal(obj, obj.stopListening());
});
}); });

View File

@@ -401,7 +401,7 @@ $(document).ready(function() {
if (attrs.admin) return "Can't change admin status."; if (attrs.admin) return "Can't change admin status.";
}; };
model.sync = function(method, model, options) { model.sync = function(method, model, options) {
options.success.call(this, {admin: true}); options.success.call(this, this, {admin: true}, options);
}; };
model.on('invalid', function(model, error) { model.on('invalid', function(model, error) {
lastError = error; lastError = error;
@@ -418,19 +418,6 @@ $(document).ready(function() {
ok(_.isEqual(this.syncArgs.model, doc)); ok(_.isEqual(this.syncArgs.model, doc));
}); });
test("save, fetch, destroy triggers error event when an error occurs", 3, function () {
var model = new Backbone.Model();
model.on('error', function () {
ok(true);
});
model.sync = function (method, model, options) {
options.error();
};
model.save({data: 2, id: 1});
model.fetch();
model.destroy();
});
test("save with PATCH", function() { test("save with PATCH", function() {
doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4}); doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4});
doc.save(); doc.save();
@@ -448,7 +435,7 @@ $(document).ready(function() {
test("save in positional style", 1, function() { test("save in positional style", 1, function() {
var model = new Backbone.Model(); var model = new Backbone.Model();
model.sync = function(method, model, options) { model.sync = function(method, model, options) {
options.success(); options.success(model, {}, options);
}; };
model.save('title', 'Twelfth Night'); model.save('title', 'Twelfth Night');
equal(model.get('title'), 'Twelfth Night'); equal(model.get('title'), 'Twelfth Night');
@@ -457,8 +444,8 @@ $(document).ready(function() {
test("save with non-object success response", 2, function () { test("save with non-object success response", 2, function () {
var model = new Backbone.Model(); var model = new Backbone.Model();
model.sync = function(method, model, options) { model.sync = function(method, model, options) {
options.success('', options); options.success(model, '', options);
options.success(null, options); options.success(model, null, options);
}; };
model.save({testing:'empty'}, { model.save({testing:'empty'}, {
success: function (model) { success: function (model) {
@@ -733,7 +720,7 @@ $(document).ready(function() {
test("#1030 - `save` with `wait` results in correct attributes if success is called during sync", 2, function() { test("#1030 - `save` with `wait` results in correct attributes if success is called during sync", 2, function() {
var model = new Backbone.Model({x: 1, y: 2}); var model = new Backbone.Model({x: 1, y: 2});
model.sync = function(method, model, options) { model.sync = function(method, model, options) {
options.success(); options.success(model, {}, options);
}; };
model.on("change:x", function() { ok(true); }); model.on("change:x", function() { ok(true); });
model.save({x: 3}, {wait: true}); model.save({x: 3}, {wait: true});
@@ -906,7 +893,7 @@ $(document).ready(function() {
} }
}; };
model.sync = function(method, model, options) { model.sync = function(method, model, options) {
options.success(); options.success(model, {}, options);
}; };
model.save({id: 1}, opts); model.save({id: 1}, opts);
model.fetch(opts); model.fetch(opts);
@@ -915,8 +902,9 @@ $(document).ready(function() {
test("#1412 - Trigger 'sync' event.", 3, function() { test("#1412 - Trigger 'sync' event.", 3, function() {
var model = new Backbone.Model({id: 1}); var model = new Backbone.Model({id: 1});
model.sync = function (method, model, options) { options.success(); }; model.url = '/test';
model.on('sync', function(){ ok(true); }); model.on('sync', function(){ ok(true); });
Backbone.ajax = function(settings){ settings.success(); };
model.fetch(); model.fetch();
model.save(); model.save();
model.destroy(); model.destroy();
@@ -962,7 +950,7 @@ $(document).ready(function() {
var Model = Backbone.Model.extend({ var Model = Backbone.Model.extend({
sync: function(method, model, options) { sync: function(method, model, options) {
setTimeout(function(){ setTimeout(function(){
options.success(); options.success(model, {}, options);
start(); start();
}, 0); }, 0);
} }