Built motion from commit 1038d87.|0.0.141
[motion.git] / public / bower_components / lodash / dist / lodash.fp.js
1 (function webpackUniversalModuleDefinition(root, factory) {
2         if(typeof exports === 'object' && typeof module === 'object')
3                 module.exports = factory();
4         else if(typeof define === 'function' && define.amd)
5                 define([], factory);
6         else if(typeof exports === 'object')
7                 exports["fp"] = factory();
8         else
9                 root["fp"] = factory();
10 })(this, function() {
11 return /******/ (function(modules) { // webpackBootstrap
12 /******/        // The module cache
13 /******/        var installedModules = {};
14
15 /******/        // The require function
16 /******/        function __webpack_require__(moduleId) {
17
18 /******/                // Check if module is in cache
19 /******/                if(installedModules[moduleId])
20 /******/                        return installedModules[moduleId].exports;
21
22 /******/                // Create a new module (and put it into the cache)
23 /******/                var module = installedModules[moduleId] = {
24 /******/                        exports: {},
25 /******/                        id: moduleId,
26 /******/                        loaded: false
27 /******/                };
28
29 /******/                // Execute the module function
30 /******/                modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32 /******/                // Flag the module as loaded
33 /******/                module.loaded = true;
34
35 /******/                // Return the exports of the module
36 /******/                return module.exports;
37 /******/        }
38
39
40 /******/        // expose the modules object (__webpack_modules__)
41 /******/        __webpack_require__.m = modules;
42
43 /******/        // expose the module cache
44 /******/        __webpack_require__.c = installedModules;
45
46 /******/        // __webpack_public_path__
47 /******/        __webpack_require__.p = "";
48
49 /******/        // Load entry module and return exports
50 /******/        return __webpack_require__(0);
51 /******/ })
52 /************************************************************************/
53 /******/ ([
54 /* 0 */
55 /***/ function(module, exports, __webpack_require__) {
56
57         var baseConvert = __webpack_require__(1);
58
59         /**
60          * Converts `lodash` to an immutable auto-curried iteratee-first data-last version.
61          *
62          * @param {Function} lodash The lodash function.
63          * @param {Object} [options] The options object. See `baseConvert` for more details.
64          * @returns {Function} Returns the converted `lodash`.
65          */
66         function browserConvert(lodash, options) {
67           return baseConvert(lodash, lodash, options);
68         }
69
70         if (typeof _ == 'function') {
71           _ = browserConvert(_.runInContext());
72         }
73         module.exports = browserConvert;
74
75
76 /***/ },
77 /* 1 */
78 /***/ function(module, exports, __webpack_require__) {
79
80         var mapping = __webpack_require__(2),
81             mutateMap = mapping.mutate,
82             placeholder = {};
83
84         /**
85          * The base implementation of `convert` which accepts a `util` object of methods
86          * required to perform conversions.
87          *
88          * @param {Object} util The util object.
89          * @param {string} name The name of the function to wrap.
90          * @param {Function} func The function to wrap.
91          * @param {Object} [options] The options object.
92          * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
93          * @param {boolean} [options.curry=true] Specify currying.
94          * @param {boolean} [options.fixed=true] Specify fixed arity.
95          * @param {boolean} [options.immutable=true] Specify immutable operations.
96          * @param {boolean} [options.rearg=true] Specify rearranging arguments.
97          * @returns {Function|Object} Returns the converted function or object.
98          */
99         function baseConvert(util, name, func, options) {
100           var setPlaceholder,
101               isLib = typeof name == 'function',
102               isObj = name === Object(name);
103
104           if (isObj) {
105             options = func;
106             func = name;
107             name = undefined;
108           }
109           if (func == null) {
110             throw new TypeError;
111           }
112           options || (options = {});
113
114           var config = {
115             'cap': 'cap' in options ? options.cap : true,
116             'curry': 'curry' in options ? options.curry : true,
117             'fixed': 'fixed' in options ? options.fixed : true,
118             'immutable': 'immutable' in options ? options.immutable : true,
119             'rearg': 'rearg' in options ? options.rearg : true
120           };
121
122           var forceRearg = ('rearg' in options) && options.rearg;
123
124           var helpers = isLib ? func : {
125             'ary': util.ary,
126             'clone': util.clone,
127             'curry': util.curry,
128             'forEach': util.forEach,
129             'isArray': util.isArray,
130             'isFunction': util.isFunction,
131             'iteratee': util.iteratee,
132             'keys': util.keys,
133             'rearg': util.rearg,
134             'spread': util.spread,
135             'toPath': util.toPath
136           };
137
138           var ary = helpers.ary,
139               clone = helpers.clone,
140               curry = helpers.curry,
141               each = helpers.forEach,
142               isArray = helpers.isArray,
143               isFunction = helpers.isFunction,
144               keys = helpers.keys,
145               rearg = helpers.rearg,
146               spread = helpers.spread,
147               toPath = helpers.toPath;
148
149           var aryMethodKeys = keys(mapping.aryMethod);
150
151           var baseArity = function(func, n) {
152             return n == 2
153               ? function(a, b) { return func.apply(undefined, arguments); }
154               : function(a) { return func.apply(undefined, arguments); };
155           };
156
157           var baseAry = function(func, n) {
158             return n == 2
159               ? function(a, b) { return func(a, b); }
160               : function(a) { return func(a); };
161           };
162
163           var cloneArray = function(array) {
164             var length = array ? array.length : 0,
165                 result = Array(length);
166
167             while (length--) {
168               result[length] = array[length];
169             }
170             return result;
171           };
172
173           var cloneByPath = function(object, path) {
174             path = toPath(path);
175
176             var index = -1,
177                 length = path.length,
178                 result = clone(Object(object)),
179                 nested = result;
180
181             while (nested != null && ++index < length) {
182               var key = path[index],
183                   value = nested[key];
184
185               if (value != null) {
186                 nested[key] = clone(Object(value));
187               }
188               nested = nested[key];
189             }
190             return result;
191           };
192
193           var createCloner = function(func) {
194             return function(object) {
195               return func({}, object);
196             };
197           };
198
199           var immutWrap = function(func, cloner) {
200             return function() {
201               var length = arguments.length;
202               if (!length) {
203                 return result;
204               }
205               var args = Array(length);
206               while (length--) {
207                 args[length] = arguments[length];
208               }
209               var result = args[0] = cloner.apply(undefined, args);
210               func.apply(undefined, args);
211               return result;
212             };
213           };
214
215           var iterateeAry = function(func, n) {
216             return overArg(func, function(func) {
217               return typeof func == 'function' ? baseAry(func, n) : func;
218             });
219           };
220
221           var iterateeRearg = function(func, indexes) {
222             return overArg(func, function(func) {
223               var n = indexes.length;
224               return baseArity(rearg(baseAry(func, n), indexes), n);
225             });
226           };
227
228           var overArg = function(func, iteratee, retArg) {
229             return function() {
230               var length = arguments.length;
231               if (!length) {
232                 return func();
233               }
234               var args = Array(length);
235               while (length--) {
236                 args[length] = arguments[length];
237               }
238               var index = config.rearg ? 0 : (length - 1);
239               args[index] = iteratee(args[index]);
240               return func.apply(undefined, args);
241             };
242           };
243
244           var wrappers = {
245             'castArray': function(castArray) {
246               return function() {
247                 var value = arguments[0];
248                 return isArray(value)
249                   ? castArray(cloneArray(value))
250                   : castArray.apply(undefined, arguments);
251               };
252             },
253             'iteratee': function(iteratee) {
254               return function() {
255                 var func = arguments[0],
256                     arity = arguments[1],
257                     result = iteratee(func, arity),
258                     length = result.length;
259
260                 if (config.cap && typeof arity == 'number') {
261                   arity = arity > 2 ? (arity - 2) : 1;
262                   return (length && length <= arity) ? result : baseAry(result, arity);
263                 }
264                 return result;
265               };
266             },
267             'mixin': function(mixin) {
268               return function(source) {
269                 var func = this;
270                 if (!isFunction(func)) {
271                   return mixin(func, Object(source));
272                 }
273                 var methods = [],
274                     methodNames = [];
275
276                 each(keys(source), function(key) {
277                   var value = source[key];
278                   if (isFunction(value)) {
279                     methodNames.push(key);
280                     methods.push(func.prototype[key]);
281                   }
282                 });
283
284                 mixin(func, Object(source));
285
286                 each(methodNames, function(methodName, index) {
287                   var method = methods[index];
288                   if (isFunction(method)) {
289                     func.prototype[methodName] = method;
290                   } else {
291                     delete func.prototype[methodName];
292                   }
293                 });
294                 return func;
295               };
296             },
297             'runInContext': function(runInContext) {
298               return function(context) {
299                 return baseConvert(util, runInContext(context), options);
300               };
301             }
302           };
303
304           var wrap = function(name, func) {
305             name = mapping.aliasToReal[name] || name;
306             var wrapper = wrappers[name];
307             if (wrapper) {
308               return wrapper(func);
309             }
310             var wrapped = func;
311             if (config.immutable) {
312               if (mutateMap.array[name]) {
313                 wrapped = immutWrap(func, cloneArray);
314               }
315               else if (mutateMap.object[name]) {
316                 wrapped = immutWrap(func, createCloner(func));
317               }
318               else if (mutateMap.set[name]) {
319                 wrapped = immutWrap(func, cloneByPath);
320               }
321             }
322             var result;
323             each(aryMethodKeys, function(aryKey) {
324               each(mapping.aryMethod[aryKey], function(otherName) {
325                 if (name == otherName) {
326                   var aryN = !isLib && mapping.iterateeAry[name],
327                       reargIndexes = mapping.iterateeRearg[name],
328                       spreadStart = mapping.methodSpread[name];
329
330                   result = wrapped;
331                   if (config.fixed) {
332                     result = spreadStart === undefined
333                       ? ary(result, aryKey)
334                       : spread(result, spreadStart);
335                   }
336                   if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
337                     result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
338                   }
339                   if (config.cap) {
340                     if (reargIndexes) {
341                       result = iterateeRearg(result, reargIndexes);
342                     } else if (aryN) {
343                       result = iterateeAry(result, aryN);
344                     }
345                   }
346                   if (config.curry && aryKey > 1) {
347                     result = curry(result, aryKey);
348                   }
349                   return false;
350                 }
351               });
352               return !result;
353             });
354
355             result || (result = wrapped);
356             if (mapping.placeholder[name]) {
357               setPlaceholder = true;
358               func.placeholder = result.placeholder = placeholder;
359             }
360             return result;
361           };
362
363           if (!isObj) {
364             return wrap(name, func);
365           }
366           var _ = func;
367
368           // Iterate over methods for the current ary cap.
369           var pairs = [];
370           each(aryMethodKeys, function(aryKey) {
371             each(mapping.aryMethod[aryKey], function(key) {
372               var func = _[mapping.remap[key] || key];
373               if (func) {
374                 pairs.push([key, wrap(key, func)]);
375               }
376             });
377           });
378
379           // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
380           each(pairs, function(pair) {
381             _[pair[0]] = pair[1];
382           });
383
384           if (setPlaceholder) {
385             _.placeholder = placeholder;
386           }
387           // Wrap the lodash method and its aliases.
388           each(keys(_), function(key) {
389             each(mapping.realToAlias[key] || [], function(alias) {
390               _[alias] = _[key];
391             });
392           });
393
394           return _;
395         }
396
397         module.exports = baseConvert;
398
399
400 /***/ },
401 /* 2 */
402 /***/ function(module, exports) {
403
404         /** Used to map aliases to their real names. */
405         exports.aliasToReal = {
406           '__': 'placeholder',
407           'all': 'some',
408           'allPass': 'overEvery',
409           'apply': 'spread',
410           'assoc': 'set',
411           'assocPath': 'set',
412           'compose': 'flowRight',
413           'contains': 'includes',
414           'dissoc': 'unset',
415           'dissocPath': 'unset',
416           'each': 'forEach',
417           'eachRight': 'forEachRight',
418           'equals': 'isEqual',
419           'extend': 'assignIn',
420           'extendWith': 'assignInWith',
421           'first': 'head',
422           'init': 'initial',
423           'mapObj': 'mapValues',
424           'omitAll': 'omit',
425           'nAry': 'ary',
426           'path': 'get',
427           'pathEq': 'matchesProperty',
428           'pathOr': 'getOr',
429           'pickAll': 'pick',
430           'pipe': 'flow',
431           'prop': 'get',
432           'propOf': 'propertyOf',
433           'propOr': 'getOr',
434           'somePass': 'overSome',
435           'unapply': 'rest',
436           'unnest': 'flatten',
437           'useWith': 'overArgs',
438           'whereEq': 'filter',
439           'zipObj': 'zipObject'
440         };
441
442         /** Used to map ary to method names. */
443         exports.aryMethod = {
444           '1': [
445             'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
446             'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
447             'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
448             'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
449           ],
450           '2': [
451             'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
452             'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
453             'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
454             'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
455             'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
456             'findLastKey', 'flatMap', 'flattenDepth', 'forEach', 'forEachRight', 'forIn',
457             'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has',
458             'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
459             'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
460             'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
461             'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
462             'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
463             'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
464             'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
465             'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
466             'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
467             'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
468             'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
469             'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
470           ],
471           '3': [
472             'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
473             'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
474             'isMatchWith', 'mergeWith', 'orderBy', 'pullAllBy', 'reduce', 'reduceRight',
475             'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform',
476             'unionBy', 'unionWith', 'xorBy', 'xorWith', 'zipWith'
477           ],
478           '4': [
479             'fill', 'setWith'
480           ]
481         };
482
483         /** Used to map ary to rearg configs. */
484         exports.aryRearg = {
485           '2': [1, 0],
486           '3': [2, 0, 1],
487           '4': [3, 2, 0, 1]
488         };
489
490         /** Used to map method names to their iteratee ary. */
491         exports.iterateeAry = {
492           'assignWith': 2,
493           'assignInWith': 2,
494           'cloneDeepWith': 1,
495           'cloneWith': 1,
496           'dropRightWhile': 1,
497           'dropWhile': 1,
498           'every': 1,
499           'filter': 1,
500           'find': 1,
501           'findIndex': 1,
502           'findKey': 1,
503           'findLast': 1,
504           'findLastIndex': 1,
505           'findLastKey': 1,
506           'flatMap': 1,
507           'forEach': 1,
508           'forEachRight': 1,
509           'forIn': 1,
510           'forInRight': 1,
511           'forOwn': 1,
512           'forOwnRight': 1,
513           'isEqualWith': 2,
514           'isMatchWith': 2,
515           'map': 1,
516           'mapKeys': 1,
517           'mapValues': 1,
518           'partition': 1,
519           'reduce': 2,
520           'reduceRight': 2,
521           'reject': 1,
522           'remove': 1,
523           'some': 1,
524           'takeRightWhile': 1,
525           'takeWhile': 1,
526           'times': 1,
527           'transform': 2
528         };
529
530         /** Used to map method names to iteratee rearg configs. */
531         exports.iterateeRearg = {
532           'mapKeys': [1]
533         };
534
535         /** Used to map method names to rearg configs. */
536         exports.methodRearg = {
537           'assignInWith': [1, 2, 0],
538           'assignWith': [1, 2, 0],
539           'getOr': [2, 1, 0],
540           'isMatchWith': [2, 1, 0],
541           'mergeWith': [1, 2, 0],
542           'pullAllBy': [2, 1, 0],
543           'setWith': [3, 1, 2, 0],
544           'sortedIndexBy': [2, 1, 0],
545           'sortedLastIndexBy': [2, 1, 0],
546           'zipWith': [1, 2, 0]
547         };
548
549         /** Used to map method names to spread configs. */
550         exports.methodSpread = {
551           'partial': 1,
552           'partialRight': 1
553         };
554
555         /** Used to identify methods which mutate arrays or objects. */
556         exports.mutate = {
557           'array': {
558             'fill': true,
559             'pull': true,
560             'pullAll': true,
561             'pullAllBy': true,
562             'pullAt': true,
563             'remove': true,
564             'reverse': true
565           },
566           'object': {
567             'assign': true,
568             'assignIn': true,
569             'assignInWith': true,
570             'assignWith': true,
571             'defaults': true,
572             'defaultsDeep': true,
573             'merge': true,
574             'mergeWith': true
575           },
576           'set': {
577             'set': true,
578             'setWith': true,
579             'unset': true
580           }
581         };
582
583         /** Used to track methods with placeholder support */
584         exports.placeholder = {
585           'bind': true,
586           'bindKey': true,
587           'curry': true,
588           'curryRight': true,
589           'partial': true,
590           'partialRight': true
591         };
592
593         /** Used to map real names to their aliases. */
594         exports.realToAlias = (function() {
595           var hasOwnProperty = Object.prototype.hasOwnProperty,
596               object = exports.aliasToReal,
597               result = {};
598
599           for (var key in object) {
600             var value = object[key];
601             if (hasOwnProperty.call(result, value)) {
602               result[value].push(key);
603             } else {
604               result[value] = [key];
605             }
606           }
607           return result;
608         }());
609
610         /** Used to map method names to other names. */
611         exports.remap = {
612           'curryN': 'curry',
613           'curryRightN': 'curryRight',
614           'getOr': 'get',
615           'trimChars': 'trim',
616           'trimCharsEnd': 'trimEnd',
617           'trimCharsStart': 'trimStart'
618         };
619
620         /** Used to track methods that skip `_.rearg`. */
621         exports.skipRearg = {
622           'add': true,
623           'assign': true,
624           'assignIn': true,
625           'concat': true,
626           'difference': true,
627           'gt': true,
628           'gte': true,
629           'lt': true,
630           'lte': true,
631           'matchesProperty': true,
632           'merge': true,
633           'partial': true,
634           'partialRight': true,
635           'random': true,
636           'range': true,
637           'rangeRight': true,
638           'subtract': true,
639           'zip': true,
640           'zipObject': true
641         };
642
643
644 /***/ }
645 /******/ ])
646 });
647 ;