Interactive interface for browsing global, full-resolution satellite imagery
Add ignore to runtime node modules
Taylor Gunnoeea3b8d5ea2e5
diff --git a/.gitignore b/.gitignoreindex 9cd91ee03..690adeacb 100644--- a/.gitignore+++ b/.gitignore@@ -1,6 +1,6 @@builddist-node_modules+/node_modulespython.project.settingsdiff --git a/web/ext/node_modules/bluebird/js/browser/bluebird.js b/web/ext/node_modules/bluebird/js/browser/bluebird.jsnew file mode 100644index 000000000..dc80cb6a8--- /dev/null+++ b/web/ext/node_modules/bluebird/js/browser/bluebird.js@@ -0,0 +1,5581 @@+/* @preserve+ * The MIT License (MIT)+ *+ * Copyright (c) 2013-2015 Petka Antonov+ *+ * Permission is hereby granted, free of charge, to any person obtaining a copy+ * of this software and associated documentation files (the "Software"), to deal+ * in the Software without restriction, including without limitation the rights+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+ * copies of the Software, and to permit persons to whom the Software is+ * furnished to do so, subject to the following conditions:+ *+ * The above copyright notice and this permission notice shall be included in+ * all copies or substantial portions of the Software.+ *+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+ * THE SOFTWARE.+ *+ */+/**+ * bluebird build version 3.4.7+ * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each+*/+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise) {+var SomePromiseArray = Promise._SomePromiseArray;+function any(promises) {+ var ret = new SomePromiseArray(promises);+ var promise = ret.promise();+ ret.setHowMany(1);+ ret.setUnwrap();+ ret.init();+ return promise;+}++Promise.any = function (promises) {+ return any(promises);+};++Promise.prototype.any = function () {+ return any(this);+};++};++},{}],2:[function(_dereq_,module,exports){+"use strict";+var firstLineError;+try {throw new Error(); } catch (e) {firstLineError = e;}+var schedule = _dereq_("./schedule");+var Queue = _dereq_("./queue");+var util = _dereq_("./util");++function Async() {+ this._customScheduler = false;+ this._isTickUsed = false;+ this._lateQueue = new Queue(16);+ this._normalQueue = new Queue(16);+ this._haveDrainedQueues = false;+ this._trampolineEnabled = true;+ var self = this;+ this.drainQueues = function () {+ self._drainQueues();+ };+ this._schedule = schedule;+}++Async.prototype.setScheduler = function(fn) {+ var prev = this._schedule;+ this._schedule = fn;+ this._customScheduler = true;+ return prev;+};++Async.prototype.hasCustomScheduler = function() {+ return this._customScheduler;+};++Async.prototype.enableTrampoline = function() {+ this._trampolineEnabled = true;+};++Async.prototype.disableTrampolineIfNecessary = function() {+ if (util.hasDevTools) {+ this._trampolineEnabled = false;+ }+};++Async.prototype.haveItemsQueued = function () {+ return this._isTickUsed || this._haveDrainedQueues;+};+++Async.prototype.fatalError = function(e, isNode) {+ if (isNode) {+ process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) ++ "\n");+ process.exit(2);+ } else {+ this.throwLater(e);+ }+};++Async.prototype.throwLater = function(fn, arg) {+ if (arguments.length === 1) {+ arg = fn;+ fn = function () { throw arg; };+ }+ if (typeof setTimeout !== "undefined") {+ setTimeout(function() {+ fn(arg);+ }, 0);+ } else try {+ this._schedule(function() {+ fn(arg);+ });+ } catch (e) {+ throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+};++function AsyncInvokeLater(fn, receiver, arg) {+ this._lateQueue.push(fn, receiver, arg);+ this._queueTick();+}++function AsyncInvoke(fn, receiver, arg) {+ this._normalQueue.push(fn, receiver, arg);+ this._queueTick();+}++function AsyncSettlePromises(promise) {+ this._normalQueue._pushOne(promise);+ this._queueTick();+}++if (!util.hasDevTools) {+ Async.prototype.invokeLater = AsyncInvokeLater;+ Async.prototype.invoke = AsyncInvoke;+ Async.prototype.settlePromises = AsyncSettlePromises;+} else {+ Async.prototype.invokeLater = function (fn, receiver, arg) {+ if (this._trampolineEnabled) {+ AsyncInvokeLater.call(this, fn, receiver, arg);+ } else {+ this._schedule(function() {+ setTimeout(function() {+ fn.call(receiver, arg);+ }, 100);+ });+ }+ };++ Async.prototype.invoke = function (fn, receiver, arg) {+ if (this._trampolineEnabled) {+ AsyncInvoke.call(this, fn, receiver, arg);+ } else {+ this._schedule(function() {+ fn.call(receiver, arg);+ });+ }+ };++ Async.prototype.settlePromises = function(promise) {+ if (this._trampolineEnabled) {+ AsyncSettlePromises.call(this, promise);+ } else {+ this._schedule(function() {+ promise._settlePromises();+ });+ }+ };+}++Async.prototype._drainQueue = function(queue) {+ while (queue.length() > 0) {+ var fn = queue.shift();+ if (typeof fn !== "function") {+ fn._settlePromises();+ continue;+ }+ var receiver = queue.shift();+ var arg = queue.shift();+ fn.call(receiver, arg);+ }+};++Async.prototype._drainQueues = function () {+ this._drainQueue(this._normalQueue);+ this._reset();+ this._haveDrainedQueues = true;+ this._drainQueue(this._lateQueue);+};++Async.prototype._queueTick = function () {+ if (!this._isTickUsed) {+ this._isTickUsed = true;+ this._schedule(this.drainQueues);+ }+};++Async.prototype._reset = function () {+ this._isTickUsed = false;+};++module.exports = Async;+module.exports.firstLineError = firstLineError;++},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {+var calledBind = false;+var rejectThis = function(_, e) {+ this._reject(e);+};++var targetRejected = function(e, context) {+ context.promiseRejectionQueued = true;+ context.bindingPromise._then(rejectThis, rejectThis, null, this, e);+};++var bindingResolved = function(thisArg, context) {+ if (((this._bitField & 50397184) === 0)) {+ this._resolveCallback(context.target);+ }+};++var bindingRejected = function(e, context) {+ if (!context.promiseRejectionQueued) this._reject(e);+};++Promise.prototype.bind = function (thisArg) {+ if (!calledBind) {+ calledBind = true;+ Promise.prototype._propagateFrom = debug.propagateFromFunction();+ Promise.prototype._boundValue = debug.boundValueFunction();+ }+ var maybePromise = tryConvertToPromise(thisArg);+ var ret = new Promise(INTERNAL);+ ret._propagateFrom(this, 1);+ var target = this._target();+ ret._setBoundTo(maybePromise);+ if (maybePromise instanceof Promise) {+ var context = {+ promiseRejectionQueued: false,+ promise: ret,+ target: target,+ bindingPromise: maybePromise+ };+ target._then(INTERNAL, targetRejected, undefined, ret, context);+ maybePromise._then(+ bindingResolved, bindingRejected, undefined, ret, context);+ ret._setOnCancel(maybePromise);+ } else {+ ret._resolveCallback(target);+ }+ return ret;+};++Promise.prototype._setBoundTo = function (obj) {+ if (obj !== undefined) {+ this._bitField = this._bitField | 2097152;+ this._boundTo = obj;+ } else {+ this._bitField = this._bitField & (~2097152);+ }+};++Promise.prototype._isBound = function () {+ return (this._bitField & 2097152) === 2097152;+};++Promise.bind = function (thisArg, value) {+ return Promise.resolve(value).bind(thisArg);+};+};++},{}],4:[function(_dereq_,module,exports){+"use strict";+var old;+if (typeof Promise !== "undefined") old = Promise;+function noConflict() {+ try { if (Promise === bluebird) Promise = old; }+ catch (e) {}+ return bluebird;+}+var bluebird = _dereq_("./promise")();+bluebird.noConflict = noConflict;+module.exports = bluebird;++},{"./promise":22}],5:[function(_dereq_,module,exports){+"use strict";+var cr = Object.create;+if (cr) {+ var callerCache = cr(null);+ var getterCache = cr(null);+ callerCache[" size"] = getterCache[" size"] = 0;+}++module.exports = function(Promise) {+var util = _dereq_("./util");+var canEvaluate = util.canEvaluate;+var isIdentifier = util.isIdentifier;++var getMethodCaller;+var getGetter;+if (!true) {+var makeMethodCaller = function (methodName) {+ return new Function("ensureMethod", " \n\+ return function(obj) { \n\+ 'use strict' \n\+ var len = this.length; \n\+ ensureMethod(obj, 'methodName'); \n\+ switch(len) { \n\+ case 1: return obj.methodName(this[0]); \n\+ case 2: return obj.methodName(this[0], this[1]); \n\+ case 3: return obj.methodName(this[0], this[1], this[2]); \n\+ case 0: return obj.methodName(); \n\+ default: \n\+ return obj.methodName.apply(obj, this); \n\+ } \n\+ }; \n\+ ".replace(/methodName/g, methodName))(ensureMethod);+};++var makeGetter = function (propertyName) {+ return new Function("obj", " \n\+ 'use strict'; \n\+ return obj.propertyName; \n\+ ".replace("propertyName", propertyName));+};++var getCompiled = function(name, compiler, cache) {+ var ret = cache[name];+ if (typeof ret !== "function") {+ if (!isIdentifier(name)) {+ return null;+ }+ ret = compiler(name);+ cache[name] = ret;+ cache[" size"]++;+ if (cache[" size"] > 512) {+ var keys = Object.keys(cache);+ for (var i = 0; i < 256; ++i) delete cache[keys[i]];+ cache[" size"] = keys.length - 256;+ }+ }+ return ret;+};++getMethodCaller = function(name) {+ return getCompiled(name, makeMethodCaller, callerCache);+};++getGetter = function(name) {+ return getCompiled(name, makeGetter, getterCache);+};+}++function ensureMethod(obj, methodName) {+ var fn;+ if (obj != null) fn = obj[methodName];+ if (typeof fn !== "function") {+ var message = "Object " + util.classString(obj) + " has no method '" ++ util.toString(methodName) + "'";+ throw new Promise.TypeError(message);+ }+ return fn;+}++function caller(obj) {+ var methodName = this.pop();+ var fn = ensureMethod(obj, methodName);+ return fn.apply(obj, this);+}+Promise.prototype.call = function (methodName) {+ var args = [].slice.call(arguments, 1);;+ if (!true) {+ if (canEvaluate) {+ var maybeCaller = getMethodCaller(methodName);+ if (maybeCaller !== null) {+ return this._then(+ maybeCaller, undefined, undefined, args, undefined);+ }+ }+ }+ args.push(methodName);+ return this._then(caller, undefined, undefined, args, undefined);+};++function namedGetter(obj) {+ return obj[this];+}+function indexedGetter(obj) {+ var index = +this;+ if (index < 0) index = Math.max(0, index + obj.length);+ return obj[index];+}+Promise.prototype.get = function (propertyName) {+ var isIndex = (typeof propertyName === "number");+ var getter;+ if (!isIndex) {+ if (canEvaluate) {+ var maybeGetter = getGetter(propertyName);+ getter = maybeGetter !== null ? maybeGetter : namedGetter;+ } else {+ getter = namedGetter;+ }+ } else {+ getter = indexedGetter;+ }+ return this._then(getter, undefined, undefined, propertyName, undefined);+};+};++},{"./util":36}],6:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, PromiseArray, apiRejection, debug) {+var util = _dereq_("./util");+var tryCatch = util.tryCatch;+var errorObj = util.errorObj;+var async = Promise._async;++Promise.prototype["break"] = Promise.prototype.cancel = function() {+ if (!debug.cancellation()) return this._warn("cancellation is disabled");++ var promise = this;+ var child = promise;+ while (promise._isCancellable()) {+ if (!promise._cancelBy(child)) {+ if (child._isFollowing()) {+ child._followee().cancel();+ } else {+ child._cancelBranched();+ }+ break;+ }++ var parent = promise._cancellationParent;+ if (parent == null || !parent._isCancellable()) {+ if (promise._isFollowing()) {+ promise._followee().cancel();+ } else {+ promise._cancelBranched();+ }+ break;+ } else {+ if (promise._isFollowing()) promise._followee().cancel();+ promise._setWillBeCancelled();+ child = promise;+ promise = parent;+ }+ }+};++Promise.prototype._branchHasCancelled = function() {+ this._branchesRemainingToCancel--;+};++Promise.prototype._enoughBranchesHaveCancelled = function() {+ return this._branchesRemainingToCancel === undefined ||+ this._branchesRemainingToCancel <= 0;+};++Promise.prototype._cancelBy = function(canceller) {+ if (canceller === this) {+ this._branchesRemainingToCancel = 0;+ this._invokeOnCancel();+ return true;+ } else {+ this._branchHasCancelled();+ if (this._enoughBranchesHaveCancelled()) {+ this._invokeOnCancel();+ return true;+ }+ }+ return false;+};++Promise.prototype._cancelBranched = function() {+ if (this._enoughBranchesHaveCancelled()) {+ this._cancel();+ }+};++Promise.prototype._cancel = function() {+ if (!this._isCancellable()) return;+ this._setCancelled();+ async.invoke(this._cancelPromises, this, undefined);+};++Promise.prototype._cancelPromises = function() {+ if (this._length() > 0) this._settlePromises();+};++Promise.prototype._unsetOnCancel = function() {+ this._onCancelField = undefined;+};++Promise.prototype._isCancellable = function() {+ return this.isPending() && !this._isCancelled();+};++Promise.prototype.isCancellable = function() {+ return this.isPending() && !this.isCancelled();+};++Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {+ if (util.isArray(onCancelCallback)) {+ for (var i = 0; i < onCancelCallback.length; ++i) {+ this._doInvokeOnCancel(onCancelCallback[i], internalOnly);+ }+ } else if (onCancelCallback !== undefined) {+ if (typeof onCancelCallback === "function") {+ if (!internalOnly) {+ var e = tryCatch(onCancelCallback).call(this._boundValue());+ if (e === errorObj) {+ this._attachExtraTrace(e.e);+ async.throwLater(e.e);+ }+ }+ } else {+ onCancelCallback._resultCancelled(this);+ }+ }+};++Promise.prototype._invokeOnCancel = function() {+ var onCancelCallback = this._onCancel();+ this._unsetOnCancel();+ async.invoke(this._doInvokeOnCancel, this, onCancelCallback);+};++Promise.prototype._invokeInternalOnCancel = function() {+ if (this._isCancellable()) {+ this._doInvokeOnCancel(this._onCancel(), true);+ this._unsetOnCancel();+ }+};++Promise.prototype._resultCancelled = function() {+ this.cancel();+};++};++},{"./util":36}],7:[function(_dereq_,module,exports){+"use strict";+module.exports = function(NEXT_FILTER) {+var util = _dereq_("./util");+var getKeys = _dereq_("./es5").keys;+var tryCatch = util.tryCatch;+var errorObj = util.errorObj;++function catchFilter(instances, cb, promise) {+ return function(e) {+ var boundTo = promise._boundValue();+ predicateLoop: for (var i = 0; i < instances.length; ++i) {+ var item = instances[i];++ if (item === Error ||+ (item != null && item.prototype instanceof Error)) {+ if (e instanceof item) {+ return tryCatch(cb).call(boundTo, e);+ }+ } else if (typeof item === "function") {+ var matchesPredicate = tryCatch(item).call(boundTo, e);+ if (matchesPredicate === errorObj) {+ return matchesPredicate;+ } else if (matchesPredicate) {+ return tryCatch(cb).call(boundTo, e);+ }+ } else if (util.isObject(e)) {+ var keys = getKeys(item);+ for (var j = 0; j < keys.length; ++j) {+ var key = keys[j];+ if (item[key] != e[key]) {+ continue predicateLoop;+ }+ }+ return tryCatch(cb).call(boundTo, e);+ }+ }+ return NEXT_FILTER;+ };+}++return catchFilter;+};++},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise) {+var longStackTraces = false;+var contextStack = [];++Promise.prototype._promiseCreated = function() {};+Promise.prototype._pushContext = function() {};+Promise.prototype._popContext = function() {return null;};+Promise._peekContext = Promise.prototype._peekContext = function() {};++function Context() {+ this._trace = new Context.CapturedTrace(peekContext());+}+Context.prototype._pushContext = function () {+ if (this._trace !== undefined) {+ this._trace._promiseCreated = null;+ contextStack.push(this._trace);+ }+};++Context.prototype._popContext = function () {+ if (this._trace !== undefined) {+ var trace = contextStack.pop();+ var ret = trace._promiseCreated;+ trace._promiseCreated = null;+ return ret;+ }+ return null;+};++function createContext() {+ if (longStackTraces) return new Context();+}++function peekContext() {+ var lastIndex = contextStack.length - 1;+ if (lastIndex >= 0) {+ return contextStack[lastIndex];+ }+ return undefined;+}+Context.CapturedTrace = null;+Context.create = createContext;+Context.deactivateLongStackTraces = function() {};+Context.activateLongStackTraces = function() {+ var Promise_pushContext = Promise.prototype._pushContext;+ var Promise_popContext = Promise.prototype._popContext;+ var Promise_PeekContext = Promise._peekContext;+ var Promise_peekContext = Promise.prototype._peekContext;+ var Promise_promiseCreated = Promise.prototype._promiseCreated;+ Context.deactivateLongStackTraces = function() {+ Promise.prototype._pushContext = Promise_pushContext;+ Promise.prototype._popContext = Promise_popContext;+ Promise._peekContext = Promise_PeekContext;+ Promise.prototype._peekContext = Promise_peekContext;+ Promise.prototype._promiseCreated = Promise_promiseCreated;+ longStackTraces = false;+ };+ longStackTraces = true;+ Promise.prototype._pushContext = Context.prototype._pushContext;+ Promise.prototype._popContext = Context.prototype._popContext;+ Promise._peekContext = Promise.prototype._peekContext = peekContext;+ Promise.prototype._promiseCreated = function() {+ var ctx = this._peekContext();+ if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;+ };+};+return Context;+};++},{}],9:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, Context) {+var getDomain = Promise._getDomain;+var async = Promise._async;+var Warning = _dereq_("./errors").Warning;+var util = _dereq_("./util");+var canAttachTrace = util.canAttachTrace;+var unhandledRejectionHandled;+var possiblyUnhandledRejection;+var bluebirdFramePattern =+ /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/;+var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/;+var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/;+var stackFramePattern = null;+var formatStack = null;+var indentStackFrames = false;+var printWarning;+var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 &&+ (true ||+ util.env("BLUEBIRD_DEBUG") ||+ util.env("NODE_ENV") === "development"));++var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 &&+ (debugging || util.env("BLUEBIRD_WARNINGS")));++var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 &&+ (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));++var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 &&+ (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));++Promise.prototype.suppressUnhandledRejections = function() {+ var target = this._target();+ target._bitField = ((target._bitField & (~1048576)) |+ 524288);+};++Promise.prototype._ensurePossibleRejectionHandled = function () {+ if ((this._bitField & 524288) !== 0) return;+ this._setRejectionIsUnhandled();+ async.invokeLater(this._notifyUnhandledRejection, this, undefined);+};++Promise.prototype._notifyUnhandledRejectionIsHandled = function () {+ fireRejectionEvent("rejectionHandled",+ unhandledRejectionHandled, undefined, this);+};++Promise.prototype._setReturnedNonUndefined = function() {+ this._bitField = this._bitField | 268435456;+};++Promise.prototype._returnedNonUndefined = function() {+ return (this._bitField & 268435456) !== 0;+};++Promise.prototype._notifyUnhandledRejection = function () {+ if (this._isRejectionUnhandled()) {+ var reason = this._settledValue();+ this._setUnhandledRejectionIsNotified();+ fireRejectionEvent("unhandledRejection",+ possiblyUnhandledRejection, reason, this);+ }+};++Promise.prototype._setUnhandledRejectionIsNotified = function () {+ this._bitField = this._bitField | 262144;+};++Promise.prototype._unsetUnhandledRejectionIsNotified = function () {+ this._bitField = this._bitField & (~262144);+};++Promise.prototype._isUnhandledRejectionNotified = function () {+ return (this._bitField & 262144) > 0;+};++Promise.prototype._setRejectionIsUnhandled = function () {+ this._bitField = this._bitField | 1048576;+};++Promise.prototype._unsetRejectionIsUnhandled = function () {+ this._bitField = this._bitField & (~1048576);+ if (this._isUnhandledRejectionNotified()) {+ this._unsetUnhandledRejectionIsNotified();+ this._notifyUnhandledRejectionIsHandled();+ }+};++Promise.prototype._isRejectionUnhandled = function () {+ return (this._bitField & 1048576) > 0;+};++Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) {+ return warn(message, shouldUseOwnTrace, promise || this);+};++Promise.onPossiblyUnhandledRejection = function (fn) {+ var domain = getDomain();+ possiblyUnhandledRejection =+ typeof fn === "function" ? (domain === null ?+ fn : util.domainBind(domain, fn))+ : undefined;+};++Promise.onUnhandledRejectionHandled = function (fn) {+ var domain = getDomain();+ unhandledRejectionHandled =+ typeof fn === "function" ? (domain === null ?+ fn : util.domainBind(domain, fn))+ : undefined;+};++var disableLongStackTraces = function() {};+Promise.longStackTraces = function () {+ if (async.haveItemsQueued() && !config.longStackTraces) {+ throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ if (!config.longStackTraces && longStackTracesIsSupported()) {+ var Promise_captureStackTrace = Promise.prototype._captureStackTrace;+ var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;+ config.longStackTraces = true;+ disableLongStackTraces = function() {+ if (async.haveItemsQueued() && !config.longStackTraces) {+ throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ Promise.prototype._captureStackTrace = Promise_captureStackTrace;+ Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;+ Context.deactivateLongStackTraces();+ async.enableTrampoline();+ config.longStackTraces = false;+ };+ Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;+ Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;+ Context.activateLongStackTraces();+ async.disableTrampolineIfNecessary();+ }+};++Promise.hasLongStackTraces = function () {+ return config.longStackTraces && longStackTracesIsSupported();+};++var fireDomEvent = (function() {+ try {+ if (typeof CustomEvent === "function") {+ var event = new CustomEvent("CustomEvent");+ util.global.dispatchEvent(event);+ return function(name, event) {+ var domEvent = new CustomEvent(name.toLowerCase(), {+ detail: event,+ cancelable: true+ });+ return !util.global.dispatchEvent(domEvent);+ };+ } else if (typeof Event === "function") {+ var event = new Event("CustomEvent");+ util.global.dispatchEvent(event);+ return function(name, event) {+ var domEvent = new Event(name.toLowerCase(), {+ cancelable: true+ });+ domEvent.detail = event;+ return !util.global.dispatchEvent(domEvent);+ };+ } else {+ var event = document.createEvent("CustomEvent");+ event.initCustomEvent("testingtheevent", false, true, {});+ util.global.dispatchEvent(event);+ return function(name, event) {+ var domEvent = document.createEvent("CustomEvent");+ domEvent.initCustomEvent(name.toLowerCase(), false, true,+ event);+ return !util.global.dispatchEvent(domEvent);+ };+ }+ } catch (e) {}+ return function() {+ return false;+ };+})();++var fireGlobalEvent = (function() {+ if (util.isNode) {+ return function() {+ return process.emit.apply(process, arguments);+ };+ } else {+ if (!util.global) {+ return function() {+ return false;+ };+ }+ return function(name) {+ var methodName = "on" + name.toLowerCase();+ var method = util.global[methodName];+ if (!method) return false;+ method.apply(util.global, [].slice.call(arguments, 1));+ return true;+ };+ }+})();++function generatePromiseLifecycleEventObject(name, promise) {+ return {promise: promise};+}++var eventToObjectGenerator = {+ promiseCreated: generatePromiseLifecycleEventObject,+ promiseFulfilled: generatePromiseLifecycleEventObject,+ promiseRejected: generatePromiseLifecycleEventObject,+ promiseResolved: generatePromiseLifecycleEventObject,+ promiseCancelled: generatePromiseLifecycleEventObject,+ promiseChained: function(name, promise, child) {+ return {promise: promise, child: child};+ },+ warning: function(name, warning) {+ return {warning: warning};+ },+ unhandledRejection: function (name, reason, promise) {+ return {reason: reason, promise: promise};+ },+ rejectionHandled: generatePromiseLifecycleEventObject+};++var activeFireEvent = function (name) {+ var globalEventFired = false;+ try {+ globalEventFired = fireGlobalEvent.apply(null, arguments);+ } catch (e) {+ async.throwLater(e);+ globalEventFired = true;+ }++ var domEventFired = false;+ try {+ domEventFired = fireDomEvent(name,+ eventToObjectGenerator[name].apply(null, arguments));+ } catch (e) {+ async.throwLater(e);+ domEventFired = true;+ }++ return domEventFired || globalEventFired;+};++Promise.config = function(opts) {+ opts = Object(opts);+ if ("longStackTraces" in opts) {+ if (opts.longStackTraces) {+ Promise.longStackTraces();+ } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {+ disableLongStackTraces();+ }+ }+ if ("warnings" in opts) {+ var warningsOption = opts.warnings;+ config.warnings = !!warningsOption;+ wForgottenReturn = config.warnings;++ if (util.isObject(warningsOption)) {+ if ("wForgottenReturn" in warningsOption) {+ wForgottenReturn = !!warningsOption.wForgottenReturn;+ }+ }+ }+ if ("cancellation" in opts && opts.cancellation && !config.cancellation) {+ if (async.haveItemsQueued()) {+ throw new Error(+ "cannot enable cancellation after promises are in use");+ }+ Promise.prototype._clearCancellationData =+ cancellationClearCancellationData;+ Promise.prototype._propagateFrom = cancellationPropagateFrom;+ Promise.prototype._onCancel = cancellationOnCancel;+ Promise.prototype._setOnCancel = cancellationSetOnCancel;+ Promise.prototype._attachCancellationCallback =+ cancellationAttachCancellationCallback;+ Promise.prototype._execute = cancellationExecute;+ propagateFromFunction = cancellationPropagateFrom;+ config.cancellation = true;+ }+ if ("monitoring" in opts) {+ if (opts.monitoring && !config.monitoring) {+ config.monitoring = true;+ Promise.prototype._fireEvent = activeFireEvent;+ } else if (!opts.monitoring && config.monitoring) {+ config.monitoring = false;+ Promise.prototype._fireEvent = defaultFireEvent;+ }+ }+ return Promise;+};++function defaultFireEvent() { return false; }++Promise.prototype._fireEvent = defaultFireEvent;+Promise.prototype._execute = function(executor, resolve, reject) {+ try {+ executor(resolve, reject);+ } catch (e) {+ return e;+ }+};+Promise.prototype._onCancel = function () {};+Promise.prototype._setOnCancel = function (handler) { ; };+Promise.prototype._attachCancellationCallback = function(onCancel) {+ ;+};+Promise.prototype._captureStackTrace = function () {};+Promise.prototype._attachExtraTrace = function () {};+Promise.prototype._clearCancellationData = function() {};+Promise.prototype._propagateFrom = function (parent, flags) {+ ;+ ;+};++function cancellationExecute(executor, resolve, reject) {+ var promise = this;+ try {+ executor(resolve, reject, function(onCancel) {+ if (typeof onCancel !== "function") {+ throw new TypeError("onCancel must be a function, got: " ++ util.toString(onCancel));+ }+ promise._attachCancellationCallback(onCancel);+ });+ } catch (e) {+ return e;+ }+}++function cancellationAttachCancellationCallback(onCancel) {+ if (!this._isCancellable()) return this;++ var previousOnCancel = this._onCancel();+ if (previousOnCancel !== undefined) {+ if (util.isArray(previousOnCancel)) {+ previousOnCancel.push(onCancel);+ } else {+ this._setOnCancel([previousOnCancel, onCancel]);+ }+ } else {+ this._setOnCancel(onCancel);+ }+}++function cancellationOnCancel() {+ return this._onCancelField;+}++function cancellationSetOnCancel(onCancel) {+ this._onCancelField = onCancel;+}++function cancellationClearCancellationData() {+ this._cancellationParent = undefined;+ this._onCancelField = undefined;+}++function cancellationPropagateFrom(parent, flags) {+ if ((flags & 1) !== 0) {+ this._cancellationParent = parent;+ var branchesRemainingToCancel = parent._branchesRemainingToCancel;+ if (branchesRemainingToCancel === undefined) {+ branchesRemainingToCancel = 0;+ }+ parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;+ }+ if ((flags & 2) !== 0 && parent._isBound()) {+ this._setBoundTo(parent._boundTo);+ }+}++function bindingPropagateFrom(parent, flags) {+ if ((flags & 2) !== 0 && parent._isBound()) {+ this._setBoundTo(parent._boundTo);+ }+}+var propagateFromFunction = bindingPropagateFrom;++function boundValueFunction() {+ var ret = this._boundTo;+ if (ret !== undefined) {+ if (ret instanceof Promise) {+ if (ret.isFulfilled()) {+ return ret.value();+ } else {+ return undefined;+ }+ }+ }+ return ret;+}++function longStackTracesCaptureStackTrace() {+ this._trace = new CapturedTrace(this._peekContext());+}++function longStackTracesAttachExtraTrace(error, ignoreSelf) {+ if (canAttachTrace(error)) {+ var trace = this._trace;+ if (trace !== undefined) {+ if (ignoreSelf) trace = trace._parent;+ }+ if (trace !== undefined) {+ trace.attachExtraTrace(error);+ } else if (!error.__stackCleaned__) {+ var parsed = parseStackAndMessage(error);+ util.notEnumerableProp(error, "stack",+ parsed.message + "\n" + parsed.stack.join("\n"));+ util.notEnumerableProp(error, "__stackCleaned__", true);+ }+ }+}++function checkForgottenReturns(returnValue, promiseCreated, name, promise,+ parent) {+ if (returnValue === undefined && promiseCreated !== null &&+ wForgottenReturn) {+ if (parent !== undefined && parent._returnedNonUndefined()) return;+ if ((promise._bitField & 65535) === 0) return;++ if (name) name = name + " ";+ var handlerLine = "";+ var creatorLine = "";+ if (promiseCreated._trace) {+ var traceLines = promiseCreated._trace.stack.split("\n");+ var stack = cleanStack(traceLines);+ for (var i = stack.length - 1; i >= 0; --i) {+ var line = stack[i];+ if (!nodeFramePattern.test(line)) {+ var lineMatches = line.match(parseLinePattern);+ if (lineMatches) {+ handlerLine = "at " + lineMatches[1] ++ ":" + lineMatches[2] + ":" + lineMatches[3] + " ";+ }+ break;+ }+ }++ if (stack.length > 0) {+ var firstUserLine = stack[0];+ for (var i = 0; i < traceLines.length; ++i) {++ if (traceLines[i] === firstUserLine) {+ if (i > 0) {+ creatorLine = "\n" + traceLines[i - 1];+ }+ break;+ }+ }++ }+ }+ var msg = "a promise was created in a " + name ++ "handler " + handlerLine + "but was not returned from it, " ++ "see http://goo.gl/rRqMUw" ++ creatorLine;+ promise._warn(msg, true, promiseCreated);+ }+}++function deprecated(name, replacement) {+ var message = name ++ " is deprecated and will be removed in a future version.";+ if (replacement) message += " Use " + replacement + " instead.";+ return warn(message);+}++function warn(message, shouldUseOwnTrace, promise) {+ if (!config.warnings) return;+ var warning = new Warning(message);+ var ctx;+ if (shouldUseOwnTrace) {+ promise._attachExtraTrace(warning);+ } else if (config.longStackTraces && (ctx = Promise._peekContext())) {+ ctx.attachExtraTrace(warning);+ } else {+ var parsed = parseStackAndMessage(warning);+ warning.stack = parsed.message + "\n" + parsed.stack.join("\n");+ }++ if (!activeFireEvent("warning", warning)) {+ formatAndLogError(warning, "", true);+ }+}++function reconstructStack(message, stacks) {+ for (var i = 0; i < stacks.length - 1; ++i) {+ stacks[i].push("From previous event:");+ stacks[i] = stacks[i].join("\n");+ }+ if (i < stacks.length) {+ stacks[i] = stacks[i].join("\n");+ }+ return message + "\n" + stacks.join("\n");+}++function removeDuplicateOrEmptyJumps(stacks) {+ for (var i = 0; i < stacks.length; ++i) {+ if (stacks[i].length === 0 ||+ ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {+ stacks.splice(i, 1);+ i--;+ }+ }+}++function removeCommonRoots(stacks) {+ var current = stacks[0];+ for (var i = 1; i < stacks.length; ++i) {+ var prev = stacks[i];+ var currentLastIndex = current.length - 1;+ var currentLastLine = current[currentLastIndex];+ var commonRootMeetPoint = -1;++ for (var j = prev.length - 1; j >= 0; --j) {+ if (prev[j] === currentLastLine) {+ commonRootMeetPoint = j;+ break;+ }+ }++ for (var j = commonRootMeetPoint; j >= 0; --j) {+ var line = prev[j];+ if (current[currentLastIndex] === line) {+ current.pop();+ currentLastIndex--;+ } else {+ break;+ }+ }+ current = prev;+ }+}++function cleanStack(stack) {+ var ret = [];+ for (var i = 0; i < stack.length; ++i) {+ var line = stack[i];+ var isTraceLine = " (No stack trace)" === line ||+ stackFramePattern.test(line);+ var isInternalFrame = isTraceLine && shouldIgnore(line);+ if (isTraceLine && !isInternalFrame) {+ if (indentStackFrames && line.charAt(0) !== " ") {+ line = " " + line;+ }+ ret.push(line);+ }+ }+ return ret;+}++function stackFramesAsArray(error) {+ var stack = error.stack.replace(/\s+$/g, "").split("\n");+ for (var i = 0; i < stack.length; ++i) {+ var line = stack[i];+ if (" (No stack trace)" === line || stackFramePattern.test(line)) {+ break;+ }+ }+ if (i > 0 && error.name != "SyntaxError") {+ stack = stack.slice(i);+ }+ return stack;+}++function parseStackAndMessage(error) {+ var stack = error.stack;+ var message = error.toString();+ stack = typeof stack === "string" && stack.length > 0+ ? stackFramesAsArray(error) : [" (No stack trace)"];+ return {+ message: message,+ stack: error.name == "SyntaxError" ? stack : cleanStack(stack)+ };+}++function formatAndLogError(error, title, isSoft) {+ if (typeof console !== "undefined") {+ var message;+ if (util.isObject(error)) {+ var stack = error.stack;+ message = title + formatStack(stack, error);+ } else {+ message = title + String(error);+ }+ if (typeof printWarning === "function") {+ printWarning(message, isSoft);+ } else if (typeof console.log === "function" ||+ typeof console.log === "object") {+ console.log(message);+ }+ }+}++function fireRejectionEvent(name, localHandler, reason, promise) {+ var localEventFired = false;+ try {+ if (typeof localHandler === "function") {+ localEventFired = true;+ if (name === "rejectionHandled") {+ localHandler(promise);+ } else {+ localHandler(reason, promise);+ }+ }+ } catch (e) {+ async.throwLater(e);+ }++ if (name === "unhandledRejection") {+ if (!activeFireEvent(name, reason, promise) && !localEventFired) {+ formatAndLogError(reason, "Unhandled rejection ");+ }+ } else {+ activeFireEvent(name, promise);+ }+}++function formatNonError(obj) {+ var str;+ if (typeof obj === "function") {+ str = "[function " ++ (obj.name || "anonymous") ++ "]";+ } else {+ str = obj && typeof obj.toString === "function"+ ? obj.toString() : util.toString(obj);+ var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;+ if (ruselessToString.test(str)) {+ try {+ var newStr = JSON.stringify(obj);+ str = newStr;+ }+ catch(e) {++ }+ }+ if (str.length === 0) {+ str = "(empty array)";+ }+ }+ return ("(<" + snip(str) + ">, no stack trace)");+}++function snip(str) {+ var maxChars = 41;+ if (str.length < maxChars) {+ return str;+ }+ return str.substr(0, maxChars - 3) + "...";+}++function longStackTracesIsSupported() {+ return typeof captureStackTrace === "function";+}++var shouldIgnore = function() { return false; };+var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;+function parseLineInfo(line) {+ var matches = line.match(parseLineInfoRegex);+ if (matches) {+ return {+ fileName: matches[1],+ line: parseInt(matches[2], 10)+ };+ }+}++function setBounds(firstLineError, lastLineError) {+ if (!longStackTracesIsSupported()) return;+ var firstStackLines = firstLineError.stack.split("\n");+ var lastStackLines = lastLineError.stack.split("\n");+ var firstIndex = -1;+ var lastIndex = -1;+ var firstFileName;+ var lastFileName;+ for (var i = 0; i < firstStackLines.length; ++i) {+ var result = parseLineInfo(firstStackLines[i]);+ if (result) {+ firstFileName = result.fileName;+ firstIndex = result.line;+ break;+ }+ }+ for (var i = 0; i < lastStackLines.length; ++i) {+ var result = parseLineInfo(lastStackLines[i]);+ if (result) {+ lastFileName = result.fileName;+ lastIndex = result.line;+ break;+ }+ }+ if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||+ firstFileName !== lastFileName || firstIndex >= lastIndex) {+ return;+ }++ shouldIgnore = function(line) {+ if (bluebirdFramePattern.test(line)) return true;+ var info = parseLineInfo(line);+ if (info) {+ if (info.fileName === firstFileName &&+ (firstIndex <= info.line && info.line <= lastIndex)) {+ return true;+ }+ }+ return false;+ };+}++function CapturedTrace(parent) {+ this._parent = parent;+ this._promisesCreated = 0;+ var length = this._length = 1 + (parent === undefined ? 0 : parent._length);+ captureStackTrace(this, CapturedTrace);+ if (length > 32) this.uncycle();+}+util.inherits(CapturedTrace, Error);+Context.CapturedTrace = CapturedTrace;++CapturedTrace.prototype.uncycle = function() {+ var length = this._length;+ if (length < 2) return;+ var nodes = [];+ var stackToIndex = {};++ for (var i = 0, node = this; node !== undefined; ++i) {+ nodes.push(node);+ node = node._parent;+ }+ length = this._length = i;+ for (var i = length - 1; i >= 0; --i) {+ var stack = nodes[i].stack;+ if (stackToIndex[stack] === undefined) {+ stackToIndex[stack] = i;+ }+ }+ for (var i = 0; i < length; ++i) {+ var currentStack = nodes[i].stack;+ var index = stackToIndex[currentStack];+ if (index !== undefined && index !== i) {+ if (index > 0) {+ nodes[index - 1]._parent = undefined;+ nodes[index - 1]._length = 1;+ }+ nodes[i]._parent = undefined;+ nodes[i]._length = 1;+ var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;++ if (index < length - 1) {+ cycleEdgeNode._parent = nodes[index + 1];+ cycleEdgeNode._parent.uncycle();+ cycleEdgeNode._length =+ cycleEdgeNode._parent._length + 1;+ } else {+ cycleEdgeNode._parent = undefined;+ cycleEdgeNode._length = 1;+ }+ var currentChildLength = cycleEdgeNode._length + 1;+ for (var j = i - 2; j >= 0; --j) {+ nodes[j]._length = currentChildLength;+ currentChildLength++;+ }+ return;+ }+ }+};++CapturedTrace.prototype.attachExtraTrace = function(error) {+ if (error.__stackCleaned__) return;+ this.uncycle();+ var parsed = parseStackAndMessage(error);+ var message = parsed.message;+ var stacks = [parsed.stack];++ var trace = this;+ while (trace !== undefined) {+ stacks.push(cleanStack(trace.stack.split("\n")));+ trace = trace._parent;+ }+ removeCommonRoots(stacks);+ removeDuplicateOrEmptyJumps(stacks);+ util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));+ util.notEnumerableProp(error, "__stackCleaned__", true);+};++var captureStackTrace = (function stackDetection() {+ var v8stackFramePattern = /^\s*at\s*/;+ var v8stackFormatter = function(stack, error) {+ if (typeof stack === "string") return stack;++ if (error.name !== undefined &&+ error.message !== undefined) {+ return error.toString();+ }+ return formatNonError(error);+ };++ if (typeof Error.stackTraceLimit === "number" &&+ typeof Error.captureStackTrace === "function") {+ Error.stackTraceLimit += 6;+ stackFramePattern = v8stackFramePattern;+ formatStack = v8stackFormatter;+ var captureStackTrace = Error.captureStackTrace;++ shouldIgnore = function(line) {+ return bluebirdFramePattern.test(line);+ };+ return function(receiver, ignoreUntil) {+ Error.stackTraceLimit += 6;+ captureStackTrace(receiver, ignoreUntil);+ Error.stackTraceLimit -= 6;+ };+ }+ var err = new Error();++ if (typeof err.stack === "string" &&+ err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {+ stackFramePattern = /@/;+ formatStack = v8stackFormatter;+ indentStackFrames = true;+ return function captureStackTrace(o) {+ o.stack = new Error().stack;+ };+ }++ var hasStackAfterThrow;+ try { throw new Error(); }+ catch(e) {+ hasStackAfterThrow = ("stack" in e);+ }+ if (!("stack" in err) && hasStackAfterThrow &&+ typeof Error.stackTraceLimit === "number") {+ stackFramePattern = v8stackFramePattern;+ formatStack = v8stackFormatter;+ return function captureStackTrace(o) {+ Error.stackTraceLimit += 6;+ try { throw new Error(); }+ catch(e) { o.stack = e.stack; }+ Error.stackTraceLimit -= 6;+ };+ }++ formatStack = function(stack, error) {+ if (typeof stack === "string") return stack;++ if ((typeof error === "object" ||+ typeof error === "function") &&+ error.name !== undefined &&+ error.message !== undefined) {+ return error.toString();+ }+ return formatNonError(error);+ };++ return null;++})([]);++if (typeof console !== "undefined" && typeof console.warn !== "undefined") {+ printWarning = function (message) {+ console.warn(message);+ };+ if (util.isNode && process.stderr.isTTY) {+ printWarning = function(message, isSoft) {+ var color = isSoft ? "\u001b[33m" : "\u001b[31m";+ console.warn(color + message + "\u001b[0m\n");+ };+ } else if (!util.isNode && typeof (new Error().stack) === "string") {+ printWarning = function(message, isSoft) {+ console.warn("%c" + message,+ isSoft ? "color: darkorange" : "color: red");+ };+ }+}++var config = {+ warnings: warnings,+ longStackTraces: false,+ cancellation: false,+ monitoring: false+};++if (longStackTraces) Promise.longStackTraces();++return {+ longStackTraces: function() {+ return config.longStackTraces;+ },+ warnings: function() {+ return config.warnings;+ },+ cancellation: function() {+ return config.cancellation;+ },+ monitoring: function() {+ return config.monitoring;+ },+ propagateFromFunction: function() {+ return propagateFromFunction;+ },+ boundValueFunction: function() {+ return boundValueFunction;+ },+ checkForgottenReturns: checkForgottenReturns,+ setBounds: setBounds,+ warn: warn,+ deprecated: deprecated,+ CapturedTrace: CapturedTrace,+ fireDomEvent: fireDomEvent,+ fireGlobalEvent: fireGlobalEvent+};+};++},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise) {+function returner() {+ return this.value;+}+function thrower() {+ throw this.reason;+}++Promise.prototype["return"] =+Promise.prototype.thenReturn = function (value) {+ if (value instanceof Promise) value.suppressUnhandledRejections();+ return this._then(+ returner, undefined, undefined, {value: value}, undefined);+};++Promise.prototype["throw"] =+Promise.prototype.thenThrow = function (reason) {+ return this._then(+ thrower, undefined, undefined, {reason: reason}, undefined);+};++Promise.prototype.catchThrow = function (reason) {+ if (arguments.length <= 1) {+ return this._then(+ undefined, thrower, undefined, {reason: reason}, undefined);+ } else {+ var _reason = arguments[1];+ var handler = function() {throw _reason;};+ return this.caught(reason, handler);+ }+};++Promise.prototype.catchReturn = function (value) {+ if (arguments.length <= 1) {+ if (value instanceof Promise) value.suppressUnhandledRejections();+ return this._then(+ undefined, returner, undefined, {value: value}, undefined);+ } else {+ var _value = arguments[1];+ if (_value instanceof Promise) _value.suppressUnhandledRejections();+ var handler = function() {return _value;};+ return this.caught(value, handler);+ }+};+};++},{}],11:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL) {+var PromiseReduce = Promise.reduce;+var PromiseAll = Promise.all;++function promiseAllThis() {+ return PromiseAll(this);+}++function PromiseMapSeries(promises, fn) {+ return PromiseReduce(promises, fn, INTERNAL, INTERNAL);+}++Promise.prototype.each = function (fn) {+ return PromiseReduce(this, fn, INTERNAL, 0)+ ._then(promiseAllThis, undefined, undefined, this, undefined);+};++Promise.prototype.mapSeries = function (fn) {+ return PromiseReduce(this, fn, INTERNAL, INTERNAL);+};++Promise.each = function (promises, fn) {+ return PromiseReduce(promises, fn, INTERNAL, 0)+ ._then(promiseAllThis, undefined, undefined, promises, undefined);+};++Promise.mapSeries = PromiseMapSeries;+};+++},{}],12:[function(_dereq_,module,exports){+"use strict";+var es5 = _dereq_("./es5");+var Objectfreeze = es5.freeze;+var util = _dereq_("./util");+var inherits = util.inherits;+var notEnumerableProp = util.notEnumerableProp;++function subError(nameProperty, defaultMessage) {+ function SubError(message) {+ if (!(this instanceof SubError)) return new SubError(message);+ notEnumerableProp(this, "message",+ typeof message === "string" ? message : defaultMessage);+ notEnumerableProp(this, "name", nameProperty);+ if (Error.captureStackTrace) {+ Error.captureStackTrace(this, this.constructor);+ } else {+ Error.call(this);+ }+ }+ inherits(SubError, Error);+ return SubError;+}++var _TypeError, _RangeError;+var Warning = subError("Warning", "warning");+var CancellationError = subError("CancellationError", "cancellation error");+var TimeoutError = subError("TimeoutError", "timeout error");+var AggregateError = subError("AggregateError", "aggregate error");+try {+ _TypeError = TypeError;+ _RangeError = RangeError;+} catch(e) {+ _TypeError = subError("TypeError", "type error");+ _RangeError = subError("RangeError", "range error");+}++var methods = ("join pop push shift unshift slice filter forEach some " ++ "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");++for (var i = 0; i < methods.length; ++i) {+ if (typeof Array.prototype[methods[i]] === "function") {+ AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];+ }+}++es5.defineProperty(AggregateError.prototype, "length", {+ value: 0,+ configurable: false,+ writable: true,+ enumerable: true+});+AggregateError.prototype["isOperational"] = true;+var level = 0;+AggregateError.prototype.toString = function() {+ var indent = Array(level * 4 + 1).join(" ");+ var ret = "\n" + indent + "AggregateError of:" + "\n";+ level++;+ indent = Array(level * 4 + 1).join(" ");+ for (var i = 0; i < this.length; ++i) {+ var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";+ var lines = str.split("\n");+ for (var j = 0; j < lines.length; ++j) {+ lines[j] = indent + lines[j];+ }+ str = lines.join("\n");+ ret += str + "\n";+ }+ level--;+ return ret;+};++function OperationalError(message) {+ if (!(this instanceof OperationalError))+ return new OperationalError(message);+ notEnumerableProp(this, "name", "OperationalError");+ notEnumerableProp(this, "message", message);+ this.cause = message;+ this["isOperational"] = true;++ if (message instanceof Error) {+ notEnumerableProp(this, "message", message.message);+ notEnumerableProp(this, "stack", message.stack);+ } else if (Error.captureStackTrace) {+ Error.captureStackTrace(this, this.constructor);+ }++}+inherits(OperationalError, Error);++var errorTypes = Error["__BluebirdErrorTypes__"];+if (!errorTypes) {+ errorTypes = Objectfreeze({+ CancellationError: CancellationError,+ TimeoutError: TimeoutError,+ OperationalError: OperationalError,+ RejectionError: OperationalError,+ AggregateError: AggregateError+ });+ es5.defineProperty(Error, "__BluebirdErrorTypes__", {+ value: errorTypes,+ writable: false,+ enumerable: false,+ configurable: false+ });+}++module.exports = {+ Error: Error,+ TypeError: _TypeError,+ RangeError: _RangeError,+ CancellationError: errorTypes.CancellationError,+ OperationalError: errorTypes.OperationalError,+ TimeoutError: errorTypes.TimeoutError,+ AggregateError: errorTypes.AggregateError,+ Warning: Warning+};++},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){+var isES5 = (function(){+ "use strict";+ return this === undefined;+})();++if (isES5) {+ module.exports = {+ freeze: Object.freeze,+ defineProperty: Object.defineProperty,+ getDescriptor: Object.getOwnPropertyDescriptor,+ keys: Object.keys,+ names: Object.getOwnPropertyNames,+ getPrototypeOf: Object.getPrototypeOf,+ isArray: Array.isArray,+ isES5: isES5,+ propertyIsWritable: function(obj, prop) {+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop);+ return !!(!descriptor || descriptor.writable || descriptor.set);+ }+ };+} else {+ var has = {}.hasOwnProperty;+ var str = {}.toString;+ var proto = {}.constructor.prototype;++ var ObjectKeys = function (o) {+ var ret = [];+ for (var key in o) {+ if (has.call(o, key)) {+ ret.push(key);+ }+ }+ return ret;+ };++ var ObjectGetDescriptor = function(o, key) {+ return {value: o[key]};+ };++ var ObjectDefineProperty = function (o, key, desc) {+ o[key] = desc.value;+ return o;+ };++ var ObjectFreeze = function (obj) {+ return obj;+ };++ var ObjectGetPrototypeOf = function (obj) {+ try {+ return Object(obj).constructor.prototype;+ }+ catch (e) {+ return proto;+ }+ };++ var ArrayIsArray = function (obj) {+ try {+ return str.call(obj) === "[object Array]";+ }+ catch(e) {+ return false;+ }+ };++ module.exports = {+ isArray: ArrayIsArray,+ keys: ObjectKeys,+ names: ObjectKeys,+ defineProperty: ObjectDefineProperty,+ getDescriptor: ObjectGetDescriptor,+ freeze: ObjectFreeze,+ getPrototypeOf: ObjectGetPrototypeOf,+ isES5: isES5,+ propertyIsWritable: function() {+ return true;+ }+ };+}++},{}],14:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL) {+var PromiseMap = Promise.map;++Promise.prototype.filter = function (fn, options) {+ return PromiseMap(this, fn, options, INTERNAL);+};++Promise.filter = function (promises, fn, options) {+ return PromiseMap(promises, fn, options, INTERNAL);+};+};++},{}],15:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, tryConvertToPromise) {+var util = _dereq_("./util");+var CancellationError = Promise.CancellationError;+var errorObj = util.errorObj;++function PassThroughHandlerContext(promise, type, handler) {+ this.promise = promise;+ this.type = type;+ this.handler = handler;+ this.called = false;+ this.cancelPromise = null;+}++PassThroughHandlerContext.prototype.isFinallyHandler = function() {+ return this.type === 0;+};++function FinallyHandlerCancelReaction(finallyHandler) {+ this.finallyHandler = finallyHandler;+}++FinallyHandlerCancelReaction.prototype._resultCancelled = function() {+ checkCancel(this.finallyHandler);+};++function checkCancel(ctx, reason) {+ if (ctx.cancelPromise != null) {+ if (arguments.length > 1) {+ ctx.cancelPromise._reject(reason);+ } else {+ ctx.cancelPromise._cancel();+ }+ ctx.cancelPromise = null;+ return true;+ }+ return false;+}++function succeed() {+ return finallyHandler.call(this, this.promise._target()._settledValue());+}+function fail(reason) {+ if (checkCancel(this, reason)) return;+ errorObj.e = reason;+ return errorObj;+}+function finallyHandler(reasonOrValue) {+ var promise = this.promise;+ var handler = this.handler;++ if (!this.called) {+ this.called = true;+ var ret = this.isFinallyHandler()+ ? handler.call(promise._boundValue())+ : handler.call(promise._boundValue(), reasonOrValue);+ if (ret !== undefined) {+ promise._setReturnedNonUndefined();+ var maybePromise = tryConvertToPromise(ret, promise);+ if (maybePromise instanceof Promise) {+ if (this.cancelPromise != null) {+ if (maybePromise._isCancelled()) {+ var reason =+ new CancellationError("late cancellation observer");+ promise._attachExtraTrace(reason);+ errorObj.e = reason;+ return errorObj;+ } else if (maybePromise.isPending()) {+ maybePromise._attachCancellationCallback(+ new FinallyHandlerCancelReaction(this));+ }+ }+ return maybePromise._then(+ succeed, fail, undefined, this, undefined);+ }+ }+ }++ if (promise.isRejected()) {+ checkCancel(this);+ errorObj.e = reasonOrValue;+ return errorObj;+ } else {+ checkCancel(this);+ return reasonOrValue;+ }+}++Promise.prototype._passThrough = function(handler, type, success, fail) {+ if (typeof handler !== "function") return this.then();+ return this._then(success,+ fail,+ undefined,+ new PassThroughHandlerContext(this, type, handler),+ undefined);+};++Promise.prototype.lastly =+Promise.prototype["finally"] = function (handler) {+ return this._passThrough(handler,+ 0,+ finallyHandler,+ finallyHandler);+};++Promise.prototype.tap = function (handler) {+ return this._passThrough(handler, 1, finallyHandler);+};++return PassThroughHandlerContext;+};++},{"./util":36}],16:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise,+ apiRejection,+ INTERNAL,+ tryConvertToPromise,+ Proxyable,+ debug) {+var errors = _dereq_("./errors");+var TypeError = errors.TypeError;+var util = _dereq_("./util");+var errorObj = util.errorObj;+var tryCatch = util.tryCatch;+var yieldHandlers = [];++function promiseFromYieldHandler(value, yieldHandlers, traceParent) {+ for (var i = 0; i < yieldHandlers.length; ++i) {+ traceParent._pushContext();+ var result = tryCatch(yieldHandlers[i])(value);+ traceParent._popContext();+ if (result === errorObj) {+ traceParent._pushContext();+ var ret = Promise.reject(errorObj.e);+ traceParent._popContext();+ return ret;+ }+ var maybePromise = tryConvertToPromise(result, traceParent);+ if (maybePromise instanceof Promise) return maybePromise;+ }+ return null;+}++function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {+ if (debug.cancellation()) {+ var internal = new Promise(INTERNAL);+ var _finallyPromise = this._finallyPromise = new Promise(INTERNAL);+ this._promise = internal.lastly(function() {+ return _finallyPromise;+ });+ internal._captureStackTrace();+ internal._setOnCancel(this);+ } else {+ var promise = this._promise = new Promise(INTERNAL);+ promise._captureStackTrace();+ }+ this._stack = stack;+ this._generatorFunction = generatorFunction;+ this._receiver = receiver;+ this._generator = undefined;+ this._yieldHandlers = typeof yieldHandler === "function"+ ? [yieldHandler].concat(yieldHandlers)+ : yieldHandlers;+ this._yieldedPromise = null;+ this._cancellationPhase = false;+}+util.inherits(PromiseSpawn, Proxyable);++PromiseSpawn.prototype._isResolved = function() {+ return this._promise === null;+};++PromiseSpawn.prototype._cleanup = function() {+ this._promise = this._generator = null;+ if (debug.cancellation() && this._finallyPromise !== null) {+ this._finallyPromise._fulfill();+ this._finallyPromise = null;+ }+};++PromiseSpawn.prototype._promiseCancelled = function() {+ if (this._isResolved()) return;+ var implementsReturn = typeof this._generator["return"] !== "undefined";++ var result;+ if (!implementsReturn) {+ var reason = new Promise.CancellationError(+ "generator .return() sentinel");+ Promise.coroutine.returnSentinel = reason;+ this._promise._attachExtraTrace(reason);+ this._promise._pushContext();+ result = tryCatch(this._generator["throw"]).call(this._generator,+ reason);+ this._promise._popContext();+ } else {+ this._promise._pushContext();+ result = tryCatch(this._generator["return"]).call(this._generator,+ undefined);+ this._promise._popContext();+ }+ this._cancellationPhase = true;+ this._yieldedPromise = null;+ this._continue(result);+};++PromiseSpawn.prototype._promiseFulfilled = function(value) {+ this._yieldedPromise = null;+ this._promise._pushContext();+ var result = tryCatch(this._generator.next).call(this._generator, value);+ this._promise._popContext();+ this._continue(result);+};++PromiseSpawn.prototype._promiseRejected = function(reason) {+ this._yieldedPromise = null;+ this._promise._attachExtraTrace(reason);+ this._promise._pushContext();+ var result = tryCatch(this._generator["throw"])+ .call(this._generator, reason);+ this._promise._popContext();+ this._continue(result);+};++PromiseSpawn.prototype._resultCancelled = function() {+ if (this._yieldedPromise instanceof Promise) {+ var promise = this._yieldedPromise;+ this._yieldedPromise = null;+ promise.cancel();+ }+};++PromiseSpawn.prototype.promise = function () {+ return this._promise;+};++PromiseSpawn.prototype._run = function () {+ this._generator = this._generatorFunction.call(this._receiver);+ this._receiver =+ this._generatorFunction = undefined;+ this._promiseFulfilled(undefined);+};++PromiseSpawn.prototype._continue = function (result) {+ var promise = this._promise;+ if (result === errorObj) {+ this._cleanup();+ if (this._cancellationPhase) {+ return promise.cancel();+ } else {+ return promise._rejectCallback(result.e, false);+ }+ }++ var value = result.value;+ if (result.done === true) {+ this._cleanup();+ if (this._cancellationPhase) {+ return promise.cancel();+ } else {+ return promise._resolveCallback(value);+ }+ } else {+ var maybePromise = tryConvertToPromise(value, this._promise);+ if (!(maybePromise instanceof Promise)) {+ maybePromise =+ promiseFromYieldHandler(maybePromise,+ this._yieldHandlers,+ this._promise);+ if (maybePromise === null) {+ this._promiseRejected(+ new TypeError(+ "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", value) ++ "From coroutine:\u000a" ++ this._stack.split("\n").slice(1, -7).join("\n")+ )+ );+ return;+ }+ }+ maybePromise = maybePromise._target();+ var bitField = maybePromise._bitField;+ ;+ if (((bitField & 50397184) === 0)) {+ this._yieldedPromise = maybePromise;+ maybePromise._proxy(this, null);+ } else if (((bitField & 33554432) !== 0)) {+ Promise._async.invoke(+ this._promiseFulfilled, this, maybePromise._value()+ );+ } else if (((bitField & 16777216) !== 0)) {+ Promise._async.invoke(+ this._promiseRejected, this, maybePromise._reason()+ );+ } else {+ this._promiseCancelled();+ }+ }+};++Promise.coroutine = function (generatorFunction, options) {+ if (typeof generatorFunction !== "function") {+ throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ var yieldHandler = Object(options).yieldHandler;+ var PromiseSpawn$ = PromiseSpawn;+ var stack = new Error().stack;+ return function () {+ var generator = generatorFunction.apply(this, arguments);+ var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,+ stack);+ var ret = spawn.promise();+ spawn._generator = generator;+ spawn._promiseFulfilled(undefined);+ return ret;+ };+};++Promise.coroutine.addYieldHandler = function(fn) {+ if (typeof fn !== "function") {+ throw new TypeError("expecting a function but got " + util.classString(fn));+ }+ yieldHandlers.push(fn);+};++Promise.spawn = function (generatorFunction) {+ debug.deprecated("Promise.spawn()", "Promise.coroutine()");+ if (typeof generatorFunction !== "function") {+ return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ var spawn = new PromiseSpawn(generatorFunction, this);+ var ret = spawn.promise();+ spawn._run(Promise.spawn);+ return ret;+};+};++},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){+"use strict";+module.exports =+function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async,+ getDomain) {+var util = _dereq_("./util");+var canEvaluate = util.canEvaluate;+var tryCatch = util.tryCatch;+var errorObj = util.errorObj;+var reject;++if (!true) {+if (canEvaluate) {+ var thenCallback = function(i) {+ return new Function("value", "holder", " \n\+ 'use strict'; \n\+ holder.pIndex = value; \n\+ holder.checkFulfillment(this); \n\+ ".replace(/Index/g, i));+ };++ var promiseSetter = function(i) {+ return new Function("promise", "holder", " \n\+ 'use strict'; \n\+ holder.pIndex = promise; \n\+ ".replace(/Index/g, i));+ };++ var generateHolderClass = function(total) {+ var props = new Array(total);+ for (var i = 0; i < props.length; ++i) {+ props[i] = "this.p" + (i+1);+ }+ var assignment = props.join(" = ") + " = null;";+ var cancellationCode= "var promise;\n" + props.map(function(prop) {+ return " \n\+ promise = " + prop + "; \n\+ if (promise instanceof Promise) { \n\+ promise.cancel(); \n\+ } \n\+ ";+ }).join("\n");+ var passedArguments = props.join(", ");+ var name = "Holder$" + total;+++ var code = "return function(tryCatch, errorObj, Promise, async) { \n\+ 'use strict'; \n\+ function [TheName](fn) { \n\+ [TheProperties] \n\+ this.fn = fn; \n\+ this.asyncNeeded = true; \n\+ this.now = 0; \n\+ } \n\+ \n\+ [TheName].prototype._callFunction = function(promise) { \n\+ promise._pushContext(); \n\+ var ret = tryCatch(this.fn)([ThePassedArguments]); \n\+ promise._popContext(); \n\+ if (ret === errorObj) { \n\+ promise._rejectCallback(ret.e, false); \n\+ } else { \n\+ promise._resolveCallback(ret); \n\+ } \n\+ }; \n\+ \n\+ [TheName].prototype.checkFulfillment = function(promise) { \n\+ var now = ++this.now; \n\+ if (now === [TheTotal]) { \n\+ if (this.asyncNeeded) { \n\+ async.invoke(this._callFunction, this, promise); \n\+ } else { \n\+ this._callFunction(promise); \n\+ } \n\+ \n\+ } \n\+ }; \n\+ \n\+ [TheName].prototype._resultCancelled = function() { \n\+ [CancellationCode] \n\+ }; \n\+ \n\+ return [TheName]; \n\+ }(tryCatch, errorObj, Promise, async); \n\+ ";++ code = code.replace(/\[TheName\]/g, name)+ .replace(/\[TheTotal\]/g, total)+ .replace(/\[ThePassedArguments\]/g, passedArguments)+ .replace(/\[TheProperties\]/g, assignment)+ .replace(/\[CancellationCode\]/g, cancellationCode);++ return new Function("tryCatch", "errorObj", "Promise", "async", code)+ (tryCatch, errorObj, Promise, async);+ };++ var holderClasses = [];+ var thenCallbacks = [];+ var promiseSetters = [];++ for (var i = 0; i < 8; ++i) {+ holderClasses.push(generateHolderClass(i + 1));+ thenCallbacks.push(thenCallback(i + 1));+ promiseSetters.push(promiseSetter(i + 1));+ }++ reject = function (reason) {+ this._reject(reason);+ };+}}++Promise.join = function () {+ var last = arguments.length - 1;+ var fn;+ if (last > 0 && typeof arguments[last] === "function") {+ fn = arguments[last];+ if (!true) {+ if (last <= 8 && canEvaluate) {+ var ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ var HolderClass = holderClasses[last - 1];+ var holder = new HolderClass(fn);+ var callbacks = thenCallbacks;++ for (var i = 0; i < last; ++i) {+ var maybePromise = tryConvertToPromise(arguments[i], ret);+ if (maybePromise instanceof Promise) {+ maybePromise = maybePromise._target();+ var bitField = maybePromise._bitField;+ ;+ if (((bitField & 50397184) === 0)) {+ maybePromise._then(callbacks[i], reject,+ undefined, ret, holder);+ promiseSetters[i](maybePromise, holder);+ holder.asyncNeeded = false;+ } else if (((bitField & 33554432) !== 0)) {+ callbacks[i].call(ret,+ maybePromise._value(), holder);+ } else if (((bitField & 16777216) !== 0)) {+ ret._reject(maybePromise._reason());+ } else {+ ret._cancel();+ }+ } else {+ callbacks[i].call(ret, maybePromise, holder);+ }+ }++ if (!ret._isFateSealed()) {+ if (holder.asyncNeeded) {+ var domain = getDomain();+ if (domain !== null) {+ holder.fn = util.domainBind(domain, holder.fn);+ }+ }+ ret._setAsyncGuaranteed();+ ret._setOnCancel(holder);+ }+ return ret;+ }+ }+ }+ var args = [].slice.call(arguments);;+ if (fn) args.pop();+ var ret = new PromiseArray(args).promise();+ return fn !== undefined ? ret.spread(fn) : ret;+};++};++},{"./util":36}],18:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise,+ PromiseArray,+ apiRejection,+ tryConvertToPromise,+ INTERNAL,+ debug) {+var getDomain = Promise._getDomain;+var util = _dereq_("./util");+var tryCatch = util.tryCatch;+var errorObj = util.errorObj;+var async = Promise._async;++function MappingPromiseArray(promises, fn, limit, _filter) {+ this.constructor$(promises);+ this._promise._captureStackTrace();+ var domain = getDomain();+ this._callback = domain === null ? fn : util.domainBind(domain, fn);+ this._preservedValues = _filter === INTERNAL+ ? new Array(this.length())+ : null;+ this._limit = limit;+ this._inFlight = 0;+ this._queue = [];+ async.invoke(this._asyncInit, this, undefined);+}+util.inherits(MappingPromiseArray, PromiseArray);++MappingPromiseArray.prototype._asyncInit = function() {+ this._init$(undefined, -2);+};++MappingPromiseArray.prototype._init = function () {};++MappingPromiseArray.prototype._promiseFulfilled = function (value, index) {+ var values = this._values;+ var length = this.length();+ var preservedValues = this._preservedValues;+ var limit = this._limit;++ if (index < 0) {+ index = (index * -1) - 1;+ values[index] = value;+ if (limit >= 1) {+ this._inFlight--;+ this._drainQueue();+ if (this._isResolved()) return true;+ }+ } else {+ if (limit >= 1 && this._inFlight >= limit) {+ values[index] = value;+ this._queue.push(index);+ return false;+ }+ if (preservedValues !== null) preservedValues[index] = value;++ var promise = this._promise;+ var callback = this._callback;+ var receiver = promise._boundValue();+ promise._pushContext();+ var ret = tryCatch(callback).call(receiver, value, index, length);+ var promiseCreated = promise._popContext();+ debug.checkForgottenReturns(+ ret,+ promiseCreated,+ preservedValues !== null ? "Promise.filter" : "Promise.map",+ promise+ );+ if (ret === errorObj) {+ this._reject(ret.e);+ return true;+ }++ var maybePromise = tryConvertToPromise(ret, this._promise);+ if (maybePromise instanceof Promise) {+ maybePromise = maybePromise._target();+ var bitField = maybePromise._bitField;+ ;+ if (((bitField & 50397184) === 0)) {+ if (limit >= 1) this._inFlight++;+ values[index] = maybePromise;+ maybePromise._proxy(this, (index + 1) * -1);+ return false;+ } else if (((bitField & 33554432) !== 0)) {+ ret = maybePromise._value();+ } else if (((bitField & 16777216) !== 0)) {+ this._reject(maybePromise._reason());+ return true;+ } else {+ this._cancel();+ return true;+ }+ }+ values[index] = ret;+ }+ var totalResolved = ++this._totalResolved;+ if (totalResolved >= length) {+ if (preservedValues !== null) {+ this._filter(values, preservedValues);+ } else {+ this._resolve(values);+ }+ return true;+ }+ return false;+};++MappingPromiseArray.prototype._drainQueue = function () {+ var queue = this._queue;+ var limit = this._limit;+ var values = this._values;+ while (queue.length > 0 && this._inFlight < limit) {+ if (this._isResolved()) return;+ var index = queue.pop();+ this._promiseFulfilled(values[index], index);+ }+};++MappingPromiseArray.prototype._filter = function (booleans, values) {+ var len = values.length;+ var ret = new Array(len);+ var j = 0;+ for (var i = 0; i < len; ++i) {+ if (booleans[i]) ret[j++] = values[i];+ }+ ret.length = j;+ this._resolve(ret);+};++MappingPromiseArray.prototype.preservedValues = function () {+ return this._preservedValues;+};++function map(promises, fn, options, _filter) {+ if (typeof fn !== "function") {+ return apiRejection("expecting a function but got " + util.classString(fn));+ }++ var limit = 0;+ if (options !== undefined) {+ if (typeof options === "object" && options !== null) {+ if (typeof options.concurrency !== "number") {+ return Promise.reject(+ new TypeError("'concurrency' must be a number but it is " ++ util.classString(options.concurrency)));+ }+ limit = options.concurrency;+ } else {+ return Promise.reject(new TypeError(+ "options argument must be an object but it is " ++ util.classString(options)));+ }+ }+ limit = typeof limit === "number" &&+ isFinite(limit) && limit >= 1 ? limit : 0;+ return new MappingPromiseArray(promises, fn, limit, _filter).promise();+}++Promise.prototype.map = function (fn, options) {+ return map(this, fn, options, null);+};++Promise.map = function (promises, fn, options, _filter) {+ return map(promises, fn, options, _filter);+};+++};++},{"./util":36}],19:[function(_dereq_,module,exports){+"use strict";+module.exports =+function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {+var util = _dereq_("./util");+var tryCatch = util.tryCatch;++Promise.method = function (fn) {+ if (typeof fn !== "function") {+ throw new Promise.TypeError("expecting a function but got " + util.classString(fn));+ }+ return function () {+ var ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ ret._pushContext();+ var value = tryCatch(fn).apply(this, arguments);+ var promiseCreated = ret._popContext();+ debug.checkForgottenReturns(+ value, promiseCreated, "Promise.method", ret);+ ret._resolveFromSyncValue(value);+ return ret;+ };+};++Promise.attempt = Promise["try"] = function (fn) {+ if (typeof fn !== "function") {+ return apiRejection("expecting a function but got " + util.classString(fn));+ }+ var ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ ret._pushContext();+ var value;+ if (arguments.length > 1) {+ debug.deprecated("calling Promise.try with more than 1 argument");+ var arg = arguments[1];+ var ctx = arguments[2];+ value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)+ : tryCatch(fn).call(ctx, arg);+ } else {+ value = tryCatch(fn)();+ }+ var promiseCreated = ret._popContext();+ debug.checkForgottenReturns(+ value, promiseCreated, "Promise.try", ret);+ ret._resolveFromSyncValue(value);+ return ret;+};++Promise.prototype._resolveFromSyncValue = function (value) {+ if (value === util.errorObj) {+ this._rejectCallback(value.e, false);+ } else {+ this._resolveCallback(value, true);+ }+};+};++},{"./util":36}],20:[function(_dereq_,module,exports){+"use strict";+var util = _dereq_("./util");+var maybeWrapAsError = util.maybeWrapAsError;+var errors = _dereq_("./errors");+var OperationalError = errors.OperationalError;+var es5 = _dereq_("./es5");++function isUntypedError(obj) {+ return obj instanceof Error &&+ es5.getPrototypeOf(obj) === Error.prototype;+}++var rErrorKey = /^(?:name|message|stack|cause)$/;+function wrapAsOperationalError(obj) {+ var ret;+ if (isUntypedError(obj)) {+ ret = new OperationalError(obj);+ ret.name = obj.name;+ ret.message = obj.message;+ ret.stack = obj.stack;+ var keys = es5.keys(obj);+ for (var i = 0; i < keys.length; ++i) {+ var key = keys[i];+ if (!rErrorKey.test(key)) {+ ret[key] = obj[key];+ }+ }+ return ret;+ }+ util.markAsOriginatingFromRejection(obj);+ return obj;+}++function nodebackForPromise(promise, multiArgs) {+ return function(err, value) {+ if (promise === null) return;+ if (err) {+ var wrapped = wrapAsOperationalError(maybeWrapAsError(err));+ promise._attachExtraTrace(wrapped);+ promise._reject(wrapped);+ } else if (!multiArgs) {+ promise._fulfill(value);+ } else {+ var args = [].slice.call(arguments, 1);;+ promise._fulfill(args);+ }+ promise = null;+ };+}++module.exports = nodebackForPromise;++},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise) {+var util = _dereq_("./util");+var async = Promise._async;+var tryCatch = util.tryCatch;+var errorObj = util.errorObj;++function spreadAdapter(val, nodeback) {+ var promise = this;+ if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);+ var ret =+ tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));+ if (ret === errorObj) {+ async.throwLater(ret.e);+ }+}++function successAdapter(val, nodeback) {+ var promise = this;+ var receiver = promise._boundValue();+ var ret = val === undefined+ ? tryCatch(nodeback).call(receiver, null)+ : tryCatch(nodeback).call(receiver, null, val);+ if (ret === errorObj) {+ async.throwLater(ret.e);+ }+}+function errorAdapter(reason, nodeback) {+ var promise = this;+ if (!reason) {+ var newReason = new Error(reason + "");+ newReason.cause = reason;+ reason = newReason;+ }+ var ret = tryCatch(nodeback).call(promise._boundValue(), reason);+ if (ret === errorObj) {+ async.throwLater(ret.e);+ }+}++Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,+ options) {+ if (typeof nodeback == "function") {+ var adapter = successAdapter;+ if (options !== undefined && Object(options).spread) {+ adapter = spreadAdapter;+ }+ this._then(+ adapter,+ errorAdapter,+ undefined,+ this,+ nodeback+ );+ }+ return this;+};+};++},{"./util":36}],22:[function(_dereq_,module,exports){+"use strict";+module.exports = function() {+var makeSelfResolutionError = function () {+ return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a");+};+var reflectHandler = function() {+ return new Promise.PromiseInspection(this._target());+};+var apiRejection = function(msg) {+ return Promise.reject(new TypeError(msg));+};+function Proxyable() {}+var UNDEFINED_BINDING = {};+var util = _dereq_("./util");++var getDomain;+if (util.isNode) {+ getDomain = function() {+ var ret = process.domain;+ if (ret === undefined) ret = null;+ return ret;+ };+} else {+ getDomain = function() {+ return null;+ };+}+util.notEnumerableProp(Promise, "_getDomain", getDomain);++var es5 = _dereq_("./es5");+var Async = _dereq_("./async");+var async = new Async();+es5.defineProperty(Promise, "_async", {value: async});+var errors = _dereq_("./errors");+var TypeError = Promise.TypeError = errors.TypeError;+Promise.RangeError = errors.RangeError;+var CancellationError = Promise.CancellationError = errors.CancellationError;+Promise.TimeoutError = errors.TimeoutError;+Promise.OperationalError = errors.OperationalError;+Promise.RejectionError = errors.OperationalError;+Promise.AggregateError = errors.AggregateError;+var INTERNAL = function(){};+var APPLY = {};+var NEXT_FILTER = {};+var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL);+var PromiseArray =+ _dereq_("./promise_array")(Promise, INTERNAL,+ tryConvertToPromise, apiRejection, Proxyable);+var Context = _dereq_("./context")(Promise);+ /*jshint unused:false*/+var createContext = Context.create;+var debug = _dereq_("./debuggability")(Promise, Context);+var CapturedTrace = debug.CapturedTrace;+var PassThroughHandlerContext =+ _dereq_("./finally")(Promise, tryConvertToPromise);+var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER);+var nodebackForPromise = _dereq_("./nodeback");+var errorObj = util.errorObj;+var tryCatch = util.tryCatch;+function check(self, executor) {+ if (typeof executor !== "function") {+ throw new TypeError("expecting a function but got " + util.classString(executor));+ }+ if (self.constructor !== Promise) {+ throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+}++function Promise(executor) {+ this._bitField = 0;+ this._fulfillmentHandler0 = undefined;+ this._rejectionHandler0 = undefined;+ this._promise0 = undefined;+ this._receiver0 = undefined;+ if (executor !== INTERNAL) {+ check(this, executor);+ this._resolveFromExecutor(executor);+ }+ this._promiseCreated();+ this._fireEvent("promiseCreated", this);+}++Promise.prototype.toString = function () {+ return "[object Promise]";+};++Promise.prototype.caught = Promise.prototype["catch"] = function (fn) {+ var len = arguments.length;+ if (len > 1) {+ var catchInstances = new Array(len - 1),+ j = 0, i;+ for (i = 0; i < len - 1; ++i) {+ var item = arguments[i];+ if (util.isObject(item)) {+ catchInstances[j++] = item;+ } else {+ return apiRejection("expecting an object but got " ++ "A catch statement predicate " + util.classString(item));+ }+ }+ catchInstances.length = j;+ fn = arguments[i];+ return this.then(undefined, catchFilter(catchInstances, fn, this));+ }+ return this.then(undefined, fn);+};++Promise.prototype.reflect = function () {+ return this._then(reflectHandler,+ reflectHandler, undefined, this, undefined);+};++Promise.prototype.then = function (didFulfill, didReject) {+ if (debug.warnings() && arguments.length > 0 &&+ typeof didFulfill !== "function" &&+ typeof didReject !== "function") {+ var msg = ".then() only accepts functions but was passed: " ++ util.classString(didFulfill);+ if (arguments.length > 1) {+ msg += ", " + util.classString(didReject);+ }+ this._warn(msg);+ }+ return this._then(didFulfill, didReject, undefined, undefined, undefined);+};++Promise.prototype.done = function (didFulfill, didReject) {+ var promise =+ this._then(didFulfill, didReject, undefined, undefined, undefined);+ promise._setIsFinal();+};++Promise.prototype.spread = function (fn) {+ if (typeof fn !== "function") {+ return apiRejection("expecting a function but got " + util.classString(fn));+ }+ return this.all()._then(fn, undefined, undefined, APPLY, undefined);+};++Promise.prototype.toJSON = function () {+ var ret = {+ isFulfilled: false,+ isRejected: false,+ fulfillmentValue: undefined,+ rejectionReason: undefined+ };+ if (this.isFulfilled()) {+ ret.fulfillmentValue = this.value();+ ret.isFulfilled = true;+ } else if (this.isRejected()) {+ ret.rejectionReason = this.reason();+ ret.isRejected = true;+ }+ return ret;+};++Promise.prototype.all = function () {+ if (arguments.length > 0) {+ this._warn(".all() was passed arguments but it does not take any");+ }+ return new PromiseArray(this).promise();+};++Promise.prototype.error = function (fn) {+ return this.caught(util.originatesFromRejection, fn);+};++Promise.getNewLibraryCopy = module.exports;++Promise.is = function (val) {+ return val instanceof Promise;+};++Promise.fromNode = Promise.fromCallback = function(fn) {+ var ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs+ : false;+ var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));+ if (result === errorObj) {+ ret._rejectCallback(result.e, true);+ }+ if (!ret._isFateSealed()) ret._setAsyncGuaranteed();+ return ret;+};++Promise.all = function (promises) {+ return new PromiseArray(promises).promise();+};++Promise.cast = function (obj) {+ var ret = tryConvertToPromise(obj);+ if (!(ret instanceof Promise)) {+ ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ ret._setFulfilled();+ ret._rejectionHandler0 = obj;+ }+ return ret;+};++Promise.resolve = Promise.fulfilled = Promise.cast;++Promise.reject = Promise.rejected = function (reason) {+ var ret = new Promise(INTERNAL);+ ret._captureStackTrace();+ ret._rejectCallback(reason, true);+ return ret;+};++Promise.setScheduler = function(fn) {+ if (typeof fn !== "function") {+ throw new TypeError("expecting a function but got " + util.classString(fn));+ }+ return async.setScheduler(fn);+};++Promise.prototype._then = function (+ didFulfill,+ didReject,+ _, receiver,+ internalData+) {+ var haveInternalData = internalData !== undefined;+ var promise = haveInternalData ? internalData : new Promise(INTERNAL);+ var target = this._target();+ var bitField = target._bitField;++ if (!haveInternalData) {+ promise._propagateFrom(this, 3);+ promise._captureStackTrace();+ if (receiver === undefined &&+ ((this._bitField & 2097152) !== 0)) {+ if (!((bitField & 50397184) === 0)) {+ receiver = this._boundValue();+ } else {+ receiver = target === this ? undefined : this._boundTo;+ }+ }+ this._fireEvent("promiseChained", this, promise);+ }++ var domain = getDomain();+ if (!((bitField & 50397184) === 0)) {+ var handler, value, settler = target._settlePromiseCtx;+ if (((bitField & 33554432) !== 0)) {+ value = target._rejectionHandler0;+ handler = didFulfill;+ } else if (((bitField & 16777216) !== 0)) {+ value = target._fulfillmentHandler0;+ handler = didReject;+ target._unsetRejectionIsUnhandled();+ } else {+ settler = target._settlePromiseLateCancellationObserver;+ value = new CancellationError("late cancellation observer");+ target._attachExtraTrace(value);+ handler = didReject;+ }++ async.invoke(settler, target, {+ handler: domain === null ? handler+ : (typeof handler === "function" &&+ util.domainBind(domain, handler)),+ promise: promise,+ receiver: receiver,+ value: value+ });+ } else {+ target._addCallbacks(didFulfill, didReject, promise, receiver, domain);+ }++ return promise;+};++Promise.prototype._length = function () {+ return this._bitField & 65535;+};++Promise.prototype._isFateSealed = function () {+ return (this._bitField & 117506048) !== 0;+};++Promise.prototype._isFollowing = function () {+ return (this._bitField & 67108864) === 67108864;+};++Promise.prototype._setLength = function (len) {+ this._bitField = (this._bitField & -65536) |+ (len & 65535);+};++Promise.prototype._setFulfilled = function () {+ this._bitField = this._bitField | 33554432;+ this._fireEvent("promiseFulfilled", this);+};++Promise.prototype._setRejected = function () {+ this._bitField = this._bitField | 16777216;+ this._fireEvent("promiseRejected", this);+};++Promise.prototype._setFollowing = function () {+ this._bitField = this._bitField | 67108864;+ this._fireEvent("promiseResolved", this);+};++Promise.prototype._setIsFinal = function () {+ this._bitField = this._bitField | 4194304;+};++Promise.prototype._isFinal = function () {+ return (this._bitField & 4194304) > 0;+};++Promise.prototype._unsetCancelled = function() {+ this._bitField = this._bitField & (~65536);+};++Promise.prototype._setCancelled = function() {+ this._bitField = this._bitField | 65536;+ this._fireEvent("promiseCancelled", this);+};++Promise.prototype._setWillBeCancelled = function() {+ this._bitField = this._bitField | 8388608;+};++Promise.prototype._setAsyncGuaranteed = function() {+ if (async.hasCustomScheduler()) return;+ this._bitField = this._bitField | 134217728;+};++Promise.prototype._receiverAt = function (index) {+ var ret = index === 0 ? this._receiver0 : this[+ index * 4 - 4 + 3];+ if (ret === UNDEFINED_BINDING) {+ return undefined;+ } else if (ret === undefined && this._isBound()) {+ return this._boundValue();+ }+ return ret;+};++Promise.prototype._promiseAt = function (index) {+ return this[+ index * 4 - 4 + 2];+};++Promise.prototype._fulfillmentHandlerAt = function (index) {+ return this[+ index * 4 - 4 + 0];+};++Promise.prototype._rejectionHandlerAt = function (index) {+ return this[+ index * 4 - 4 + 1];+};++Promise.prototype._boundValue = function() {};++Promise.prototype._migrateCallback0 = function (follower) {+ var bitField = follower._bitField;+ var fulfill = follower._fulfillmentHandler0;+ var reject = follower._rejectionHandler0;+ var promise = follower._promise0;+ var receiver = follower._receiverAt(0);+ if (receiver === undefined) receiver = UNDEFINED_BINDING;+ this._addCallbacks(fulfill, reject, promise, receiver, null);+};++Promise.prototype._migrateCallbackAt = function (follower, index) {+ var fulfill = follower._fulfillmentHandlerAt(index);+ var reject = follower._rejectionHandlerAt(index);+ var promise = follower._promiseAt(index);+ var receiver = follower._receiverAt(index);+ if (receiver === undefined) receiver = UNDEFINED_BINDING;+ this._addCallbacks(fulfill, reject, promise, receiver, null);+};++Promise.prototype._addCallbacks = function (+ fulfill,+ reject,+ promise,+ receiver,+ domain+) {+ var index = this._length();++ if (index >= 65535 - 4) {+ index = 0;+ this._setLength(0);+ }++ if (index === 0) {+ this._promise0 = promise;+ this._receiver0 = receiver;+ if (typeof fulfill === "function") {+ this._fulfillmentHandler0 =+ domain === null ? fulfill : util.domainBind(domain, fulfill);+ }+ if (typeof reject === "function") {+ this._rejectionHandler0 =+ domain === null ? reject : util.domainBind(domain, reject);+ }+ } else {+ var base = index * 4 - 4;+ this[base + 2] = promise;+ this[base + 3] = receiver;+ if (typeof fulfill === "function") {+ this[base + 0] =+ domain === null ? fulfill : util.domainBind(domain, fulfill);+ }+ if (typeof reject === "function") {+ this[base + 1] =+ domain === null ? reject : util.domainBind(domain, reject);+ }+ }+ this._setLength(index + 1);+ return index;+};++Promise.prototype._proxy = function (proxyable, arg) {+ this._addCallbacks(undefined, undefined, arg, proxyable, null);+};++Promise.prototype._resolveCallback = function(value, shouldBind) {+ if (((this._bitField & 117506048) !== 0)) return;+ if (value === this)+ return this._rejectCallback(makeSelfResolutionError(), false);+ var maybePromise = tryConvertToPromise(value, this);+ if (!(maybePromise instanceof Promise)) return this._fulfill(value);++ if (shouldBind) this._propagateFrom(maybePromise, 2);++ var promise = maybePromise._target();++ if (promise === this) {+ this._reject(makeSelfResolutionError());+ return;+ }++ var bitField = promise._bitField;+ if (((bitField & 50397184) === 0)) {+ var len = this._length();+ if (len > 0) promise._migrateCallback0(this);+ for (var i = 1; i < len; ++i) {+ promise._migrateCallbackAt(this, i);+ }+ this._setFollowing();+ this._setLength(0);+ this._setFollowee(promise);+ } else if (((bitField & 33554432) !== 0)) {+ this._fulfill(promise._value());+ } else if (((bitField & 16777216) !== 0)) {+ this._reject(promise._reason());+ } else {+ var reason = new CancellationError("late cancellation observer");+ promise._attachExtraTrace(reason);+ this._reject(reason);+ }+};++Promise.prototype._rejectCallback =+function(reason, synchronous, ignoreNonErrorWarnings) {+ var trace = util.ensureErrorObject(reason);+ var hasStack = trace === reason;+ if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {+ var message = "a promise was rejected with a non-error: " ++ util.classString(reason);+ this._warn(message, true);+ }+ this._attachExtraTrace(trace, synchronous ? hasStack : false);+ this._reject(reason);+};++Promise.prototype._resolveFromExecutor = function (executor) {+ var promise = this;+ this._captureStackTrace();+ this._pushContext();+ var synchronous = true;+ var r = this._execute(executor, function(value) {+ promise._resolveCallback(value);+ }, function (reason) {+ promise._rejectCallback(reason, synchronous);+ });+ synchronous = false;+ this._popContext();++ if (r !== undefined) {+ promise._rejectCallback(r, true);+ }+};++Promise.prototype._settlePromiseFromHandler = function (+ handler, receiver, value, promise+) {+ var bitField = promise._bitField;+ if (((bitField & 65536) !== 0)) return;+ promise._pushContext();+ var x;+ if (receiver === APPLY) {+ if (!value || typeof value.length !== "number") {+ x = errorObj;+ x.e = new TypeError("cannot .spread() a non-array: " ++ util.classString(value));+ } else {+ x = tryCatch(handler).apply(this._boundValue(), value);+ }+ } else {+ x = tryCatch(handler).call(receiver, value);+ }+ var promiseCreated = promise._popContext();+ bitField = promise._bitField;+ if (((bitField & 65536) !== 0)) return;++ if (x === NEXT_FILTER) {+ promise._reject(value);+ } else if (x === errorObj) {+ promise._rejectCallback(x.e, false);+ } else {+ debug.checkForgottenReturns(x, promiseCreated, "", promise, this);+ promise._resolveCallback(x);+ }+};++Promise.prototype._target = function() {+ var ret = this;+ while (ret._isFollowing()) ret = ret._followee();+ return ret;+};++Promise.prototype._followee = function() {+ return this._rejectionHandler0;+};++Promise.prototype._setFollowee = function(promise) {+ this._rejectionHandler0 = promise;+};++Promise.prototype._settlePromise = function(promise, handler, receiver, value) {+ var isPromise = promise instanceof Promise;+ var bitField = this._bitField;+ var asyncGuaranteed = ((bitField & 134217728) !== 0);+ if (((bitField & 65536) !== 0)) {+ if (isPromise) promise._invokeInternalOnCancel();++ if (receiver instanceof PassThroughHandlerContext &&+ receiver.isFinallyHandler()) {+ receiver.cancelPromise = promise;+ if (tryCatch(handler).call(receiver, value) === errorObj) {+ promise._reject(errorObj.e);+ }+ } else if (handler === reflectHandler) {+ promise._fulfill(reflectHandler.call(receiver));+ } else if (receiver instanceof Proxyable) {+ receiver._promiseCancelled(promise);+ } else if (isPromise || promise instanceof PromiseArray) {+ promise._cancel();+ } else {+ receiver.cancel();+ }+ } else if (typeof handler === "function") {+ if (!isPromise) {+ handler.call(receiver, value, promise);+ } else {+ if (asyncGuaranteed) promise._setAsyncGuaranteed();+ this._settlePromiseFromHandler(handler, receiver, value, promise);+ }+ } else if (receiver instanceof Proxyable) {+ if (!receiver._isResolved()) {+ if (((bitField & 33554432) !== 0)) {+ receiver._promiseFulfilled(value, promise);+ } else {+ receiver._promiseRejected(value, promise);+ }+ }+ } else if (isPromise) {+ if (asyncGuaranteed) promise._setAsyncGuaranteed();+ if (((bitField & 33554432) !== 0)) {+ promise._fulfill(value);+ } else {+ promise._reject(value);+ }+ }+};++Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) {+ var handler = ctx.handler;+ var promise = ctx.promise;+ var receiver = ctx.receiver;+ var value = ctx.value;+ if (typeof handler === "function") {+ if (!(promise instanceof Promise)) {+ handler.call(receiver, value, promise);+ } else {+ this._settlePromiseFromHandler(handler, receiver, value, promise);+ }+ } else if (promise instanceof Promise) {+ promise._reject(value);+ }+};++Promise.prototype._settlePromiseCtx = function(ctx) {+ this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);+};++Promise.prototype._settlePromise0 = function(handler, value, bitField) {+ var promise = this._promise0;+ var receiver = this._receiverAt(0);+ this._promise0 = undefined;+ this._receiver0 = undefined;+ this._settlePromise(promise, handler, receiver, value);+};++Promise.prototype._clearCallbackDataAtIndex = function(index) {+ var base = index * 4 - 4;+ this[base + 2] =+ this[base + 3] =+ this[base + 0] =+ this[base + 1] = undefined;+};++Promise.prototype._fulfill = function (value) {+ var bitField = this._bitField;+ if (((bitField & 117506048) >>> 16)) return;+ if (value === this) {+ var err = makeSelfResolutionError();+ this._attachExtraTrace(err);+ return this._reject(err);+ }+ this._setFulfilled();+ this._rejectionHandler0 = value;++ if ((bitField & 65535) > 0) {+ if (((bitField & 134217728) !== 0)) {+ this._settlePromises();+ } else {+ async.settlePromises(this);+ }+ }+};++Promise.prototype._reject = function (reason) {+ var bitField = this._bitField;+ if (((bitField & 117506048) >>> 16)) return;+ this._setRejected();+ this._fulfillmentHandler0 = reason;++ if (this._isFinal()) {+ return async.fatalError(reason, util.isNode);+ }++ if ((bitField & 65535) > 0) {+ async.settlePromises(this);+ } else {+ this._ensurePossibleRejectionHandled();+ }+};++Promise.prototype._fulfillPromises = function (len, value) {+ for (var i = 1; i < len; i++) {+ var handler = this._fulfillmentHandlerAt(i);+ var promise = this._promiseAt(i);+ var receiver = this._receiverAt(i);+ this._clearCallbackDataAtIndex(i);+ this._settlePromise(promise, handler, receiver, value);+ }+};++Promise.prototype._rejectPromises = function (len, reason) {+ for (var i = 1; i < len; i++) {+ var handler = this._rejectionHandlerAt(i);+ var promise = this._promiseAt(i);+ var receiver = this._receiverAt(i);+ this._clearCallbackDataAtIndex(i);+ this._settlePromise(promise, handler, receiver, reason);+ }+};++Promise.prototype._settlePromises = function () {+ var bitField = this._bitField;+ var len = (bitField & 65535);++ if (len > 0) {+ if (((bitField & 16842752) !== 0)) {+ var reason = this._fulfillmentHandler0;+ this._settlePromise0(this._rejectionHandler0, reason, bitField);+ this._rejectPromises(len, reason);+ } else {+ var value = this._rejectionHandler0;+ this._settlePromise0(this._fulfillmentHandler0, value, bitField);+ this._fulfillPromises(len, value);+ }+ this._setLength(0);+ }+ this._clearCancellationData();+};++Promise.prototype._settledValue = function() {+ var bitField = this._bitField;+ if (((bitField & 33554432) !== 0)) {+ return this._rejectionHandler0;+ } else if (((bitField & 16777216) !== 0)) {+ return this._fulfillmentHandler0;+ }+};++function deferResolve(v) {this.promise._resolveCallback(v);}+function deferReject(v) {this.promise._rejectCallback(v, false);}++Promise.defer = Promise.pending = function() {+ debug.deprecated("Promise.defer", "new Promise");+ var promise = new Promise(INTERNAL);+ return {+ promise: promise,+ resolve: deferResolve,+ reject: deferReject+ };+};++util.notEnumerableProp(Promise,+ "_makeSelfResolutionError",+ makeSelfResolutionError);++_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection,+ debug);+_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug);+_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug);+_dereq_("./direct_resolve")(Promise);+_dereq_("./synchronous_inspection")(Promise);+_dereq_("./join")(+ Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain);+Promise.Promise = Promise;+Promise.version = "3.4.7";+_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);+_dereq_('./call_get.js')(Promise);+_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);+_dereq_('./timers.js')(Promise, INTERNAL, debug);+_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);+_dereq_('./nodeify.js')(Promise);+_dereq_('./promisify.js')(Promise, INTERNAL);+_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);+_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);+_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);+_dereq_('./settle.js')(Promise, PromiseArray, debug);+_dereq_('./some.js')(Promise, PromiseArray, apiRejection);+_dereq_('./filter.js')(Promise, INTERNAL);+_dereq_('./each.js')(Promise, INTERNAL);+_dereq_('./any.js')(Promise);++ util.toFastProperties(Promise);+ util.toFastProperties(Promise.prototype);+ function fillTypes(value) {+ var p = new Promise(INTERNAL);+ p._fulfillmentHandler0 = value;+ p._rejectionHandler0 = value;+ p._promise0 = value;+ p._receiver0 = value;+ }+ // Complete slack tracking, opt out of field-type tracking and+ // stabilize map+ fillTypes({a: 1});+ fillTypes({b: 2});+ fillTypes({c: 3});+ fillTypes(1);+ fillTypes(function(){});+ fillTypes(undefined);+ fillTypes(false);+ fillTypes(new Promise(INTERNAL));+ debug.setBounds(Async.firstLineError, util.lastLineError);+ return Promise;++};++},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL, tryConvertToPromise,+ apiRejection, Proxyable) {+var util = _dereq_("./util");+var isArray = util.isArray;++function toResolutionValue(val) {+ switch(val) {+ case -2: return [];+ case -3: return {};+ }+}++function PromiseArray(values) {+ var promise = this._promise = new Promise(INTERNAL);+ if (values instanceof Promise) {+ promise._propagateFrom(values, 3);+ }+ promise._setOnCancel(this);+ this._values = values;+ this._length = 0;+ this._totalResolved = 0;+ this._init(undefined, -2);+}+util.inherits(PromiseArray, Proxyable);++PromiseArray.prototype.length = function () {+ return this._length;+};++PromiseArray.prototype.promise = function () {+ return this._promise;+};++PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {+ var values = tryConvertToPromise(this._values, this._promise);+ if (values instanceof Promise) {+ values = values._target();+ var bitField = values._bitField;+ ;+ this._values = values;++ if (((bitField & 50397184) === 0)) {+ this._promise._setAsyncGuaranteed();+ return values._then(+ init,+ this._reject,+ undefined,+ this,+ resolveValueIfEmpty+ );+ } else if (((bitField & 33554432) !== 0)) {+ values = values._value();+ } else if (((bitField & 16777216) !== 0)) {+ return this._reject(values._reason());+ } else {+ return this._cancel();+ }+ }+ values = util.asArray(values);+ if (values === null) {+ var err = apiRejection(+ "expecting an array or an iterable object but got " + util.classString(values)).reason();+ this._promise._rejectCallback(err, false);+ return;+ }++ if (values.length === 0) {+ if (resolveValueIfEmpty === -5) {+ this._resolveEmptyArray();+ }+ else {+ this._resolve(toResolutionValue(resolveValueIfEmpty));+ }+ return;+ }+ this._iterate(values);+};++PromiseArray.prototype._iterate = function(values) {+ var len = this.getActualLength(values.length);+ this._length = len;+ this._values = this.shouldCopyValues() ? new Array(len) : this._values;+ var result = this._promise;+ var isResolved = false;+ var bitField = null;+ for (var i = 0; i < len; ++i) {+ var maybePromise = tryConvertToPromise(values[i], result);++ if (maybePromise instanceof Promise) {+ maybePromise = maybePromise._target();+ bitField = maybePromise._bitField;+ } else {+ bitField = null;+ }++ if (isResolved) {+ if (bitField !== null) {+ maybePromise.suppressUnhandledRejections();+ }+ } else if (bitField !== null) {+ if (((bitField & 50397184) === 0)) {+ maybePromise._proxy(this, i);+ this._values[i] = maybePromise;+ } else if (((bitField & 33554432) !== 0)) {+ isResolved = this._promiseFulfilled(maybePromise._value(), i);+ } else if (((bitField & 16777216) !== 0)) {+ isResolved = this._promiseRejected(maybePromise._reason(), i);+ } else {+ isResolved = this._promiseCancelled(i);+ }+ } else {+ isResolved = this._promiseFulfilled(maybePromise, i);+ }+ }+ if (!isResolved) result._setAsyncGuaranteed();+};++PromiseArray.prototype._isResolved = function () {+ return this._values === null;+};++PromiseArray.prototype._resolve = function (value) {+ this._values = null;+ this._promise._fulfill(value);+};++PromiseArray.prototype._cancel = function() {+ if (this._isResolved() || !this._promise._isCancellable()) return;+ this._values = null;+ this._promise._cancel();+};++PromiseArray.prototype._reject = function (reason) {+ this._values = null;+ this._promise._rejectCallback(reason, false);+};++PromiseArray.prototype._promiseFulfilled = function (value, index) {+ this._values[index] = value;+ var totalResolved = ++this._totalResolved;+ if (totalResolved >= this._length) {+ this._resolve(this._values);+ return true;+ }+ return false;+};++PromiseArray.prototype._promiseCancelled = function() {+ this._cancel();+ return true;+};++PromiseArray.prototype._promiseRejected = function (reason) {+ this._totalResolved++;+ this._reject(reason);+ return true;+};++PromiseArray.prototype._resultCancelled = function() {+ if (this._isResolved()) return;+ var values = this._values;+ this._cancel();+ if (values instanceof Promise) {+ values.cancel();+ } else {+ for (var i = 0; i < values.length; ++i) {+ if (values[i] instanceof Promise) {+ values[i].cancel();+ }+ }+ }+};++PromiseArray.prototype.shouldCopyValues = function () {+ return true;+};++PromiseArray.prototype.getActualLength = function (len) {+ return len;+};++return PromiseArray;+};++},{"./util":36}],24:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL) {+var THIS = {};+var util = _dereq_("./util");+var nodebackForPromise = _dereq_("./nodeback");+var withAppended = util.withAppended;+var maybeWrapAsError = util.maybeWrapAsError;+var canEvaluate = util.canEvaluate;+var TypeError = _dereq_("./errors").TypeError;+var defaultSuffix = "Async";+var defaultPromisified = {__isPromisified__: true};+var noCopyProps = [+ "arity", "length",+ "name",+ "arguments",+ "caller",+ "callee",+ "prototype",+ "__isPromisified__"+];+var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");++var defaultFilter = function(name) {+ return util.isIdentifier(name) &&+ name.charAt(0) !== "_" &&+ name !== "constructor";+};++function propsFilter(key) {+ return !noCopyPropsPattern.test(key);+}++function isPromisified(fn) {+ try {+ return fn.__isPromisified__ === true;+ }+ catch (e) {+ return false;+ }+}++function hasPromisified(obj, key, suffix) {+ var val = util.getDataPropertyOrDefault(obj, key + suffix,+ defaultPromisified);+ return val ? isPromisified(val) : false;+}+function checkValid(ret, suffix, suffixRegexp) {+ for (var i = 0; i < ret.length; i += 2) {+ var key = ret[i];+ if (suffixRegexp.test(key)) {+ var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");+ for (var j = 0; j < ret.length; j += 2) {+ if (ret[j] === keyWithoutAsyncSuffix) {+ throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a"+ .replace("%s", suffix));+ }+ }+ }+ }+}++function promisifiableMethods(obj, suffix, suffixRegexp, filter) {+ var keys = util.inheritedDataKeys(obj);+ var ret = [];+ for (var i = 0; i < keys.length; ++i) {+ var key = keys[i];+ var value = obj[key];+ var passesDefaultFilter = filter === defaultFilter+ ? true : defaultFilter(key, value, obj);+ if (typeof value === "function" &&+ !isPromisified(value) &&+ !hasPromisified(obj, key, suffix) &&+ filter(key, value, obj, passesDefaultFilter)) {+ ret.push(key, value);+ }+ }+ checkValid(ret, suffix, suffixRegexp);+ return ret;+}++var escapeIdentRegex = function(str) {+ return str.replace(/([$])/, "\\$");+};++var makeNodePromisifiedEval;+if (!true) {+var switchCaseArgumentOrder = function(likelyArgumentCount) {+ var ret = [likelyArgumentCount];+ var min = Math.max(0, likelyArgumentCount - 1 - 3);+ for(var i = likelyArgumentCount - 1; i >= min; --i) {+ ret.push(i);+ }+ for(var i = likelyArgumentCount + 1; i <= 3; ++i) {+ ret.push(i);+ }+ return ret;+};++var argumentSequence = function(argumentCount) {+ return util.filledRange(argumentCount, "_arg", "");+};++var parameterDeclaration = function(parameterCount) {+ return util.filledRange(+ Math.max(parameterCount, 3), "_arg", "");+};++var parameterCount = function(fn) {+ if (typeof fn.length === "number") {+ return Math.max(Math.min(fn.length, 1023 + 1), 0);+ }+ return 0;+};++makeNodePromisifiedEval =+function(callback, receiver, originalName, fn, _, multiArgs) {+ var newParameterCount = Math.max(0, parameterCount(fn) - 1);+ var argumentOrder = switchCaseArgumentOrder(newParameterCount);+ var shouldProxyThis = typeof callback === "string" || receiver === THIS;++ function generateCallForArgumentCount(count) {+ var args = argumentSequence(count).join(", ");+ var comma = count > 0 ? ", " : "";+ var ret;+ if (shouldProxyThis) {+ ret = "ret = callback.call(this, {{args}}, nodeback); break;\n";+ } else {+ ret = receiver === undefined+ ? "ret = callback({{args}}, nodeback); break;\n"+ : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";+ }+ return ret.replace("{{args}}", args).replace(", ", comma);+ }++ function generateArgumentSwitchCase() {+ var ret = "";+ for (var i = 0; i < argumentOrder.length; ++i) {+ ret += "case " + argumentOrder[i] +":" ++ generateCallForArgumentCount(argumentOrder[i]);+ }++ ret += " \n\+ default: \n\+ var args = new Array(len + 1); \n\+ var i = 0; \n\+ for (var i = 0; i < len; ++i) { \n\+ args[i] = arguments[i]; \n\+ } \n\+ args[i] = nodeback; \n\+ [CodeForCall] \n\+ break; \n\+ ".replace("[CodeForCall]", (shouldProxyThis+ ? "ret = callback.apply(this, args);\n"+ : "ret = callback.apply(receiver, args);\n"));+ return ret;+ }++ var getFunctionCode = typeof callback === "string"+ ? ("this != null ? this['"+callback+"'] : fn")+ : "fn";+ var body = "'use strict'; \n\+ var ret = function (Parameters) { \n\+ 'use strict'; \n\+ var len = arguments.length; \n\+ var promise = new Promise(INTERNAL); \n\+ promise._captureStackTrace(); \n\+ var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\+ var ret; \n\+ var callback = tryCatch([GetFunctionCode]); \n\+ switch(len) { \n\+ [CodeForSwitchCase] \n\+ } \n\+ if (ret === errorObj) { \n\+ promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\+ } \n\+ if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\+ return promise; \n\+ }; \n\+ notEnumerableProp(ret, '__isPromisified__', true); \n\+ return ret; \n\+ ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase())+ .replace("[GetFunctionCode]", getFunctionCode);+ body = body.replace("Parameters", parameterDeclaration(newParameterCount));+ return new Function("Promise",+ "fn",+ "receiver",+ "withAppended",+ "maybeWrapAsError",+ "nodebackForPromise",+ "tryCatch",+ "errorObj",+ "notEnumerableProp",+ "INTERNAL",+ body)(+ Promise,+ fn,+ receiver,+ withAppended,+ maybeWrapAsError,+ nodebackForPromise,+ util.tryCatch,+ util.errorObj,+ util.notEnumerableProp,+ INTERNAL);+};+}++function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {+ var defaultThis = (function() {return this;})();+ var method = callback;+ if (typeof method === "string") {+ callback = fn;+ }+ function promisified() {+ var _receiver = receiver;+ if (receiver === THIS) _receiver = this;+ var promise = new Promise(INTERNAL);+ promise._captureStackTrace();+ var cb = typeof method === "string" && this !== defaultThis+ ? this[method] : callback;+ var fn = nodebackForPromise(promise, multiArgs);+ try {+ cb.apply(_receiver, withAppended(arguments, fn));+ } catch(e) {+ promise._rejectCallback(maybeWrapAsError(e), true, true);+ }+ if (!promise._isFateSealed()) promise._setAsyncGuaranteed();+ return promise;+ }+ util.notEnumerableProp(promisified, "__isPromisified__", true);+ return promisified;+}++var makeNodePromisified = canEvaluate+ ? makeNodePromisifiedEval+ : makeNodePromisifiedClosure;++function promisifyAll(obj, suffix, filter, promisifier, multiArgs) {+ var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");+ var methods =+ promisifiableMethods(obj, suffix, suffixRegexp, filter);++ for (var i = 0, len = methods.length; i < len; i+= 2) {+ var key = methods[i];+ var fn = methods[i+1];+ var promisifiedKey = key + suffix;+ if (promisifier === makeNodePromisified) {+ obj[promisifiedKey] =+ makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);+ } else {+ var promisified = promisifier(fn, function() {+ return makeNodePromisified(key, THIS, key,+ fn, suffix, multiArgs);+ });+ util.notEnumerableProp(promisified, "__isPromisified__", true);+ obj[promisifiedKey] = promisified;+ }+ }+ util.toFastProperties(obj);+ return obj;+}++function promisify(callback, receiver, multiArgs) {+ return makeNodePromisified(callback, receiver, undefined,+ callback, null, multiArgs);+}++Promise.promisify = function (fn, options) {+ if (typeof fn !== "function") {+ throw new TypeError("expecting a function but got " + util.classString(fn));+ }+ if (isPromisified(fn)) {+ return fn;+ }+ options = Object(options);+ var receiver = options.context === undefined ? THIS : options.context;+ var multiArgs = !!options.multiArgs;+ var ret = promisify(fn, receiver, multiArgs);+ util.copyDescriptors(fn, ret, propsFilter);+ return ret;+};++Promise.promisifyAll = function (target, options) {+ if (typeof target !== "function" && typeof target !== "object") {+ throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ options = Object(options);+ var multiArgs = !!options.multiArgs;+ var suffix = options.suffix;+ if (typeof suffix !== "string") suffix = defaultSuffix;+ var filter = options.filter;+ if (typeof filter !== "function") filter = defaultFilter;+ var promisifier = options.promisifier;+ if (typeof promisifier !== "function") promisifier = makeNodePromisified;++ if (!util.isIdentifier(suffix)) {+ throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }++ var keys = util.inheritedDataKeys(target);+ for (var i = 0; i < keys.length; ++i) {+ var value = target[keys[i]];+ if (keys[i] !== "constructor" &&+ util.isClass(value)) {+ promisifyAll(value.prototype, suffix, filter, promisifier,+ multiArgs);+ promisifyAll(value, suffix, filter, promisifier, multiArgs);+ }+ }++ return promisifyAll(target, suffix, filter, promisifier, multiArgs);+};+};+++},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){+"use strict";+module.exports = function(+ Promise, PromiseArray, tryConvertToPromise, apiRejection) {+var util = _dereq_("./util");+var isObject = util.isObject;+var es5 = _dereq_("./es5");+var Es6Map;+if (typeof Map === "function") Es6Map = Map;++var mapToEntries = (function() {+ var index = 0;+ var size = 0;++ function extractEntry(value, key) {+ this[index] = value;+ this[index + size] = key;+ index++;+ }++ return function mapToEntries(map) {+ size = map.size;+ index = 0;+ var ret = new Array(map.size * 2);+ map.forEach(extractEntry, ret);+ return ret;+ };+})();++var entriesToMap = function(entries) {+ var ret = new Es6Map();+ var length = entries.length / 2 | 0;+ for (var i = 0; i < length; ++i) {+ var key = entries[length + i];+ var value = entries[i];+ ret.set(key, value);+ }+ return ret;+};++function PropertiesPromiseArray(obj) {+ var isMap = false;+ var entries;+ if (Es6Map !== undefined && obj instanceof Es6Map) {+ entries = mapToEntries(obj);+ isMap = true;+ } else {+ var keys = es5.keys(obj);+ var len = keys.length;+ entries = new Array(len * 2);+ for (var i = 0; i < len; ++i) {+ var key = keys[i];+ entries[i] = obj[key];+ entries[i + len] = key;+ }+ }+ this.constructor$(entries);+ this._isMap = isMap;+ this._init$(undefined, -3);+}+util.inherits(PropertiesPromiseArray, PromiseArray);++PropertiesPromiseArray.prototype._init = function () {};++PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {+ this._values[index] = value;+ var totalResolved = ++this._totalResolved;+ if (totalResolved >= this._length) {+ var val;+ if (this._isMap) {+ val = entriesToMap(this._values);+ } else {+ val = {};+ var keyOffset = this.length();+ for (var i = 0, len = this.length(); i < len; ++i) {+ val[this._values[i + keyOffset]] = this._values[i];+ }+ }+ this._resolve(val);+ return true;+ }+ return false;+};++PropertiesPromiseArray.prototype.shouldCopyValues = function () {+ return false;+};++PropertiesPromiseArray.prototype.getActualLength = function (len) {+ return len >> 1;+};++function props(promises) {+ var ret;+ var castValue = tryConvertToPromise(promises);++ if (!isObject(castValue)) {+ return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ } else if (castValue instanceof Promise) {+ ret = castValue._then(+ Promise.props, undefined, undefined, undefined, undefined);+ } else {+ ret = new PropertiesPromiseArray(castValue).promise();+ }++ if (castValue instanceof Promise) {+ ret._propagateFrom(castValue, 2);+ }+ return ret;+}++Promise.prototype.props = function () {+ return props(this);+};++Promise.props = function (promises) {+ return props(promises);+};+};++},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){+"use strict";+function arrayMove(src, srcIndex, dst, dstIndex, len) {+ for (var j = 0; j < len; ++j) {+ dst[j + dstIndex] = src[j + srcIndex];+ src[j + srcIndex] = void 0;+ }+}++function Queue(capacity) {+ this._capacity = capacity;+ this._length = 0;+ this._front = 0;+}++Queue.prototype._willBeOverCapacity = function (size) {+ return this._capacity < size;+};++Queue.prototype._pushOne = function (arg) {+ var length = this.length();+ this._checkCapacity(length + 1);+ var i = (this._front + length) & (this._capacity - 1);+ this[i] = arg;+ this._length = length + 1;+};++Queue.prototype.push = function (fn, receiver, arg) {+ var length = this.length() + 3;+ if (this._willBeOverCapacity(length)) {+ this._pushOne(fn);+ this._pushOne(receiver);+ this._pushOne(arg);+ return;+ }+ var j = this._front + length - 3;+ this._checkCapacity(length);+ var wrapMask = this._capacity - 1;+ this[(j + 0) & wrapMask] = fn;+ this[(j + 1) & wrapMask] = receiver;+ this[(j + 2) & wrapMask] = arg;+ this._length = length;+};++Queue.prototype.shift = function () {+ var front = this._front,+ ret = this[front];++ this[front] = undefined;+ this._front = (front + 1) & (this._capacity - 1);+ this._length--;+ return ret;+};++Queue.prototype.length = function () {+ return this._length;+};++Queue.prototype._checkCapacity = function (size) {+ if (this._capacity < size) {+ this._resizeTo(this._capacity << 1);+ }+};++Queue.prototype._resizeTo = function (capacity) {+ var oldCapacity = this._capacity;+ this._capacity = capacity;+ var front = this._front;+ var length = this._length;+ var moveItemsCount = (front + length) & (oldCapacity - 1);+ arrayMove(this, 0, this, oldCapacity, moveItemsCount);+};++module.exports = Queue;++},{}],27:[function(_dereq_,module,exports){+"use strict";+module.exports = function(+ Promise, INTERNAL, tryConvertToPromise, apiRejection) {+var util = _dereq_("./util");++var raceLater = function (promise) {+ return promise.then(function(array) {+ return race(array, promise);+ });+};++function race(promises, parent) {+ var maybePromise = tryConvertToPromise(promises);++ if (maybePromise instanceof Promise) {+ return raceLater(maybePromise);+ } else {+ promises = util.asArray(promises);+ if (promises === null)+ return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));+ }++ var ret = new Promise(INTERNAL);+ if (parent !== undefined) {+ ret._propagateFrom(parent, 3);+ }+ var fulfill = ret._fulfill;+ var reject = ret._reject;+ for (var i = 0, len = promises.length; i < len; ++i) {+ var val = promises[i];++ if (val === undefined && !(i in promises)) {+ continue;+ }++ Promise.cast(val)._then(fulfill, reject, undefined, ret, null);+ }+ return ret;+}++Promise.race = function (promises) {+ return race(promises, undefined);+};++Promise.prototype.race = function () {+ return race(this, undefined);+};++};++},{"./util":36}],28:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise,+ PromiseArray,+ apiRejection,+ tryConvertToPromise,+ INTERNAL,+ debug) {+var getDomain = Promise._getDomain;+var util = _dereq_("./util");+var tryCatch = util.tryCatch;++function ReductionPromiseArray(promises, fn, initialValue, _each) {+ this.constructor$(promises);+ var domain = getDomain();+ this._fn = domain === null ? fn : util.domainBind(domain, fn);+ if (initialValue !== undefined) {+ initialValue = Promise.resolve(initialValue);+ initialValue._attachCancellationCallback(this);+ }+ this._initialValue = initialValue;+ this._currentCancellable = null;+ if(_each === INTERNAL) {+ this._eachValues = Array(this._length);+ } else if (_each === 0) {+ this._eachValues = null;+ } else {+ this._eachValues = undefined;+ }+ this._promise._captureStackTrace();+ this._init$(undefined, -5);+}+util.inherits(ReductionPromiseArray, PromiseArray);++ReductionPromiseArray.prototype._gotAccum = function(accum) {+ if (this._eachValues !== undefined &&+ this._eachValues !== null &&+ accum !== INTERNAL) {+ this._eachValues.push(accum);+ }+};++ReductionPromiseArray.prototype._eachComplete = function(value) {+ if (this._eachValues !== null) {+ this._eachValues.push(value);+ }+ return this._eachValues;+};++ReductionPromiseArray.prototype._init = function() {};++ReductionPromiseArray.prototype._resolveEmptyArray = function() {+ this._resolve(this._eachValues !== undefined ? this._eachValues+ : this._initialValue);+};++ReductionPromiseArray.prototype.shouldCopyValues = function () {+ return false;+};++ReductionPromiseArray.prototype._resolve = function(value) {+ this._promise._resolveCallback(value);+ this._values = null;+};++ReductionPromiseArray.prototype._resultCancelled = function(sender) {+ if (sender === this._initialValue) return this._cancel();+ if (this._isResolved()) return;+ this._resultCancelled$();+ if (this._currentCancellable instanceof Promise) {+ this._currentCancellable.cancel();+ }+ if (this._initialValue instanceof Promise) {+ this._initialValue.cancel();+ }+};++ReductionPromiseArray.prototype._iterate = function (values) {+ this._values = values;+ var value;+ var i;+ var length = values.length;+ if (this._initialValue !== undefined) {+ value = this._initialValue;+ i = 0;+ } else {+ value = Promise.resolve(values[0]);+ i = 1;+ }++ this._currentCancellable = value;++ if (!value.isRejected()) {+ for (; i < length; ++i) {+ var ctx = {+ accum: null,+ value: values[i],+ index: i,+ length: length,+ array: this+ };+ value = value._then(gotAccum, undefined, undefined, ctx, undefined);+ }+ }++ if (this._eachValues !== undefined) {+ value = value+ ._then(this._eachComplete, undefined, undefined, this, undefined);+ }+ value._then(completed, completed, undefined, value, this);+};++Promise.prototype.reduce = function (fn, initialValue) {+ return reduce(this, fn, initialValue, null);+};++Promise.reduce = function (promises, fn, initialValue, _each) {+ return reduce(promises, fn, initialValue, _each);+};++function completed(valueOrReason, array) {+ if (this.isFulfilled()) {+ array._resolve(valueOrReason);+ } else {+ array._reject(valueOrReason);+ }+}++function reduce(promises, fn, initialValue, _each) {+ if (typeof fn !== "function") {+ return apiRejection("expecting a function but got " + util.classString(fn));+ }+ var array = new ReductionPromiseArray(promises, fn, initialValue, _each);+ return array.promise();+}++function gotAccum(accum) {+ this.accum = accum;+ this.array._gotAccum(accum);+ var value = tryConvertToPromise(this.value, this.array._promise);+ if (value instanceof Promise) {+ this.array._currentCancellable = value;+ return value._then(gotValue, undefined, undefined, this, undefined);+ } else {+ return gotValue.call(this, value);+ }+}++function gotValue(value) {+ var array = this.array;+ var promise = array._promise;+ var fn = tryCatch(array._fn);+ promise._pushContext();+ var ret;+ if (array._eachValues !== undefined) {+ ret = fn.call(promise._boundValue(), value, this.index, this.length);+ } else {+ ret = fn.call(promise._boundValue(),+ this.accum, value, this.index, this.length);+ }+ if (ret instanceof Promise) {+ array._currentCancellable = ret;+ }+ var promiseCreated = promise._popContext();+ debug.checkForgottenReturns(+ ret,+ promiseCreated,+ array._eachValues !== undefined ? "Promise.each" : "Promise.reduce",+ promise+ );+ return ret;+}+};++},{"./util":36}],29:[function(_dereq_,module,exports){+"use strict";+var util = _dereq_("./util");+var schedule;+var noAsyncScheduler = function() {+ throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a");+};+var NativePromise = util.getNativePromise();+if (util.isNode && typeof MutationObserver === "undefined") {+ var GlobalSetImmediate = global.setImmediate;+ var ProcessNextTick = process.nextTick;+ schedule = util.isRecentNode+ ? function(fn) { GlobalSetImmediate.call(global, fn); }+ : function(fn) { ProcessNextTick.call(process, fn); };+} else if (typeof NativePromise === "function" &&+ typeof NativePromise.resolve === "function") {+ var nativePromise = NativePromise.resolve();+ schedule = function(fn) {+ nativePromise.then(fn);+ };+} else if ((typeof MutationObserver !== "undefined") &&+ !(typeof window !== "undefined" &&+ window.navigator &&+ (window.navigator.standalone || window.cordova))) {+ schedule = (function() {+ var div = document.createElement("div");+ var opts = {attributes: true};+ var toggleScheduled = false;+ var div2 = document.createElement("div");+ var o2 = new MutationObserver(function() {+ div.classList.toggle("foo");+ toggleScheduled = false;+ });+ o2.observe(div2, opts);++ var scheduleToggle = function() {+ if (toggleScheduled) return;+ toggleScheduled = true;+ div2.classList.toggle("foo");+ };++ return function schedule(fn) {+ var o = new MutationObserver(function() {+ o.disconnect();+ fn();+ });+ o.observe(div, opts);+ scheduleToggle();+ };+ })();+} else if (typeof setImmediate !== "undefined") {+ schedule = function (fn) {+ setImmediate(fn);+ };+} else if (typeof setTimeout !== "undefined") {+ schedule = function (fn) {+ setTimeout(fn, 0);+ };+} else {+ schedule = noAsyncScheduler;+}+module.exports = schedule;++},{"./util":36}],30:[function(_dereq_,module,exports){+"use strict";+module.exports =+ function(Promise, PromiseArray, debug) {+var PromiseInspection = Promise.PromiseInspection;+var util = _dereq_("./util");++function SettledPromiseArray(values) {+ this.constructor$(values);+}+util.inherits(SettledPromiseArray, PromiseArray);++SettledPromiseArray.prototype._promiseResolved = function (index, inspection) {+ this._values[index] = inspection;+ var totalResolved = ++this._totalResolved;+ if (totalResolved >= this._length) {+ this._resolve(this._values);+ return true;+ }+ return false;+};++SettledPromiseArray.prototype._promiseFulfilled = function (value, index) {+ var ret = new PromiseInspection();+ ret._bitField = 33554432;+ ret._settledValueField = value;+ return this._promiseResolved(index, ret);+};+SettledPromiseArray.prototype._promiseRejected = function (reason, index) {+ var ret = new PromiseInspection();+ ret._bitField = 16777216;+ ret._settledValueField = reason;+ return this._promiseResolved(index, ret);+};++Promise.settle = function (promises) {+ debug.deprecated(".settle()", ".reflect()");+ return new SettledPromiseArray(promises).promise();+};++Promise.prototype.settle = function () {+ return Promise.settle(this);+};+};++},{"./util":36}],31:[function(_dereq_,module,exports){+"use strict";+module.exports =+function(Promise, PromiseArray, apiRejection) {+var util = _dereq_("./util");+var RangeError = _dereq_("./errors").RangeError;+var AggregateError = _dereq_("./errors").AggregateError;+var isArray = util.isArray;+var CANCELLATION = {};+++function SomePromiseArray(values) {+ this.constructor$(values);+ this._howMany = 0;+ this._unwrap = false;+ this._initialized = false;+}+util.inherits(SomePromiseArray, PromiseArray);++SomePromiseArray.prototype._init = function () {+ if (!this._initialized) {+ return;+ }+ if (this._howMany === 0) {+ this._resolve([]);+ return;+ }+ this._init$(undefined, -5);+ var isArrayResolved = isArray(this._values);+ if (!this._isResolved() &&+ isArrayResolved &&+ this._howMany > this._canPossiblyFulfill()) {+ this._reject(this._getRangeError(this.length()));+ }+};++SomePromiseArray.prototype.init = function () {+ this._initialized = true;+ this._init();+};++SomePromiseArray.prototype.setUnwrap = function () {+ this._unwrap = true;+};++SomePromiseArray.prototype.howMany = function () {+ return this._howMany;+};++SomePromiseArray.prototype.setHowMany = function (count) {+ this._howMany = count;+};++SomePromiseArray.prototype._promiseFulfilled = function (value) {+ this._addFulfilled(value);+ if (this._fulfilled() === this.howMany()) {+ this._values.length = this.howMany();+ if (this.howMany() === 1 && this._unwrap) {+ this._resolve(this._values[0]);+ } else {+ this._resolve(this._values);+ }+ return true;+ }+ return false;++};+SomePromiseArray.prototype._promiseRejected = function (reason) {+ this._addRejected(reason);+ return this._checkOutcome();+};++SomePromiseArray.prototype._promiseCancelled = function () {+ if (this._values instanceof Promise || this._values == null) {+ return this._cancel();+ }+ this._addRejected(CANCELLATION);+ return this._checkOutcome();+};++SomePromiseArray.prototype._checkOutcome = function() {+ if (this.howMany() > this._canPossiblyFulfill()) {+ var e = new AggregateError();+ for (var i = this.length(); i < this._values.length; ++i) {+ if (this._values[i] !== CANCELLATION) {+ e.push(this._values[i]);+ }+ }+ if (e.length > 0) {+ this._reject(e);+ } else {+ this._cancel();+ }+ return true;+ }+ return false;+};++SomePromiseArray.prototype._fulfilled = function () {+ return this._totalResolved;+};++SomePromiseArray.prototype._rejected = function () {+ return this._values.length - this.length();+};++SomePromiseArray.prototype._addRejected = function (reason) {+ this._values.push(reason);+};++SomePromiseArray.prototype._addFulfilled = function (value) {+ this._values[this._totalResolved++] = value;+};++SomePromiseArray.prototype._canPossiblyFulfill = function () {+ return this.length() - this._rejected();+};++SomePromiseArray.prototype._getRangeError = function (count) {+ var message = "Input array must contain at least " ++ this._howMany + " items but contains only " + count + " items";+ return new RangeError(message);+};++SomePromiseArray.prototype._resolveEmptyArray = function () {+ this._reject(this._getRangeError(0));+};++function some(promises, howMany) {+ if ((howMany | 0) !== howMany || howMany < 0) {+ return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ var ret = new SomePromiseArray(promises);+ var promise = ret.promise();+ ret.setHowMany(howMany);+ ret.init();+ return promise;+}++Promise.some = function (promises, howMany) {+ return some(promises, howMany);+};++Promise.prototype.some = function (howMany) {+ return some(this, howMany);+};++Promise._SomePromiseArray = SomePromiseArray;+};++},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise) {+function PromiseInspection(promise) {+ if (promise !== undefined) {+ promise = promise._target();+ this._bitField = promise._bitField;+ this._settledValueField = promise._isFateSealed()+ ? promise._settledValue() : undefined;+ }+ else {+ this._bitField = 0;+ this._settledValueField = undefined;+ }+}++PromiseInspection.prototype._settledValue = function() {+ return this._settledValueField;+};++var value = PromiseInspection.prototype.value = function () {+ if (!this.isFulfilled()) {+ throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ return this._settledValue();+};++var reason = PromiseInspection.prototype.error =+PromiseInspection.prototype.reason = function () {+ if (!this.isRejected()) {+ throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a");+ }+ return this._settledValue();+};++var isFulfilled = PromiseInspection.prototype.isFulfilled = function() {+ return (this._bitField & 33554432) !== 0;+};++var isRejected = PromiseInspection.prototype.isRejected = function () {+ return (this._bitField & 16777216) !== 0;+};++var isPending = PromiseInspection.prototype.isPending = function () {+ return (this._bitField & 50397184) === 0;+};++var isResolved = PromiseInspection.prototype.isResolved = function () {+ return (this._bitField & 50331648) !== 0;+};++PromiseInspection.prototype.isCancelled = function() {+ return (this._bitField & 8454144) !== 0;+};++Promise.prototype.__isCancelled = function() {+ return (this._bitField & 65536) === 65536;+};++Promise.prototype._isCancelled = function() {+ return this._target().__isCancelled();+};++Promise.prototype.isCancelled = function() {+ return (this._target()._bitField & 8454144) !== 0;+};++Promise.prototype.isPending = function() {+ return isPending.call(this._target());+};++Promise.prototype.isRejected = function() {+ return isRejected.call(this._target());+};++Promise.prototype.isFulfilled = function() {+ return isFulfilled.call(this._target());+};++Promise.prototype.isResolved = function() {+ return isResolved.call(this._target());+};++Promise.prototype.value = function() {+ return value.call(this._target());+};++Promise.prototype.reason = function() {+ var target = this._target();+ target._unsetRejectionIsUnhandled();+ return reason.call(target);+};++Promise.prototype._value = function() {+ return this._settledValue();+};++Promise.prototype._reason = function() {+ this._unsetRejectionIsUnhandled();+ return this._settledValue();+};++Promise.PromiseInspection = PromiseInspection;+};++},{}],33:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL) {+var util = _dereq_("./util");+var errorObj = util.errorObj;+var isObject = util.isObject;++function tryConvertToPromise(obj, context) {+ if (isObject(obj)) {+ if (obj instanceof Promise) return obj;+ var then = getThen(obj);+ if (then === errorObj) {+ if (context) context._pushContext();+ var ret = Promise.reject(then.e);+ if (context) context._popContext();+ return ret;+ } else if (typeof then === "function") {+ if (isAnyBluebirdPromise(obj)) {+ var ret = new Promise(INTERNAL);+ obj._then(+ ret._fulfill,+ ret._reject,+ undefined,+ ret,+ null+ );+ return ret;+ }+ return doThenable(obj, then, context);+ }+ }+ return obj;+}++function doGetThen(obj) {+ return obj.then;+}++function getThen(obj) {+ try {+ return doGetThen(obj);+ } catch (e) {+ errorObj.e = e;+ return errorObj;+ }+}++var hasProp = {}.hasOwnProperty;+function isAnyBluebirdPromise(obj) {+ try {+ return hasProp.call(obj, "_promise0");+ } catch (e) {+ return false;+ }+}++function doThenable(x, then, context) {+ var promise = new Promise(INTERNAL);+ var ret = promise;+ if (context) context._pushContext();+ promise._captureStackTrace();+ if (context) context._popContext();+ var synchronous = true;+ var result = util.tryCatch(then).call(x, resolve, reject);+ synchronous = false;++ if (promise && result === errorObj) {+ promise._rejectCallback(result.e, true, true);+ promise = null;+ }++ function resolve(value) {+ if (!promise) return;+ promise._resolveCallback(value);+ promise = null;+ }++ function reject(reason) {+ if (!promise) return;+ promise._rejectCallback(reason, synchronous, true);+ promise = null;+ }+ return ret;+}++return tryConvertToPromise;+};++},{"./util":36}],34:[function(_dereq_,module,exports){+"use strict";+module.exports = function(Promise, INTERNAL, debug) {+var util = _dereq_("./util");+var TimeoutError = Promise.TimeoutError;++function HandleWrapper(handle) {+ this.handle = handle;+}++HandleWrapper.prototype._resultCancelled = function() {+ clearTimeout(this.handle);+};++var afterValue = function(value) { return delay(+this).thenReturn(value); };+var delay = Promise.delay = function (ms, value) {+ var ret;+ var handle;+ if (value !== undefined) {+ ret = Promise.resolve(value)+ ._then(afterValue, null, null, ms, undefined);+ if (debug.cancellation() && value instanceof Promise) {+ ret._setOnCancel(value);+ }+ } else {+ ret = new Promise(INTERNAL);+ handle = setTimeout(function() { ret._fulfill(); }, +ms);+ if (debug.cancellation()) {+ ret._setOnCancel(new HandleWrapper(handle));+ }+ ret._captureStackTrace();+ }+ ret._setAsyncGuaranteed();+ return ret;+};++Promise.prototype.delay = function (ms) {+ return delay(ms, this);+};++var afterTimeout = function (promise, message, parent) {+ var err;+ if (typeof message !== "string") {+ if (message instanceof Error) {+ err = message;+ } else {+ err = new TimeoutError("operation timed out");+ }+ } else {+ err = new TimeoutError(message);+ }+ util.markAsOriginatingFromRejection(err);+ promise._attachExtraTrace(err);+ promise._reject(err);++ if (parent != null) {+ parent.cancel();+ }+};++function successClear(value) {+ clearTimeout(this.handle);+ return value;+}++function failureClear(reason) {+ clearTimeout(this.handle);+ throw reason;+}++Promise.prototype.timeout = function (ms, message) {+ ms = +ms;+ var ret, parent;++ var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {+ if (ret.isPending()) {+ afterTimeout(ret, message, parent);+ }+ }, ms));++ if (debug.cancellation()) {+ parent = this.then();+ ret = parent._then(successClear, failureClear,+ undefined, handleWrapper, undefined);+ ret._setOnCancel(handleWrapper);+ } else {+ ret = this._then(successClear, failureClear,+ undefined, handleWrapper, undefined);+ }++ return ret;+};++};++},{"./util":36}],35:[function(_dereq_,module,exports){+"use strict";+module.exports = function (Promise, apiRejection, tryConvertToPromise,+ createContext, INTERNAL, debug) {+ var util = _dereq_("./util");+ var TypeError = _dereq_("./errors").TypeError;+ var inherits = _dereq_("./util").inherits;+ var errorObj = util.errorObj;+ var tryCatch = util.tryCatch;+ var NULL = {};++ function thrower(e) {+ setTimeout(function(){throw e;}, 0);+ }++ function castPreservingDisposable(thenable) {+ var maybePromise = tryConvertToPromise(thenable);+ if (maybePromise !== thenable &&+ typeof thenable._isDisposable === "function" &&+ typeof thenable._getDisposer === "function" &&+ thenable._isDisposable()) {+ maybePromise._setDisposable(thenable._getDisposer());+ }+ return maybePromise;+ }+ function dispose(resources, inspection) {+ var i = 0;+ var len = resources.length;+ var ret = new Promise(INTERNAL);+ function iterator() {+ if (i >= len) return ret._fulfill();+ var maybePromise = castPreservingDisposable(resources[i++]);+ if (maybePromise instanceof Promise &&+ maybePromise._isDisposable()) {+ try {+ maybePromise = tryConvertToPromise(+ maybePromise._getDisposer().tryDispose(inspection),+ resources.promise);+ } catch (e) {+ return thrower(e);+ }+ if (maybePromise instanceof Promise) {+ return maybePromise._then(iterator, thrower,+ null, null, null);+ }+ }+ iterator();+ }+ iterator();+ return ret;+ }++ function Disposer(data, promise, context) {+ this._data = data;+ this._promise = promise;+ this._context = context;+ }++ Disposer.prototype.data = function () {+ return this._data;+ };++ Disposer.prototype.promise = function () {+ return this._promise;+ };++ Disposer.prototype.resource = function () {+ if (this.promise().isFulfilled()) {+ return this.promise().value();+ }+ return NULL;+ };++ Disposer.prototype.tryDispose = function(inspection) {+ var resource = this.resource();+ var context = this._context;+ if (context !== undefined) context._pushContext();+ var ret = resource !== NULL+ ? this.doDispose(resource, inspection) : null;+ if (context !== undefined) context._popContext();+ this._promise._unsetDisposable();+ this._data = null;+ return ret;+ };++ Disposer.isDisposer = function (d) {+ return (d != null &&+ typeof d.resource === "function" &&+ typeof d.tryDispose === "function");+ };++ function FunctionDisposer(fn, promise, context) {+ this.constructor$(fn, promise, context);+ }+ inherits(FunctionDisposer, Disposer);++ FunctionDisposer.prototype.doDispose = function (resource, inspection) {+ var fn = this.data();+ return fn.call(resource, resource, inspection);+ };++ function maybeUnwrapDisposer(value) {+ if (Disposer.isDisposer(value)) {+ this.resources[this.index]._setDisposable(value);+ return value.promise();+ }+ return value;+ }++ function ResourceList(length) {+ this.length = length;+ this.promise = null;+ this[length-1] = null;+ }++ ResourceList.prototype._resultCancelled = function() {+ var len = this.length;+ for (var i = 0; i < len; ++i) {+ var item = this[i];+ if (item instanceof Promise) {+ item.cancel();+ }+ }+ };++ Promise.using = function () {+ var len = arguments.length;+ if (len < 2) return apiRejection(+ "you must pass at least 2 arguments to Promise.using");+ var fn = arguments[len - 1];+ if (typeof fn !== "function") {+ return apiRejection("expecting a function but got " + util.classString(fn));+ }+ var input;+ var spreadArgs = true;+ if (len === 2 && Array.isArray(arguments[0])) {+ input = arguments[0];+ len = input.length;+ spreadArgs = false;+ } else {+ input = arguments;+ len--;+ }+ var resources = new ResourceList(len);+ for (var i = 0; i < len; ++i) {+ var resource = input[i];+ if (Disposer.isDisposer(resource)) {+ var disposer = resource;+ resource = resource.promise();+ resource._setDisposable(disposer);+ } else {+ var maybePromise = tryConvertToPromise(resource);+ if (maybePromise instanceof Promise) {+ resource =+ maybePromise._then(maybeUnwrapDisposer, null, null, {+ resources: resources,+ index: i+ }, undefined);+ }+ }+ resources[i] = resource;+ }++ var reflectedResources = new Array(resources.length);+ for (var i = 0; i < reflectedResources.length; ++i) {+ reflectedResources[i] = Promise.resolve(resources[i]).reflect();+ }++ var resultPromise = Promise.all(reflectedResources)+ .then(function(inspections) {+ for (var i = 0; i < inspections.length; ++i) {+ var inspection = inspections[i];+ if (inspection.isRejected()) {+ errorObj.e = inspection.error();+ return errorObj;+ } else if (!inspection.isFulfilled()) {+ resultPromise.cancel();+ return;+ }+ inspections[i] = inspection.value();+ }+ promise._pushContext();++ fn = tryCatch(fn);+ var ret = spreadArgs+ ? fn.apply(undefined, inspections) : fn(inspections);+ var promiseCreated = promise._popContext();+ debug.checkForgottenReturns(+ ret, promiseCreated, "Promise.using", promise);+ return ret;+ });++ var promise = resultPromise.lastly(function() {+ var inspection = new Promise.PromiseInspection(resultPromise);+ return dispose(resources, inspection);+ });+ resources.promise = promise;+ promise._setOnCancel(resources);+ return promise;+ };++ Promise.prototype._setDisposable = function (disposer) {+ this._bitField = this._bitField | 131072;+ this._disposer = disposer;+ };++ Promise.prototype._isDisposable = function () {+ return (this._bitField & 131072) > 0;+ };++ Promise.prototype._getDisposer = function () {+ return this._disposer;+ };++ Promise.prototype._unsetDisposable = function () {+ this._bitField = this._bitField & (~131072);+ this._disposer = undefined;+ };++ Promise.prototype.disposer = function (fn) {+ if (typeof fn === "function") {+ return new FunctionDisposer(fn, this, createContext());+ }+ throw new TypeError();+ };++};++},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){+"use strict";+var es5 = _dereq_("./es5");+var canEvaluate = typeof navigator == "undefined";++var errorObj = {e: {}};+var tryCatchTarget;+var globalObject = typeof self !== "undefined" ? self :+ typeof window !== "undefined" ? window :+ typeof global !== "undefined" ? global :+ this !== undefined ? this : null;++function tryCatcher() {+ try {+ var target = tryCatchTarget;+ tryCatchTarget = null;+ return target.apply(this, arguments);+ } catch (e) {+ errorObj.e = e;+ return errorObj;+ }+}+function tryCatch(fn) {+ tryCatchTarget = fn;+ return tryCatcher;+}++var inherits = function(Child, Parent) {+ var hasProp = {}.hasOwnProperty;++ function T() {+ this.constructor = Child;+ this.constructor$ = Parent;+ for (var propertyName in Parent.prototype) {+ if (hasProp.call(Parent.prototype, propertyName) &&+ propertyName.charAt(propertyName.length-1) !== "$"+ ) {+ this[propertyName + "$"] = Parent.prototype[propertyName];+ }+ }+ }+ T.prototype = Parent.prototype;+ Child.prototype = new T();+ return Child.prototype;+};+++function isPrimitive(val) {+ return val == null || val === true || val === false ||+ typeof val === "string" || typeof val === "number";++}++function isObject(value) {+ return typeof value === "function" ||+ typeof value === "object" && value !== null;+}++function maybeWrapAsError(maybeError) {+ if (!isPrimitive(maybeError)) return maybeError;++ return new Error(safeToString(maybeError));+}++function withAppended(target, appendee) {+ var len = target.length;+ var ret = new Array(len + 1);+ var i;+ for (i = 0; i < len; ++i) {+ ret[i] = target[i];+ }+ ret[i] = appendee;+ return ret;+}++function getDataPropertyOrDefault(obj, key, defaultValue) {+ if (es5.isES5) {+ var desc = Object.getOwnPropertyDescriptor(obj, key);++ if (desc != null) {+ return desc.get == null && desc.set == null+ ? desc.value+ : defaultValue;+ }+ } else {+ return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;+ }+}++function notEnumerableProp(obj, name, value) {+ if (isPrimitive(obj)) return obj;+ var descriptor = {+ value: value,+ configurable: true,+ enumerable: false,+ writable: true+ };+ es5.defineProperty(obj, name, descriptor);+ return obj;+}++function thrower(r) {+ throw r;+}++var inheritedDataKeys = (function() {+ var excludedPrototypes = [+ Array.prototype,+ Object.prototype,+ Function.prototype+ ];++ var isExcludedProto = function(val) {+ for (var i = 0; i < excludedPrototypes.length; ++i) {+ if (excludedPrototypes[i] === val) {+ return true;+ }+ }+ return false;+ };++ if (es5.isES5) {+ var getKeys = Object.getOwnPropertyNames;+ return function(obj) {+ var ret = [];+ var visitedKeys = Object.create(null);+ while (obj != null && !isExcludedProto(obj)) {+ var keys;+ try {+ keys = getKeys(obj);+ } catch (e) {+ return ret;+ }+ for (var i = 0; i < keys.length; ++i) {+ var key = keys[i];+ if (visitedKeys[key]) continue;+ visitedKeys[key] = true;+ var desc = Object.getOwnPropertyDescriptor(obj, key);+ if (desc != null && desc.get == null && desc.set == null) {+ ret.push(key);+ }+ }+ obj = es5.getPrototypeOf(obj);+ }+ return ret;+ };+ } else {+ var hasProp = {}.hasOwnProperty;+ return function(obj) {+ if (isExcludedProto(obj)) return [];+ var ret = [];++ /*jshint forin:false */+ enumeration: for (var key in obj) {+ if (hasProp.call(obj, key)) {+ ret.push(key);+ } else {+ for (var i = 0; i < excludedPrototypes.length; ++i) {+ if (hasProp.call(excludedPrototypes[i], key)) {+ continue enumeration;+ }+ }+ ret.push(key);+ }+ }+ return ret;+ };+ }++})();++var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;+function isClass(fn) {+ try {+ if (typeof fn === "function") {+ var keys = es5.names(fn.prototype);++ var hasMethods = es5.isES5 && keys.length > 1;+ var hasMethodsOtherThanConstructor = keys.length > 0 &&+ !(keys.length === 1 && keys[0] === "constructor");+ var hasThisAssignmentAndStaticMethods =+ thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;++ if (hasMethods || hasMethodsOtherThanConstructor ||+ hasThisAssignmentAndStaticMethods) {+ return true;+ }+ }+ return false;+ } catch (e) {+ return false;+ }+}++function toFastProperties(obj) {+ /*jshint -W027,-W055,-W031*/+ function FakeConstructor() {}+ FakeConstructor.prototype = obj;+ var l = 8;+ while (l--) new FakeConstructor();+ return obj;+ eval(obj);+}++var rident = /^[a-z$_][a-z$_0-9]*$/i;+function isIdentifier(str) {+ return rident.test(str);+}++function filledRange(count, prefix, suffix) {+ var ret = new Array(count);+ for(var i = 0; i < count; ++i) {+ ret[i] = prefix + i + suffix;+ }+ return ret;+}++function safeToString(obj) {+ try {+ return obj + "";+ } catch (e) {+ return "[no string representation]";+ }+}++function isError(obj) {+ return obj !== null &&+ typeof obj === "object" &&+ typeof obj.message === "string" &&+ typeof obj.name === "string";+}++function markAsOriginatingFromRejection(e) {+ try {+ notEnumerableProp(e, "isOperational", true);+ }+ catch(ignore) {}+}++function originatesFromRejection(e) {+ if (e == null) return false;+ return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||+ e["isOperational"] === true);+}++function canAttachTrace(obj) {+ return isError(obj) && es5.propertyIsWritable(obj, "stack");+}++var ensureErrorObject = (function() {+ if (!("stack" in new Error())) {+ return function(value) {+ if (canAttachTrace(value)) return value;+ try {throw new Error(safeToString(value));}+ catch(err) {return err;}+ };+ } else {+ return function(value) {+ if (canAttachTrace(value)) return value;+ return new Error(safeToString(value));+ };+ }+})();++function classString(obj) {+ return {}.toString.call(obj);+}++function copyDescriptors(from, to, filter) {+ var keys = es5.names(from);+ for (var i = 0; i < keys.length; ++i) {+ var key = keys[i];+ if (filter(key)) {+ try {+ es5.defineProperty(to, key, es5.getDescriptor(from, key));+ } catch (ignore) {}+ }+ }+}++var asArray = function(v) {+ if (es5.isArray(v)) {+ return v;+ }+ return null;+};++if (typeof Symbol !== "undefined" && Symbol.iterator) {+ var ArrayFrom = typeof Array.from === "function" ? function(v) {+ return Array.from(v);+ } : function(v) {+ var ret = [];+ var it = v[Symbol.iterator]();+ var itResult;+ while (!((itResult = it.next()).done)) {+ ret.push(itResult.value);+ }+ return ret;+ };++ asArray = function(v) {+ if (es5.isArray(v)) {+ return v;+ } else if (v != null && typeof v[Symbol.iterator] === "function") {+ return ArrayFrom(v);+ }+ return null;+ };+}++var isNode = typeof process !== "undefined" &&+ classString(process).toLowerCase() === "[object process]";++var hasEnvVariables = typeof process !== "undefined" &&+ typeof process.env !== "undefined";++function env(key) {+ return hasEnvVariables ? process.env[key] : undefined;+}++function getNativePromise() {+ if (typeof Promise === "function") {+ try {+ var promise = new Promise(function(){});+ if ({}.toString.call(promise) === "[object Promise]") {+ return Promise;+ }+ } catch (e) {}+ }+}++function domainBind(self, cb) {+ return self.bind(cb);+}++var ret = {+ isClass: isClass,+ isIdentifier: isIdentifier,+ inheritedDataKeys: inheritedDataKeys,+ getDataPropertyOrDefault: getDataPropertyOrDefault,+ thrower: thrower,+ isArray: es5.isArray,+ asArray: asArray,+ notEnumerableProp: notEnumerableProp,+ isPrimitive: isPrimitive,+ isObject: isObject,+ isError: isError,+ canEvaluate: canEvaluate,+ errorObj: errorObj,+ tryCatch: tryCatch,+ inherits: inherits,+ withAppended: withAppended,+ maybeWrapAsError: maybeWrapAsError,+ toFastProperties: toFastProperties,+ filledRange: filledRange,+ toString: safeToString,+ canAttachTrace: canAttachTrace,+ ensureErrorObject: ensureErrorObject,+ originatesFromRejection: originatesFromRejection,+ markAsOriginatingFromRejection: markAsOriginatingFromRejection,+ classString: classString,+ copyDescriptors: copyDescriptors,+ hasDevTools: typeof chrome !== "undefined" && chrome &&+ typeof chrome.loadTimes === "function",+ isNode: isNode,+ hasEnvVariables: hasEnvVariables,+ env: env,+ global: globalObject,+ getNativePromise: getNativePromise,+ domainBind: domainBind+};+ret.isRecentNode = ret.isNode && (function() {+ var version = process.versions.node.split(".").map(Number);+ return (version[0] === 0 && version[1] > 10) || (version[0] > 0);+})();++if (ret.isNode) ret.toFastProperties(process);++try {throw new Error(); } catch (e) {ret.lastLineError = e;}+module.exports = ret;++},{"./es5":13}]},{},[4])(4)+}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }\ No newline at end of filediff --git a/web/ext/node_modules/bluebird/js/browser/bluebird.min.js b/web/ext/node_modules/bluebird/js/browser/bluebird.min.jsnew file mode 100644index 000000000..242bbfeca--- /dev/null+++ b/web/ext/node_modules/bluebird/js/browser/bluebird.min.js@@ -0,0 +1,31 @@+/* @preserve+ * The MIT License (MIT)+ *+ * Copyright (c) 2013-2015 Petka Antonov+ *+ * Permission is hereby granted, free of charge, to any person obtaining a copy+ * of this software and associated documentation files (the "Software"), to deal+ * in the Software without restriction, including without limitation the rights+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+ * copies of the Software, and to permit persons to whom the Software is+ * furnished to do so, subject to the following conditions:+ *+ * The above copyright notice and this permission notice shall be included in+ * all copies or substantial portions of the Software.+ *+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+ * THE SOFTWARE.+ *+ */+/**+ * bluebird build version 3.4.7+ * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each+*/+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,n){"use strict";e.exports=function(t){function e(t){var e=new n(t),r=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),r}var n=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e,n){"use strict";function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new u(16),this._normalQueue=new u(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=l}function i(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function o(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function s(t){this._normalQueue._pushOne(t),this._queueTick()}var a;try{throw new Error}catch(c){a=c}var l=t("./schedule"),u=t("./queue"),p=t("./util");r.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){p.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},p.hasDevTools?(r.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?i.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},r.prototype.invoke=function(t,e,n){this._trampolineEnabled?o.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=i,r.prototype.invoke=o,r.prototype.settlePromises=s),r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var r=s(t).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),c.throwLater(r.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),c.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){function n(t,n,a){return function(c){var l=a._boundValue();t:for(var u=0;u<t.length;++u){var p=t[u];if(p===Error||null!=p&&p.prototype instanceof Error){if(c instanceof p)return o(n).call(l,c)}else if("function"==typeof p){var h=o(p).call(l,c);if(h===s)return h;if(h)return o(n).call(l,c)}else if(r.isObject(c)){for(var f=i(p),_=0;_<f.length;++_){var d=f[_];if(p[d]!=c[d])continue t}return o(n).call(l,c)}}return e}}var r=t("./util"),i=t("./es5").keys,o=r.tryCatch,s=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){this._trace=new e.CapturedTrace(r())}function n(){return i?new e:void 0}function r(){var t=o.length-1;return t>=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l<a.length;++l)if(a[l]===h){l>0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function m(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}function g(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function b(t){for(var e=t[0],n=1;n<t.length;++n){for(var r=t[n],i=e.length-1,o=e[i],s=-1,a=r.length-1;a>=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n<t.length;++n){var r=t[n],i=" (No stack trace)"===r||q.test(r),o=i&&nt(r);i&&!o&&($&&" "!==r.charAt(0)&&(r=" "+r),e.push(r))}return e}function C(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var r=e[n];if(" (No stack trace)"===r||q.test(r))break}return n>0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function T(){return"function"==typeof it}function P(t){var e=t.match(rt);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}function R(t,e){if(T()){for(var n,r,i=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,c=0;c<i.length;++c){var l=P(i[c]);if(l){n=l.fileName,s=l.line;break}}for(var c=0;c<o.length;++c){var l=P(o[c]);if(l){r=l.fileName,a=l.line;break}}0>s||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),z=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),X=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:H.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:H.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!H.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!H.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),g(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"[33m":"[31m";console.warn(n+t+"[0m\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m<y.length;++m)"function"==typeof Array.prototype[y[m]]&&(d.prototype[y[m]]=Array.prototype[y[m]]);a.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",i=r.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];r=i.join("\n"),e+=r+"\n"}return g--,e},u(i,Error);var b=Error.__BluebirdErrorTypes__;b||(b=c({CancellationError:f,TimeoutError:_,OperationalError:i,RejectionError:i,AggregateError:d}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:b,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:o,RangeError:s,CancellationError:b.CancellationError,OperationalError:b.OperationalError,TimeoutError:b.TimeoutError,AggregateError:b.AggregateError,Warning:h}},{"./es5":13,"./util":36}],13:[function(t,e,n){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var i={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var n in t)i.call(t,n)&&e.push(n);return e},c=function(t,e){return{value:t[e]}},l=function(t,e,n){return t[e]=n.value,t},u=function(t){return t},p=function(t){try{return Object(t).constructor.prototype}catch(e){return s}},h=function(t){try{return"[object Array]"===o.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:a,names:a,defineProperty:l,getDescriptor:c,freeze:u,getPrototypeOf:p,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,r){return n(this,t,r,e)},t.filter=function(t,r,i){return n(t,r,i,e)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function i(t){this.finallyHandler=t}function o(t,e){return null!=t.cancelPromise?(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return c.call(this,this.promise._target()._settledValue())}function a(t){return o(this,t)?void 0:(p.e=t,p)}function c(t){var r=this.promise,c=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?c.call(r._boundValue()):c.call(r._boundValue(),t);if(void 0!==l){r._setReturnedNonUndefined();var h=n(l,r);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var f=new u("late cancellation observer");return r._attachExtraTrace(f),p.e=f,p}h.isPending()&&h._attachCancellationCallback(new i(this))}return h._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(o(this),p.e=t,p):(o(this),t)}var l=t("./util"),u=e.CancellationError,p=l.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new r(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,c,c)},e.prototype.tap=function(t){return this._passThrough(t,1,c)},r}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o<n.length;++o){r._pushContext();var s=f(n[o])(t);if(r._popContext(),s===h){r._pushContext();var a=e.reject(h.e);return r._popContext(),a}var c=i(s,r);if(c instanceof e)return c}return null}function c(t,n,i,o){if(s.cancellation()){var a=new e(r),c=this._finallyPromise=new e(r);this._promise=a.lastly(function(){return c}),a._captureStackTrace(),a._setOnCancel(this)}else{var l=this._promise=new e(r);l._captureStackTrace()}this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(_):_,this._yieldedPromise=null,this._cancellationPhase=!1}var l=t("./errors"),u=l.TypeError,p=t("./util"),h=p.errorObj,f=p.tryCatch,_=[];p.inherits(c,o),c.prototype._isResolved=function(){return null===this._promise},c.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},c.prototype._promiseCancelled=function(){if(!this._isResolved()){var t,n="undefined"!=typeof this._generator["return"];if(n)this._promise._pushContext(),t=f(this._generator["return"]).call(this._generator,void 0),this._promise._popContext();else{var r=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),t=f(this._generator["throw"]).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(t)}},c.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=f(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=f(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},c.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,t.cancel()}},c.prototype.promise=function(){return this._promise},c.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},c.prototype._continue=function(t){var n=this._promise;if(t===h)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(t.e,!1);var r=t.value;if(t.done===!0)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var o=i(r,this._promise);if(!(o instanceof e)&&(o=a(o,this._yieldHandlers,this._promise),null===o))return void this._promiseRejected(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));o=o._target();var s=o._bitField;0===(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!==(33554432&s)?e._async.invoke(this._promiseFulfilled,this,o._value()):0!==(16777216&s)?e._async.invoke(this._promiseRejected,this,o._reason()):this._promiseCancelled()},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,r=c,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new r(void 0,void 0,n,i),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),+s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("expecting a function but got "+p.classString(t));_.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var r=new c(t,this),i=r.promise();return r._run(e.spawn),i}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){var a=t("./util");a.canEvaluate,a.tryCatch,a.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var m=++this._totalResolved;return m>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var r=t.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(t,e){for(var n=e.length,r=new Array(n),i=0,o=0;n>o;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i<n.length;++i){var o=n[i];p.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function o(t,e){return function(n,r){if(null!==t){if(n){var o=i(a(n));t._attachExtraTrace(o),t._reject(o)}else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(r);t=null}}}var s=t("./util"),a=s.maybeWrapAsError,c=t("./errors"),l=c.OperationalError,u=t("./es5"),p=/^(?:name|message|stack|cause)$/;e.exports=o},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){function n(t,e){var n=this;if(!o.isArray(t))return r.call(n,t,e);var i=a(e).apply(n._boundValue(),[null].concat(t));i===c&&s.throwLater(i.e)}function r(t,e){var n=this,r=n._boundValue(),i=void 0===t?a(e).call(r,null):a(e).call(r,null,t);i===c&&s.throwLater(i.e)}function i(t,e){var n=this;if(!t){var r=new Error(t+"");r.cause=t,t=r}var i=a(e).call(n._boundValue(),t);i===c&&s.throwLater(i.e)}var o=t("./util"),s=e._async,a=o.tryCatch,c=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=r;void 0!==e&&Object(e).spread&&(o=n),this._then(o,i,void 0,this,t)}return this}}},{"./util":36}],22:[function(t,e,n){"use strict";e.exports=function(){function n(){}function r(t,e){if("function"!=typeof e)throw new m("expecting a function but got "+f.classString(e));if(t.constructor!==i)throw new m("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}function i(t){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,t!==b&&(r(this,t),this._resolveFromExecutor(t)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function o(t){this.promise._resolveCallback(t)}function s(t){this.promise._rejectCallback(t,!1)}function a(t){var e=new i(b);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}var c,l=function(){return new m("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},u=function(){return new i.PromiseInspection(this._target())},p=function(t){return i.reject(new m(t))},h={},f=t("./util");c=f.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},f.notEnumerableProp(i,"_getDomain",c);var _=t("./es5"),d=t("./async"),v=new d;_.defineProperty(i,"_async",{value:v});var y=t("./errors"),m=i.TypeError=y.TypeError;i.RangeError=y.RangeError;var g=i.CancellationError=y.CancellationError;i.TimeoutError=y.TimeoutError,i.OperationalError=y.OperationalError,i.RejectionError=y.OperationalError,i.AggregateError=y.AggregateError;var b=function(){},w={},C={},j=t("./thenables")(i,b),E=t("./promise_array")(i,b,j,p,n),k=t("./context")(i),F=k.create,x=t("./debuggability")(i,k),T=(x.CapturedTrace,t("./finally")(i,j)),P=t("./catch_filter")(C),R=t("./nodeback"),S=f.errorObj,O=f.tryCatch;return i.prototype.toString=function(){return"[object Promise]"},i.prototype.caught=i.prototype["catch"]=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("expecting an object but got A catch statement predicate "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&u)){var h,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,h=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new g("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new g("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new m("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.4.7",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t){return!C.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,n){var r=f.getDataPropertyOrDefault(t,e+n,b);return r?i(r):!1}function s(t,e,n){for(var r=0;r<t.length;r+=2){var i=t[r];if(n.test(i))for(var o=i.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new m("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}function a(t,e,n,r){for(var a=f.inheritedDataKeys(t),c=[],l=0;l<a.length;++l){var u=a[l],p=t[u],h=r===j?!0:j(u,p,t);"function"!=typeof p||i(p)||o(t,u,e)||!r(u,p,t,h)||c.push(u,p)}return s(c,e,n),c}function c(t,r,i,o,s,a){function c(){var i=r;r===h&&(i=this);var o=new e(n);o._captureStackTrace();var s="string"==typeof u&&this!==l?this[u]:t,c=_(o,a);try{s.apply(i,d(arguments,c))}catch(p){o._rejectCallback(v(p),!0,!0)}return o._isFateSealed()||o._setAsyncGuaranteed(),o}var l=function(){return this}(),u=t;return"string"==typeof u&&(t=o),f.notEnumerableProp(c,"__isPromisified__",!0),c}function l(t,e,n,r,i){for(var o=new RegExp(E(e)+"$"),s=a(t,e,o,n),c=0,l=s.length;l>c;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===k)t[_]=k(u,h,u,p,e,i);else{var d=r(p,function(){return k(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return k(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,m=t("./errors").TypeError,g="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},k=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=g);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=k),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;a<s.length;++a){var c=t[s[a]];"constructor"!==s[a]&&f.isClass(c)&&(l(c.prototype,r,i,o,n),l(c,r,i,o,n))}return l(t,r,i,o,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t){var e,n=!1;if(void 0!==a&&t instanceof a)e=p(t),n=!0;else{var r=u.keys(t),i=r.length;e=new Array(2*i);for(var o=0;i>o;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var n=this._front+e&this._capacity-1;this[n]=t,this._length=e+1},i.prototype.push=function(t,e,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var i=this._front+r-3;this._checkCapacity(r);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=n,this._length=r},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=i},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){function o(t,o){var c=r(t);if(c instanceof e)return a(c);if(t=s.asArray(t),null===t)return i("expecting an array or an iterable object but got "+s.classString(t));var l=new e(n);void 0!==o&&l._propagateFrom(o,3);for(var u=l._fulfill,p=l._reject,h=0,f=t.length;f>h;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){+if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){try{return p.call(t,"_promise0")}catch(e){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,m=_.tryCatch,g={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():g},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==g?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var g=r(d);g instanceof e&&(d=g._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p<b.length;++p)b[p]=e.resolve(c[p]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return y.e=n.error(),y;if(!n.isFulfilled())return void w.cancel();t[e]=n.value()}C._pushContext(),i=m(i);var r=a?i.apply(void 0,t):i(t),o=C._popContext();return s.checkForgottenReturns(r,o,"Promise.using",C),r}),C=w.lastly(function(){var t=new e.PromiseInspection(w);return l(c,t)});return c.promise=C,C._setOnCancel(c),C},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=P;return P=null,t.apply(this,arguments)}catch(e){return T.e=e,T}}function i(t){return P=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function m(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=F.names(t),i=0;i<r.length;++i){var o=r[i];if(n(o))try{F.defineProperty(e,o,F.getDescriptor(t,o))}catch(s){}}}function j(t){return N?process.env[t]:void 0}function E(){if("function"==typeof Promise)try{var t=new Promise(function(){});if("[object Promise]"==={}.toString.call(t))return Promise}catch(e){}}function k(t,e){return t.bind(e)}var F=t("./es5"),x="undefined"==typeof navigator,T={e:{}},P,R="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null,S=function(t,e){function n(){this.constructor=t,this.constructor$=e;for(var n in e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}var r={}.hasOwnProperty;return n.prototype=e.prototype,t.prototype=new n,t.prototype},O=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(F.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],i=Object.create(null);null!=t&&!e(t);){var o;try{o=n(t)}catch(s){return r}for(var a=0;a<o.length;++a){var c=o[a];if(!i[c]){i[c]=!0;var l=Object.getOwnPropertyDescriptor(t,c);null!=l&&null==l.get&&null==l.set&&r.push(c)}}t=F.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),A=/this\s*\.\s*\S+\s*=/,D=/^[a-z$_][a-z$_0-9]*$/i,V=function(){return"stack"in new Error?function(t){return b(t)?t:new Error(v(t))}:function(t){if(b(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),I=function(t){return F.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var L="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],r=t[Symbol.iterator]();!(e=r.next()).done;)n.push(e.value);return n};I=function(t){return F.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?L(t):null}}var H="undefined"!=typeof process&&"[object process]"===w(process).toLowerCase(),N="undefined"!=typeof process&&"undefined"!=typeof process.env,B={isClass:h,isIdentifier:_,inheritedDataKeys:O,getDataPropertyOrDefault:l,thrower:p,isArray:F.isArray,asArray:I,notEnumerableProp:u,isPrimitive:o,isObject:s,isError:y,canEvaluate:x,errorObj:T,tryCatch:i,inherits:S,withAppended:c,maybeWrapAsError:a,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:b,ensureErrorObject:V,originatesFromRejection:g,markAsOriginatingFromRejection:m,classString:w,copyDescriptors:C,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:H,hasEnvVariables:N,env:j,global:R,getNativePromise:E,domainBind:k};B.isRecentNode=B.isNode&&function(){var t=process.versions.node.split(".").map(Number);return 0===t[0]&&t[1]>10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(U){B.lastLineError=U}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);\ No newline at end of filediff --git a/web/ext/node_modules/gifshot/demo/gifshot.custom.js b/web/ext/node_modules/gifshot/demo/gifshot.custom.jsnew file mode 100644index 000000000..630862810--- /dev/null+++ b/web/ext/node_modules/gifshot/demo/gifshot.custom.js@@ -0,0 +1,1523 @@+/*Copyrights for code authored by Yahoo Inc. is licensed under the following terms:+MIT License+Copyright 2015 Yahoo Inc.+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+*/+;(function(window, document, navigator, undefined) {+var utils, error, defaultOptions, isSupported, isWebCamGIFSupported, isExistingImagesGIFSupported, isExistingVideoGIFSupported, NeuQuant, processFrameWorker, gifWriter, AnimatedGIF, getBase64GIF, existingImages, screenShot, videoStream, stopVideoStreaming, createAndGetGIF, existingVideo, existingWebcam, createGIF, takeSnapShot, API;+utils = function () {+ var utils = {+ 'URL': window.URL || window.webkitURL || window.mozURL || window.msURL,+ 'getUserMedia': function () {+ var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;+ return getUserMedia ? getUserMedia.bind(navigator) : getUserMedia;+ }(),+ 'requestAnimFrame': window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame,+ 'requestTimeout': function (callback, delay) {+ callback = callback || utils.noop;+ delay = delay || 0;+ if (!utils.requestAnimFrame) {+ return setTimeout(callback, delay);+ }+ var start = new Date().getTime(), handle = new Object(), requestAnimFrame = utils.requestAnimFrame;+ function loop() {+ var current = new Date().getTime(), delta = current - start;+ delta >= delay ? callback.call() : handle.value = requestAnimFrame(loop);+ }+ handle.value = requestAnimFrame(loop);+ return handle;+ },+ 'Blob': window.Blob || window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder,+ 'btoa': function () {+ var btoa = window.btoa || function (input) {+ var output = '', i = 0, l = input.length, key = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', chr1, chr2, chr3, enc1, enc2, enc3, enc4;+ while (i < l) {+ chr1 = input.charCodeAt(i++);+ chr2 = input.charCodeAt(i++);+ chr3 = input.charCodeAt(i++);+ enc1 = chr1 >> 2;+ enc2 = (chr1 & 3) << 4 | chr2 >> 4;+ enc3 = (chr2 & 15) << 2 | chr3 >> 6;+ enc4 = chr3 & 63;+ if (isNaN(chr2))+ enc3 = enc4 = 64;+ else if (isNaN(chr3))+ enc4 = 64;+ output = output + key.charAt(enc1) + key.charAt(enc2) + key.charAt(enc3) + key.charAt(enc4);+ }+ return output;+ };+ return btoa ? btoa.bind(window) : function () {+ };+ }(),+ 'isObject': function (obj) {+ return obj && Object.prototype.toString.call(obj) === '[object Object]';+ },+ 'isEmptyObject': function (obj) {+ return utils.isObject(obj) && !Object.keys(obj).length;+ },+ 'isArray': function (arr) {+ return arr && Array.isArray(arr);+ },+ 'isFunction': function (func) {+ return func && typeof func === 'function';+ },+ 'isElement': function (elem) {+ return elem && elem.nodeType === 1;+ },+ 'isString': function (value) {+ return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]';+ },+ 'isSupported': {+ 'canvas': function () {+ var el = document.createElement('canvas');+ return el && el.getContext && el.getContext('2d');+ },+ 'webworkers': function () {+ return window.Worker;+ },+ 'blob': function () {+ return utils.Blob;+ },+ 'Uint8Array': function () {+ return window.Uint8Array;+ },+ 'Uint32Array': function () {+ return window.Uint32Array;+ },+ 'videoCodecs': function () {+ var testEl = document.createElement('video'), supportObj = {+ 'mp4': false,+ 'h264': false,+ 'ogv': false,+ 'ogg': false,+ 'webm': false+ };+ try {+ if (testEl && testEl.canPlayType) {+ supportObj.mp4 = testEl.canPlayType('video/mp4; codecs="mp4v.20.8"') !== '';+ supportObj.h264 = (testEl.canPlayType('video/mp4; codecs="avc1.42E01E"') || testEl.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')) !== '';+ supportObj.ogv = testEl.canPlayType('video/ogg; codecs="theora"') !== '';+ supportObj.ogg = testEl.canPlayType('video/ogg; codecs="theora"') !== '';+ supportObj.webm = testEl.canPlayType('video/webm; codecs="vp8, vorbis"') !== -1;+ }+ } catch (e) {+ }+ return supportObj;+ }()+ },+ 'noop': function () {+ },+ 'each': function (collection, callback) {+ var x, len;+ if (utils.isArray(collection)) {+ x = -1;+ len = collection.length;+ while (++x < len) {+ if (callback(x, collection[x]) === false) {+ break;+ }+ }+ } else if (utils.isObject(collection)) {+ for (x in collection) {+ if (collection.hasOwnProperty(x)) {+ if (callback(x, collection[x]) === false) {+ break;+ }+ }+ }+ }+ },+ 'mergeOptions': function deepMerge(defaultOptions, userOptions) {+ if (!utils.isObject(defaultOptions) || !utils.isObject(userOptions) || !Object.keys) {+ return;+ }+ var newObj = {};+ utils.each(defaultOptions, function (key, val) {+ newObj[key] = defaultOptions[key];+ });+ utils.each(userOptions, function (key, val) {+ var currentUserOption = userOptions[key];+ if (!utils.isObject(currentUserOption)) {+ newObj[key] = currentUserOption;+ } else {+ if (!defaultOptions[key]) {+ newObj[key] = currentUserOption;+ } else {+ newObj[key] = deepMerge(defaultOptions[key], currentUserOption);+ }+ }+ });+ return newObj;+ },+ 'setCSSAttr': function (elem, attr, val) {+ if (!utils.isElement(elem)) {+ return;+ }+ if (utils.isString(attr) && utils.isString(val)) {+ elem.style[attr] = val;+ } else if (utils.isObject(attr)) {+ utils.each(attr, function (key, val) {+ elem.style[key] = val;+ });+ }+ },+ 'removeElement': function (node) {+ if (!utils.isElement(node)) {+ return;+ }+ if (node.parentNode) {+ node.parentNode.removeChild(node);+ }+ },+ 'createWebWorker': function (content) {+ if (!utils.isString(content)) {+ return {};+ }+ try {+ var blob = new utils.Blob([content], { 'type': 'text/javascript' }), objectUrl = utils.URL.createObjectURL(blob), worker = new Worker(objectUrl);+ return {+ 'objectUrl': objectUrl,+ 'worker': worker+ };+ } catch (e) {+ return '' + e;+ }+ },+ 'getExtension': function (src) {+ return src.substr(src.lastIndexOf('.') + 1, src.length);+ },+ 'getFontSize': function (options) {+ options = options || {};+ if (!document.body || options.resizeFont === false) {+ return options.fontSize;+ }+ var text = options.text, containerWidth = options.gifWidth, fontSize = parseInt(options.fontSize, 10), minFontSize = parseInt(options.minFontSize, 10), div = document.createElement('div'), span = document.createElement('span');+ div.setAttribute('width', containerWidth);+ div.appendChild(span);+ span.innerHTML = text;+ span.style.fontSize = fontSize + 'px';+ span.style.textIndent = '-9999px';+ span.style.visibility = 'hidden';+ document.body.appendChild(span);+ while (span.offsetWidth > containerWidth && fontSize >= minFontSize) {+ span.style.fontSize = --fontSize + 'px';+ }+ document.body.removeChild(span);+ return fontSize + 'px';+ },+ 'webWorkerError': false+ };+ return utils;+}();+error = function (utils) {+ var error = {+ 'validate': function (skipObj) {+ skipObj = utils.isObject(skipObj) ? skipObj : {};+ var errorObj = {};+ utils.each(error.validators, function (indece, currentValidator) {+ var errorCode = currentValidator.errorCode;+ if (!skipObj[errorCode] && !currentValidator.condition) {+ errorObj = currentValidator;+ errorObj.error = true;+ return false;+ }+ });+ delete errorObj.condition;+ return errorObj;+ },+ 'isValid': function (skipObj) {+ var errorObj = error.validate(skipObj), isValid = errorObj.error !== true ? true : false;+ return isValid;+ },+ 'validators': [+ {+ 'condition': utils.isFunction(utils.getUserMedia),+ 'errorCode': 'getUserMedia',+ 'errorMsg': 'The getUserMedia API is not supported in your browser'+ },+ {+ 'condition': utils.isSupported.canvas(),+ 'errorCode': 'canvas',+ 'errorMsg': 'Canvas elements are not supported in your browser'+ },+ {+ 'condition': utils.isSupported.webworkers(),+ 'errorCode': 'webworkers',+ 'errorMsg': 'The Web Workers API is not supported in your browser'+ },+ {+ 'condition': utils.isFunction(utils.URL),+ 'errorCode': 'window.URL',+ 'errorMsg': 'The window.URL API is not supported in your browser'+ },+ {+ 'condition': utils.isSupported.blob(),+ 'errorCode': 'window.Blob',+ 'errorMsg': 'The window.Blob File API is not supported in your browser'+ },+ {+ 'condition': utils.isSupported.Uint8Array(),+ 'errorCode': 'window.Uint8Array',+ 'errorMsg': 'The window.Uint8Array function constructor is not supported in your browser'+ },+ {+ 'condition': utils.isSupported.Uint32Array(),+ 'errorCode': 'window.Uint32Array',+ 'errorMsg': 'The window.Uint32Array function constructor is not supported in your browser'+ }+ ],+ 'messages': {+ 'videoCodecs': {+ 'errorCode': 'videocodec',+ 'errorMsg': 'The video codec you are trying to use is not supported in your browser'+ }+ }+ };+ return error;+}(utils);+defaultOptions = {+ 'sampleInterval': 10,+ 'numWorkers': 2,+ 'gifWidth': 200,+ 'gifHeight': 200,+ 'interval': 0.1,+ 'numFrames': 10,+ 'keepCameraOn': false,+ 'images': [],+ 'video': null,+ 'stamp': null,+ 'webcamVideoElement': null,+ 'cameraStream': null,+ 'text': '',+ 'fontWeight': 'normal',+ 'fontSize': '16px',+ 'minFontSize': '10px',+ 'resizeFont': false,+ 'fontFamily': 'sans-serif',+ 'fontColor': '#ffffff',+ 'textAlign': 'center',+ 'textBaseline': 'bottom',+ 'textXCoordinate': null,+ 'textYCoordinate': null,+ 'progressCallback': function (captureProgress) {+ },+ 'completeCallback': function () {+ },+ 'saveRenderingContexts': false,+ 'savedRenderingContexts': [],+ 'crossOrigin': 'Anonymous'+};+isSupported = function () {+ return error.isValid();+};+isExistingImagesGIFSupported = function () {+ var skipObj = { 'getUserMedia': true };+ return error.isValid(skipObj);+};+NeuQuant = function () {+ function NeuQuant() {+ var netsize = 256;+ var prime1 = 499;+ var prime2 = 491;+ var prime3 = 487;+ var prime4 = 503;+ var minpicturebytes = 3 * prime4;+ var maxnetpos = netsize - 1;+ var netbiasshift = 4;+ var ncycles = 100;+ var intbiasshift = 16;+ var intbias = 1 << intbiasshift;+ var gammashift = 10;+ var gamma = 1 << gammashift;+ var betashift = 10;+ var beta = intbias >> betashift;+ var betagamma = intbias << gammashift - betashift;+ var initrad = netsize >> 3;+ var radiusbiasshift = 6;+ var radiusbias = 1 << radiusbiasshift;+ var initradius = initrad * radiusbias;+ var radiusdec = 30;+ var alphabiasshift = 10;+ var initalpha = 1 << alphabiasshift;+ var alphadec;+ var radbiasshift = 8;+ var radbias = 1 << radbiasshift;+ var alpharadbshift = alphabiasshift + radbiasshift;+ var alpharadbias = 1 << alpharadbshift;+ var thepicture;+ var lengthcount;+ var samplefac;+ var network;+ var netindex = [];+ var bias = [];+ var freq = [];+ var radpower = [];+ function NeuQuantConstructor(thepic, len, sample) {+ var i;+ var p;+ thepicture = thepic;+ lengthcount = len;+ samplefac = sample;+ network = new Array(netsize);+ for (i = 0; i < netsize; i++) {+ network[i] = new Array(4);+ p = network[i];+ p[0] = p[1] = p[2] = (i << netbiasshift + 8) / netsize | 0;+ freq[i] = intbias / netsize | 0;+ bias[i] = 0;+ }+ }+ function colorMap() {+ var map = [];+ var index = new Array(netsize);+ for (var i = 0; i < netsize; i++)+ index[network[i][3]] = i;+ var k = 0;+ for (var l = 0; l < netsize; l++) {+ var j = index[l];+ map[k++] = network[j][0];+ map[k++] = network[j][1];+ map[k++] = network[j][2];+ }+ return map;+ }+ function inxbuild() {+ var i;+ var j;+ var smallpos;+ var smallval;+ var p;+ var q;+ var previouscol;+ var startpos;+ previouscol = 0;+ startpos = 0;+ for (i = 0; i < netsize; i++) {+ p = network[i];+ smallpos = i;+ smallval = p[1];+ for (j = i + 1; j < netsize; j++) {+ q = network[j];+ if (q[1] < smallval) {+ smallpos = j;+ smallval = q[1];+ }+ }+ q = network[smallpos];+ if (i != smallpos) {+ j = q[0];+ q[0] = p[0];+ p[0] = j;+ j = q[1];+ q[1] = p[1];+ p[1] = j;+ j = q[2];+ q[2] = p[2];+ p[2] = j;+ j = q[3];+ q[3] = p[3];+ p[3] = j;+ }+ if (smallval != previouscol) {+ netindex[previouscol] = startpos + i >> 1;+ for (j = previouscol + 1; j < smallval; j++) {+ netindex[j] = i;+ }+ previouscol = smallval;+ startpos = i;+ }+ }+ netindex[previouscol] = startpos + maxnetpos >> 1;+ for (j = previouscol + 1; j < 256; j++) {+ netindex[j] = maxnetpos;+ }+ }+ function learn() {+ var i;+ var j;+ var b;+ var g;+ var r;+ var radius;+ var rad;+ var alpha;+ var step;+ var delta;+ var samplepixels;+ var p;+ var pix;+ var lim;+ if (lengthcount < minpicturebytes) {+ samplefac = 1;+ }+ alphadec = 30 + (samplefac - 1) / 3;+ p = thepicture;+ pix = 0;+ lim = lengthcount;+ samplepixels = lengthcount / (3 * samplefac);+ delta = samplepixels / ncycles | 0;+ alpha = initalpha;+ radius = initradius;+ rad = radius >> radiusbiasshift;+ if (rad <= 1) {+ rad = 0;+ }+ for (i = 0; i < rad; i++) {+ radpower[i] = alpha * ((rad * rad - i * i) * radbias / (rad * rad));+ }+ if (lengthcount < minpicturebytes) {+ step = 3;+ } else if (lengthcount % prime1 !== 0) {+ step = 3 * prime1;+ } else {+ if (lengthcount % prime2 !== 0) {+ step = 3 * prime2;+ } else {+ if (lengthcount % prime3 !== 0) {+ step = 3 * prime3;+ } else {+ step = 3 * prime4;+ }+ }+ }+ i = 0;+ while (i < samplepixels) {+ b = (p[pix + 0] & 255) << netbiasshift;+ g = (p[pix + 1] & 255) << netbiasshift;+ r = (p[pix + 2] & 255) << netbiasshift;+ j = contest(b, g, r);+ altersingle(alpha, j, b, g, r);+ if (rad !== 0) {+ alterneigh(rad, j, b, g, r);+ }+ pix += step;+ if (pix >= lim) {+ pix -= lengthcount;+ }+ i++;+ if (delta === 0) {+ delta = 1;+ }+ if (i % delta === 0) {+ alpha -= alpha / alphadec;+ radius -= radius / radiusdec;+ rad = radius >> radiusbiasshift;+ if (rad <= 1) {+ rad = 0;+ }+ for (j = 0; j < rad; j++) {+ radpower[j] = alpha * ((rad * rad - j * j) * radbias / (rad * rad));+ }+ }+ }+ }+ function map(b, g, r) {+ var i;+ var j;+ var dist;+ var a;+ var bestd;+ var p;+ var best;+ bestd = 1000;+ best = -1;+ i = netindex[g];+ j = i - 1;+ while (i < netsize || j >= 0) {+ if (i < netsize) {+ p = network[i];+ dist = p[1] - g;+ if (dist >= bestd) {+ i = netsize;+ } else {+ i++;+ if (dist < 0) {+ dist = -dist;+ }+ a = p[0] - b;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ if (dist < bestd) {+ a = p[2] - r;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ if (dist < bestd) {+ bestd = dist;+ best = p[3];+ }+ }+ }+ }+ if (j >= 0) {+ p = network[j];+ dist = g - p[1];+ if (dist >= bestd) {+ j = -1;+ } else {+ j--;+ if (dist < 0) {+ dist = -dist;+ }+ a = p[0] - b;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ if (dist < bestd) {+ a = p[2] - r;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ if (dist < bestd) {+ bestd = dist;+ best = p[3];+ }+ }+ }+ }+ }+ return best;+ }+ function process() {+ learn();+ unbiasnet();+ inxbuild();+ return colorMap();+ }+ function unbiasnet() {+ var i;+ var j;+ for (i = 0; i < netsize; i++) {+ network[i][0] >>= netbiasshift;+ network[i][1] >>= netbiasshift;+ network[i][2] >>= netbiasshift;+ network[i][3] = i;+ }+ }+ function alterneigh(rad, i, b, g, r) {+ var j;+ var k;+ var lo;+ var hi;+ var a;+ var m;+ var p;+ lo = i - rad;+ if (lo < -1) {+ lo = -1;+ }+ hi = i + rad;+ if (hi > netsize) {+ hi = netsize;+ }+ j = i + 1;+ k = i - 1;+ m = 1;+ while (j < hi || k > lo) {+ a = radpower[m++];+ if (j < hi) {+ p = network[j++];+ try {+ p[0] -= a * (p[0] - b) / alpharadbias | 0;+ p[1] -= a * (p[1] - g) / alpharadbias | 0;+ p[2] -= a * (p[2] - r) / alpharadbias | 0;+ } catch (e) {+ }+ }+ if (k > lo) {+ p = network[k--];+ try {+ p[0] -= a * (p[0] - b) / alpharadbias | 0;+ p[1] -= a * (p[1] - g) / alpharadbias | 0;+ p[2] -= a * (p[2] - r) / alpharadbias | 0;+ } catch (e) {+ }+ }+ }+ }+ function altersingle(alpha, i, b, g, r) {+ var n = network[i];+ var alphaMult = alpha / initalpha;+ n[0] -= alphaMult * (n[0] - b) | 0;+ n[1] -= alphaMult * (n[1] - g) | 0;+ n[2] -= alphaMult * (n[2] - r) | 0;+ }+ function contest(b, g, r) {+ var i;+ var dist;+ var a;+ var biasdist;+ var betafreq;+ var bestpos;+ var bestbiaspos;+ var bestd;+ var bestbiasd;+ var n;+ bestd = ~(1 << 31);+ bestbiasd = bestd;+ bestpos = -1;+ bestbiaspos = bestpos;+ for (i = 0; i < netsize; i++) {+ n = network[i];+ dist = n[0] - b;+ if (dist < 0) {+ dist = -dist;+ }+ a = n[1] - g;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ a = n[2] - r;+ if (a < 0) {+ a = -a;+ }+ dist += a;+ if (dist < bestd) {+ bestd = dist;+ bestpos = i;+ }+ biasdist = dist - (bias[i] >> intbiasshift - netbiasshift);+ if (biasdist < bestbiasd) {+ bestbiasd = biasdist;+ bestbiaspos = i;+ }+ betafreq = freq[i] >> betashift;+ freq[i] -= betafreq;+ bias[i] += betafreq << gammashift;+ }+ freq[bestpos] += beta;+ bias[bestpos] -= betagamma;+ return bestbiaspos;+ }+ NeuQuantConstructor.apply(this, arguments);+ var exports = {};+ exports.map = map;+ exports.process = process;+ return exports;+ }+ return NeuQuant;+}();+processFrameWorker = function (NeuQuant) {+ var workerCode = function () {+ try {+ self.onmessage = function (ev) {+ var data = ev.data || {};+ var response;+ if (data.gifshot) {+ response = workerMethods.run(data);+ postMessage(response);+ }+ };+ } catch (e) {+ }+ var workerMethods = {+ 'dataToRGB': function (data, width, height) {+ var i = 0, length = width * height * 4, rgb = [];+ while (i < length) {+ rgb.push(data[i++]);+ rgb.push(data[i++]);+ rgb.push(data[i++]);+ i++;+ }+ return rgb;+ },+ 'componentizedPaletteToArray': function (paletteRGB) {+ var paletteArray = [], i, r, g, b;+ for (i = 0; i < paletteRGB.length; i += 3) {+ r = paletteRGB[i];+ g = paletteRGB[i + 1];+ b = paletteRGB[i + 2];+ paletteArray.push(r << 16 | g << 8 | b);+ }+ return paletteArray;+ },+ 'processFrameWithQuantizer': function (imageData, width, height, sampleInterval) {+ var rgbComponents = this.dataToRGB(imageData, width, height), nq = new NeuQuant(rgbComponents, rgbComponents.length, sampleInterval), paletteRGB = nq.process(), paletteArray = new Uint32Array(this.componentizedPaletteToArray(paletteRGB)), numberPixels = width * height, indexedPixels = new Uint8Array(numberPixels), k = 0, i, r, g, b;+ for (i = 0; i < numberPixels; i++) {+ r = rgbComponents[k++];+ g = rgbComponents[k++];+ b = rgbComponents[k++];+ indexedPixels[i] = nq.map(r, g, b);+ }+ return {+ pixels: indexedPixels,+ palette: paletteArray+ };+ },+ 'run': function (frame) {+ var width = frame.width, height = frame.height, imageData = frame.data, palette = frame.palette, sampleInterval = frame.sampleInterval;+ return this.processFrameWithQuantizer(imageData, width, height, sampleInterval);+ }+ };+ return workerMethods;+ };+ return workerCode;+}(NeuQuant);+gifWriter = function gifWriter(buf, width, height, gopts) {+ var p = 0;+ gopts = gopts === undefined ? {} : gopts;+ var loop_count = gopts.loop === undefined ? null : gopts.loop;+ var global_palette = gopts.palette === undefined ? null : gopts.palette;+ if (width <= 0 || height <= 0 || width > 65535 || height > 65535)+ throw 'Width/Height invalid.';+ function check_palette_and_num_colors(palette) {+ var num_colors = palette.length;+ if (num_colors < 2 || num_colors > 256 || num_colors & num_colors - 1)+ throw 'Invalid code/color length, must be power of 2 and 2 .. 256.';+ return num_colors;+ }+ buf[p++] = 71;+ buf[p++] = 73;+ buf[p++] = 70;+ buf[p++] = 56;+ buf[p++] = 57;+ buf[p++] = 97;+ var gp_num_colors_pow2 = 0;+ var background = 0;+ buf[p++] = width & 255;+ buf[p++] = width >> 8 & 255;+ buf[p++] = height & 255;+ buf[p++] = height >> 8 & 255;+ buf[p++] = (global_palette !== null ? 128 : 0) | gp_num_colors_pow2;+ buf[p++] = background;+ buf[p++] = 0;+ if (loop_count !== null) {+ if (loop_count < 0 || loop_count > 65535)+ throw 'Loop count invalid.';+ buf[p++] = 33;+ buf[p++] = 255;+ buf[p++] = 11;+ buf[p++] = 78;+ buf[p++] = 69;+ buf[p++] = 84;+ buf[p++] = 83;+ buf[p++] = 67;+ buf[p++] = 65;+ buf[p++] = 80;+ buf[p++] = 69;+ buf[p++] = 50;+ buf[p++] = 46;+ buf[p++] = 48;+ buf[p++] = 3;+ buf[p++] = 1;+ buf[p++] = loop_count & 255;+ buf[p++] = loop_count >> 8 & 255;+ buf[p++] = 0;+ }+ var ended = false;+ this.addFrame = function (x, y, w, h, indexed_pixels, opts) {+ if (ended === true) {+ --p;+ ended = false;+ }+ opts = opts === undefined ? {} : opts;+ if (x < 0 || y < 0 || x > 65535 || y > 65535)+ throw 'x/y invalid.';+ if (w <= 0 || h <= 0 || w > 65535 || h > 65535)+ throw 'Width/Height invalid.';+ if (indexed_pixels.length < w * h)+ throw 'Not enough pixels for the frame size.';+ var using_local_palette = true;+ var palette = opts.palette;+ if (palette === undefined || palette === null) {+ using_local_palette = false;+ palette = global_palette;+ }+ if (palette === undefined || palette === null)+ throw 'Must supply either a local or global palette.';+ var num_colors = check_palette_and_num_colors(palette);+ var min_code_size = 0;+ while (num_colors >>= 1)+ ++min_code_size;+ num_colors = 1 << min_code_size;+ var delay = opts.delay === undefined ? 0 : opts.delay;+ var disposal = opts.disposal === undefined ? 0 : opts.disposal;+ if (disposal < 0 || disposal > 3)+ throw 'Disposal out of range.';+ var use_transparency = false;+ var transparent_index = 0;+ if (opts.transparent !== undefined && opts.transparent !== null) {+ use_transparency = true;+ transparent_index = opts.transparent;+ if (transparent_index < 0 || transparent_index >= num_colors)+ throw 'Transparent color index.';+ }+ if (disposal !== 0 || use_transparency || delay !== 0) {+ buf[p++] = 33;+ buf[p++] = 249;+ buf[p++] = 4;+ buf[p++] = disposal << 2 | (use_transparency === true ? 1 : 0);+ buf[p++] = delay & 255;+ buf[p++] = delay >> 8 & 255;+ buf[p++] = transparent_index;+ buf[p++] = 0;+ }+ buf[p++] = 44;+ buf[p++] = x & 255;+ buf[p++] = x >> 8 & 255;+ buf[p++] = y & 255;+ buf[p++] = y >> 8 & 255;+ buf[p++] = w & 255;+ buf[p++] = w >> 8 & 255;+ buf[p++] = h & 255;+ buf[p++] = h >> 8 & 255;+ buf[p++] = using_local_palette === true ? 128 | min_code_size - 1 : 0;+ if (using_local_palette === true) {+ for (var i = 0, il = palette.length; i < il; ++i) {+ var rgb = palette[i];+ buf[p++] = rgb >> 16 & 255;+ buf[p++] = rgb >> 8 & 255;+ buf[p++] = rgb & 255;+ }+ }+ p = GifWriterOutputLZWCodeStream(buf, p, min_code_size < 2 ? 2 : min_code_size, indexed_pixels);+ };+ this.end = function () {+ if (ended === false) {+ buf[p++] = 59;+ ended = true;+ }+ return p;+ };+ function GifWriterOutputLZWCodeStream(buf, p, min_code_size, index_stream) {+ buf[p++] = min_code_size;+ var cur_subblock = p++;+ var clear_code = 1 << min_code_size;+ var code_mask = clear_code - 1;+ var eoi_code = clear_code + 1;+ var next_code = eoi_code + 1;+ var cur_code_size = min_code_size + 1;+ var cur_shift = 0;+ var cur = 0;+ function emit_bytes_to_buffer(bit_block_size) {+ while (cur_shift >= bit_block_size) {+ buf[p++] = cur & 255;+ cur >>= 8;+ cur_shift -= 8;+ if (p === cur_subblock + 256) {+ buf[cur_subblock] = 255;+ cur_subblock = p++;+ }+ }+ }+ function emit_code(c) {+ cur |= c << cur_shift;+ cur_shift += cur_code_size;+ emit_bytes_to_buffer(8);+ }+ var ib_code = index_stream[0] & code_mask;+ var code_table = {};+ emit_code(clear_code);+ for (var i = 1, il = index_stream.length; i < il; ++i) {+ var k = index_stream[i] & code_mask;+ var cur_key = ib_code << 8 | k;+ var cur_code = code_table[cur_key];+ if (cur_code === undefined) {+ cur |= ib_code << cur_shift;+ cur_shift += cur_code_size;+ while (cur_shift >= 8) {+ buf[p++] = cur & 255;+ cur >>= 8;+ cur_shift -= 8;+ if (p === cur_subblock + 256) {+ buf[cur_subblock] = 255;+ cur_subblock = p++;+ }+ }+ if (next_code === 4096) {+ emit_code(clear_code);+ next_code = eoi_code + 1;+ cur_code_size = min_code_size + 1;+ code_table = {};+ } else {+ if (next_code >= 1 << cur_code_size)+ ++cur_code_size;+ code_table[cur_key] = next_code++;+ }+ ib_code = k;+ } else {+ ib_code = cur_code;+ }+ }+ emit_code(ib_code);+ emit_code(eoi_code);+ emit_bytes_to_buffer(1);+ if (cur_subblock + 1 === p) {+ buf[cur_subblock] = 0;+ } else {+ buf[cur_subblock] = p - cur_subblock - 1;+ buf[p++] = 0;+ }+ return p;+ }+};+AnimatedGIF = function (utils, frameWorkerCode, NeuQuant, GifWriter) {+ var AnimatedGIF = function (options) {+ this.canvas = null;+ this.ctx = null;+ this.repeat = 0;+ this.frames = [];+ this.numRenderedFrames = 0;+ this.onRenderCompleteCallback = utils.noop;+ this.onRenderProgressCallback = utils.noop;+ this.workers = [];+ this.availableWorkers = [];+ this.generatingGIF = false;+ this.options = options;+ this.initializeWebWorkers(options);+ };+ AnimatedGIF.prototype = {+ 'workerMethods': frameWorkerCode(),+ 'initializeWebWorkers': function (options) {+ var processFrameWorkerCode = NeuQuant.toString() + '(' + frameWorkerCode.toString() + '());', webWorkerObj, objectUrl, webWorker, numWorkers, x = -1, workerError = '';+ numWorkers = options.numWorkers;+ while (++x < numWorkers) {+ webWorkerObj = utils.createWebWorker(processFrameWorkerCode);+ if (utils.isObject(webWorkerObj)) {+ objectUrl = webWorkerObj.objectUrl;+ webWorker = webWorkerObj.worker;+ this.workers.push({+ 'worker': webWorker,+ 'objectUrl': objectUrl+ });+ this.availableWorkers.push(webWorker);+ } else {+ workerError = webWorkerObj;+ utils.webWorkerError = !!webWorkerObj;+ }+ }+ this.workerError = workerError;+ this.canvas = document.createElement('canvas');+ this.canvas.width = options.gifWidth;+ this.canvas.height = options.gifHeight;+ this.ctx = this.canvas.getContext('2d');+ this.frames = [];+ },+ 'getWorker': function () {+ return this.availableWorkers.pop();+ },+ 'freeWorker': function (worker) {+ this.availableWorkers.push(worker);+ },+ 'byteMap': function () {+ var byteMap = [];+ for (var i = 0; i < 256; i++) {+ byteMap[i] = String.fromCharCode(i);+ }+ return byteMap;+ }(),+ 'bufferToString': function (buffer) {+ var numberValues = buffer.length, str = '', x = -1;+ while (++x < numberValues) {+ str += this.byteMap[buffer[x]];+ }+ return str;+ },+ 'onFrameFinished': function (progressCallback) {+ var self = this, frames = self.frames, options = self.options;+ hasExistingImages = !!(options.images || []).length;+ allDone = frames.every(function (frame) {+ return !frame.beingProcessed && frame.done;+ });+ self.numRenderedFrames++;+ if (hasExistingImages) {+ progressCallback(self.numRenderedFrames / frames.length);+ }+ self.onRenderProgressCallback(self.numRenderedFrames * 0.75 / frames.length);+ if (allDone) {+ if (!self.generatingGIF) {+ self.generateGIF(frames, self.onRenderCompleteCallback);+ }+ } else {+ utils.requestTimeout(function () {+ self.processNextFrame();+ }, 1);+ }+ },+ 'processFrame': function (position) {+ var AnimatedGifContext = this, options = this.options, progressCallback = options.progressCallback, sampleInterval = options.sampleInterval, frames = this.frames, frame, worker, done = function (ev) {+ var data = ev.data;+ delete frame.data;+ frame.pixels = Array.prototype.slice.call(data.pixels);+ frame.palette = Array.prototype.slice.call(data.palette);+ frame.done = true;+ frame.beingProcessed = false;+ AnimatedGifContext.freeWorker(worker);+ AnimatedGifContext.onFrameFinished(progressCallback);+ };+ frame = frames[position];+ if (frame.beingProcessed || frame.done) {+ this.onFrameFinished();+ return;+ }+ frame.sampleInterval = sampleInterval;+ frame.beingProcessed = true;+ frame.gifshot = true;+ worker = this.getWorker();+ if (worker) {+ worker.onmessage = done;+ worker.postMessage(frame);+ } else {+ done({ 'data': AnimatedGifContext.workerMethods.run(frame) });+ }+ },+ 'startRendering': function (completeCallback) {+ this.onRenderCompleteCallback = completeCallback;+ for (var i = 0; i < this.options.numWorkers && i < this.frames.length; i++) {+ this.processFrame(i);+ }+ },+ 'processNextFrame': function () {+ var position = -1;+ for (var i = 0; i < this.frames.length; i++) {+ var frame = this.frames[i];+ if (!frame.done && !frame.beingProcessed) {+ position = i;+ break;+ }+ }+ if (position >= 0) {+ this.processFrame(position);+ }+ },+ 'generateGIF': function (frames, callback) {+ var buffer = [], gifOptions = { 'loop': this.repeat }, options = this.options, interval = options.interval, existingImages = options.images, hasExistingImages = !!existingImages.length, height = options.gifHeight, width = options.gifWidth, gifWriter = new GifWriter(buffer, width, height, gifOptions), onRenderProgressCallback = this.onRenderProgressCallback, delay = hasExistingImages ? interval * 100 : 0, bufferToString, gif;+ this.generatingGIF = true;+ utils.each(frames, function (iterator, frame) {+ var framePalette = frame.palette;+ onRenderProgressCallback(0.75 + 0.25 * frame.position * 1 / frames.length);+ gifWriter.addFrame(0, 0, width, height, frame.pixels, {+ palette: framePalette,+ delay: delay+ });+ });+ gifWriter.end();+ onRenderProgressCallback(1);+ this.frames = [];+ this.generatingGIF = false;+ if (utils.isFunction(callback)) {+ bufferToString = this.bufferToString(buffer);+ gif = 'data:image/gif;base64,' + utils.btoa(bufferToString);+ callback(gif);+ }+ },+ 'setRepeat': function (r) {+ this.repeat = r;+ },+ 'addFrame': function (element, gifshotOptions, frameText) {+ gifshotOptions = utils.isObject(gifshotOptions) ? gifshotOptions : {};+ var self = this, ctx = self.ctx, options = self.options, width = options.gifWidth, height = options.gifHeight, stamp = options.stamp, stampHeight = 26, stampWidth = stampHeight / 0.192, gifHeight = gifshotOptions.gifHeight, gifWidth = gifshotOptions.gifWidth, text = gifshotOptions.text, fontWeight = gifshotOptions.fontWeight, fontSize = utils.getFontSize(gifshotOptions), fontFamily = gifshotOptions.fontFamily, fontColor = gifshotOptions.fontColor, textAlign = gifshotOptions.textAlign, textBaseline = gifshotOptions.textBaseline, textXCoordinate = gifshotOptions.textXCoordinate ? gifshotOptions.textXCoordinate : textAlign === 'left' ? 1 : textAlign === 'right' ? width - 7 : width / 2, textYCoordinate = gifshotOptions.textYCoordinate ? gifshotOptions.textYCoordinate : textBaseline === 'top' ? 7 : textBaseline === 'center' ? height / 2 : height, font = fontWeight + ' ' + fontSize + ' ' + fontFamily, imageData, stroke;+ if (width < 250) {+ if (width < 90) {+ stamp = null;+ frameText = null;+ } else if (height < 50) {+ stamp = null;+ } else {+ textXCoordinate = 90;+ textYCoordinate = height - 30;+ }+ }+ try {+ ctx.drawImage(element, 0, 0, width, height);+ if (stamp && stampWidth > 80) {+ ctx.drawImage(stamp, 2.5, 2.5);+ }+ if (text || frameText) {+ ctx.font = font;+ ctx.fillStyle = fontColor;+ ctx.textAlign = textAlign;+ ctx.textBaseline = textBaseline;+ if (gifshotOptions.stroke && frameText) {+ stroke = gifshotOptions.stroke;+ ctx.strokeStyle = stroke.color;+ ctx.lineWidth = stroke.pixels * 2;+ ctx.strokeText(frameText, textXCoordinate, textYCoordinate);+ }+ if (frameText) {+ ctx.fillText(frameText, textXCoordinate, textYCoordinate);+ } else {+ ctx.fillText(text, textXCoordinate, textYCoordinate);+ }+ }+ imageData = ctx.getImageData(0, 0, width, height);+ self.addFrameImageData(imageData);+ } catch (e) {+ return '' + e;+ }+ },+ 'addFrameImageData': function (imageData) {+ var frames = this.frames, imageDataArray = imageData.data;+ this.frames.push({+ 'data': imageDataArray,+ 'width': imageData.width,+ 'height': imageData.height,+ 'palette': null,+ 'dithering': null,+ 'done': false,+ 'beingProcessed': false,+ 'position': frames.length+ });+ },+ 'onRenderProgress': function (callback) {+ this.onRenderProgressCallback = callback;+ },+ 'isRendering': function () {+ return this.generatingGIF;+ },+ 'getBase64GIF': function (completeCallback) {+ var self = this, onRenderComplete = function (gif) {+ self.destroyWorkers();+ utils.requestTimeout(function () {+ completeCallback(gif);+ }, 0);+ };+ self.startRendering(onRenderComplete);+ },+ 'destroyWorkers': function () {+ if (this.workerError) {+ return;+ }+ var workers = this.workers;+ utils.each(workers, function (iterator, workerObj) {+ var worker = workerObj.worker, objectUrl = workerObj.objectUrl;+ worker.terminate();+ utils.URL.revokeObjectURL(objectUrl);+ });+ }+ };+ return AnimatedGIF;+}(utils, processFrameWorker, NeuQuant, gifWriter);+getBase64GIF = function getBase64GIF(animatedGifInstance, callback) {+ animatedGifInstance.getBase64GIF(function (image) {+ callback({+ 'error': false,+ 'errorCode': '',+ 'errorMsg': '',+ 'image': image+ });+ });+};+existingImages = function (obj) {+ var images = obj.images, imagesLength = obj.imagesLength, callback = obj.callback, options = obj.options, skipObj = {+ 'getUserMedia': true,+ 'window.URL': true+ }, errorObj = error.validate(skipObj), loadedImages = [], loadedImagesLength = 0, tempImage, self = this, ag;+ if (errorObj.error) {+ return callback(errorObj);+ }+ ag = new AnimatedGIF(options);+ utils.each(images, function (index, image) {+ var currentImage = image;+ if (image.src) {+ currentImage = currentImage.src;+ }+ if (utils.isElement(currentImage)) {+ if (options.crossOrigin) {+ currentImage.crossOrigin = options.crossOrigin;+ }+ loadedImages[index] = currentImage;+ loadedImagesLength += 1;+ if (loadedImagesLength === imagesLength) {+ addLoadedImagesToGif();+ }+ } else if (utils.isString(currentImage)) {+ tempImage = new Image();+ if (options.crossOrigin) {+ tempImage.crossOrigin = options.crossOrigin;+ }+ (function (tempImage) {+ if (image.text) {+ tempImage.text = image.text;+ }+ tempImage.onerror = function (e) {+ var error;+ --imagesLength;+ if (imagesLength === 0) {+ error = {};+ error.error = 'None of the requested images was capable of being retrieved';+ return callback(error);+ }+ if (loadedImagesLength === imagesLength) {+ if (obj.options.pause) {+ addPauseFrames(obj.options);+ }+ addLoadedImagesToGif();+ }+ };+ tempImage.onload = function (e) {+ if (image.text) {+ loadedImages[index] = {+ img: tempImage,+ text: tempImage.text+ };+ } else {+ loadedImages[index] = tempImage;+ }+ loadedImagesLength += 1;+ if (loadedImagesLength === imagesLength) {+ if (obj.options.pause) {+ addPauseFrames(obj.options);+ }+ addLoadedImagesToGif();+ }+ utils.removeElement(tempImage);+ };+ tempImage.src = currentImage;+ }(tempImage));+ utils.setCSSAttr(tempImage, {+ 'position': 'fixed',+ 'opacity': '0'+ });+ document.body.appendChild(tempImage);+ }+ });+ function addPauseFrames(options) {+ var speed = 1 / options.interval;+ var len = speed * options.pause;+ var lastImage = loadedImages[loadedImages.length - 1];+ for (var i = 0; i < len; i++) {+ loadedImages.push(lastImage);+ }+ }+ function addLoadedImagesToGif() {+ utils.each(loadedImages, function (index, loadedImage) {+ if (loadedImage) {+ if (loadedImage.text) {+ ag.addFrame(loadedImage.img, options, loadedImage.text);+ } else {+ ag.addFrame(loadedImage, options);+ }+ }+ });+ getBase64GIF(ag, callback);+ }+};+screenShot = {+ getGIF: function (options, callback) {+ callback = utils.isFunction(callback) ? callback : utils.noop;+ var canvas = document.createElement('canvas'), context, existingImages = options.images, hasExistingImages = !!existingImages.length, videoElement = options.videoElement, keepCameraOn = options.keepCameraOn, webcamVideoElement = options.webcamVideoElement, cameraStream = options.cameraStream, gifWidth = +options.gifWidth, gifHeight = +options.gifHeight, videoWidth = options.videoWidth, videoHeight = options.videoHeight, sampleInterval = +options.sampleInterval, numWorkers = +options.numWorkers, crop = options.crop, interval = +options.interval, waitBetweenFrames = hasExistingImages ? 0 : interval * 1000, progressCallback = options.progressCallback, savedRenderingContexts = options.savedRenderingContexts, saveRenderingContexts = options.saveRenderingContexts, renderingContextsToSave = [], numFrames = savedRenderingContexts.length ? savedRenderingContexts.length : options.numFrames, pendingFrames = numFrames, ag = new AnimatedGIF(options), text = options.text, fontWeight = options.fontWeight, fontSize = utils.getFontSize(options), fontFamily = options.fontFamily, fontColor = options.fontColor, textAlign = options.textAlign, textBaseline = options.textBaseline, textXCoordinate = options.textXCoordinate ? options.textXCoordinate : textAlign === 'left' ? 1 : textAlign === 'right' ? gifWidth : gifWidth / 2, textYCoordinate = options.textYCoordinate ? options.textYCoordinate : textBaseline === 'top' ? 1 : textBaseline === 'center' ? gifHeight / 2 : gifHeight, font = fontWeight + ' ' + fontSize + ' ' + fontFamily, sourceX = crop ? Math.floor(crop.scaledWidth / 2) : 0, sourceWidth = crop ? videoWidth - crop.scaledWidth : 0, sourceY = crop ? Math.floor(crop.scaledHeight / 2) : 0, sourceHeight = crop ? videoHeight - crop.scaledHeight : 0, captureFrames = function captureFrame() {+ var framesLeft = pendingFrames - 1;+ if (savedRenderingContexts.length) {+ context.putImageData(savedRenderingContexts[numFrames - pendingFrames], 0, 0);+ finishCapture();+ } else {+ drawVideo();+ }+ function drawVideo() {+ try {+ if (sourceWidth > videoWidth) {+ sourceWidth = videoWidth;+ }+ if (sourceHeight > videoHeight) {+ sourceHeight = videoHeight;+ }+ if (sourceX < 0) {+ sourceX = 0;+ }+ if (sourceY < 0) {+ sourceY = 0;+ }+ context.drawImage(videoElement, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, gifWidth, gifHeight);+ finishCapture();+ } catch (e) {+ if (e.name === 'NS_ERROR_NOT_AVAILABLE') {+ utils.requestTimeout(drawVideo, 100);+ } else {+ throw e;+ }+ }+ }+ function finishCapture() {+ pendingFrames = framesLeft;+ var processedFrames = numFrames - pendingFrames;+ var imageData;+ var data;+ var rgba;+ var isBlackFrame;+ if (saveRenderingContexts) {+ renderingContextsToSave.push(context.getImageData(0, 0, gifWidth, gifHeight));+ }+ if (text) {+ context.font = font;+ context.fillStyle = fontColor;+ context.textAlign = textAlign;+ context.textBaseline = textBaseline;+ context.fillText(text, textXCoordinate, textYCoordinate);+ }+ imageData = context.getImageData(0, 0, gifWidth, gifHeight);+ data = imageData.data;+ rgba = data[0] + data[1] + data[2] + data[3];+ isBlackFrame = rgba === 0;+ if (!isBlackFrame) {+ ag.addFrameImageData(imageData);+ } else if (processedFrames === 1 && numFrames === 1) {+ drawVideo();+ }+ progressCallback(processedFrames / numFrames);+ if (framesLeft > 0) {+ utils.requestTimeout(captureFrame, waitBetweenFrames);+ }+ if (!pendingFrames) {+ ag.getBase64GIF(function (image) {+ callback({+ 'error': false,+ 'errorCode': '',+ 'errorMsg': '',+ 'image': image,+ 'cameraStream': cameraStream,+ 'videoElement': videoElement,+ 'webcamVideoElement': webcamVideoElement,+ 'savedRenderingContexts': renderingContextsToSave,+ 'keepCameraOn': keepCameraOn+ });+ });+ }+ }+ };+ numFrames = numFrames != null ? numFrames : 10;+ interval = interval != null ? interval : 0.1;+ canvas.width = gifWidth;+ canvas.height = gifHeight;+ context = canvas.getContext('2d');+ (function capture() {+ if (!savedRenderingContexts.length && videoElement.currentTime === 0) {+ utils.requestTimeout(capture, 100);+ return;+ }+ captureFrames();+ }());+ },+ 'getCropDimensions': function (obj) {+ var width = obj.videoWidth, height = obj.videoHeight, gifWidth = obj.gifWidth, gifHeight = obj.gifHeight, result = {+ width: 0,+ height: 0,+ scaledWidth: 0,+ scaledHeight: 0+ };+ if (width > height) {+ result.width = Math.round(width * (gifHeight / height)) - gifWidth;+ result.scaledWidth = Math.round(result.width * (height / gifHeight));+ } else {+ result.height = Math.round(height * (gifWidth / width)) - gifHeight;+ result.scaledHeight = Math.round(result.height * (width / gifWidth));+ }+ return result;+ }+};+createAndGetGIF = function (obj, callback) {+ var options = obj.options || {}, images = options.images, video = options.video, numFrames = +options.numFrames, cameraStream = obj.cameraStream, videoElement = obj.videoElement, videoWidth = obj.videoWidth, videoHeight = obj.videoHeight, gifWidth = +options.gifWidth, gifHeight = +options.gifHeight, cropDimensions = screenShot.getCropDimensions({+ 'videoWidth': videoWidth,+ 'videoHeight': videoHeight,+ 'gifHeight': gifHeight,+ 'gifWidth': gifWidth+ }), completeCallback = callback;+ options.crop = cropDimensions;+ options.videoElement = videoElement;+ options.videoWidth = videoWidth;+ options.videoHeight = videoHeight;+ options.cameraStream = cameraStream;+ if (!utils.isElement(videoElement)) {+ return;+ }+ videoElement.width = gifWidth + cropDimensions.width;+ videoElement.height = gifHeight + cropDimensions.height;+ if (!options.webcamVideoElement) {+ utils.setCSSAttr(videoElement, {+ 'position': 'fixed',+ 'opacity': '0'+ });+ document.body.appendChild(videoElement);+ }+ videoElement.play();+ screenShot.getGIF(options, function (obj) {+ if ((!images || !images.length) && (!video || !video.length)) {+ stopVideoStreaming(obj);+ }+ completeCallback(obj);+ });+};+createGIF = function (userOptions, callback) {+ callback = utils.isFunction(userOptions) ? userOptions : callback;+ userOptions = utils.isObject(userOptions) ? userOptions : {};+ if (!utils.isFunction(callback)) {+ return;+ }+ var options = utils.mergeOptions(defaultOptions, userOptions) || {}, lastCameraStream = userOptions.cameraStream, images = options.images, imagesLength = images ? images.length : 0, video = options.video, webcamVideoElement = options.webcamVideoElement;+ options = utils.mergeOptions(options, {+ 'gifWidth': Math.floor(options.gifWidth),+ 'gifHeight': Math.floor(options.gifHeight)+ });+ if (imagesLength) {+ existingImages({+ 'images': images,+ 'imagesLength': imagesLength,+ 'callback': callback,+ 'options': options+ });+ } else if (video) {+ existingVideo({+ 'existingVideo': video,+ 'callback': callback,+ 'options': options+ });+ } else {+ existingWebcam({+ 'lastCameraStream': lastCameraStream,+ 'callback': callback,+ 'webcamVideoElement': webcamVideoElement,+ 'options': options+ });+ }+};+takeSnapShot = function (userOptions, callback) {+ callback = utils.isFunction(userOptions) ? userOptions : callback;+ userOptions = utils.isObject(userOptions) ? userOptions : {};+ if (!utils.isFunction(callback)) {+ return;+ }+ var mergedOptions = utils.mergeOptions(defaultOptions, userOptions), options = utils.mergeOptions(mergedOptions, {+ 'interval': 0.1,+ 'numFrames': 1,+ 'gifWidth': Math.floor(mergedOptions.gifWidth),+ 'gifHeight': Math.floor(mergedOptions.gifHeight)+ });+ createGIF(options, callback);+};+API = function (utils, error, defaultOptions, isSupported, isWebCamGIFSupported, isExistingImagesGIFSupported, isExistingVideoGIFSupported, createGIF, takeSnapShot, stopVideoStreaming) {+ var gifshot = {+ 'utils': utils,+ 'error': error,+ 'defaultOptions': defaultOptions,+ 'createGIF': createGIF,+ 'takeSnapShot': takeSnapShot,+ 'stopVideoStreaming': stopVideoStreaming,+ 'isSupported': isSupported,+ 'isWebCamGIFSupported': isWebCamGIFSupported,+ 'isExistingVideoGIFSupported': isExistingVideoGIFSupported,+ 'isExistingImagesGIFSupported': isExistingImagesGIFSupported,+ 'VERSION': '0.3.2'+ };+ return gifshot;+}(utils, error, defaultOptions, isSupported, isWebCamGIFSupported, isExistingImagesGIFSupported, isExistingVideoGIFSupported, createGIF, takeSnapShot, stopVideoStreaming);+(function (API) {+ if (typeof define === 'function' && define.amd) {+ define([], function () {+ return API;+ });+ } else if (typeof exports !== 'undefined') {+ module.exports = API;+ } else {+ window.gifshot = API;+ }+}(API));+}(typeof window !== "undefined" ? window : {}, typeof document !== "undefined" ? document : { createElement: function() {} }, typeof window !== "undefined" ? window.navigator : {}));\ No newline at end of filediff --git a/web/ext/node_modules/lodash/lodash.js b/web/ext/node_modules/lodash/lodash.jsnew file mode 100644index 000000000..b39ddce69--- /dev/null+++ b/web/ext/node_modules/lodash/lodash.js@@ -0,0 +1,17084 @@+/**+ * @license+ * Lodash <https://lodash.com/>+ * Copyright JS Foundation and other contributors <https://js.foundation/>+ * Released under MIT license <https://lodash.com/license>+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors+ */+;(function() {++ /** Used as a safe reference for `undefined` in pre-ES5 environments. */+ var undefined;++ /** Used as the semantic version number. */+ var VERSION = '4.17.4';++ /** Used as the size to enable large array optimizations. */+ var LARGE_ARRAY_SIZE = 200;++ /** Error message constants. */+ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',+ FUNC_ERROR_TEXT = 'Expected a function';++ /** Used to stand-in for `undefined` hash values. */+ var HASH_UNDEFINED = '__lodash_hash_undefined__';++ /** Used as the maximum memoize cache size. */+ var MAX_MEMOIZE_SIZE = 500;++ /** Used as the internal argument placeholder. */+ var PLACEHOLDER = '__lodash_placeholder__';++ /** Used to compose bitmasks for cloning. */+ var CLONE_DEEP_FLAG = 1,+ CLONE_FLAT_FLAG = 2,+ CLONE_SYMBOLS_FLAG = 4;++ /** Used to compose bitmasks for value comparisons. */+ var COMPARE_PARTIAL_FLAG = 1,+ COMPARE_UNORDERED_FLAG = 2;++ /** Used to compose bitmasks for function metadata. */+ var WRAP_BIND_FLAG = 1,+ WRAP_BIND_KEY_FLAG = 2,+ WRAP_CURRY_BOUND_FLAG = 4,+ WRAP_CURRY_FLAG = 8,+ WRAP_CURRY_RIGHT_FLAG = 16,+ WRAP_PARTIAL_FLAG = 32,+ WRAP_PARTIAL_RIGHT_FLAG = 64,+ WRAP_ARY_FLAG = 128,+ WRAP_REARG_FLAG = 256,+ WRAP_FLIP_FLAG = 512;++ /** Used as default options for `_.truncate`. */+ var DEFAULT_TRUNC_LENGTH = 30,+ DEFAULT_TRUNC_OMISSION = '...';++ /** Used to detect hot functions by number of calls within a span of milliseconds. */+ var HOT_COUNT = 800,+ HOT_SPAN = 16;++ /** Used to indicate the type of lazy iteratees. */+ var LAZY_FILTER_FLAG = 1,+ LAZY_MAP_FLAG = 2,+ LAZY_WHILE_FLAG = 3;++ /** Used as references for various `Number` constants. */+ var INFINITY = 1 / 0,+ MAX_SAFE_INTEGER = 9007199254740991,+ MAX_INTEGER = 1.7976931348623157e+308,+ NAN = 0 / 0;++ /** Used as references for the maximum length and index of an array. */+ var MAX_ARRAY_LENGTH = 4294967295,+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;++ /** Used to associate wrap methods with their bit flags. */+ var wrapFlags = [+ ['ary', WRAP_ARY_FLAG],+ ['bind', WRAP_BIND_FLAG],+ ['bindKey', WRAP_BIND_KEY_FLAG],+ ['curry', WRAP_CURRY_FLAG],+ ['curryRight', WRAP_CURRY_RIGHT_FLAG],+ ['flip', WRAP_FLIP_FLAG],+ ['partial', WRAP_PARTIAL_FLAG],+ ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],+ ['rearg', WRAP_REARG_FLAG]+ ];++ /** `Object#toString` result references. */+ var argsTag = '[object Arguments]',+ arrayTag = '[object Array]',+ asyncTag = '[object AsyncFunction]',+ boolTag = '[object Boolean]',+ dateTag = '[object Date]',+ domExcTag = '[object DOMException]',+ errorTag = '[object Error]',+ funcTag = '[object Function]',+ genTag = '[object GeneratorFunction]',+ mapTag = '[object Map]',+ numberTag = '[object Number]',+ nullTag = '[object Null]',+ objectTag = '[object Object]',+ promiseTag = '[object Promise]',+ proxyTag = '[object Proxy]',+ regexpTag = '[object RegExp]',+ setTag = '[object Set]',+ stringTag = '[object String]',+ symbolTag = '[object Symbol]',+ undefinedTag = '[object Undefined]',+ weakMapTag = '[object WeakMap]',+ weakSetTag = '[object WeakSet]';++ var arrayBufferTag = '[object ArrayBuffer]',+ dataViewTag = '[object DataView]',+ float32Tag = '[object Float32Array]',+ float64Tag = '[object Float64Array]',+ int8Tag = '[object Int8Array]',+ int16Tag = '[object Int16Array]',+ int32Tag = '[object Int32Array]',+ uint8Tag = '[object Uint8Array]',+ uint8ClampedTag = '[object Uint8ClampedArray]',+ uint16Tag = '[object Uint16Array]',+ uint32Tag = '[object Uint32Array]';++ /** Used to match empty string literals in compiled template source. */+ var reEmptyStringLeading = /\b__p \+= '';/g,+ reEmptyStringMiddle = /\b(__p \+=) '' \+/g,+ reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;++ /** Used to match HTML entities and HTML characters. */+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,+ reUnescapedHtml = /[&<>"']/g,+ reHasEscapedHtml = RegExp(reEscapedHtml.source),+ reHasUnescapedHtml = RegExp(reUnescapedHtml.source);++ /** Used to match template delimiters. */+ var reEscape = /<%-([\s\S]+?)%>/g,+ reEvaluate = /<%([\s\S]+?)%>/g,+ reInterpolate = /<%=([\s\S]+?)%>/g;++ /** Used to match property names within property paths. */+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,+ reIsPlainProp = /^\w*$/,+ reLeadingDot = /^\./,+ rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;++ /**+ * Used to match `RegExp`+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).+ */+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,+ reHasRegExpChar = RegExp(reRegExpChar.source);++ /** Used to match leading and trailing whitespace. */+ var reTrim = /^\s+|\s+$/g,+ reTrimStart = /^\s+/,+ reTrimEnd = /\s+$/;++ /** Used to match wrap detail comments. */+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,+ reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,+ reSplitDetails = /,? & /;++ /** Used to match words composed of alphanumeric characters. */+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;++ /** Used to match backslashes in property paths. */+ var reEscapeChar = /\\(\\)?/g;++ /**+ * Used to match+ * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).+ */+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;++ /** Used to match `RegExp` flags from their coerced string values. */+ var reFlags = /\w*$/;++ /** Used to detect bad signed hexadecimal string values. */+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;++ /** Used to detect binary string values. */+ var reIsBinary = /^0b[01]+$/i;++ /** Used to detect host constructors (Safari). */+ var reIsHostCtor = /^\[object .+?Constructor\]$/;++ /** Used to detect octal string values. */+ var reIsOctal = /^0o[0-7]+$/i;++ /** Used to detect unsigned integer values. */+ var reIsUint = /^(?:0|[1-9]\d*)$/;++ /** Used to match Latin Unicode letters (excluding mathematical operators). */+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;++ /** Used to ensure capturing order of template delimiters. */+ var reNoMatch = /($^)/;++ /** Used to match unescaped characters in compiled string literals. */+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;++ /** Used to compose unicode character classes. */+ var rsAstralRange = '\\ud800-\\udfff',+ rsComboMarksRange = '\\u0300-\\u036f',+ reComboHalfMarksRange = '\\ufe20-\\ufe2f',+ rsComboSymbolsRange = '\\u20d0-\\u20ff',+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,+ rsDingbatRange = '\\u2700-\\u27bf',+ rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',+ rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',+ rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',+ rsPunctuationRange = '\\u2000-\\u206f',+ rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',+ rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',+ rsVarRange = '\\ufe0e\\ufe0f',+ rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;++ /** Used to compose unicode capture groups. */+ var rsApos = "['\u2019]",+ rsAstral = '[' + rsAstralRange + ']',+ rsBreak = '[' + rsBreakRange + ']',+ rsCombo = '[' + rsComboRange + ']',+ rsDigits = '\\d+',+ rsDingbat = '[' + rsDingbatRange + ']',+ rsLower = '[' + rsLowerRange + ']',+ rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',+ rsFitz = '\\ud83c[\\udffb-\\udfff]',+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',+ rsNonAstral = '[^' + rsAstralRange + ']',+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',+ rsUpper = '[' + rsUpperRange + ']',+ rsZWJ = '\\u200d';++ /** Used to compose unicode regexes. */+ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',+ rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',+ rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',+ rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',+ reOptMod = rsModifier + '?',+ rsOptVar = '[' + rsVarRange + ']?',+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',+ rsOrdLower = '\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)',+ rsOrdUpper = '\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)',+ rsSeq = rsOptVar + reOptMod + rsOptJoin,+ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';++ /** Used to match apostrophes. */+ var reApos = RegExp(rsApos, 'g');++ /**+ * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and+ * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).+ */+ var reComboMark = RegExp(rsCombo, 'g');++ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */+ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');++ /** Used to match complex or compound words. */+ var reUnicodeWord = RegExp([+ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',+ rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',+ rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,+ rsUpper + '+' + rsOptContrUpper,+ rsOrdUpper,+ rsOrdLower,+ rsDigits,+ rsEmoji+ ].join('|'), 'g');++ /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */+ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');++ /** Used to detect strings that need a more robust regexp to match words. */+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;++ /** Used to assign default `context` object properties. */+ var contextProps = [+ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',+ 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',+ 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',+ 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',+ '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'+ ];++ /** Used to make template sourceURLs easier to identify. */+ var templateCounter = -1;++ /** Used to identify `toStringTag` values of typed arrays. */+ var typedArrayTags = {};+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =+ typedArrayTags[uint32Tag] = true;+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =+ typedArrayTags[setTag] = typedArrayTags[stringTag] =+ typedArrayTags[weakMapTag] = false;++ /** Used to identify `toStringTag` values supported by `_.clone`. */+ var cloneableTags = {};+ cloneableTags[argsTag] = cloneableTags[arrayTag] =+ cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =+ cloneableTags[boolTag] = cloneableTags[dateTag] =+ cloneableTags[float32Tag] = cloneableTags[float64Tag] =+ cloneableTags[int8Tag] = cloneableTags[int16Tag] =+ cloneableTags[int32Tag] = cloneableTags[mapTag] =+ cloneableTags[numberTag] = cloneableTags[objectTag] =+ cloneableTags[regexpTag] = cloneableTags[setTag] =+ cloneableTags[stringTag] = cloneableTags[symbolTag] =+ cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =+ cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;+ cloneableTags[errorTag] = cloneableTags[funcTag] =+ cloneableTags[weakMapTag] = false;++ /** Used to map Latin Unicode letters to basic Latin letters. */+ var deburredLetters = {+ // Latin-1 Supplement block.+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',+ '\xc7': 'C', '\xe7': 'c',+ '\xd0': 'D', '\xf0': 'd',+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',+ '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',+ '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',+ '\xd1': 'N', '\xf1': 'n',+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',+ '\xc6': 'Ae', '\xe6': 'ae',+ '\xde': 'Th', '\xfe': 'th',+ '\xdf': 'ss',+ // Latin Extended-A block.+ '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',+ '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',+ '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',+ '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',+ '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',+ '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',+ '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',+ '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',+ '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',+ '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',+ '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',+ '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',+ '\u0134': 'J', '\u0135': 'j',+ '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',+ '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',+ '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',+ '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',+ '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',+ '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',+ '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',+ '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',+ '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',+ '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',+ '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',+ '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',+ '\u0163': 't', '\u0165': 't', '\u0167': 't',+ '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',+ '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',+ '\u0174': 'W', '\u0175': 'w',+ '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',+ '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',+ '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',+ '\u0132': 'IJ', '\u0133': 'ij',+ '\u0152': 'Oe', '\u0153': 'oe',+ '\u0149': "'n", '\u017f': 's'+ };++ /** Used to map characters to HTML entities. */+ var htmlEscapes = {+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": '''+ };++ /** Used to map HTML entities to characters. */+ var htmlUnescapes = {+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ ''': "'"+ };++ /** Used to escape characters for inclusion in compiled string literals. */+ var stringEscapes = {+ '\\': '\\',+ "'": "'",+ '\n': 'n',+ '\r': 'r',+ '\u2028': 'u2028',+ '\u2029': 'u2029'+ };++ /** Built-in method references without a dependency on `root`. */+ var freeParseFloat = parseFloat,+ freeParseInt = parseInt;++ /** Detect free variable `global` from Node.js. */+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;++ /** Detect free variable `self`. */+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;++ /** Used as a reference to the global object. */+ var root = freeGlobal || freeSelf || Function('return this')();++ /** Detect free variable `exports`. */+ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;++ /** Detect free variable `module`. */+ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;++ /** Detect the popular CommonJS extension `module.exports`. */+ var moduleExports = freeModule && freeModule.exports === freeExports;++ /** Detect free variable `process` from Node.js. */+ var freeProcess = moduleExports && freeGlobal.process;++ /** Used to access faster Node.js helpers. */+ var nodeUtil = (function() {+ try {+ return freeProcess && freeProcess.binding && freeProcess.binding('util');+ } catch (e) {}+ }());++ /* Node.js helper references. */+ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,+ nodeIsDate = nodeUtil && nodeUtil.isDate,+ nodeIsMap = nodeUtil && nodeUtil.isMap,+ nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,+ nodeIsSet = nodeUtil && nodeUtil.isSet,+ nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;++ /*--------------------------------------------------------------------------*/++ /**+ * Adds the key-value `pair` to `map`.+ *+ * @private+ * @param {Object} map The map to modify.+ * @param {Array} pair The key-value pair to add.+ * @returns {Object} Returns `map`.+ */+ function addMapEntry(map, pair) {+ // Don't return `map.set` because it's not chainable in IE 11.+ map.set(pair[0], pair[1]);+ return map;+ }++ /**+ * Adds `value` to `set`.+ *+ * @private+ * @param {Object} set The set to modify.+ * @param {*} value The value to add.+ * @returns {Object} Returns `set`.+ */+ function addSetEntry(set, value) {+ // Don't return `set.add` because it's not chainable in IE 11.+ set.add(value);+ return set;+ }++ /**+ * A faster alternative to `Function#apply`, this function invokes `func`+ * with the `this` binding of `thisArg` and the arguments of `args`.+ *+ * @private+ * @param {Function} func The function to invoke.+ * @param {*} thisArg The `this` binding of `func`.+ * @param {Array} args The arguments to invoke `func` with.+ * @returns {*} Returns the result of `func`.+ */+ function apply(func, thisArg, args) {+ switch (args.length) {+ case 0: return func.call(thisArg);+ case 1: return func.call(thisArg, args[0]);+ case 2: return func.call(thisArg, args[0], args[1]);+ case 3: return func.call(thisArg, args[0], args[1], args[2]);+ }+ return func.apply(thisArg, args);+ }++ /**+ * A specialized version of `baseAggregator` for arrays.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} setter The function to set `accumulator` values.+ * @param {Function} iteratee The iteratee to transform keys.+ * @param {Object} accumulator The initial aggregated object.+ * @returns {Function} Returns `accumulator`.+ */+ function arrayAggregator(array, setter, iteratee, accumulator) {+ var index = -1,+ length = array == null ? 0 : array.length;++ while (++index < length) {+ var value = array[index];+ setter(accumulator, value, iteratee(value), array);+ }+ return accumulator;+ }++ /**+ * A specialized version of `_.forEach` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array} Returns `array`.+ */+ function arrayEach(array, iteratee) {+ var index = -1,+ length = array == null ? 0 : array.length;++ while (++index < length) {+ if (iteratee(array[index], index, array) === false) {+ break;+ }+ }+ return array;+ }++ /**+ * A specialized version of `_.forEachRight` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array} Returns `array`.+ */+ function arrayEachRight(array, iteratee) {+ var length = array == null ? 0 : array.length;++ while (length--) {+ if (iteratee(array[length], length, array) === false) {+ break;+ }+ }+ return array;+ }++ /**+ * A specialized version of `_.every` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {boolean} Returns `true` if all elements pass the predicate check,+ * else `false`.+ */+ function arrayEvery(array, predicate) {+ var index = -1,+ length = array == null ? 0 : array.length;++ while (++index < length) {+ if (!predicate(array[index], index, array)) {+ return false;+ }+ }+ return true;+ }++ /**+ * A specialized version of `_.filter` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {Array} Returns the new filtered array.+ */+ function arrayFilter(array, predicate) {+ var index = -1,+ length = array == null ? 0 : array.length,+ resIndex = 0,+ result = [];++ while (++index < length) {+ var value = array[index];+ if (predicate(value, index, array)) {+ result[resIndex++] = value;+ }+ }+ return result;+ }++ /**+ * A specialized version of `_.includes` for arrays without support for+ * specifying an index to search from.+ *+ * @private+ * @param {Array} [array] The array to inspect.+ * @param {*} target The value to search for.+ * @returns {boolean} Returns `true` if `target` is found, else `false`.+ */+ function arrayIncludes(array, value) {+ var length = array == null ? 0 : array.length;+ return !!length && baseIndexOf(array, value, 0) > -1;+ }++ /**+ * This function is like `arrayIncludes` except that it accepts a comparator.+ *+ * @private+ * @param {Array} [array] The array to inspect.+ * @param {*} target The value to search for.+ * @param {Function} comparator The comparator invoked per element.+ * @returns {boolean} Returns `true` if `target` is found, else `false`.+ */+ function arrayIncludesWith(array, value, comparator) {+ var index = -1,+ length = array == null ? 0 : array.length;++ while (++index < length) {+ if (comparator(value, array[index])) {+ return true;+ }+ }+ return false;+ }++ /**+ * A specialized version of `_.map` for arrays without support for iteratee+ * shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array} Returns the new mapped array.+ */+ function arrayMap(array, iteratee) {+ var index = -1,+ length = array == null ? 0 : array.length,+ result = Array(length);++ while (++index < length) {+ result[index] = iteratee(array[index], index, array);+ }+ return result;+ }++ /**+ * Appends the elements of `values` to `array`.+ *+ * @private+ * @param {Array} array The array to modify.+ * @param {Array} values The values to append.+ * @returns {Array} Returns `array`.+ */+ function arrayPush(array, values) {+ var index = -1,+ length = values.length,+ offset = array.length;++ while (++index < length) {+ array[offset + index] = values[index];+ }+ return array;+ }++ /**+ * A specialized version of `_.reduce` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @param {*} [accumulator] The initial value.+ * @param {boolean} [initAccum] Specify using the first element of `array` as+ * the initial value.+ * @returns {*} Returns the accumulated value.+ */+ function arrayReduce(array, iteratee, accumulator, initAccum) {+ var index = -1,+ length = array == null ? 0 : array.length;++ if (initAccum && length) {+ accumulator = array[++index];+ }+ while (++index < length) {+ accumulator = iteratee(accumulator, array[index], index, array);+ }+ return accumulator;+ }++ /**+ * A specialized version of `_.reduceRight` for arrays without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @param {*} [accumulator] The initial value.+ * @param {boolean} [initAccum] Specify using the last element of `array` as+ * the initial value.+ * @returns {*} Returns the accumulated value.+ */+ function arrayReduceRight(array, iteratee, accumulator, initAccum) {+ var length = array == null ? 0 : array.length;+ if (initAccum && length) {+ accumulator = array[--length];+ }+ while (length--) {+ accumulator = iteratee(accumulator, array[length], length, array);+ }+ return accumulator;+ }++ /**+ * A specialized version of `_.some` for arrays without support for iteratee+ * shorthands.+ *+ * @private+ * @param {Array} [array] The array to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {boolean} Returns `true` if any element passes the predicate check,+ * else `false`.+ */+ function arraySome(array, predicate) {+ var index = -1,+ length = array == null ? 0 : array.length;++ while (++index < length) {+ if (predicate(array[index], index, array)) {+ return true;+ }+ }+ return false;+ }++ /**+ * Gets the size of an ASCII `string`.+ *+ * @private+ * @param {string} string The string inspect.+ * @returns {number} Returns the string size.+ */+ var asciiSize = baseProperty('length');++ /**+ * Converts an ASCII `string` to an array.+ *+ * @private+ * @param {string} string The string to convert.+ * @returns {Array} Returns the converted array.+ */+ function asciiToArray(string) {+ return string.split('');+ }++ /**+ * Splits an ASCII `string` into an array of its words.+ *+ * @private+ * @param {string} The string to inspect.+ * @returns {Array} Returns the words of `string`.+ */+ function asciiWords(string) {+ return string.match(reAsciiWord) || [];+ }++ /**+ * The base implementation of methods like `_.findKey` and `_.findLastKey`,+ * without support for iteratee shorthands, which iterates over `collection`+ * using `eachFunc`.+ *+ * @private+ * @param {Array|Object} collection The collection to inspect.+ * @param {Function} predicate The function invoked per iteration.+ * @param {Function} eachFunc The function to iterate over `collection`.+ * @returns {*} Returns the found element or its key, else `undefined`.+ */+ function baseFindKey(collection, predicate, eachFunc) {+ var result;+ eachFunc(collection, function(value, key, collection) {+ if (predicate(value, key, collection)) {+ result = key;+ return false;+ }+ });+ return result;+ }++ /**+ * The base implementation of `_.findIndex` and `_.findLastIndex` without+ * support for iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {Function} predicate The function invoked per iteration.+ * @param {number} fromIndex The index to search from.+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function baseFindIndex(array, predicate, fromIndex, fromRight) {+ var length = array.length,+ index = fromIndex + (fromRight ? 1 : -1);++ while ((fromRight ? index-- : ++index < length)) {+ if (predicate(array[index], index, array)) {+ return index;+ }+ }+ return -1;+ }++ /**+ * The base implementation of `_.indexOf` without `fromIndex` bounds checks.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} fromIndex The index to search from.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function baseIndexOf(array, value, fromIndex) {+ return value === value+ ? strictIndexOf(array, value, fromIndex)+ : baseFindIndex(array, baseIsNaN, fromIndex);+ }++ /**+ * This function is like `baseIndexOf` except that it accepts a comparator.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} fromIndex The index to search from.+ * @param {Function} comparator The comparator invoked per element.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function baseIndexOfWith(array, value, fromIndex, comparator) {+ var index = fromIndex - 1,+ length = array.length;++ while (++index < length) {+ if (comparator(array[index], value)) {+ return index;+ }+ }+ return -1;+ }++ /**+ * The base implementation of `_.isNaN` without support for number objects.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.+ */+ function baseIsNaN(value) {+ return value !== value;+ }++ /**+ * The base implementation of `_.mean` and `_.meanBy` without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {number} Returns the mean.+ */+ function baseMean(array, iteratee) {+ var length = array == null ? 0 : array.length;+ return length ? (baseSum(array, iteratee) / length) : NAN;+ }++ /**+ * The base implementation of `_.property` without support for deep paths.+ *+ * @private+ * @param {string} key The key of the property to get.+ * @returns {Function} Returns the new accessor function.+ */+ function baseProperty(key) {+ return function(object) {+ return object == null ? undefined : object[key];+ };+ }++ /**+ * The base implementation of `_.propertyOf` without support for deep paths.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Function} Returns the new accessor function.+ */+ function basePropertyOf(object) {+ return function(key) {+ return object == null ? undefined : object[key];+ };+ }++ /**+ * The base implementation of `_.reduce` and `_.reduceRight`, without support+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @param {*} accumulator The initial value.+ * @param {boolean} initAccum Specify using the first or last element of+ * `collection` as the initial value.+ * @param {Function} eachFunc The function to iterate over `collection`.+ * @returns {*} Returns the accumulated value.+ */+ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {+ eachFunc(collection, function(value, index, collection) {+ accumulator = initAccum+ ? (initAccum = false, value)+ : iteratee(accumulator, value, index, collection);+ });+ return accumulator;+ }++ /**+ * The base implementation of `_.sortBy` which uses `comparer` to define the+ * sort order of `array` and replaces criteria objects with their corresponding+ * values.+ *+ * @private+ * @param {Array} array The array to sort.+ * @param {Function} comparer The function to define sort order.+ * @returns {Array} Returns `array`.+ */+ function baseSortBy(array, comparer) {+ var length = array.length;++ array.sort(comparer);+ while (length--) {+ array[length] = array[length].value;+ }+ return array;+ }++ /**+ * The base implementation of `_.sum` and `_.sumBy` without support for+ * iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {number} Returns the sum.+ */+ function baseSum(array, iteratee) {+ var result,+ index = -1,+ length = array.length;++ while (++index < length) {+ var current = iteratee(array[index]);+ if (current !== undefined) {+ result = result === undefined ? current : (result + current);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.times` without support for iteratee shorthands+ * or max array length checks.+ *+ * @private+ * @param {number} n The number of times to invoke `iteratee`.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array} Returns the array of results.+ */+ function baseTimes(n, iteratee) {+ var index = -1,+ result = Array(n);++ while (++index < n) {+ result[index] = iteratee(index);+ }+ return result;+ }++ /**+ * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array+ * of key-value pairs for `object` corresponding to the property names of `props`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array} props The property names to get values for.+ * @returns {Object} Returns the key-value pairs.+ */+ function baseToPairs(object, props) {+ return arrayMap(props, function(key) {+ return [key, object[key]];+ });+ }++ /**+ * The base implementation of `_.unary` without support for storing metadata.+ *+ * @private+ * @param {Function} func The function to cap arguments for.+ * @returns {Function} Returns the new capped function.+ */+ function baseUnary(func) {+ return function(value) {+ return func(value);+ };+ }++ /**+ * The base implementation of `_.values` and `_.valuesIn` which creates an+ * array of `object` property values corresponding to the property names+ * of `props`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array} props The property names to get values for.+ * @returns {Object} Returns the array of property values.+ */+ function baseValues(object, props) {+ return arrayMap(props, function(key) {+ return object[key];+ });+ }++ /**+ * Checks if a `cache` value for `key` exists.+ *+ * @private+ * @param {Object} cache The cache to query.+ * @param {string} key The key of the entry to check.+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.+ */+ function cacheHas(cache, key) {+ return cache.has(key);+ }++ /**+ * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol+ * that is not found in the character symbols.+ *+ * @private+ * @param {Array} strSymbols The string symbols to inspect.+ * @param {Array} chrSymbols The character symbols to find.+ * @returns {number} Returns the index of the first unmatched string symbol.+ */+ function charsStartIndex(strSymbols, chrSymbols) {+ var index = -1,+ length = strSymbols.length;++ while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}+ return index;+ }++ /**+ * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol+ * that is not found in the character symbols.+ *+ * @private+ * @param {Array} strSymbols The string symbols to inspect.+ * @param {Array} chrSymbols The character symbols to find.+ * @returns {number} Returns the index of the last unmatched string symbol.+ */+ function charsEndIndex(strSymbols, chrSymbols) {+ var index = strSymbols.length;++ while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}+ return index;+ }++ /**+ * Gets the number of `placeholder` occurrences in `array`.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} placeholder The placeholder to search for.+ * @returns {number} Returns the placeholder count.+ */+ function countHolders(array, placeholder) {+ var length = array.length,+ result = 0;++ while (length--) {+ if (array[length] === placeholder) {+ ++result;+ }+ }+ return result;+ }++ /**+ * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A+ * letters to basic Latin letters.+ *+ * @private+ * @param {string} letter The matched letter to deburr.+ * @returns {string} Returns the deburred letter.+ */+ var deburrLetter = basePropertyOf(deburredLetters);++ /**+ * Used by `_.escape` to convert characters to HTML entities.+ *+ * @private+ * @param {string} chr The matched character to escape.+ * @returns {string} Returns the escaped character.+ */+ var escapeHtmlChar = basePropertyOf(htmlEscapes);++ /**+ * Used by `_.template` to escape characters for inclusion in compiled string literals.+ *+ * @private+ * @param {string} chr The matched character to escape.+ * @returns {string} Returns the escaped character.+ */+ function escapeStringChar(chr) {+ return '\\' + stringEscapes[chr];+ }++ /**+ * Gets the value at `key` of `object`.+ *+ * @private+ * @param {Object} [object] The object to query.+ * @param {string} key The key of the property to get.+ * @returns {*} Returns the property value.+ */+ function getValue(object, key) {+ return object == null ? undefined : object[key];+ }++ /**+ * Checks if `string` contains Unicode symbols.+ *+ * @private+ * @param {string} string The string to inspect.+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.+ */+ function hasUnicode(string) {+ return reHasUnicode.test(string);+ }++ /**+ * Checks if `string` contains a word composed of Unicode symbols.+ *+ * @private+ * @param {string} string The string to inspect.+ * @returns {boolean} Returns `true` if a word is found, else `false`.+ */+ function hasUnicodeWord(string) {+ return reHasUnicodeWord.test(string);+ }++ /**+ * Converts `iterator` to an array.+ *+ * @private+ * @param {Object} iterator The iterator to convert.+ * @returns {Array} Returns the converted array.+ */+ function iteratorToArray(iterator) {+ var data,+ result = [];++ while (!(data = iterator.next()).done) {+ result.push(data.value);+ }+ return result;+ }++ /**+ * Converts `map` to its key-value pairs.+ *+ * @private+ * @param {Object} map The map to convert.+ * @returns {Array} Returns the key-value pairs.+ */+ function mapToArray(map) {+ var index = -1,+ result = Array(map.size);++ map.forEach(function(value, key) {+ result[++index] = [key, value];+ });+ return result;+ }++ /**+ * Creates a unary function that invokes `func` with its argument transformed.+ *+ * @private+ * @param {Function} func The function to wrap.+ * @param {Function} transform The argument transform.+ * @returns {Function} Returns the new function.+ */+ function overArg(func, transform) {+ return function(arg) {+ return func(transform(arg));+ };+ }++ /**+ * Replaces all `placeholder` elements in `array` with an internal placeholder+ * and returns an array of their indexes.+ *+ * @private+ * @param {Array} array The array to modify.+ * @param {*} placeholder The placeholder to replace.+ * @returns {Array} Returns the new array of placeholder indexes.+ */+ function replaceHolders(array, placeholder) {+ var index = -1,+ length = array.length,+ resIndex = 0,+ result = [];++ while (++index < length) {+ var value = array[index];+ if (value === placeholder || value === PLACEHOLDER) {+ array[index] = PLACEHOLDER;+ result[resIndex++] = index;+ }+ }+ return result;+ }++ /**+ * Converts `set` to an array of its values.+ *+ * @private+ * @param {Object} set The set to convert.+ * @returns {Array} Returns the values.+ */+ function setToArray(set) {+ var index = -1,+ result = Array(set.size);++ set.forEach(function(value) {+ result[++index] = value;+ });+ return result;+ }++ /**+ * Converts `set` to its value-value pairs.+ *+ * @private+ * @param {Object} set The set to convert.+ * @returns {Array} Returns the value-value pairs.+ */+ function setToPairs(set) {+ var index = -1,+ result = Array(set.size);++ set.forEach(function(value) {+ result[++index] = [value, value];+ });+ return result;+ }++ /**+ * A specialized version of `_.indexOf` which performs strict equality+ * comparisons of values, i.e. `===`.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} fromIndex The index to search from.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function strictIndexOf(array, value, fromIndex) {+ var index = fromIndex - 1,+ length = array.length;++ while (++index < length) {+ if (array[index] === value) {+ return index;+ }+ }+ return -1;+ }++ /**+ * A specialized version of `_.lastIndexOf` which performs strict equality+ * comparisons of values, i.e. `===`.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} fromIndex The index to search from.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function strictLastIndexOf(array, value, fromIndex) {+ var index = fromIndex + 1;+ while (index--) {+ if (array[index] === value) {+ return index;+ }+ }+ return index;+ }++ /**+ * Gets the number of symbols in `string`.+ *+ * @private+ * @param {string} string The string to inspect.+ * @returns {number} Returns the string size.+ */+ function stringSize(string) {+ return hasUnicode(string)+ ? unicodeSize(string)+ : asciiSize(string);+ }++ /**+ * Converts `string` to an array.+ *+ * @private+ * @param {string} string The string to convert.+ * @returns {Array} Returns the converted array.+ */+ function stringToArray(string) {+ return hasUnicode(string)+ ? unicodeToArray(string)+ : asciiToArray(string);+ }++ /**+ * Used by `_.unescape` to convert HTML entities to characters.+ *+ * @private+ * @param {string} chr The matched character to unescape.+ * @returns {string} Returns the unescaped character.+ */+ var unescapeHtmlChar = basePropertyOf(htmlUnescapes);++ /**+ * Gets the size of a Unicode `string`.+ *+ * @private+ * @param {string} string The string inspect.+ * @returns {number} Returns the string size.+ */+ function unicodeSize(string) {+ var result = reUnicode.lastIndex = 0;+ while (reUnicode.test(string)) {+ ++result;+ }+ return result;+ }++ /**+ * Converts a Unicode `string` to an array.+ *+ * @private+ * @param {string} string The string to convert.+ * @returns {Array} Returns the converted array.+ */+ function unicodeToArray(string) {+ return string.match(reUnicode) || [];+ }++ /**+ * Splits a Unicode `string` into an array of its words.+ *+ * @private+ * @param {string} The string to inspect.+ * @returns {Array} Returns the words of `string`.+ */+ function unicodeWords(string) {+ return string.match(reUnicodeWord) || [];+ }++ /*--------------------------------------------------------------------------*/++ /**+ * Create a new pristine `lodash` function using the `context` object.+ *+ * @static+ * @memberOf _+ * @since 1.1.0+ * @category Util+ * @param {Object} [context=root] The context object.+ * @returns {Function} Returns a new `lodash` function.+ * @example+ *+ * _.mixin({ 'foo': _.constant('foo') });+ *+ * var lodash = _.runInContext();+ * lodash.mixin({ 'bar': lodash.constant('bar') });+ *+ * _.isFunction(_.foo);+ * // => true+ * _.isFunction(_.bar);+ * // => false+ *+ * lodash.isFunction(lodash.foo);+ * // => false+ * lodash.isFunction(lodash.bar);+ * // => true+ *+ * // Create a suped-up `defer` in Node.js.+ * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;+ */+ var runInContext = (function runInContext(context) {+ context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));++ /** Built-in constructor references. */+ var Array = context.Array,+ Date = context.Date,+ Error = context.Error,+ Function = context.Function,+ Math = context.Math,+ Object = context.Object,+ RegExp = context.RegExp,+ String = context.String,+ TypeError = context.TypeError;++ /** Used for built-in method references. */+ var arrayProto = Array.prototype,+ funcProto = Function.prototype,+ objectProto = Object.prototype;++ /** Used to detect overreaching core-js shims. */+ var coreJsData = context['__core-js_shared__'];++ /** Used to resolve the decompiled source of functions. */+ var funcToString = funcProto.toString;++ /** Used to check objects for own properties. */+ var hasOwnProperty = objectProto.hasOwnProperty;++ /** Used to generate unique IDs. */+ var idCounter = 0;++ /** Used to detect methods masquerading as native. */+ var maskSrcKey = (function() {+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');+ return uid ? ('Symbol(src)_1.' + uid) : '';+ }());++ /**+ * Used to resolve the+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)+ * of values.+ */+ var nativeObjectToString = objectProto.toString;++ /** Used to infer the `Object` constructor. */+ var objectCtorString = funcToString.call(Object);++ /** Used to restore the original `_` reference in `_.noConflict`. */+ var oldDash = root._;++ /** Used to detect if a method is native. */+ var reIsNative = RegExp('^' ++ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'+ );++ /** Built-in value references. */+ var Buffer = moduleExports ? context.Buffer : undefined,+ Symbol = context.Symbol,+ Uint8Array = context.Uint8Array,+ allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,+ getPrototype = overArg(Object.getPrototypeOf, Object),+ objectCreate = Object.create,+ propertyIsEnumerable = objectProto.propertyIsEnumerable,+ splice = arrayProto.splice,+ spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,+ symIterator = Symbol ? Symbol.iterator : undefined,+ symToStringTag = Symbol ? Symbol.toStringTag : undefined;++ var defineProperty = (function() {+ try {+ var func = getNative(Object, 'defineProperty');+ func({}, '', {});+ return func;+ } catch (e) {}+ }());++ /** Mocked built-ins. */+ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,+ ctxNow = Date && Date.now !== root.Date.now && Date.now,+ ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;++ /* Built-in method references for those with the same name as other `lodash` methods. */+ var nativeCeil = Math.ceil,+ nativeFloor = Math.floor,+ nativeGetSymbols = Object.getOwnPropertySymbols,+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,+ nativeIsFinite = context.isFinite,+ nativeJoin = arrayProto.join,+ nativeKeys = overArg(Object.keys, Object),+ nativeMax = Math.max,+ nativeMin = Math.min,+ nativeNow = Date.now,+ nativeParseInt = context.parseInt,+ nativeRandom = Math.random,+ nativeReverse = arrayProto.reverse;++ /* Built-in method references that are verified to be native. */+ var DataView = getNative(context, 'DataView'),+ Map = getNative(context, 'Map'),+ Promise = getNative(context, 'Promise'),+ Set = getNative(context, 'Set'),+ WeakMap = getNative(context, 'WeakMap'),+ nativeCreate = getNative(Object, 'create');++ /** Used to store function metadata. */+ var metaMap = WeakMap && new WeakMap;++ /** Used to lookup unminified function names. */+ var realNames = {};++ /** Used to detect maps, sets, and weakmaps. */+ var dataViewCtorString = toSource(DataView),+ mapCtorString = toSource(Map),+ promiseCtorString = toSource(Promise),+ setCtorString = toSource(Set),+ weakMapCtorString = toSource(WeakMap);++ /** Used to convert symbols to primitives and strings. */+ var symbolProto = Symbol ? Symbol.prototype : undefined,+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,+ symbolToString = symbolProto ? symbolProto.toString : undefined;++ /*------------------------------------------------------------------------*/++ /**+ * Creates a `lodash` object which wraps `value` to enable implicit method+ * chain sequences. Methods that operate on and return arrays, collections,+ * and functions can be chained together. Methods that retrieve a single value+ * or may return a primitive value will automatically end the chain sequence+ * and return the unwrapped value. Otherwise, the value must be unwrapped+ * with `_#value`.+ *+ * Explicit chain sequences, which must be unwrapped with `_#value`, may be+ * enabled using `_.chain`.+ *+ * The execution of chained methods is lazy, that is, it's deferred until+ * `_#value` is implicitly or explicitly called.+ *+ * Lazy evaluation allows several methods to support shortcut fusion.+ * Shortcut fusion is an optimization to merge iteratee calls; this avoids+ * the creation of intermediate arrays and can greatly reduce the number of+ * iteratee executions. Sections of a chain sequence qualify for shortcut+ * fusion if the section is applied to an array and iteratees accept only+ * one argument. The heuristic for whether a section qualifies for shortcut+ * fusion is subject to change.+ *+ * Chaining is supported in custom builds as long as the `_#value` method is+ * directly or indirectly included in the build.+ *+ * In addition to lodash methods, wrappers have `Array` and `String` methods.+ *+ * The wrapper `Array` methods are:+ * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`+ *+ * The wrapper `String` methods are:+ * `replace` and `split`+ *+ * The wrapper methods that support shortcut fusion are:+ * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,+ * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,+ * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`+ *+ * The chainable wrapper methods are:+ * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,+ * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,+ * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,+ * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,+ * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,+ * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,+ * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,+ * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,+ * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,+ * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,+ * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,+ * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,+ * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,+ * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,+ * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,+ * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,+ * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,+ * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,+ * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,+ * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,+ * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,+ * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,+ * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,+ * `zipObject`, `zipObjectDeep`, and `zipWith`+ *+ * The wrapper methods that are **not** chainable by default are:+ * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,+ * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,+ * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,+ * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,+ * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,+ * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,+ * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,+ * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,+ * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,+ * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,+ * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,+ * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,+ * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,+ * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,+ * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,+ * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,+ * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,+ * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,+ * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,+ * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,+ * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,+ * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,+ * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,+ * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,+ * `upperFirst`, `value`, and `words`+ *+ * @name _+ * @constructor+ * @category Seq+ * @param {*} value The value to wrap in a `lodash` instance.+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * var wrapped = _([1, 2, 3]);+ *+ * // Returns an unwrapped value.+ * wrapped.reduce(_.add);+ * // => 6+ *+ * // Returns a wrapped value.+ * var squares = wrapped.map(square);+ *+ * _.isArray(squares);+ * // => false+ *+ * _.isArray(squares.value());+ * // => true+ */+ function lodash(value) {+ if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {+ if (value instanceof LodashWrapper) {+ return value;+ }+ if (hasOwnProperty.call(value, '__wrapped__')) {+ return wrapperClone(value);+ }+ }+ return new LodashWrapper(value);+ }++ /**+ * The base implementation of `_.create` without support for assigning+ * properties to the created object.+ *+ * @private+ * @param {Object} proto The object to inherit from.+ * @returns {Object} Returns the new object.+ */+ var baseCreate = (function() {+ function object() {}+ return function(proto) {+ if (!isObject(proto)) {+ return {};+ }+ if (objectCreate) {+ return objectCreate(proto);+ }+ object.prototype = proto;+ var result = new object;+ object.prototype = undefined;+ return result;+ };+ }());++ /**+ * The function whose prototype chain sequence wrappers inherit from.+ *+ * @private+ */+ function baseLodash() {+ // No operation performed.+ }++ /**+ * The base constructor for creating `lodash` wrapper objects.+ *+ * @private+ * @param {*} value The value to wrap.+ * @param {boolean} [chainAll] Enable explicit method chain sequences.+ */+ function LodashWrapper(value, chainAll) {+ this.__wrapped__ = value;+ this.__actions__ = [];+ this.__chain__ = !!chainAll;+ this.__index__ = 0;+ this.__values__ = undefined;+ }++ /**+ * By default, the template delimiters used by lodash are like those in+ * embedded Ruby (ERB) as well as ES2015 template strings. Change the+ * following template settings to use alternative delimiters.+ *+ * @static+ * @memberOf _+ * @type {Object}+ */+ lodash.templateSettings = {++ /**+ * Used to detect `data` property values to be HTML-escaped.+ *+ * @memberOf _.templateSettings+ * @type {RegExp}+ */+ 'escape': reEscape,++ /**+ * Used to detect code to be evaluated.+ *+ * @memberOf _.templateSettings+ * @type {RegExp}+ */+ 'evaluate': reEvaluate,++ /**+ * Used to detect `data` property values to inject.+ *+ * @memberOf _.templateSettings+ * @type {RegExp}+ */+ 'interpolate': reInterpolate,++ /**+ * Used to reference the data object in the template text.+ *+ * @memberOf _.templateSettings+ * @type {string}+ */+ 'variable': '',++ /**+ * Used to import variables into the compiled template.+ *+ * @memberOf _.templateSettings+ * @type {Object}+ */+ 'imports': {++ /**+ * A reference to the `lodash` function.+ *+ * @memberOf _.templateSettings.imports+ * @type {Function}+ */+ '_': lodash+ }+ };++ // Ensure wrappers are instances of `baseLodash`.+ lodash.prototype = baseLodash.prototype;+ lodash.prototype.constructor = lodash;++ LodashWrapper.prototype = baseCreate(baseLodash.prototype);+ LodashWrapper.prototype.constructor = LodashWrapper;++ /*------------------------------------------------------------------------*/++ /**+ * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.+ *+ * @private+ * @constructor+ * @param {*} value The value to wrap.+ */+ function LazyWrapper(value) {+ this.__wrapped__ = value;+ this.__actions__ = [];+ this.__dir__ = 1;+ this.__filtered__ = false;+ this.__iteratees__ = [];+ this.__takeCount__ = MAX_ARRAY_LENGTH;+ this.__views__ = [];+ }++ /**+ * Creates a clone of the lazy wrapper object.+ *+ * @private+ * @name clone+ * @memberOf LazyWrapper+ * @returns {Object} Returns the cloned `LazyWrapper` object.+ */+ function lazyClone() {+ var result = new LazyWrapper(this.__wrapped__);+ result.__actions__ = copyArray(this.__actions__);+ result.__dir__ = this.__dir__;+ result.__filtered__ = this.__filtered__;+ result.__iteratees__ = copyArray(this.__iteratees__);+ result.__takeCount__ = this.__takeCount__;+ result.__views__ = copyArray(this.__views__);+ return result;+ }++ /**+ * Reverses the direction of lazy iteration.+ *+ * @private+ * @name reverse+ * @memberOf LazyWrapper+ * @returns {Object} Returns the new reversed `LazyWrapper` object.+ */+ function lazyReverse() {+ if (this.__filtered__) {+ var result = new LazyWrapper(this);+ result.__dir__ = -1;+ result.__filtered__ = true;+ } else {+ result = this.clone();+ result.__dir__ *= -1;+ }+ return result;+ }++ /**+ * Extracts the unwrapped value from its lazy wrapper.+ *+ * @private+ * @name value+ * @memberOf LazyWrapper+ * @returns {*} Returns the unwrapped value.+ */+ function lazyValue() {+ var array = this.__wrapped__.value(),+ dir = this.__dir__,+ isArr = isArray(array),+ isRight = dir < 0,+ arrLength = isArr ? array.length : 0,+ view = getView(0, arrLength, this.__views__),+ start = view.start,+ end = view.end,+ length = end - start,+ index = isRight ? end : (start - 1),+ iteratees = this.__iteratees__,+ iterLength = iteratees.length,+ resIndex = 0,+ takeCount = nativeMin(length, this.__takeCount__);++ if (!isArr || (!isRight && arrLength == length && takeCount == length)) {+ return baseWrapperValue(array, this.__actions__);+ }+ var result = [];++ outer:+ while (length-- && resIndex < takeCount) {+ index += dir;++ var iterIndex = -1,+ value = array[index];++ while (++iterIndex < iterLength) {+ var data = iteratees[iterIndex],+ iteratee = data.iteratee,+ type = data.type,+ computed = iteratee(value);++ if (type == LAZY_MAP_FLAG) {+ value = computed;+ } else if (!computed) {+ if (type == LAZY_FILTER_FLAG) {+ continue outer;+ } else {+ break outer;+ }+ }+ }+ result[resIndex++] = value;+ }+ return result;+ }++ // Ensure `LazyWrapper` is an instance of `baseLodash`.+ LazyWrapper.prototype = baseCreate(baseLodash.prototype);+ LazyWrapper.prototype.constructor = LazyWrapper;++ /*------------------------------------------------------------------------*/++ /**+ * Creates a hash object.+ *+ * @private+ * @constructor+ * @param {Array} [entries] The key-value pairs to cache.+ */+ function Hash(entries) {+ var index = -1,+ length = entries == null ? 0 : entries.length;++ this.clear();+ while (++index < length) {+ var entry = entries[index];+ this.set(entry[0], entry[1]);+ }+ }++ /**+ * Removes all key-value entries from the hash.+ *+ * @private+ * @name clear+ * @memberOf Hash+ */+ function hashClear() {+ this.__data__ = nativeCreate ? nativeCreate(null) : {};+ this.size = 0;+ }++ /**+ * Removes `key` and its value from the hash.+ *+ * @private+ * @name delete+ * @memberOf Hash+ * @param {Object} hash The hash to modify.+ * @param {string} key The key of the value to remove.+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.+ */+ function hashDelete(key) {+ var result = this.has(key) && delete this.__data__[key];+ this.size -= result ? 1 : 0;+ return result;+ }++ /**+ * Gets the hash value for `key`.+ *+ * @private+ * @name get+ * @memberOf Hash+ * @param {string} key The key of the value to get.+ * @returns {*} Returns the entry value.+ */+ function hashGet(key) {+ var data = this.__data__;+ if (nativeCreate) {+ var result = data[key];+ return result === HASH_UNDEFINED ? undefined : result;+ }+ return hasOwnProperty.call(data, key) ? data[key] : undefined;+ }++ /**+ * Checks if a hash value for `key` exists.+ *+ * @private+ * @name has+ * @memberOf Hash+ * @param {string} key The key of the entry to check.+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.+ */+ function hashHas(key) {+ var data = this.__data__;+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);+ }++ /**+ * Sets the hash `key` to `value`.+ *+ * @private+ * @name set+ * @memberOf Hash+ * @param {string} key The key of the value to set.+ * @param {*} value The value to set.+ * @returns {Object} Returns the hash instance.+ */+ function hashSet(key, value) {+ var data = this.__data__;+ this.size += this.has(key) ? 0 : 1;+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;+ return this;+ }++ // Add methods to `Hash`.+ Hash.prototype.clear = hashClear;+ Hash.prototype['delete'] = hashDelete;+ Hash.prototype.get = hashGet;+ Hash.prototype.has = hashHas;+ Hash.prototype.set = hashSet;++ /*------------------------------------------------------------------------*/++ /**+ * Creates an list cache object.+ *+ * @private+ * @constructor+ * @param {Array} [entries] The key-value pairs to cache.+ */+ function ListCache(entries) {+ var index = -1,+ length = entries == null ? 0 : entries.length;++ this.clear();+ while (++index < length) {+ var entry = entries[index];+ this.set(entry[0], entry[1]);+ }+ }++ /**+ * Removes all key-value entries from the list cache.+ *+ * @private+ * @name clear+ * @memberOf ListCache+ */+ function listCacheClear() {+ this.__data__ = [];+ this.size = 0;+ }++ /**+ * Removes `key` and its value from the list cache.+ *+ * @private+ * @name delete+ * @memberOf ListCache+ * @param {string} key The key of the value to remove.+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.+ */+ function listCacheDelete(key) {+ var data = this.__data__,+ index = assocIndexOf(data, key);++ if (index < 0) {+ return false;+ }+ var lastIndex = data.length - 1;+ if (index == lastIndex) {+ data.pop();+ } else {+ splice.call(data, index, 1);+ }+ --this.size;+ return true;+ }++ /**+ * Gets the list cache value for `key`.+ *+ * @private+ * @name get+ * @memberOf ListCache+ * @param {string} key The key of the value to get.+ * @returns {*} Returns the entry value.+ */+ function listCacheGet(key) {+ var data = this.__data__,+ index = assocIndexOf(data, key);++ return index < 0 ? undefined : data[index][1];+ }++ /**+ * Checks if a list cache value for `key` exists.+ *+ * @private+ * @name has+ * @memberOf ListCache+ * @param {string} key The key of the entry to check.+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.+ */+ function listCacheHas(key) {+ return assocIndexOf(this.__data__, key) > -1;+ }++ /**+ * Sets the list cache `key` to `value`.+ *+ * @private+ * @name set+ * @memberOf ListCache+ * @param {string} key The key of the value to set.+ * @param {*} value The value to set.+ * @returns {Object} Returns the list cache instance.+ */+ function listCacheSet(key, value) {+ var data = this.__data__,+ index = assocIndexOf(data, key);++ if (index < 0) {+ ++this.size;+ data.push([key, value]);+ } else {+ data[index][1] = value;+ }+ return this;+ }++ // Add methods to `ListCache`.+ ListCache.prototype.clear = listCacheClear;+ ListCache.prototype['delete'] = listCacheDelete;+ ListCache.prototype.get = listCacheGet;+ ListCache.prototype.has = listCacheHas;+ ListCache.prototype.set = listCacheSet;++ /*------------------------------------------------------------------------*/++ /**+ * Creates a map cache object to store key-value pairs.+ *+ * @private+ * @constructor+ * @param {Array} [entries] The key-value pairs to cache.+ */+ function MapCache(entries) {+ var index = -1,+ length = entries == null ? 0 : entries.length;++ this.clear();+ while (++index < length) {+ var entry = entries[index];+ this.set(entry[0], entry[1]);+ }+ }++ /**+ * Removes all key-value entries from the map.+ *+ * @private+ * @name clear+ * @memberOf MapCache+ */+ function mapCacheClear() {+ this.size = 0;+ this.__data__ = {+ 'hash': new Hash,+ 'map': new (Map || ListCache),+ 'string': new Hash+ };+ }++ /**+ * Removes `key` and its value from the map.+ *+ * @private+ * @name delete+ * @memberOf MapCache+ * @param {string} key The key of the value to remove.+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.+ */+ function mapCacheDelete(key) {+ var result = getMapData(this, key)['delete'](key);+ this.size -= result ? 1 : 0;+ return result;+ }++ /**+ * Gets the map value for `key`.+ *+ * @private+ * @name get+ * @memberOf MapCache+ * @param {string} key The key of the value to get.+ * @returns {*} Returns the entry value.+ */+ function mapCacheGet(key) {+ return getMapData(this, key).get(key);+ }++ /**+ * Checks if a map value for `key` exists.+ *+ * @private+ * @name has+ * @memberOf MapCache+ * @param {string} key The key of the entry to check.+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.+ */+ function mapCacheHas(key) {+ return getMapData(this, key).has(key);+ }++ /**+ * Sets the map `key` to `value`.+ *+ * @private+ * @name set+ * @memberOf MapCache+ * @param {string} key The key of the value to set.+ * @param {*} value The value to set.+ * @returns {Object} Returns the map cache instance.+ */+ function mapCacheSet(key, value) {+ var data = getMapData(this, key),+ size = data.size;++ data.set(key, value);+ this.size += data.size == size ? 0 : 1;+ return this;+ }++ // Add methods to `MapCache`.+ MapCache.prototype.clear = mapCacheClear;+ MapCache.prototype['delete'] = mapCacheDelete;+ MapCache.prototype.get = mapCacheGet;+ MapCache.prototype.has = mapCacheHas;+ MapCache.prototype.set = mapCacheSet;++ /*------------------------------------------------------------------------*/++ /**+ *+ * Creates an array cache object to store unique values.+ *+ * @private+ * @constructor+ * @param {Array} [values] The values to cache.+ */+ function SetCache(values) {+ var index = -1,+ length = values == null ? 0 : values.length;++ this.__data__ = new MapCache;+ while (++index < length) {+ this.add(values[index]);+ }+ }++ /**+ * Adds `value` to the array cache.+ *+ * @private+ * @name add+ * @memberOf SetCache+ * @alias push+ * @param {*} value The value to cache.+ * @returns {Object} Returns the cache instance.+ */+ function setCacheAdd(value) {+ this.__data__.set(value, HASH_UNDEFINED);+ return this;+ }++ /**+ * Checks if `value` is in the array cache.+ *+ * @private+ * @name has+ * @memberOf SetCache+ * @param {*} value The value to search for.+ * @returns {number} Returns `true` if `value` is found, else `false`.+ */+ function setCacheHas(value) {+ return this.__data__.has(value);+ }++ // Add methods to `SetCache`.+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;+ SetCache.prototype.has = setCacheHas;++ /*------------------------------------------------------------------------*/++ /**+ * Creates a stack cache object to store key-value pairs.+ *+ * @private+ * @constructor+ * @param {Array} [entries] The key-value pairs to cache.+ */+ function Stack(entries) {+ var data = this.__data__ = new ListCache(entries);+ this.size = data.size;+ }++ /**+ * Removes all key-value entries from the stack.+ *+ * @private+ * @name clear+ * @memberOf Stack+ */+ function stackClear() {+ this.__data__ = new ListCache;+ this.size = 0;+ }++ /**+ * Removes `key` and its value from the stack.+ *+ * @private+ * @name delete+ * @memberOf Stack+ * @param {string} key The key of the value to remove.+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.+ */+ function stackDelete(key) {+ var data = this.__data__,+ result = data['delete'](key);++ this.size = data.size;+ return result;+ }++ /**+ * Gets the stack value for `key`.+ *+ * @private+ * @name get+ * @memberOf Stack+ * @param {string} key The key of the value to get.+ * @returns {*} Returns the entry value.+ */+ function stackGet(key) {+ return this.__data__.get(key);+ }++ /**+ * Checks if a stack value for `key` exists.+ *+ * @private+ * @name has+ * @memberOf Stack+ * @param {string} key The key of the entry to check.+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.+ */+ function stackHas(key) {+ return this.__data__.has(key);+ }++ /**+ * Sets the stack `key` to `value`.+ *+ * @private+ * @name set+ * @memberOf Stack+ * @param {string} key The key of the value to set.+ * @param {*} value The value to set.+ * @returns {Object} Returns the stack cache instance.+ */+ function stackSet(key, value) {+ var data = this.__data__;+ if (data instanceof ListCache) {+ var pairs = data.__data__;+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {+ pairs.push([key, value]);+ this.size = ++data.size;+ return this;+ }+ data = this.__data__ = new MapCache(pairs);+ }+ data.set(key, value);+ this.size = data.size;+ return this;+ }++ // Add methods to `Stack`.+ Stack.prototype.clear = stackClear;+ Stack.prototype['delete'] = stackDelete;+ Stack.prototype.get = stackGet;+ Stack.prototype.has = stackHas;+ Stack.prototype.set = stackSet;++ /*------------------------------------------------------------------------*/++ /**+ * Creates an array of the enumerable property names of the array-like `value`.+ *+ * @private+ * @param {*} value The value to query.+ * @param {boolean} inherited Specify returning inherited property names.+ * @returns {Array} Returns the array of property names.+ */+ function arrayLikeKeys(value, inherited) {+ var isArr = isArray(value),+ isArg = !isArr && isArguments(value),+ isBuff = !isArr && !isArg && isBuffer(value),+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),+ skipIndexes = isArr || isArg || isBuff || isType,+ result = skipIndexes ? baseTimes(value.length, String) : [],+ length = result.length;++ for (var key in value) {+ if ((inherited || hasOwnProperty.call(value, key)) &&+ !(skipIndexes && (+ // Safari 9 has enumerable `arguments.length` in strict mode.+ key == 'length' ||+ // Node.js 0.10 has enumerable non-index properties on buffers.+ (isBuff && (key == 'offset' || key == 'parent')) ||+ // PhantomJS 2 has enumerable non-index properties on typed arrays.+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||+ // Skip index properties.+ isIndex(key, length)+ ))) {+ result.push(key);+ }+ }+ return result;+ }++ /**+ * A specialized version of `_.sample` for arrays.+ *+ * @private+ * @param {Array} array The array to sample.+ * @returns {*} Returns the random element.+ */+ function arraySample(array) {+ var length = array.length;+ return length ? array[baseRandom(0, length - 1)] : undefined;+ }++ /**+ * A specialized version of `_.sampleSize` for arrays.+ *+ * @private+ * @param {Array} array The array to sample.+ * @param {number} n The number of elements to sample.+ * @returns {Array} Returns the random elements.+ */+ function arraySampleSize(array, n) {+ return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));+ }++ /**+ * A specialized version of `_.shuffle` for arrays.+ *+ * @private+ * @param {Array} array The array to shuffle.+ * @returns {Array} Returns the new shuffled array.+ */+ function arrayShuffle(array) {+ return shuffleSelf(copyArray(array));+ }++ /**+ * This function is like `assignValue` except that it doesn't assign+ * `undefined` values.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {string} key The key of the property to assign.+ * @param {*} value The value to assign.+ */+ function assignMergeValue(object, key, value) {+ if ((value !== undefined && !eq(object[key], value)) ||+ (value === undefined && !(key in object))) {+ baseAssignValue(object, key, value);+ }+ }++ /**+ * Assigns `value` to `key` of `object` if the existing value is not equivalent+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {string} key The key of the property to assign.+ * @param {*} value The value to assign.+ */+ function assignValue(object, key, value) {+ var objValue = object[key];+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||+ (value === undefined && !(key in object))) {+ baseAssignValue(object, key, value);+ }+ }++ /**+ * Gets the index at which the `key` is found in `array` of key-value pairs.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {*} key The key to search for.+ * @returns {number} Returns the index of the matched value, else `-1`.+ */+ function assocIndexOf(array, key) {+ var length = array.length;+ while (length--) {+ if (eq(array[length][0], key)) {+ return length;+ }+ }+ return -1;+ }++ /**+ * Aggregates elements of `collection` on `accumulator` with keys transformed+ * by `iteratee` and values set by `setter`.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} setter The function to set `accumulator` values.+ * @param {Function} iteratee The iteratee to transform keys.+ * @param {Object} accumulator The initial aggregated object.+ * @returns {Function} Returns `accumulator`.+ */+ function baseAggregator(collection, setter, iteratee, accumulator) {+ baseEach(collection, function(value, key, collection) {+ setter(accumulator, value, iteratee(value), collection);+ });+ return accumulator;+ }++ /**+ * The base implementation of `_.assign` without support for multiple sources+ * or `customizer` functions.+ *+ * @private+ * @param {Object} object The destination object.+ * @param {Object} source The source object.+ * @returns {Object} Returns `object`.+ */+ function baseAssign(object, source) {+ return object && copyObject(source, keys(source), object);+ }++ /**+ * The base implementation of `_.assignIn` without support for multiple sources+ * or `customizer` functions.+ *+ * @private+ * @param {Object} object The destination object.+ * @param {Object} source The source object.+ * @returns {Object} Returns `object`.+ */+ function baseAssignIn(object, source) {+ return object && copyObject(source, keysIn(source), object);+ }++ /**+ * The base implementation of `assignValue` and `assignMergeValue` without+ * value checks.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {string} key The key of the property to assign.+ * @param {*} value The value to assign.+ */+ function baseAssignValue(object, key, value) {+ if (key == '__proto__' && defineProperty) {+ defineProperty(object, key, {+ 'configurable': true,+ 'enumerable': true,+ 'value': value,+ 'writable': true+ });+ } else {+ object[key] = value;+ }+ }++ /**+ * The base implementation of `_.at` without support for individual paths.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {string[]} paths The property paths to pick.+ * @returns {Array} Returns the picked elements.+ */+ function baseAt(object, paths) {+ var index = -1,+ length = paths.length,+ result = Array(length),+ skip = object == null;++ while (++index < length) {+ result[index] = skip ? undefined : get(object, paths[index]);+ }+ return result;+ }++ /**+ * The base implementation of `_.clamp` which doesn't coerce arguments.+ *+ * @private+ * @param {number} number The number to clamp.+ * @param {number} [lower] The lower bound.+ * @param {number} upper The upper bound.+ * @returns {number} Returns the clamped number.+ */+ function baseClamp(number, lower, upper) {+ if (number === number) {+ if (upper !== undefined) {+ number = number <= upper ? number : upper;+ }+ if (lower !== undefined) {+ number = number >= lower ? number : lower;+ }+ }+ return number;+ }++ /**+ * The base implementation of `_.clone` and `_.cloneDeep` which tracks+ * traversed objects.+ *+ * @private+ * @param {*} value The value to clone.+ * @param {boolean} bitmask The bitmask flags.+ * 1 - Deep clone+ * 2 - Flatten inherited properties+ * 4 - Clone symbols+ * @param {Function} [customizer] The function to customize cloning.+ * @param {string} [key] The key of `value`.+ * @param {Object} [object] The parent object of `value`.+ * @param {Object} [stack] Tracks traversed objects and their clone counterparts.+ * @returns {*} Returns the cloned value.+ */+ function baseClone(value, bitmask, customizer, key, object, stack) {+ var result,+ isDeep = bitmask & CLONE_DEEP_FLAG,+ isFlat = bitmask & CLONE_FLAT_FLAG,+ isFull = bitmask & CLONE_SYMBOLS_FLAG;++ if (customizer) {+ result = object ? customizer(value, key, object, stack) : customizer(value);+ }+ if (result !== undefined) {+ return result;+ }+ if (!isObject(value)) {+ return value;+ }+ var isArr = isArray(value);+ if (isArr) {+ result = initCloneArray(value);+ if (!isDeep) {+ return copyArray(value, result);+ }+ } else {+ var tag = getTag(value),+ isFunc = tag == funcTag || tag == genTag;++ if (isBuffer(value)) {+ return cloneBuffer(value, isDeep);+ }+ if (tag == objectTag || tag == argsTag || (isFunc && !object)) {+ result = (isFlat || isFunc) ? {} : initCloneObject(value);+ if (!isDeep) {+ return isFlat+ ? copySymbolsIn(value, baseAssignIn(result, value))+ : copySymbols(value, baseAssign(result, value));+ }+ } else {+ if (!cloneableTags[tag]) {+ return object ? value : {};+ }+ result = initCloneByTag(value, tag, baseClone, isDeep);+ }+ }+ // Check for circular references and return its corresponding clone.+ stack || (stack = new Stack);+ var stacked = stack.get(value);+ if (stacked) {+ return stacked;+ }+ stack.set(value, result);++ var keysFunc = isFull+ ? (isFlat ? getAllKeysIn : getAllKeys)+ : (isFlat ? keysIn : keys);++ var props = isArr ? undefined : keysFunc(value);+ arrayEach(props || value, function(subValue, key) {+ if (props) {+ key = subValue;+ subValue = value[key];+ }+ // Recursively populate clone (susceptible to call stack limits).+ assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));+ });+ return result;+ }++ /**+ * The base implementation of `_.conforms` which doesn't clone `source`.+ *+ * @private+ * @param {Object} source The object of property predicates to conform to.+ * @returns {Function} Returns the new spec function.+ */+ function baseConforms(source) {+ var props = keys(source);+ return function(object) {+ return baseConformsTo(object, source, props);+ };+ }++ /**+ * The base implementation of `_.conformsTo` which accepts `props` to check.+ *+ * @private+ * @param {Object} object The object to inspect.+ * @param {Object} source The object of property predicates to conform to.+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.+ */+ function baseConformsTo(object, source, props) {+ var length = props.length;+ if (object == null) {+ return !length;+ }+ object = Object(object);+ while (length--) {+ var key = props[length],+ predicate = source[key],+ value = object[key];++ if ((value === undefined && !(key in object)) || !predicate(value)) {+ return false;+ }+ }+ return true;+ }++ /**+ * The base implementation of `_.delay` and `_.defer` which accepts `args`+ * to provide to `func`.+ *+ * @private+ * @param {Function} func The function to delay.+ * @param {number} wait The number of milliseconds to delay invocation.+ * @param {Array} args The arguments to provide to `func`.+ * @returns {number|Object} Returns the timer id or timeout object.+ */+ function baseDelay(func, wait, args) {+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ return setTimeout(function() { func.apply(undefined, args); }, wait);+ }++ /**+ * The base implementation of methods like `_.difference` without support+ * for excluding multiple arrays or iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {Array} values The values to exclude.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of filtered values.+ */+ function baseDifference(array, values, iteratee, comparator) {+ var index = -1,+ includes = arrayIncludes,+ isCommon = true,+ length = array.length,+ result = [],+ valuesLength = values.length;++ if (!length) {+ return result;+ }+ if (iteratee) {+ values = arrayMap(values, baseUnary(iteratee));+ }+ if (comparator) {+ includes = arrayIncludesWith;+ isCommon = false;+ }+ else if (values.length >= LARGE_ARRAY_SIZE) {+ includes = cacheHas;+ isCommon = false;+ values = new SetCache(values);+ }+ outer:+ while (++index < length) {+ var value = array[index],+ computed = iteratee == null ? value : iteratee(value);++ value = (comparator || value !== 0) ? value : 0;+ if (isCommon && computed === computed) {+ var valuesIndex = valuesLength;+ while (valuesIndex--) {+ if (values[valuesIndex] === computed) {+ continue outer;+ }+ }+ result.push(value);+ }+ else if (!includes(values, computed, comparator)) {+ result.push(value);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.forEach` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array|Object} Returns `collection`.+ */+ var baseEach = createBaseEach(baseForOwn);++ /**+ * The base implementation of `_.forEachRight` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array|Object} Returns `collection`.+ */+ var baseEachRight = createBaseEach(baseForOwnRight, true);++ /**+ * The base implementation of `_.every` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {boolean} Returns `true` if all elements pass the predicate check,+ * else `false`+ */+ function baseEvery(collection, predicate) {+ var result = true;+ baseEach(collection, function(value, index, collection) {+ result = !!predicate(value, index, collection);+ return result;+ });+ return result;+ }++ /**+ * The base implementation of methods like `_.max` and `_.min` which accepts a+ * `comparator` to determine the extremum value.+ *+ * @private+ * @param {Array} array The array to iterate over.+ * @param {Function} iteratee The iteratee invoked per iteration.+ * @param {Function} comparator The comparator used to compare values.+ * @returns {*} Returns the extremum value.+ */+ function baseExtremum(array, iteratee, comparator) {+ var index = -1,+ length = array.length;++ while (++index < length) {+ var value = array[index],+ current = iteratee(value);++ if (current != null && (computed === undefined+ ? (current === current && !isSymbol(current))+ : comparator(current, computed)+ )) {+ var computed = current,+ result = value;+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.fill` without an iteratee call guard.+ *+ * @private+ * @param {Array} array The array to fill.+ * @param {*} value The value to fill `array` with.+ * @param {number} [start=0] The start position.+ * @param {number} [end=array.length] The end position.+ * @returns {Array} Returns `array`.+ */+ function baseFill(array, value, start, end) {+ var length = array.length;++ start = toInteger(start);+ if (start < 0) {+ start = -start > length ? 0 : (length + start);+ }+ end = (end === undefined || end > length) ? length : toInteger(end);+ if (end < 0) {+ end += length;+ }+ end = start > end ? 0 : toLength(end);+ while (start < end) {+ array[start++] = value;+ }+ return array;+ }++ /**+ * The base implementation of `_.filter` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {Array} Returns the new filtered array.+ */+ function baseFilter(collection, predicate) {+ var result = [];+ baseEach(collection, function(value, index, collection) {+ if (predicate(value, index, collection)) {+ result.push(value);+ }+ });+ return result;+ }++ /**+ * The base implementation of `_.flatten` with support for restricting flattening.+ *+ * @private+ * @param {Array} array The array to flatten.+ * @param {number} depth The maximum recursion depth.+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.+ * @param {Array} [result=[]] The initial result value.+ * @returns {Array} Returns the new flattened array.+ */+ function baseFlatten(array, depth, predicate, isStrict, result) {+ var index = -1,+ length = array.length;++ predicate || (predicate = isFlattenable);+ result || (result = []);++ while (++index < length) {+ var value = array[index];+ if (depth > 0 && predicate(value)) {+ if (depth > 1) {+ // Recursively flatten arrays (susceptible to call stack limits).+ baseFlatten(value, depth - 1, predicate, isStrict, result);+ } else {+ arrayPush(result, value);+ }+ } else if (!isStrict) {+ result[result.length] = value;+ }+ }+ return result;+ }++ /**+ * The base implementation of `baseForOwn` which iterates over `object`+ * properties returned by `keysFunc` and invokes `iteratee` for each property.+ * Iteratee functions may exit iteration early by explicitly returning `false`.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @param {Function} keysFunc The function to get the keys of `object`.+ * @returns {Object} Returns `object`.+ */+ var baseFor = createBaseFor();++ /**+ * This function is like `baseFor` except that it iterates over properties+ * in the opposite order.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @param {Function} keysFunc The function to get the keys of `object`.+ * @returns {Object} Returns `object`.+ */+ var baseForRight = createBaseFor(true);++ /**+ * The base implementation of `_.forOwn` without support for iteratee shorthands.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Object} Returns `object`.+ */+ function baseForOwn(object, iteratee) {+ return object && baseFor(object, iteratee, keys);+ }++ /**+ * The base implementation of `_.forOwnRight` without support for iteratee shorthands.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Object} Returns `object`.+ */+ function baseForOwnRight(object, iteratee) {+ return object && baseForRight(object, iteratee, keys);+ }++ /**+ * The base implementation of `_.functions` which creates an array of+ * `object` function property names filtered from `props`.+ *+ * @private+ * @param {Object} object The object to inspect.+ * @param {Array} props The property names to filter.+ * @returns {Array} Returns the function names.+ */+ function baseFunctions(object, props) {+ return arrayFilter(props, function(key) {+ return isFunction(object[key]);+ });+ }++ /**+ * The base implementation of `_.get` without support for default values.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array|string} path The path of the property to get.+ * @returns {*} Returns the resolved value.+ */+ function baseGet(object, path) {+ path = castPath(path, object);++ var index = 0,+ length = path.length;++ while (object != null && index < length) {+ object = object[toKey(path[index++])];+ }+ return (index && index == length) ? object : undefined;+ }++ /**+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and+ * symbols of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Function} keysFunc The function to get the keys of `object`.+ * @param {Function} symbolsFunc The function to get the symbols of `object`.+ * @returns {Array} Returns the array of property names and symbols.+ */+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {+ var result = keysFunc(object);+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));+ }++ /**+ * The base implementation of `getTag` without fallbacks for buggy environments.+ *+ * @private+ * @param {*} value The value to query.+ * @returns {string} Returns the `toStringTag`.+ */+ function baseGetTag(value) {+ if (value == null) {+ return value === undefined ? undefinedTag : nullTag;+ }+ return (symToStringTag && symToStringTag in Object(value))+ ? getRawTag(value)+ : objectToString(value);+ }++ /**+ * The base implementation of `_.gt` which doesn't coerce arguments.+ *+ * @private+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is greater than `other`,+ * else `false`.+ */+ function baseGt(value, other) {+ return value > other;+ }++ /**+ * The base implementation of `_.has` without support for deep paths.+ *+ * @private+ * @param {Object} [object] The object to query.+ * @param {Array|string} key The key to check.+ * @returns {boolean} Returns `true` if `key` exists, else `false`.+ */+ function baseHas(object, key) {+ return object != null && hasOwnProperty.call(object, key);+ }++ /**+ * The base implementation of `_.hasIn` without support for deep paths.+ *+ * @private+ * @param {Object} [object] The object to query.+ * @param {Array|string} key The key to check.+ * @returns {boolean} Returns `true` if `key` exists, else `false`.+ */+ function baseHasIn(object, key) {+ return object != null && key in Object(object);+ }++ /**+ * The base implementation of `_.inRange` which doesn't coerce arguments.+ *+ * @private+ * @param {number} number The number to check.+ * @param {number} start The start of the range.+ * @param {number} end The end of the range.+ * @returns {boolean} Returns `true` if `number` is in the range, else `false`.+ */+ function baseInRange(number, start, end) {+ return number >= nativeMin(start, end) && number < nativeMax(start, end);+ }++ /**+ * The base implementation of methods like `_.intersection`, without support+ * for iteratee shorthands, that accepts an array of arrays to inspect.+ *+ * @private+ * @param {Array} arrays The arrays to inspect.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of shared values.+ */+ function baseIntersection(arrays, iteratee, comparator) {+ var includes = comparator ? arrayIncludesWith : arrayIncludes,+ length = arrays[0].length,+ othLength = arrays.length,+ othIndex = othLength,+ caches = Array(othLength),+ maxLength = Infinity,+ result = [];++ while (othIndex--) {+ var array = arrays[othIndex];+ if (othIndex && iteratee) {+ array = arrayMap(array, baseUnary(iteratee));+ }+ maxLength = nativeMin(array.length, maxLength);+ caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))+ ? new SetCache(othIndex && array)+ : undefined;+ }+ array = arrays[0];++ var index = -1,+ seen = caches[0];++ outer:+ while (++index < length && result.length < maxLength) {+ var value = array[index],+ computed = iteratee ? iteratee(value) : value;++ value = (comparator || value !== 0) ? value : 0;+ if (!(seen+ ? cacheHas(seen, computed)+ : includes(result, computed, comparator)+ )) {+ othIndex = othLength;+ while (--othIndex) {+ var cache = caches[othIndex];+ if (!(cache+ ? cacheHas(cache, computed)+ : includes(arrays[othIndex], computed, comparator))+ ) {+ continue outer;+ }+ }+ if (seen) {+ seen.push(computed);+ }+ result.push(value);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.invert` and `_.invertBy` which inverts+ * `object` with values transformed by `iteratee` and set by `setter`.+ *+ * @private+ * @param {Object} object The object to iterate over.+ * @param {Function} setter The function to set `accumulator` values.+ * @param {Function} iteratee The iteratee to transform values.+ * @param {Object} accumulator The initial inverted object.+ * @returns {Function} Returns `accumulator`.+ */+ function baseInverter(object, setter, iteratee, accumulator) {+ baseForOwn(object, function(value, key, object) {+ setter(accumulator, iteratee(value), key, object);+ });+ return accumulator;+ }++ /**+ * The base implementation of `_.invoke` without support for individual+ * method arguments.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array|string} path The path of the method to invoke.+ * @param {Array} args The arguments to invoke the method with.+ * @returns {*} Returns the result of the invoked method.+ */+ function baseInvoke(object, path, args) {+ path = castPath(path, object);+ object = parent(object, path);+ var func = object == null ? object : object[toKey(last(path))];+ return func == null ? undefined : apply(func, object, args);+ }++ /**+ * The base implementation of `_.isArguments`.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,+ */+ function baseIsArguments(value) {+ return isObjectLike(value) && baseGetTag(value) == argsTag;+ }++ /**+ * The base implementation of `_.isArrayBuffer` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.+ */+ function baseIsArrayBuffer(value) {+ return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;+ }++ /**+ * The base implementation of `_.isDate` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.+ */+ function baseIsDate(value) {+ return isObjectLike(value) && baseGetTag(value) == dateTag;+ }++ /**+ * The base implementation of `_.isEqual` which supports partial comparisons+ * and tracks traversed objects.+ *+ * @private+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @param {boolean} bitmask The bitmask flags.+ * 1 - Unordered comparison+ * 2 - Partial comparison+ * @param {Function} [customizer] The function to customize comparisons.+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.+ */+ function baseIsEqual(value, other, bitmask, customizer, stack) {+ if (value === other) {+ return true;+ }+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {+ return value !== value && other !== other;+ }+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);+ }++ /**+ * A specialized version of `baseIsEqual` for arrays and objects which performs+ * deep comparisons and tracks traversed objects enabling objects with circular+ * references to be compared.+ *+ * @private+ * @param {Object} object The object to compare.+ * @param {Object} other The other object to compare.+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.+ * @param {Function} customizer The function to customize comparisons.+ * @param {Function} equalFunc The function to determine equivalents of values.+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.+ */+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {+ var objIsArr = isArray(object),+ othIsArr = isArray(other),+ objTag = objIsArr ? arrayTag : getTag(object),+ othTag = othIsArr ? arrayTag : getTag(other);++ objTag = objTag == argsTag ? objectTag : objTag;+ othTag = othTag == argsTag ? objectTag : othTag;++ var objIsObj = objTag == objectTag,+ othIsObj = othTag == objectTag,+ isSameTag = objTag == othTag;++ if (isSameTag && isBuffer(object)) {+ if (!isBuffer(other)) {+ return false;+ }+ objIsArr = true;+ objIsObj = false;+ }+ if (isSameTag && !objIsObj) {+ stack || (stack = new Stack);+ return (objIsArr || isTypedArray(object))+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);+ }+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');++ if (objIsWrapped || othIsWrapped) {+ var objUnwrapped = objIsWrapped ? object.value() : object,+ othUnwrapped = othIsWrapped ? other.value() : other;++ stack || (stack = new Stack);+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);+ }+ }+ if (!isSameTag) {+ return false;+ }+ stack || (stack = new Stack);+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);+ }++ /**+ * The base implementation of `_.isMap` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.+ */+ function baseIsMap(value) {+ return isObjectLike(value) && getTag(value) == mapTag;+ }++ /**+ * The base implementation of `_.isMatch` without support for iteratee shorthands.+ *+ * @private+ * @param {Object} object The object to inspect.+ * @param {Object} source The object of property values to match.+ * @param {Array} matchData The property names, values, and compare flags to match.+ * @param {Function} [customizer] The function to customize comparisons.+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.+ */+ function baseIsMatch(object, source, matchData, customizer) {+ var index = matchData.length,+ length = index,+ noCustomizer = !customizer;++ if (object == null) {+ return !length;+ }+ object = Object(object);+ while (index--) {+ var data = matchData[index];+ if ((noCustomizer && data[2])+ ? data[1] !== object[data[0]]+ : !(data[0] in object)+ ) {+ return false;+ }+ }+ while (++index < length) {+ data = matchData[index];+ var key = data[0],+ objValue = object[key],+ srcValue = data[1];++ if (noCustomizer && data[2]) {+ if (objValue === undefined && !(key in object)) {+ return false;+ }+ } else {+ var stack = new Stack;+ if (customizer) {+ var result = customizer(objValue, srcValue, key, object, source, stack);+ }+ if (!(result === undefined+ ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)+ : result+ )) {+ return false;+ }+ }+ }+ return true;+ }++ /**+ * The base implementation of `_.isNative` without bad shim checks.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a native function,+ * else `false`.+ */+ function baseIsNative(value) {+ if (!isObject(value) || isMasked(value)) {+ return false;+ }+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;+ return pattern.test(toSource(value));+ }++ /**+ * The base implementation of `_.isRegExp` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.+ */+ function baseIsRegExp(value) {+ return isObjectLike(value) && baseGetTag(value) == regexpTag;+ }++ /**+ * The base implementation of `_.isSet` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.+ */+ function baseIsSet(value) {+ return isObjectLike(value) && getTag(value) == setTag;+ }++ /**+ * The base implementation of `_.isTypedArray` without Node.js optimizations.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.+ */+ function baseIsTypedArray(value) {+ return isObjectLike(value) &&+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];+ }++ /**+ * The base implementation of `_.iteratee`.+ *+ * @private+ * @param {*} [value=_.identity] The value to convert to an iteratee.+ * @returns {Function} Returns the iteratee.+ */+ function baseIteratee(value) {+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.+ if (typeof value == 'function') {+ return value;+ }+ if (value == null) {+ return identity;+ }+ if (typeof value == 'object') {+ return isArray(value)+ ? baseMatchesProperty(value[0], value[1])+ : baseMatches(value);+ }+ return property(value);+ }++ /**+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names.+ */+ function baseKeys(object) {+ if (!isPrototype(object)) {+ return nativeKeys(object);+ }+ var result = [];+ for (var key in Object(object)) {+ if (hasOwnProperty.call(object, key) && key != 'constructor') {+ result.push(key);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names.+ */+ function baseKeysIn(object) {+ if (!isObject(object)) {+ return nativeKeysIn(object);+ }+ var isProto = isPrototype(object),+ result = [];++ for (var key in object) {+ if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {+ result.push(key);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.lt` which doesn't coerce arguments.+ *+ * @private+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is less than `other`,+ * else `false`.+ */+ function baseLt(value, other) {+ return value < other;+ }++ /**+ * The base implementation of `_.map` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} iteratee The function invoked per iteration.+ * @returns {Array} Returns the new mapped array.+ */+ function baseMap(collection, iteratee) {+ var index = -1,+ result = isArrayLike(collection) ? Array(collection.length) : [];++ baseEach(collection, function(value, key, collection) {+ result[++index] = iteratee(value, key, collection);+ });+ return result;+ }++ /**+ * The base implementation of `_.matches` which doesn't clone `source`.+ *+ * @private+ * @param {Object} source The object of property values to match.+ * @returns {Function} Returns the new spec function.+ */+ function baseMatches(source) {+ var matchData = getMatchData(source);+ if (matchData.length == 1 && matchData[0][2]) {+ return matchesStrictComparable(matchData[0][0], matchData[0][1]);+ }+ return function(object) {+ return object === source || baseIsMatch(object, source, matchData);+ };+ }++ /**+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.+ *+ * @private+ * @param {string} path The path of the property to get.+ * @param {*} srcValue The value to match.+ * @returns {Function} Returns the new spec function.+ */+ function baseMatchesProperty(path, srcValue) {+ if (isKey(path) && isStrictComparable(srcValue)) {+ return matchesStrictComparable(toKey(path), srcValue);+ }+ return function(object) {+ var objValue = get(object, path);+ return (objValue === undefined && objValue === srcValue)+ ? hasIn(object, path)+ : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);+ };+ }++ /**+ * The base implementation of `_.merge` without support for multiple sources.+ *+ * @private+ * @param {Object} object The destination object.+ * @param {Object} source The source object.+ * @param {number} srcIndex The index of `source`.+ * @param {Function} [customizer] The function to customize merged values.+ * @param {Object} [stack] Tracks traversed source values and their merged+ * counterparts.+ */+ function baseMerge(object, source, srcIndex, customizer, stack) {+ if (object === source) {+ return;+ }+ baseFor(source, function(srcValue, key) {+ if (isObject(srcValue)) {+ stack || (stack = new Stack);+ baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);+ }+ else {+ var newValue = customizer+ ? customizer(object[key], srcValue, (key + ''), object, source, stack)+ : undefined;++ if (newValue === undefined) {+ newValue = srcValue;+ }+ assignMergeValue(object, key, newValue);+ }+ }, keysIn);+ }++ /**+ * A specialized version of `baseMerge` for arrays and objects which performs+ * deep merges and tracks traversed objects enabling objects with circular+ * references to be merged.+ *+ * @private+ * @param {Object} object The destination object.+ * @param {Object} source The source object.+ * @param {string} key The key of the value to merge.+ * @param {number} srcIndex The index of `source`.+ * @param {Function} mergeFunc The function to merge values.+ * @param {Function} [customizer] The function to customize assigned values.+ * @param {Object} [stack] Tracks traversed source values and their merged+ * counterparts.+ */+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {+ var objValue = object[key],+ srcValue = source[key],+ stacked = stack.get(srcValue);++ if (stacked) {+ assignMergeValue(object, key, stacked);+ return;+ }+ var newValue = customizer+ ? customizer(objValue, srcValue, (key + ''), object, source, stack)+ : undefined;++ var isCommon = newValue === undefined;++ if (isCommon) {+ var isArr = isArray(srcValue),+ isBuff = !isArr && isBuffer(srcValue),+ isTyped = !isArr && !isBuff && isTypedArray(srcValue);++ newValue = srcValue;+ if (isArr || isBuff || isTyped) {+ if (isArray(objValue)) {+ newValue = objValue;+ }+ else if (isArrayLikeObject(objValue)) {+ newValue = copyArray(objValue);+ }+ else if (isBuff) {+ isCommon = false;+ newValue = cloneBuffer(srcValue, true);+ }+ else if (isTyped) {+ isCommon = false;+ newValue = cloneTypedArray(srcValue, true);+ }+ else {+ newValue = [];+ }+ }+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {+ newValue = objValue;+ if (isArguments(objValue)) {+ newValue = toPlainObject(objValue);+ }+ else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {+ newValue = initCloneObject(srcValue);+ }+ }+ else {+ isCommon = false;+ }+ }+ if (isCommon) {+ // Recursively merge objects and arrays (susceptible to call stack limits).+ stack.set(srcValue, newValue);+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);+ stack['delete'](srcValue);+ }+ assignMergeValue(object, key, newValue);+ }++ /**+ * The base implementation of `_.nth` which doesn't coerce arguments.+ *+ * @private+ * @param {Array} array The array to query.+ * @param {number} n The index of the element to return.+ * @returns {*} Returns the nth element of `array`.+ */+ function baseNth(array, n) {+ var length = array.length;+ if (!length) {+ return;+ }+ n += n < 0 ? length : 0;+ return isIndex(n, length) ? array[n] : undefined;+ }++ /**+ * The base implementation of `_.orderBy` without param guards.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.+ * @param {string[]} orders The sort orders of `iteratees`.+ * @returns {Array} Returns the new sorted array.+ */+ function baseOrderBy(collection, iteratees, orders) {+ var index = -1;+ iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));++ var result = baseMap(collection, function(value, key, collection) {+ var criteria = arrayMap(iteratees, function(iteratee) {+ return iteratee(value);+ });+ return { 'criteria': criteria, 'index': ++index, 'value': value };+ });++ return baseSortBy(result, function(object, other) {+ return compareMultiple(object, other, orders);+ });+ }++ /**+ * The base implementation of `_.pick` without support for individual+ * property identifiers.+ *+ * @private+ * @param {Object} object The source object.+ * @param {string[]} paths The property paths to pick.+ * @returns {Object} Returns the new object.+ */+ function basePick(object, paths) {+ return basePickBy(object, paths, function(value, path) {+ return hasIn(object, path);+ });+ }++ /**+ * The base implementation of `_.pickBy` without support for iteratee shorthands.+ *+ * @private+ * @param {Object} object The source object.+ * @param {string[]} paths The property paths to pick.+ * @param {Function} predicate The function invoked per property.+ * @returns {Object} Returns the new object.+ */+ function basePickBy(object, paths, predicate) {+ var index = -1,+ length = paths.length,+ result = {};++ while (++index < length) {+ var path = paths[index],+ value = baseGet(object, path);++ if (predicate(value, path)) {+ baseSet(result, castPath(path, object), value);+ }+ }+ return result;+ }++ /**+ * A specialized version of `baseProperty` which supports deep paths.+ *+ * @private+ * @param {Array|string} path The path of the property to get.+ * @returns {Function} Returns the new accessor function.+ */+ function basePropertyDeep(path) {+ return function(object) {+ return baseGet(object, path);+ };+ }++ /**+ * The base implementation of `_.pullAllBy` without support for iteratee+ * shorthands.+ *+ * @private+ * @param {Array} array The array to modify.+ * @param {Array} values The values to remove.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns `array`.+ */+ function basePullAll(array, values, iteratee, comparator) {+ var indexOf = comparator ? baseIndexOfWith : baseIndexOf,+ index = -1,+ length = values.length,+ seen = array;++ if (array === values) {+ values = copyArray(values);+ }+ if (iteratee) {+ seen = arrayMap(array, baseUnary(iteratee));+ }+ while (++index < length) {+ var fromIndex = 0,+ value = values[index],+ computed = iteratee ? iteratee(value) : value;++ while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {+ if (seen !== array) {+ splice.call(seen, fromIndex, 1);+ }+ splice.call(array, fromIndex, 1);+ }+ }+ return array;+ }++ /**+ * The base implementation of `_.pullAt` without support for individual+ * indexes or capturing the removed elements.+ *+ * @private+ * @param {Array} array The array to modify.+ * @param {number[]} indexes The indexes of elements to remove.+ * @returns {Array} Returns `array`.+ */+ function basePullAt(array, indexes) {+ var length = array ? indexes.length : 0,+ lastIndex = length - 1;++ while (length--) {+ var index = indexes[length];+ if (length == lastIndex || index !== previous) {+ var previous = index;+ if (isIndex(index)) {+ splice.call(array, index, 1);+ } else {+ baseUnset(array, index);+ }+ }+ }+ return array;+ }++ /**+ * The base implementation of `_.random` without support for returning+ * floating-point numbers.+ *+ * @private+ * @param {number} lower The lower bound.+ * @param {number} upper The upper bound.+ * @returns {number} Returns the random number.+ */+ function baseRandom(lower, upper) {+ return lower + nativeFloor(nativeRandom() * (upper - lower + 1));+ }++ /**+ * The base implementation of `_.range` and `_.rangeRight` which doesn't+ * coerce arguments.+ *+ * @private+ * @param {number} start The start of the range.+ * @param {number} end The end of the range.+ * @param {number} step The value to increment or decrement by.+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Array} Returns the range of numbers.+ */+ function baseRange(start, end, step, fromRight) {+ var index = -1,+ length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),+ result = Array(length);++ while (length--) {+ result[fromRight ? length : ++index] = start;+ start += step;+ }+ return result;+ }++ /**+ * The base implementation of `_.repeat` which doesn't coerce arguments.+ *+ * @private+ * @param {string} string The string to repeat.+ * @param {number} n The number of times to repeat the string.+ * @returns {string} Returns the repeated string.+ */+ function baseRepeat(string, n) {+ var result = '';+ if (!string || n < 1 || n > MAX_SAFE_INTEGER) {+ return result;+ }+ // Leverage the exponentiation by squaring algorithm for a faster repeat.+ // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.+ do {+ if (n % 2) {+ result += string;+ }+ n = nativeFloor(n / 2);+ if (n) {+ string += string;+ }+ } while (n);++ return result;+ }++ /**+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.+ *+ * @private+ * @param {Function} func The function to apply a rest parameter to.+ * @param {number} [start=func.length-1] The start position of the rest parameter.+ * @returns {Function} Returns the new function.+ */+ function baseRest(func, start) {+ return setToString(overRest(func, start, identity), func + '');+ }++ /**+ * The base implementation of `_.sample`.+ *+ * @private+ * @param {Array|Object} collection The collection to sample.+ * @returns {*} Returns the random element.+ */+ function baseSample(collection) {+ return arraySample(values(collection));+ }++ /**+ * The base implementation of `_.sampleSize` without param guards.+ *+ * @private+ * @param {Array|Object} collection The collection to sample.+ * @param {number} n The number of elements to sample.+ * @returns {Array} Returns the random elements.+ */+ function baseSampleSize(collection, n) {+ var array = values(collection);+ return shuffleSelf(array, baseClamp(n, 0, array.length));+ }++ /**+ * The base implementation of `_.set`.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to set.+ * @param {*} value The value to set.+ * @param {Function} [customizer] The function to customize path creation.+ * @returns {Object} Returns `object`.+ */+ function baseSet(object, path, value, customizer) {+ if (!isObject(object)) {+ return object;+ }+ path = castPath(path, object);++ var index = -1,+ length = path.length,+ lastIndex = length - 1,+ nested = object;++ while (nested != null && ++index < length) {+ var key = toKey(path[index]),+ newValue = value;++ if (index != lastIndex) {+ var objValue = nested[key];+ newValue = customizer ? customizer(objValue, key, nested) : undefined;+ if (newValue === undefined) {+ newValue = isObject(objValue)+ ? objValue+ : (isIndex(path[index + 1]) ? [] : {});+ }+ }+ assignValue(nested, key, newValue);+ nested = nested[key];+ }+ return object;+ }++ /**+ * The base implementation of `setData` without support for hot loop shorting.+ *+ * @private+ * @param {Function} func The function to associate metadata with.+ * @param {*} data The metadata.+ * @returns {Function} Returns `func`.+ */+ var baseSetData = !metaMap ? identity : function(func, data) {+ metaMap.set(func, data);+ return func;+ };++ /**+ * The base implementation of `setToString` without support for hot loop shorting.+ *+ * @private+ * @param {Function} func The function to modify.+ * @param {Function} string The `toString` result.+ * @returns {Function} Returns `func`.+ */+ var baseSetToString = !defineProperty ? identity : function(func, string) {+ return defineProperty(func, 'toString', {+ 'configurable': true,+ 'enumerable': false,+ 'value': constant(string),+ 'writable': true+ });+ };++ /**+ * The base implementation of `_.shuffle`.+ *+ * @private+ * @param {Array|Object} collection The collection to shuffle.+ * @returns {Array} Returns the new shuffled array.+ */+ function baseShuffle(collection) {+ return shuffleSelf(values(collection));+ }++ /**+ * The base implementation of `_.slice` without an iteratee call guard.+ *+ * @private+ * @param {Array} array The array to slice.+ * @param {number} [start=0] The start position.+ * @param {number} [end=array.length] The end position.+ * @returns {Array} Returns the slice of `array`.+ */+ function baseSlice(array, start, end) {+ var index = -1,+ length = array.length;++ if (start < 0) {+ start = -start > length ? 0 : (length + start);+ }+ end = end > length ? length : end;+ if (end < 0) {+ end += length;+ }+ length = start > end ? 0 : ((end - start) >>> 0);+ start >>>= 0;++ var result = Array(length);+ while (++index < length) {+ result[index] = array[index + start];+ }+ return result;+ }++ /**+ * The base implementation of `_.some` without support for iteratee shorthands.+ *+ * @private+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} predicate The function invoked per iteration.+ * @returns {boolean} Returns `true` if any element passes the predicate check,+ * else `false`.+ */+ function baseSome(collection, predicate) {+ var result;++ baseEach(collection, function(value, index, collection) {+ result = predicate(value, index, collection);+ return !result;+ });+ return !!result;+ }++ /**+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which+ * performs a binary search of `array` to determine the index at which `value`+ * should be inserted into `array` in order to maintain its sort order.+ *+ * @private+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @param {boolean} [retHighest] Specify returning the highest qualified index.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ */+ function baseSortedIndex(array, value, retHighest) {+ var low = 0,+ high = array == null ? low : array.length;++ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {+ while (low < high) {+ var mid = (low + high) >>> 1,+ computed = array[mid];++ if (computed !== null && !isSymbol(computed) &&+ (retHighest ? (computed <= value) : (computed < value))) {+ low = mid + 1;+ } else {+ high = mid;+ }+ }+ return high;+ }+ return baseSortedIndexBy(array, value, identity, retHighest);+ }++ /**+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`+ * which invokes `iteratee` for `value` and each element of `array` to compute+ * their sort ranking. The iteratee is invoked with one argument; (value).+ *+ * @private+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @param {Function} iteratee The iteratee invoked per element.+ * @param {boolean} [retHighest] Specify returning the highest qualified index.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ */+ function baseSortedIndexBy(array, value, iteratee, retHighest) {+ value = iteratee(value);++ var low = 0,+ high = array == null ? 0 : array.length,+ valIsNaN = value !== value,+ valIsNull = value === null,+ valIsSymbol = isSymbol(value),+ valIsUndefined = value === undefined;++ while (low < high) {+ var mid = nativeFloor((low + high) / 2),+ computed = iteratee(array[mid]),+ othIsDefined = computed !== undefined,+ othIsNull = computed === null,+ othIsReflexive = computed === computed,+ othIsSymbol = isSymbol(computed);++ if (valIsNaN) {+ var setLow = retHighest || othIsReflexive;+ } else if (valIsUndefined) {+ setLow = othIsReflexive && (retHighest || othIsDefined);+ } else if (valIsNull) {+ setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);+ } else if (valIsSymbol) {+ setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);+ } else if (othIsNull || othIsSymbol) {+ setLow = false;+ } else {+ setLow = retHighest ? (computed <= value) : (computed < value);+ }+ if (setLow) {+ low = mid + 1;+ } else {+ high = mid;+ }+ }+ return nativeMin(high, MAX_ARRAY_INDEX);+ }++ /**+ * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without+ * support for iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @returns {Array} Returns the new duplicate free array.+ */+ function baseSortedUniq(array, iteratee) {+ var index = -1,+ length = array.length,+ resIndex = 0,+ result = [];++ while (++index < length) {+ var value = array[index],+ computed = iteratee ? iteratee(value) : value;++ if (!index || !eq(computed, seen)) {+ var seen = computed;+ result[resIndex++] = value === 0 ? 0 : value;+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.toNumber` which doesn't ensure correct+ * conversions of binary, hexadecimal, or octal string values.+ *+ * @private+ * @param {*} value The value to process.+ * @returns {number} Returns the number.+ */+ function baseToNumber(value) {+ if (typeof value == 'number') {+ return value;+ }+ if (isSymbol(value)) {+ return NAN;+ }+ return +value;+ }++ /**+ * The base implementation of `_.toString` which doesn't convert nullish+ * values to empty strings.+ *+ * @private+ * @param {*} value The value to process.+ * @returns {string} Returns the string.+ */+ function baseToString(value) {+ // Exit early for strings to avoid a performance hit in some environments.+ if (typeof value == 'string') {+ return value;+ }+ if (isArray(value)) {+ // Recursively convert values (susceptible to call stack limits).+ return arrayMap(value, baseToString) + '';+ }+ if (isSymbol(value)) {+ return symbolToString ? symbolToString.call(value) : '';+ }+ var result = (value + '');+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;+ }++ /**+ * The base implementation of `_.uniqBy` without support for iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new duplicate free array.+ */+ function baseUniq(array, iteratee, comparator) {+ var index = -1,+ includes = arrayIncludes,+ length = array.length,+ isCommon = true,+ result = [],+ seen = result;++ if (comparator) {+ isCommon = false;+ includes = arrayIncludesWith;+ }+ else if (length >= LARGE_ARRAY_SIZE) {+ var set = iteratee ? null : createSet(array);+ if (set) {+ return setToArray(set);+ }+ isCommon = false;+ includes = cacheHas;+ seen = new SetCache;+ }+ else {+ seen = iteratee ? [] : result;+ }+ outer:+ while (++index < length) {+ var value = array[index],+ computed = iteratee ? iteratee(value) : value;++ value = (comparator || value !== 0) ? value : 0;+ if (isCommon && computed === computed) {+ var seenIndex = seen.length;+ while (seenIndex--) {+ if (seen[seenIndex] === computed) {+ continue outer;+ }+ }+ if (iteratee) {+ seen.push(computed);+ }+ result.push(value);+ }+ else if (!includes(seen, computed, comparator)) {+ if (seen !== result) {+ seen.push(computed);+ }+ result.push(value);+ }+ }+ return result;+ }++ /**+ * The base implementation of `_.unset`.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {Array|string} path The property path to unset.+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.+ */+ function baseUnset(object, path) {+ path = castPath(path, object);+ object = parent(object, path);+ return object == null || delete object[toKey(last(path))];+ }++ /**+ * The base implementation of `_.update`.+ *+ * @private+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to update.+ * @param {Function} updater The function to produce the updated value.+ * @param {Function} [customizer] The function to customize path creation.+ * @returns {Object} Returns `object`.+ */+ function baseUpdate(object, path, updater, customizer) {+ return baseSet(object, path, updater(baseGet(object, path)), customizer);+ }++ /**+ * The base implementation of methods like `_.dropWhile` and `_.takeWhile`+ * without support for iteratee shorthands.+ *+ * @private+ * @param {Array} array The array to query.+ * @param {Function} predicate The function invoked per iteration.+ * @param {boolean} [isDrop] Specify dropping elements instead of taking them.+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Array} Returns the slice of `array`.+ */+ function baseWhile(array, predicate, isDrop, fromRight) {+ var length = array.length,+ index = fromRight ? length : -1;++ while ((fromRight ? index-- : ++index < length) &&+ predicate(array[index], index, array)) {}++ return isDrop+ ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))+ : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));+ }++ /**+ * The base implementation of `wrapperValue` which returns the result of+ * performing a sequence of actions on the unwrapped `value`, where each+ * successive action is supplied the return value of the previous.+ *+ * @private+ * @param {*} value The unwrapped value.+ * @param {Array} actions Actions to perform to resolve the unwrapped value.+ * @returns {*} Returns the resolved value.+ */+ function baseWrapperValue(value, actions) {+ var result = value;+ if (result instanceof LazyWrapper) {+ result = result.value();+ }+ return arrayReduce(actions, function(result, action) {+ return action.func.apply(action.thisArg, arrayPush([result], action.args));+ }, result);+ }++ /**+ * The base implementation of methods like `_.xor`, without support for+ * iteratee shorthands, that accepts an array of arrays to inspect.+ *+ * @private+ * @param {Array} arrays The arrays to inspect.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of values.+ */+ function baseXor(arrays, iteratee, comparator) {+ var length = arrays.length;+ if (length < 2) {+ return length ? baseUniq(arrays[0]) : [];+ }+ var index = -1,+ result = Array(length);++ while (++index < length) {+ var array = arrays[index],+ othIndex = -1;++ while (++othIndex < length) {+ if (othIndex != index) {+ result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);+ }+ }+ }+ return baseUniq(baseFlatten(result, 1), iteratee, comparator);+ }++ /**+ * This base implementation of `_.zipObject` which assigns values using `assignFunc`.+ *+ * @private+ * @param {Array} props The property identifiers.+ * @param {Array} values The property values.+ * @param {Function} assignFunc The function to assign values.+ * @returns {Object} Returns the new object.+ */+ function baseZipObject(props, values, assignFunc) {+ var index = -1,+ length = props.length,+ valsLength = values.length,+ result = {};++ while (++index < length) {+ var value = index < valsLength ? values[index] : undefined;+ assignFunc(result, props[index], value);+ }+ return result;+ }++ /**+ * Casts `value` to an empty array if it's not an array like object.+ *+ * @private+ * @param {*} value The value to inspect.+ * @returns {Array|Object} Returns the cast array-like object.+ */+ function castArrayLikeObject(value) {+ return isArrayLikeObject(value) ? value : [];+ }++ /**+ * Casts `value` to `identity` if it's not a function.+ *+ * @private+ * @param {*} value The value to inspect.+ * @returns {Function} Returns cast function.+ */+ function castFunction(value) {+ return typeof value == 'function' ? value : identity;+ }++ /**+ * Casts `value` to a path array if it's not one.+ *+ * @private+ * @param {*} value The value to inspect.+ * @param {Object} [object] The object to query keys on.+ * @returns {Array} Returns the cast property path array.+ */+ function castPath(value, object) {+ if (isArray(value)) {+ return value;+ }+ return isKey(value, object) ? [value] : stringToPath(toString(value));+ }++ /**+ * A `baseRest` alias which can be replaced with `identity` by module+ * replacement plugins.+ *+ * @private+ * @type {Function}+ * @param {Function} func The function to apply a rest parameter to.+ * @returns {Function} Returns the new function.+ */+ var castRest = baseRest;++ /**+ * Casts `array` to a slice if it's needed.+ *+ * @private+ * @param {Array} array The array to inspect.+ * @param {number} start The start position.+ * @param {number} [end=array.length] The end position.+ * @returns {Array} Returns the cast slice.+ */+ function castSlice(array, start, end) {+ var length = array.length;+ end = end === undefined ? length : end;+ return (!start && end >= length) ? array : baseSlice(array, start, end);+ }++ /**+ * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).+ *+ * @private+ * @param {number|Object} id The timer id or timeout object of the timer to clear.+ */+ var clearTimeout = ctxClearTimeout || function(id) {+ return root.clearTimeout(id);+ };++ /**+ * Creates a clone of `buffer`.+ *+ * @private+ * @param {Buffer} buffer The buffer to clone.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Buffer} Returns the cloned buffer.+ */+ function cloneBuffer(buffer, isDeep) {+ if (isDeep) {+ return buffer.slice();+ }+ var length = buffer.length,+ result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);++ buffer.copy(result);+ return result;+ }++ /**+ * Creates a clone of `arrayBuffer`.+ *+ * @private+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.+ * @returns {ArrayBuffer} Returns the cloned array buffer.+ */+ function cloneArrayBuffer(arrayBuffer) {+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));+ return result;+ }++ /**+ * Creates a clone of `dataView`.+ *+ * @private+ * @param {Object} dataView The data view to clone.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Object} Returns the cloned data view.+ */+ function cloneDataView(dataView, isDeep) {+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);+ }++ /**+ * Creates a clone of `map`.+ *+ * @private+ * @param {Object} map The map to clone.+ * @param {Function} cloneFunc The function to clone values.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Object} Returns the cloned map.+ */+ function cloneMap(map, isDeep, cloneFunc) {+ var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map);+ return arrayReduce(array, addMapEntry, new map.constructor);+ }++ /**+ * Creates a clone of `regexp`.+ *+ * @private+ * @param {Object} regexp The regexp to clone.+ * @returns {Object} Returns the cloned regexp.+ */+ function cloneRegExp(regexp) {+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));+ result.lastIndex = regexp.lastIndex;+ return result;+ }++ /**+ * Creates a clone of `set`.+ *+ * @private+ * @param {Object} set The set to clone.+ * @param {Function} cloneFunc The function to clone values.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Object} Returns the cloned set.+ */+ function cloneSet(set, isDeep, cloneFunc) {+ var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set);+ return arrayReduce(array, addSetEntry, new set.constructor);+ }++ /**+ * Creates a clone of the `symbol` object.+ *+ * @private+ * @param {Object} symbol The symbol object to clone.+ * @returns {Object} Returns the cloned symbol object.+ */+ function cloneSymbol(symbol) {+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};+ }++ /**+ * Creates a clone of `typedArray`.+ *+ * @private+ * @param {Object} typedArray The typed array to clone.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Object} Returns the cloned typed array.+ */+ function cloneTypedArray(typedArray, isDeep) {+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);+ }++ /**+ * Compares values to sort them in ascending order.+ *+ * @private+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {number} Returns the sort order indicator for `value`.+ */+ function compareAscending(value, other) {+ if (value !== other) {+ var valIsDefined = value !== undefined,+ valIsNull = value === null,+ valIsReflexive = value === value,+ valIsSymbol = isSymbol(value);++ var othIsDefined = other !== undefined,+ othIsNull = other === null,+ othIsReflexive = other === other,+ othIsSymbol = isSymbol(other);++ if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||+ (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||+ (valIsNull && othIsDefined && othIsReflexive) ||+ (!valIsDefined && othIsReflexive) ||+ !valIsReflexive) {+ return 1;+ }+ if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||+ (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||+ (othIsNull && valIsDefined && valIsReflexive) ||+ (!othIsDefined && valIsReflexive) ||+ !othIsReflexive) {+ return -1;+ }+ }+ return 0;+ }++ /**+ * Used by `_.orderBy` to compare multiple properties of a value to another+ * and stable sort them.+ *+ * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,+ * specify an order of "desc" for descending or "asc" for ascending sort order+ * of corresponding values.+ *+ * @private+ * @param {Object} object The object to compare.+ * @param {Object} other The other object to compare.+ * @param {boolean[]|string[]} orders The order to sort by for each property.+ * @returns {number} Returns the sort order indicator for `object`.+ */+ function compareMultiple(object, other, orders) {+ var index = -1,+ objCriteria = object.criteria,+ othCriteria = other.criteria,+ length = objCriteria.length,+ ordersLength = orders.length;++ while (++index < length) {+ var result = compareAscending(objCriteria[index], othCriteria[index]);+ if (result) {+ if (index >= ordersLength) {+ return result;+ }+ var order = orders[index];+ return result * (order == 'desc' ? -1 : 1);+ }+ }+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications+ // that causes it, under certain circumstances, to provide the same value for+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247+ // for more details.+ //+ // This also ensures a stable sort in V8 and other engines.+ // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.+ return object.index - other.index;+ }++ /**+ * Creates an array that is the composition of partially applied arguments,+ * placeholders, and provided arguments into a single array of arguments.+ *+ * @private+ * @param {Array} args The provided arguments.+ * @param {Array} partials The arguments to prepend to those provided.+ * @param {Array} holders The `partials` placeholder indexes.+ * @params {boolean} [isCurried] Specify composing for a curried function.+ * @returns {Array} Returns the new array of composed arguments.+ */+ function composeArgs(args, partials, holders, isCurried) {+ var argsIndex = -1,+ argsLength = args.length,+ holdersLength = holders.length,+ leftIndex = -1,+ leftLength = partials.length,+ rangeLength = nativeMax(argsLength - holdersLength, 0),+ result = Array(leftLength + rangeLength),+ isUncurried = !isCurried;++ while (++leftIndex < leftLength) {+ result[leftIndex] = partials[leftIndex];+ }+ while (++argsIndex < holdersLength) {+ if (isUncurried || argsIndex < argsLength) {+ result[holders[argsIndex]] = args[argsIndex];+ }+ }+ while (rangeLength--) {+ result[leftIndex++] = args[argsIndex++];+ }+ return result;+ }++ /**+ * This function is like `composeArgs` except that the arguments composition+ * is tailored for `_.partialRight`.+ *+ * @private+ * @param {Array} args The provided arguments.+ * @param {Array} partials The arguments to append to those provided.+ * @param {Array} holders The `partials` placeholder indexes.+ * @params {boolean} [isCurried] Specify composing for a curried function.+ * @returns {Array} Returns the new array of composed arguments.+ */+ function composeArgsRight(args, partials, holders, isCurried) {+ var argsIndex = -1,+ argsLength = args.length,+ holdersIndex = -1,+ holdersLength = holders.length,+ rightIndex = -1,+ rightLength = partials.length,+ rangeLength = nativeMax(argsLength - holdersLength, 0),+ result = Array(rangeLength + rightLength),+ isUncurried = !isCurried;++ while (++argsIndex < rangeLength) {+ result[argsIndex] = args[argsIndex];+ }+ var offset = argsIndex;+ while (++rightIndex < rightLength) {+ result[offset + rightIndex] = partials[rightIndex];+ }+ while (++holdersIndex < holdersLength) {+ if (isUncurried || argsIndex < argsLength) {+ result[offset + holders[holdersIndex]] = args[argsIndex++];+ }+ }+ return result;+ }++ /**+ * Copies the values of `source` to `array`.+ *+ * @private+ * @param {Array} source The array to copy values from.+ * @param {Array} [array=[]] The array to copy values to.+ * @returns {Array} Returns `array`.+ */+ function copyArray(source, array) {+ var index = -1,+ length = source.length;++ array || (array = Array(length));+ while (++index < length) {+ array[index] = source[index];+ }+ return array;+ }++ /**+ * Copies properties of `source` to `object`.+ *+ * @private+ * @param {Object} source The object to copy properties from.+ * @param {Array} props The property identifiers to copy.+ * @param {Object} [object={}] The object to copy properties to.+ * @param {Function} [customizer] The function to customize copied values.+ * @returns {Object} Returns `object`.+ */+ function copyObject(source, props, object, customizer) {+ var isNew = !object;+ object || (object = {});++ var index = -1,+ length = props.length;++ while (++index < length) {+ var key = props[index];++ var newValue = customizer+ ? customizer(object[key], source[key], key, object, source)+ : undefined;++ if (newValue === undefined) {+ newValue = source[key];+ }+ if (isNew) {+ baseAssignValue(object, key, newValue);+ } else {+ assignValue(object, key, newValue);+ }+ }+ return object;+ }++ /**+ * Copies own symbols of `source` to `object`.+ *+ * @private+ * @param {Object} source The object to copy symbols from.+ * @param {Object} [object={}] The object to copy symbols to.+ * @returns {Object} Returns `object`.+ */+ function copySymbols(source, object) {+ return copyObject(source, getSymbols(source), object);+ }++ /**+ * Copies own and inherited symbols of `source` to `object`.+ *+ * @private+ * @param {Object} source The object to copy symbols from.+ * @param {Object} [object={}] The object to copy symbols to.+ * @returns {Object} Returns `object`.+ */+ function copySymbolsIn(source, object) {+ return copyObject(source, getSymbolsIn(source), object);+ }++ /**+ * Creates a function like `_.groupBy`.+ *+ * @private+ * @param {Function} setter The function to set accumulator values.+ * @param {Function} [initializer] The accumulator object initializer.+ * @returns {Function} Returns the new aggregator function.+ */+ function createAggregator(setter, initializer) {+ return function(collection, iteratee) {+ var func = isArray(collection) ? arrayAggregator : baseAggregator,+ accumulator = initializer ? initializer() : {};++ return func(collection, setter, getIteratee(iteratee, 2), accumulator);+ };+ }++ /**+ * Creates a function like `_.assign`.+ *+ * @private+ * @param {Function} assigner The function to assign values.+ * @returns {Function} Returns the new assigner function.+ */+ function createAssigner(assigner) {+ return baseRest(function(object, sources) {+ var index = -1,+ length = sources.length,+ customizer = length > 1 ? sources[length - 1] : undefined,+ guard = length > 2 ? sources[2] : undefined;++ customizer = (assigner.length > 3 && typeof customizer == 'function')+ ? (length--, customizer)+ : undefined;++ if (guard && isIterateeCall(sources[0], sources[1], guard)) {+ customizer = length < 3 ? undefined : customizer;+ length = 1;+ }+ object = Object(object);+ while (++index < length) {+ var source = sources[index];+ if (source) {+ assigner(object, source, index, customizer);+ }+ }+ return object;+ });+ }++ /**+ * Creates a `baseEach` or `baseEachRight` function.+ *+ * @private+ * @param {Function} eachFunc The function to iterate over a collection.+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Function} Returns the new base function.+ */+ function createBaseEach(eachFunc, fromRight) {+ return function(collection, iteratee) {+ if (collection == null) {+ return collection;+ }+ if (!isArrayLike(collection)) {+ return eachFunc(collection, iteratee);+ }+ var length = collection.length,+ index = fromRight ? length : -1,+ iterable = Object(collection);++ while ((fromRight ? index-- : ++index < length)) {+ if (iteratee(iterable[index], index, iterable) === false) {+ break;+ }+ }+ return collection;+ };+ }++ /**+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.+ *+ * @private+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Function} Returns the new base function.+ */+ function createBaseFor(fromRight) {+ return function(object, iteratee, keysFunc) {+ var index = -1,+ iterable = Object(object),+ props = keysFunc(object),+ length = props.length;++ while (length--) {+ var key = props[fromRight ? length : ++index];+ if (iteratee(iterable[key], key, iterable) === false) {+ break;+ }+ }+ return object;+ };+ }++ /**+ * Creates a function that wraps `func` to invoke it with the optional `this`+ * binding of `thisArg`.+ *+ * @private+ * @param {Function} func The function to wrap.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @param {*} [thisArg] The `this` binding of `func`.+ * @returns {Function} Returns the new wrapped function.+ */+ function createBind(func, bitmask, thisArg) {+ var isBind = bitmask & WRAP_BIND_FLAG,+ Ctor = createCtor(func);++ function wrapper() {+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;+ return fn.apply(isBind ? thisArg : this, arguments);+ }+ return wrapper;+ }++ /**+ * Creates a function like `_.lowerFirst`.+ *+ * @private+ * @param {string} methodName The name of the `String` case method to use.+ * @returns {Function} Returns the new case function.+ */+ function createCaseFirst(methodName) {+ return function(string) {+ string = toString(string);++ var strSymbols = hasUnicode(string)+ ? stringToArray(string)+ : undefined;++ var chr = strSymbols+ ? strSymbols[0]+ : string.charAt(0);++ var trailing = strSymbols+ ? castSlice(strSymbols, 1).join('')+ : string.slice(1);++ return chr[methodName]() + trailing;+ };+ }++ /**+ * Creates a function like `_.camelCase`.+ *+ * @private+ * @param {Function} callback The function to combine each word.+ * @returns {Function} Returns the new compounder function.+ */+ function createCompounder(callback) {+ return function(string) {+ return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');+ };+ }++ /**+ * Creates a function that produces an instance of `Ctor` regardless of+ * whether it was invoked as part of a `new` expression or by `call` or `apply`.+ *+ * @private+ * @param {Function} Ctor The constructor to wrap.+ * @returns {Function} Returns the new wrapped function.+ */+ function createCtor(Ctor) {+ return function() {+ // Use a `switch` statement to work with class constructors. See+ // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist+ // for more details.+ var args = arguments;+ switch (args.length) {+ case 0: return new Ctor;+ case 1: return new Ctor(args[0]);+ case 2: return new Ctor(args[0], args[1]);+ case 3: return new Ctor(args[0], args[1], args[2]);+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);+ case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);+ case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);+ }+ var thisBinding = baseCreate(Ctor.prototype),+ result = Ctor.apply(thisBinding, args);++ // Mimic the constructor's `return` behavior.+ // See https://es5.github.io/#x13.2.2 for more details.+ return isObject(result) ? result : thisBinding;+ };+ }++ /**+ * Creates a function that wraps `func` to enable currying.+ *+ * @private+ * @param {Function} func The function to wrap.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @param {number} arity The arity of `func`.+ * @returns {Function} Returns the new wrapped function.+ */+ function createCurry(func, bitmask, arity) {+ var Ctor = createCtor(func);++ function wrapper() {+ var length = arguments.length,+ args = Array(length),+ index = length,+ placeholder = getHolder(wrapper);++ while (index--) {+ args[index] = arguments[index];+ }+ var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)+ ? []+ : replaceHolders(args, placeholder);++ length -= holders.length;+ if (length < arity) {+ return createRecurry(+ func, bitmask, createHybrid, wrapper.placeholder, undefined,+ args, holders, undefined, undefined, arity - length);+ }+ var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;+ return apply(fn, this, args);+ }+ return wrapper;+ }++ /**+ * Creates a `_.find` or `_.findLast` function.+ *+ * @private+ * @param {Function} findIndexFunc The function to find the collection index.+ * @returns {Function} Returns the new find function.+ */+ function createFind(findIndexFunc) {+ return function(collection, predicate, fromIndex) {+ var iterable = Object(collection);+ if (!isArrayLike(collection)) {+ var iteratee = getIteratee(predicate, 3);+ collection = keys(collection);+ predicate = function(key) { return iteratee(iterable[key], key, iterable); };+ }+ var index = findIndexFunc(collection, predicate, fromIndex);+ return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;+ };+ }++ /**+ * Creates a `_.flow` or `_.flowRight` function.+ *+ * @private+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Function} Returns the new flow function.+ */+ function createFlow(fromRight) {+ return flatRest(function(funcs) {+ var length = funcs.length,+ index = length,+ prereq = LodashWrapper.prototype.thru;++ if (fromRight) {+ funcs.reverse();+ }+ while (index--) {+ var func = funcs[index];+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ if (prereq && !wrapper && getFuncName(func) == 'wrapper') {+ var wrapper = new LodashWrapper([], true);+ }+ }+ index = wrapper ? index : length;+ while (++index < length) {+ func = funcs[index];++ var funcName = getFuncName(func),+ data = funcName == 'wrapper' ? getData(func) : undefined;++ if (data && isLaziable(data[0]) &&+ data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&+ !data[4].length && data[9] == 1+ ) {+ wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);+ } else {+ wrapper = (func.length == 1 && isLaziable(func))+ ? wrapper[funcName]()+ : wrapper.thru(func);+ }+ }+ return function() {+ var args = arguments,+ value = args[0];++ if (wrapper && args.length == 1 && isArray(value)) {+ return wrapper.plant(value).value();+ }+ var index = 0,+ result = length ? funcs[index].apply(this, args) : value;++ while (++index < length) {+ result = funcs[index].call(this, result);+ }+ return result;+ };+ });+ }++ /**+ * Creates a function that wraps `func` to invoke it with optional `this`+ * binding of `thisArg`, partial application, and currying.+ *+ * @private+ * @param {Function|string} func The function or method name to wrap.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @param {*} [thisArg] The `this` binding of `func`.+ * @param {Array} [partials] The arguments to prepend to those provided to+ * the new function.+ * @param {Array} [holders] The `partials` placeholder indexes.+ * @param {Array} [partialsRight] The arguments to append to those provided+ * to the new function.+ * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.+ * @param {Array} [argPos] The argument positions of the new function.+ * @param {number} [ary] The arity cap of `func`.+ * @param {number} [arity] The arity of `func`.+ * @returns {Function} Returns the new wrapped function.+ */+ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {+ var isAry = bitmask & WRAP_ARY_FLAG,+ isBind = bitmask & WRAP_BIND_FLAG,+ isBindKey = bitmask & WRAP_BIND_KEY_FLAG,+ isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),+ isFlip = bitmask & WRAP_FLIP_FLAG,+ Ctor = isBindKey ? undefined : createCtor(func);++ function wrapper() {+ var length = arguments.length,+ args = Array(length),+ index = length;++ while (index--) {+ args[index] = arguments[index];+ }+ if (isCurried) {+ var placeholder = getHolder(wrapper),+ holdersCount = countHolders(args, placeholder);+ }+ if (partials) {+ args = composeArgs(args, partials, holders, isCurried);+ }+ if (partialsRight) {+ args = composeArgsRight(args, partialsRight, holdersRight, isCurried);+ }+ length -= holdersCount;+ if (isCurried && length < arity) {+ var newHolders = replaceHolders(args, placeholder);+ return createRecurry(+ func, bitmask, createHybrid, wrapper.placeholder, thisArg,+ args, newHolders, argPos, ary, arity - length+ );+ }+ var thisBinding = isBind ? thisArg : this,+ fn = isBindKey ? thisBinding[func] : func;++ length = args.length;+ if (argPos) {+ args = reorder(args, argPos);+ } else if (isFlip && length > 1) {+ args.reverse();+ }+ if (isAry && ary < length) {+ args.length = ary;+ }+ if (this && this !== root && this instanceof wrapper) {+ fn = Ctor || createCtor(fn);+ }+ return fn.apply(thisBinding, args);+ }+ return wrapper;+ }++ /**+ * Creates a function like `_.invertBy`.+ *+ * @private+ * @param {Function} setter The function to set accumulator values.+ * @param {Function} toIteratee The function to resolve iteratees.+ * @returns {Function} Returns the new inverter function.+ */+ function createInverter(setter, toIteratee) {+ return function(object, iteratee) {+ return baseInverter(object, setter, toIteratee(iteratee), {});+ };+ }++ /**+ * Creates a function that performs a mathematical operation on two values.+ *+ * @private+ * @param {Function} operator The function to perform the operation.+ * @param {number} [defaultValue] The value used for `undefined` arguments.+ * @returns {Function} Returns the new mathematical operation function.+ */+ function createMathOperation(operator, defaultValue) {+ return function(value, other) {+ var result;+ if (value === undefined && other === undefined) {+ return defaultValue;+ }+ if (value !== undefined) {+ result = value;+ }+ if (other !== undefined) {+ if (result === undefined) {+ return other;+ }+ if (typeof value == 'string' || typeof other == 'string') {+ value = baseToString(value);+ other = baseToString(other);+ } else {+ value = baseToNumber(value);+ other = baseToNumber(other);+ }+ result = operator(value, other);+ }+ return result;+ };+ }++ /**+ * Creates a function like `_.over`.+ *+ * @private+ * @param {Function} arrayFunc The function to iterate over iteratees.+ * @returns {Function} Returns the new over function.+ */+ function createOver(arrayFunc) {+ return flatRest(function(iteratees) {+ iteratees = arrayMap(iteratees, baseUnary(getIteratee()));+ return baseRest(function(args) {+ var thisArg = this;+ return arrayFunc(iteratees, function(iteratee) {+ return apply(iteratee, thisArg, args);+ });+ });+ });+ }++ /**+ * Creates the padding for `string` based on `length`. The `chars` string+ * is truncated if the number of characters exceeds `length`.+ *+ * @private+ * @param {number} length The padding length.+ * @param {string} [chars=' '] The string used as padding.+ * @returns {string} Returns the padding for `string`.+ */+ function createPadding(length, chars) {+ chars = chars === undefined ? ' ' : baseToString(chars);++ var charsLength = chars.length;+ if (charsLength < 2) {+ return charsLength ? baseRepeat(chars, length) : chars;+ }+ var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));+ return hasUnicode(chars)+ ? castSlice(stringToArray(result), 0, length).join('')+ : result.slice(0, length);+ }++ /**+ * Creates a function that wraps `func` to invoke it with the `this` binding+ * of `thisArg` and `partials` prepended to the arguments it receives.+ *+ * @private+ * @param {Function} func The function to wrap.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @param {*} thisArg The `this` binding of `func`.+ * @param {Array} partials The arguments to prepend to those provided to+ * the new function.+ * @returns {Function} Returns the new wrapped function.+ */+ function createPartial(func, bitmask, thisArg, partials) {+ var isBind = bitmask & WRAP_BIND_FLAG,+ Ctor = createCtor(func);++ function wrapper() {+ var argsIndex = -1,+ argsLength = arguments.length,+ leftIndex = -1,+ leftLength = partials.length,+ args = Array(leftLength + argsLength),+ fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;++ while (++leftIndex < leftLength) {+ args[leftIndex] = partials[leftIndex];+ }+ while (argsLength--) {+ args[leftIndex++] = arguments[++argsIndex];+ }+ return apply(fn, isBind ? thisArg : this, args);+ }+ return wrapper;+ }++ /**+ * Creates a `_.range` or `_.rangeRight` function.+ *+ * @private+ * @param {boolean} [fromRight] Specify iterating from right to left.+ * @returns {Function} Returns the new range function.+ */+ function createRange(fromRight) {+ return function(start, end, step) {+ if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {+ end = step = undefined;+ }+ // Ensure the sign of `-0` is preserved.+ start = toFinite(start);+ if (end === undefined) {+ end = start;+ start = 0;+ } else {+ end = toFinite(end);+ }+ step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);+ return baseRange(start, end, step, fromRight);+ };+ }++ /**+ * Creates a function that performs a relational operation on two values.+ *+ * @private+ * @param {Function} operator The function to perform the operation.+ * @returns {Function} Returns the new relational operation function.+ */+ function createRelationalOperation(operator) {+ return function(value, other) {+ if (!(typeof value == 'string' && typeof other == 'string')) {+ value = toNumber(value);+ other = toNumber(other);+ }+ return operator(value, other);+ };+ }++ /**+ * Creates a function that wraps `func` to continue currying.+ *+ * @private+ * @param {Function} func The function to wrap.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @param {Function} wrapFunc The function to create the `func` wrapper.+ * @param {*} placeholder The placeholder value.+ * @param {*} [thisArg] The `this` binding of `func`.+ * @param {Array} [partials] The arguments to prepend to those provided to+ * the new function.+ * @param {Array} [holders] The `partials` placeholder indexes.+ * @param {Array} [argPos] The argument positions of the new function.+ * @param {number} [ary] The arity cap of `func`.+ * @param {number} [arity] The arity of `func`.+ * @returns {Function} Returns the new wrapped function.+ */+ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {+ var isCurry = bitmask & WRAP_CURRY_FLAG,+ newHolders = isCurry ? holders : undefined,+ newHoldersRight = isCurry ? undefined : holders,+ newPartials = isCurry ? partials : undefined,+ newPartialsRight = isCurry ? undefined : partials;++ bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);+ bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);++ if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {+ bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);+ }+ var newData = [+ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,+ newHoldersRight, argPos, ary, arity+ ];++ var result = wrapFunc.apply(undefined, newData);+ if (isLaziable(func)) {+ setData(result, newData);+ }+ result.placeholder = placeholder;+ return setWrapToString(result, func, bitmask);+ }++ /**+ * Creates a function like `_.round`.+ *+ * @private+ * @param {string} methodName The name of the `Math` method to use when rounding.+ * @returns {Function} Returns the new round function.+ */+ function createRound(methodName) {+ var func = Math[methodName];+ return function(number, precision) {+ number = toNumber(number);+ precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);+ if (precision) {+ // Shift with exponential notation to avoid floating-point issues.+ // See [MDN](https://mdn.io/round#Examples) for more details.+ var pair = (toString(number) + 'e').split('e'),+ value = func(pair[0] + 'e' + (+pair[1] + precision));++ pair = (toString(value) + 'e').split('e');+ return +(pair[0] + 'e' + (+pair[1] - precision));+ }+ return func(number);+ };+ }++ /**+ * Creates a set object of `values`.+ *+ * @private+ * @param {Array} values The values to add to the set.+ * @returns {Object} Returns the new set.+ */+ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {+ return new Set(values);+ };++ /**+ * Creates a `_.toPairs` or `_.toPairsIn` function.+ *+ * @private+ * @param {Function} keysFunc The function to get the keys of a given object.+ * @returns {Function} Returns the new pairs function.+ */+ function createToPairs(keysFunc) {+ return function(object) {+ var tag = getTag(object);+ if (tag == mapTag) {+ return mapToArray(object);+ }+ if (tag == setTag) {+ return setToPairs(object);+ }+ return baseToPairs(object, keysFunc(object));+ };+ }++ /**+ * Creates a function that either curries or invokes `func` with optional+ * `this` binding and partially applied arguments.+ *+ * @private+ * @param {Function|string} func The function or method name to wrap.+ * @param {number} bitmask The bitmask flags.+ * 1 - `_.bind`+ * 2 - `_.bindKey`+ * 4 - `_.curry` or `_.curryRight` of a bound function+ * 8 - `_.curry`+ * 16 - `_.curryRight`+ * 32 - `_.partial`+ * 64 - `_.partialRight`+ * 128 - `_.rearg`+ * 256 - `_.ary`+ * 512 - `_.flip`+ * @param {*} [thisArg] The `this` binding of `func`.+ * @param {Array} [partials] The arguments to be partially applied.+ * @param {Array} [holders] The `partials` placeholder indexes.+ * @param {Array} [argPos] The argument positions of the new function.+ * @param {number} [ary] The arity cap of `func`.+ * @param {number} [arity] The arity of `func`.+ * @returns {Function} Returns the new wrapped function.+ */+ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {+ var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;+ if (!isBindKey && typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ var length = partials ? partials.length : 0;+ if (!length) {+ bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);+ partials = holders = undefined;+ }+ ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);+ arity = arity === undefined ? arity : toInteger(arity);+ length -= holders ? holders.length : 0;++ if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {+ var partialsRight = partials,+ holdersRight = holders;++ partials = holders = undefined;+ }+ var data = isBindKey ? undefined : getData(func);++ var newData = [+ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,+ argPos, ary, arity+ ];++ if (data) {+ mergeData(newData, data);+ }+ func = newData[0];+ bitmask = newData[1];+ thisArg = newData[2];+ partials = newData[3];+ holders = newData[4];+ arity = newData[9] = newData[9] === undefined+ ? (isBindKey ? 0 : func.length)+ : nativeMax(newData[9] - length, 0);++ if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {+ bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);+ }+ if (!bitmask || bitmask == WRAP_BIND_FLAG) {+ var result = createBind(func, bitmask, thisArg);+ } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {+ result = createCurry(func, bitmask, arity);+ } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {+ result = createPartial(func, bitmask, thisArg, partials);+ } else {+ result = createHybrid.apply(undefined, newData);+ }+ var setter = data ? baseSetData : setData;+ return setWrapToString(setter(result, newData), func, bitmask);+ }++ /**+ * Used by `_.defaults` to customize its `_.assignIn` use to assign properties+ * of source objects to the destination object for all destination properties+ * that resolve to `undefined`.+ *+ * @private+ * @param {*} objValue The destination value.+ * @param {*} srcValue The source value.+ * @param {string} key The key of the property to assign.+ * @param {Object} object The parent object of `objValue`.+ * @returns {*} Returns the value to assign.+ */+ function customDefaultsAssignIn(objValue, srcValue, key, object) {+ if (objValue === undefined ||+ (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {+ return srcValue;+ }+ return objValue;+ }++ /**+ * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source+ * objects into destination objects that are passed thru.+ *+ * @private+ * @param {*} objValue The destination value.+ * @param {*} srcValue The source value.+ * @param {string} key The key of the property to merge.+ * @param {Object} object The parent object of `objValue`.+ * @param {Object} source The parent object of `srcValue`.+ * @param {Object} [stack] Tracks traversed source values and their merged+ * counterparts.+ * @returns {*} Returns the value to assign.+ */+ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {+ if (isObject(objValue) && isObject(srcValue)) {+ // Recursively merge objects and arrays (susceptible to call stack limits).+ stack.set(srcValue, objValue);+ baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);+ stack['delete'](srcValue);+ }+ return objValue;+ }++ /**+ * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain+ * objects.+ *+ * @private+ * @param {*} value The value to inspect.+ * @param {string} key The key of the property to inspect.+ * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.+ */+ function customOmitClone(value) {+ return isPlainObject(value) ? undefined : value;+ }++ /**+ * A specialized version of `baseIsEqualDeep` for arrays with support for+ * partial deep comparisons.+ *+ * @private+ * @param {Array} array The array to compare.+ * @param {Array} other The other array to compare.+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.+ * @param {Function} customizer The function to customize comparisons.+ * @param {Function} equalFunc The function to determine equivalents of values.+ * @param {Object} stack Tracks traversed `array` and `other` objects.+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.+ */+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,+ arrLength = array.length,+ othLength = other.length;++ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {+ return false;+ }+ // Assume cyclic values are equal.+ var stacked = stack.get(array);+ if (stacked && stack.get(other)) {+ return stacked == other;+ }+ var index = -1,+ result = true,+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;++ stack.set(array, other);+ stack.set(other, array);++ // Ignore non-index properties.+ while (++index < arrLength) {+ var arrValue = array[index],+ othValue = other[index];++ if (customizer) {+ var compared = isPartial+ ? customizer(othValue, arrValue, index, other, array, stack)+ : customizer(arrValue, othValue, index, array, other, stack);+ }+ if (compared !== undefined) {+ if (compared) {+ continue;+ }+ result = false;+ break;+ }+ // Recursively compare arrays (susceptible to call stack limits).+ if (seen) {+ if (!arraySome(other, function(othValue, othIndex) {+ if (!cacheHas(seen, othIndex) &&+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {+ return seen.push(othIndex);+ }+ })) {+ result = false;+ break;+ }+ } else if (!(+ arrValue === othValue ||+ equalFunc(arrValue, othValue, bitmask, customizer, stack)+ )) {+ result = false;+ break;+ }+ }+ stack['delete'](array);+ stack['delete'](other);+ return result;+ }++ /**+ * A specialized version of `baseIsEqualDeep` for comparing objects of+ * the same `toStringTag`.+ *+ * **Note:** This function only supports comparing values with tags of+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.+ *+ * @private+ * @param {Object} object The object to compare.+ * @param {Object} other The other object to compare.+ * @param {string} tag The `toStringTag` of the objects to compare.+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.+ * @param {Function} customizer The function to customize comparisons.+ * @param {Function} equalFunc The function to determine equivalents of values.+ * @param {Object} stack Tracks traversed `object` and `other` objects.+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.+ */+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {+ switch (tag) {+ case dataViewTag:+ if ((object.byteLength != other.byteLength) ||+ (object.byteOffset != other.byteOffset)) {+ return false;+ }+ object = object.buffer;+ other = other.buffer;++ case arrayBufferTag:+ if ((object.byteLength != other.byteLength) ||+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {+ return false;+ }+ return true;++ case boolTag:+ case dateTag:+ case numberTag:+ // Coerce booleans to `1` or `0` and dates to milliseconds.+ // Invalid dates are coerced to `NaN`.+ return eq(+object, +other);++ case errorTag:+ return object.name == other.name && object.message == other.message;++ case regexpTag:+ case stringTag:+ // Coerce regexes to strings and treat strings, primitives and objects,+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring+ // for more details.+ return object == (other + '');++ case mapTag:+ var convert = mapToArray;++ case setTag:+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;+ convert || (convert = setToArray);++ if (object.size != other.size && !isPartial) {+ return false;+ }+ // Assume cyclic values are equal.+ var stacked = stack.get(object);+ if (stacked) {+ return stacked == other;+ }+ bitmask |= COMPARE_UNORDERED_FLAG;++ // Recursively compare objects (susceptible to call stack limits).+ stack.set(object, other);+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);+ stack['delete'](object);+ return result;++ case symbolTag:+ if (symbolValueOf) {+ return symbolValueOf.call(object) == symbolValueOf.call(other);+ }+ }+ return false;+ }++ /**+ * A specialized version of `baseIsEqualDeep` for objects with support for+ * partial deep comparisons.+ *+ * @private+ * @param {Object} object The object to compare.+ * @param {Object} other The other object to compare.+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.+ * @param {Function} customizer The function to customize comparisons.+ * @param {Function} equalFunc The function to determine equivalents of values.+ * @param {Object} stack Tracks traversed `object` and `other` objects.+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.+ */+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,+ objProps = getAllKeys(object),+ objLength = objProps.length,+ othProps = getAllKeys(other),+ othLength = othProps.length;++ if (objLength != othLength && !isPartial) {+ return false;+ }+ var index = objLength;+ while (index--) {+ var key = objProps[index];+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {+ return false;+ }+ }+ // Assume cyclic values are equal.+ var stacked = stack.get(object);+ if (stacked && stack.get(other)) {+ return stacked == other;+ }+ var result = true;+ stack.set(object, other);+ stack.set(other, object);++ var skipCtor = isPartial;+ while (++index < objLength) {+ key = objProps[index];+ var objValue = object[key],+ othValue = other[key];++ if (customizer) {+ var compared = isPartial+ ? customizer(othValue, objValue, key, other, object, stack)+ : customizer(objValue, othValue, key, object, other, stack);+ }+ // Recursively compare objects (susceptible to call stack limits).+ if (!(compared === undefined+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))+ : compared+ )) {+ result = false;+ break;+ }+ skipCtor || (skipCtor = key == 'constructor');+ }+ if (result && !skipCtor) {+ var objCtor = object.constructor,+ othCtor = other.constructor;++ // Non `Object` object instances with different constructors are not equal.+ if (objCtor != othCtor &&+ ('constructor' in object && 'constructor' in other) &&+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {+ result = false;+ }+ }+ stack['delete'](object);+ stack['delete'](other);+ return result;+ }++ /**+ * A specialized version of `baseRest` which flattens the rest array.+ *+ * @private+ * @param {Function} func The function to apply a rest parameter to.+ * @returns {Function} Returns the new function.+ */+ function flatRest(func) {+ return setToString(overRest(func, undefined, flatten), func + '');+ }++ /**+ * Creates an array of own enumerable property names and symbols of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names and symbols.+ */+ function getAllKeys(object) {+ return baseGetAllKeys(object, keys, getSymbols);+ }++ /**+ * Creates an array of own and inherited enumerable property names and+ * symbols of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names and symbols.+ */+ function getAllKeysIn(object) {+ return baseGetAllKeys(object, keysIn, getSymbolsIn);+ }++ /**+ * Gets metadata for `func`.+ *+ * @private+ * @param {Function} func The function to query.+ * @returns {*} Returns the metadata for `func`.+ */+ var getData = !metaMap ? noop : function(func) {+ return metaMap.get(func);+ };++ /**+ * Gets the name of `func`.+ *+ * @private+ * @param {Function} func The function to query.+ * @returns {string} Returns the function name.+ */+ function getFuncName(func) {+ var result = (func.name + ''),+ array = realNames[result],+ length = hasOwnProperty.call(realNames, result) ? array.length : 0;++ while (length--) {+ var data = array[length],+ otherFunc = data.func;+ if (otherFunc == null || otherFunc == func) {+ return data.name;+ }+ }+ return result;+ }++ /**+ * Gets the argument placeholder value for `func`.+ *+ * @private+ * @param {Function} func The function to inspect.+ * @returns {*} Returns the placeholder value.+ */+ function getHolder(func) {+ var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;+ return object.placeholder;+ }++ /**+ * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,+ * this function returns the custom method, otherwise it returns `baseIteratee`.+ * If arguments are provided, the chosen function is invoked with them and+ * its result is returned.+ *+ * @private+ * @param {*} [value] The value to convert to an iteratee.+ * @param {number} [arity] The arity of the created iteratee.+ * @returns {Function} Returns the chosen function or its result.+ */+ function getIteratee() {+ var result = lodash.iteratee || iteratee;+ result = result === iteratee ? baseIteratee : result;+ return arguments.length ? result(arguments[0], arguments[1]) : result;+ }++ /**+ * Gets the data for `map`.+ *+ * @private+ * @param {Object} map The map to query.+ * @param {string} key The reference key.+ * @returns {*} Returns the map data.+ */+ function getMapData(map, key) {+ var data = map.__data__;+ return isKeyable(key)+ ? data[typeof key == 'string' ? 'string' : 'hash']+ : data.map;+ }++ /**+ * Gets the property names, values, and compare flags of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the match data of `object`.+ */+ function getMatchData(object) {+ var result = keys(object),+ length = result.length;++ while (length--) {+ var key = result[length],+ value = object[key];++ result[length] = [key, value, isStrictComparable(value)];+ }+ return result;+ }++ /**+ * Gets the native function at `key` of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {string} key The key of the method to get.+ * @returns {*} Returns the function if it's native, else `undefined`.+ */+ function getNative(object, key) {+ var value = getValue(object, key);+ return baseIsNative(value) ? value : undefined;+ }++ /**+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.+ *+ * @private+ * @param {*} value The value to query.+ * @returns {string} Returns the raw `toStringTag`.+ */+ function getRawTag(value) {+ var isOwn = hasOwnProperty.call(value, symToStringTag),+ tag = value[symToStringTag];++ try {+ value[symToStringTag] = undefined;+ var unmasked = true;+ } catch (e) {}++ var result = nativeObjectToString.call(value);+ if (unmasked) {+ if (isOwn) {+ value[symToStringTag] = tag;+ } else {+ delete value[symToStringTag];+ }+ }+ return result;+ }++ /**+ * Creates an array of the own enumerable symbols of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of symbols.+ */+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {+ if (object == null) {+ return [];+ }+ object = Object(object);+ return arrayFilter(nativeGetSymbols(object), function(symbol) {+ return propertyIsEnumerable.call(object, symbol);+ });+ };++ /**+ * Creates an array of the own and inherited enumerable symbols of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of symbols.+ */+ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {+ var result = [];+ while (object) {+ arrayPush(result, getSymbols(object));+ object = getPrototype(object);+ }+ return result;+ };++ /**+ * Gets the `toStringTag` of `value`.+ *+ * @private+ * @param {*} value The value to query.+ * @returns {string} Returns the `toStringTag`.+ */+ var getTag = baseGetTag;++ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||+ (Map && getTag(new Map) != mapTag) ||+ (Promise && getTag(Promise.resolve()) != promiseTag) ||+ (Set && getTag(new Set) != setTag) ||+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {+ getTag = function(value) {+ var result = baseGetTag(value),+ Ctor = result == objectTag ? value.constructor : undefined,+ ctorString = Ctor ? toSource(Ctor) : '';++ if (ctorString) {+ switch (ctorString) {+ case dataViewCtorString: return dataViewTag;+ case mapCtorString: return mapTag;+ case promiseCtorString: return promiseTag;+ case setCtorString: return setTag;+ case weakMapCtorString: return weakMapTag;+ }+ }+ return result;+ };+ }++ /**+ * Gets the view, applying any `transforms` to the `start` and `end` positions.+ *+ * @private+ * @param {number} start The start of the view.+ * @param {number} end The end of the view.+ * @param {Array} transforms The transformations to apply to the view.+ * @returns {Object} Returns an object containing the `start` and `end`+ * positions of the view.+ */+ function getView(start, end, transforms) {+ var index = -1,+ length = transforms.length;++ while (++index < length) {+ var data = transforms[index],+ size = data.size;++ switch (data.type) {+ case 'drop': start += size; break;+ case 'dropRight': end -= size; break;+ case 'take': end = nativeMin(end, start + size); break;+ case 'takeRight': start = nativeMax(start, end - size); break;+ }+ }+ return { 'start': start, 'end': end };+ }++ /**+ * Extracts wrapper details from the `source` body comment.+ *+ * @private+ * @param {string} source The source to inspect.+ * @returns {Array} Returns the wrapper details.+ */+ function getWrapDetails(source) {+ var match = source.match(reWrapDetails);+ return match ? match[1].split(reSplitDetails) : [];+ }++ /**+ * Checks if `path` exists on `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array|string} path The path to check.+ * @param {Function} hasFunc The function to check properties.+ * @returns {boolean} Returns `true` if `path` exists, else `false`.+ */+ function hasPath(object, path, hasFunc) {+ path = castPath(path, object);++ var index = -1,+ length = path.length,+ result = false;++ while (++index < length) {+ var key = toKey(path[index]);+ if (!(result = object != null && hasFunc(object, key))) {+ break;+ }+ object = object[key];+ }+ if (result || ++index != length) {+ return result;+ }+ length = object == null ? 0 : object.length;+ return !!length && isLength(length) && isIndex(key, length) &&+ (isArray(object) || isArguments(object));+ }++ /**+ * Initializes an array clone.+ *+ * @private+ * @param {Array} array The array to clone.+ * @returns {Array} Returns the initialized clone.+ */+ function initCloneArray(array) {+ var length = array.length,+ result = array.constructor(length);++ // Add properties assigned by `RegExp#exec`.+ if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {+ result.index = array.index;+ result.input = array.input;+ }+ return result;+ }++ /**+ * Initializes an object clone.+ *+ * @private+ * @param {Object} object The object to clone.+ * @returns {Object} Returns the initialized clone.+ */+ function initCloneObject(object) {+ return (typeof object.constructor == 'function' && !isPrototype(object))+ ? baseCreate(getPrototype(object))+ : {};+ }++ /**+ * Initializes an object clone based on its `toStringTag`.+ *+ * **Note:** This function only supports cloning values with tags of+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.+ *+ * @private+ * @param {Object} object The object to clone.+ * @param {string} tag The `toStringTag` of the object to clone.+ * @param {Function} cloneFunc The function to clone values.+ * @param {boolean} [isDeep] Specify a deep clone.+ * @returns {Object} Returns the initialized clone.+ */+ function initCloneByTag(object, tag, cloneFunc, isDeep) {+ var Ctor = object.constructor;+ switch (tag) {+ case arrayBufferTag:+ return cloneArrayBuffer(object);++ case boolTag:+ case dateTag:+ return new Ctor(+object);++ case dataViewTag:+ return cloneDataView(object, isDeep);++ case float32Tag: case float64Tag:+ case int8Tag: case int16Tag: case int32Tag:+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:+ return cloneTypedArray(object, isDeep);++ case mapTag:+ return cloneMap(object, isDeep, cloneFunc);++ case numberTag:+ case stringTag:+ return new Ctor(object);++ case regexpTag:+ return cloneRegExp(object);++ case setTag:+ return cloneSet(object, isDeep, cloneFunc);++ case symbolTag:+ return cloneSymbol(object);+ }+ }++ /**+ * Inserts wrapper `details` in a comment at the top of the `source` body.+ *+ * @private+ * @param {string} source The source to modify.+ * @returns {Array} details The details to insert.+ * @returns {string} Returns the modified source.+ */+ function insertWrapDetails(source, details) {+ var length = details.length;+ if (!length) {+ return source;+ }+ var lastIndex = length - 1;+ details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];+ details = details.join(length > 2 ? ', ' : ' ');+ return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');+ }++ /**+ * Checks if `value` is a flattenable `arguments` object or array.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.+ */+ function isFlattenable(value) {+ return isArray(value) || isArguments(value) ||+ !!(spreadableSymbol && value && value[spreadableSymbol]);+ }++ /**+ * Checks if `value` is a valid array-like index.+ *+ * @private+ * @param {*} value The value to check.+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.+ */+ function isIndex(value, length) {+ length = length == null ? MAX_SAFE_INTEGER : length;+ return !!length &&+ (typeof value == 'number' || reIsUint.test(value)) &&+ (value > -1 && value % 1 == 0 && value < length);+ }++ /**+ * Checks if the given arguments are from an iteratee call.+ *+ * @private+ * @param {*} value The potential iteratee value argument.+ * @param {*} index The potential iteratee index or key argument.+ * @param {*} object The potential iteratee object argument.+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,+ * else `false`.+ */+ function isIterateeCall(value, index, object) {+ if (!isObject(object)) {+ return false;+ }+ var type = typeof index;+ if (type == 'number'+ ? (isArrayLike(object) && isIndex(index, object.length))+ : (type == 'string' && index in object)+ ) {+ return eq(object[index], value);+ }+ return false;+ }++ /**+ * Checks if `value` is a property name and not a property path.+ *+ * @private+ * @param {*} value The value to check.+ * @param {Object} [object] The object to query keys on.+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.+ */+ function isKey(value, object) {+ if (isArray(value)) {+ return false;+ }+ var type = typeof value;+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||+ value == null || isSymbol(value)) {+ return true;+ }+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||+ (object != null && value in Object(object));+ }++ /**+ * Checks if `value` is suitable for use as unique object key.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.+ */+ function isKeyable(value) {+ var type = typeof value;+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')+ ? (value !== '__proto__')+ : (value === null);+ }++ /**+ * Checks if `func` has a lazy counterpart.+ *+ * @private+ * @param {Function} func The function to check.+ * @returns {boolean} Returns `true` if `func` has a lazy counterpart,+ * else `false`.+ */+ function isLaziable(func) {+ var funcName = getFuncName(func),+ other = lodash[funcName];++ if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {+ return false;+ }+ if (func === other) {+ return true;+ }+ var data = getData(other);+ return !!data && func === data[0];+ }++ /**+ * Checks if `func` has its source masked.+ *+ * @private+ * @param {Function} func The function to check.+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.+ */+ function isMasked(func) {+ return !!maskSrcKey && (maskSrcKey in func);+ }++ /**+ * Checks if `func` is capable of being masked.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `func` is maskable, else `false`.+ */+ var isMaskable = coreJsData ? isFunction : stubFalse;++ /**+ * Checks if `value` is likely a prototype object.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.+ */+ function isPrototype(value) {+ var Ctor = value && value.constructor,+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;++ return value === proto;+ }++ /**+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.+ *+ * @private+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` if suitable for strict+ * equality comparisons, else `false`.+ */+ function isStrictComparable(value) {+ return value === value && !isObject(value);+ }++ /**+ * A specialized version of `matchesProperty` for source values suitable+ * for strict equality comparisons, i.e. `===`.+ *+ * @private+ * @param {string} key The key of the property to get.+ * @param {*} srcValue The value to match.+ * @returns {Function} Returns the new spec function.+ */+ function matchesStrictComparable(key, srcValue) {+ return function(object) {+ if (object == null) {+ return false;+ }+ return object[key] === srcValue &&+ (srcValue !== undefined || (key in Object(object)));+ };+ }++ /**+ * A specialized version of `_.memoize` which clears the memoized function's+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.+ *+ * @private+ * @param {Function} func The function to have its output memoized.+ * @returns {Function} Returns the new memoized function.+ */+ function memoizeCapped(func) {+ var result = memoize(func, function(key) {+ if (cache.size === MAX_MEMOIZE_SIZE) {+ cache.clear();+ }+ return key;+ });++ var cache = result.cache;+ return result;+ }++ /**+ * Merges the function metadata of `source` into `data`.+ *+ * Merging metadata reduces the number of wrappers used to invoke a function.+ * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`+ * may be applied regardless of execution order. Methods like `_.ary` and+ * `_.rearg` modify function arguments, making the order in which they are+ * executed important, preventing the merging of metadata. However, we make+ * an exception for a safe combined case where curried functions have `_.ary`+ * and or `_.rearg` applied.+ *+ * @private+ * @param {Array} data The destination metadata.+ * @param {Array} source The source metadata.+ * @returns {Array} Returns `data`.+ */+ function mergeData(data, source) {+ var bitmask = data[1],+ srcBitmask = source[1],+ newBitmask = bitmask | srcBitmask,+ isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);++ var isCombo =+ ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||+ ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||+ ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));++ // Exit early if metadata can't be merged.+ if (!(isCommon || isCombo)) {+ return data;+ }+ // Use source `thisArg` if available.+ if (srcBitmask & WRAP_BIND_FLAG) {+ data[2] = source[2];+ // Set when currying a bound function.+ newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;+ }+ // Compose partial arguments.+ var value = source[3];+ if (value) {+ var partials = data[3];+ data[3] = partials ? composeArgs(partials, value, source[4]) : value;+ data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];+ }+ // Compose partial right arguments.+ value = source[5];+ if (value) {+ partials = data[5];+ data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;+ data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];+ }+ // Use source `argPos` if available.+ value = source[7];+ if (value) {+ data[7] = value;+ }+ // Use source `ary` if it's smaller.+ if (srcBitmask & WRAP_ARY_FLAG) {+ data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);+ }+ // Use source `arity` if one is not provided.+ if (data[9] == null) {+ data[9] = source[9];+ }+ // Use source `func` and merge bitmasks.+ data[0] = source[0];+ data[1] = newBitmask;++ return data;+ }++ /**+ * This function is like+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)+ * except that it includes inherited enumerable properties.+ *+ * @private+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names.+ */+ function nativeKeysIn(object) {+ var result = [];+ if (object != null) {+ for (var key in Object(object)) {+ result.push(key);+ }+ }+ return result;+ }++ /**+ * Converts `value` to a string using `Object.prototype.toString`.+ *+ * @private+ * @param {*} value The value to convert.+ * @returns {string} Returns the converted string.+ */+ function objectToString(value) {+ return nativeObjectToString.call(value);+ }++ /**+ * A specialized version of `baseRest` which transforms the rest array.+ *+ * @private+ * @param {Function} func The function to apply a rest parameter to.+ * @param {number} [start=func.length-1] The start position of the rest parameter.+ * @param {Function} transform The rest array transform.+ * @returns {Function} Returns the new function.+ */+ function overRest(func, start, transform) {+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);+ return function() {+ var args = arguments,+ index = -1,+ length = nativeMax(args.length - start, 0),+ array = Array(length);++ while (++index < length) {+ array[index] = args[start + index];+ }+ index = -1;+ var otherArgs = Array(start + 1);+ while (++index < start) {+ otherArgs[index] = args[index];+ }+ otherArgs[start] = transform(array);+ return apply(func, this, otherArgs);+ };+ }++ /**+ * Gets the parent value at `path` of `object`.+ *+ * @private+ * @param {Object} object The object to query.+ * @param {Array} path The path to get the parent value of.+ * @returns {*} Returns the parent value.+ */+ function parent(object, path) {+ return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));+ }++ /**+ * Reorder `array` according to the specified indexes where the element at+ * the first index is assigned as the first element, the element at+ * the second index is assigned as the second element, and so on.+ *+ * @private+ * @param {Array} array The array to reorder.+ * @param {Array} indexes The arranged array indexes.+ * @returns {Array} Returns `array`.+ */+ function reorder(array, indexes) {+ var arrLength = array.length,+ length = nativeMin(indexes.length, arrLength),+ oldArray = copyArray(array);++ while (length--) {+ var index = indexes[length];+ array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;+ }+ return array;+ }++ /**+ * Sets metadata for `func`.+ *+ * **Note:** If this function becomes hot, i.e. is invoked a lot in a short+ * period of time, it will trip its breaker and transition to an identity+ * function to avoid garbage collection pauses in V8. See+ * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)+ * for more details.+ *+ * @private+ * @param {Function} func The function to associate metadata with.+ * @param {*} data The metadata.+ * @returns {Function} Returns `func`.+ */+ var setData = shortOut(baseSetData);++ /**+ * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).+ *+ * @private+ * @param {Function} func The function to delay.+ * @param {number} wait The number of milliseconds to delay invocation.+ * @returns {number|Object} Returns the timer id or timeout object.+ */+ var setTimeout = ctxSetTimeout || function(func, wait) {+ return root.setTimeout(func, wait);+ };++ /**+ * Sets the `toString` method of `func` to return `string`.+ *+ * @private+ * @param {Function} func The function to modify.+ * @param {Function} string The `toString` result.+ * @returns {Function} Returns `func`.+ */+ var setToString = shortOut(baseSetToString);++ /**+ * Sets the `toString` method of `wrapper` to mimic the source of `reference`+ * with wrapper details in a comment at the top of the source body.+ *+ * @private+ * @param {Function} wrapper The function to modify.+ * @param {Function} reference The reference function.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @returns {Function} Returns `wrapper`.+ */+ function setWrapToString(wrapper, reference, bitmask) {+ var source = (reference + '');+ return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));+ }++ /**+ * Creates a function that'll short out and invoke `identity` instead+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`+ * milliseconds.+ *+ * @private+ * @param {Function} func The function to restrict.+ * @returns {Function} Returns the new shortable function.+ */+ function shortOut(func) {+ var count = 0,+ lastCalled = 0;++ return function() {+ var stamp = nativeNow(),+ remaining = HOT_SPAN - (stamp - lastCalled);++ lastCalled = stamp;+ if (remaining > 0) {+ if (++count >= HOT_COUNT) {+ return arguments[0];+ }+ } else {+ count = 0;+ }+ return func.apply(undefined, arguments);+ };+ }++ /**+ * A specialized version of `_.shuffle` which mutates and sets the size of `array`.+ *+ * @private+ * @param {Array} array The array to shuffle.+ * @param {number} [size=array.length] The size of `array`.+ * @returns {Array} Returns `array`.+ */+ function shuffleSelf(array, size) {+ var index = -1,+ length = array.length,+ lastIndex = length - 1;++ size = size === undefined ? length : size;+ while (++index < size) {+ var rand = baseRandom(index, lastIndex),+ value = array[rand];++ array[rand] = array[index];+ array[index] = value;+ }+ array.length = size;+ return array;+ }++ /**+ * Converts `string` to a property path array.+ *+ * @private+ * @param {string} string The string to convert.+ * @returns {Array} Returns the property path array.+ */+ var stringToPath = memoizeCapped(function(string) {+ var result = [];+ if (reLeadingDot.test(string)) {+ result.push('');+ }+ string.replace(rePropName, function(match, number, quote, string) {+ result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));+ });+ return result;+ });++ /**+ * Converts `value` to a string key if it's not a string or symbol.+ *+ * @private+ * @param {*} value The value to inspect.+ * @returns {string|symbol} Returns the key.+ */+ function toKey(value) {+ if (typeof value == 'string' || isSymbol(value)) {+ return value;+ }+ var result = (value + '');+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;+ }++ /**+ * Converts `func` to its source code.+ *+ * @private+ * @param {Function} func The function to convert.+ * @returns {string} Returns the source code.+ */+ function toSource(func) {+ if (func != null) {+ try {+ return funcToString.call(func);+ } catch (e) {}+ try {+ return (func + '');+ } catch (e) {}+ }+ return '';+ }++ /**+ * Updates wrapper `details` based on `bitmask` flags.+ *+ * @private+ * @returns {Array} details The details to modify.+ * @param {number} bitmask The bitmask flags. See `createWrap` for more details.+ * @returns {Array} Returns `details`.+ */+ function updateWrapDetails(details, bitmask) {+ arrayEach(wrapFlags, function(pair) {+ var value = '_.' + pair[0];+ if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {+ details.push(value);+ }+ });+ return details.sort();+ }++ /**+ * Creates a clone of `wrapper`.+ *+ * @private+ * @param {Object} wrapper The wrapper to clone.+ * @returns {Object} Returns the cloned wrapper.+ */+ function wrapperClone(wrapper) {+ if (wrapper instanceof LazyWrapper) {+ return wrapper.clone();+ }+ var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);+ result.__actions__ = copyArray(wrapper.__actions__);+ result.__index__ = wrapper.__index__;+ result.__values__ = wrapper.__values__;+ return result;+ }++ /*------------------------------------------------------------------------*/++ /**+ * Creates an array of elements split into groups the length of `size`.+ * If `array` can't be split evenly, the final chunk will be the remaining+ * elements.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to process.+ * @param {number} [size=1] The length of each chunk+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the new array of chunks.+ * @example+ *+ * _.chunk(['a', 'b', 'c', 'd'], 2);+ * // => [['a', 'b'], ['c', 'd']]+ *+ * _.chunk(['a', 'b', 'c', 'd'], 3);+ * // => [['a', 'b', 'c'], ['d']]+ */+ function chunk(array, size, guard) {+ if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {+ size = 1;+ } else {+ size = nativeMax(toInteger(size), 0);+ }+ var length = array == null ? 0 : array.length;+ if (!length || size < 1) {+ return [];+ }+ var index = 0,+ resIndex = 0,+ result = Array(nativeCeil(length / size));++ while (index < length) {+ result[resIndex++] = baseSlice(array, index, (index += size));+ }+ return result;+ }++ /**+ * Creates an array with all falsey values removed. The values `false`, `null`,+ * `0`, `""`, `undefined`, and `NaN` are falsey.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to compact.+ * @returns {Array} Returns the new array of filtered values.+ * @example+ *+ * _.compact([0, 1, false, 2, '', 3]);+ * // => [1, 2, 3]+ */+ function compact(array) {+ var index = -1,+ length = array == null ? 0 : array.length,+ resIndex = 0,+ result = [];++ while (++index < length) {+ var value = array[index];+ if (value) {+ result[resIndex++] = value;+ }+ }+ return result;+ }++ /**+ * Creates a new array concatenating `array` with any additional arrays+ * and/or values.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to concatenate.+ * @param {...*} [values] The values to concatenate.+ * @returns {Array} Returns the new concatenated array.+ * @example+ *+ * var array = [1];+ * var other = _.concat(array, 2, [3], [[4]]);+ *+ * console.log(other);+ * // => [1, 2, 3, [4]]+ *+ * console.log(array);+ * // => [1]+ */+ function concat() {+ var length = arguments.length;+ if (!length) {+ return [];+ }+ var args = Array(length - 1),+ array = arguments[0],+ index = length;++ while (index--) {+ args[index - 1] = arguments[index];+ }+ return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));+ }++ /**+ * Creates an array of `array` values not included in the other given arrays+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons. The order and references of result values are+ * determined by the first array.+ *+ * **Note:** Unlike `_.pullAll`, this method returns a new array.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {...Array} [values] The values to exclude.+ * @returns {Array} Returns the new array of filtered values.+ * @see _.without, _.xor+ * @example+ *+ * _.difference([2, 1], [2, 3]);+ * // => [1]+ */+ var difference = baseRest(function(array, values) {+ return isArrayLikeObject(array)+ ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))+ : [];+ });++ /**+ * This method is like `_.difference` except that it accepts `iteratee` which+ * is invoked for each element of `array` and `values` to generate the criterion+ * by which they're compared. The order and references of result values are+ * determined by the first array. The iteratee is invoked with one argument:+ * (value).+ *+ * **Note:** Unlike `_.pullAllBy`, this method returns a new array.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {...Array} [values] The values to exclude.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns the new array of filtered values.+ * @example+ *+ * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);+ * // => [1.2]+ *+ * // The `_.property` iteratee shorthand.+ * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');+ * // => [{ 'x': 2 }]+ */+ var differenceBy = baseRest(function(array, values) {+ var iteratee = last(values);+ if (isArrayLikeObject(iteratee)) {+ iteratee = undefined;+ }+ return isArrayLikeObject(array)+ ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))+ : [];+ });++ /**+ * This method is like `_.difference` except that it accepts `comparator`+ * which is invoked to compare elements of `array` to `values`. The order and+ * references of result values are determined by the first array. The comparator+ * is invoked with two arguments: (arrVal, othVal).+ *+ * **Note:** Unlike `_.pullAllWith`, this method returns a new array.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {...Array} [values] The values to exclude.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of filtered values.+ * @example+ *+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];+ *+ * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);+ * // => [{ 'x': 2, 'y': 1 }]+ */+ var differenceWith = baseRest(function(array, values) {+ var comparator = last(values);+ if (isArrayLikeObject(comparator)) {+ comparator = undefined;+ }+ return isArrayLikeObject(array)+ ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)+ : [];+ });++ /**+ * Creates a slice of `array` with `n` elements dropped from the beginning.+ *+ * @static+ * @memberOf _+ * @since 0.5.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {number} [n=1] The number of elements to drop.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.drop([1, 2, 3]);+ * // => [2, 3]+ *+ * _.drop([1, 2, 3], 2);+ * // => [3]+ *+ * _.drop([1, 2, 3], 5);+ * // => []+ *+ * _.drop([1, 2, 3], 0);+ * // => [1, 2, 3]+ */+ function drop(array, n, guard) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ n = (guard || n === undefined) ? 1 : toInteger(n);+ return baseSlice(array, n < 0 ? 0 : n, length);+ }++ /**+ * Creates a slice of `array` with `n` elements dropped from the end.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {number} [n=1] The number of elements to drop.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.dropRight([1, 2, 3]);+ * // => [1, 2]+ *+ * _.dropRight([1, 2, 3], 2);+ * // => [1]+ *+ * _.dropRight([1, 2, 3], 5);+ * // => []+ *+ * _.dropRight([1, 2, 3], 0);+ * // => [1, 2, 3]+ */+ function dropRight(array, n, guard) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ n = (guard || n === undefined) ? 1 : toInteger(n);+ n = length - n;+ return baseSlice(array, 0, n < 0 ? 0 : n);+ }++ /**+ * Creates a slice of `array` excluding elements dropped from the end.+ * Elements are dropped until `predicate` returns falsey. The predicate is+ * invoked with three arguments: (value, index, array).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': true },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': false }+ * ];+ *+ * _.dropRightWhile(users, function(o) { return !o.active; });+ * // => objects for ['barney']+ *+ * // The `_.matches` iteratee shorthand.+ * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });+ * // => objects for ['barney', 'fred']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.dropRightWhile(users, ['active', false]);+ * // => objects for ['barney']+ *+ * // The `_.property` iteratee shorthand.+ * _.dropRightWhile(users, 'active');+ * // => objects for ['barney', 'fred', 'pebbles']+ */+ function dropRightWhile(array, predicate) {+ return (array && array.length)+ ? baseWhile(array, getIteratee(predicate, 3), true, true)+ : [];+ }++ /**+ * Creates a slice of `array` excluding elements dropped from the beginning.+ * Elements are dropped until `predicate` returns falsey. The predicate is+ * invoked with three arguments: (value, index, array).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': false },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': true }+ * ];+ *+ * _.dropWhile(users, function(o) { return !o.active; });+ * // => objects for ['pebbles']+ *+ * // The `_.matches` iteratee shorthand.+ * _.dropWhile(users, { 'user': 'barney', 'active': false });+ * // => objects for ['fred', 'pebbles']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.dropWhile(users, ['active', false]);+ * // => objects for ['pebbles']+ *+ * // The `_.property` iteratee shorthand.+ * _.dropWhile(users, 'active');+ * // => objects for ['barney', 'fred', 'pebbles']+ */+ function dropWhile(array, predicate) {+ return (array && array.length)+ ? baseWhile(array, getIteratee(predicate, 3), true)+ : [];+ }++ /**+ * Fills elements of `array` with `value` from `start` up to, but not+ * including, `end`.+ *+ * **Note:** This method mutates `array`.+ *+ * @static+ * @memberOf _+ * @since 3.2.0+ * @category Array+ * @param {Array} array The array to fill.+ * @param {*} value The value to fill `array` with.+ * @param {number} [start=0] The start position.+ * @param {number} [end=array.length] The end position.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = [1, 2, 3];+ *+ * _.fill(array, 'a');+ * console.log(array);+ * // => ['a', 'a', 'a']+ *+ * _.fill(Array(3), 2);+ * // => [2, 2, 2]+ *+ * _.fill([4, 6, 8, 10], '*', 1, 3);+ * // => [4, '*', '*', 10]+ */+ function fill(array, value, start, end) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {+ start = 0;+ end = length;+ }+ return baseFill(array, value, start, end);+ }++ /**+ * This method is like `_.find` except that it returns the index of the first+ * element `predicate` returns truthy for instead of the element itself.+ *+ * @static+ * @memberOf _+ * @since 1.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param {number} [fromIndex=0] The index to search from.+ * @returns {number} Returns the index of the found element, else `-1`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': false },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': true }+ * ];+ *+ * _.findIndex(users, function(o) { return o.user == 'barney'; });+ * // => 0+ *+ * // The `_.matches` iteratee shorthand.+ * _.findIndex(users, { 'user': 'fred', 'active': false });+ * // => 1+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.findIndex(users, ['active', false]);+ * // => 0+ *+ * // The `_.property` iteratee shorthand.+ * _.findIndex(users, 'active');+ * // => 2+ */+ function findIndex(array, predicate, fromIndex) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return -1;+ }+ var index = fromIndex == null ? 0 : toInteger(fromIndex);+ if (index < 0) {+ index = nativeMax(length + index, 0);+ }+ return baseFindIndex(array, getIteratee(predicate, 3), index);+ }++ /**+ * This method is like `_.findIndex` except that it iterates over elements+ * of `collection` from right to left.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param {number} [fromIndex=array.length-1] The index to search from.+ * @returns {number} Returns the index of the found element, else `-1`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': true },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': false }+ * ];+ *+ * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });+ * // => 2+ *+ * // The `_.matches` iteratee shorthand.+ * _.findLastIndex(users, { 'user': 'barney', 'active': true });+ * // => 0+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.findLastIndex(users, ['active', false]);+ * // => 2+ *+ * // The `_.property` iteratee shorthand.+ * _.findLastIndex(users, 'active');+ * // => 0+ */+ function findLastIndex(array, predicate, fromIndex) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return -1;+ }+ var index = length - 1;+ if (fromIndex !== undefined) {+ index = toInteger(fromIndex);+ index = fromIndex < 0+ ? nativeMax(length + index, 0)+ : nativeMin(index, length - 1);+ }+ return baseFindIndex(array, getIteratee(predicate, 3), index, true);+ }++ /**+ * Flattens `array` a single level deep.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to flatten.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * _.flatten([1, [2, [3, [4]], 5]]);+ * // => [1, 2, [3, [4]], 5]+ */+ function flatten(array) {+ var length = array == null ? 0 : array.length;+ return length ? baseFlatten(array, 1) : [];+ }++ /**+ * Recursively flattens `array`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to flatten.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * _.flattenDeep([1, [2, [3, [4]], 5]]);+ * // => [1, 2, 3, 4, 5]+ */+ function flattenDeep(array) {+ var length = array == null ? 0 : array.length;+ return length ? baseFlatten(array, INFINITY) : [];+ }++ /**+ * Recursively flatten `array` up to `depth` times.+ *+ * @static+ * @memberOf _+ * @since 4.4.0+ * @category Array+ * @param {Array} array The array to flatten.+ * @param {number} [depth=1] The maximum recursion depth.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * var array = [1, [2, [3, [4]], 5]];+ *+ * _.flattenDepth(array, 1);+ * // => [1, 2, [3, [4]], 5]+ *+ * _.flattenDepth(array, 2);+ * // => [1, 2, 3, [4], 5]+ */+ function flattenDepth(array, depth) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ depth = depth === undefined ? 1 : toInteger(depth);+ return baseFlatten(array, depth);+ }++ /**+ * The inverse of `_.toPairs`; this method returns an object composed+ * from key-value `pairs`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} pairs The key-value pairs.+ * @returns {Object} Returns the new object.+ * @example+ *+ * _.fromPairs([['a', 1], ['b', 2]]);+ * // => { 'a': 1, 'b': 2 }+ */+ function fromPairs(pairs) {+ var index = -1,+ length = pairs == null ? 0 : pairs.length,+ result = {};++ while (++index < length) {+ var pair = pairs[index];+ result[pair[0]] = pair[1];+ }+ return result;+ }++ /**+ * Gets the first element of `array`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @alias first+ * @category Array+ * @param {Array} array The array to query.+ * @returns {*} Returns the first element of `array`.+ * @example+ *+ * _.head([1, 2, 3]);+ * // => 1+ *+ * _.head([]);+ * // => undefined+ */+ function head(array) {+ return (array && array.length) ? array[0] : undefined;+ }++ /**+ * Gets the index at which the first occurrence of `value` is found in `array`+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons. If `fromIndex` is negative, it's used as the+ * offset from the end of `array`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} [fromIndex=0] The index to search from.+ * @returns {number} Returns the index of the matched value, else `-1`.+ * @example+ *+ * _.indexOf([1, 2, 1, 2], 2);+ * // => 1+ *+ * // Search from the `fromIndex`.+ * _.indexOf([1, 2, 1, 2], 2, 2);+ * // => 3+ */+ function indexOf(array, value, fromIndex) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return -1;+ }+ var index = fromIndex == null ? 0 : toInteger(fromIndex);+ if (index < 0) {+ index = nativeMax(length + index, 0);+ }+ return baseIndexOf(array, value, index);+ }++ /**+ * Gets all but the last element of `array`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to query.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.initial([1, 2, 3]);+ * // => [1, 2]+ */+ function initial(array) {+ var length = array == null ? 0 : array.length;+ return length ? baseSlice(array, 0, -1) : [];+ }++ /**+ * Creates an array of unique values that are included in all given arrays+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons. The order and references of result values are+ * determined by the first array.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @returns {Array} Returns the new array of intersecting values.+ * @example+ *+ * _.intersection([2, 1], [2, 3]);+ * // => [2]+ */+ var intersection = baseRest(function(arrays) {+ var mapped = arrayMap(arrays, castArrayLikeObject);+ return (mapped.length && mapped[0] === arrays[0])+ ? baseIntersection(mapped)+ : [];+ });++ /**+ * This method is like `_.intersection` except that it accepts `iteratee`+ * which is invoked for each element of each `arrays` to generate the criterion+ * by which they're compared. The order and references of result values are+ * determined by the first array. The iteratee is invoked with one argument:+ * (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns the new array of intersecting values.+ * @example+ *+ * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);+ * // => [2.1]+ *+ * // The `_.property` iteratee shorthand.+ * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');+ * // => [{ 'x': 1 }]+ */+ var intersectionBy = baseRest(function(arrays) {+ var iteratee = last(arrays),+ mapped = arrayMap(arrays, castArrayLikeObject);++ if (iteratee === last(mapped)) {+ iteratee = undefined;+ } else {+ mapped.pop();+ }+ return (mapped.length && mapped[0] === arrays[0])+ ? baseIntersection(mapped, getIteratee(iteratee, 2))+ : [];+ });++ /**+ * This method is like `_.intersection` except that it accepts `comparator`+ * which is invoked to compare elements of `arrays`. The order and references+ * of result values are determined by the first array. The comparator is+ * invoked with two arguments: (arrVal, othVal).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of intersecting values.+ * @example+ *+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];+ *+ * _.intersectionWith(objects, others, _.isEqual);+ * // => [{ 'x': 1, 'y': 2 }]+ */+ var intersectionWith = baseRest(function(arrays) {+ var comparator = last(arrays),+ mapped = arrayMap(arrays, castArrayLikeObject);++ comparator = typeof comparator == 'function' ? comparator : undefined;+ if (comparator) {+ mapped.pop();+ }+ return (mapped.length && mapped[0] === arrays[0])+ ? baseIntersection(mapped, undefined, comparator)+ : [];+ });++ /**+ * Converts all elements in `array` into a string separated by `separator`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to convert.+ * @param {string} [separator=','] The element separator.+ * @returns {string} Returns the joined string.+ * @example+ *+ * _.join(['a', 'b', 'c'], '~');+ * // => 'a~b~c'+ */+ function join(array, separator) {+ return array == null ? '' : nativeJoin.call(array, separator);+ }++ /**+ * Gets the last element of `array`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to query.+ * @returns {*} Returns the last element of `array`.+ * @example+ *+ * _.last([1, 2, 3]);+ * // => 3+ */+ function last(array) {+ var length = array == null ? 0 : array.length;+ return length ? array[length - 1] : undefined;+ }++ /**+ * This method is like `_.indexOf` except that it iterates over elements of+ * `array` from right to left.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @param {number} [fromIndex=array.length-1] The index to search from.+ * @returns {number} Returns the index of the matched value, else `-1`.+ * @example+ *+ * _.lastIndexOf([1, 2, 1, 2], 2);+ * // => 3+ *+ * // Search from the `fromIndex`.+ * _.lastIndexOf([1, 2, 1, 2], 2, 2);+ * // => 1+ */+ function lastIndexOf(array, value, fromIndex) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return -1;+ }+ var index = length;+ if (fromIndex !== undefined) {+ index = toInteger(fromIndex);+ index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);+ }+ return value === value+ ? strictLastIndexOf(array, value, index)+ : baseFindIndex(array, baseIsNaN, index, true);+ }++ /**+ * Gets the element at index `n` of `array`. If `n` is negative, the nth+ * element from the end is returned.+ *+ * @static+ * @memberOf _+ * @since 4.11.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {number} [n=0] The index of the element to return.+ * @returns {*} Returns the nth element of `array`.+ * @example+ *+ * var array = ['a', 'b', 'c', 'd'];+ *+ * _.nth(array, 1);+ * // => 'b'+ *+ * _.nth(array, -2);+ * // => 'c';+ */+ function nth(array, n) {+ return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;+ }++ /**+ * Removes all given values from `array` using+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons.+ *+ * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`+ * to remove elements from an array by predicate.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {...*} [values] The values to remove.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = ['a', 'b', 'c', 'a', 'b', 'c'];+ *+ * _.pull(array, 'a', 'c');+ * console.log(array);+ * // => ['b', 'b']+ */+ var pull = baseRest(pullAll);++ /**+ * This method is like `_.pull` except that it accepts an array of values to remove.+ *+ * **Note:** Unlike `_.difference`, this method mutates `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {Array} values The values to remove.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = ['a', 'b', 'c', 'a', 'b', 'c'];+ *+ * _.pullAll(array, ['a', 'c']);+ * console.log(array);+ * // => ['b', 'b']+ */+ function pullAll(array, values) {+ return (array && array.length && values && values.length)+ ? basePullAll(array, values)+ : array;+ }++ /**+ * This method is like `_.pullAll` except that it accepts `iteratee` which is+ * invoked for each element of `array` and `values` to generate the criterion+ * by which they're compared. The iteratee is invoked with one argument: (value).+ *+ * **Note:** Unlike `_.differenceBy`, this method mutates `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {Array} values The values to remove.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];+ *+ * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');+ * console.log(array);+ * // => [{ 'x': 2 }]+ */+ function pullAllBy(array, values, iteratee) {+ return (array && array.length && values && values.length)+ ? basePullAll(array, values, getIteratee(iteratee, 2))+ : array;+ }++ /**+ * This method is like `_.pullAll` except that it accepts `comparator` which+ * is invoked to compare elements of `array` to `values`. The comparator is+ * invoked with two arguments: (arrVal, othVal).+ *+ * **Note:** Unlike `_.differenceWith`, this method mutates `array`.+ *+ * @static+ * @memberOf _+ * @since 4.6.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {Array} values The values to remove.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];+ *+ * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);+ * console.log(array);+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]+ */+ function pullAllWith(array, values, comparator) {+ return (array && array.length && values && values.length)+ ? basePullAll(array, values, undefined, comparator)+ : array;+ }++ /**+ * Removes elements from `array` corresponding to `indexes` and returns an+ * array of removed elements.+ *+ * **Note:** Unlike `_.at`, this method mutates `array`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {...(number|number[])} [indexes] The indexes of elements to remove.+ * @returns {Array} Returns the new array of removed elements.+ * @example+ *+ * var array = ['a', 'b', 'c', 'd'];+ * var pulled = _.pullAt(array, [1, 3]);+ *+ * console.log(array);+ * // => ['a', 'c']+ *+ * console.log(pulled);+ * // => ['b', 'd']+ */+ var pullAt = flatRest(function(array, indexes) {+ var length = array == null ? 0 : array.length,+ result = baseAt(array, indexes);++ basePullAt(array, arrayMap(indexes, function(index) {+ return isIndex(index, length) ? +index : index;+ }).sort(compareAscending));++ return result;+ });++ /**+ * Removes all elements from `array` that `predicate` returns truthy for+ * and returns an array of the removed elements. The predicate is invoked+ * with three arguments: (value, index, array).+ *+ * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`+ * to pull elements from an array by value.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new array of removed elements.+ * @example+ *+ * var array = [1, 2, 3, 4];+ * var evens = _.remove(array, function(n) {+ * return n % 2 == 0;+ * });+ *+ * console.log(array);+ * // => [1, 3]+ *+ * console.log(evens);+ * // => [2, 4]+ */+ function remove(array, predicate) {+ var result = [];+ if (!(array && array.length)) {+ return result;+ }+ var index = -1,+ indexes = [],+ length = array.length;++ predicate = getIteratee(predicate, 3);+ while (++index < length) {+ var value = array[index];+ if (predicate(value, index, array)) {+ result.push(value);+ indexes.push(index);+ }+ }+ basePullAt(array, indexes);+ return result;+ }++ /**+ * Reverses `array` so that the first element becomes the last, the second+ * element becomes the second to last, and so on.+ *+ * **Note:** This method mutates `array` and is based on+ * [`Array#reverse`](https://mdn.io/Array/reverse).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to modify.+ * @returns {Array} Returns `array`.+ * @example+ *+ * var array = [1, 2, 3];+ *+ * _.reverse(array);+ * // => [3, 2, 1]+ *+ * console.log(array);+ * // => [3, 2, 1]+ */+ function reverse(array) {+ return array == null ? array : nativeReverse.call(array);+ }++ /**+ * Creates a slice of `array` from `start` up to, but not including, `end`.+ *+ * **Note:** This method is used instead of+ * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are+ * returned.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to slice.+ * @param {number} [start=0] The start position.+ * @param {number} [end=array.length] The end position.+ * @returns {Array} Returns the slice of `array`.+ */+ function slice(array, start, end) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {+ start = 0;+ end = length;+ }+ else {+ start = start == null ? 0 : toInteger(start);+ end = end === undefined ? length : toInteger(end);+ }+ return baseSlice(array, start, end);+ }++ /**+ * Uses a binary search to determine the lowest index at which `value`+ * should be inserted into `array` in order to maintain its sort order.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ * @example+ *+ * _.sortedIndex([30, 50], 40);+ * // => 1+ */+ function sortedIndex(array, value) {+ return baseSortedIndex(array, value);+ }++ /**+ * This method is like `_.sortedIndex` except that it accepts `iteratee`+ * which is invoked for `value` and each element of `array` to compute their+ * sort ranking. The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ * @example+ *+ * var objects = [{ 'x': 4 }, { 'x': 5 }];+ *+ * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });+ * // => 0+ *+ * // The `_.property` iteratee shorthand.+ * _.sortedIndexBy(objects, { 'x': 4 }, 'x');+ * // => 0+ */+ function sortedIndexBy(array, value, iteratee) {+ return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));+ }++ /**+ * This method is like `_.indexOf` except that it performs a binary+ * search on a sorted `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @returns {number} Returns the index of the matched value, else `-1`.+ * @example+ *+ * _.sortedIndexOf([4, 5, 5, 5, 6], 5);+ * // => 1+ */+ function sortedIndexOf(array, value) {+ var length = array == null ? 0 : array.length;+ if (length) {+ var index = baseSortedIndex(array, value);+ if (index < length && eq(array[index], value)) {+ return index;+ }+ }+ return -1;+ }++ /**+ * This method is like `_.sortedIndex` except that it returns the highest+ * index at which `value` should be inserted into `array` in order to+ * maintain its sort order.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ * @example+ *+ * _.sortedLastIndex([4, 5, 5, 5, 6], 5);+ * // => 4+ */+ function sortedLastIndex(array, value) {+ return baseSortedIndex(array, value, true);+ }++ /**+ * This method is like `_.sortedLastIndex` except that it accepts `iteratee`+ * which is invoked for `value` and each element of `array` to compute their+ * sort ranking. The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The sorted array to inspect.+ * @param {*} value The value to evaluate.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {number} Returns the index at which `value` should be inserted+ * into `array`.+ * @example+ *+ * var objects = [{ 'x': 4 }, { 'x': 5 }];+ *+ * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });+ * // => 1+ *+ * // The `_.property` iteratee shorthand.+ * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');+ * // => 1+ */+ function sortedLastIndexBy(array, value, iteratee) {+ return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);+ }++ /**+ * This method is like `_.lastIndexOf` except that it performs a binary+ * search on a sorted `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {*} value The value to search for.+ * @returns {number} Returns the index of the matched value, else `-1`.+ * @example+ *+ * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);+ * // => 3+ */+ function sortedLastIndexOf(array, value) {+ var length = array == null ? 0 : array.length;+ if (length) {+ var index = baseSortedIndex(array, value, true) - 1;+ if (eq(array[index], value)) {+ return index;+ }+ }+ return -1;+ }++ /**+ * This method is like `_.uniq` except that it's designed and optimized+ * for sorted arrays.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @returns {Array} Returns the new duplicate free array.+ * @example+ *+ * _.sortedUniq([1, 1, 2]);+ * // => [1, 2]+ */+ function sortedUniq(array) {+ return (array && array.length)+ ? baseSortedUniq(array)+ : [];+ }++ /**+ * This method is like `_.uniqBy` except that it's designed and optimized+ * for sorted arrays.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {Function} [iteratee] The iteratee invoked per element.+ * @returns {Array} Returns the new duplicate free array.+ * @example+ *+ * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);+ * // => [1.1, 2.3]+ */+ function sortedUniqBy(array, iteratee) {+ return (array && array.length)+ ? baseSortedUniq(array, getIteratee(iteratee, 2))+ : [];+ }++ /**+ * Gets all but the first element of `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.tail([1, 2, 3]);+ * // => [2, 3]+ */+ function tail(array) {+ var length = array == null ? 0 : array.length;+ return length ? baseSlice(array, 1, length) : [];+ }++ /**+ * Creates a slice of `array` with `n` elements taken from the beginning.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {number} [n=1] The number of elements to take.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.take([1, 2, 3]);+ * // => [1]+ *+ * _.take([1, 2, 3], 2);+ * // => [1, 2]+ *+ * _.take([1, 2, 3], 5);+ * // => [1, 2, 3]+ *+ * _.take([1, 2, 3], 0);+ * // => []+ */+ function take(array, n, guard) {+ if (!(array && array.length)) {+ return [];+ }+ n = (guard || n === undefined) ? 1 : toInteger(n);+ return baseSlice(array, 0, n < 0 ? 0 : n);+ }++ /**+ * Creates a slice of `array` with `n` elements taken from the end.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {number} [n=1] The number of elements to take.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * _.takeRight([1, 2, 3]);+ * // => [3]+ *+ * _.takeRight([1, 2, 3], 2);+ * // => [2, 3]+ *+ * _.takeRight([1, 2, 3], 5);+ * // => [1, 2, 3]+ *+ * _.takeRight([1, 2, 3], 0);+ * // => []+ */+ function takeRight(array, n, guard) {+ var length = array == null ? 0 : array.length;+ if (!length) {+ return [];+ }+ n = (guard || n === undefined) ? 1 : toInteger(n);+ n = length - n;+ return baseSlice(array, n < 0 ? 0 : n, length);+ }++ /**+ * Creates a slice of `array` with elements taken from the end. Elements are+ * taken until `predicate` returns falsey. The predicate is invoked with+ * three arguments: (value, index, array).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': true },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': false }+ * ];+ *+ * _.takeRightWhile(users, function(o) { return !o.active; });+ * // => objects for ['fred', 'pebbles']+ *+ * // The `_.matches` iteratee shorthand.+ * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });+ * // => objects for ['pebbles']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.takeRightWhile(users, ['active', false]);+ * // => objects for ['fred', 'pebbles']+ *+ * // The `_.property` iteratee shorthand.+ * _.takeRightWhile(users, 'active');+ * // => []+ */+ function takeRightWhile(array, predicate) {+ return (array && array.length)+ ? baseWhile(array, getIteratee(predicate, 3), false, true)+ : [];+ }++ /**+ * Creates a slice of `array` with elements taken from the beginning. Elements+ * are taken until `predicate` returns falsey. The predicate is invoked with+ * three arguments: (value, index, array).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Array+ * @param {Array} array The array to query.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the slice of `array`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'active': false },+ * { 'user': 'fred', 'active': false },+ * { 'user': 'pebbles', 'active': true }+ * ];+ *+ * _.takeWhile(users, function(o) { return !o.active; });+ * // => objects for ['barney', 'fred']+ *+ * // The `_.matches` iteratee shorthand.+ * _.takeWhile(users, { 'user': 'barney', 'active': false });+ * // => objects for ['barney']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.takeWhile(users, ['active', false]);+ * // => objects for ['barney', 'fred']+ *+ * // The `_.property` iteratee shorthand.+ * _.takeWhile(users, 'active');+ * // => []+ */+ function takeWhile(array, predicate) {+ return (array && array.length)+ ? baseWhile(array, getIteratee(predicate, 3))+ : [];+ }++ /**+ * Creates an array of unique values, in order, from all given arrays using+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @returns {Array} Returns the new array of combined values.+ * @example+ *+ * _.union([2], [1, 2]);+ * // => [2, 1]+ */+ var union = baseRest(function(arrays) {+ return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));+ });++ /**+ * This method is like `_.union` except that it accepts `iteratee` which is+ * invoked for each element of each `arrays` to generate the criterion by+ * which uniqueness is computed. Result values are chosen from the first+ * array in which the value occurs. The iteratee is invoked with one argument:+ * (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns the new array of combined values.+ * @example+ *+ * _.unionBy([2.1], [1.2, 2.3], Math.floor);+ * // => [2.1, 1.2]+ *+ * // The `_.property` iteratee shorthand.+ * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');+ * // => [{ 'x': 1 }, { 'x': 2 }]+ */+ var unionBy = baseRest(function(arrays) {+ var iteratee = last(arrays);+ if (isArrayLikeObject(iteratee)) {+ iteratee = undefined;+ }+ return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));+ });++ /**+ * This method is like `_.union` except that it accepts `comparator` which+ * is invoked to compare elements of `arrays`. Result values are chosen from+ * the first array in which the value occurs. The comparator is invoked+ * with two arguments: (arrVal, othVal).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of combined values.+ * @example+ *+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];+ *+ * _.unionWith(objects, others, _.isEqual);+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]+ */+ var unionWith = baseRest(function(arrays) {+ var comparator = last(arrays);+ comparator = typeof comparator == 'function' ? comparator : undefined;+ return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);+ });++ /**+ * Creates a duplicate-free version of an array, using+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons, in which only the first occurrence of each element+ * is kept. The order of result values is determined by the order they occur+ * in the array.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @returns {Array} Returns the new duplicate free array.+ * @example+ *+ * _.uniq([2, 1, 2]);+ * // => [2, 1]+ */+ function uniq(array) {+ return (array && array.length) ? baseUniq(array) : [];+ }++ /**+ * This method is like `_.uniq` except that it accepts `iteratee` which is+ * invoked for each element in `array` to generate the criterion by which+ * uniqueness is computed. The order of result values is determined by the+ * order they occur in the array. The iteratee is invoked with one argument:+ * (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns the new duplicate free array.+ * @example+ *+ * _.uniqBy([2.1, 1.2, 2.3], Math.floor);+ * // => [2.1, 1.2]+ *+ * // The `_.property` iteratee shorthand.+ * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');+ * // => [{ 'x': 1 }, { 'x': 2 }]+ */+ function uniqBy(array, iteratee) {+ return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];+ }++ /**+ * This method is like `_.uniq` except that it accepts `comparator` which+ * is invoked to compare elements of `array`. The order of result values is+ * determined by the order they occur in the array.The comparator is invoked+ * with two arguments: (arrVal, othVal).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new duplicate free array.+ * @example+ *+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];+ *+ * _.uniqWith(objects, _.isEqual);+ * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]+ */+ function uniqWith(array, comparator) {+ comparator = typeof comparator == 'function' ? comparator : undefined;+ return (array && array.length) ? baseUniq(array, undefined, comparator) : [];+ }++ /**+ * This method is like `_.zip` except that it accepts an array of grouped+ * elements and creates an array regrouping the elements to their pre-zip+ * configuration.+ *+ * @static+ * @memberOf _+ * @since 1.2.0+ * @category Array+ * @param {Array} array The array of grouped elements to process.+ * @returns {Array} Returns the new array of regrouped elements.+ * @example+ *+ * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);+ * // => [['a', 1, true], ['b', 2, false]]+ *+ * _.unzip(zipped);+ * // => [['a', 'b'], [1, 2], [true, false]]+ */+ function unzip(array) {+ if (!(array && array.length)) {+ return [];+ }+ var length = 0;+ array = arrayFilter(array, function(group) {+ if (isArrayLikeObject(group)) {+ length = nativeMax(group.length, length);+ return true;+ }+ });+ return baseTimes(length, function(index) {+ return arrayMap(array, baseProperty(index));+ });+ }++ /**+ * This method is like `_.unzip` except that it accepts `iteratee` to specify+ * how regrouped values should be combined. The iteratee is invoked with the+ * elements of each group: (...group).+ *+ * @static+ * @memberOf _+ * @since 3.8.0+ * @category Array+ * @param {Array} array The array of grouped elements to process.+ * @param {Function} [iteratee=_.identity] The function to combine+ * regrouped values.+ * @returns {Array} Returns the new array of regrouped elements.+ * @example+ *+ * var zipped = _.zip([1, 2], [10, 20], [100, 200]);+ * // => [[1, 10, 100], [2, 20, 200]]+ *+ * _.unzipWith(zipped, _.add);+ * // => [3, 30, 300]+ */+ function unzipWith(array, iteratee) {+ if (!(array && array.length)) {+ return [];+ }+ var result = unzip(array);+ if (iteratee == null) {+ return result;+ }+ return arrayMap(result, function(group) {+ return apply(iteratee, undefined, group);+ });+ }++ /**+ * Creates an array excluding all given values using+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * for equality comparisons.+ *+ * **Note:** Unlike `_.pull`, this method returns a new array.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {Array} array The array to inspect.+ * @param {...*} [values] The values to exclude.+ * @returns {Array} Returns the new array of filtered values.+ * @see _.difference, _.xor+ * @example+ *+ * _.without([2, 1, 2, 3], 1, 2);+ * // => [3]+ */+ var without = baseRest(function(array, values) {+ return isArrayLikeObject(array)+ ? baseDifference(array, values)+ : [];+ });++ /**+ * Creates an array of unique values that is the+ * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)+ * of the given arrays. The order of result values is determined by the order+ * they occur in the arrays.+ *+ * @static+ * @memberOf _+ * @since 2.4.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @returns {Array} Returns the new array of filtered values.+ * @see _.difference, _.without+ * @example+ *+ * _.xor([2, 1], [2, 3]);+ * // => [1, 3]+ */+ var xor = baseRest(function(arrays) {+ return baseXor(arrayFilter(arrays, isArrayLikeObject));+ });++ /**+ * This method is like `_.xor` except that it accepts `iteratee` which is+ * invoked for each element of each `arrays` to generate the criterion by+ * which by which they're compared. The order of result values is determined+ * by the order they occur in the arrays. The iteratee is invoked with one+ * argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Array} Returns the new array of filtered values.+ * @example+ *+ * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);+ * // => [1.2, 3.4]+ *+ * // The `_.property` iteratee shorthand.+ * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');+ * // => [{ 'x': 2 }]+ */+ var xorBy = baseRest(function(arrays) {+ var iteratee = last(arrays);+ if (isArrayLikeObject(iteratee)) {+ iteratee = undefined;+ }+ return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));+ });++ /**+ * This method is like `_.xor` except that it accepts `comparator` which is+ * invoked to compare elements of `arrays`. The order of result values is+ * determined by the order they occur in the arrays. The comparator is invoked+ * with two arguments: (arrVal, othVal).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Array+ * @param {...Array} [arrays] The arrays to inspect.+ * @param {Function} [comparator] The comparator invoked per element.+ * @returns {Array} Returns the new array of filtered values.+ * @example+ *+ * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];+ * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];+ *+ * _.xorWith(objects, others, _.isEqual);+ * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]+ */+ var xorWith = baseRest(function(arrays) {+ var comparator = last(arrays);+ comparator = typeof comparator == 'function' ? comparator : undefined;+ return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);+ });++ /**+ * Creates an array of grouped elements, the first of which contains the+ * first elements of the given arrays, the second of which contains the+ * second elements of the given arrays, and so on.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Array+ * @param {...Array} [arrays] The arrays to process.+ * @returns {Array} Returns the new array of grouped elements.+ * @example+ *+ * _.zip(['a', 'b'], [1, 2], [true, false]);+ * // => [['a', 1, true], ['b', 2, false]]+ */+ var zip = baseRest(unzip);++ /**+ * This method is like `_.fromPairs` except that it accepts two arrays,+ * one of property identifiers and one of corresponding values.+ *+ * @static+ * @memberOf _+ * @since 0.4.0+ * @category Array+ * @param {Array} [props=[]] The property identifiers.+ * @param {Array} [values=[]] The property values.+ * @returns {Object} Returns the new object.+ * @example+ *+ * _.zipObject(['a', 'b'], [1, 2]);+ * // => { 'a': 1, 'b': 2 }+ */+ function zipObject(props, values) {+ return baseZipObject(props || [], values || [], assignValue);+ }++ /**+ * This method is like `_.zipObject` except that it supports property paths.+ *+ * @static+ * @memberOf _+ * @since 4.1.0+ * @category Array+ * @param {Array} [props=[]] The property identifiers.+ * @param {Array} [values=[]] The property values.+ * @returns {Object} Returns the new object.+ * @example+ *+ * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);+ * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }+ */+ function zipObjectDeep(props, values) {+ return baseZipObject(props || [], values || [], baseSet);+ }++ /**+ * This method is like `_.zip` except that it accepts `iteratee` to specify+ * how grouped values should be combined. The iteratee is invoked with the+ * elements of each group: (...group).+ *+ * @static+ * @memberOf _+ * @since 3.8.0+ * @category Array+ * @param {...Array} [arrays] The arrays to process.+ * @param {Function} [iteratee=_.identity] The function to combine+ * grouped values.+ * @returns {Array} Returns the new array of grouped elements.+ * @example+ *+ * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {+ * return a + b + c;+ * });+ * // => [111, 222]+ */+ var zipWith = baseRest(function(arrays) {+ var length = arrays.length,+ iteratee = length > 1 ? arrays[length - 1] : undefined;++ iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;+ return unzipWith(arrays, iteratee);+ });++ /*------------------------------------------------------------------------*/++ /**+ * Creates a `lodash` wrapper instance that wraps `value` with explicit method+ * chain sequences enabled. The result of such sequences must be unwrapped+ * with `_#value`.+ *+ * @static+ * @memberOf _+ * @since 1.3.0+ * @category Seq+ * @param {*} value The value to wrap.+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36 },+ * { 'user': 'fred', 'age': 40 },+ * { 'user': 'pebbles', 'age': 1 }+ * ];+ *+ * var youngest = _+ * .chain(users)+ * .sortBy('age')+ * .map(function(o) {+ * return o.user + ' is ' + o.age;+ * })+ * .head()+ * .value();+ * // => 'pebbles is 1'+ */+ function chain(value) {+ var result = lodash(value);+ result.__chain__ = true;+ return result;+ }++ /**+ * This method invokes `interceptor` and returns `value`. The interceptor+ * is invoked with one argument; (value). The purpose of this method is to+ * "tap into" a method chain sequence in order to modify intermediate results.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Seq+ * @param {*} value The value to provide to `interceptor`.+ * @param {Function} interceptor The function to invoke.+ * @returns {*} Returns `value`.+ * @example+ *+ * _([1, 2, 3])+ * .tap(function(array) {+ * // Mutate input array.+ * array.pop();+ * })+ * .reverse()+ * .value();+ * // => [2, 1]+ */+ function tap(value, interceptor) {+ interceptor(value);+ return value;+ }++ /**+ * This method is like `_.tap` except that it returns the result of `interceptor`.+ * The purpose of this method is to "pass thru" values replacing intermediate+ * results in a method chain sequence.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Seq+ * @param {*} value The value to provide to `interceptor`.+ * @param {Function} interceptor The function to invoke.+ * @returns {*} Returns the result of `interceptor`.+ * @example+ *+ * _(' abc ')+ * .chain()+ * .trim()+ * .thru(function(value) {+ * return [value];+ * })+ * .value();+ * // => ['abc']+ */+ function thru(value, interceptor) {+ return interceptor(value);+ }++ /**+ * This method is the wrapper version of `_.at`.+ *+ * @name at+ * @memberOf _+ * @since 1.0.0+ * @category Seq+ * @param {...(string|string[])} [paths] The property paths to pick.+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };+ *+ * _(object).at(['a[0].b.c', 'a[1]']).value();+ * // => [3, 4]+ */+ var wrapperAt = flatRest(function(paths) {+ var length = paths.length,+ start = length ? paths[0] : 0,+ value = this.__wrapped__,+ interceptor = function(object) { return baseAt(object, paths); };++ if (length > 1 || this.__actions__.length ||+ !(value instanceof LazyWrapper) || !isIndex(start)) {+ return this.thru(interceptor);+ }+ value = value.slice(start, +start + (length ? 1 : 0));+ value.__actions__.push({+ 'func': thru,+ 'args': [interceptor],+ 'thisArg': undefined+ });+ return new LodashWrapper(value, this.__chain__).thru(function(array) {+ if (length && !array.length) {+ array.push(undefined);+ }+ return array;+ });+ });++ /**+ * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.+ *+ * @name chain+ * @memberOf _+ * @since 0.1.0+ * @category Seq+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36 },+ * { 'user': 'fred', 'age': 40 }+ * ];+ *+ * // A sequence without explicit chaining.+ * _(users).head();+ * // => { 'user': 'barney', 'age': 36 }+ *+ * // A sequence with explicit chaining.+ * _(users)+ * .chain()+ * .head()+ * .pick('user')+ * .value();+ * // => { 'user': 'barney' }+ */+ function wrapperChain() {+ return chain(this);+ }++ /**+ * Executes the chain sequence and returns the wrapped result.+ *+ * @name commit+ * @memberOf _+ * @since 3.2.0+ * @category Seq+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * var array = [1, 2];+ * var wrapped = _(array).push(3);+ *+ * console.log(array);+ * // => [1, 2]+ *+ * wrapped = wrapped.commit();+ * console.log(array);+ * // => [1, 2, 3]+ *+ * wrapped.last();+ * // => 3+ *+ * console.log(array);+ * // => [1, 2, 3]+ */+ function wrapperCommit() {+ return new LodashWrapper(this.value(), this.__chain__);+ }++ /**+ * Gets the next value on a wrapped object following the+ * [iterator protocol](https://mdn.io/iteration_protocols#iterator).+ *+ * @name next+ * @memberOf _+ * @since 4.0.0+ * @category Seq+ * @returns {Object} Returns the next iterator value.+ * @example+ *+ * var wrapped = _([1, 2]);+ *+ * wrapped.next();+ * // => { 'done': false, 'value': 1 }+ *+ * wrapped.next();+ * // => { 'done': false, 'value': 2 }+ *+ * wrapped.next();+ * // => { 'done': true, 'value': undefined }+ */+ function wrapperNext() {+ if (this.__values__ === undefined) {+ this.__values__ = toArray(this.value());+ }+ var done = this.__index__ >= this.__values__.length,+ value = done ? undefined : this.__values__[this.__index__++];++ return { 'done': done, 'value': value };+ }++ /**+ * Enables the wrapper to be iterable.+ *+ * @name Symbol.iterator+ * @memberOf _+ * @since 4.0.0+ * @category Seq+ * @returns {Object} Returns the wrapper object.+ * @example+ *+ * var wrapped = _([1, 2]);+ *+ * wrapped[Symbol.iterator]() === wrapped;+ * // => true+ *+ * Array.from(wrapped);+ * // => [1, 2]+ */+ function wrapperToIterator() {+ return this;+ }++ /**+ * Creates a clone of the chain sequence planting `value` as the wrapped value.+ *+ * @name plant+ * @memberOf _+ * @since 3.2.0+ * @category Seq+ * @param {*} value The value to plant.+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * var wrapped = _([1, 2]).map(square);+ * var other = wrapped.plant([3, 4]);+ *+ * other.value();+ * // => [9, 16]+ *+ * wrapped.value();+ * // => [1, 4]+ */+ function wrapperPlant(value) {+ var result,+ parent = this;++ while (parent instanceof baseLodash) {+ var clone = wrapperClone(parent);+ clone.__index__ = 0;+ clone.__values__ = undefined;+ if (result) {+ previous.__wrapped__ = clone;+ } else {+ result = clone;+ }+ var previous = clone;+ parent = parent.__wrapped__;+ }+ previous.__wrapped__ = value;+ return result;+ }++ /**+ * This method is the wrapper version of `_.reverse`.+ *+ * **Note:** This method mutates the wrapped array.+ *+ * @name reverse+ * @memberOf _+ * @since 0.1.0+ * @category Seq+ * @returns {Object} Returns the new `lodash` wrapper instance.+ * @example+ *+ * var array = [1, 2, 3];+ *+ * _(array).reverse().value()+ * // => [3, 2, 1]+ *+ * console.log(array);+ * // => [3, 2, 1]+ */+ function wrapperReverse() {+ var value = this.__wrapped__;+ if (value instanceof LazyWrapper) {+ var wrapped = value;+ if (this.__actions__.length) {+ wrapped = new LazyWrapper(this);+ }+ wrapped = wrapped.reverse();+ wrapped.__actions__.push({+ 'func': thru,+ 'args': [reverse],+ 'thisArg': undefined+ });+ return new LodashWrapper(wrapped, this.__chain__);+ }+ return this.thru(reverse);+ }++ /**+ * Executes the chain sequence to resolve the unwrapped value.+ *+ * @name value+ * @memberOf _+ * @since 0.1.0+ * @alias toJSON, valueOf+ * @category Seq+ * @returns {*} Returns the resolved unwrapped value.+ * @example+ *+ * _([1, 2, 3]).value();+ * // => [1, 2, 3]+ */+ function wrapperValue() {+ return baseWrapperValue(this.__wrapped__, this.__actions__);+ }++ /*------------------------------------------------------------------------*/++ /**+ * Creates an object composed of keys generated from the results of running+ * each element of `collection` thru `iteratee`. The corresponding value of+ * each key is the number of times the key was returned by `iteratee`. The+ * iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 0.5.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.+ * @returns {Object} Returns the composed aggregate object.+ * @example+ *+ * _.countBy([6.1, 4.2, 6.3], Math.floor);+ * // => { '4': 1, '6': 2 }+ *+ * // The `_.property` iteratee shorthand.+ * _.countBy(['one', 'two', 'three'], 'length');+ * // => { '3': 2, '5': 1 }+ */+ var countBy = createAggregator(function(result, value, key) {+ if (hasOwnProperty.call(result, key)) {+ ++result[key];+ } else {+ baseAssignValue(result, key, 1);+ }+ });++ /**+ * Checks if `predicate` returns truthy for **all** elements of `collection`.+ * Iteration is stopped once `predicate` returns falsey. The predicate is+ * invoked with three arguments: (value, index|key, collection).+ *+ * **Note:** This method returns `true` for+ * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because+ * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of+ * elements of empty collections.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {boolean} Returns `true` if all elements pass the predicate check,+ * else `false`.+ * @example+ *+ * _.every([true, 1, null, 'yes'], Boolean);+ * // => false+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': false },+ * { 'user': 'fred', 'age': 40, 'active': false }+ * ];+ *+ * // The `_.matches` iteratee shorthand.+ * _.every(users, { 'user': 'barney', 'active': false });+ * // => false+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.every(users, ['active', false]);+ * // => true+ *+ * // The `_.property` iteratee shorthand.+ * _.every(users, 'active');+ * // => false+ */+ function every(collection, predicate, guard) {+ var func = isArray(collection) ? arrayEvery : baseEvery;+ if (guard && isIterateeCall(collection, predicate, guard)) {+ predicate = undefined;+ }+ return func(collection, getIteratee(predicate, 3));+ }++ /**+ * Iterates over elements of `collection`, returning an array of all elements+ * `predicate` returns truthy for. The predicate is invoked with three+ * arguments: (value, index|key, collection).+ *+ * **Note:** Unlike `_.remove`, this method returns a new array.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new filtered array.+ * @see _.reject+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': true },+ * { 'user': 'fred', 'age': 40, 'active': false }+ * ];+ *+ * _.filter(users, function(o) { return !o.active; });+ * // => objects for ['fred']+ *+ * // The `_.matches` iteratee shorthand.+ * _.filter(users, { 'age': 36, 'active': true });+ * // => objects for ['barney']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.filter(users, ['active', false]);+ * // => objects for ['fred']+ *+ * // The `_.property` iteratee shorthand.+ * _.filter(users, 'active');+ * // => objects for ['barney']+ */+ function filter(collection, predicate) {+ var func = isArray(collection) ? arrayFilter : baseFilter;+ return func(collection, getIteratee(predicate, 3));+ }++ /**+ * Iterates over elements of `collection`, returning the first element+ * `predicate` returns truthy for. The predicate is invoked with three+ * arguments: (value, index|key, collection).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param {number} [fromIndex=0] The index to search from.+ * @returns {*} Returns the matched element, else `undefined`.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': true },+ * { 'user': 'fred', 'age': 40, 'active': false },+ * { 'user': 'pebbles', 'age': 1, 'active': true }+ * ];+ *+ * _.find(users, function(o) { return o.age < 40; });+ * // => object for 'barney'+ *+ * // The `_.matches` iteratee shorthand.+ * _.find(users, { 'age': 1, 'active': true });+ * // => object for 'pebbles'+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.find(users, ['active', false]);+ * // => object for 'fred'+ *+ * // The `_.property` iteratee shorthand.+ * _.find(users, 'active');+ * // => object for 'barney'+ */+ var find = createFind(findIndex);++ /**+ * This method is like `_.find` except that it iterates over elements of+ * `collection` from right to left.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param {number} [fromIndex=collection.length-1] The index to search from.+ * @returns {*} Returns the matched element, else `undefined`.+ * @example+ *+ * _.findLast([1, 2, 3, 4], function(n) {+ * return n % 2 == 1;+ * });+ * // => 3+ */+ var findLast = createFind(findLastIndex);++ /**+ * Creates a flattened array of values by running each element in `collection`+ * thru `iteratee` and flattening the mapped results. The iteratee is invoked+ * with three arguments: (value, index|key, collection).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * function duplicate(n) {+ * return [n, n];+ * }+ *+ * _.flatMap([1, 2], duplicate);+ * // => [1, 1, 2, 2]+ */+ function flatMap(collection, iteratee) {+ return baseFlatten(map(collection, iteratee), 1);+ }++ /**+ * This method is like `_.flatMap` except that it recursively flattens the+ * mapped results.+ *+ * @static+ * @memberOf _+ * @since 4.7.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * function duplicate(n) {+ * return [[[n, n]]];+ * }+ *+ * _.flatMapDeep([1, 2], duplicate);+ * // => [1, 1, 2, 2]+ */+ function flatMapDeep(collection, iteratee) {+ return baseFlatten(map(collection, iteratee), INFINITY);+ }++ /**+ * This method is like `_.flatMap` except that it recursively flattens the+ * mapped results up to `depth` times.+ *+ * @static+ * @memberOf _+ * @since 4.7.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @param {number} [depth=1] The maximum recursion depth.+ * @returns {Array} Returns the new flattened array.+ * @example+ *+ * function duplicate(n) {+ * return [[[n, n]]];+ * }+ *+ * _.flatMapDepth([1, 2], duplicate, 2);+ * // => [[1, 1], [2, 2]]+ */+ function flatMapDepth(collection, iteratee, depth) {+ depth = depth === undefined ? 1 : toInteger(depth);+ return baseFlatten(map(collection, iteratee), depth);+ }++ /**+ * Iterates over elements of `collection` and invokes `iteratee` for each element.+ * The iteratee is invoked with three arguments: (value, index|key, collection).+ * Iteratee functions may exit iteration early by explicitly returning `false`.+ *+ * **Note:** As with other "Collections" methods, objects with a "length"+ * property are iterated like arrays. To avoid this behavior use `_.forIn`+ * or `_.forOwn` for object iteration.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @alias each+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array|Object} Returns `collection`.+ * @see _.forEachRight+ * @example+ *+ * _.forEach([1, 2], function(value) {+ * console.log(value);+ * });+ * // => Logs `1` then `2`.+ *+ * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {+ * console.log(key);+ * });+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).+ */+ function forEach(collection, iteratee) {+ var func = isArray(collection) ? arrayEach : baseEach;+ return func(collection, getIteratee(iteratee, 3));+ }++ /**+ * This method is like `_.forEach` except that it iterates over elements of+ * `collection` from right to left.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @alias eachRight+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array|Object} Returns `collection`.+ * @see _.forEach+ * @example+ *+ * _.forEachRight([1, 2], function(value) {+ * console.log(value);+ * });+ * // => Logs `2` then `1`.+ */+ function forEachRight(collection, iteratee) {+ var func = isArray(collection) ? arrayEachRight : baseEachRight;+ return func(collection, getIteratee(iteratee, 3));+ }++ /**+ * Creates an object composed of keys generated from the results of running+ * each element of `collection` thru `iteratee`. The order of grouped values+ * is determined by the order they occur in `collection`. The corresponding+ * value of each key is an array of elements responsible for generating the+ * key. The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.+ * @returns {Object} Returns the composed aggregate object.+ * @example+ *+ * _.groupBy([6.1, 4.2, 6.3], Math.floor);+ * // => { '4': [4.2], '6': [6.1, 6.3] }+ *+ * // The `_.property` iteratee shorthand.+ * _.groupBy(['one', 'two', 'three'], 'length');+ * // => { '3': ['one', 'two'], '5': ['three'] }+ */+ var groupBy = createAggregator(function(result, value, key) {+ if (hasOwnProperty.call(result, key)) {+ result[key].push(value);+ } else {+ baseAssignValue(result, key, [value]);+ }+ });++ /**+ * Checks if `value` is in `collection`. If `collection` is a string, it's+ * checked for a substring of `value`, otherwise+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * is used for equality comparisons. If `fromIndex` is negative, it's used as+ * the offset from the end of `collection`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object|string} collection The collection to inspect.+ * @param {*} value The value to search for.+ * @param {number} [fromIndex=0] The index to search from.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.+ * @returns {boolean} Returns `true` if `value` is found, else `false`.+ * @example+ *+ * _.includes([1, 2, 3], 1);+ * // => true+ *+ * _.includes([1, 2, 3], 1, 2);+ * // => false+ *+ * _.includes({ 'a': 1, 'b': 2 }, 1);+ * // => true+ *+ * _.includes('abcd', 'bc');+ * // => true+ */+ function includes(collection, value, fromIndex, guard) {+ collection = isArrayLike(collection) ? collection : values(collection);+ fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;++ var length = collection.length;+ if (fromIndex < 0) {+ fromIndex = nativeMax(length + fromIndex, 0);+ }+ return isString(collection)+ ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)+ : (!!length && baseIndexOf(collection, value, fromIndex) > -1);+ }++ /**+ * Invokes the method at `path` of each element in `collection`, returning+ * an array of the results of each invoked method. Any additional arguments+ * are provided to each invoked method. If `path` is a function, it's invoked+ * for, and `this` bound to, each element in `collection`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Array|Function|string} path The path of the method to invoke or+ * the function invoked per iteration.+ * @param {...*} [args] The arguments to invoke each method with.+ * @returns {Array} Returns the array of results.+ * @example+ *+ * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');+ * // => [[1, 5, 7], [1, 2, 3]]+ *+ * _.invokeMap([123, 456], String.prototype.split, '');+ * // => [['1', '2', '3'], ['4', '5', '6']]+ */+ var invokeMap = baseRest(function(collection, path, args) {+ var index = -1,+ isFunc = typeof path == 'function',+ result = isArrayLike(collection) ? Array(collection.length) : [];++ baseEach(collection, function(value) {+ result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);+ });+ return result;+ });++ /**+ * Creates an object composed of keys generated from the results of running+ * each element of `collection` thru `iteratee`. The corresponding value of+ * each key is the last element responsible for generating the key. The+ * iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee to transform keys.+ * @returns {Object} Returns the composed aggregate object.+ * @example+ *+ * var array = [+ * { 'dir': 'left', 'code': 97 },+ * { 'dir': 'right', 'code': 100 }+ * ];+ *+ * _.keyBy(array, function(o) {+ * return String.fromCharCode(o.code);+ * });+ * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }+ *+ * _.keyBy(array, 'dir');+ * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }+ */+ var keyBy = createAggregator(function(result, value, key) {+ baseAssignValue(result, key, value);+ });++ /**+ * Creates an array of values by running each element in `collection` thru+ * `iteratee`. The iteratee is invoked with three arguments:+ * (value, index|key, collection).+ *+ * Many lodash methods are guarded to work as iteratees for methods like+ * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.+ *+ * The guarded methods are:+ * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,+ * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,+ * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,+ * `template`, `trim`, `trimEnd`, `trimStart`, and `words`+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new mapped array.+ * @example+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * _.map([4, 8], square);+ * // => [16, 64]+ *+ * _.map({ 'a': 4, 'b': 8 }, square);+ * // => [16, 64] (iteration order is not guaranteed)+ *+ * var users = [+ * { 'user': 'barney' },+ * { 'user': 'fred' }+ * ];+ *+ * // The `_.property` iteratee shorthand.+ * _.map(users, 'user');+ * // => ['barney', 'fred']+ */+ function map(collection, iteratee) {+ var func = isArray(collection) ? arrayMap : baseMap;+ return func(collection, getIteratee(iteratee, 3));+ }++ /**+ * This method is like `_.sortBy` except that it allows specifying the sort+ * orders of the iteratees to sort by. If `orders` is unspecified, all values+ * are sorted in ascending order. Otherwise, specify an order of "desc" for+ * descending or "asc" for ascending sort order of corresponding values.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]+ * The iteratees to sort by.+ * @param {string[]} [orders] The sort orders of `iteratees`.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.+ * @returns {Array} Returns the new sorted array.+ * @example+ *+ * var users = [+ * { 'user': 'fred', 'age': 48 },+ * { 'user': 'barney', 'age': 34 },+ * { 'user': 'fred', 'age': 40 },+ * { 'user': 'barney', 'age': 36 }+ * ];+ *+ * // Sort by `user` in ascending order and by `age` in descending order.+ * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]+ */+ function orderBy(collection, iteratees, orders, guard) {+ if (collection == null) {+ return [];+ }+ if (!isArray(iteratees)) {+ iteratees = iteratees == null ? [] : [iteratees];+ }+ orders = guard ? undefined : orders;+ if (!isArray(orders)) {+ orders = orders == null ? [] : [orders];+ }+ return baseOrderBy(collection, iteratees, orders);+ }++ /**+ * Creates an array of elements split into two groups, the first of which+ * contains elements `predicate` returns truthy for, the second of which+ * contains elements `predicate` returns falsey for. The predicate is+ * invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the array of grouped elements.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': false },+ * { 'user': 'fred', 'age': 40, 'active': true },+ * { 'user': 'pebbles', 'age': 1, 'active': false }+ * ];+ *+ * _.partition(users, function(o) { return o.active; });+ * // => objects for [['fred'], ['barney', 'pebbles']]+ *+ * // The `_.matches` iteratee shorthand.+ * _.partition(users, { 'age': 1, 'active': false });+ * // => objects for [['pebbles'], ['barney', 'fred']]+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.partition(users, ['active', false]);+ * // => objects for [['barney', 'pebbles'], ['fred']]+ *+ * // The `_.property` iteratee shorthand.+ * _.partition(users, 'active');+ * // => objects for [['fred'], ['barney', 'pebbles']]+ */+ var partition = createAggregator(function(result, value, key) {+ result[key ? 0 : 1].push(value);+ }, function() { return [[], []]; });++ /**+ * Reduces `collection` to a value which is the accumulated result of running+ * each element in `collection` thru `iteratee`, where each successive+ * invocation is supplied the return value of the previous. If `accumulator`+ * is not given, the first element of `collection` is used as the initial+ * value. The iteratee is invoked with four arguments:+ * (accumulator, value, index|key, collection).+ *+ * Many lodash methods are guarded to work as iteratees for methods like+ * `_.reduce`, `_.reduceRight`, and `_.transform`.+ *+ * The guarded methods are:+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,+ * and `sortBy`+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @param {*} [accumulator] The initial value.+ * @returns {*} Returns the accumulated value.+ * @see _.reduceRight+ * @example+ *+ * _.reduce([1, 2], function(sum, n) {+ * return sum + n;+ * }, 0);+ * // => 3+ *+ * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {+ * (result[value] || (result[value] = [])).push(key);+ * return result;+ * }, {});+ * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)+ */+ function reduce(collection, iteratee, accumulator) {+ var func = isArray(collection) ? arrayReduce : baseReduce,+ initAccum = arguments.length < 3;++ return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);+ }++ /**+ * This method is like `_.reduce` except that it iterates over elements of+ * `collection` from right to left.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @param {*} [accumulator] The initial value.+ * @returns {*} Returns the accumulated value.+ * @see _.reduce+ * @example+ *+ * var array = [[0, 1], [2, 3], [4, 5]];+ *+ * _.reduceRight(array, function(flattened, other) {+ * return flattened.concat(other);+ * }, []);+ * // => [4, 5, 2, 3, 0, 1]+ */+ function reduceRight(collection, iteratee, accumulator) {+ var func = isArray(collection) ? arrayReduceRight : baseReduce,+ initAccum = arguments.length < 3;++ return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);+ }++ /**+ * The opposite of `_.filter`; this method returns the elements of `collection`+ * that `predicate` does **not** return truthy for.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the new filtered array.+ * @see _.filter+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': false },+ * { 'user': 'fred', 'age': 40, 'active': true }+ * ];+ *+ * _.reject(users, function(o) { return !o.active; });+ * // => objects for ['fred']+ *+ * // The `_.matches` iteratee shorthand.+ * _.reject(users, { 'age': 40, 'active': true });+ * // => objects for ['barney']+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.reject(users, ['active', false]);+ * // => objects for ['fred']+ *+ * // The `_.property` iteratee shorthand.+ * _.reject(users, 'active');+ * // => objects for ['barney']+ */+ function reject(collection, predicate) {+ var func = isArray(collection) ? arrayFilter : baseFilter;+ return func(collection, negate(getIteratee(predicate, 3)));+ }++ /**+ * Gets a random element from `collection`.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to sample.+ * @returns {*} Returns the random element.+ * @example+ *+ * _.sample([1, 2, 3, 4]);+ * // => 2+ */+ function sample(collection) {+ var func = isArray(collection) ? arraySample : baseSample;+ return func(collection);+ }++ /**+ * Gets `n` random elements at unique keys from `collection` up to the+ * size of `collection`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Collection+ * @param {Array|Object} collection The collection to sample.+ * @param {number} [n=1] The number of elements to sample.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the random elements.+ * @example+ *+ * _.sampleSize([1, 2, 3], 2);+ * // => [3, 1]+ *+ * _.sampleSize([1, 2, 3], 4);+ * // => [2, 3, 1]+ */+ function sampleSize(collection, n, guard) {+ if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {+ n = 1;+ } else {+ n = toInteger(n);+ }+ var func = isArray(collection) ? arraySampleSize : baseSampleSize;+ return func(collection, n);+ }++ /**+ * Creates an array of shuffled values, using a version of the+ * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to shuffle.+ * @returns {Array} Returns the new shuffled array.+ * @example+ *+ * _.shuffle([1, 2, 3, 4]);+ * // => [4, 1, 3, 2]+ */+ function shuffle(collection) {+ var func = isArray(collection) ? arrayShuffle : baseShuffle;+ return func(collection);+ }++ /**+ * Gets the size of `collection` by returning its length for array-like+ * values or the number of own enumerable string keyed properties for objects.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object|string} collection The collection to inspect.+ * @returns {number} Returns the collection size.+ * @example+ *+ * _.size([1, 2, 3]);+ * // => 3+ *+ * _.size({ 'a': 1, 'b': 2 });+ * // => 2+ *+ * _.size('pebbles');+ * // => 7+ */+ function size(collection) {+ if (collection == null) {+ return 0;+ }+ if (isArrayLike(collection)) {+ return isString(collection) ? stringSize(collection) : collection.length;+ }+ var tag = getTag(collection);+ if (tag == mapTag || tag == setTag) {+ return collection.size;+ }+ return baseKeys(collection).length;+ }++ /**+ * Checks if `predicate` returns truthy for **any** element of `collection`.+ * Iteration is stopped once `predicate` returns truthy. The predicate is+ * invoked with three arguments: (value, index|key, collection).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {boolean} Returns `true` if any element passes the predicate check,+ * else `false`.+ * @example+ *+ * _.some([null, 0, 'yes', false], Boolean);+ * // => true+ *+ * var users = [+ * { 'user': 'barney', 'active': true },+ * { 'user': 'fred', 'active': false }+ * ];+ *+ * // The `_.matches` iteratee shorthand.+ * _.some(users, { 'user': 'barney', 'active': false });+ * // => false+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.some(users, ['active', false]);+ * // => true+ *+ * // The `_.property` iteratee shorthand.+ * _.some(users, 'active');+ * // => true+ */+ function some(collection, predicate, guard) {+ var func = isArray(collection) ? arraySome : baseSome;+ if (guard && isIterateeCall(collection, predicate, guard)) {+ predicate = undefined;+ }+ return func(collection, getIteratee(predicate, 3));+ }++ /**+ * Creates an array of elements, sorted in ascending order by the results of+ * running each element in a collection thru each iteratee. This method+ * performs a stable sort, that is, it preserves the original sort order of+ * equal elements. The iteratees are invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Collection+ * @param {Array|Object} collection The collection to iterate over.+ * @param {...(Function|Function[])} [iteratees=[_.identity]]+ * The iteratees to sort by.+ * @returns {Array} Returns the new sorted array.+ * @example+ *+ * var users = [+ * { 'user': 'fred', 'age': 48 },+ * { 'user': 'barney', 'age': 36 },+ * { 'user': 'fred', 'age': 40 },+ * { 'user': 'barney', 'age': 34 }+ * ];+ *+ * _.sortBy(users, [function(o) { return o.user; }]);+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]+ *+ * _.sortBy(users, ['user', 'age']);+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]+ */+ var sortBy = baseRest(function(collection, iteratees) {+ if (collection == null) {+ return [];+ }+ var length = iteratees.length;+ if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {+ iteratees = [];+ } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {+ iteratees = [iteratees[0]];+ }+ return baseOrderBy(collection, baseFlatten(iteratees, 1), []);+ });++ /*------------------------------------------------------------------------*/++ /**+ * Gets the timestamp of the number of milliseconds that have elapsed since+ * the Unix epoch (1 January 1970 00:00:00 UTC).+ *+ * @static+ * @memberOf _+ * @since 2.4.0+ * @category Date+ * @returns {number} Returns the timestamp.+ * @example+ *+ * _.defer(function(stamp) {+ * console.log(_.now() - stamp);+ * }, _.now());+ * // => Logs the number of milliseconds it took for the deferred invocation.+ */+ var now = ctxNow || function() {+ return root.Date.now();+ };++ /*------------------------------------------------------------------------*/++ /**+ * The opposite of `_.before`; this method creates a function that invokes+ * `func` once it's called `n` or more times.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {number} n The number of calls before `func` is invoked.+ * @param {Function} func The function to restrict.+ * @returns {Function} Returns the new restricted function.+ * @example+ *+ * var saves = ['profile', 'settings'];+ *+ * var done = _.after(saves.length, function() {+ * console.log('done saving!');+ * });+ *+ * _.forEach(saves, function(type) {+ * asyncSave({ 'type': type, 'complete': done });+ * });+ * // => Logs 'done saving!' after the two async saves have completed.+ */+ function after(n, func) {+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ n = toInteger(n);+ return function() {+ if (--n < 1) {+ return func.apply(this, arguments);+ }+ };+ }++ /**+ * Creates a function that invokes `func`, with up to `n` arguments,+ * ignoring any additional arguments.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Function+ * @param {Function} func The function to cap arguments for.+ * @param {number} [n=func.length] The arity cap.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Function} Returns the new capped function.+ * @example+ *+ * _.map(['6', '8', '10'], _.ary(parseInt, 1));+ * // => [6, 8, 10]+ */+ function ary(func, n, guard) {+ n = guard ? undefined : n;+ n = (func && n == null) ? func.length : n;+ return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);+ }++ /**+ * Creates a function that invokes `func`, with the `this` binding and arguments+ * of the created function, while it's called less than `n` times. Subsequent+ * calls to the created function return the result of the last `func` invocation.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Function+ * @param {number} n The number of calls at which `func` is no longer invoked.+ * @param {Function} func The function to restrict.+ * @returns {Function} Returns the new restricted function.+ * @example+ *+ * jQuery(element).on('click', _.before(5, addContactToList));+ * // => Allows adding up to 4 contacts to the list.+ */+ function before(n, func) {+ var result;+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ n = toInteger(n);+ return function() {+ if (--n > 0) {+ result = func.apply(this, arguments);+ }+ if (n <= 1) {+ func = undefined;+ }+ return result;+ };+ }++ /**+ * Creates a function that invokes `func` with the `this` binding of `thisArg`+ * and `partials` prepended to the arguments it receives.+ *+ * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,+ * may be used as a placeholder for partially applied arguments.+ *+ * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"+ * property of bound functions.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to bind.+ * @param {*} thisArg The `this` binding of `func`.+ * @param {...*} [partials] The arguments to be partially applied.+ * @returns {Function} Returns the new bound function.+ * @example+ *+ * function greet(greeting, punctuation) {+ * return greeting + ' ' + this.user + punctuation;+ * }+ *+ * var object = { 'user': 'fred' };+ *+ * var bound = _.bind(greet, object, 'hi');+ * bound('!');+ * // => 'hi fred!'+ *+ * // Bound with placeholders.+ * var bound = _.bind(greet, object, _, '!');+ * bound('hi');+ * // => 'hi fred!'+ */+ var bind = baseRest(function(func, thisArg, partials) {+ var bitmask = WRAP_BIND_FLAG;+ if (partials.length) {+ var holders = replaceHolders(partials, getHolder(bind));+ bitmask |= WRAP_PARTIAL_FLAG;+ }+ return createWrap(func, bitmask, thisArg, partials, holders);+ });++ /**+ * Creates a function that invokes the method at `object[key]` with `partials`+ * prepended to the arguments it receives.+ *+ * This method differs from `_.bind` by allowing bound functions to reference+ * methods that may be redefined or don't yet exist. See+ * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)+ * for more details.+ *+ * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic+ * builds, may be used as a placeholder for partially applied arguments.+ *+ * @static+ * @memberOf _+ * @since 0.10.0+ * @category Function+ * @param {Object} object The object to invoke the method on.+ * @param {string} key The key of the method.+ * @param {...*} [partials] The arguments to be partially applied.+ * @returns {Function} Returns the new bound function.+ * @example+ *+ * var object = {+ * 'user': 'fred',+ * 'greet': function(greeting, punctuation) {+ * return greeting + ' ' + this.user + punctuation;+ * }+ * };+ *+ * var bound = _.bindKey(object, 'greet', 'hi');+ * bound('!');+ * // => 'hi fred!'+ *+ * object.greet = function(greeting, punctuation) {+ * return greeting + 'ya ' + this.user + punctuation;+ * };+ *+ * bound('!');+ * // => 'hiya fred!'+ *+ * // Bound with placeholders.+ * var bound = _.bindKey(object, 'greet', _, '!');+ * bound('hi');+ * // => 'hiya fred!'+ */+ var bindKey = baseRest(function(object, key, partials) {+ var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;+ if (partials.length) {+ var holders = replaceHolders(partials, getHolder(bindKey));+ bitmask |= WRAP_PARTIAL_FLAG;+ }+ return createWrap(key, bitmask, object, partials, holders);+ });++ /**+ * Creates a function that accepts arguments of `func` and either invokes+ * `func` returning its result, if at least `arity` number of arguments have+ * been provided, or returns a function that accepts the remaining `func`+ * arguments, and so on. The arity of `func` may be specified if `func.length`+ * is not sufficient.+ *+ * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,+ * may be used as a placeholder for provided arguments.+ *+ * **Note:** This method doesn't set the "length" property of curried functions.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Function+ * @param {Function} func The function to curry.+ * @param {number} [arity=func.length] The arity of `func`.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Function} Returns the new curried function.+ * @example+ *+ * var abc = function(a, b, c) {+ * return [a, b, c];+ * };+ *+ * var curried = _.curry(abc);+ *+ * curried(1)(2)(3);+ * // => [1, 2, 3]+ *+ * curried(1, 2)(3);+ * // => [1, 2, 3]+ *+ * curried(1, 2, 3);+ * // => [1, 2, 3]+ *+ * // Curried with placeholders.+ * curried(1)(_, 3)(2);+ * // => [1, 2, 3]+ */+ function curry(func, arity, guard) {+ arity = guard ? undefined : arity;+ var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);+ result.placeholder = curry.placeholder;+ return result;+ }++ /**+ * This method is like `_.curry` except that arguments are applied to `func`+ * in the manner of `_.partialRight` instead of `_.partial`.+ *+ * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic+ * builds, may be used as a placeholder for provided arguments.+ *+ * **Note:** This method doesn't set the "length" property of curried functions.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Function+ * @param {Function} func The function to curry.+ * @param {number} [arity=func.length] The arity of `func`.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Function} Returns the new curried function.+ * @example+ *+ * var abc = function(a, b, c) {+ * return [a, b, c];+ * };+ *+ * var curried = _.curryRight(abc);+ *+ * curried(3)(2)(1);+ * // => [1, 2, 3]+ *+ * curried(2, 3)(1);+ * // => [1, 2, 3]+ *+ * curried(1, 2, 3);+ * // => [1, 2, 3]+ *+ * // Curried with placeholders.+ * curried(3)(1, _)(2);+ * // => [1, 2, 3]+ */+ function curryRight(func, arity, guard) {+ arity = guard ? undefined : arity;+ var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);+ result.placeholder = curryRight.placeholder;+ return result;+ }++ /**+ * Creates a debounced function that delays invoking `func` until after `wait`+ * milliseconds have elapsed since the last time the debounced function was+ * invoked. The debounced function comes with a `cancel` method to cancel+ * delayed `func` invocations and a `flush` method to immediately invoke them.+ * Provide `options` to indicate whether `func` should be invoked on the+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked+ * with the last arguments provided to the debounced function. Subsequent+ * calls to the debounced function return the result of the last `func`+ * invocation.+ *+ * **Note:** If `leading` and `trailing` options are `true`, `func` is+ * invoked on the trailing edge of the timeout only if the debounced function+ * is invoked more than once during the `wait` timeout.+ *+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.+ *+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)+ * for details over the differences between `_.debounce` and `_.throttle`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to debounce.+ * @param {number} [wait=0] The number of milliseconds to delay.+ * @param {Object} [options={}] The options object.+ * @param {boolean} [options.leading=false]+ * Specify invoking on the leading edge of the timeout.+ * @param {number} [options.maxWait]+ * The maximum time `func` is allowed to be delayed before it's invoked.+ * @param {boolean} [options.trailing=true]+ * Specify invoking on the trailing edge of the timeout.+ * @returns {Function} Returns the new debounced function.+ * @example+ *+ * // Avoid costly calculations while the window size is in flux.+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));+ *+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.+ * jQuery(element).on('click', _.debounce(sendMail, 300, {+ * 'leading': true,+ * 'trailing': false+ * }));+ *+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });+ * var source = new EventSource('/stream');+ * jQuery(source).on('message', debounced);+ *+ * // Cancel the trailing debounced invocation.+ * jQuery(window).on('popstate', debounced.cancel);+ */+ function debounce(func, wait, options) {+ var lastArgs,+ lastThis,+ maxWait,+ result,+ timerId,+ lastCallTime,+ lastInvokeTime = 0,+ leading = false,+ maxing = false,+ trailing = true;++ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ wait = toNumber(wait) || 0;+ if (isObject(options)) {+ leading = !!options.leading;+ maxing = 'maxWait' in options;+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;+ trailing = 'trailing' in options ? !!options.trailing : trailing;+ }++ function invokeFunc(time) {+ var args = lastArgs,+ thisArg = lastThis;++ lastArgs = lastThis = undefined;+ lastInvokeTime = time;+ result = func.apply(thisArg, args);+ return result;+ }++ function leadingEdge(time) {+ // Reset any `maxWait` timer.+ lastInvokeTime = time;+ // Start the timer for the trailing edge.+ timerId = setTimeout(timerExpired, wait);+ // Invoke the leading edge.+ return leading ? invokeFunc(time) : result;+ }++ function remainingWait(time) {+ var timeSinceLastCall = time - lastCallTime,+ timeSinceLastInvoke = time - lastInvokeTime,+ result = wait - timeSinceLastCall;++ return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;+ }++ function shouldInvoke(time) {+ var timeSinceLastCall = time - lastCallTime,+ timeSinceLastInvoke = time - lastInvokeTime;++ // Either this is the first call, activity has stopped and we're at the+ // trailing edge, the system time has gone backwards and we're treating+ // it as the trailing edge, or we've hit the `maxWait` limit.+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));+ }++ function timerExpired() {+ var time = now();+ if (shouldInvoke(time)) {+ return trailingEdge(time);+ }+ // Restart the timer.+ timerId = setTimeout(timerExpired, remainingWait(time));+ }++ function trailingEdge(time) {+ timerId = undefined;++ // Only invoke if we have `lastArgs` which means `func` has been+ // debounced at least once.+ if (trailing && lastArgs) {+ return invokeFunc(time);+ }+ lastArgs = lastThis = undefined;+ return result;+ }++ function cancel() {+ if (timerId !== undefined) {+ clearTimeout(timerId);+ }+ lastInvokeTime = 0;+ lastArgs = lastCallTime = lastThis = timerId = undefined;+ }++ function flush() {+ return timerId === undefined ? result : trailingEdge(now());+ }++ function debounced() {+ var time = now(),+ isInvoking = shouldInvoke(time);++ lastArgs = arguments;+ lastThis = this;+ lastCallTime = time;++ if (isInvoking) {+ if (timerId === undefined) {+ return leadingEdge(lastCallTime);+ }+ if (maxing) {+ // Handle invocations in a tight loop.+ timerId = setTimeout(timerExpired, wait);+ return invokeFunc(lastCallTime);+ }+ }+ if (timerId === undefined) {+ timerId = setTimeout(timerExpired, wait);+ }+ return result;+ }+ debounced.cancel = cancel;+ debounced.flush = flush;+ return debounced;+ }++ /**+ * Defers invoking the `func` until the current call stack has cleared. Any+ * additional arguments are provided to `func` when it's invoked.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to defer.+ * @param {...*} [args] The arguments to invoke `func` with.+ * @returns {number} Returns the timer id.+ * @example+ *+ * _.defer(function(text) {+ * console.log(text);+ * }, 'deferred');+ * // => Logs 'deferred' after one millisecond.+ */+ var defer = baseRest(function(func, args) {+ return baseDelay(func, 1, args);+ });++ /**+ * Invokes `func` after `wait` milliseconds. Any additional arguments are+ * provided to `func` when it's invoked.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to delay.+ * @param {number} wait The number of milliseconds to delay invocation.+ * @param {...*} [args] The arguments to invoke `func` with.+ * @returns {number} Returns the timer id.+ * @example+ *+ * _.delay(function(text) {+ * console.log(text);+ * }, 1000, 'later');+ * // => Logs 'later' after one second.+ */+ var delay = baseRest(function(func, wait, args) {+ return baseDelay(func, toNumber(wait) || 0, args);+ });++ /**+ * Creates a function that invokes `func` with arguments reversed.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Function+ * @param {Function} func The function to flip arguments for.+ * @returns {Function} Returns the new flipped function.+ * @example+ *+ * var flipped = _.flip(function() {+ * return _.toArray(arguments);+ * });+ *+ * flipped('a', 'b', 'c', 'd');+ * // => ['d', 'c', 'b', 'a']+ */+ function flip(func) {+ return createWrap(func, WRAP_FLIP_FLAG);+ }++ /**+ * Creates a function that memoizes the result of `func`. If `resolver` is+ * provided, it determines the cache key for storing the result based on the+ * arguments provided to the memoized function. By default, the first argument+ * provided to the memoized function is used as the map cache key. The `func`+ * is invoked with the `this` binding of the memoized function.+ *+ * **Note:** The cache is exposed as the `cache` property on the memoized+ * function. Its creation may be customized by replacing the `_.memoize.Cache`+ * constructor with one whose instances implement the+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to have its output memoized.+ * @param {Function} [resolver] The function to resolve the cache key.+ * @returns {Function} Returns the new memoized function.+ * @example+ *+ * var object = { 'a': 1, 'b': 2 };+ * var other = { 'c': 3, 'd': 4 };+ *+ * var values = _.memoize(_.values);+ * values(object);+ * // => [1, 2]+ *+ * values(other);+ * // => [3, 4]+ *+ * object.a = 2;+ * values(object);+ * // => [1, 2]+ *+ * // Modify the result cache.+ * values.cache.set(object, ['a', 'b']);+ * values(object);+ * // => ['a', 'b']+ *+ * // Replace `_.memoize.Cache`.+ * _.memoize.Cache = WeakMap;+ */+ function memoize(func, resolver) {+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ var memoized = function() {+ var args = arguments,+ key = resolver ? resolver.apply(this, args) : args[0],+ cache = memoized.cache;++ if (cache.has(key)) {+ return cache.get(key);+ }+ var result = func.apply(this, args);+ memoized.cache = cache.set(key, result) || cache;+ return result;+ };+ memoized.cache = new (memoize.Cache || MapCache);+ return memoized;+ }++ // Expose `MapCache`.+ memoize.Cache = MapCache;++ /**+ * Creates a function that negates the result of the predicate `func`. The+ * `func` predicate is invoked with the `this` binding and arguments of the+ * created function.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Function+ * @param {Function} predicate The predicate to negate.+ * @returns {Function} Returns the new negated function.+ * @example+ *+ * function isEven(n) {+ * return n % 2 == 0;+ * }+ *+ * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));+ * // => [1, 3, 5]+ */+ function negate(predicate) {+ if (typeof predicate != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ return function() {+ var args = arguments;+ switch (args.length) {+ case 0: return !predicate.call(this);+ case 1: return !predicate.call(this, args[0]);+ case 2: return !predicate.call(this, args[0], args[1]);+ case 3: return !predicate.call(this, args[0], args[1], args[2]);+ }+ return !predicate.apply(this, args);+ };+ }++ /**+ * Creates a function that is restricted to invoking `func` once. Repeat calls+ * to the function return the value of the first invocation. The `func` is+ * invoked with the `this` binding and arguments of the created function.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to restrict.+ * @returns {Function} Returns the new restricted function.+ * @example+ *+ * var initialize = _.once(createApplication);+ * initialize();+ * initialize();+ * // => `createApplication` is invoked once+ */+ function once(func) {+ return before(2, func);+ }++ /**+ * Creates a function that invokes `func` with its arguments transformed.+ *+ * @static+ * @since 4.0.0+ * @memberOf _+ * @category Function+ * @param {Function} func The function to wrap.+ * @param {...(Function|Function[])} [transforms=[_.identity]]+ * The argument transforms.+ * @returns {Function} Returns the new function.+ * @example+ *+ * function doubled(n) {+ * return n * 2;+ * }+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * var func = _.overArgs(function(x, y) {+ * return [x, y];+ * }, [square, doubled]);+ *+ * func(9, 3);+ * // => [81, 6]+ *+ * func(10, 5);+ * // => [100, 10]+ */+ var overArgs = castRest(function(func, transforms) {+ transforms = (transforms.length == 1 && isArray(transforms[0]))+ ? arrayMap(transforms[0], baseUnary(getIteratee()))+ : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));++ var funcsLength = transforms.length;+ return baseRest(function(args) {+ var index = -1,+ length = nativeMin(args.length, funcsLength);++ while (++index < length) {+ args[index] = transforms[index].call(this, args[index]);+ }+ return apply(func, this, args);+ });+ });++ /**+ * Creates a function that invokes `func` with `partials` prepended to the+ * arguments it receives. This method is like `_.bind` except it does **not**+ * alter the `this` binding.+ *+ * The `_.partial.placeholder` value, which defaults to `_` in monolithic+ * builds, may be used as a placeholder for partially applied arguments.+ *+ * **Note:** This method doesn't set the "length" property of partially+ * applied functions.+ *+ * @static+ * @memberOf _+ * @since 0.2.0+ * @category Function+ * @param {Function} func The function to partially apply arguments to.+ * @param {...*} [partials] The arguments to be partially applied.+ * @returns {Function} Returns the new partially applied function.+ * @example+ *+ * function greet(greeting, name) {+ * return greeting + ' ' + name;+ * }+ *+ * var sayHelloTo = _.partial(greet, 'hello');+ * sayHelloTo('fred');+ * // => 'hello fred'+ *+ * // Partially applied with placeholders.+ * var greetFred = _.partial(greet, _, 'fred');+ * greetFred('hi');+ * // => 'hi fred'+ */+ var partial = baseRest(function(func, partials) {+ var holders = replaceHolders(partials, getHolder(partial));+ return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);+ });++ /**+ * This method is like `_.partial` except that partially applied arguments+ * are appended to the arguments it receives.+ *+ * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic+ * builds, may be used as a placeholder for partially applied arguments.+ *+ * **Note:** This method doesn't set the "length" property of partially+ * applied functions.+ *+ * @static+ * @memberOf _+ * @since 1.0.0+ * @category Function+ * @param {Function} func The function to partially apply arguments to.+ * @param {...*} [partials] The arguments to be partially applied.+ * @returns {Function} Returns the new partially applied function.+ * @example+ *+ * function greet(greeting, name) {+ * return greeting + ' ' + name;+ * }+ *+ * var greetFred = _.partialRight(greet, 'fred');+ * greetFred('hi');+ * // => 'hi fred'+ *+ * // Partially applied with placeholders.+ * var sayHelloTo = _.partialRight(greet, 'hello', _);+ * sayHelloTo('fred');+ * // => 'hello fred'+ */+ var partialRight = baseRest(function(func, partials) {+ var holders = replaceHolders(partials, getHolder(partialRight));+ return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);+ });++ /**+ * Creates a function that invokes `func` with arguments arranged according+ * to the specified `indexes` where the argument value at the first index is+ * provided as the first argument, the argument value at the second index is+ * provided as the second argument, and so on.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Function+ * @param {Function} func The function to rearrange arguments for.+ * @param {...(number|number[])} indexes The arranged argument indexes.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var rearged = _.rearg(function(a, b, c) {+ * return [a, b, c];+ * }, [2, 0, 1]);+ *+ * rearged('b', 'c', 'a')+ * // => ['a', 'b', 'c']+ */+ var rearg = flatRest(function(func, indexes) {+ return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);+ });++ /**+ * Creates a function that invokes `func` with the `this` binding of the+ * created function and arguments from `start` and beyond provided as+ * an array.+ *+ * **Note:** This method is based on the+ * [rest parameter](https://mdn.io/rest_parameters).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Function+ * @param {Function} func The function to apply a rest parameter to.+ * @param {number} [start=func.length-1] The start position of the rest parameter.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var say = _.rest(function(what, names) {+ * return what + ' ' + _.initial(names).join(', ') ++ * (_.size(names) > 1 ? ', & ' : '') + _.last(names);+ * });+ *+ * say('hello', 'fred', 'barney', 'pebbles');+ * // => 'hello fred, barney, & pebbles'+ */+ function rest(func, start) {+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ start = start === undefined ? start : toInteger(start);+ return baseRest(func, start);+ }++ /**+ * Creates a function that invokes `func` with the `this` binding of the+ * create function and an array of arguments much like+ * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).+ *+ * **Note:** This method is based on the+ * [spread operator](https://mdn.io/spread_operator).+ *+ * @static+ * @memberOf _+ * @since 3.2.0+ * @category Function+ * @param {Function} func The function to spread arguments over.+ * @param {number} [start=0] The start position of the spread.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var say = _.spread(function(who, what) {+ * return who + ' says ' + what;+ * });+ *+ * say(['fred', 'hello']);+ * // => 'fred says hello'+ *+ * var numbers = Promise.all([+ * Promise.resolve(40),+ * Promise.resolve(36)+ * ]);+ *+ * numbers.then(_.spread(function(x, y) {+ * return x + y;+ * }));+ * // => a Promise of 76+ */+ function spread(func, start) {+ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ start = start == null ? 0 : nativeMax(toInteger(start), 0);+ return baseRest(function(args) {+ var array = args[start],+ otherArgs = castSlice(args, 0, start);++ if (array) {+ arrayPush(otherArgs, array);+ }+ return apply(func, this, otherArgs);+ });+ }++ /**+ * Creates a throttled function that only invokes `func` at most once per+ * every `wait` milliseconds. The throttled function comes with a `cancel`+ * method to cancel delayed `func` invocations and a `flush` method to+ * immediately invoke them. Provide `options` to indicate whether `func`+ * should be invoked on the leading and/or trailing edge of the `wait`+ * timeout. The `func` is invoked with the last arguments provided to the+ * throttled function. Subsequent calls to the throttled function return the+ * result of the last `func` invocation.+ *+ * **Note:** If `leading` and `trailing` options are `true`, `func` is+ * invoked on the trailing edge of the timeout only if the throttled function+ * is invoked more than once during the `wait` timeout.+ *+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.+ *+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)+ * for details over the differences between `_.throttle` and `_.debounce`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {Function} func The function to throttle.+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.+ * @param {Object} [options={}] The options object.+ * @param {boolean} [options.leading=true]+ * Specify invoking on the leading edge of the timeout.+ * @param {boolean} [options.trailing=true]+ * Specify invoking on the trailing edge of the timeout.+ * @returns {Function} Returns the new throttled function.+ * @example+ *+ * // Avoid excessively updating the position while scrolling.+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));+ *+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });+ * jQuery(element).on('click', throttled);+ *+ * // Cancel the trailing throttled invocation.+ * jQuery(window).on('popstate', throttled.cancel);+ */+ function throttle(func, wait, options) {+ var leading = true,+ trailing = true;++ if (typeof func != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ if (isObject(options)) {+ leading = 'leading' in options ? !!options.leading : leading;+ trailing = 'trailing' in options ? !!options.trailing : trailing;+ }+ return debounce(func, wait, {+ 'leading': leading,+ 'maxWait': wait,+ 'trailing': trailing+ });+ }++ /**+ * Creates a function that accepts up to one argument, ignoring any+ * additional arguments.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Function+ * @param {Function} func The function to cap arguments for.+ * @returns {Function} Returns the new capped function.+ * @example+ *+ * _.map(['6', '8', '10'], _.unary(parseInt));+ * // => [6, 8, 10]+ */+ function unary(func) {+ return ary(func, 1);+ }++ /**+ * Creates a function that provides `value` to `wrapper` as its first+ * argument. Any additional arguments provided to the function are appended+ * to those provided to the `wrapper`. The wrapper is invoked with the `this`+ * binding of the created function.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Function+ * @param {*} value The value to wrap.+ * @param {Function} [wrapper=identity] The wrapper function.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var p = _.wrap(_.escape, function(func, text) {+ * return '<p>' + func(text) + '</p>';+ * });+ *+ * p('fred, barney, & pebbles');+ * // => '<p>fred, barney, & pebbles</p>'+ */+ function wrap(value, wrapper) {+ return partial(castFunction(wrapper), value);+ }++ /*------------------------------------------------------------------------*/++ /**+ * Casts `value` as an array if it's not one.+ *+ * @static+ * @memberOf _+ * @since 4.4.0+ * @category Lang+ * @param {*} value The value to inspect.+ * @returns {Array} Returns the cast array.+ * @example+ *+ * _.castArray(1);+ * // => [1]+ *+ * _.castArray({ 'a': 1 });+ * // => [{ 'a': 1 }]+ *+ * _.castArray('abc');+ * // => ['abc']+ *+ * _.castArray(null);+ * // => [null]+ *+ * _.castArray(undefined);+ * // => [undefined]+ *+ * _.castArray();+ * // => []+ *+ * var array = [1, 2, 3];+ * console.log(_.castArray(array) === array);+ * // => true+ */+ function castArray() {+ if (!arguments.length) {+ return [];+ }+ var value = arguments[0];+ return isArray(value) ? value : [value];+ }++ /**+ * Creates a shallow clone of `value`.+ *+ * **Note:** This method is loosely based on the+ * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)+ * and supports cloning arrays, array buffers, booleans, date objects, maps,+ * numbers, `Object` objects, regexes, sets, strings, symbols, and typed+ * arrays. The own enumerable properties of `arguments` objects are cloned+ * as plain objects. An empty object is returned for uncloneable values such+ * as error objects, functions, DOM nodes, and WeakMaps.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to clone.+ * @returns {*} Returns the cloned value.+ * @see _.cloneDeep+ * @example+ *+ * var objects = [{ 'a': 1 }, { 'b': 2 }];+ *+ * var shallow = _.clone(objects);+ * console.log(shallow[0] === objects[0]);+ * // => true+ */+ function clone(value) {+ return baseClone(value, CLONE_SYMBOLS_FLAG);+ }++ /**+ * This method is like `_.clone` except that it accepts `customizer` which+ * is invoked to produce the cloned value. If `customizer` returns `undefined`,+ * cloning is handled by the method instead. The `customizer` is invoked with+ * up to four arguments; (value [, index|key, object, stack]).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to clone.+ * @param {Function} [customizer] The function to customize cloning.+ * @returns {*} Returns the cloned value.+ * @see _.cloneDeepWith+ * @example+ *+ * function customizer(value) {+ * if (_.isElement(value)) {+ * return value.cloneNode(false);+ * }+ * }+ *+ * var el = _.cloneWith(document.body, customizer);+ *+ * console.log(el === document.body);+ * // => false+ * console.log(el.nodeName);+ * // => 'BODY'+ * console.log(el.childNodes.length);+ * // => 0+ */+ function cloneWith(value, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);+ }++ /**+ * This method is like `_.clone` except that it recursively clones `value`.+ *+ * @static+ * @memberOf _+ * @since 1.0.0+ * @category Lang+ * @param {*} value The value to recursively clone.+ * @returns {*} Returns the deep cloned value.+ * @see _.clone+ * @example+ *+ * var objects = [{ 'a': 1 }, { 'b': 2 }];+ *+ * var deep = _.cloneDeep(objects);+ * console.log(deep[0] === objects[0]);+ * // => false+ */+ function cloneDeep(value) {+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);+ }++ /**+ * This method is like `_.cloneWith` except that it recursively clones `value`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to recursively clone.+ * @param {Function} [customizer] The function to customize cloning.+ * @returns {*} Returns the deep cloned value.+ * @see _.cloneWith+ * @example+ *+ * function customizer(value) {+ * if (_.isElement(value)) {+ * return value.cloneNode(true);+ * }+ * }+ *+ * var el = _.cloneDeepWith(document.body, customizer);+ *+ * console.log(el === document.body);+ * // => false+ * console.log(el.nodeName);+ * // => 'BODY'+ * console.log(el.childNodes.length);+ * // => 20+ */+ function cloneDeepWith(value, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);+ }++ /**+ * Checks if `object` conforms to `source` by invoking the predicate+ * properties of `source` with the corresponding property values of `object`.+ *+ * **Note:** This method is equivalent to `_.conforms` when `source` is+ * partially applied.+ *+ * @static+ * @memberOf _+ * @since 4.14.0+ * @category Lang+ * @param {Object} object The object to inspect.+ * @param {Object} source The object of property predicates to conform to.+ * @returns {boolean} Returns `true` if `object` conforms, else `false`.+ * @example+ *+ * var object = { 'a': 1, 'b': 2 };+ *+ * _.conformsTo(object, { 'b': function(n) { return n > 1; } });+ * // => true+ *+ * _.conformsTo(object, { 'b': function(n) { return n > 2; } });+ * // => false+ */+ function conformsTo(object, source) {+ return source == null || baseConformsTo(object, source, keys(source));+ }++ /**+ * Performs a+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)+ * comparison between two values to determine if they are equivalent.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.+ * @example+ *+ * var object = { 'a': 1 };+ * var other = { 'a': 1 };+ *+ * _.eq(object, object);+ * // => true+ *+ * _.eq(object, other);+ * // => false+ *+ * _.eq('a', 'a');+ * // => true+ *+ * _.eq('a', Object('a'));+ * // => false+ *+ * _.eq(NaN, NaN);+ * // => true+ */+ function eq(value, other) {+ return value === other || (value !== value && other !== other);+ }++ /**+ * Checks if `value` is greater than `other`.+ *+ * @static+ * @memberOf _+ * @since 3.9.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is greater than `other`,+ * else `false`.+ * @see _.lt+ * @example+ *+ * _.gt(3, 1);+ * // => true+ *+ * _.gt(3, 3);+ * // => false+ *+ * _.gt(1, 3);+ * // => false+ */+ var gt = createRelationalOperation(baseGt);++ /**+ * Checks if `value` is greater than or equal to `other`.+ *+ * @static+ * @memberOf _+ * @since 3.9.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is greater than or equal to+ * `other`, else `false`.+ * @see _.lte+ * @example+ *+ * _.gte(3, 1);+ * // => true+ *+ * _.gte(3, 3);+ * // => true+ *+ * _.gte(1, 3);+ * // => false+ */+ var gte = createRelationalOperation(function(value, other) {+ return value >= other;+ });++ /**+ * Checks if `value` is likely an `arguments` object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,+ * else `false`.+ * @example+ *+ * _.isArguments(function() { return arguments; }());+ * // => true+ *+ * _.isArguments([1, 2, 3]);+ * // => false+ */+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&+ !propertyIsEnumerable.call(value, 'callee');+ };++ /**+ * Checks if `value` is classified as an `Array` object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.+ * @example+ *+ * _.isArray([1, 2, 3]);+ * // => true+ *+ * _.isArray(document.body.children);+ * // => false+ *+ * _.isArray('abc');+ * // => false+ *+ * _.isArray(_.noop);+ * // => false+ */+ var isArray = Array.isArray;++ /**+ * Checks if `value` is classified as an `ArrayBuffer` object.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.+ * @example+ *+ * _.isArrayBuffer(new ArrayBuffer(2));+ * // => true+ *+ * _.isArrayBuffer(new Array(2));+ * // => false+ */+ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;++ /**+ * Checks if `value` is array-like. A value is considered array-like if it's+ * not a function and has a `value.length` that's an integer greater than or+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.+ * @example+ *+ * _.isArrayLike([1, 2, 3]);+ * // => true+ *+ * _.isArrayLike(document.body.children);+ * // => true+ *+ * _.isArrayLike('abc');+ * // => true+ *+ * _.isArrayLike(_.noop);+ * // => false+ */+ function isArrayLike(value) {+ return value != null && isLength(value.length) && !isFunction(value);+ }++ /**+ * This method is like `_.isArrayLike` except that it also checks if `value`+ * is an object.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an array-like object,+ * else `false`.+ * @example+ *+ * _.isArrayLikeObject([1, 2, 3]);+ * // => true+ *+ * _.isArrayLikeObject(document.body.children);+ * // => true+ *+ * _.isArrayLikeObject('abc');+ * // => false+ *+ * _.isArrayLikeObject(_.noop);+ * // => false+ */+ function isArrayLikeObject(value) {+ return isObjectLike(value) && isArrayLike(value);+ }++ /**+ * Checks if `value` is classified as a boolean primitive or object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.+ * @example+ *+ * _.isBoolean(false);+ * // => true+ *+ * _.isBoolean(null);+ * // => false+ */+ function isBoolean(value) {+ return value === true || value === false ||+ (isObjectLike(value) && baseGetTag(value) == boolTag);+ }++ /**+ * Checks if `value` is a buffer.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.+ * @example+ *+ * _.isBuffer(new Buffer(2));+ * // => true+ *+ * _.isBuffer(new Uint8Array(2));+ * // => false+ */+ var isBuffer = nativeIsBuffer || stubFalse;++ /**+ * Checks if `value` is classified as a `Date` object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a date object, else `false`.+ * @example+ *+ * _.isDate(new Date);+ * // => true+ *+ * _.isDate('Mon April 23 2012');+ * // => false+ */+ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;++ /**+ * Checks if `value` is likely a DOM element.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.+ * @example+ *+ * _.isElement(document.body);+ * // => true+ *+ * _.isElement('<body>');+ * // => false+ */+ function isElement(value) {+ return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);+ }++ /**+ * Checks if `value` is an empty object, collection, map, or set.+ *+ * Objects are considered empty if they have no own enumerable string keyed+ * properties.+ *+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or+ * jQuery-like collections are considered empty if they have a `length` of `0`.+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.+ * @example+ *+ * _.isEmpty(null);+ * // => true+ *+ * _.isEmpty(true);+ * // => true+ *+ * _.isEmpty(1);+ * // => true+ *+ * _.isEmpty([1, 2, 3]);+ * // => false+ *+ * _.isEmpty({ 'a': 1 });+ * // => false+ */+ function isEmpty(value) {+ if (value == null) {+ return true;+ }+ if (isArrayLike(value) &&+ (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||+ isBuffer(value) || isTypedArray(value) || isArguments(value))) {+ return !value.length;+ }+ var tag = getTag(value);+ if (tag == mapTag || tag == setTag) {+ return !value.size;+ }+ if (isPrototype(value)) {+ return !baseKeys(value).length;+ }+ for (var key in value) {+ if (hasOwnProperty.call(value, key)) {+ return false;+ }+ }+ return true;+ }++ /**+ * Performs a deep comparison between two values to determine if they are+ * equivalent.+ *+ * **Note:** This method supports comparing arrays, array buffers, booleans,+ * date objects, error objects, maps, numbers, `Object` objects, regexes,+ * sets, strings, symbols, and typed arrays. `Object` objects are compared+ * by their own, not inherited, enumerable properties. Functions and DOM+ * nodes are compared by strict equality, i.e. `===`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.+ * @example+ *+ * var object = { 'a': 1 };+ * var other = { 'a': 1 };+ *+ * _.isEqual(object, other);+ * // => true+ *+ * object === other;+ * // => false+ */+ function isEqual(value, other) {+ return baseIsEqual(value, other);+ }++ /**+ * This method is like `_.isEqual` except that it accepts `customizer` which+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons+ * are handled by the method instead. The `customizer` is invoked with up to+ * six arguments: (objValue, othValue [, index|key, object, other, stack]).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @param {Function} [customizer] The function to customize comparisons.+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.+ * @example+ *+ * function isGreeting(value) {+ * return /^h(?:i|ello)$/.test(value);+ * }+ *+ * function customizer(objValue, othValue) {+ * if (isGreeting(objValue) && isGreeting(othValue)) {+ * return true;+ * }+ * }+ *+ * var array = ['hello', 'goodbye'];+ * var other = ['hi', 'goodbye'];+ *+ * _.isEqualWith(array, other, customizer);+ * // => true+ */+ function isEqualWith(value, other, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ var result = customizer ? customizer(value, other) : undefined;+ return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;+ }++ /**+ * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,+ * `SyntaxError`, `TypeError`, or `URIError` object.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an error object, else `false`.+ * @example+ *+ * _.isError(new Error);+ * // => true+ *+ * _.isError(Error);+ * // => false+ */+ function isError(value) {+ if (!isObjectLike(value)) {+ return false;+ }+ var tag = baseGetTag(value);+ return tag == errorTag || tag == domExcTag ||+ (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));+ }++ /**+ * Checks if `value` is a finite primitive number.+ *+ * **Note:** This method is based on+ * [`Number.isFinite`](https://mdn.io/Number/isFinite).+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.+ * @example+ *+ * _.isFinite(3);+ * // => true+ *+ * _.isFinite(Number.MIN_VALUE);+ * // => true+ *+ * _.isFinite(Infinity);+ * // => false+ *+ * _.isFinite('3');+ * // => false+ */+ function isFinite(value) {+ return typeof value == 'number' && nativeIsFinite(value);+ }++ /**+ * Checks if `value` is classified as a `Function` object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.+ * @example+ *+ * _.isFunction(_);+ * // => true+ *+ * _.isFunction(/abc/);+ * // => false+ */+ function isFunction(value) {+ if (!isObject(value)) {+ return false;+ }+ // The use of `Object#toString` avoids issues with the `typeof` operator+ // in Safari 9 which returns 'object' for typed arrays and other constructors.+ var tag = baseGetTag(value);+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;+ }++ /**+ * Checks if `value` is an integer.+ *+ * **Note:** This method is based on+ * [`Number.isInteger`](https://mdn.io/Number/isInteger).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an integer, else `false`.+ * @example+ *+ * _.isInteger(3);+ * // => true+ *+ * _.isInteger(Number.MIN_VALUE);+ * // => false+ *+ * _.isInteger(Infinity);+ * // => false+ *+ * _.isInteger('3');+ * // => false+ */+ function isInteger(value) {+ return typeof value == 'number' && value == toInteger(value);+ }++ /**+ * Checks if `value` is a valid array-like length.+ *+ * **Note:** This method is loosely based on+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.+ * @example+ *+ * _.isLength(3);+ * // => true+ *+ * _.isLength(Number.MIN_VALUE);+ * // => false+ *+ * _.isLength(Infinity);+ * // => false+ *+ * _.isLength('3');+ * // => false+ */+ function isLength(value) {+ return typeof value == 'number' &&+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;+ }++ /**+ * Checks if `value` is the+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.+ * @example+ *+ * _.isObject({});+ * // => true+ *+ * _.isObject([1, 2, 3]);+ * // => true+ *+ * _.isObject(_.noop);+ * // => true+ *+ * _.isObject(null);+ * // => false+ */+ function isObject(value) {+ var type = typeof value;+ return value != null && (type == 'object' || type == 'function');+ }++ /**+ * Checks if `value` is object-like. A value is object-like if it's not `null`+ * and has a `typeof` result of "object".+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.+ * @example+ *+ * _.isObjectLike({});+ * // => true+ *+ * _.isObjectLike([1, 2, 3]);+ * // => true+ *+ * _.isObjectLike(_.noop);+ * // => false+ *+ * _.isObjectLike(null);+ * // => false+ */+ function isObjectLike(value) {+ return value != null && typeof value == 'object';+ }++ /**+ * Checks if `value` is classified as a `Map` object.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a map, else `false`.+ * @example+ *+ * _.isMap(new Map);+ * // => true+ *+ * _.isMap(new WeakMap);+ * // => false+ */+ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;++ /**+ * Performs a partial deep comparison between `object` and `source` to+ * determine if `object` contains equivalent property values.+ *+ * **Note:** This method is equivalent to `_.matches` when `source` is+ * partially applied.+ *+ * Partial comparisons will match empty array and empty object `source`+ * values against any array or object value, respectively. See `_.isEqual`+ * for a list of supported value comparisons.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Lang+ * @param {Object} object The object to inspect.+ * @param {Object} source The object of property values to match.+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.+ * @example+ *+ * var object = { 'a': 1, 'b': 2 };+ *+ * _.isMatch(object, { 'b': 2 });+ * // => true+ *+ * _.isMatch(object, { 'b': 1 });+ * // => false+ */+ function isMatch(object, source) {+ return object === source || baseIsMatch(object, source, getMatchData(source));+ }++ /**+ * This method is like `_.isMatch` except that it accepts `customizer` which+ * is invoked to compare values. If `customizer` returns `undefined`, comparisons+ * are handled by the method instead. The `customizer` is invoked with five+ * arguments: (objValue, srcValue, index|key, object, source).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {Object} object The object to inspect.+ * @param {Object} source The object of property values to match.+ * @param {Function} [customizer] The function to customize comparisons.+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.+ * @example+ *+ * function isGreeting(value) {+ * return /^h(?:i|ello)$/.test(value);+ * }+ *+ * function customizer(objValue, srcValue) {+ * if (isGreeting(objValue) && isGreeting(srcValue)) {+ * return true;+ * }+ * }+ *+ * var object = { 'greeting': 'hello' };+ * var source = { 'greeting': 'hi' };+ *+ * _.isMatchWith(object, source, customizer);+ * // => true+ */+ function isMatchWith(object, source, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ return baseIsMatch(object, source, getMatchData(source), customizer);+ }++ /**+ * Checks if `value` is `NaN`.+ *+ * **Note:** This method is based on+ * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as+ * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for+ * `undefined` and other non-number values.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.+ * @example+ *+ * _.isNaN(NaN);+ * // => true+ *+ * _.isNaN(new Number(NaN));+ * // => true+ *+ * isNaN(undefined);+ * // => true+ *+ * _.isNaN(undefined);+ * // => false+ */+ function isNaN(value) {+ // An `NaN` primitive is the only value that is not equal to itself.+ // Perform the `toStringTag` check first to avoid errors with some+ // ActiveX objects in IE.+ return isNumber(value) && value != +value;+ }++ /**+ * Checks if `value` is a pristine native function.+ *+ * **Note:** This method can't reliably detect native functions in the presence+ * of the core-js package because core-js circumvents this kind of detection.+ * Despite multiple requests, the core-js maintainer has made it clear: any+ * attempt to fix the detection will be obstructed. As a result, we're left+ * with little choice but to throw an error. Unfortunately, this also affects+ * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),+ * which rely on core-js.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a native function,+ * else `false`.+ * @example+ *+ * _.isNative(Array.prototype.push);+ * // => true+ *+ * _.isNative(_);+ * // => false+ */+ function isNative(value) {+ if (isMaskable(value)) {+ throw new Error(CORE_ERROR_TEXT);+ }+ return baseIsNative(value);+ }++ /**+ * Checks if `value` is `null`.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is `null`, else `false`.+ * @example+ *+ * _.isNull(null);+ * // => true+ *+ * _.isNull(void 0);+ * // => false+ */+ function isNull(value) {+ return value === null;+ }++ /**+ * Checks if `value` is `null` or `undefined`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is nullish, else `false`.+ * @example+ *+ * _.isNil(null);+ * // => true+ *+ * _.isNil(void 0);+ * // => true+ *+ * _.isNil(NaN);+ * // => false+ */+ function isNil(value) {+ return value == null;+ }++ /**+ * Checks if `value` is classified as a `Number` primitive or object.+ *+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are+ * classified as numbers, use the `_.isFinite` method.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a number, else `false`.+ * @example+ *+ * _.isNumber(3);+ * // => true+ *+ * _.isNumber(Number.MIN_VALUE);+ * // => true+ *+ * _.isNumber(Infinity);+ * // => true+ *+ * _.isNumber('3');+ * // => false+ */+ function isNumber(value) {+ return typeof value == 'number' ||+ (isObjectLike(value) && baseGetTag(value) == numberTag);+ }++ /**+ * Checks if `value` is a plain object, that is, an object created by the+ * `Object` constructor or one with a `[[Prototype]]` of `null`.+ *+ * @static+ * @memberOf _+ * @since 0.8.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * }+ *+ * _.isPlainObject(new Foo);+ * // => false+ *+ * _.isPlainObject([1, 2, 3]);+ * // => false+ *+ * _.isPlainObject({ 'x': 0, 'y': 0 });+ * // => true+ *+ * _.isPlainObject(Object.create(null));+ * // => true+ */+ function isPlainObject(value) {+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) {+ return false;+ }+ var proto = getPrototype(value);+ if (proto === null) {+ return true;+ }+ var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;+ return typeof Ctor == 'function' && Ctor instanceof Ctor &&+ funcToString.call(Ctor) == objectCtorString;+ }++ /**+ * Checks if `value` is classified as a `RegExp` object.+ *+ * @static+ * @memberOf _+ * @since 0.1.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.+ * @example+ *+ * _.isRegExp(/abc/);+ * // => true+ *+ * _.isRegExp('/abc/');+ * // => false+ */+ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;++ /**+ * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754+ * double precision number which isn't the result of a rounded unsafe integer.+ *+ * **Note:** This method is based on+ * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.+ * @example+ *+ * _.isSafeInteger(3);+ * // => true+ *+ * _.isSafeInteger(Number.MIN_VALUE);+ * // => false+ *+ * _.isSafeInteger(Infinity);+ * // => false+ *+ * _.isSafeInteger('3');+ * // => false+ */+ function isSafeInteger(value) {+ return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;+ }++ /**+ * Checks if `value` is classified as a `Set` object.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a set, else `false`.+ * @example+ *+ * _.isSet(new Set);+ * // => true+ *+ * _.isSet(new WeakSet);+ * // => false+ */+ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;++ /**+ * Checks if `value` is classified as a `String` primitive or object.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.+ * @example+ *+ * _.isString('abc');+ * // => true+ *+ * _.isString(1);+ * // => false+ */+ function isString(value) {+ return typeof value == 'string' ||+ (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);+ }++ /**+ * Checks if `value` is classified as a `Symbol` primitive or object.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.+ * @example+ *+ * _.isSymbol(Symbol.iterator);+ * // => true+ *+ * _.isSymbol('abc');+ * // => false+ */+ function isSymbol(value) {+ return typeof value == 'symbol' ||+ (isObjectLike(value) && baseGetTag(value) == symbolTag);+ }++ /**+ * Checks if `value` is classified as a typed array.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.+ * @example+ *+ * _.isTypedArray(new Uint8Array);+ * // => true+ *+ * _.isTypedArray([]);+ * // => false+ */+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;++ /**+ * Checks if `value` is `undefined`.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.+ * @example+ *+ * _.isUndefined(void 0);+ * // => true+ *+ * _.isUndefined(null);+ * // => false+ */+ function isUndefined(value) {+ return value === undefined;+ }++ /**+ * Checks if `value` is classified as a `WeakMap` object.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.+ * @example+ *+ * _.isWeakMap(new WeakMap);+ * // => true+ *+ * _.isWeakMap(new Map);+ * // => false+ */+ function isWeakMap(value) {+ return isObjectLike(value) && getTag(value) == weakMapTag;+ }++ /**+ * Checks if `value` is classified as a `WeakSet` object.+ *+ * @static+ * @memberOf _+ * @since 4.3.0+ * @category Lang+ * @param {*} value The value to check.+ * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.+ * @example+ *+ * _.isWeakSet(new WeakSet);+ * // => true+ *+ * _.isWeakSet(new Set);+ * // => false+ */+ function isWeakSet(value) {+ return isObjectLike(value) && baseGetTag(value) == weakSetTag;+ }++ /**+ * Checks if `value` is less than `other`.+ *+ * @static+ * @memberOf _+ * @since 3.9.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is less than `other`,+ * else `false`.+ * @see _.gt+ * @example+ *+ * _.lt(1, 3);+ * // => true+ *+ * _.lt(3, 3);+ * // => false+ *+ * _.lt(3, 1);+ * // => false+ */+ var lt = createRelationalOperation(baseLt);++ /**+ * Checks if `value` is less than or equal to `other`.+ *+ * @static+ * @memberOf _+ * @since 3.9.0+ * @category Lang+ * @param {*} value The value to compare.+ * @param {*} other The other value to compare.+ * @returns {boolean} Returns `true` if `value` is less than or equal to+ * `other`, else `false`.+ * @see _.gte+ * @example+ *+ * _.lte(1, 3);+ * // => true+ *+ * _.lte(3, 3);+ * // => true+ *+ * _.lte(3, 1);+ * // => false+ */+ var lte = createRelationalOperation(function(value, other) {+ return value <= other;+ });++ /**+ * Converts `value` to an array.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {Array} Returns the converted array.+ * @example+ *+ * _.toArray({ 'a': 1, 'b': 2 });+ * // => [1, 2]+ *+ * _.toArray('abc');+ * // => ['a', 'b', 'c']+ *+ * _.toArray(1);+ * // => []+ *+ * _.toArray(null);+ * // => []+ */+ function toArray(value) {+ if (!value) {+ return [];+ }+ if (isArrayLike(value)) {+ return isString(value) ? stringToArray(value) : copyArray(value);+ }+ if (symIterator && value[symIterator]) {+ return iteratorToArray(value[symIterator]());+ }+ var tag = getTag(value),+ func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);++ return func(value);+ }++ /**+ * Converts `value` to a finite number.+ *+ * @static+ * @memberOf _+ * @since 4.12.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {number} Returns the converted number.+ * @example+ *+ * _.toFinite(3.2);+ * // => 3.2+ *+ * _.toFinite(Number.MIN_VALUE);+ * // => 5e-324+ *+ * _.toFinite(Infinity);+ * // => 1.7976931348623157e+308+ *+ * _.toFinite('3.2');+ * // => 3.2+ */+ function toFinite(value) {+ if (!value) {+ return value === 0 ? value : 0;+ }+ value = toNumber(value);+ if (value === INFINITY || value === -INFINITY) {+ var sign = (value < 0 ? -1 : 1);+ return sign * MAX_INTEGER;+ }+ return value === value ? value : 0;+ }++ /**+ * Converts `value` to an integer.+ *+ * **Note:** This method is loosely based on+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {number} Returns the converted integer.+ * @example+ *+ * _.toInteger(3.2);+ * // => 3+ *+ * _.toInteger(Number.MIN_VALUE);+ * // => 0+ *+ * _.toInteger(Infinity);+ * // => 1.7976931348623157e+308+ *+ * _.toInteger('3.2');+ * // => 3+ */+ function toInteger(value) {+ var result = toFinite(value),+ remainder = result % 1;++ return result === result ? (remainder ? result - remainder : result) : 0;+ }++ /**+ * Converts `value` to an integer suitable for use as the length of an+ * array-like object.+ *+ * **Note:** This method is based on+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {number} Returns the converted integer.+ * @example+ *+ * _.toLength(3.2);+ * // => 3+ *+ * _.toLength(Number.MIN_VALUE);+ * // => 0+ *+ * _.toLength(Infinity);+ * // => 4294967295+ *+ * _.toLength('3.2');+ * // => 3+ */+ function toLength(value) {+ return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;+ }++ /**+ * Converts `value` to a number.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to process.+ * @returns {number} Returns the number.+ * @example+ *+ * _.toNumber(3.2);+ * // => 3.2+ *+ * _.toNumber(Number.MIN_VALUE);+ * // => 5e-324+ *+ * _.toNumber(Infinity);+ * // => Infinity+ *+ * _.toNumber('3.2');+ * // => 3.2+ */+ function toNumber(value) {+ if (typeof value == 'number') {+ return value;+ }+ if (isSymbol(value)) {+ return NAN;+ }+ if (isObject(value)) {+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;+ value = isObject(other) ? (other + '') : other;+ }+ if (typeof value != 'string') {+ return value === 0 ? value : +value;+ }+ value = value.replace(reTrim, '');+ var isBinary = reIsBinary.test(value);+ return (isBinary || reIsOctal.test(value))+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)+ : (reIsBadHex.test(value) ? NAN : +value);+ }++ /**+ * Converts `value` to a plain object flattening inherited enumerable string+ * keyed properties of `value` to own properties of the plain object.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {Object} Returns the converted plain object.+ * @example+ *+ * function Foo() {+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.assign({ 'a': 1 }, new Foo);+ * // => { 'a': 1, 'b': 2 }+ *+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));+ * // => { 'a': 1, 'b': 2, 'c': 3 }+ */+ function toPlainObject(value) {+ return copyObject(value, keysIn(value));+ }++ /**+ * Converts `value` to a safe integer. A safe integer can be compared and+ * represented correctly.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {number} Returns the converted integer.+ * @example+ *+ * _.toSafeInteger(3.2);+ * // => 3+ *+ * _.toSafeInteger(Number.MIN_VALUE);+ * // => 0+ *+ * _.toSafeInteger(Infinity);+ * // => 9007199254740991+ *+ * _.toSafeInteger('3.2');+ * // => 3+ */+ function toSafeInteger(value) {+ return value+ ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)+ : (value === 0 ? value : 0);+ }++ /**+ * Converts `value` to a string. An empty string is returned for `null`+ * and `undefined` values. The sign of `-0` is preserved.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Lang+ * @param {*} value The value to convert.+ * @returns {string} Returns the converted string.+ * @example+ *+ * _.toString(null);+ * // => ''+ *+ * _.toString(-0);+ * // => '-0'+ *+ * _.toString([1, 2, 3]);+ * // => '1,2,3'+ */+ function toString(value) {+ return value == null ? '' : baseToString(value);+ }++ /*------------------------------------------------------------------------*/++ /**+ * Assigns own enumerable string keyed properties of source objects to the+ * destination object. Source objects are applied from left to right.+ * Subsequent sources overwrite property assignments of previous sources.+ *+ * **Note:** This method mutates `object` and is loosely based on+ * [`Object.assign`](https://mdn.io/Object/assign).+ *+ * @static+ * @memberOf _+ * @since 0.10.0+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} [sources] The source objects.+ * @returns {Object} Returns `object`.+ * @see _.assignIn+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * }+ *+ * function Bar() {+ * this.c = 3;+ * }+ *+ * Foo.prototype.b = 2;+ * Bar.prototype.d = 4;+ *+ * _.assign({ 'a': 0 }, new Foo, new Bar);+ * // => { 'a': 1, 'c': 3 }+ */+ var assign = createAssigner(function(object, source) {+ if (isPrototype(source) || isArrayLike(source)) {+ copyObject(source, keys(source), object);+ return;+ }+ for (var key in source) {+ if (hasOwnProperty.call(source, key)) {+ assignValue(object, key, source[key]);+ }+ }+ });++ /**+ * This method is like `_.assign` except that it iterates over own and+ * inherited source properties.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @alias extend+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} [sources] The source objects.+ * @returns {Object} Returns `object`.+ * @see _.assign+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * }+ *+ * function Bar() {+ * this.c = 3;+ * }+ *+ * Foo.prototype.b = 2;+ * Bar.prototype.d = 4;+ *+ * _.assignIn({ 'a': 0 }, new Foo, new Bar);+ * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }+ */+ var assignIn = createAssigner(function(object, source) {+ copyObject(source, keysIn(source), object);+ });++ /**+ * This method is like `_.assignIn` except that it accepts `customizer`+ * which is invoked to produce the assigned values. If `customizer` returns+ * `undefined`, assignment is handled by the method instead. The `customizer`+ * is invoked with five arguments: (objValue, srcValue, key, object, source).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @alias extendWith+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} sources The source objects.+ * @param {Function} [customizer] The function to customize assigned values.+ * @returns {Object} Returns `object`.+ * @see _.assignWith+ * @example+ *+ * function customizer(objValue, srcValue) {+ * return _.isUndefined(objValue) ? srcValue : objValue;+ * }+ *+ * var defaults = _.partialRight(_.assignInWith, customizer);+ *+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });+ * // => { 'a': 1, 'b': 2 }+ */+ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {+ copyObject(source, keysIn(source), object, customizer);+ });++ /**+ * This method is like `_.assign` except that it accepts `customizer`+ * which is invoked to produce the assigned values. If `customizer` returns+ * `undefined`, assignment is handled by the method instead. The `customizer`+ * is invoked with five arguments: (objValue, srcValue, key, object, source).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} sources The source objects.+ * @param {Function} [customizer] The function to customize assigned values.+ * @returns {Object} Returns `object`.+ * @see _.assignInWith+ * @example+ *+ * function customizer(objValue, srcValue) {+ * return _.isUndefined(objValue) ? srcValue : objValue;+ * }+ *+ * var defaults = _.partialRight(_.assignWith, customizer);+ *+ * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });+ * // => { 'a': 1, 'b': 2 }+ */+ var assignWith = createAssigner(function(object, source, srcIndex, customizer) {+ copyObject(source, keys(source), object, customizer);+ });++ /**+ * Creates an array of values corresponding to `paths` of `object`.+ *+ * @static+ * @memberOf _+ * @since 1.0.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {...(string|string[])} [paths] The property paths to pick.+ * @returns {Array} Returns the picked values.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };+ *+ * _.at(object, ['a[0].b.c', 'a[1]']);+ * // => [3, 4]+ */+ var at = flatRest(baseAt);++ /**+ * Creates an object that inherits from the `prototype` object. If a+ * `properties` object is given, its own enumerable string keyed properties+ * are assigned to the created object.+ *+ * @static+ * @memberOf _+ * @since 2.3.0+ * @category Object+ * @param {Object} prototype The object to inherit from.+ * @param {Object} [properties] The properties to assign to the object.+ * @returns {Object} Returns the new object.+ * @example+ *+ * function Shape() {+ * this.x = 0;+ * this.y = 0;+ * }+ *+ * function Circle() {+ * Shape.call(this);+ * }+ *+ * Circle.prototype = _.create(Shape.prototype, {+ * 'constructor': Circle+ * });+ *+ * var circle = new Circle;+ * circle instanceof Circle;+ * // => true+ *+ * circle instanceof Shape;+ * // => true+ */+ function create(prototype, properties) {+ var result = baseCreate(prototype);+ return properties == null ? result : baseAssign(result, properties);+ }++ /**+ * Assigns own and inherited enumerable string keyed properties of source+ * objects to the destination object for all destination properties that+ * resolve to `undefined`. Source objects are applied from left to right.+ * Once a property is set, additional values of the same property are ignored.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} [sources] The source objects.+ * @returns {Object} Returns `object`.+ * @see _.defaultsDeep+ * @example+ *+ * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });+ * // => { 'a': 1, 'b': 2 }+ */+ var defaults = baseRest(function(args) {+ args.push(undefined, customDefaultsAssignIn);+ return apply(assignInWith, undefined, args);+ });++ /**+ * This method is like `_.defaults` except that it recursively assigns+ * default properties.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 3.10.0+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} [sources] The source objects.+ * @returns {Object} Returns `object`.+ * @see _.defaults+ * @example+ *+ * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });+ * // => { 'a': { 'b': 2, 'c': 3 } }+ */+ var defaultsDeep = baseRest(function(args) {+ args.push(undefined, customDefaultsMerge);+ return apply(mergeWith, undefined, args);+ });++ /**+ * This method is like `_.find` except that it returns the key of the first+ * element `predicate` returns truthy for instead of the element itself.+ *+ * @static+ * @memberOf _+ * @since 1.1.0+ * @category Object+ * @param {Object} object The object to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {string|undefined} Returns the key of the matched element,+ * else `undefined`.+ * @example+ *+ * var users = {+ * 'barney': { 'age': 36, 'active': true },+ * 'fred': { 'age': 40, 'active': false },+ * 'pebbles': { 'age': 1, 'active': true }+ * };+ *+ * _.findKey(users, function(o) { return o.age < 40; });+ * // => 'barney' (iteration order is not guaranteed)+ *+ * // The `_.matches` iteratee shorthand.+ * _.findKey(users, { 'age': 1, 'active': true });+ * // => 'pebbles'+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.findKey(users, ['active', false]);+ * // => 'fred'+ *+ * // The `_.property` iteratee shorthand.+ * _.findKey(users, 'active');+ * // => 'barney'+ */+ function findKey(object, predicate) {+ return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);+ }++ /**+ * This method is like `_.findKey` except that it iterates over elements of+ * a collection in the opposite order.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Object+ * @param {Object} object The object to inspect.+ * @param {Function} [predicate=_.identity] The function invoked per iteration.+ * @returns {string|undefined} Returns the key of the matched element,+ * else `undefined`.+ * @example+ *+ * var users = {+ * 'barney': { 'age': 36, 'active': true },+ * 'fred': { 'age': 40, 'active': false },+ * 'pebbles': { 'age': 1, 'active': true }+ * };+ *+ * _.findLastKey(users, function(o) { return o.age < 40; });+ * // => returns 'pebbles' assuming `_.findKey` returns 'barney'+ *+ * // The `_.matches` iteratee shorthand.+ * _.findLastKey(users, { 'age': 36, 'active': true });+ * // => 'barney'+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.findLastKey(users, ['active', false]);+ * // => 'fred'+ *+ * // The `_.property` iteratee shorthand.+ * _.findLastKey(users, 'active');+ * // => 'pebbles'+ */+ function findLastKey(object, predicate) {+ return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);+ }++ /**+ * Iterates over own and inherited enumerable string keyed properties of an+ * object and invokes `iteratee` for each property. The iteratee is invoked+ * with three arguments: (value, key, object). Iteratee functions may exit+ * iteration early by explicitly returning `false`.+ *+ * @static+ * @memberOf _+ * @since 0.3.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns `object`.+ * @see _.forInRight+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.forIn(new Foo, function(value, key) {+ * console.log(key);+ * });+ * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).+ */+ function forIn(object, iteratee) {+ return object == null+ ? object+ : baseFor(object, getIteratee(iteratee, 3), keysIn);+ }++ /**+ * This method is like `_.forIn` except that it iterates over properties of+ * `object` in the opposite order.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns `object`.+ * @see _.forIn+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.forInRight(new Foo, function(value, key) {+ * console.log(key);+ * });+ * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.+ */+ function forInRight(object, iteratee) {+ return object == null+ ? object+ : baseForRight(object, getIteratee(iteratee, 3), keysIn);+ }++ /**+ * Iterates over own enumerable string keyed properties of an object and+ * invokes `iteratee` for each property. The iteratee is invoked with three+ * arguments: (value, key, object). Iteratee functions may exit iteration+ * early by explicitly returning `false`.+ *+ * @static+ * @memberOf _+ * @since 0.3.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns `object`.+ * @see _.forOwnRight+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.forOwn(new Foo, function(value, key) {+ * console.log(key);+ * });+ * // => Logs 'a' then 'b' (iteration order is not guaranteed).+ */+ function forOwn(object, iteratee) {+ return object && baseForOwn(object, getIteratee(iteratee, 3));+ }++ /**+ * This method is like `_.forOwn` except that it iterates over properties of+ * `object` in the opposite order.+ *+ * @static+ * @memberOf _+ * @since 2.0.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns `object`.+ * @see _.forOwn+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.forOwnRight(new Foo, function(value, key) {+ * console.log(key);+ * });+ * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.+ */+ function forOwnRight(object, iteratee) {+ return object && baseForOwnRight(object, getIteratee(iteratee, 3));+ }++ /**+ * Creates an array of function property names from own enumerable properties+ * of `object`.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The object to inspect.+ * @returns {Array} Returns the function names.+ * @see _.functionsIn+ * @example+ *+ * function Foo() {+ * this.a = _.constant('a');+ * this.b = _.constant('b');+ * }+ *+ * Foo.prototype.c = _.constant('c');+ *+ * _.functions(new Foo);+ * // => ['a', 'b']+ */+ function functions(object) {+ return object == null ? [] : baseFunctions(object, keys(object));+ }++ /**+ * Creates an array of function property names from own and inherited+ * enumerable properties of `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The object to inspect.+ * @returns {Array} Returns the function names.+ * @see _.functions+ * @example+ *+ * function Foo() {+ * this.a = _.constant('a');+ * this.b = _.constant('b');+ * }+ *+ * Foo.prototype.c = _.constant('c');+ *+ * _.functionsIn(new Foo);+ * // => ['a', 'b', 'c']+ */+ function functionsIn(object) {+ return object == null ? [] : baseFunctions(object, keysIn(object));+ }++ /**+ * Gets the value at `path` of `object`. If the resolved value is+ * `undefined`, the `defaultValue` is returned in its place.+ *+ * @static+ * @memberOf _+ * @since 3.7.0+ * @category Object+ * @param {Object} object The object to query.+ * @param {Array|string} path The path of the property to get.+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.+ * @returns {*} Returns the resolved value.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };+ *+ * _.get(object, 'a[0].b.c');+ * // => 3+ *+ * _.get(object, ['a', '0', 'b', 'c']);+ * // => 3+ *+ * _.get(object, 'a.b.c', 'default');+ * // => 'default'+ */+ function get(object, path, defaultValue) {+ var result = object == null ? undefined : baseGet(object, path);+ return result === undefined ? defaultValue : result;+ }++ /**+ * Checks if `path` is a direct property of `object`.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The object to query.+ * @param {Array|string} path The path to check.+ * @returns {boolean} Returns `true` if `path` exists, else `false`.+ * @example+ *+ * var object = { 'a': { 'b': 2 } };+ * var other = _.create({ 'a': _.create({ 'b': 2 }) });+ *+ * _.has(object, 'a');+ * // => true+ *+ * _.has(object, 'a.b');+ * // => true+ *+ * _.has(object, ['a', 'b']);+ * // => true+ *+ * _.has(other, 'a');+ * // => false+ */+ function has(object, path) {+ return object != null && hasPath(object, path, baseHas);+ }++ /**+ * Checks if `path` is a direct or inherited property of `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The object to query.+ * @param {Array|string} path The path to check.+ * @returns {boolean} Returns `true` if `path` exists, else `false`.+ * @example+ *+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });+ *+ * _.hasIn(object, 'a');+ * // => true+ *+ * _.hasIn(object, 'a.b');+ * // => true+ *+ * _.hasIn(object, ['a', 'b']);+ * // => true+ *+ * _.hasIn(object, 'b');+ * // => false+ */+ function hasIn(object, path) {+ return object != null && hasPath(object, path, baseHasIn);+ }++ /**+ * Creates an object composed of the inverted keys and values of `object`.+ * If `object` contains duplicate values, subsequent values overwrite+ * property assignments of previous values.+ *+ * @static+ * @memberOf _+ * @since 0.7.0+ * @category Object+ * @param {Object} object The object to invert.+ * @returns {Object} Returns the new inverted object.+ * @example+ *+ * var object = { 'a': 1, 'b': 2, 'c': 1 };+ *+ * _.invert(object);+ * // => { '1': 'c', '2': 'b' }+ */+ var invert = createInverter(function(result, value, key) {+ result[value] = key;+ }, constant(identity));++ /**+ * This method is like `_.invert` except that the inverted object is generated+ * from the results of running each element of `object` thru `iteratee`. The+ * corresponding inverted value of each inverted key is an array of keys+ * responsible for generating the inverted value. The iteratee is invoked+ * with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.1.0+ * @category Object+ * @param {Object} object The object to invert.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {Object} Returns the new inverted object.+ * @example+ *+ * var object = { 'a': 1, 'b': 2, 'c': 1 };+ *+ * _.invertBy(object);+ * // => { '1': ['a', 'c'], '2': ['b'] }+ *+ * _.invertBy(object, function(value) {+ * return 'group' + value;+ * });+ * // => { 'group1': ['a', 'c'], 'group2': ['b'] }+ */+ var invertBy = createInverter(function(result, value, key) {+ if (hasOwnProperty.call(result, value)) {+ result[value].push(key);+ } else {+ result[value] = [key];+ }+ }, getIteratee);++ /**+ * Invokes the method at `path` of `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The object to query.+ * @param {Array|string} path The path of the method to invoke.+ * @param {...*} [args] The arguments to invoke the method with.+ * @returns {*} Returns the result of the invoked method.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };+ *+ * _.invoke(object, 'a[0].b.c.slice', 1, 3);+ * // => [2, 3]+ */+ var invoke = baseRest(baseInvoke);++ /**+ * Creates an array of the own enumerable property names of `object`.+ *+ * **Note:** Non-object values are coerced to objects. See the+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)+ * for more details.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.keys(new Foo);+ * // => ['a', 'b'] (iteration order is not guaranteed)+ *+ * _.keys('hi');+ * // => ['0', '1']+ */+ function keys(object) {+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);+ }++ /**+ * Creates an array of the own and inherited enumerable property names of `object`.+ *+ * **Note:** Non-object values are coerced to objects.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property names.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.keysIn(new Foo);+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)+ */+ function keysIn(object) {+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);+ }++ /**+ * The opposite of `_.mapValues`; this method creates an object with the+ * same values as `object` and keys generated by running each own enumerable+ * string keyed property of `object` thru `iteratee`. The iteratee is invoked+ * with three arguments: (value, key, object).+ *+ * @static+ * @memberOf _+ * @since 3.8.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns the new mapped object.+ * @see _.mapValues+ * @example+ *+ * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {+ * return key + value;+ * });+ * // => { 'a1': 1, 'b2': 2 }+ */+ function mapKeys(object, iteratee) {+ var result = {};+ iteratee = getIteratee(iteratee, 3);++ baseForOwn(object, function(value, key, object) {+ baseAssignValue(result, iteratee(value, key, object), value);+ });+ return result;+ }++ /**+ * Creates an object with the same keys as `object` and values generated+ * by running each own enumerable string keyed property of `object` thru+ * `iteratee`. The iteratee is invoked with three arguments:+ * (value, key, object).+ *+ * @static+ * @memberOf _+ * @since 2.4.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Object} Returns the new mapped object.+ * @see _.mapKeys+ * @example+ *+ * var users = {+ * 'fred': { 'user': 'fred', 'age': 40 },+ * 'pebbles': { 'user': 'pebbles', 'age': 1 }+ * };+ *+ * _.mapValues(users, function(o) { return o.age; });+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)+ *+ * // The `_.property` iteratee shorthand.+ * _.mapValues(users, 'age');+ * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)+ */+ function mapValues(object, iteratee) {+ var result = {};+ iteratee = getIteratee(iteratee, 3);++ baseForOwn(object, function(value, key, object) {+ baseAssignValue(result, key, iteratee(value, key, object));+ });+ return result;+ }++ /**+ * This method is like `_.assign` except that it recursively merges own and+ * inherited enumerable string keyed properties of source objects into the+ * destination object. Source properties that resolve to `undefined` are+ * skipped if a destination value exists. Array and plain object properties+ * are merged recursively. Other objects and value types are overridden by+ * assignment. Source objects are applied from left to right. Subsequent+ * sources overwrite property assignments of previous sources.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 0.5.0+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} [sources] The source objects.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var object = {+ * 'a': [{ 'b': 2 }, { 'd': 4 }]+ * };+ *+ * var other = {+ * 'a': [{ 'c': 3 }, { 'e': 5 }]+ * };+ *+ * _.merge(object, other);+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }+ */+ var merge = createAssigner(function(object, source, srcIndex) {+ baseMerge(object, source, srcIndex);+ });++ /**+ * This method is like `_.merge` except that it accepts `customizer` which+ * is invoked to produce the merged values of the destination and source+ * properties. If `customizer` returns `undefined`, merging is handled by the+ * method instead. The `customizer` is invoked with six arguments:+ * (objValue, srcValue, key, object, source, stack).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The destination object.+ * @param {...Object} sources The source objects.+ * @param {Function} customizer The function to customize assigned values.+ * @returns {Object} Returns `object`.+ * @example+ *+ * function customizer(objValue, srcValue) {+ * if (_.isArray(objValue)) {+ * return objValue.concat(srcValue);+ * }+ * }+ *+ * var object = { 'a': [1], 'b': [2] };+ * var other = { 'a': [3], 'b': [4] };+ *+ * _.mergeWith(object, other, customizer);+ * // => { 'a': [1, 3], 'b': [2, 4] }+ */+ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {+ baseMerge(object, source, srcIndex, customizer);+ });++ /**+ * The opposite of `_.pick`; this method creates an object composed of the+ * own and inherited enumerable property paths of `object` that are not omitted.+ *+ * **Note:** This method is considerably slower than `_.pick`.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The source object.+ * @param {...(string|string[])} [paths] The property paths to omit.+ * @returns {Object} Returns the new object.+ * @example+ *+ * var object = { 'a': 1, 'b': '2', 'c': 3 };+ *+ * _.omit(object, ['a', 'c']);+ * // => { 'b': '2' }+ */+ var omit = flatRest(function(object, paths) {+ var result = {};+ if (object == null) {+ return result;+ }+ var isDeep = false;+ paths = arrayMap(paths, function(path) {+ path = castPath(path, object);+ isDeep || (isDeep = path.length > 1);+ return path;+ });+ copyObject(object, getAllKeysIn(object), result);+ if (isDeep) {+ result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);+ }+ var length = paths.length;+ while (length--) {+ baseUnset(result, paths[length]);+ }+ return result;+ });++ /**+ * The opposite of `_.pickBy`; this method creates an object composed of+ * the own and inherited enumerable string keyed properties of `object` that+ * `predicate` doesn't return truthy for. The predicate is invoked with two+ * arguments: (value, key).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The source object.+ * @param {Function} [predicate=_.identity] The function invoked per property.+ * @returns {Object} Returns the new object.+ * @example+ *+ * var object = { 'a': 1, 'b': '2', 'c': 3 };+ *+ * _.omitBy(object, _.isNumber);+ * // => { 'b': '2' }+ */+ function omitBy(object, predicate) {+ return pickBy(object, negate(getIteratee(predicate)));+ }++ /**+ * Creates an object composed of the picked `object` properties.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The source object.+ * @param {...(string|string[])} [paths] The property paths to pick.+ * @returns {Object} Returns the new object.+ * @example+ *+ * var object = { 'a': 1, 'b': '2', 'c': 3 };+ *+ * _.pick(object, ['a', 'c']);+ * // => { 'a': 1, 'c': 3 }+ */+ var pick = flatRest(function(object, paths) {+ return object == null ? {} : basePick(object, paths);+ });++ /**+ * Creates an object composed of the `object` properties `predicate` returns+ * truthy for. The predicate is invoked with two arguments: (value, key).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The source object.+ * @param {Function} [predicate=_.identity] The function invoked per property.+ * @returns {Object} Returns the new object.+ * @example+ *+ * var object = { 'a': 1, 'b': '2', 'c': 3 };+ *+ * _.pickBy(object, _.isNumber);+ * // => { 'a': 1, 'c': 3 }+ */+ function pickBy(object, predicate) {+ if (object == null) {+ return {};+ }+ var props = arrayMap(getAllKeysIn(object), function(prop) {+ return [prop];+ });+ predicate = getIteratee(predicate);+ return basePickBy(object, props, function(value, path) {+ return predicate(value, path[0]);+ });+ }++ /**+ * This method is like `_.get` except that if the resolved value is a+ * function it's invoked with the `this` binding of its parent object and+ * its result is returned.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The object to query.+ * @param {Array|string} path The path of the property to resolve.+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.+ * @returns {*} Returns the resolved value.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };+ *+ * _.result(object, 'a[0].b.c1');+ * // => 3+ *+ * _.result(object, 'a[0].b.c2');+ * // => 4+ *+ * _.result(object, 'a[0].b.c3', 'default');+ * // => 'default'+ *+ * _.result(object, 'a[0].b.c3', _.constant('default'));+ * // => 'default'+ */+ function result(object, path, defaultValue) {+ path = castPath(path, object);++ var index = -1,+ length = path.length;++ // Ensure the loop is entered when path is empty.+ if (!length) {+ length = 1;+ object = undefined;+ }+ while (++index < length) {+ var value = object == null ? undefined : object[toKey(path[index])];+ if (value === undefined) {+ index = length;+ value = defaultValue;+ }+ object = isFunction(value) ? value.call(object) : value;+ }+ return object;+ }++ /**+ * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,+ * it's created. Arrays are created for missing index properties while objects+ * are created for all other missing properties. Use `_.setWith` to customize+ * `path` creation.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 3.7.0+ * @category Object+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to set.+ * @param {*} value The value to set.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };+ *+ * _.set(object, 'a[0].b.c', 4);+ * console.log(object.a[0].b.c);+ * // => 4+ *+ * _.set(object, ['x', '0', 'y', 'z'], 5);+ * console.log(object.x[0].y.z);+ * // => 5+ */+ function set(object, path, value) {+ return object == null ? object : baseSet(object, path, value);+ }++ /**+ * This method is like `_.set` except that it accepts `customizer` which is+ * invoked to produce the objects of `path`. If `customizer` returns `undefined`+ * path creation is handled by the method instead. The `customizer` is invoked+ * with three arguments: (nsValue, key, nsObject).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to set.+ * @param {*} value The value to set.+ * @param {Function} [customizer] The function to customize assigned values.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var object = {};+ *+ * _.setWith(object, '[0][1]', 'a', Object);+ * // => { '0': { '1': 'a' } }+ */+ function setWith(object, path, value, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ return object == null ? object : baseSet(object, path, value, customizer);+ }++ /**+ * Creates an array of own enumerable string keyed-value pairs for `object`+ * which can be consumed by `_.fromPairs`. If `object` is a map or set, its+ * entries are returned.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @alias entries+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the key-value pairs.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.toPairs(new Foo);+ * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)+ */+ var toPairs = createToPairs(keys);++ /**+ * Creates an array of own and inherited enumerable string keyed-value pairs+ * for `object` which can be consumed by `_.fromPairs`. If `object` is a map+ * or set, its entries are returned.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @alias entriesIn+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the key-value pairs.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.toPairsIn(new Foo);+ * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)+ */+ var toPairsIn = createToPairs(keysIn);++ /**+ * An alternative to `_.reduce`; this method transforms `object` to a new+ * `accumulator` object which is the result of running each of its own+ * enumerable string keyed properties thru `iteratee`, with each invocation+ * potentially mutating the `accumulator` object. If `accumulator` is not+ * provided, a new object with the same `[[Prototype]]` will be used. The+ * iteratee is invoked with four arguments: (accumulator, value, key, object).+ * Iteratee functions may exit iteration early by explicitly returning `false`.+ *+ * @static+ * @memberOf _+ * @since 1.3.0+ * @category Object+ * @param {Object} object The object to iterate over.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @param {*} [accumulator] The custom accumulator value.+ * @returns {*} Returns the accumulated value.+ * @example+ *+ * _.transform([2, 3, 4], function(result, n) {+ * result.push(n *= n);+ * return n % 2 == 0;+ * }, []);+ * // => [4, 9]+ *+ * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {+ * (result[value] || (result[value] = [])).push(key);+ * }, {});+ * // => { '1': ['a', 'c'], '2': ['b'] }+ */+ function transform(object, iteratee, accumulator) {+ var isArr = isArray(object),+ isArrLike = isArr || isBuffer(object) || isTypedArray(object);++ iteratee = getIteratee(iteratee, 4);+ if (accumulator == null) {+ var Ctor = object && object.constructor;+ if (isArrLike) {+ accumulator = isArr ? new Ctor : [];+ }+ else if (isObject(object)) {+ accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};+ }+ else {+ accumulator = {};+ }+ }+ (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {+ return iteratee(accumulator, value, index, object);+ });+ return accumulator;+ }++ /**+ * Removes the property at `path` of `object`.+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Object+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to unset.+ * @returns {boolean} Returns `true` if the property is deleted, else `false`.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 7 } }] };+ * _.unset(object, 'a[0].b.c');+ * // => true+ *+ * console.log(object);+ * // => { 'a': [{ 'b': {} }] };+ *+ * _.unset(object, ['a', '0', 'b', 'c']);+ * // => true+ *+ * console.log(object);+ * // => { 'a': [{ 'b': {} }] };+ */+ function unset(object, path) {+ return object == null ? true : baseUnset(object, path);+ }++ /**+ * This method is like `_.set` except that accepts `updater` to produce the+ * value to set. Use `_.updateWith` to customize `path` creation. The `updater`+ * is invoked with one argument: (value).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.6.0+ * @category Object+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to set.+ * @param {Function} updater The function to produce the updated value.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };+ *+ * _.update(object, 'a[0].b.c', function(n) { return n * n; });+ * console.log(object.a[0].b.c);+ * // => 9+ *+ * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });+ * console.log(object.x[0].y.z);+ * // => 0+ */+ function update(object, path, updater) {+ return object == null ? object : baseUpdate(object, path, castFunction(updater));+ }++ /**+ * This method is like `_.update` except that it accepts `customizer` which is+ * invoked to produce the objects of `path`. If `customizer` returns `undefined`+ * path creation is handled by the method instead. The `customizer` is invoked+ * with three arguments: (nsValue, key, nsObject).+ *+ * **Note:** This method mutates `object`.+ *+ * @static+ * @memberOf _+ * @since 4.6.0+ * @category Object+ * @param {Object} object The object to modify.+ * @param {Array|string} path The path of the property to set.+ * @param {Function} updater The function to produce the updated value.+ * @param {Function} [customizer] The function to customize assigned values.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var object = {};+ *+ * _.updateWith(object, '[0][1]', _.constant('a'), Object);+ * // => { '0': { '1': 'a' } }+ */+ function updateWith(object, path, updater, customizer) {+ customizer = typeof customizer == 'function' ? customizer : undefined;+ return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);+ }++ /**+ * Creates an array of the own enumerable string keyed property values of `object`.+ *+ * **Note:** Non-object values are coerced to objects.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property values.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.values(new Foo);+ * // => [1, 2] (iteration order is not guaranteed)+ *+ * _.values('hi');+ * // => ['h', 'i']+ */+ function values(object) {+ return object == null ? [] : baseValues(object, keys(object));+ }++ /**+ * Creates an array of the own and inherited enumerable string keyed property+ * values of `object`.+ *+ * **Note:** Non-object values are coerced to objects.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Object+ * @param {Object} object The object to query.+ * @returns {Array} Returns the array of property values.+ * @example+ *+ * function Foo() {+ * this.a = 1;+ * this.b = 2;+ * }+ *+ * Foo.prototype.c = 3;+ *+ * _.valuesIn(new Foo);+ * // => [1, 2, 3] (iteration order is not guaranteed)+ */+ function valuesIn(object) {+ return object == null ? [] : baseValues(object, keysIn(object));+ }++ /*------------------------------------------------------------------------*/++ /**+ * Clamps `number` within the inclusive `lower` and `upper` bounds.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Number+ * @param {number} number The number to clamp.+ * @param {number} [lower] The lower bound.+ * @param {number} upper The upper bound.+ * @returns {number} Returns the clamped number.+ * @example+ *+ * _.clamp(-10, -5, 5);+ * // => -5+ *+ * _.clamp(10, -5, 5);+ * // => 5+ */+ function clamp(number, lower, upper) {+ if (upper === undefined) {+ upper = lower;+ lower = undefined;+ }+ if (upper !== undefined) {+ upper = toNumber(upper);+ upper = upper === upper ? upper : 0;+ }+ if (lower !== undefined) {+ lower = toNumber(lower);+ lower = lower === lower ? lower : 0;+ }+ return baseClamp(toNumber(number), lower, upper);+ }++ /**+ * Checks if `n` is between `start` and up to, but not including, `end`. If+ * `end` is not specified, it's set to `start` with `start` then set to `0`.+ * If `start` is greater than `end` the params are swapped to support+ * negative ranges.+ *+ * @static+ * @memberOf _+ * @since 3.3.0+ * @category Number+ * @param {number} number The number to check.+ * @param {number} [start=0] The start of the range.+ * @param {number} end The end of the range.+ * @returns {boolean} Returns `true` if `number` is in the range, else `false`.+ * @see _.range, _.rangeRight+ * @example+ *+ * _.inRange(3, 2, 4);+ * // => true+ *+ * _.inRange(4, 8);+ * // => true+ *+ * _.inRange(4, 2);+ * // => false+ *+ * _.inRange(2, 2);+ * // => false+ *+ * _.inRange(1.2, 2);+ * // => true+ *+ * _.inRange(5.2, 4);+ * // => false+ *+ * _.inRange(-3, -2, -6);+ * // => true+ */+ function inRange(number, start, end) {+ start = toFinite(start);+ if (end === undefined) {+ end = start;+ start = 0;+ } else {+ end = toFinite(end);+ }+ number = toNumber(number);+ return baseInRange(number, start, end);+ }++ /**+ * Produces a random number between the inclusive `lower` and `upper` bounds.+ * If only one argument is provided a number between `0` and the given number+ * is returned. If `floating` is `true`, or either `lower` or `upper` are+ * floats, a floating-point number is returned instead of an integer.+ *+ * **Note:** JavaScript follows the IEEE-754 standard for resolving+ * floating-point values which can produce unexpected results.+ *+ * @static+ * @memberOf _+ * @since 0.7.0+ * @category Number+ * @param {number} [lower=0] The lower bound.+ * @param {number} [upper=1] The upper bound.+ * @param {boolean} [floating] Specify returning a floating-point number.+ * @returns {number} Returns the random number.+ * @example+ *+ * _.random(0, 5);+ * // => an integer between 0 and 5+ *+ * _.random(5);+ * // => also an integer between 0 and 5+ *+ * _.random(5, true);+ * // => a floating-point number between 0 and 5+ *+ * _.random(1.2, 5.2);+ * // => a floating-point number between 1.2 and 5.2+ */+ function random(lower, upper, floating) {+ if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {+ upper = floating = undefined;+ }+ if (floating === undefined) {+ if (typeof upper == 'boolean') {+ floating = upper;+ upper = undefined;+ }+ else if (typeof lower == 'boolean') {+ floating = lower;+ lower = undefined;+ }+ }+ if (lower === undefined && upper === undefined) {+ lower = 0;+ upper = 1;+ }+ else {+ lower = toFinite(lower);+ if (upper === undefined) {+ upper = lower;+ lower = 0;+ } else {+ upper = toFinite(upper);+ }+ }+ if (lower > upper) {+ var temp = lower;+ lower = upper;+ upper = temp;+ }+ if (floating || lower % 1 || upper % 1) {+ var rand = nativeRandom();+ return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);+ }+ return baseRandom(lower, upper);+ }++ /*------------------------------------------------------------------------*/++ /**+ * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the camel cased string.+ * @example+ *+ * _.camelCase('Foo Bar');+ * // => 'fooBar'+ *+ * _.camelCase('--foo-bar--');+ * // => 'fooBar'+ *+ * _.camelCase('__FOO_BAR__');+ * // => 'fooBar'+ */+ var camelCase = createCompounder(function(result, word, index) {+ word = word.toLowerCase();+ return result + (index ? capitalize(word) : word);+ });++ /**+ * Converts the first character of `string` to upper case and the remaining+ * to lower case.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to capitalize.+ * @returns {string} Returns the capitalized string.+ * @example+ *+ * _.capitalize('FRED');+ * // => 'Fred'+ */+ function capitalize(string) {+ return upperFirst(toString(string).toLowerCase());+ }++ /**+ * Deburrs `string` by converting+ * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)+ * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)+ * letters to basic Latin letters and removing+ * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to deburr.+ * @returns {string} Returns the deburred string.+ * @example+ *+ * _.deburr('déjà vu');+ * // => 'deja vu'+ */+ function deburr(string) {+ string = toString(string);+ return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');+ }++ /**+ * Checks if `string` ends with the given target string.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to inspect.+ * @param {string} [target] The string to search for.+ * @param {number} [position=string.length] The position to search up to.+ * @returns {boolean} Returns `true` if `string` ends with `target`,+ * else `false`.+ * @example+ *+ * _.endsWith('abc', 'c');+ * // => true+ *+ * _.endsWith('abc', 'b');+ * // => false+ *+ * _.endsWith('abc', 'b', 2);+ * // => true+ */+ function endsWith(string, target, position) {+ string = toString(string);+ target = baseToString(target);++ var length = string.length;+ position = position === undefined+ ? length+ : baseClamp(toInteger(position), 0, length);++ var end = position;+ position -= target.length;+ return position >= 0 && string.slice(position, end) == target;+ }++ /**+ * Converts the characters "&", "<", ">", '"', and "'" in `string` to their+ * corresponding HTML entities.+ *+ * **Note:** No other characters are escaped. To escape additional+ * characters use a third-party library like [_he_](https://mths.be/he).+ *+ * Though the ">" character is escaped for symmetry, characters like+ * ">" and "/" don't need escaping in HTML and have no special meaning+ * unless they're part of a tag or unquoted attribute value. See+ * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)+ * (under "semi-related fun fact") for more details.+ *+ * When working with HTML you should always+ * [quote attribute values](http://wonko.com/post/html-escaping) to reduce+ * XSS vectors.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category String+ * @param {string} [string=''] The string to escape.+ * @returns {string} Returns the escaped string.+ * @example+ *+ * _.escape('fred, barney, & pebbles');+ * // => 'fred, barney, & pebbles'+ */+ function escape(string) {+ string = toString(string);+ return (string && reHasUnescapedHtml.test(string))+ ? string.replace(reUnescapedHtml, escapeHtmlChar)+ : string;+ }++ /**+ * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",+ * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to escape.+ * @returns {string} Returns the escaped string.+ * @example+ *+ * _.escapeRegExp('[lodash](https://lodash.com/)');+ * // => '\[lodash\]\(https://lodash\.com/\)'+ */+ function escapeRegExp(string) {+ string = toString(string);+ return (string && reHasRegExpChar.test(string))+ ? string.replace(reRegExpChar, '\\$&')+ : string;+ }++ /**+ * Converts `string` to+ * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the kebab cased string.+ * @example+ *+ * _.kebabCase('Foo Bar');+ * // => 'foo-bar'+ *+ * _.kebabCase('fooBar');+ * // => 'foo-bar'+ *+ * _.kebabCase('__FOO_BAR__');+ * // => 'foo-bar'+ */+ var kebabCase = createCompounder(function(result, word, index) {+ return result + (index ? '-' : '') + word.toLowerCase();+ });++ /**+ * Converts `string`, as space separated words, to lower case.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the lower cased string.+ * @example+ *+ * _.lowerCase('--Foo-Bar--');+ * // => 'foo bar'+ *+ * _.lowerCase('fooBar');+ * // => 'foo bar'+ *+ * _.lowerCase('__FOO_BAR__');+ * // => 'foo bar'+ */+ var lowerCase = createCompounder(function(result, word, index) {+ return result + (index ? ' ' : '') + word.toLowerCase();+ });++ /**+ * Converts the first character of `string` to lower case.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the converted string.+ * @example+ *+ * _.lowerFirst('Fred');+ * // => 'fred'+ *+ * _.lowerFirst('FRED');+ * // => 'fRED'+ */+ var lowerFirst = createCaseFirst('toLowerCase');++ /**+ * Pads `string` on the left and right sides if it's shorter than `length`.+ * Padding characters are truncated if they can't be evenly divided by `length`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to pad.+ * @param {number} [length=0] The padding length.+ * @param {string} [chars=' '] The string used as padding.+ * @returns {string} Returns the padded string.+ * @example+ *+ * _.pad('abc', 8);+ * // => ' abc '+ *+ * _.pad('abc', 8, '_-');+ * // => '_-abc_-_'+ *+ * _.pad('abc', 3);+ * // => 'abc'+ */+ function pad(string, length, chars) {+ string = toString(string);+ length = toInteger(length);++ var strLength = length ? stringSize(string) : 0;+ if (!length || strLength >= length) {+ return string;+ }+ var mid = (length - strLength) / 2;+ return (+ createPadding(nativeFloor(mid), chars) ++ string ++ createPadding(nativeCeil(mid), chars)+ );+ }++ /**+ * Pads `string` on the right side if it's shorter than `length`. Padding+ * characters are truncated if they exceed `length`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to pad.+ * @param {number} [length=0] The padding length.+ * @param {string} [chars=' '] The string used as padding.+ * @returns {string} Returns the padded string.+ * @example+ *+ * _.padEnd('abc', 6);+ * // => 'abc '+ *+ * _.padEnd('abc', 6, '_-');+ * // => 'abc_-_'+ *+ * _.padEnd('abc', 3);+ * // => 'abc'+ */+ function padEnd(string, length, chars) {+ string = toString(string);+ length = toInteger(length);++ var strLength = length ? stringSize(string) : 0;+ return (length && strLength < length)+ ? (string + createPadding(length - strLength, chars))+ : string;+ }++ /**+ * Pads `string` on the left side if it's shorter than `length`. Padding+ * characters are truncated if they exceed `length`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to pad.+ * @param {number} [length=0] The padding length.+ * @param {string} [chars=' '] The string used as padding.+ * @returns {string} Returns the padded string.+ * @example+ *+ * _.padStart('abc', 6);+ * // => ' abc'+ *+ * _.padStart('abc', 6, '_-');+ * // => '_-_abc'+ *+ * _.padStart('abc', 3);+ * // => 'abc'+ */+ function padStart(string, length, chars) {+ string = toString(string);+ length = toInteger(length);++ var strLength = length ? stringSize(string) : 0;+ return (length && strLength < length)+ ? (createPadding(length - strLength, chars) + string)+ : string;+ }++ /**+ * Converts `string` to an integer of the specified radix. If `radix` is+ * `undefined` or `0`, a `radix` of `10` is used unless `value` is a+ * hexadecimal, in which case a `radix` of `16` is used.+ *+ * **Note:** This method aligns with the+ * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.+ *+ * @static+ * @memberOf _+ * @since 1.1.0+ * @category String+ * @param {string} string The string to convert.+ * @param {number} [radix=10] The radix to interpret `value` by.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {number} Returns the converted integer.+ * @example+ *+ * _.parseInt('08');+ * // => 8+ *+ * _.map(['6', '08', '10'], _.parseInt);+ * // => [6, 8, 10]+ */+ function parseInt(string, radix, guard) {+ if (guard || radix == null) {+ radix = 0;+ } else if (radix) {+ radix = +radix;+ }+ return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);+ }++ /**+ * Repeats the given string `n` times.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to repeat.+ * @param {number} [n=1] The number of times to repeat the string.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {string} Returns the repeated string.+ * @example+ *+ * _.repeat('*', 3);+ * // => '***'+ *+ * _.repeat('abc', 2);+ * // => 'abcabc'+ *+ * _.repeat('abc', 0);+ * // => ''+ */+ function repeat(string, n, guard) {+ if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {+ n = 1;+ } else {+ n = toInteger(n);+ }+ return baseRepeat(toString(string), n);+ }++ /**+ * Replaces matches for `pattern` in `string` with `replacement`.+ *+ * **Note:** This method is based on+ * [`String#replace`](https://mdn.io/String/replace).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to modify.+ * @param {RegExp|string} pattern The pattern to replace.+ * @param {Function|string} replacement The match replacement.+ * @returns {string} Returns the modified string.+ * @example+ *+ * _.replace('Hi Fred', 'Fred', 'Barney');+ * // => 'Hi Barney'+ */+ function replace() {+ var args = arguments,+ string = toString(args[0]);++ return args.length < 3 ? string : string.replace(args[1], args[2]);+ }++ /**+ * Converts `string` to+ * [snake case](https://en.wikipedia.org/wiki/Snake_case).+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the snake cased string.+ * @example+ *+ * _.snakeCase('Foo Bar');+ * // => 'foo_bar'+ *+ * _.snakeCase('fooBar');+ * // => 'foo_bar'+ *+ * _.snakeCase('--FOO-BAR--');+ * // => 'foo_bar'+ */+ var snakeCase = createCompounder(function(result, word, index) {+ return result + (index ? '_' : '') + word.toLowerCase();+ });++ /**+ * Splits `string` by `separator`.+ *+ * **Note:** This method is based on+ * [`String#split`](https://mdn.io/String/split).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to split.+ * @param {RegExp|string} separator The separator pattern to split by.+ * @param {number} [limit] The length to truncate results to.+ * @returns {Array} Returns the string segments.+ * @example+ *+ * _.split('a-b-c', '-', 2);+ * // => ['a', 'b']+ */+ function split(string, separator, limit) {+ if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {+ separator = limit = undefined;+ }+ limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;+ if (!limit) {+ return [];+ }+ string = toString(string);+ if (string && (+ typeof separator == 'string' ||+ (separator != null && !isRegExp(separator))+ )) {+ separator = baseToString(separator);+ if (!separator && hasUnicode(string)) {+ return castSlice(stringToArray(string), 0, limit);+ }+ }+ return string.split(separator, limit);+ }++ /**+ * Converts `string` to+ * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).+ *+ * @static+ * @memberOf _+ * @since 3.1.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the start cased string.+ * @example+ *+ * _.startCase('--foo-bar--');+ * // => 'Foo Bar'+ *+ * _.startCase('fooBar');+ * // => 'Foo Bar'+ *+ * _.startCase('__FOO_BAR__');+ * // => 'FOO BAR'+ */+ var startCase = createCompounder(function(result, word, index) {+ return result + (index ? ' ' : '') + upperFirst(word);+ });++ /**+ * Checks if `string` starts with the given target string.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to inspect.+ * @param {string} [target] The string to search for.+ * @param {number} [position=0] The position to search from.+ * @returns {boolean} Returns `true` if `string` starts with `target`,+ * else `false`.+ * @example+ *+ * _.startsWith('abc', 'a');+ * // => true+ *+ * _.startsWith('abc', 'b');+ * // => false+ *+ * _.startsWith('abc', 'b', 1);+ * // => true+ */+ function startsWith(string, target, position) {+ string = toString(string);+ position = position == null+ ? 0+ : baseClamp(toInteger(position), 0, string.length);++ target = baseToString(target);+ return string.slice(position, position + target.length) == target;+ }++ /**+ * Creates a compiled template function that can interpolate data properties+ * in "interpolate" delimiters, HTML-escape interpolated data properties in+ * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data+ * properties may be accessed as free variables in the template. If a setting+ * object is given, it takes precedence over `_.templateSettings` values.+ *+ * **Note:** In the development build `_.template` utilizes+ * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)+ * for easier debugging.+ *+ * For more information on precompiling templates see+ * [lodash's custom builds documentation](https://lodash.com/custom-builds).+ *+ * For more information on Chrome extension sandboxes see+ * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category String+ * @param {string} [string=''] The template string.+ * @param {Object} [options={}] The options object.+ * @param {RegExp} [options.escape=_.templateSettings.escape]+ * The HTML "escape" delimiter.+ * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]+ * The "evaluate" delimiter.+ * @param {Object} [options.imports=_.templateSettings.imports]+ * An object to import into the template as free variables.+ * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]+ * The "interpolate" delimiter.+ * @param {string} [options.sourceURL='lodash.templateSources[n]']+ * The sourceURL of the compiled template.+ * @param {string} [options.variable='obj']+ * The data object variable name.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Function} Returns the compiled template function.+ * @example+ *+ * // Use the "interpolate" delimiter to create a compiled template.+ * var compiled = _.template('hello <%= user %>!');+ * compiled({ 'user': 'fred' });+ * // => 'hello fred!'+ *+ * // Use the HTML "escape" delimiter to escape data property values.+ * var compiled = _.template('<b><%- value %></b>');+ * compiled({ 'value': '<script>' });+ * // => '<b><script></b>'+ *+ * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.+ * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');+ * compiled({ 'users': ['fred', 'barney'] });+ * // => '<li>fred</li><li>barney</li>'+ *+ * // Use the internal `print` function in "evaluate" delimiters.+ * var compiled = _.template('<% print("hello " + user); %>!');+ * compiled({ 'user': 'barney' });+ * // => 'hello barney!'+ *+ * // Use the ES template literal delimiter as an "interpolate" delimiter.+ * // Disable support by replacing the "interpolate" delimiter.+ * var compiled = _.template('hello ${ user }!');+ * compiled({ 'user': 'pebbles' });+ * // => 'hello pebbles!'+ *+ * // Use backslashes to treat delimiters as plain text.+ * var compiled = _.template('<%= "\\<%- value %\\>" %>');+ * compiled({ 'value': 'ignored' });+ * // => '<%- value %>'+ *+ * // Use the `imports` option to import `jQuery` as `jq`.+ * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';+ * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });+ * compiled({ 'users': ['fred', 'barney'] });+ * // => '<li>fred</li><li>barney</li>'+ *+ * // Use the `sourceURL` option to specify a custom sourceURL for the template.+ * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });+ * compiled(data);+ * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.+ *+ * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.+ * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });+ * compiled.source;+ * // => function(data) {+ * // var __t, __p = '';+ * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';+ * // return __p;+ * // }+ *+ * // Use custom template delimiters.+ * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;+ * var compiled = _.template('hello {{ user }}!');+ * compiled({ 'user': 'mustache' });+ * // => 'hello mustache!'+ *+ * // Use the `source` property to inline compiled templates for meaningful+ * // line numbers in error messages and stack traces.+ * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\+ * var JST = {\+ * "main": ' + _.template(mainText).source + '\+ * };\+ * ');+ */+ function template(string, options, guard) {+ // Based on John Resig's `tmpl` implementation+ // (http://ejohn.org/blog/javascript-micro-templating/)+ // and Laura Doktorova's doT.js (https://github.com/olado/doT).+ var settings = lodash.templateSettings;++ if (guard && isIterateeCall(string, options, guard)) {+ options = undefined;+ }+ string = toString(string);+ options = assignInWith({}, options, settings, customDefaultsAssignIn);++ var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),+ importsKeys = keys(imports),+ importsValues = baseValues(imports, importsKeys);++ var isEscaping,+ isEvaluating,+ index = 0,+ interpolate = options.interpolate || reNoMatch,+ source = "__p += '";++ // Compile the regexp to match each delimiter.+ var reDelimiters = RegExp(+ (options.escape || reNoMatch).source + '|' ++ interpolate.source + '|' ++ (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' ++ (options.evaluate || reNoMatch).source + '|$'+ , 'g');++ // Use a sourceURL for easier debugging.+ var sourceURL = '//# sourceURL=' ++ ('sourceURL' in options+ ? options.sourceURL+ : ('lodash.templateSources[' + (++templateCounter) + ']')+ ) + '\n';++ string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {+ interpolateValue || (interpolateValue = esTemplateValue);++ // Escape characters that can't be included in string literals.+ source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);++ // Replace delimiters with snippets.+ if (escapeValue) {+ isEscaping = true;+ source += "' +\n__e(" + escapeValue + ") +\n'";+ }+ if (evaluateValue) {+ isEvaluating = true;+ source += "';\n" + evaluateValue + ";\n__p += '";+ }+ if (interpolateValue) {+ source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";+ }+ index = offset + match.length;++ // The JS engine embedded in Adobe products needs `match` returned in+ // order to produce the correct `offset` value.+ return match;+ });++ source += "';\n";++ // If `variable` is not specified wrap a with-statement around the generated+ // code to add the data object to the top of the scope chain.+ var variable = options.variable;+ if (!variable) {+ source = 'with (obj) {\n' + source + '\n}\n';+ }+ // Cleanup code by stripping empty strings.+ source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)+ .replace(reEmptyStringMiddle, '$1')+ .replace(reEmptyStringTrailing, '$1;');++ // Frame code as the function body.+ source = 'function(' + (variable || 'obj') + ') {\n' ++ (variable+ ? ''+ : 'obj || (obj = {});\n'+ ) ++ "var __t, __p = ''" ++ (isEscaping+ ? ', __e = _.escape'+ : ''+ ) ++ (isEvaluating+ ? ', __j = Array.prototype.join;\n' ++ "function print() { __p += __j.call(arguments, '') }\n"+ : ';\n'+ ) ++ source ++ 'return __p\n}';++ var result = attempt(function() {+ return Function(importsKeys, sourceURL + 'return ' + source)+ .apply(undefined, importsValues);+ });++ // Provide the compiled function's source by its `toString` method or+ // the `source` property as a convenience for inlining compiled templates.+ result.source = source;+ if (isError(result)) {+ throw result;+ }+ return result;+ }++ /**+ * Converts `string`, as a whole, to lower case just like+ * [String#toLowerCase](https://mdn.io/toLowerCase).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the lower cased string.+ * @example+ *+ * _.toLower('--Foo-Bar--');+ * // => '--foo-bar--'+ *+ * _.toLower('fooBar');+ * // => 'foobar'+ *+ * _.toLower('__FOO_BAR__');+ * // => '__foo_bar__'+ */+ function toLower(value) {+ return toString(value).toLowerCase();+ }++ /**+ * Converts `string`, as a whole, to upper case just like+ * [String#toUpperCase](https://mdn.io/toUpperCase).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the upper cased string.+ * @example+ *+ * _.toUpper('--foo-bar--');+ * // => '--FOO-BAR--'+ *+ * _.toUpper('fooBar');+ * // => 'FOOBAR'+ *+ * _.toUpper('__foo_bar__');+ * // => '__FOO_BAR__'+ */+ function toUpper(value) {+ return toString(value).toUpperCase();+ }++ /**+ * Removes leading and trailing whitespace or specified characters from `string`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to trim.+ * @param {string} [chars=whitespace] The characters to trim.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {string} Returns the trimmed string.+ * @example+ *+ * _.trim(' abc ');+ * // => 'abc'+ *+ * _.trim('-_-abc-_-', '_-');+ * // => 'abc'+ *+ * _.map([' foo ', ' bar '], _.trim);+ * // => ['foo', 'bar']+ */+ function trim(string, chars, guard) {+ string = toString(string);+ if (string && (guard || chars === undefined)) {+ return string.replace(reTrim, '');+ }+ if (!string || !(chars = baseToString(chars))) {+ return string;+ }+ var strSymbols = stringToArray(string),+ chrSymbols = stringToArray(chars),+ start = charsStartIndex(strSymbols, chrSymbols),+ end = charsEndIndex(strSymbols, chrSymbols) + 1;++ return castSlice(strSymbols, start, end).join('');+ }++ /**+ * Removes trailing whitespace or specified characters from `string`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to trim.+ * @param {string} [chars=whitespace] The characters to trim.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {string} Returns the trimmed string.+ * @example+ *+ * _.trimEnd(' abc ');+ * // => ' abc'+ *+ * _.trimEnd('-_-abc-_-', '_-');+ * // => '-_-abc'+ */+ function trimEnd(string, chars, guard) {+ string = toString(string);+ if (string && (guard || chars === undefined)) {+ return string.replace(reTrimEnd, '');+ }+ if (!string || !(chars = baseToString(chars))) {+ return string;+ }+ var strSymbols = stringToArray(string),+ end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;++ return castSlice(strSymbols, 0, end).join('');+ }++ /**+ * Removes leading whitespace or specified characters from `string`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to trim.+ * @param {string} [chars=whitespace] The characters to trim.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {string} Returns the trimmed string.+ * @example+ *+ * _.trimStart(' abc ');+ * // => 'abc '+ *+ * _.trimStart('-_-abc-_-', '_-');+ * // => 'abc-_-'+ */+ function trimStart(string, chars, guard) {+ string = toString(string);+ if (string && (guard || chars === undefined)) {+ return string.replace(reTrimStart, '');+ }+ if (!string || !(chars = baseToString(chars))) {+ return string;+ }+ var strSymbols = stringToArray(string),+ start = charsStartIndex(strSymbols, stringToArray(chars));++ return castSlice(strSymbols, start).join('');+ }++ /**+ * Truncates `string` if it's longer than the given maximum string length.+ * The last characters of the truncated string are replaced with the omission+ * string which defaults to "...".+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to truncate.+ * @param {Object} [options={}] The options object.+ * @param {number} [options.length=30] The maximum string length.+ * @param {string} [options.omission='...'] The string to indicate text is omitted.+ * @param {RegExp|string} [options.separator] The separator pattern to truncate to.+ * @returns {string} Returns the truncated string.+ * @example+ *+ * _.truncate('hi-diddly-ho there, neighborino');+ * // => 'hi-diddly-ho there, neighbo...'+ *+ * _.truncate('hi-diddly-ho there, neighborino', {+ * 'length': 24,+ * 'separator': ' '+ * });+ * // => 'hi-diddly-ho there,...'+ *+ * _.truncate('hi-diddly-ho there, neighborino', {+ * 'length': 24,+ * 'separator': /,? +/+ * });+ * // => 'hi-diddly-ho there...'+ *+ * _.truncate('hi-diddly-ho there, neighborino', {+ * 'omission': ' [...]'+ * });+ * // => 'hi-diddly-ho there, neig [...]'+ */+ function truncate(string, options) {+ var length = DEFAULT_TRUNC_LENGTH,+ omission = DEFAULT_TRUNC_OMISSION;++ if (isObject(options)) {+ var separator = 'separator' in options ? options.separator : separator;+ length = 'length' in options ? toInteger(options.length) : length;+ omission = 'omission' in options ? baseToString(options.omission) : omission;+ }+ string = toString(string);++ var strLength = string.length;+ if (hasUnicode(string)) {+ var strSymbols = stringToArray(string);+ strLength = strSymbols.length;+ }+ if (length >= strLength) {+ return string;+ }+ var end = length - stringSize(omission);+ if (end < 1) {+ return omission;+ }+ var result = strSymbols+ ? castSlice(strSymbols, 0, end).join('')+ : string.slice(0, end);++ if (separator === undefined) {+ return result + omission;+ }+ if (strSymbols) {+ end += (result.length - end);+ }+ if (isRegExp(separator)) {+ if (string.slice(end).search(separator)) {+ var match,+ substring = result;++ if (!separator.global) {+ separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');+ }+ separator.lastIndex = 0;+ while ((match = separator.exec(substring))) {+ var newEnd = match.index;+ }+ result = result.slice(0, newEnd === undefined ? end : newEnd);+ }+ } else if (string.indexOf(baseToString(separator), end) != end) {+ var index = result.lastIndexOf(separator);+ if (index > -1) {+ result = result.slice(0, index);+ }+ }+ return result + omission;+ }++ /**+ * The inverse of `_.escape`; this method converts the HTML entities+ * `&`, `<`, `>`, `"`, and `'` in `string` to+ * their corresponding characters.+ *+ * **Note:** No other HTML entities are unescaped. To unescape additional+ * HTML entities use a third-party library like [_he_](https://mths.be/he).+ *+ * @static+ * @memberOf _+ * @since 0.6.0+ * @category String+ * @param {string} [string=''] The string to unescape.+ * @returns {string} Returns the unescaped string.+ * @example+ *+ * _.unescape('fred, barney, & pebbles');+ * // => 'fred, barney, & pebbles'+ */+ function unescape(string) {+ string = toString(string);+ return (string && reHasEscapedHtml.test(string))+ ? string.replace(reEscapedHtml, unescapeHtmlChar)+ : string;+ }++ /**+ * Converts `string`, as space separated words, to upper case.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the upper cased string.+ * @example+ *+ * _.upperCase('--foo-bar');+ * // => 'FOO BAR'+ *+ * _.upperCase('fooBar');+ * // => 'FOO BAR'+ *+ * _.upperCase('__foo_bar__');+ * // => 'FOO BAR'+ */+ var upperCase = createCompounder(function(result, word, index) {+ return result + (index ? ' ' : '') + word.toUpperCase();+ });++ /**+ * Converts the first character of `string` to upper case.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category String+ * @param {string} [string=''] The string to convert.+ * @returns {string} Returns the converted string.+ * @example+ *+ * _.upperFirst('fred');+ * // => 'Fred'+ *+ * _.upperFirst('FRED');+ * // => 'FRED'+ */+ var upperFirst = createCaseFirst('toUpperCase');++ /**+ * Splits `string` into an array of its words.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category String+ * @param {string} [string=''] The string to inspect.+ * @param {RegExp|string} [pattern] The pattern to match words.+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.+ * @returns {Array} Returns the words of `string`.+ * @example+ *+ * _.words('fred, barney, & pebbles');+ * // => ['fred', 'barney', 'pebbles']+ *+ * _.words('fred, barney, & pebbles', /[^, ]+/g);+ * // => ['fred', 'barney', '&', 'pebbles']+ */+ function words(string, pattern, guard) {+ string = toString(string);+ pattern = guard ? undefined : pattern;++ if (pattern === undefined) {+ return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);+ }+ return string.match(pattern) || [];+ }++ /*------------------------------------------------------------------------*/++ /**+ * Attempts to invoke `func`, returning either the result or the caught error+ * object. Any additional arguments are provided to `func` when it's invoked.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Util+ * @param {Function} func The function to attempt.+ * @param {...*} [args] The arguments to invoke `func` with.+ * @returns {*} Returns the `func` result or error object.+ * @example+ *+ * // Avoid throwing errors for invalid selectors.+ * var elements = _.attempt(function(selector) {+ * return document.querySelectorAll(selector);+ * }, '>_>');+ *+ * if (_.isError(elements)) {+ * elements = [];+ * }+ */+ var attempt = baseRest(function(func, args) {+ try {+ return apply(func, undefined, args);+ } catch (e) {+ return isError(e) ? e : new Error(e);+ }+ });++ /**+ * Binds methods of an object to the object itself, overwriting the existing+ * method.+ *+ * **Note:** This method doesn't set the "length" property of bound functions.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {Object} object The object to bind and assign the bound methods to.+ * @param {...(string|string[])} methodNames The object method names to bind.+ * @returns {Object} Returns `object`.+ * @example+ *+ * var view = {+ * 'label': 'docs',+ * 'click': function() {+ * console.log('clicked ' + this.label);+ * }+ * };+ *+ * _.bindAll(view, ['click']);+ * jQuery(element).on('click', view.click);+ * // => Logs 'clicked docs' when clicked.+ */+ var bindAll = flatRest(function(object, methodNames) {+ arrayEach(methodNames, function(key) {+ key = toKey(key);+ baseAssignValue(object, key, bind(object[key], object));+ });+ return object;+ });++ /**+ * Creates a function that iterates over `pairs` and invokes the corresponding+ * function of the first predicate to return truthy. The predicate-function+ * pairs are invoked with the `this` binding and arguments of the created+ * function.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {Array} pairs The predicate-function pairs.+ * @returns {Function} Returns the new composite function.+ * @example+ *+ * var func = _.cond([+ * [_.matches({ 'a': 1 }), _.constant('matches A')],+ * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],+ * [_.stubTrue, _.constant('no match')]+ * ]);+ *+ * func({ 'a': 1, 'b': 2 });+ * // => 'matches A'+ *+ * func({ 'a': 0, 'b': 1 });+ * // => 'matches B'+ *+ * func({ 'a': '1', 'b': '2' });+ * // => 'no match'+ */+ function cond(pairs) {+ var length = pairs == null ? 0 : pairs.length,+ toIteratee = getIteratee();++ pairs = !length ? [] : arrayMap(pairs, function(pair) {+ if (typeof pair[1] != 'function') {+ throw new TypeError(FUNC_ERROR_TEXT);+ }+ return [toIteratee(pair[0]), pair[1]];+ });++ return baseRest(function(args) {+ var index = -1;+ while (++index < length) {+ var pair = pairs[index];+ if (apply(pair[0], this, args)) {+ return apply(pair[1], this, args);+ }+ }+ });+ }++ /**+ * Creates a function that invokes the predicate properties of `source` with+ * the corresponding property values of a given object, returning `true` if+ * all predicates return truthy, else `false`.+ *+ * **Note:** The created function is equivalent to `_.conformsTo` with+ * `source` partially applied.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {Object} source The object of property predicates to conform to.+ * @returns {Function} Returns the new spec function.+ * @example+ *+ * var objects = [+ * { 'a': 2, 'b': 1 },+ * { 'a': 1, 'b': 2 }+ * ];+ *+ * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));+ * // => [{ 'a': 1, 'b': 2 }]+ */+ function conforms(source) {+ return baseConforms(baseClone(source, CLONE_DEEP_FLAG));+ }++ /**+ * Creates a function that returns `value`.+ *+ * @static+ * @memberOf _+ * @since 2.4.0+ * @category Util+ * @param {*} value The value to return from the new function.+ * @returns {Function} Returns the new constant function.+ * @example+ *+ * var objects = _.times(2, _.constant({ 'a': 1 }));+ *+ * console.log(objects);+ * // => [{ 'a': 1 }, { 'a': 1 }]+ *+ * console.log(objects[0] === objects[1]);+ * // => true+ */+ function constant(value) {+ return function() {+ return value;+ };+ }++ /**+ * Checks `value` to determine whether a default value should be returned in+ * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,+ * or `undefined`.+ *+ * @static+ * @memberOf _+ * @since 4.14.0+ * @category Util+ * @param {*} value The value to check.+ * @param {*} defaultValue The default value.+ * @returns {*} Returns the resolved value.+ * @example+ *+ * _.defaultTo(1, 10);+ * // => 1+ *+ * _.defaultTo(undefined, 10);+ * // => 10+ */+ function defaultTo(value, defaultValue) {+ return (value == null || value !== value) ? defaultValue : value;+ }++ /**+ * Creates a function that returns the result of invoking the given functions+ * with the `this` binding of the created function, where each successive+ * invocation is supplied the return value of the previous.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Util+ * @param {...(Function|Function[])} [funcs] The functions to invoke.+ * @returns {Function} Returns the new composite function.+ * @see _.flowRight+ * @example+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * var addSquare = _.flow([_.add, square]);+ * addSquare(1, 2);+ * // => 9+ */+ var flow = createFlow();++ /**+ * This method is like `_.flow` except that it creates a function that+ * invokes the given functions from right to left.+ *+ * @static+ * @since 3.0.0+ * @memberOf _+ * @category Util+ * @param {...(Function|Function[])} [funcs] The functions to invoke.+ * @returns {Function} Returns the new composite function.+ * @see _.flow+ * @example+ *+ * function square(n) {+ * return n * n;+ * }+ *+ * var addSquare = _.flowRight([square, _.add]);+ * addSquare(1, 2);+ * // => 9+ */+ var flowRight = createFlow(true);++ /**+ * This method returns the first argument it receives.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {*} value Any value.+ * @returns {*} Returns `value`.+ * @example+ *+ * var object = { 'a': 1 };+ *+ * console.log(_.identity(object) === object);+ * // => true+ */+ function identity(value) {+ return value;+ }++ /**+ * Creates a function that invokes `func` with the arguments of the created+ * function. If `func` is a property name, the created function returns the+ * property value for a given element. If `func` is an array or object, the+ * created function returns `true` for elements that contain the equivalent+ * source properties, otherwise it returns `false`.+ *+ * @static+ * @since 4.0.0+ * @memberOf _+ * @category Util+ * @param {*} [func=_.identity] The value to convert to a callback.+ * @returns {Function} Returns the callback.+ * @example+ *+ * var users = [+ * { 'user': 'barney', 'age': 36, 'active': true },+ * { 'user': 'fred', 'age': 40, 'active': false }+ * ];+ *+ * // The `_.matches` iteratee shorthand.+ * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));+ * // => [{ 'user': 'barney', 'age': 36, 'active': true }]+ *+ * // The `_.matchesProperty` iteratee shorthand.+ * _.filter(users, _.iteratee(['user', 'fred']));+ * // => [{ 'user': 'fred', 'age': 40 }]+ *+ * // The `_.property` iteratee shorthand.+ * _.map(users, _.iteratee('user'));+ * // => ['barney', 'fred']+ *+ * // Create custom iteratee shorthands.+ * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {+ * return !_.isRegExp(func) ? iteratee(func) : function(string) {+ * return func.test(string);+ * };+ * });+ *+ * _.filter(['abc', 'def'], /ef/);+ * // => ['def']+ */+ function iteratee(func) {+ return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));+ }++ /**+ * Creates a function that performs a partial deep comparison between a given+ * object and `source`, returning `true` if the given object has equivalent+ * property values, else `false`.+ *+ * **Note:** The created function is equivalent to `_.isMatch` with `source`+ * partially applied.+ *+ * Partial comparisons will match empty array and empty object `source`+ * values against any array or object value, respectively. See `_.isEqual`+ * for a list of supported value comparisons.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Util+ * @param {Object} source The object of property values to match.+ * @returns {Function} Returns the new spec function.+ * @example+ *+ * var objects = [+ * { 'a': 1, 'b': 2, 'c': 3 },+ * { 'a': 4, 'b': 5, 'c': 6 }+ * ];+ *+ * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));+ * // => [{ 'a': 4, 'b': 5, 'c': 6 }]+ */+ function matches(source) {+ return baseMatches(baseClone(source, CLONE_DEEP_FLAG));+ }++ /**+ * Creates a function that performs a partial deep comparison between the+ * value at `path` of a given object to `srcValue`, returning `true` if the+ * object value is equivalent, else `false`.+ *+ * **Note:** Partial comparisons will match empty array and empty object+ * `srcValue` values against any array or object value, respectively. See+ * `_.isEqual` for a list of supported value comparisons.+ *+ * @static+ * @memberOf _+ * @since 3.2.0+ * @category Util+ * @param {Array|string} path The path of the property to get.+ * @param {*} srcValue The value to match.+ * @returns {Function} Returns the new spec function.+ * @example+ *+ * var objects = [+ * { 'a': 1, 'b': 2, 'c': 3 },+ * { 'a': 4, 'b': 5, 'c': 6 }+ * ];+ *+ * _.find(objects, _.matchesProperty('a', 4));+ * // => { 'a': 4, 'b': 5, 'c': 6 }+ */+ function matchesProperty(path, srcValue) {+ return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));+ }++ /**+ * Creates a function that invokes the method at `path` of a given object.+ * Any additional arguments are provided to the invoked method.+ *+ * @static+ * @memberOf _+ * @since 3.7.0+ * @category Util+ * @param {Array|string} path The path of the method to invoke.+ * @param {...*} [args] The arguments to invoke the method with.+ * @returns {Function} Returns the new invoker function.+ * @example+ *+ * var objects = [+ * { 'a': { 'b': _.constant(2) } },+ * { 'a': { 'b': _.constant(1) } }+ * ];+ *+ * _.map(objects, _.method('a.b'));+ * // => [2, 1]+ *+ * _.map(objects, _.method(['a', 'b']));+ * // => [2, 1]+ */+ var method = baseRest(function(path, args) {+ return function(object) {+ return baseInvoke(object, path, args);+ };+ });++ /**+ * The opposite of `_.method`; this method creates a function that invokes+ * the method at a given path of `object`. Any additional arguments are+ * provided to the invoked method.+ *+ * @static+ * @memberOf _+ * @since 3.7.0+ * @category Util+ * @param {Object} object The object to query.+ * @param {...*} [args] The arguments to invoke the method with.+ * @returns {Function} Returns the new invoker function.+ * @example+ *+ * var array = _.times(3, _.constant),+ * object = { 'a': array, 'b': array, 'c': array };+ *+ * _.map(['a[2]', 'c[0]'], _.methodOf(object));+ * // => [2, 0]+ *+ * _.map([['a', '2'], ['c', '0']], _.methodOf(object));+ * // => [2, 0]+ */+ var methodOf = baseRest(function(object, args) {+ return function(path) {+ return baseInvoke(object, path, args);+ };+ });++ /**+ * Adds all own enumerable string keyed function properties of a source+ * object to the destination object. If `object` is a function, then methods+ * are added to its prototype as well.+ *+ * **Note:** Use `_.runInContext` to create a pristine `lodash` function to+ * avoid conflicts caused by modifying the original.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {Function|Object} [object=lodash] The destination object.+ * @param {Object} source The object of functions to add.+ * @param {Object} [options={}] The options object.+ * @param {boolean} [options.chain=true] Specify whether mixins are chainable.+ * @returns {Function|Object} Returns `object`.+ * @example+ *+ * function vowels(string) {+ * return _.filter(string, function(v) {+ * return /[aeiou]/i.test(v);+ * });+ * }+ *+ * _.mixin({ 'vowels': vowels });+ * _.vowels('fred');+ * // => ['e']+ *+ * _('fred').vowels().value();+ * // => ['e']+ *+ * _.mixin({ 'vowels': vowels }, { 'chain': false });+ * _('fred').vowels();+ * // => ['e']+ */+ function mixin(object, source, options) {+ var props = keys(source),+ methodNames = baseFunctions(source, props);++ if (options == null &&+ !(isObject(source) && (methodNames.length || !props.length))) {+ options = source;+ source = object;+ object = this;+ methodNames = baseFunctions(source, keys(source));+ }+ var chain = !(isObject(options) && 'chain' in options) || !!options.chain,+ isFunc = isFunction(object);++ arrayEach(methodNames, function(methodName) {+ var func = source[methodName];+ object[methodName] = func;+ if (isFunc) {+ object.prototype[methodName] = function() {+ var chainAll = this.__chain__;+ if (chain || chainAll) {+ var result = object(this.__wrapped__),+ actions = result.__actions__ = copyArray(this.__actions__);++ actions.push({ 'func': func, 'args': arguments, 'thisArg': object });+ result.__chain__ = chainAll;+ return result;+ }+ return func.apply(object, arrayPush([this.value()], arguments));+ };+ }+ });++ return object;+ }++ /**+ * Reverts the `_` variable to its previous value and returns a reference to+ * the `lodash` function.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @returns {Function} Returns the `lodash` function.+ * @example+ *+ * var lodash = _.noConflict();+ */+ function noConflict() {+ if (root._ === this) {+ root._ = oldDash;+ }+ return this;+ }++ /**+ * This method returns `undefined`.+ *+ * @static+ * @memberOf _+ * @since 2.3.0+ * @category Util+ * @example+ *+ * _.times(2, _.noop);+ * // => [undefined, undefined]+ */+ function noop() {+ // No operation performed.+ }++ /**+ * Creates a function that gets the argument at index `n`. If `n` is negative,+ * the nth argument from the end is returned.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {number} [n=0] The index of the argument to return.+ * @returns {Function} Returns the new pass-thru function.+ * @example+ *+ * var func = _.nthArg(1);+ * func('a', 'b', 'c', 'd');+ * // => 'b'+ *+ * var func = _.nthArg(-2);+ * func('a', 'b', 'c', 'd');+ * // => 'c'+ */+ function nthArg(n) {+ n = toInteger(n);+ return baseRest(function(args) {+ return baseNth(args, n);+ });+ }++ /**+ * Creates a function that invokes `iteratees` with the arguments it receives+ * and returns their results.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {...(Function|Function[])} [iteratees=[_.identity]]+ * The iteratees to invoke.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var func = _.over([Math.max, Math.min]);+ *+ * func(1, 2, 3, 4);+ * // => [4, 1]+ */+ var over = createOver(arrayMap);++ /**+ * Creates a function that checks if **all** of the `predicates` return+ * truthy when invoked with the arguments it receives.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {...(Function|Function[])} [predicates=[_.identity]]+ * The predicates to check.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var func = _.overEvery([Boolean, isFinite]);+ *+ * func('1');+ * // => true+ *+ * func(null);+ * // => false+ *+ * func(NaN);+ * // => false+ */+ var overEvery = createOver(arrayEvery);++ /**+ * Creates a function that checks if **any** of the `predicates` return+ * truthy when invoked with the arguments it receives.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {...(Function|Function[])} [predicates=[_.identity]]+ * The predicates to check.+ * @returns {Function} Returns the new function.+ * @example+ *+ * var func = _.overSome([Boolean, isFinite]);+ *+ * func('1');+ * // => true+ *+ * func(null);+ * // => true+ *+ * func(NaN);+ * // => false+ */+ var overSome = createOver(arraySome);++ /**+ * Creates a function that returns the value at `path` of a given object.+ *+ * @static+ * @memberOf _+ * @since 2.4.0+ * @category Util+ * @param {Array|string} path The path of the property to get.+ * @returns {Function} Returns the new accessor function.+ * @example+ *+ * var objects = [+ * { 'a': { 'b': 2 } },+ * { 'a': { 'b': 1 } }+ * ];+ *+ * _.map(objects, _.property('a.b'));+ * // => [2, 1]+ *+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');+ * // => [1, 2]+ */+ function property(path) {+ return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);+ }++ /**+ * The opposite of `_.property`; this method creates a function that returns+ * the value at a given path of `object`.+ *+ * @static+ * @memberOf _+ * @since 3.0.0+ * @category Util+ * @param {Object} object The object to query.+ * @returns {Function} Returns the new accessor function.+ * @example+ *+ * var array = [0, 1, 2],+ * object = { 'a': array, 'b': array, 'c': array };+ *+ * _.map(['a[2]', 'c[0]'], _.propertyOf(object));+ * // => [2, 0]+ *+ * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));+ * // => [2, 0]+ */+ function propertyOf(object) {+ return function(path) {+ return object == null ? undefined : baseGet(object, path);+ };+ }++ /**+ * Creates an array of numbers (positive and/or negative) progressing from+ * `start` up to, but not including, `end`. A step of `-1` is used if a negative+ * `start` is specified without an `end` or `step`. If `end` is not specified,+ * it's set to `start` with `start` then set to `0`.+ *+ * **Note:** JavaScript follows the IEEE-754 standard for resolving+ * floating-point values which can produce unexpected results.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {number} [start=0] The start of the range.+ * @param {number} end The end of the range.+ * @param {number} [step=1] The value to increment or decrement by.+ * @returns {Array} Returns the range of numbers.+ * @see _.inRange, _.rangeRight+ * @example+ *+ * _.range(4);+ * // => [0, 1, 2, 3]+ *+ * _.range(-4);+ * // => [0, -1, -2, -3]+ *+ * _.range(1, 5);+ * // => [1, 2, 3, 4]+ *+ * _.range(0, 20, 5);+ * // => [0, 5, 10, 15]+ *+ * _.range(0, -4, -1);+ * // => [0, -1, -2, -3]+ *+ * _.range(1, 4, 0);+ * // => [1, 1, 1]+ *+ * _.range(0);+ * // => []+ */+ var range = createRange();++ /**+ * This method is like `_.range` except that it populates values in+ * descending order.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {number} [start=0] The start of the range.+ * @param {number} end The end of the range.+ * @param {number} [step=1] The value to increment or decrement by.+ * @returns {Array} Returns the range of numbers.+ * @see _.inRange, _.range+ * @example+ *+ * _.rangeRight(4);+ * // => [3, 2, 1, 0]+ *+ * _.rangeRight(-4);+ * // => [-3, -2, -1, 0]+ *+ * _.rangeRight(1, 5);+ * // => [4, 3, 2, 1]+ *+ * _.rangeRight(0, 20, 5);+ * // => [15, 10, 5, 0]+ *+ * _.rangeRight(0, -4, -1);+ * // => [-3, -2, -1, 0]+ *+ * _.rangeRight(1, 4, 0);+ * // => [1, 1, 1]+ *+ * _.rangeRight(0);+ * // => []+ */+ var rangeRight = createRange(true);++ /**+ * This method returns a new empty array.+ *+ * @static+ * @memberOf _+ * @since 4.13.0+ * @category Util+ * @returns {Array} Returns the new empty array.+ * @example+ *+ * var arrays = _.times(2, _.stubArray);+ *+ * console.log(arrays);+ * // => [[], []]+ *+ * console.log(arrays[0] === arrays[1]);+ * // => false+ */+ function stubArray() {+ return [];+ }++ /**+ * This method returns `false`.+ *+ * @static+ * @memberOf _+ * @since 4.13.0+ * @category Util+ * @returns {boolean} Returns `false`.+ * @example+ *+ * _.times(2, _.stubFalse);+ * // => [false, false]+ */+ function stubFalse() {+ return false;+ }++ /**+ * This method returns a new empty object.+ *+ * @static+ * @memberOf _+ * @since 4.13.0+ * @category Util+ * @returns {Object} Returns the new empty object.+ * @example+ *+ * var objects = _.times(2, _.stubObject);+ *+ * console.log(objects);+ * // => [{}, {}]+ *+ * console.log(objects[0] === objects[1]);+ * // => false+ */+ function stubObject() {+ return {};+ }++ /**+ * This method returns an empty string.+ *+ * @static+ * @memberOf _+ * @since 4.13.0+ * @category Util+ * @returns {string} Returns the empty string.+ * @example+ *+ * _.times(2, _.stubString);+ * // => ['', '']+ */+ function stubString() {+ return '';+ }++ /**+ * This method returns `true`.+ *+ * @static+ * @memberOf _+ * @since 4.13.0+ * @category Util+ * @returns {boolean} Returns `true`.+ * @example+ *+ * _.times(2, _.stubTrue);+ * // => [true, true]+ */+ function stubTrue() {+ return true;+ }++ /**+ * Invokes the iteratee `n` times, returning an array of the results of+ * each invocation. The iteratee is invoked with one argument; (index).+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {number} n The number of times to invoke `iteratee`.+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.+ * @returns {Array} Returns the array of results.+ * @example+ *+ * _.times(3, String);+ * // => ['0', '1', '2']+ *+ * _.times(4, _.constant(0));+ * // => [0, 0, 0, 0]+ */+ function times(n, iteratee) {+ n = toInteger(n);+ if (n < 1 || n > MAX_SAFE_INTEGER) {+ return [];+ }+ var index = MAX_ARRAY_LENGTH,+ length = nativeMin(n, MAX_ARRAY_LENGTH);++ iteratee = getIteratee(iteratee);+ n -= MAX_ARRAY_LENGTH;++ var result = baseTimes(length, iteratee);+ while (++index < n) {+ iteratee(index);+ }+ return result;+ }++ /**+ * Converts `value` to a property path array.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Util+ * @param {*} value The value to convert.+ * @returns {Array} Returns the new property path array.+ * @example+ *+ * _.toPath('a.b.c');+ * // => ['a', 'b', 'c']+ *+ * _.toPath('a[0].b.c');+ * // => ['a', '0', 'b', 'c']+ */+ function toPath(value) {+ if (isArray(value)) {+ return arrayMap(value, toKey);+ }+ return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));+ }++ /**+ * Generates a unique ID. If `prefix` is given, the ID is appended to it.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Util+ * @param {string} [prefix=''] The value to prefix the ID with.+ * @returns {string} Returns the unique ID.+ * @example+ *+ * _.uniqueId('contact_');+ * // => 'contact_104'+ *+ * _.uniqueId();+ * // => '105'+ */+ function uniqueId(prefix) {+ var id = ++idCounter;+ return toString(prefix) + id;+ }++ /*------------------------------------------------------------------------*/++ /**+ * Adds two numbers.+ *+ * @static+ * @memberOf _+ * @since 3.4.0+ * @category Math+ * @param {number} augend The first number in an addition.+ * @param {number} addend The second number in an addition.+ * @returns {number} Returns the total.+ * @example+ *+ * _.add(6, 4);+ * // => 10+ */+ var add = createMathOperation(function(augend, addend) {+ return augend + addend;+ }, 0);++ /**+ * Computes `number` rounded up to `precision`.+ *+ * @static+ * @memberOf _+ * @since 3.10.0+ * @category Math+ * @param {number} number The number to round up.+ * @param {number} [precision=0] The precision to round up to.+ * @returns {number} Returns the rounded up number.+ * @example+ *+ * _.ceil(4.006);+ * // => 5+ *+ * _.ceil(6.004, 2);+ * // => 6.01+ *+ * _.ceil(6040, -2);+ * // => 6100+ */+ var ceil = createRound('ceil');++ /**+ * Divide two numbers.+ *+ * @static+ * @memberOf _+ * @since 4.7.0+ * @category Math+ * @param {number} dividend The first number in a division.+ * @param {number} divisor The second number in a division.+ * @returns {number} Returns the quotient.+ * @example+ *+ * _.divide(6, 4);+ * // => 1.5+ */+ var divide = createMathOperation(function(dividend, divisor) {+ return dividend / divisor;+ }, 1);++ /**+ * Computes `number` rounded down to `precision`.+ *+ * @static+ * @memberOf _+ * @since 3.10.0+ * @category Math+ * @param {number} number The number to round down.+ * @param {number} [precision=0] The precision to round down to.+ * @returns {number} Returns the rounded down number.+ * @example+ *+ * _.floor(4.006);+ * // => 4+ *+ * _.floor(0.046, 2);+ * // => 0.04+ *+ * _.floor(4060, -2);+ * // => 4000+ */+ var floor = createRound('floor');++ /**+ * Computes the maximum value of `array`. If `array` is empty or falsey,+ * `undefined` is returned.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Math+ * @param {Array} array The array to iterate over.+ * @returns {*} Returns the maximum value.+ * @example+ *+ * _.max([4, 2, 8, 6]);+ * // => 8+ *+ * _.max([]);+ * // => undefined+ */+ function max(array) {+ return (array && array.length)+ ? baseExtremum(array, identity, baseGt)+ : undefined;+ }++ /**+ * This method is like `_.max` except that it accepts `iteratee` which is+ * invoked for each element in `array` to generate the criterion by which+ * the value is ranked. The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {*} Returns the maximum value.+ * @example+ *+ * var objects = [{ 'n': 1 }, { 'n': 2 }];+ *+ * _.maxBy(objects, function(o) { return o.n; });+ * // => { 'n': 2 }+ *+ * // The `_.property` iteratee shorthand.+ * _.maxBy(objects, 'n');+ * // => { 'n': 2 }+ */+ function maxBy(array, iteratee) {+ return (array && array.length)+ ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)+ : undefined;+ }++ /**+ * Computes the mean of the values in `array`.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @returns {number} Returns the mean.+ * @example+ *+ * _.mean([4, 2, 8, 6]);+ * // => 5+ */+ function mean(array) {+ return baseMean(array, identity);+ }++ /**+ * This method is like `_.mean` except that it accepts `iteratee` which is+ * invoked for each element in `array` to generate the value to be averaged.+ * The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.7.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {number} Returns the mean.+ * @example+ *+ * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];+ *+ * _.meanBy(objects, function(o) { return o.n; });+ * // => 5+ *+ * // The `_.property` iteratee shorthand.+ * _.meanBy(objects, 'n');+ * // => 5+ */+ function meanBy(array, iteratee) {+ return baseMean(array, getIteratee(iteratee, 2));+ }++ /**+ * Computes the minimum value of `array`. If `array` is empty or falsey,+ * `undefined` is returned.+ *+ * @static+ * @since 0.1.0+ * @memberOf _+ * @category Math+ * @param {Array} array The array to iterate over.+ * @returns {*} Returns the minimum value.+ * @example+ *+ * _.min([4, 2, 8, 6]);+ * // => 2+ *+ * _.min([]);+ * // => undefined+ */+ function min(array) {+ return (array && array.length)+ ? baseExtremum(array, identity, baseLt)+ : undefined;+ }++ /**+ * This method is like `_.min` except that it accepts `iteratee` which is+ * invoked for each element in `array` to generate the criterion by which+ * the value is ranked. The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {*} Returns the minimum value.+ * @example+ *+ * var objects = [{ 'n': 1 }, { 'n': 2 }];+ *+ * _.minBy(objects, function(o) { return o.n; });+ * // => { 'n': 1 }+ *+ * // The `_.property` iteratee shorthand.+ * _.minBy(objects, 'n');+ * // => { 'n': 1 }+ */+ function minBy(array, iteratee) {+ return (array && array.length)+ ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)+ : undefined;+ }++ /**+ * Multiply two numbers.+ *+ * @static+ * @memberOf _+ * @since 4.7.0+ * @category Math+ * @param {number} multiplier The first number in a multiplication.+ * @param {number} multiplicand The second number in a multiplication.+ * @returns {number} Returns the product.+ * @example+ *+ * _.multiply(6, 4);+ * // => 24+ */+ var multiply = createMathOperation(function(multiplier, multiplicand) {+ return multiplier * multiplicand;+ }, 1);++ /**+ * Computes `number` rounded to `precision`.+ *+ * @static+ * @memberOf _+ * @since 3.10.0+ * @category Math+ * @param {number} number The number to round.+ * @param {number} [precision=0] The precision to round to.+ * @returns {number} Returns the rounded number.+ * @example+ *+ * _.round(4.006);+ * // => 4+ *+ * _.round(4.006, 2);+ * // => 4.01+ *+ * _.round(4060, -2);+ * // => 4100+ */+ var round = createRound('round');++ /**+ * Subtract two numbers.+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Math+ * @param {number} minuend The first number in a subtraction.+ * @param {number} subtrahend The second number in a subtraction.+ * @returns {number} Returns the difference.+ * @example+ *+ * _.subtract(6, 4);+ * // => 2+ */+ var subtract = createMathOperation(function(minuend, subtrahend) {+ return minuend - subtrahend;+ }, 0);++ /**+ * Computes the sum of the values in `array`.+ *+ * @static+ * @memberOf _+ * @since 3.4.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @returns {number} Returns the sum.+ * @example+ *+ * _.sum([4, 2, 8, 6]);+ * // => 20+ */+ function sum(array) {+ return (array && array.length)+ ? baseSum(array, identity)+ : 0;+ }++ /**+ * This method is like `_.sum` except that it accepts `iteratee` which is+ * invoked for each element in `array` to generate the value to be summed.+ * The iteratee is invoked with one argument: (value).+ *+ * @static+ * @memberOf _+ * @since 4.0.0+ * @category Math+ * @param {Array} array The array to iterate over.+ * @param {Function} [iteratee=_.identity] The iteratee invoked per element.+ * @returns {number} Returns the sum.+ * @example+ *+ * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];+ *+ * _.sumBy(objects, function(o) { return o.n; });+ * // => 20+ *+ * // The `_.property` iteratee shorthand.+ * _.sumBy(objects, 'n');+ * // => 20+ */+ function sumBy(array, iteratee) {+ return (array && array.length)+ ? baseSum(array, getIteratee(iteratee, 2))+ : 0;+ }++ /*------------------------------------------------------------------------*/++ // Add methods that return wrapped values in chain sequences.+ lodash.after = after;+ lodash.ary = ary;+ lodash.assign = assign;+ lodash.assignIn = assignIn;+ lodash.assignInWith = assignInWith;+ lodash.assignWith = assignWith;+ lodash.at = at;+ lodash.before = before;+ lodash.bind = bind;+ lodash.bindAll = bindAll;+ lodash.bindKey = bindKey;+ lodash.castArray = castArray;+ lodash.chain = chain;+ lodash.chunk = chunk;+ lodash.compact = compact;+ lodash.concat = concat;+ lodash.cond = cond;+ lodash.conforms = conforms;+ lodash.constant = constant;+ lodash.countBy = countBy;+ lodash.create = create;+ lodash.curry = curry;+ lodash.curryRight = curryRight;+ lodash.debounce = debounce;+ lodash.defaults = defaults;+ lodash.defaultsDeep = defaultsDeep;+ lodash.defer = defer;+ lodash.delay = delay;+ lodash.difference = difference;+ lodash.differenceBy = differenceBy;+ lodash.differenceWith = differenceWith;+ lodash.drop = drop;+ lodash.dropRight = dropRight;+ lodash.dropRightWhile = dropRightWhile;+ lodash.dropWhile = dropWhile;+ lodash.fill = fill;+ lodash.filter = filter;+ lodash.flatMap = flatMap;+ lodash.flatMapDeep = flatMapDeep;+ lodash.flatMapDepth = flatMapDepth;+ lodash.flatten = flatten;+ lodash.flattenDeep = flattenDeep;+ lodash.flattenDepth = flattenDepth;+ lodash.flip = flip;+ lodash.flow = flow;+ lodash.flowRight = flowRight;+ lodash.fromPairs = fromPairs;+ lodash.functions = functions;+ lodash.functionsIn = functionsIn;+ lodash.groupBy = groupBy;+ lodash.initial = initial;+ lodash.intersection = intersection;+ lodash.intersectionBy = intersectionBy;+ lodash.intersectionWith = intersectionWith;+ lodash.invert = invert;+ lodash.invertBy = invertBy;+ lodash.invokeMap = invokeMap;+ lodash.iteratee = iteratee;+ lodash.keyBy = keyBy;+ lodash.keys = keys;+ lodash.keysIn = keysIn;+ lodash.map = map;+ lodash.mapKeys = mapKeys;+ lodash.mapValues = mapValues;+ lodash.matches = matches;+ lodash.matchesProperty = matchesProperty;+ lodash.memoize = memoize;+ lodash.merge = merge;+ lodash.mergeWith = mergeWith;+ lodash.method = method;+ lodash.methodOf = methodOf;+ lodash.mixin = mixin;+ lodash.negate = negate;+ lodash.nthArg = nthArg;+ lodash.omit = omit;+ lodash.omitBy = omitBy;+ lodash.once = once;+ lodash.orderBy = orderBy;+ lodash.over = over;+ lodash.overArgs = overArgs;+ lodash.overEvery = overEvery;+ lodash.overSome = overSome;+ lodash.partial = partial;+ lodash.partialRight = partialRight;+ lodash.partition = partition;+ lodash.pick = pick;+ lodash.pickBy = pickBy;+ lodash.property = property;+ lodash.propertyOf = propertyOf;+ lodash.pull = pull;+ lodash.pullAll = pullAll;+ lodash.pullAllBy = pullAllBy;+ lodash.pullAllWith = pullAllWith;+ lodash.pullAt = pullAt;+ lodash.range = range;+ lodash.rangeRight = rangeRight;+ lodash.rearg = rearg;+ lodash.reject = reject;+ lodash.remove = remove;+ lodash.rest = rest;+ lodash.reverse = reverse;+ lodash.sampleSize = sampleSize;+ lodash.set = set;+ lodash.setWith = setWith;+ lodash.shuffle = shuffle;+ lodash.slice = slice;+ lodash.sortBy = sortBy;+ lodash.sortedUniq = sortedUniq;+ lodash.sortedUniqBy = sortedUniqBy;+ lodash.split = split;+ lodash.spread = spread;+ lodash.tail = tail;+ lodash.take = take;+ lodash.takeRight = takeRight;+ lodash.takeRightWhile = takeRightWhile;+ lodash.takeWhile = takeWhile;+ lodash.tap = tap;+ lodash.throttle = throttle;+ lodash.thru = thru;+ lodash.toArray = toArray;+ lodash.toPairs = toPairs;+ lodash.toPairsIn = toPairsIn;+ lodash.toPath = toPath;+ lodash.toPlainObject = toPlainObject;+ lodash.transform = transform;+ lodash.unary = unary;+ lodash.union = union;+ lodash.unionBy = unionBy;+ lodash.unionWith = unionWith;+ lodash.uniq = uniq;+ lodash.uniqBy = uniqBy;+ lodash.uniqWith = uniqWith;+ lodash.unset = unset;+ lodash.unzip = unzip;+ lodash.unzipWith = unzipWith;+ lodash.update = update;+ lodash.updateWith = updateWith;+ lodash.values = values;+ lodash.valuesIn = valuesIn;+ lodash.without = without;+ lodash.words = words;+ lodash.wrap = wrap;+ lodash.xor = xor;+ lodash.xorBy = xorBy;+ lodash.xorWith = xorWith;+ lodash.zip = zip;+ lodash.zipObject = zipObject;+ lodash.zipObjectDeep = zipObjectDeep;+ lodash.zipWith = zipWith;++ // Add aliases.+ lodash.entries = toPairs;+ lodash.entriesIn = toPairsIn;+ lodash.extend = assignIn;+ lodash.extendWith = assignInWith;++ // Add methods to `lodash.prototype`.+ mixin(lodash, lodash);++ /*------------------------------------------------------------------------*/++ // Add methods that return unwrapped values in chain sequences.+ lodash.add = add;+ lodash.attempt = attempt;+ lodash.camelCase = camelCase;+ lodash.capitalize = capitalize;+ lodash.ceil = ceil;+ lodash.clamp = clamp;+ lodash.clone = clone;+ lodash.cloneDeep = cloneDeep;+ lodash.cloneDeepWith = cloneDeepWith;+ lodash.cloneWith = cloneWith;+ lodash.conformsTo = conformsTo;+ lodash.deburr = deburr;+ lodash.defaultTo = defaultTo;+ lodash.divide = divide;+ lodash.endsWith = endsWith;+ lodash.eq = eq;+ lodash.escape = escape;+ lodash.escapeRegExp = escapeRegExp;+ lodash.every = every;+ lodash.find = find;+ lodash.findIndex = findIndex;+ lodash.findKey = findKey;+ lodash.findLast = findLast;+ lodash.findLastIndex = findLastIndex;+ lodash.findLastKey = findLastKey;+ lodash.floor = floor;+ lodash.forEach = forEach;+ lodash.forEachRight = forEachRight;+ lodash.forIn = forIn;+ lodash.forInRight = forInRight;+ lodash.forOwn = forOwn;+ lodash.forOwnRight = forOwnRight;+ lodash.get = get;+ lodash.gt = gt;+ lodash.gte = gte;+ lodash.has = has;+ lodash.hasIn = hasIn;+ lodash.head = head;+ lodash.identity = identity;+ lodash.includes = includes;+ lodash.indexOf = indexOf;+ lodash.inRange = inRange;+ lodash.invoke = invoke;+ lodash.isArguments = isArguments;+ lodash.isArray = isArray;+ lodash.isArrayBuffer = isArrayBuffer;+ lodash.isArrayLike = isArrayLike;+ lodash.isArrayLikeObject = isArrayLikeObject;+ lodash.isBoolean = isBoolean;+ lodash.isBuffer = isBuffer;+ lodash.isDate = isDate;+ lodash.isElement = isElement;+ lodash.isEmpty = isEmpty;+ lodash.isEqual = isEqual;+ lodash.isEqualWith = isEqualWith;+ lodash.isError = isError;+ lodash.isFinite = isFinite;+ lodash.isFunction = isFunction;+ lodash.isInteger = isInteger;+ lodash.isLength = isLength;+ lodash.isMap = isMap;+ lodash.isMatch = isMatch;+ lodash.isMatchWith = isMatchWith;+ lodash.isNaN = isNaN;+ lodash.isNative = isNative;+ lodash.isNil = isNil;+ lodash.isNull = isNull;+ lodash.isNumber = isNumber;+ lodash.isObject = isObject;+ lodash.isObjectLike = isObjectLike;+ lodash.isPlainObject = isPlainObject;+ lodash.isRegExp = isRegExp;+ lodash.isSafeInteger = isSafeInteger;+ lodash.isSet = isSet;+ lodash.isString = isString;+ lodash.isSymbol = isSymbol;+ lodash.isTypedArray = isTypedArray;+ lodash.isUndefined = isUndefined;+ lodash.isWeakMap = isWeakMap;+ lodash.isWeakSet = isWeakSet;+ lodash.join = join;+ lodash.kebabCase = kebabCase;+ lodash.last = last;+ lodash.lastIndexOf = lastIndexOf;+ lodash.lowerCase = lowerCase;+ lodash.lowerFirst = lowerFirst;+ lodash.lt = lt;+ lodash.lte = lte;+ lodash.max = max;+ lodash.maxBy = maxBy;+ lodash.mean = mean;+ lodash.meanBy = meanBy;+ lodash.min = min;+ lodash.minBy = minBy;+ lodash.stubArray = stubArray;+ lodash.stubFalse = stubFalse;+ lodash.stubObject = stubObject;+ lodash.stubString = stubString;+ lodash.stubTrue = stubTrue;+ lodash.multiply = multiply;+ lodash.nth = nth;+ lodash.noConflict = noConflict;+ lodash.noop = noop;+ lodash.now = now;+ lodash.pad = pad;+ lodash.padEnd = padEnd;+ lodash.padStart = padStart;+ lodash.parseInt = parseInt;+ lodash.random = random;+ lodash.reduce = reduce;+ lodash.reduceRight = reduceRight;+ lodash.repeat = repeat;+ lodash.replace = replace;+ lodash.result = result;+ lodash.round = round;+ lodash.runInContext = runInContext;+ lodash.sample = sample;+ lodash.size = size;+ lodash.snakeCase = snakeCase;+ lodash.some = some;+ lodash.sortedIndex = sortedIndex;+ lodash.sortedIndexBy = sortedIndexBy;+ lodash.sortedIndexOf = sortedIndexOf;+ lodash.sortedLastIndex = sortedLastIndex;+ lodash.sortedLastIndexBy = sortedLastIndexBy;+ lodash.sortedLastIndexOf = sortedLastIndexOf;+ lodash.startCase = startCase;+ lodash.startsWith = startsWith;+ lodash.subtract = subtract;+ lodash.sum = sum;+ lodash.sumBy = sumBy;+ lodash.template = template;+ lodash.times = times;+ lodash.toFinite = toFinite;+ lodash.toInteger = toInteger;+ lodash.toLength = toLength;+ lodash.toLower = toLower;+ lodash.toNumber = toNumber;+ lodash.toSafeInteger = toSafeInteger;+ lodash.toString = toString;+ lodash.toUpper = toUpper;+ lodash.trim = trim;+ lodash.trimEnd = trimEnd;+ lodash.trimStart = trimStart;+ lodash.truncate = truncate;+ lodash.unescape = unescape;+ lodash.uniqueId = uniqueId;+ lodash.upperCase = upperCase;+ lodash.upperFirst = upperFirst;++ // Add aliases.+ lodash.each = forEach;+ lodash.eachRight = forEachRight;+ lodash.first = head;++ mixin(lodash, (function() {+ var source = {};+ baseForOwn(lodash, function(func, methodName) {+ if (!hasOwnProperty.call(lodash.prototype, methodName)) {+ source[methodName] = func;+ }+ });+ return source;+ }()), { 'chain': false });++ /*------------------------------------------------------------------------*/++ /**+ * The semantic version number.+ *+ * @static+ * @memberOf _+ * @type {string}+ */+ lodash.VERSION = VERSION;++ // Assign default placeholders.+ arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {+ lodash[methodName].placeholder = lodash;+ });++ // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.+ arrayEach(['drop', 'take'], function(methodName, index) {+ LazyWrapper.prototype[methodName] = function(n) {+ n = n === undefined ? 1 : nativeMax(toInteger(n), 0);++ var result = (this.__filtered__ && !index)+ ? new LazyWrapper(this)+ : this.clone();++ if (result.__filtered__) {+ result.__takeCount__ = nativeMin(n, result.__takeCount__);+ } else {+ result.__views__.push({+ 'size': nativeMin(n, MAX_ARRAY_LENGTH),+ 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')+ });+ }+ return result;+ };++ LazyWrapper.prototype[methodName + 'Right'] = function(n) {+ return this.reverse()[methodName](n).reverse();+ };+ });++ // Add `LazyWrapper` methods that accept an `iteratee` value.+ arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {+ var type = index + 1,+ isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;++ LazyWrapper.prototype[methodName] = function(iteratee) {+ var result = this.clone();+ result.__iteratees__.push({+ 'iteratee': getIteratee(iteratee, 3),+ 'type': type+ });+ result.__filtered__ = result.__filtered__ || isFilter;+ return result;+ };+ });++ // Add `LazyWrapper` methods for `_.head` and `_.last`.+ arrayEach(['head', 'last'], function(methodName, index) {+ var takeName = 'take' + (index ? 'Right' : '');++ LazyWrapper.prototype[methodName] = function() {+ return this[takeName](1).value()[0];+ };+ });++ // Add `LazyWrapper` methods for `_.initial` and `_.tail`.+ arrayEach(['initial', 'tail'], function(methodName, index) {+ var dropName = 'drop' + (index ? '' : 'Right');++ LazyWrapper.prototype[methodName] = function() {+ return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);+ };+ });++ LazyWrapper.prototype.compact = function() {+ return this.filter(identity);+ };++ LazyWrapper.prototype.find = function(predicate) {+ return this.filter(predicate).head();+ };++ LazyWrapper.prototype.findLast = function(predicate) {+ return this.reverse().find(predicate);+ };++ LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {+ if (typeof path == 'function') {+ return new LazyWrapper(this);+ }+ return this.map(function(value) {+ return baseInvoke(value, path, args);+ });+ });++ LazyWrapper.prototype.reject = function(predicate) {+ return this.filter(negate(getIteratee(predicate)));+ };++ LazyWrapper.prototype.slice = function(start, end) {+ start = toInteger(start);++ var result = this;+ if (result.__filtered__ && (start > 0 || end < 0)) {+ return new LazyWrapper(result);+ }+ if (start < 0) {+ result = result.takeRight(-start);+ } else if (start) {+ result = result.drop(start);+ }+ if (end !== undefined) {+ end = toInteger(end);+ result = end < 0 ? result.dropRight(-end) : result.take(end - start);+ }+ return result;+ };++ LazyWrapper.prototype.takeRightWhile = function(predicate) {+ return this.reverse().takeWhile(predicate).reverse();+ };++ LazyWrapper.prototype.toArray = function() {+ return this.take(MAX_ARRAY_LENGTH);+ };++ // Add `LazyWrapper` methods to `lodash.prototype`.+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {+ var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),+ isTaker = /^(?:head|last)$/.test(methodName),+ lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],+ retUnwrapped = isTaker || /^find/.test(methodName);++ if (!lodashFunc) {+ return;+ }+ lodash.prototype[methodName] = function() {+ var value = this.__wrapped__,+ args = isTaker ? [1] : arguments,+ isLazy = value instanceof LazyWrapper,+ iteratee = args[0],+ useLazy = isLazy || isArray(value);++ var interceptor = function(value) {+ var result = lodashFunc.apply(lodash, arrayPush([value], args));+ return (isTaker && chainAll) ? result[0] : result;+ };++ if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {+ // Avoid lazy use if the iteratee has a "length" value other than `1`.+ isLazy = useLazy = false;+ }+ var chainAll = this.__chain__,+ isHybrid = !!this.__actions__.length,+ isUnwrapped = retUnwrapped && !chainAll,+ onlyLazy = isLazy && !isHybrid;++ if (!retUnwrapped && useLazy) {+ value = onlyLazy ? value : new LazyWrapper(this);+ var result = func.apply(value, args);+ result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });+ return new LodashWrapper(result, chainAll);+ }+ if (isUnwrapped && onlyLazy) {+ return func.apply(this, args);+ }+ result = this.thru(interceptor);+ return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;+ };+ });++ // Add `Array` methods to `lodash.prototype`.+ arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {+ var func = arrayProto[methodName],+ chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',+ retUnwrapped = /^(?:pop|shift)$/.test(methodName);++ lodash.prototype[methodName] = function() {+ var args = arguments;+ if (retUnwrapped && !this.__chain__) {+ var value = this.value();+ return func.apply(isArray(value) ? value : [], args);+ }+ return this[chainName](function(value) {+ return func.apply(isArray(value) ? value : [], args);+ });+ };+ });++ // Map minified method names to their real names.+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {+ var lodashFunc = lodash[methodName];+ if (lodashFunc) {+ var key = (lodashFunc.name + ''),+ names = realNames[key] || (realNames[key] = []);++ names.push({ 'name': methodName, 'func': lodashFunc });+ }+ });++ realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{+ 'name': 'wrapper',+ 'func': undefined+ }];++ // Add methods to `LazyWrapper`.+ LazyWrapper.prototype.clone = lazyClone;+ LazyWrapper.prototype.reverse = lazyReverse;+ LazyWrapper.prototype.value = lazyValue;++ // Add chain sequence methods to the `lodash` wrapper.+ lodash.prototype.at = wrapperAt;+ lodash.prototype.chain = wrapperChain;+ lodash.prototype.commit = wrapperCommit;+ lodash.prototype.next = wrapperNext;+ lodash.prototype.plant = wrapperPlant;+ lodash.prototype.reverse = wrapperReverse;+ lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;++ // Add lazy aliases.+ lodash.prototype.first = lodash.prototype.head;++ if (symIterator) {+ lodash.prototype[symIterator] = wrapperToIterator;+ }+ return lodash;+ });++ /*--------------------------------------------------------------------------*/++ // Export lodash.+ var _ = runInContext();++ // Some AMD build optimizers, like r.js, check for condition patterns like:+ if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {+ // Expose Lodash on the global object to prevent errors when Lodash is+ // loaded by a script tag in the presence of an AMD loader.+ // See http://requirejs.org/docs/errors.html#mismatch for more details.+ // Use `_.noConflict` to remove Lodash from the global object.+ root._ = _;++ // Define as an anonymous module so, through path mapping, it can be+ // referenced as the "underscore" module.+ define(function() {+ return _;+ });+ }+ // Check for `exports` after `define` in case a build optimizer adds it.+ else if (freeModule) {+ // Export for Node.js.+ (freeModule.exports = _)._ = _;+ // Export for CommonJS support.+ freeExports._ = _;+ }+ else {+ // Export to the global object.+ root._ = _;+ }+}.call(this));diff --git a/web/ext/node_modules/lodash/lodash.min.js b/web/ext/node_modules/lodash/lodash.min.jsnew file mode 100644index 000000000..ca447f4e8--- /dev/null+++ b/web/ext/node_modules/lodash/lodash.min.js@@ -0,0 +1,136 @@+/**+ * @license+ * Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE+ */+;(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&false!==t(n[r],r,n););return n}function i(n,t){for(var r=null==n?0:n.length;r--&&false!==t(n[r],r,n););+return n}function o(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function f(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function c(n,t){return!(null==n||!n.length)&&-1<d(n,t,0)}function a(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return true;return false}function l(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function s(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];+return n}function h(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function p(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function _(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return true;return false}function v(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,false}),e}function g(n,t,r,e){var u=n.length;for(r+=e?1:-1;e?r--:++r<u;)if(t(n[r],r,n))return r;return-1}function d(n,t,r){if(t===t)n:{+--r;for(var e=n.length;++r<e;)if(n[r]===t){n=r;break n}n=-1}else n=g(n,b,r);return n}function y(n,t,r,e){--r;for(var u=n.length;++r<u;)if(e(n[r],t))return r;return-1}function b(n){return n!==n}function x(n,t){var r=null==n?0:n.length;return r?k(n,t)/r:P}function j(n){return function(t){return null==t?F:t[n]}}function w(n){return function(t){return null==n?F:n[t]}}function m(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=false,n):t(r,n,u,i)}),r}function A(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;+return n}function k(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==F&&(r=r===F?i:r+i)}return r}function E(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function O(n,t){return l(t,function(t){return[t,n[t]]})}function S(n){return function(t){return n(t)}}function I(n,t){return l(t,function(t){return n[t]})}function R(n,t){return n.has(t)}function z(n,t){for(var r=-1,e=n.length;++r<e&&-1<d(t,n[r],0););return r}function W(n,t){for(var r=n.length;r--&&-1<d(t,n[r],0););return r}function B(n){+return"\\"+Tn[n]}function L(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function U(n,t){return function(r){return n(t(r))}}function C(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&"__lodash_placeholder__"!==o||(n[r]="__lodash_placeholder__",i[u++]=r)}return i}function D(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function T(n){if(Bn.test(n)){+for(var t=zn.lastIndex=0;zn.test(n);)++t;n=t}else n=tt(n);return n}function $(n){return Bn.test(n)?n.match(zn)||[]:n.split("")}var F,N=1/0,P=NaN,Z=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],q=/\b__p\+='';/g,V=/\b(__p\+=)''\+/g,K=/(__e\(.*?\)|\b__t\))\+'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,J=RegExp(G.source),Y=RegExp(H.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/^\./,un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,on=/[\\^$.*+?()[\]{}|]/g,fn=RegExp(on.source),cn=/^\s+|\s+$/g,an=/^\s+/,ln=/\s+$/,sn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hn=/\{\n\/\* \[wrapped with (.+)\] \*/,pn=/,? & /,_n=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,vn=/\\(\\)?/g,gn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dn=/\w*$/,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,xn=/^\[object .+?Constructor\]$/,jn=/^0o[0-7]+$/i,wn=/^(?:0|[1-9]\d*)$/,mn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,An=/($^)/,kn=/['\n\r\u2028\u2029\\]/g,En="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",On="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+En,Sn="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",In=RegExp("['\u2019]","g"),Rn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),zn=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+Sn+En,"g"),Wn=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)|\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)|\\d+",On].join("|"),"g"),Bn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),Ln=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Un="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Cn={};+Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true,Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object DataView]"]=Cn["[object Date]"]=Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object WeakMap]"]=false;+var Dn={};Dn["[object Arguments]"]=Dn["[object Array]"]=Dn["[object ArrayBuffer]"]=Dn["[object DataView]"]=Dn["[object Boolean]"]=Dn["[object Date]"]=Dn["[object Float32Array]"]=Dn["[object Float64Array]"]=Dn["[object Int8Array]"]=Dn["[object Int16Array]"]=Dn["[object Int32Array]"]=Dn["[object Map]"]=Dn["[object Number]"]=Dn["[object Object]"]=Dn["[object RegExp]"]=Dn["[object Set]"]=Dn["[object String]"]=Dn["[object Symbol]"]=Dn["[object Uint8Array]"]=Dn["[object Uint8ClampedArray]"]=Dn["[object Uint16Array]"]=Dn["[object Uint32Array]"]=true,+Dn["[object Error]"]=Dn["[object Function]"]=Dn["[object WeakMap]"]=false;var Mn,Tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$n=parseFloat,Fn=parseInt,Nn=typeof global=="object"&&global&&global.Object===Object&&global,Pn=typeof self=="object"&&self&&self.Object===Object&&self,Zn=Nn||Pn||Function("return this")(),qn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vn=qn&&typeof module=="object"&&module&&!module.nodeType&&module,Kn=Vn&&Vn.exports===qn,Gn=Kn&&Nn.process;+n:{try{Mn=Gn&&Gn.binding&&Gn.binding("util");break n}catch(n){}Mn=void 0}var Hn=Mn&&Mn.isArrayBuffer,Jn=Mn&&Mn.isDate,Yn=Mn&&Mn.isMap,Qn=Mn&&Mn.isRegExp,Xn=Mn&&Mn.isSet,nt=Mn&&Mn.isTypedArray,tt=j("length"),rt=w({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I",+"\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C",+"\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i",+"\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S",+"\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe",+"\u0149":"'n","\u017f":"s"}),et=w({"&":"&","<":"<",">":">",'"':""","'":"'"}),ut=w({"&":"&","<":"<",">":">",""":'"',"'":"'"}),it=function w(En){function On(n){if(xu(n)&&!af(n)&&!(n instanceof Mn)){if(n instanceof zn)return n;if(ci.call(n,"__wrapped__"))return Pe(n)}return new zn(n)}function Sn(){}function zn(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=F}function Mn(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,+this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Tn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Nn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Pn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function qn(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Pn;++t<r;)this.add(n[t])}function Vn(n){+this.size=(this.__data__=new Nn(n)).size}function Gn(n,t){var r,e=af(n),u=!e&&cf(n),i=!e&&!u&&sf(n),o=!e&&!u&&!i&&gf(n),u=(e=e||u||i||o)?E(n.length,ri):[],f=u.length;for(r in n)!t&&!ci.call(n,r)||e&&("length"==r||i&&("offset"==r||"parent"==r)||o&&("buffer"==r||"byteLength"==r||"byteOffset"==r)||Re(r,f))||u.push(r);return u}function tt(n){var t=n.length;return t?n[cr(0,t-1)]:F}function ot(n,t){return Te(Mr(n),gt(t,0,n.length))}function ft(n){return Te(Mr(n))}function ct(n,t,r){(r===F||hu(n[t],r))&&(r!==F||t in n)||_t(n,t,r);+}function at(n,t,r){var e=n[t];ci.call(n,t)&&hu(e,r)&&(r!==F||t in n)||_t(n,t,r)}function lt(n,t){for(var r=n.length;r--;)if(hu(n[r][0],t))return r;return-1}function st(n,t,r,e){return oo(n,function(n,u,i){t(e,n,r(n),i)}),e}function ht(n,t){return n&&Tr(t,Lu(t),n)}function pt(n,t){return n&&Tr(t,Uu(t),n)}function _t(n,t,r){"__proto__"==t&&Ei?Ei(n,t,{configurable:true,enumerable:true,value:r,writable:true}):n[t]=r}function vt(n,t){for(var r=-1,e=t.length,u=Hu(e),i=null==n;++r<e;)u[r]=i?F:Wu(n,t[r]);return u;+}function gt(n,t,r){return n===n&&(r!==F&&(n=n<=r?n:r),t!==F&&(n=n>=t?n:t)),n}function dt(n,t,r,e,i,o){var f,c=1&t,a=2&t,l=4&t;if(r&&(f=i?r(n,e,i,o):r(n)),f!==F)return f;if(!bu(n))return n;if(e=af(n)){if(f=Ee(n),!c)return Mr(n,f)}else{var s=yo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(sf(n))return Wr(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Oe(n),!c)return a?Fr(n,pt(f,n)):$r(n,ht(f,n))}else{if(!Dn[s])return i?n:{};f=Se(n,s,dt,c)}}if(o||(o=new Vn),+i=o.get(n))return i;o.set(n,f);var a=l?a?ye:de:a?Uu:Lu,p=e?F:a(n);return u(p||n,function(e,u){p&&(u=e,e=n[u]),at(f,u,dt(e,t,r,u,n,o))}),f}function yt(n){var t=Lu(n);return function(r){return bt(r,n,t)}}function bt(n,t,r){var e=r.length;if(null==n)return!e;for(n=ni(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===F&&!(u in n)||!i(o))return false}return true}function xt(n,t,r){if(typeof n!="function")throw new ei("Expected a function");return jo(function(){n.apply(F,r)},t)}function jt(n,t,r,e){var u=-1,i=c,o=true,f=n.length,s=[],h=t.length;+if(!f)return s;r&&(t=l(t,S(r))),e?(i=a,o=false):200<=t.length&&(i=R,o=false,t=new qn(t));n:for(;++u<f;){var p=n[u],_=null==r?p:r(p),p=e||0!==p?p:0;if(o&&_===_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function wt(n,t){var r=true;return oo(n,function(n,e,u){return r=!!t(n,e,u)}),r}function mt(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===F?o===o&&!Au(o):r(o,f)))var f=o,c=i}return c}function At(n,t){var r=[];return oo(n,function(n,e,u){+t(n,e,u)&&r.push(n)}),r}function kt(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Ie),u||(u=[]);++i<o;){var f=n[i];0<t&&r(f)?1<t?kt(f,t-1,r,e,u):s(u,f):e||(u[u.length]=f)}return u}function Et(n,t){return n&&co(n,t,Lu)}function Ot(n,t){return n&&ao(n,t,Lu)}function St(n,t){return f(t,function(t){return gu(n[t])})}function It(n,t){t=Rr(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[$e(t[r++])];return r&&r==e?n:F}function Rt(n,t,r){return t=t(n),af(n)?t:s(t,r(n))}function zt(n){if(null==n)n=n===F?"[object Undefined]":"[object Null]";else if(ki&&ki in ni(n)){+var t=ci.call(n,ki),r=n[ki];try{n[ki]=F;var e=true}catch(n){}var u=si.call(n);e&&(t?n[ki]=r:delete n[ki]),n=u}else n=si.call(n);return n}function Wt(n,t){return n>t}function Bt(n,t){return null!=n&&ci.call(n,t)}function Lt(n,t){return null!=n&&t in ni(n)}function Ut(n,t,r){for(var e=r?a:c,u=n[0].length,i=n.length,o=i,f=Hu(i),s=1/0,h=[];o--;){var p=n[o];o&&t&&(p=l(p,S(t))),s=Mi(p.length,s),f[o]=!r&&(t||120<=u&&120<=p.length)?new qn(o&&p):F}var p=n[0],_=-1,v=f[0];n:for(;++_<u&&h.length<s;){var g=p[_],d=t?t(g):g,g=r||0!==g?g:0;+if(v?!R(v,d):!e(h,d,r)){for(o=i;--o;){var y=f[o];if(y?!R(y,d):!e(n[o],d,r))continue n}v&&v.push(d),h.push(g)}}return h}function Ct(n,t,r){var e={};return Et(n,function(n,u,i){t(e,r(n),u,i)}),e}function Dt(n,t,e){return t=Rr(t,n),n=2>t.length?n:It(n,vr(t,0,-1)),t=null==n?n:n[$e(Ge(t))],null==t?F:r(t,n,e)}function Mt(n){return xu(n)&&"[object Arguments]"==zt(n)}function Tt(n){return xu(n)&&"[object ArrayBuffer]"==zt(n)}function $t(n){return xu(n)&&"[object Date]"==zt(n)}function Ft(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!xu(n)&&!xu(t))t=n!==n&&t!==t;else n:{+var i=af(n),o=af(t),f=i?"[object Array]":yo(n),c=o?"[object Array]":yo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&sf(n)){if(!sf(t)){t=false;break n}i=true,a=false}if(c&&!a)u||(u=new Vn),t=i||gf(n)?_e(n,t,r,e,Ft,u):ve(n,t,f,r,e,Ft,u);else{if(!(1&r)&&(i=a&&ci.call(n,"__wrapped__"),f=o&&ci.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Vn),t=Ft(n,t,r,e,u);break n}if(c)t:if(u||(u=new Vn),+i=1&r,f=de(n),o=f.length,c=de(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:ci.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++a<o;){var l=f[a],h=n[l],p=t[l];if(e)var _=i?e(p,h,l,t,n,u):e(h,p,l,n,t,u);if(_===F?h!==p&&!Ft(h,p,r,e,u):!_){c=false;break}s||(s="constructor"==l)}c&&!s&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(c=false)),+u.delete(n),u.delete(t),t=c}}else t=false;else t=false}}return t}function Nt(n){return xu(n)&&"[object Map]"==yo(n)}function Pt(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=ni(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return false}for(;++u<i;){var f=r[u],c=f[0],a=n[c],l=f[1];if(o&&f[2]){if(a===F&&!(c in n))return false}else{if(f=new Vn,e)var s=e(a,l,c,n,t,f);if(s===F?!Ft(l,a,3,e,f):!s)return false}}return true}function Zt(n){return!(!bu(n)||li&&li in n)&&(gu(n)?_i:xn).test(Fe(n))}function qt(n){+return xu(n)&&"[object RegExp]"==zt(n)}function Vt(n){return xu(n)&&"[object Set]"==yo(n)}function Kt(n){return xu(n)&&yu(n.length)&&!!Cn[zt(n)]}function Gt(n){return typeof n=="function"?n:null==n?Nu:typeof n=="object"?af(n)?Xt(n[0],n[1]):Qt(n):Vu(n)}function Ht(n){if(!Le(n))return Ci(n);var t,r=[];for(t in ni(n))ci.call(n,t)&&"constructor"!=t&&r.push(t);return r}function Jt(n,t){return n<t}function Yt(n,t){var r=-1,e=pu(n)?Hu(n.length):[];return oo(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Qt(n){+var t=me(n);return 1==t.length&&t[0][2]?Ue(t[0][0],t[0][1]):function(r){return r===n||Pt(r,n,t)}}function Xt(n,t){return We(n)&&t===t&&!bu(t)?Ue($e(n),t):function(r){var e=Wu(r,n);return e===F&&e===t?Bu(r,n):Ft(t,e,3)}}function nr(n,t,r,e,u){n!==t&&co(t,function(i,o){if(bu(i)){u||(u=new Vn);var f=u,c=n[o],a=t[o],l=f.get(a);if(l)ct(n,o,l);else{var l=e?e(c,a,o+"",n,t,f):F,s=l===F;if(s){var h=af(a),p=!h&&sf(a),_=!h&&!p&&gf(a),l=a;h||p||_?af(c)?l=c:_u(c)?l=Mr(c):p?(s=false,l=Wr(a,true)):_?(s=false,l=Lr(a,true)):l=[]:wu(a)||cf(a)?(l=c,+cf(c)?l=Ru(c):(!bu(c)||r&&gu(c))&&(l=Oe(a))):s=false}s&&(f.set(a,l),nr(l,a,r,e,f),f.delete(a)),ct(n,o,l)}}else f=e?e(n[o],i,o+"",n,t,u):F,f===F&&(f=i),ct(n,o,f)},Uu)}function tr(n,t){var r=n.length;if(r)return t+=0>t?r:0,Re(t,r)?n[t]:F}function rr(n,t,r){var e=-1;return t=l(t.length?t:[Nu],S(je())),n=Yt(n,function(n){return{a:l(t,function(t){return t(n)}),b:++e,c:n}}),A(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e<o;){var c=Ur(u[e],i[e]);if(c){e=e>=f?c:c*("desc"==r[e]?-1:1);+break n}}e=n.b-t.b}return e})}function er(n,t){return ur(n,t,function(t,r){return Bu(n,r)})}function ur(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=It(n,o);r(f,o)&&pr(i,Rr(o,n),f)}return i}function ir(n){return function(t){return It(t,n)}}function or(n,t,r,e){var u=e?y:d,i=-1,o=t.length,f=n;for(n===t&&(t=Mr(t)),r&&(f=l(n,S(r)));++i<o;)for(var c=0,a=t[i],a=r?r(a):a;-1<(c=u(f,a,c,e));)f!==n&&wi.call(f,c,1),wi.call(n,c,1);return n}function fr(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];+if(r==e||u!==i){var i=u;Re(u)?wi.call(n,u,1):mr(n,u)}}}function cr(n,t){return n+zi(Fi()*(t-n+1))}function ar(n,t){var r="";if(!n||1>t||9007199254740991<t)return r;do t%2&&(r+=n),(t=zi(t/2))&&(n+=n);while(t);return r}function lr(n,t){return wo(Ce(n,t,Nu),n+"")}function sr(n){return tt(Du(n))}function hr(n,t){var r=Du(n);return Te(r,gt(t,0,r.length))}function pr(n,t,r,e){if(!bu(n))return n;t=Rr(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++u<i;){var c=$e(t[u]),a=r;if(u!=o){var l=f[c],a=e?e(l,c,f):F;+a===F&&(a=bu(l)?l:Re(t[u+1])?[]:{})}at(f,c,a),f=f[c]}return n}function _r(n){return Te(Du(n))}function vr(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Hu(u);++e<u;)r[e]=n[e+t];return r}function gr(n,t){var r;return oo(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function dr(n,t,r){var e=0,u=null==n?e:n.length;if(typeof t=="number"&&t===t&&2147483647>=u){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!Au(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return yr(n,t,Nu,r);+}function yr(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!==t,f=null===t,c=Au(t),a=t===F;u<i;){var l=zi((u+i)/2),s=r(n[l]),h=s!==F,p=null===s,_=s===s,v=Au(s);(o?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?s<=t:s<t)?u=l+1:i=l}return Mi(i,4294967294)}function br(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!hu(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function xr(n){return typeof n=="number"?n:Au(n)?P:+n}function jr(n){if(typeof n=="string")return n;+if(af(n))return l(n,jr)+"";if(Au(n))return uo?uo.call(n):"";var t=n+"";return"0"==t&&1/n==-N?"-0":t}function wr(n,t,r){var e=-1,u=c,i=n.length,o=true,f=[],l=f;if(r)o=false,u=a;else if(200<=i){if(u=t?null:po(n))return D(u);o=false,u=R,l=new qn}else l=t?[]:f;n:for(;++e<i;){var s=n[e],h=t?t(s):s,s=r||0!==s?s:0;if(o&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue n;t&&l.push(h),f.push(s)}else u(l,h,r)||(l!==f&&l.push(h),f.push(s))}return f}function mr(n,t){return t=Rr(t,n),n=2>t.length?n:It(n,vr(t,0,-1)),+null==n||delete n[$e(Ge(t))]}function Ar(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?vr(n,e?0:i,e?i+1:u):vr(n,e?i+1:0,e?u:i)}function kr(n,t){var r=n;return r instanceof Mn&&(r=r.value()),h(t,function(n,t){return t.func.apply(t.thisArg,s([n],t.args))},r)}function Er(n,t,r){var e=n.length;if(2>e)return e?wr(n[0]):[];for(var u=-1,i=Hu(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=jt(i[u]||o,n[f],t,r));return wr(kt(i,1),t,r)}function Or(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;)r(o,n[e],e<i?t[e]:F);+return o}function Sr(n){return _u(n)?n:[]}function Ir(n){return typeof n=="function"?n:Nu}function Rr(n,t){return af(n)?n:We(n,t)?[n]:mo(zu(n))}function zr(n,t,r){var e=n.length;return r=r===F?e:r,!t&&r>=e?n:vr(n,t,r)}function Wr(n,t){if(t)return n.slice();var r=n.length,r=yi?yi(r):new n.constructor(r);return n.copy(r),r}function Br(n){var t=new n.constructor(n.byteLength);return new di(t).set(new di(n)),t}function Lr(n,t){return new n.constructor(t?Br(n.buffer):n.buffer,n.byteOffset,n.length)}function Ur(n,t){+if(n!==t){var r=n!==F,e=null===n,u=n===n,i=Au(n),o=t!==F,f=null===t,c=t===t,a=Au(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function Cr(n,t,r,e){var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=Di(i-o,0),l=Hu(c+a);for(e=!e;++f<c;)l[f]=t[f];for(;++u<o;)(e||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l}function Dr(n,t,r,e){var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=Di(i-f,0),s=Hu(l+a);+for(e=!e;++u<l;)s[u]=n[u];for(l=u;++c<a;)s[l+c]=t[c];for(;++o<f;)(e||u<i)&&(s[l+r[o]]=n[u++]);return s}function Mr(n,t){var r=-1,e=n.length;for(t||(t=Hu(e));++r<e;)t[r]=n[r];return t}function Tr(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):F;c===F&&(c=n[f]),u?_t(r,f,c):at(r,f,c)}return r}function $r(n,t){return Tr(n,vo(n),t)}function Fr(n,t){return Tr(n,go(n),t)}function Nr(n,t){return function(r,u){var i=af(r)?e:st,o=t?t():{};return i(r,n,je(u,2),o);+}}function Pr(n){return lr(function(t,r){var e=-1,u=r.length,i=1<u?r[u-1]:F,o=2<u?r[2]:F,i=3<n.length&&typeof i=="function"?(u--,i):F;for(o&&ze(r[0],r[1],o)&&(i=3>u?F:i,u=1),t=ni(t);++e<u;)(o=r[e])&&n(t,o,e,i);return t})}function Zr(n,t){return function(r,e){if(null==r)return r;if(!pu(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=ni(r);(t?i--:++i<u)&&false!==e(o[i],i,o););return r}}function qr(n){return function(t,r,e){var u=-1,i=ni(t);e=e(t);for(var o=e.length;o--;){var f=e[n?o:++u];if(false===r(i[f],f,i))break;+}return t}}function Vr(n,t,r){function e(){return(this&&this!==Zn&&this instanceof e?i:n).apply(u?r:this,arguments)}var u=1&t,i=Hr(n);return e}function Kr(n){return function(t){t=zu(t);var r=Bn.test(t)?$(t):F,e=r?r[0]:t.charAt(0);return t=r?zr(r,1).join(""):t.slice(1),e[n]()+t}}function Gr(n){return function(t){return h($u(Tu(t).replace(In,"")),n,"")}}function Hr(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:+return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=io(n.prototype),t=n.apply(r,t);return bu(t)?t:r}}function Jr(n,t,e){function u(){for(var o=arguments.length,f=Hu(o),c=o,a=xe(u);c--;)f[c]=arguments[c];return c=3>o&&f[0]!==a&&f[o-1]!==a?[]:C(f,a),o-=c.length,o<e?fe(n,t,Xr,u.placeholder,F,f,c,F,F,e-o):r(this&&this!==Zn&&this instanceof u?i:n,this,f);+}var i=Hr(n);return u}function Yr(n){return function(t,r,e){var u=ni(t);if(!pu(t)){var i=je(r,3);t=Lu(t),r=function(n){return i(u[n],n,u)}}return r=n(t,r,e),-1<r?u[i?t[r]:r]:F}}function Qr(n){return ge(function(t){var r=t.length,e=r,u=zn.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if(typeof i!="function")throw new ei("Expected a function");if(u&&!o&&"wrapper"==be(i))var o=new zn([],true)}for(e=o?e:r;++e<r;)var i=t[e],u=be(i),f="wrapper"==u?_o(i):F,o=f&&Be(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?o[be(f[0])].apply(o,f[3]):1==i.length&&Be(i)?o[u]():o.thru(i);+return function(){var n=arguments,e=n[0];if(o&&1==n.length&&af(e))return o.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++u<r;)n=t[u].call(this,n);return n}})}function Xr(n,t,r,e,u,i,o,f,c,a){function l(){for(var d=arguments.length,y=Hu(d),b=d;b--;)y[b]=arguments[b];if(_){var x,j=xe(l),b=y.length;for(x=0;b--;)y[b]===j&&++x}if(e&&(y=Cr(y,e,u,_)),i&&(y=Dr(y,i,o,_)),d-=x,_&&d<a)return j=C(y,j),fe(n,t,Xr,l.placeholder,r,y,j,f,c,a-d);if(j=h?r:this,b=p?j[n]:n,d=y.length,f){x=y.length;for(var w=Mi(f.length,x),m=Mr(y);w--;){+var A=f[w];y[w]=Re(A,x)?m[A]:F}}else v&&1<d&&y.reverse();return s&&c<d&&(y.length=c),this&&this!==Zn&&this instanceof l&&(b=g||Hr(b)),b.apply(j,y)}var s=128&t,h=1&t,p=2&t,_=24&t,v=512&t,g=p?F:Hr(n);return l}function ne(n,t){return function(r,e){return Ct(r,n,t(e))}}function te(n,t){return function(r,e){var u;if(r===F&&e===F)return t;if(r!==F&&(u=r),e!==F){if(u===F)return e;typeof r=="string"||typeof e=="string"?(r=jr(r),e=jr(e)):(r=xr(r),e=xr(e)),u=n(r,e)}return u}}function re(n){return ge(function(t){+return t=l(t,S(je())),lr(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function ee(n,t){t=t===F?" ":jr(t);var r=t.length;return 2>r?r?ar(t,n):t:(r=ar(t,Ri(n/T(t))),Bn.test(t)?zr($(r),0,n).join(""):r.slice(0,n))}function ue(n,t,e,u){function i(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Hu(l+c),h=this&&this!==Zn&&this instanceof i?f:n;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++t];return r(h,o?e:this,s)}var o=1&t,f=Hr(n);return i}function ie(n){return function(t,r,e){+e&&typeof e!="number"&&ze(t,r,e)&&(r=e=F),t=Eu(t),r===F?(r=t,t=0):r=Eu(r),e=e===F?t<r?1:-1:Eu(e);var u=-1;r=Di(Ri((r-t)/(e||1)),0);for(var i=Hu(r);r--;)i[n?r:++u]=t,t+=e;return i}}function oe(n){return function(t,r){return typeof t=="string"&&typeof r=="string"||(t=Iu(t),r=Iu(r)),n(t,r)}}function fe(n,t,r,e,u,i,o,f,c,a){var l=8&t,s=l?o:F;o=l?F:o;var h=l?i:F;return i=l?F:i,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),u=[n,t,u,h,s,i,o,f,c,a],r=r.apply(F,u),Be(n)&&xo(r,u),r.placeholder=e,De(r,n,t)}function ce(n){+var t=Xu[n];return function(n,r){if(n=Iu(n),r=null==r?0:Mi(Ou(r),292)){var e=(zu(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(zu(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function ae(n){return function(t){var r=yo(t);return"[object Map]"==r?L(t):"[object Set]"==r?M(t):O(t,n(t))}}function le(n,t,r,e,u,i,o,f){var c=2&t;if(!c&&typeof n!="function")throw new ei("Expected a function");var a=e?e.length:0;if(a||(t&=-97,e=u=F),o=o===F?o:Di(Ou(o),0),f=f===F?f:Ou(f),a-=u?u.length:0,64&t){+var l=e,s=u;e=u=F}var h=c?F:_o(n);return i=[n,t,r,e,u,l,s,i,o,f],h&&(r=i[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&i[7].length<=h[8]||384==n&&h[7].length<=h[8]&&8==r,131>t||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Cr(e,r,h[4]):r,i[4]=e?C(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Dr(e,r,h[6]):r,i[6]=e?C(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Mi(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0],t=i[1],+r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===F?c?0:n.length:Di(i[9]-a,0),!f&&24&t&&(t&=-25),De((h?lo:xo)(t&&1!=t?8==t||16==t?Jr(n,t,f):32!=t&&33!=t||u.length?Xr.apply(F,i):ue(n,t,r,e):Vr(n,t,r),i),n,t)}function se(n,t,r,e){return n===F||hu(n,ii[r])&&!ci.call(e,r)?t:n}function he(n,t,r,e,u,i){return bu(n)&&bu(t)&&(i.set(t,n),nr(n,t,F,he,i),i.delete(t)),n}function pe(n){return wu(n)?F:n}function _e(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t;var c=-1,a=true,l=2&r?new qn:F;+for(i.set(n,t),i.set(t,n);++c<f;){var s=n[c],h=t[c];if(e)var p=o?e(h,s,c,t,n,i):e(s,h,c,n,t,i);if(p!==F){if(p)continue;a=false;break}if(l){if(!_(t,function(n,t){if(!R(l,t)&&(s===n||u(s,n,r,e,i)))return l.push(t)})){a=false;break}}else if(s!==h&&!u(s,h,r,e,i)){a=false;break}}return i.delete(n),i.delete(t),a}function ve(n,t,r,e,u,i,o){switch(r){case"[object DataView]":if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)break;n=n.buffer,t=t.buffer;case"[object ArrayBuffer]":if(n.byteLength!=t.byteLength||!i(new di(n),new di(t)))break;+return true;case"[object Boolean]":case"[object Date]":case"[object Number]":return hu(+n,+t);case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object RegExp]":case"[object String]":return n==t+"";case"[object Map]":var f=L;case"[object Set]":if(f||(f=D),n.size!=t.size&&!(1&e))break;return(r=o.get(n))?r==t:(e|=2,o.set(n,t),t=_e(f(n),f(t),e,u,i,o),o.delete(n),t);case"[object Symbol]":if(eo)return eo.call(n)==eo.call(t)}return false}function ge(n){return wo(Ce(n,F,Ve),n+"")}function de(n){+return Rt(n,Lu,vo)}function ye(n){return Rt(n,Uu,go)}function be(n){for(var t=n.name+"",r=Ji[t],e=ci.call(Ji,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function xe(n){return(ci.call(On,"placeholder")?On:n).placeholder}function je(){var n=On.iteratee||Pu,n=n===Pu?Gt:n;return arguments.length?n(arguments[0],arguments[1]):n}function we(n,t){var r=n.__data__,e=typeof t;return("string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t)?r[typeof t=="string"?"string":"hash"]:r.map;+}function me(n){for(var t=Lu(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,u===u&&!bu(u)]}return t}function Ae(n,t){var r=null==n?F:n[t];return Zt(r)?r:F}function ke(n,t,r){t=Rr(t,n);for(var e=-1,u=t.length,i=false;++e<u;){var o=$e(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&yu(u)&&Re(o,u)&&(af(n)||cf(n)))}function Ee(n){var t=n.length,r=n.constructor(t);return t&&"string"==typeof n[0]&&ci.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Oe(n){+return typeof n.constructor!="function"||Le(n)?{}:io(bi(n))}function Se(r,e,u,i){var o=r.constructor;switch(e){case"[object ArrayBuffer]":return Br(r);case"[object Boolean]":case"[object Date]":return new o(+r);case"[object DataView]":return e=i?Br(r.buffer):r.buffer,new r.constructor(e,r.byteOffset,r.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":+case"[object Uint16Array]":case"[object Uint32Array]":return Lr(r,i);case"[object Map]":return e=i?u(L(r),1):L(r),h(e,n,new r.constructor);case"[object Number]":case"[object String]":return new o(r);case"[object RegExp]":return e=new r.constructor(r.source,dn.exec(r)),e.lastIndex=r.lastIndex,e;case"[object Set]":return e=i?u(D(r),1):D(r),h(e,t,new r.constructor);case"[object Symbol]":return eo?ni(eo.call(r)):{}}}function Ie(n){return af(n)||cf(n)||!!(mi&&n&&n[mi])}function Re(n,t){return t=null==t?9007199254740991:t,+!!t&&(typeof n=="number"||wn.test(n))&&-1<n&&0==n%1&&n<t}function ze(n,t,r){if(!bu(r))return false;var e=typeof t;return!!("number"==e?pu(r)&&Re(t,r.length):"string"==e&&t in r)&&hu(r[t],n)}function We(n,t){if(af(n))return false;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!Au(n))||(rn.test(n)||!tn.test(n)||null!=t&&n in ni(t))}function Be(n){var t=be(n),r=On[t];return typeof r=="function"&&t in Mn.prototype&&(n===r||(t=_o(r),!!t&&n===t[0]))}function Le(n){var t=n&&n.constructor;+return n===(typeof t=="function"&&t.prototype||ii)}function Ue(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==F||n in ni(r)))}}function Ce(n,t,e){return t=Di(t===F?n.length-1:t,0),function(){for(var u=arguments,i=-1,o=Di(u.length-t,0),f=Hu(o);++i<o;)f[i]=u[t+i];for(i=-1,o=Hu(t+1);++i<t;)o[i]=u[i];return o[t]=e(f),r(n,this,o)}}function De(n,t,r){var e=t+"";t=wo;var u,i=Ne;return u=(u=e.match(hn))?u[1].split(pn):[],r=i(u,r),(i=r.length)&&(u=i-1,r[u]=(1<i?"& ":"")+r[u],r=r.join(2<i?", ":" "),+e=e.replace(sn,"{\n/* [wrapped with "+r+"] */\n")),t(n,e)}function Me(n){var t=0,r=0;return function(){var e=Ti(),u=16-(e-r);if(r=e,0<u){if(800<=++t)return arguments[0]}else t=0;return n.apply(F,arguments)}}function Te(n,t){var r=-1,e=n.length,u=e-1;for(t=t===F?e:t;++r<t;){var e=cr(r,u),i=n[e];n[e]=n[r],n[r]=i}return n.length=t,n}function $e(n){if(typeof n=="string"||Au(n))return n;var t=n+"";return"0"==t&&1/n==-N?"-0":t}function Fe(n){if(null!=n){try{return fi.call(n)}catch(n){}return n+""}return"";+}function Ne(n,t){return u(Z,function(r){var e="_."+r[0];t&r[1]&&!c(n,e)&&n.push(e)}),n.sort()}function Pe(n){if(n instanceof Mn)return n.clone();var t=new zn(n.__wrapped__,n.__chain__);return t.__actions__=Mr(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Ze(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Ou(r),0>r&&(r=Di(e+r,0)),g(n,je(t,3),r)):-1}function qe(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==F&&(u=Ou(r),u=0>r?Di(e+u,0):Mi(u,e-1)),+g(n,je(t,3),u,true)}function Ve(n){return(null==n?0:n.length)?kt(n,1):[]}function Ke(n){return n&&n.length?n[0]:F}function Ge(n){var t=null==n?0:n.length;return t?n[t-1]:F}function He(n,t){return n&&n.length&&t&&t.length?or(n,t):n}function Je(n){return null==n?n:Ni.call(n)}function Ye(n){if(!n||!n.length)return[];var t=0;return n=f(n,function(n){if(_u(n))return t=Di(n.length,t),true}),E(t,function(t){return l(n,j(t))})}function Qe(n,t){if(!n||!n.length)return[];var e=Ye(n);return null==t?e:l(e,function(n){+return r(t,F,n)})}function Xe(n){return n=On(n),n.__chain__=true,n}function nu(n,t){return t(n)}function tu(){return this}function ru(n,t){return(af(n)?u:oo)(n,je(t,3))}function eu(n,t){return(af(n)?i:fo)(n,je(t,3))}function uu(n,t){return(af(n)?l:Yt)(n,je(t,3))}function iu(n,t,r){return t=r?F:t,t=n&&null==t?n.length:t,le(n,128,F,F,F,F,t)}function ou(n,t){var r;if(typeof t!="function")throw new ei("Expected a function");return n=Ou(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=F),+r}}function fu(n,t,r){return t=r?F:t,n=le(n,8,F,F,F,F,F,t),n.placeholder=fu.placeholder,n}function cu(n,t,r){return t=r?F:t,n=le(n,16,F,F,F,F,F,t),n.placeholder=cu.placeholder,n}function au(n,t,r){function e(t){var r=c,e=a;return c=a=F,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===F||r>=t||0>r||g&&n>=l}function i(){var n=Jo();if(u(n))return o(n);var r,e=jo;r=n-_,n=t-(n-p),r=g?Mi(n,l-r):n,h=e(i,r)}function o(n){return h=F,d&&c?e(n):(c=a=F,s)}function f(){var n=Jo(),r=u(n);if(c=arguments,+a=this,p=n,r){if(h===F)return _=n=p,h=jo(i,t),v?e(n):s;if(g)return h=jo(i,t),e(p)}return h===F&&(h=jo(i,t)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ei("Expected a function");return t=Iu(t)||0,bu(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Di(Iu(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==F&&ho(h),_=0,c=p=a=h=F},f.flush=function(){return h===F?s:o(Jo())},f}function lu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;return i.has(u)?i.get(u):(e=n.apply(this,e),+r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ei("Expected a function");return r.cache=new(lu.Cache||Pn),r}function su(n){if(typeof n!="function")throw new ei("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function hu(n,t){return n===t||n!==n&&t!==t}function pu(n){return null!=n&&yu(n.length)&&!gu(n);+}function _u(n){return xu(n)&&pu(n)}function vu(n){if(!xu(n))return false;var t=zt(n);return"[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!wu(n)}function gu(n){return!!bu(n)&&(n=zt(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function du(n){return typeof n=="number"&&n==Ou(n)}function yu(n){return typeof n=="number"&&-1<n&&0==n%1&&9007199254740991>=n}function bu(n){var t=typeof n;return null!=n&&("object"==t||"function"==t);+}function xu(n){return null!=n&&typeof n=="object"}function ju(n){return typeof n=="number"||xu(n)&&"[object Number]"==zt(n)}function wu(n){return!(!xu(n)||"[object Object]"!=zt(n))&&(n=bi(n),null===n||(n=ci.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&fi.call(n)==hi))}function mu(n){return typeof n=="string"||!af(n)&&xu(n)&&"[object String]"==zt(n)}function Au(n){return typeof n=="symbol"||xu(n)&&"[object Symbol]"==zt(n)}function ku(n){if(!n)return[];if(pu(n))return mu(n)?$(n):Mr(n);+if(Ai&&n[Ai]){n=n[Ai]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=yo(n),("[object Map]"==t?L:"[object Set]"==t?D:Du)(n)}function Eu(n){return n?(n=Iu(n),n===N||n===-N?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Ou(n){n=Eu(n);var t=n%1;return n===n?t?n-t:n:0}function Su(n){return n?gt(Ou(n),0,4294967295):0}function Iu(n){if(typeof n=="number")return n;if(Au(n))return P;if(bu(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n,n=bu(n)?n+"":n),typeof n!="string")return 0===n?n:+n;+n=n.replace(cn,"");var t=bn.test(n);return t||jn.test(n)?Fn(n.slice(2),t?2:8):yn.test(n)?P:+n}function Ru(n){return Tr(n,Uu(n))}function zu(n){return null==n?"":jr(n)}function Wu(n,t,r){return n=null==n?F:It(n,t),n===F?r:n}function Bu(n,t){return null!=n&&ke(n,t,Lt)}function Lu(n){return pu(n)?Gn(n):Ht(n)}function Uu(n){if(pu(n))n=Gn(n,true);else if(bu(n)){var t,r=Le(n),e=[];for(t in n)("constructor"!=t||!r&&ci.call(n,t))&&e.push(t);n=e}else{if(t=[],null!=n)for(r in ni(n))t.push(r);n=t}return n}function Cu(n,t){+if(null==n)return{};var r=l(ye(n),function(n){return[n]});return t=je(t),ur(n,r,function(n,r){return t(n,r[0])})}function Du(n){return null==n?[]:I(n,Lu(n))}function Mu(n){return Nf(zu(n).toLowerCase())}function Tu(n){return(n=zu(n))&&n.replace(mn,rt).replace(Rn,"")}function $u(n,t,r){return n=zu(n),t=r?F:t,t===F?Ln.test(n)?n.match(Wn)||[]:n.match(_n)||[]:n.match(t)||[]}function Fu(n){return function(){return n}}function Nu(n){return n}function Pu(n){return Gt(typeof n=="function"?n:dt(n,1))}function Zu(n,t,r){+var e=Lu(t),i=St(t,e);null!=r||bu(t)&&(i.length||!e.length)||(r=t,t=n,n=this,i=St(t,Lu(t)));var o=!(bu(r)&&"chain"in r&&!r.chain),f=gu(n);return u(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=Mr(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,s([this.value()],arguments))})}),n}function qu(){}function Vu(n){return We(n)?j($e(n)):ir(n)}function Ku(){return[]}function Gu(){+return false}En=null==En?Zn:it.defaults(Zn.Object(),En,it.pick(Zn,Un));var Hu=En.Array,Ju=En.Date,Yu=En.Error,Qu=En.Function,Xu=En.Math,ni=En.Object,ti=En.RegExp,ri=En.String,ei=En.TypeError,ui=Hu.prototype,ii=ni.prototype,oi=En["__core-js_shared__"],fi=Qu.prototype.toString,ci=ii.hasOwnProperty,ai=0,li=function(){var n=/[^.]+$/.exec(oi&&oi.keys&&oi.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),si=ii.toString,hi=fi.call(ni),pi=Zn._,_i=ti("^"+fi.call(ci).replace(on,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vi=Kn?En.Buffer:F,gi=En.Symbol,di=En.Uint8Array,yi=vi?vi.f:F,bi=U(ni.getPrototypeOf,ni),xi=ni.create,ji=ii.propertyIsEnumerable,wi=ui.splice,mi=gi?gi.isConcatSpreadable:F,Ai=gi?gi.iterator:F,ki=gi?gi.toStringTag:F,Ei=function(){+try{var n=Ae(ni,"defineProperty");return n({},"",{}),n}catch(n){}}(),Oi=En.clearTimeout!==Zn.clearTimeout&&En.clearTimeout,Si=Ju&&Ju.now!==Zn.Date.now&&Ju.now,Ii=En.setTimeout!==Zn.setTimeout&&En.setTimeout,Ri=Xu.ceil,zi=Xu.floor,Wi=ni.getOwnPropertySymbols,Bi=vi?vi.isBuffer:F,Li=En.isFinite,Ui=ui.join,Ci=U(ni.keys,ni),Di=Xu.max,Mi=Xu.min,Ti=Ju.now,$i=En.parseInt,Fi=Xu.random,Ni=ui.reverse,Pi=Ae(En,"DataView"),Zi=Ae(En,"Map"),qi=Ae(En,"Promise"),Vi=Ae(En,"Set"),Ki=Ae(En,"WeakMap"),Gi=Ae(ni,"create"),Hi=Ki&&new Ki,Ji={},Yi=Fe(Pi),Qi=Fe(Zi),Xi=Fe(qi),no=Fe(Vi),to=Fe(Ki),ro=gi?gi.prototype:F,eo=ro?ro.valueOf:F,uo=ro?ro.toString:F,io=function(){+function n(){}return function(t){return bu(t)?xi?xi(t):(n.prototype=t,t=new n,n.prototype=F,t):{}}}();On.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:On}},On.prototype=Sn.prototype,On.prototype.constructor=On,zn.prototype=io(Sn.prototype),zn.prototype.constructor=zn,Mn.prototype=io(Sn.prototype),Mn.prototype.constructor=Mn,Tn.prototype.clear=function(){this.__data__=Gi?Gi(null):{},this.size=0},Tn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n],+this.size-=n?1:0,n},Tn.prototype.get=function(n){var t=this.__data__;return Gi?(n=t[n],"__lodash_hash_undefined__"===n?F:n):ci.call(t,n)?t[n]:F},Tn.prototype.has=function(n){var t=this.__data__;return Gi?t[n]!==F:ci.call(t,n)},Tn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Gi&&t===F?"__lodash_hash_undefined__":t,this},Nn.prototype.clear=function(){this.__data__=[],this.size=0},Nn.prototype.delete=function(n){var t=this.__data__;return n=lt(t,n),!(0>n)&&(n==t.length-1?t.pop():wi.call(t,n,1),+--this.size,true)},Nn.prototype.get=function(n){var t=this.__data__;return n=lt(t,n),0>n?F:t[n][1]},Nn.prototype.has=function(n){return-1<lt(this.__data__,n)},Nn.prototype.set=function(n,t){var r=this.__data__,e=lt(r,n);return 0>e?(++this.size,r.push([n,t])):r[e][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Tn,map:new(Zi||Nn),string:new Tn}},Pn.prototype.delete=function(n){return n=we(this,n).delete(n),this.size-=n?1:0,n},Pn.prototype.get=function(n){return we(this,n).get(n);+},Pn.prototype.has=function(n){return we(this,n).has(n)},Pn.prototype.set=function(n,t){var r=we(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},qn.prototype.add=qn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},qn.prototype.has=function(n){return this.__data__.has(n)},Vn.prototype.clear=function(){this.__data__=new Nn,this.size=0},Vn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Vn.prototype.get=function(n){+return this.__data__.get(n)},Vn.prototype.has=function(n){return this.__data__.has(n)},Vn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Nn){var e=r.__data__;if(!Zi||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Pn(e)}return r.set(n,t),this.size=r.size,this};var oo=Zr(Et),fo=Zr(Ot,true),co=qr(),ao=qr(true),lo=Hi?function(n,t){return Hi.set(n,t),n}:Nu,so=Ei?function(n,t){return Ei(n,"toString",{configurable:true,enumerable:false,value:Fu(t),writable:true})}:Nu,ho=Oi||function(n){+return Zn.clearTimeout(n)},po=Vi&&1/D(new Vi([,-0]))[1]==N?function(n){return new Vi(n)}:qu,_o=Hi?function(n){return Hi.get(n)}:qu,vo=Wi?function(n){return null==n?[]:(n=ni(n),f(Wi(n),function(t){return ji.call(n,t)}))}:Ku,go=Wi?function(n){for(var t=[];n;)s(t,vo(n)),n=bi(n);return t}:Ku,yo=zt;(Pi&&"[object DataView]"!=yo(new Pi(new ArrayBuffer(1)))||Zi&&"[object Map]"!=yo(new Zi)||qi&&"[object Promise]"!=yo(qi.resolve())||Vi&&"[object Set]"!=yo(new Vi)||Ki&&"[object WeakMap]"!=yo(new Ki))&&(yo=function(n){+var t=zt(n);if(n=(n="[object Object]"==t?n.constructor:F)?Fe(n):"")switch(n){case Yi:return"[object DataView]";case Qi:return"[object Map]";case Xi:return"[object Promise]";case no:return"[object Set]";case to:return"[object WeakMap]"}return t});var bo=oi?gu:Gu,xo=Me(lo),jo=Ii||function(n,t){return Zn.setTimeout(n,t)},wo=Me(so),mo=function(n){n=lu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return en.test(n)&&t.push(""),n.replace(un,function(n,r,e,u){+t.push(e?u.replace(vn,"$1"):r||n)}),t}),Ao=lr(function(n,t){return _u(n)?jt(n,kt(t,1,_u,true)):[]}),ko=lr(function(n,t){var r=Ge(t);return _u(r)&&(r=F),_u(n)?jt(n,kt(t,1,_u,true),je(r,2)):[]}),Eo=lr(function(n,t){var r=Ge(t);return _u(r)&&(r=F),_u(n)?jt(n,kt(t,1,_u,true),F,r):[]}),Oo=lr(function(n){var t=l(n,Sr);return t.length&&t[0]===n[0]?Ut(t):[]}),So=lr(function(n){var t=Ge(n),r=l(n,Sr);return t===Ge(r)?t=F:r.pop(),r.length&&r[0]===n[0]?Ut(r,je(t,2)):[]}),Io=lr(function(n){var t=Ge(n),r=l(n,Sr);return(t=typeof t=="function"?t:F)&&r.pop(),+r.length&&r[0]===n[0]?Ut(r,F,t):[]}),Ro=lr(He),zo=ge(function(n,t){var r=null==n?0:n.length,e=vt(n,t);return fr(n,l(t,function(n){return Re(n,r)?+n:n}).sort(Ur)),e}),Wo=lr(function(n){return wr(kt(n,1,_u,true))}),Bo=lr(function(n){var t=Ge(n);return _u(t)&&(t=F),wr(kt(n,1,_u,true),je(t,2))}),Lo=lr(function(n){var t=Ge(n),t=typeof t=="function"?t:F;return wr(kt(n,1,_u,true),F,t)}),Uo=lr(function(n,t){return _u(n)?jt(n,t):[]}),Co=lr(function(n){return Er(f(n,_u))}),Do=lr(function(n){var t=Ge(n);return _u(t)&&(t=F),+Er(f(n,_u),je(t,2))}),Mo=lr(function(n){var t=Ge(n),t=typeof t=="function"?t:F;return Er(f(n,_u),F,t)}),To=lr(Ye),$o=lr(function(n){var t=n.length,t=1<t?n[t-1]:F,t=typeof t=="function"?(n.pop(),t):F;return Qe(n,t)}),Fo=ge(function(n){function t(t){return vt(t,n)}var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return!(1<r||this.__actions__.length)&&u instanceof Mn&&Re(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:nu,args:[t],thisArg:F}),new zn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(F),+n})):this.thru(t)}),No=Nr(function(n,t,r){ci.call(n,r)?++n[r]:_t(n,r,1)}),Po=Yr(Ze),Zo=Yr(qe),qo=Nr(function(n,t,r){ci.call(n,r)?n[r].push(t):_t(n,r,[t])}),Vo=lr(function(n,t,e){var u=-1,i=typeof t=="function",o=pu(n)?Hu(n.length):[];return oo(n,function(n){o[++u]=i?r(t,n,e):Dt(n,t,e)}),o}),Ko=Nr(function(n,t,r){_t(n,r,t)}),Go=Nr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Ho=lr(function(n,t){if(null==n)return[];var r=t.length;return 1<r&&ze(n,t[0],t[1])?t=[]:2<r&&ze(t[0],t[1],t[2])&&(t=[t[0]]),+rr(n,kt(t,1),[])}),Jo=Si||function(){return Zn.Date.now()},Yo=lr(function(n,t,r){var e=1;if(r.length)var u=C(r,xe(Yo)),e=32|e;return le(n,e,t,r,u)}),Qo=lr(function(n,t,r){var e=3;if(r.length)var u=C(r,xe(Qo)),e=32|e;return le(t,e,n,r,u)}),Xo=lr(function(n,t){return xt(n,1,t)}),nf=lr(function(n,t,r){return xt(n,Iu(t)||0,r)});lu.Cache=Pn;var tf=lr(function(n,t){t=1==t.length&&af(t[0])?l(t[0],S(je())):l(kt(t,1),S(je()));var e=t.length;return lr(function(u){for(var i=-1,o=Mi(u.length,e);++i<o;)u[i]=t[i].call(this,u[i]);+return r(n,this,u)})}),rf=lr(function(n,t){return le(n,32,F,t,C(t,xe(rf)))}),ef=lr(function(n,t){return le(n,64,F,t,C(t,xe(ef)))}),uf=ge(function(n,t){return le(n,256,F,F,F,t)}),of=oe(Wt),ff=oe(function(n,t){return n>=t}),cf=Mt(function(){return arguments}())?Mt:function(n){return xu(n)&&ci.call(n,"callee")&&!ji.call(n,"callee")},af=Hu.isArray,lf=Hn?S(Hn):Tt,sf=Bi||Gu,hf=Jn?S(Jn):$t,pf=Yn?S(Yn):Nt,_f=Qn?S(Qn):qt,vf=Xn?S(Xn):Vt,gf=nt?S(nt):Kt,df=oe(Jt),yf=oe(function(n,t){return n<=t}),bf=Pr(function(n,t){+if(Le(t)||pu(t))Tr(t,Lu(t),n);else for(var r in t)ci.call(t,r)&&at(n,r,t[r])}),xf=Pr(function(n,t){Tr(t,Uu(t),n)}),jf=Pr(function(n,t,r,e){Tr(t,Uu(t),n,e)}),wf=Pr(function(n,t,r,e){Tr(t,Lu(t),n,e)}),mf=ge(vt),Af=lr(function(n){return n.push(F,se),r(jf,F,n)}),kf=lr(function(n){return n.push(F,he),r(Rf,F,n)}),Ef=ne(function(n,t,r){n[t]=r},Fu(Nu)),Of=ne(function(n,t,r){ci.call(n,t)?n[t].push(r):n[t]=[r]},je),Sf=lr(Dt),If=Pr(function(n,t,r){nr(n,t,r)}),Rf=Pr(function(n,t,r,e){nr(n,t,r,e)}),zf=ge(function(n,t){+var r={};if(null==n)return r;var e=false;t=l(t,function(t){return t=Rr(t,n),e||(e=1<t.length),t}),Tr(n,ye(n),r),e&&(r=dt(r,7,pe));for(var u=t.length;u--;)mr(r,t[u]);return r}),Wf=ge(function(n,t){return null==n?{}:er(n,t)}),Bf=ae(Lu),Lf=ae(Uu),Uf=Gr(function(n,t,r){return t=t.toLowerCase(),n+(r?Mu(t):t)}),Cf=Gr(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Df=Gr(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Mf=Kr("toLowerCase"),Tf=Gr(function(n,t,r){return n+(r?"_":"")+t.toLowerCase();+}),$f=Gr(function(n,t,r){return n+(r?" ":"")+Nf(t)}),Ff=Gr(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Nf=Kr("toUpperCase"),Pf=lr(function(n,t){try{return r(n,F,t)}catch(n){return vu(n)?n:new Yu(n)}}),Zf=ge(function(n,t){return u(t,function(t){t=$e(t),_t(n,t,Yo(n[t],n))}),n}),qf=Qr(),Vf=Qr(true),Kf=lr(function(n,t){return function(r){return Dt(r,n,t)}}),Gf=lr(function(n,t){return function(r){return Dt(n,r,t)}}),Hf=re(l),Jf=re(o),Yf=re(_),Qf=ie(),Xf=ie(true),nc=te(function(n,t){return n+t},0),tc=ce("ceil"),rc=te(function(n,t){+return n/t},1),ec=ce("floor"),uc=te(function(n,t){return n*t},1),ic=ce("round"),oc=te(function(n,t){return n-t},0);return On.after=function(n,t){if(typeof t!="function")throw new ei("Expected a function");return n=Ou(n),function(){if(1>--n)return t.apply(this,arguments)}},On.ary=iu,On.assign=bf,On.assignIn=xf,On.assignInWith=jf,On.assignWith=wf,On.at=mf,On.before=ou,On.bind=Yo,On.bindAll=Zf,On.bindKey=Qo,On.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return af(n)?n:[n]},+On.chain=Xe,On.chunk=function(n,t,r){if(t=(r?ze(n,t,r):t===F)?1:Di(Ou(t),0),r=null==n?0:n.length,!r||1>t)return[];for(var e=0,u=0,i=Hu(Ri(r/t));e<r;)i[u++]=vr(n,e,e+=t);return i},On.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},On.concat=function(){var n=arguments.length;if(!n)return[];for(var t=Hu(n-1),r=arguments[0];n--;)t[n-1]=arguments[n];return s(af(r)?Mr(r):[r],kt(t,1))},On.cond=function(n){var t=null==n?0:n.length,e=je();return n=t?l(n,function(n){+if("function"!=typeof n[1])throw new ei("Expected a function");return[e(n[0]),n[1]]}):[],lr(function(e){for(var u=-1;++u<t;){var i=n[u];if(r(i[0],this,e))return r(i[1],this,e)}})},On.conforms=function(n){return yt(dt(n,1))},On.constant=Fu,On.countBy=No,On.create=function(n,t){var r=io(n);return null==t?r:ht(r,t)},On.curry=fu,On.curryRight=cu,On.debounce=au,On.defaults=Af,On.defaultsDeep=kf,On.defer=Xo,On.delay=nf,On.difference=Ao,On.differenceBy=ko,On.differenceWith=Eo,On.drop=function(n,t,r){var e=null==n?0:n.length;+return e?(t=r||t===F?1:Ou(t),vr(n,0>t?0:t,e)):[]},On.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===F?1:Ou(t),t=e-t,vr(n,0,0>t?0:t)):[]},On.dropRightWhile=function(n,t){return n&&n.length?Ar(n,je(t,3),true,true):[]},On.dropWhile=function(n,t){return n&&n.length?Ar(n,je(t,3),true):[]},On.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return[];for(r&&typeof r!="number"&&ze(n,t,r)&&(r=0,e=u),u=n.length,r=Ou(r),0>r&&(r=-r>u?0:u+r),e=e===F||e>u?u:Ou(e),0>e&&(e+=u),e=r>e?0:Su(e);r<e;)n[r++]=t;+return n},On.filter=function(n,t){return(af(n)?f:At)(n,je(t,3))},On.flatMap=function(n,t){return kt(uu(n,t),1)},On.flatMapDeep=function(n,t){return kt(uu(n,t),N)},On.flatMapDepth=function(n,t,r){return r=r===F?1:Ou(r),kt(uu(n,t),r)},On.flatten=Ve,On.flattenDeep=function(n){return(null==n?0:n.length)?kt(n,N):[]},On.flattenDepth=function(n,t){return null!=n&&n.length?(t=t===F?1:Ou(t),kt(n,t)):[]},On.flip=function(n){return le(n,512)},On.flow=qf,On.flowRight=Vf,On.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){+var u=n[t];e[u[0]]=u[1]}return e},On.functions=function(n){return null==n?[]:St(n,Lu(n))},On.functionsIn=function(n){return null==n?[]:St(n,Uu(n))},On.groupBy=qo,On.initial=function(n){return(null==n?0:n.length)?vr(n,0,-1):[]},On.intersection=Oo,On.intersectionBy=So,On.intersectionWith=Io,On.invert=Ef,On.invertBy=Of,On.invokeMap=Vo,On.iteratee=Pu,On.keyBy=Ko,On.keys=Lu,On.keysIn=Uu,On.map=uu,On.mapKeys=function(n,t){var r={};return t=je(t,3),Et(n,function(n,e,u){_t(r,t(n,e,u),n)}),r},On.mapValues=function(n,t){+var r={};return t=je(t,3),Et(n,function(n,e,u){_t(r,e,t(n,e,u))}),r},On.matches=function(n){return Qt(dt(n,1))},On.matchesProperty=function(n,t){return Xt(n,dt(t,1))},On.memoize=lu,On.merge=If,On.mergeWith=Rf,On.method=Kf,On.methodOf=Gf,On.mixin=Zu,On.negate=su,On.nthArg=function(n){return n=Ou(n),lr(function(t){return tr(t,n)})},On.omit=zf,On.omitBy=function(n,t){return Cu(n,su(je(t)))},On.once=function(n){return ou(2,n)},On.orderBy=function(n,t,r,e){return null==n?[]:(af(t)||(t=null==t?[]:[t]),+r=e?F:r,af(r)||(r=null==r?[]:[r]),rr(n,t,r))},On.over=Hf,On.overArgs=tf,On.overEvery=Jf,On.overSome=Yf,On.partial=rf,On.partialRight=ef,On.partition=Go,On.pick=Wf,On.pickBy=Cu,On.property=Vu,On.propertyOf=function(n){return function(t){return null==n?F:It(n,t)}},On.pull=Ro,On.pullAll=He,On.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?or(n,t,je(r,2)):n},On.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?or(n,t,F,r):n},On.pullAt=zo,On.range=Qf,On.rangeRight=Xf,On.rearg=uf,On.reject=function(n,t){+return(af(n)?f:At)(n,su(je(t,3)))},On.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=je(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return fr(n,u),r},On.rest=function(n,t){if(typeof n!="function")throw new ei("Expected a function");return t=t===F?t:Ou(t),lr(n,t)},On.reverse=Je,On.sampleSize=function(n,t,r){return t=(r?ze(n,t,r):t===F)?1:Ou(t),(af(n)?ot:hr)(n,t)},On.set=function(n,t,r){return null==n?n:pr(n,t,r)},On.setWith=function(n,t,r,e){return e=typeof e=="function"?e:F,+null==n?n:pr(n,t,r,e)},On.shuffle=function(n){return(af(n)?ft:_r)(n)},On.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&typeof r!="number"&&ze(n,t,r)?(t=0,r=e):(t=null==t?0:Ou(t),r=r===F?e:Ou(r)),vr(n,t,r)):[]},On.sortBy=Ho,On.sortedUniq=function(n){return n&&n.length?br(n):[]},On.sortedUniqBy=function(n,t){return n&&n.length?br(n,je(t,2)):[]},On.split=function(n,t,r){return r&&typeof r!="number"&&ze(n,t,r)&&(t=r=F),r=r===F?4294967295:r>>>0,r?(n=zu(n))&&(typeof t=="string"||null!=t&&!_f(t))&&(t=jr(t),+!t&&Bn.test(n))?zr($(n),0,r):n.split(t,r):[]},On.spread=function(n,t){if(typeof n!="function")throw new ei("Expected a function");return t=null==t?0:Di(Ou(t),0),lr(function(e){var u=e[t];return e=zr(e,0,t),u&&s(e,u),r(n,this,e)})},On.tail=function(n){var t=null==n?0:n.length;return t?vr(n,1,t):[]},On.take=function(n,t,r){return n&&n.length?(t=r||t===F?1:Ou(t),vr(n,0,0>t?0:t)):[]},On.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===F?1:Ou(t),t=e-t,vr(n,0>t?0:t,e)):[]},On.takeRightWhile=function(n,t){+return n&&n.length?Ar(n,je(t,3),false,true):[]},On.takeWhile=function(n,t){return n&&n.length?Ar(n,je(t,3)):[]},On.tap=function(n,t){return t(n),n},On.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ei("Expected a function");return bu(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),au(n,t,{leading:e,maxWait:t,trailing:u})},On.thru=nu,On.toArray=ku,On.toPairs=Bf,On.toPairsIn=Lf,On.toPath=function(n){return af(n)?l(n,$e):Au(n)?[n]:Mr(mo(zu(n)))},On.toPlainObject=Ru,+On.transform=function(n,t,r){var e=af(n),i=e||sf(n)||gf(n);if(t=je(t,4),null==r){var o=n&&n.constructor;r=i?e?new o:[]:bu(n)&&gu(o)?io(bi(n)):{}}return(i?u:Et)(n,function(n,e,u){return t(r,n,e,u)}),r},On.unary=function(n){return iu(n,1)},On.union=Wo,On.unionBy=Bo,On.unionWith=Lo,On.uniq=function(n){return n&&n.length?wr(n):[]},On.uniqBy=function(n,t){return n&&n.length?wr(n,je(t,2)):[]},On.uniqWith=function(n,t){return t=typeof t=="function"?t:F,n&&n.length?wr(n,F,t):[]},On.unset=function(n,t){return null==n||mr(n,t);+},On.unzip=Ye,On.unzipWith=Qe,On.update=function(n,t,r){return null==n?n:pr(n,t,Ir(r)(It(n,t)),void 0)},On.updateWith=function(n,t,r,e){return e=typeof e=="function"?e:F,null!=n&&(n=pr(n,t,Ir(r)(It(n,t)),e)),n},On.values=Du,On.valuesIn=function(n){return null==n?[]:I(n,Uu(n))},On.without=Uo,On.words=$u,On.wrap=function(n,t){return rf(Ir(t),n)},On.xor=Co,On.xorBy=Do,On.xorWith=Mo,On.zip=To,On.zipObject=function(n,t){return Or(n||[],t||[],at)},On.zipObjectDeep=function(n,t){return Or(n||[],t||[],pr);+},On.zipWith=$o,On.entries=Bf,On.entriesIn=Lf,On.extend=xf,On.extendWith=jf,Zu(On,On),On.add=nc,On.attempt=Pf,On.camelCase=Uf,On.capitalize=Mu,On.ceil=tc,On.clamp=function(n,t,r){return r===F&&(r=t,t=F),r!==F&&(r=Iu(r),r=r===r?r:0),t!==F&&(t=Iu(t),t=t===t?t:0),gt(Iu(n),t,r)},On.clone=function(n){return dt(n,4)},On.cloneDeep=function(n){return dt(n,5)},On.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:F,dt(n,5,t)},On.cloneWith=function(n,t){return t=typeof t=="function"?t:F,dt(n,4,t)},+On.conformsTo=function(n,t){return null==t||bt(n,t,Lu(t))},On.deburr=Tu,On.defaultTo=function(n,t){return null==n||n!==n?t:n},On.divide=rc,On.endsWith=function(n,t,r){n=zu(n),t=jr(t);var e=n.length,e=r=r===F?e:gt(Ou(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},On.eq=hu,On.escape=function(n){return(n=zu(n))&&Y.test(n)?n.replace(H,et):n},On.escapeRegExp=function(n){return(n=zu(n))&&fn.test(n)?n.replace(on,"\\$&"):n},On.every=function(n,t,r){var e=af(n)?o:wt;return r&&ze(n,t,r)&&(t=F),e(n,je(t,3));+},On.find=Po,On.findIndex=Ze,On.findKey=function(n,t){return v(n,je(t,3),Et)},On.findLast=Zo,On.findLastIndex=qe,On.findLastKey=function(n,t){return v(n,je(t,3),Ot)},On.floor=ec,On.forEach=ru,On.forEachRight=eu,On.forIn=function(n,t){return null==n?n:co(n,je(t,3),Uu)},On.forInRight=function(n,t){return null==n?n:ao(n,je(t,3),Uu)},On.forOwn=function(n,t){return n&&Et(n,je(t,3))},On.forOwnRight=function(n,t){return n&&Ot(n,je(t,3))},On.get=Wu,On.gt=of,On.gte=ff,On.has=function(n,t){return null!=n&&ke(n,t,Bt);+},On.hasIn=Bu,On.head=Ke,On.identity=Nu,On.includes=function(n,t,r,e){return n=pu(n)?n:Du(n),r=r&&!e?Ou(r):0,e=n.length,0>r&&(r=Di(e+r,0)),mu(n)?r<=e&&-1<n.indexOf(t,r):!!e&&-1<d(n,t,r)},On.indexOf=function(n,t,r){var e=null==n?0:n.length;return e?(r=null==r?0:Ou(r),0>r&&(r=Di(e+r,0)),d(n,t,r)):-1},On.inRange=function(n,t,r){return t=Eu(t),r===F?(r=t,t=0):r=Eu(r),n=Iu(n),n>=Mi(t,r)&&n<Di(t,r)},On.invoke=Sf,On.isArguments=cf,On.isArray=af,On.isArrayBuffer=lf,On.isArrayLike=pu,On.isArrayLikeObject=_u,+On.isBoolean=function(n){return true===n||false===n||xu(n)&&"[object Boolean]"==zt(n)},On.isBuffer=sf,On.isDate=hf,On.isElement=function(n){return xu(n)&&1===n.nodeType&&!wu(n)},On.isEmpty=function(n){if(null==n)return true;if(pu(n)&&(af(n)||typeof n=="string"||typeof n.splice=="function"||sf(n)||gf(n)||cf(n)))return!n.length;var t=yo(n);if("[object Map]"==t||"[object Set]"==t)return!n.size;if(Le(n))return!Ht(n).length;for(var r in n)if(ci.call(n,r))return false;return true},On.isEqual=function(n,t){return Ft(n,t);+},On.isEqualWith=function(n,t,r){var e=(r=typeof r=="function"?r:F)?r(n,t):F;return e===F?Ft(n,t,F,r):!!e},On.isError=vu,On.isFinite=function(n){return typeof n=="number"&&Li(n)},On.isFunction=gu,On.isInteger=du,On.isLength=yu,On.isMap=pf,On.isMatch=function(n,t){return n===t||Pt(n,t,me(t))},On.isMatchWith=function(n,t,r){return r=typeof r=="function"?r:F,Pt(n,t,me(t),r)},On.isNaN=function(n){return ju(n)&&n!=+n},On.isNative=function(n){if(bo(n))throw new Yu("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");+return Zt(n)},On.isNil=function(n){return null==n},On.isNull=function(n){return null===n},On.isNumber=ju,On.isObject=bu,On.isObjectLike=xu,On.isPlainObject=wu,On.isRegExp=_f,On.isSafeInteger=function(n){return du(n)&&-9007199254740991<=n&&9007199254740991>=n},On.isSet=vf,On.isString=mu,On.isSymbol=Au,On.isTypedArray=gf,On.isUndefined=function(n){return n===F},On.isWeakMap=function(n){return xu(n)&&"[object WeakMap]"==yo(n)},On.isWeakSet=function(n){return xu(n)&&"[object WeakSet]"==zt(n)},On.join=function(n,t){+return null==n?"":Ui.call(n,t)},On.kebabCase=Cf,On.last=Ge,On.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;if(r!==F&&(u=Ou(r),u=0>u?Di(e+u,0):Mi(u,e-1)),t===t){for(r=u+1;r--&&n[r]!==t;);n=r}else n=g(n,b,u,true);return n},On.lowerCase=Df,On.lowerFirst=Mf,On.lt=df,On.lte=yf,On.max=function(n){return n&&n.length?mt(n,Nu,Wt):F},On.maxBy=function(n,t){return n&&n.length?mt(n,je(t,2),Wt):F},On.mean=function(n){return x(n,Nu)},On.meanBy=function(n,t){return x(n,je(t,2))},On.min=function(n){+return n&&n.length?mt(n,Nu,Jt):F},On.minBy=function(n,t){return n&&n.length?mt(n,je(t,2),Jt):F},On.stubArray=Ku,On.stubFalse=Gu,On.stubObject=function(){return{}},On.stubString=function(){return""},On.stubTrue=function(){return true},On.multiply=uc,On.nth=function(n,t){return n&&n.length?tr(n,Ou(t)):F},On.noConflict=function(){return Zn._===this&&(Zn._=pi),this},On.noop=qu,On.now=Jo,On.pad=function(n,t,r){n=zu(n);var e=(t=Ou(t))?T(n):0;return!t||e>=t?n:(t=(t-e)/2,ee(zi(t),r)+n+ee(Ri(t),r))},On.padEnd=function(n,t,r){+n=zu(n);var e=(t=Ou(t))?T(n):0;return t&&e<t?n+ee(t-e,r):n},On.padStart=function(n,t,r){n=zu(n);var e=(t=Ou(t))?T(n):0;return t&&e<t?ee(t-e,r)+n:n},On.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),$i(zu(n).replace(an,""),t||0)},On.random=function(n,t,r){if(r&&typeof r!="boolean"&&ze(n,t,r)&&(t=r=F),r===F&&(typeof t=="boolean"?(r=t,t=F):typeof n=="boolean"&&(r=n,n=F)),n===F&&t===F?(n=0,t=1):(n=Eu(n),t===F?(t=n,n=0):t=Eu(t)),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Fi(),Mi(n+r*(t-n+$n("1e-"+((r+"").length-1))),t)):cr(n,t);+},On.reduce=function(n,t,r){var e=af(n)?h:m,u=3>arguments.length;return e(n,je(t,4),r,u,oo)},On.reduceRight=function(n,t,r){var e=af(n)?p:m,u=3>arguments.length;return e(n,je(t,4),r,u,fo)},On.repeat=function(n,t,r){return t=(r?ze(n,t,r):t===F)?1:Ou(t),ar(zu(n),t)},On.replace=function(){var n=arguments,t=zu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},On.result=function(n,t,r){t=Rr(t,n);var e=-1,u=t.length;for(u||(u=1,n=F);++e<u;){var i=null==n?F:n[$e(t[e])];i===F&&(e=u,i=r),n=gu(i)?i.call(n):i;+}return n},On.round=ic,On.runInContext=w,On.sample=function(n){return(af(n)?tt:sr)(n)},On.size=function(n){if(null==n)return 0;if(pu(n))return mu(n)?T(n):n.length;var t=yo(n);return"[object Map]"==t||"[object Set]"==t?n.size:Ht(n).length},On.snakeCase=Tf,On.some=function(n,t,r){var e=af(n)?_:gr;return r&&ze(n,t,r)&&(t=F),e(n,je(t,3))},On.sortedIndex=function(n,t){return dr(n,t)},On.sortedIndexBy=function(n,t,r){return yr(n,t,je(r,2))},On.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){+var e=dr(n,t);if(e<r&&hu(n[e],t))return e}return-1},On.sortedLastIndex=function(n,t){return dr(n,t,true)},On.sortedLastIndexBy=function(n,t,r){return yr(n,t,je(r,2),true)},On.sortedLastIndexOf=function(n,t){if(null==n?0:n.length){var r=dr(n,t,true)-1;if(hu(n[r],t))return r}return-1},On.startCase=$f,On.startsWith=function(n,t,r){return n=zu(n),r=null==r?0:gt(Ou(r),0,n.length),t=jr(t),n.slice(r,r+t.length)==t},On.subtract=oc,On.sum=function(n){return n&&n.length?k(n,Nu):0},On.sumBy=function(n,t){return n&&n.length?k(n,je(t,2)):0;+},On.template=function(n,t,r){var e=On.templateSettings;r&&ze(n,t,r)&&(t=F),n=zu(n),t=jf({},t,e,se),r=jf({},t.imports,e.imports,se);var u,i,o=Lu(r),f=I(r,o),c=0;r=t.interpolate||An;var a="__p+='";r=ti((t.escape||An).source+"|"+r.source+"|"+(r===nn?gn:An).source+"|"+(t.evaluate||An).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,o,f,l){return e||(e=o),a+=n.slice(c,l).replace(kn,B),r&&(u=true,a+="'+__e("+r+")+'"),f&&(i=true,a+="';"+f+";\n__p+='"),+e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(i?a.replace(q,""):a).replace(V,"$1").replace(K,"$1;"),a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=Pf(function(){return Qu(o,l+"return "+a).apply(F,f)}),t.source=a,vu(t))throw t;return t},On.times=function(n,t){if(n=Ou(n),1>n||9007199254740991<n)return[];+var r=4294967295,e=Mi(n,4294967295);for(t=je(t),n-=4294967295,e=E(e,t);++r<n;)t(r);return e},On.toFinite=Eu,On.toInteger=Ou,On.toLength=Su,On.toLower=function(n){return zu(n).toLowerCase()},On.toNumber=Iu,On.toSafeInteger=function(n){return n?gt(Ou(n),-9007199254740991,9007199254740991):0===n?n:0},On.toString=zu,On.toUpper=function(n){return zu(n).toUpperCase()},On.trim=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(cn,""):n&&(t=jr(t))?(n=$(n),r=$(t),t=z(n,r),r=W(n,r)+1,zr(n,t,r).join("")):n;+},On.trimEnd=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(ln,""):n&&(t=jr(t))?(n=$(n),t=W(n,$(t))+1,zr(n,0,t).join("")):n},On.trimStart=function(n,t,r){return(n=zu(n))&&(r||t===F)?n.replace(an,""):n&&(t=jr(t))?(n=$(n),t=z(n,$(t)),zr(n,t).join("")):n},On.truncate=function(n,t){var r=30,e="...";if(bu(t))var u="separator"in t?t.separator:u,r="length"in t?Ou(t.length):r,e="omission"in t?jr(t.omission):e;n=zu(n);var i=n.length;if(Bn.test(n))var o=$(n),i=o.length;if(r>=i)return n;if(i=r-T(e),1>i)return e;+if(r=o?zr(o,0,i).join(""):n.slice(0,i),u===F)return r+e;if(o&&(i+=r.length-i),_f(u)){if(n.slice(i).search(u)){var f=r;for(u.global||(u=ti(u.source,zu(dn.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===F?i:c)}}else n.indexOf(jr(u),i)!=i&&(u=r.lastIndexOf(u),-1<u&&(r=r.slice(0,u)));return r+e},On.unescape=function(n){return(n=zu(n))&&J.test(n)?n.replace(G,ut):n},On.uniqueId=function(n){var t=++ai;return zu(n)+t},On.upperCase=Ff,On.upperFirst=Nf,On.each=ru,On.eachRight=eu,On.first=Ke,+Zu(On,function(){var n={};return Et(On,function(t,r){ci.call(On.prototype,r)||(n[r]=t)}),n}(),{chain:false}),On.VERSION="4.17.4",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){On[n].placeholder=On}),u(["drop","take"],function(n,t){Mn.prototype[n]=function(r){r=r===F?1:Di(Ou(r),0);var e=this.__filtered__&&!t?new Mn(this):this.clone();return e.__filtered__?e.__takeCount__=Mi(r,e.__takeCount__):e.__views__.push({size:Mi(r,4294967295),type:n+(0>e.__dir__?"Right":"")}),e},Mn.prototype[n+"Right"]=function(t){+return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Mn.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:je(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");Mn.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Mn.prototype[n]=function(){return this.__filtered__?new Mn(this):this[r](1);+}}),Mn.prototype.compact=function(){return this.filter(Nu)},Mn.prototype.find=function(n){return this.filter(n).head()},Mn.prototype.findLast=function(n){return this.reverse().find(n)},Mn.prototype.invokeMap=lr(function(n,t){return typeof n=="function"?new Mn(this):this.map(function(r){return Dt(r,n,t)})}),Mn.prototype.reject=function(n){return this.filter(su(je(n)))},Mn.prototype.slice=function(n,t){n=Ou(n);var r=this;return r.__filtered__&&(0<n||0>t)?new Mn(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),+t!==F&&(t=Ou(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Mn.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Mn.prototype.toArray=function(){return this.take(4294967295)},Et(Mn.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=On[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(On.prototype[t]=function(){function t(n){return n=u.apply(On,s([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Mn,a=f[0],l=c||af(o);+l&&r&&typeof a=="function"&&1!=a.length&&(c=l=false);var h=this.__chain__,p=!!this.__actions__.length,a=i&&!h,c=c&&!p;return!i&&l?(o=c?o:new Mn(this),o=n.apply(o,f),o.__actions__.push({func:nu,args:[t],thisArg:F}),new zn(o,h)):a&&c?n.apply(this,f):(o=this.thru(t),a?e?o.value()[0]:o.value():o)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=ui[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);On.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){+var u=this.value();return t.apply(af(u)?u:[],n)}return this[r](function(r){return t.apply(af(r)?r:[],n)})}}),Et(Mn.prototype,function(n,t){var r=On[t];if(r){var e=r.name+"";(Ji[e]||(Ji[e]=[])).push({name:t,func:r})}}),Ji[Xr(F,2).name]=[{name:"wrapper",func:F}],Mn.prototype.clone=function(){var n=new Mn(this.__wrapped__);return n.__actions__=Mr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Mr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Mr(this.__views__),+n},Mn.prototype.reverse=function(){if(this.__filtered__){var n=new Mn(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Mn.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=af(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c<a;){var l=o[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=Mi(n,f+s);break;case"takeRight":f=Di(f,n-s)}}if(n={start:f,end:n},o=n.start,f=n.end,n=f-o,+o=u?f:o-1,f=this.__iteratees__,c=f.length,a=0,l=Mi(n,this.__takeCount__),!e||!u&&i==n&&l==n)return kr(t,this.__actions__);e=[];n:for(;n--&&a<l;){for(o+=r,u=-1,i=t[o];++u<c;){var h=f[u],s=h.type,h=(0,h.iteratee)(i);if(2==s)i=h;else if(!h){if(1==s)continue n;break n}}e[a++]=i}return e},On.prototype.at=Fo,On.prototype.chain=function(){return Xe(this)},On.prototype.commit=function(){return new zn(this.value(),this.__chain__)},On.prototype.next=function(){this.__values__===F&&(this.__values__=ku(this.value()));+var n=this.__index__>=this.__values__.length;return{done:n,value:n?F:this.__values__[this.__index__++]}},On.prototype.plant=function(n){for(var t,r=this;r instanceof Sn;){var e=Pe(r);e.__index__=0,e.__values__=F,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},On.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Mn?(this.__actions__.length&&(n=new Mn(this)),n=n.reverse(),n.__actions__.push({func:nu,args:[Je],thisArg:F}),new zn(n,this.__chain__)):this.thru(Je);+},On.prototype.toJSON=On.prototype.valueOf=On.prototype.value=function(){return kr(this.__wrapped__,this.__actions__)},On.prototype.first=On.prototype.head,Ai&&(On.prototype[Ai]=tu),On}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Zn._=it, define(function(){return it})):Vn?((Vn.exports=it)._=it,qn._=it):Zn._=it}).call(this);\ No newline at end of filediff --git a/web/ext/node_modules/promise-queue/lib/index.js b/web/ext/node_modules/promise-queue/lib/index.jsnew file mode 100644index 000000000..1d8287a0e--- /dev/null+++ b/web/ext/node_modules/promise-queue/lib/index.js@@ -0,0 +1,178 @@+/* global define, Promise */+(function (root, factory) {+ 'use strict';+ if (typeof module === 'object' && module.exports && typeof require === 'function') {+ // CommonJS+ module.exports = factory();+ } else if (typeof define === 'function' && typeof define.amd === 'object') {+ // AMD. Register as an anonymous module.+ define(factory);+ } else {+ // Browser globals+ root.Queue = factory();+ }+})+(this, function () {+ 'use strict';++ /**+ * @return {Object}+ */+ var LocalPromise = typeof Promise !== 'undefined' ? Promise : function () {+ return {+ then: function () {+ throw new Error('Queue.configure() before use Queue');+ }+ };+ };++ var noop = function () {};++ /**+ * @param {*} value+ * @returns {LocalPromise}+ */+ var resolveWith = function (value) {+ if (value && typeof value.then === 'function') {+ return value;+ }++ return new LocalPromise(function (resolve) {+ resolve(value);+ });+ };++ /**+ * It limits concurrently executed promises+ *+ * @param {Number} [maxPendingPromises=Infinity] max number of concurrently executed promises+ * @param {Number} [maxQueuedPromises=Infinity] max number of queued promises+ * @constructor+ *+ * @example+ *+ * var queue = new Queue(1);+ *+ * queue.add(function () {+ * // resolve of this promise will resume next request+ * return downloadTarballFromGithub(url, file);+ * })+ * .then(function (file) {+ * doStuffWith(file);+ * });+ *+ * queue.add(function () {+ * return downloadTarballFromGithub(url, file);+ * })+ * // This request will be paused+ * .then(function (file) {+ * doStuffWith(file);+ * });+ */+ function Queue(maxPendingPromises, maxQueuedPromises) {+ this.pendingPromises = 0;+ this.maxPendingPromises = typeof maxPendingPromises !== 'undefined' ? maxPendingPromises : Infinity;+ this.maxQueuedPromises = typeof maxQueuedPromises !== 'undefined' ? maxQueuedPromises : Infinity;+ this.queue = [];+ }++ /**+ * Defines promise promiseFactory+ * @param {Function} GlobalPromise+ */+ Queue.configure = function (GlobalPromise) {+ LocalPromise = GlobalPromise;+ };++ /**+ * @param {Function} promiseGenerator+ * @return {LocalPromise}+ */+ Queue.prototype.add = function (promiseGenerator) {+ var self = this;+ return new LocalPromise(function (resolve, reject, notify) {+ // Do not queue to much promises+ if (self.queue.length >= self.maxQueuedPromises) {+ reject(new Error('Queue limit reached'));+ return;+ }++ // Add to queue+ self.queue.push({+ promiseGenerator: promiseGenerator,+ resolve: resolve,+ reject: reject,+ notify: notify || noop+ });++ self._dequeue();+ });+ };++ /**+ * Number of simultaneously running promises (which are resolving)+ *+ * @return {number}+ */+ Queue.prototype.getPendingLength = function () {+ return this.pendingPromises;+ };++ /**+ * Number of queued promises (which are waiting)+ *+ * @return {number}+ */+ Queue.prototype.getQueueLength = function () {+ return this.queue.length;+ };++ /**+ * @returns {boolean} true if first item removed from queue+ * @private+ */+ Queue.prototype._dequeue = function () {+ var self = this;+ if (this.pendingPromises >= this.maxPendingPromises) {+ return false;+ }++ // Remove from queue+ var item = this.queue.shift();+ if (!item) {+ return false;+ }++ try {+ this.pendingPromises++;++ resolveWith(item.promiseGenerator())+ // Forward all stuff+ .then(function (value) {+ // It is not pending now+ self.pendingPromises--;+ // It should pass values+ item.resolve(value);+ self._dequeue();+ }, function (err) {+ // It is not pending now+ self.pendingPromises--;+ // It should not mask errors+ item.reject(err);+ self._dequeue();+ }, function (message) {+ // It should pass notifications+ item.notify(message);+ });+ } catch (err) {+ self.pendingPromises--;+ item.reject(err);+ self._dequeue();++ }++ return true;+ };++ return Queue;+});diff --git a/web/ext/node_modules/worldview-components/browser/wvc.js b/web/ext/node_modules/worldview-components/browser/wvc.jsnew file mode 100644index 000000000..5c7fa1015--- /dev/null+++ b/web/ext/node_modules/worldview-components/browser/wvc.js@@ -0,0 +1,5840 @@+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.WVC = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){+(function (global){+(function webpackUniversalModuleDefinition(root, factory) {+ if(typeof exports === 'object' && typeof module === 'object')+ module.exports = factory((typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null), (typeof window !== "undefined" ? window['ReactDOM'] : typeof global !== "undefined" ? global['ReactDOM'] : null));+ else if(typeof define === 'function' && define.amd)+ define(["react", "react-dom"], factory);+ else if(typeof exports === 'object')+ exports["ReactDraggable"] = factory((typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null), (typeof window !== "undefined" ? window['ReactDOM'] : typeof global !== "undefined" ? global['ReactDOM'] : null));+ else+ root["ReactDraggable"] = factory(root["React"], root["ReactDOM"]);+})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {+return /******/ (function(modules) { // webpackBootstrap+/******/ // The module cache+/******/ var installedModules = {};+/******/+/******/ // The require function+/******/ function __webpack_require__(moduleId) {+/******/+/******/ // Check if module is in cache+/******/ if(installedModules[moduleId])+/******/ return installedModules[moduleId].exports;+/******/+/******/ // Create a new module (and put it into the cache)+/******/ var module = installedModules[moduleId] = {+/******/ exports: {},+/******/ id: moduleId,+/******/ loaded: false+/******/ };+/******/+/******/ // Execute the module function+/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);+/******/+/******/ // Flag the module as loaded+/******/ module.loaded = true;+/******/+/******/ // Return the exports of the module+/******/ return module.exports;+/******/ }+/******/+/******/+/******/ // expose the modules object (__webpack_modules__)+/******/ __webpack_require__.m = modules;+/******/+/******/ // expose the module cache+/******/ __webpack_require__.c = installedModules;+/******/+/******/ // __webpack_public_path__+/******/ __webpack_require__.p = "";+/******/+/******/ // Load entry module and return exports+/******/ return __webpack_require__(0);+/******/ })+/************************************************************************/+/******/ ([+/* 0 */+/***/ function(module, exports, __webpack_require__) {++ 'use strict';++ module.exports = __webpack_require__(1).default;+ module.exports.DraggableCore = __webpack_require__(9).default;++/***/ },+/* 1 */+/***/ function(module, exports, __webpack_require__) {++ 'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });++ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };++ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();++ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++ var _react = __webpack_require__(2);++ var _react2 = _interopRequireDefault(_react);++ var _reactDom = __webpack_require__(3);++ var _reactDom2 = _interopRequireDefault(_reactDom);++ var _classnames = __webpack_require__(4);++ var _classnames2 = _interopRequireDefault(_classnames);++ var _domFns = __webpack_require__(5);++ var _positionFns = __webpack_require__(8);++ var _shims = __webpack_require__(6);++ var _DraggableCore = __webpack_require__(9);++ var _DraggableCore2 = _interopRequireDefault(_DraggableCore);++ var _log = __webpack_require__(11);++ var _log2 = _interopRequireDefault(_log);++ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }++ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }+ // $FlowIgnore+++ /*:: import type {DraggableEventHandler} from './utils/types';*/+ /*:: type DraggableState = {+ dragging: boolean,+ dragged: boolean,+ x: number, y: number,+ slackX: number, slackY: number,+ isElementSVG: boolean+ };*/+++ //+ // Define <Draggable>+ //++ /*:: type ConstructorProps = {+ position: { x: number, y: number },+ defaultPosition: { x: number, y: number }+ };*/++ var Draggable = function (_React$Component) {+ _inherits(Draggable, _React$Component);++ function Draggable(props /*: ConstructorProps*/) {+ _classCallCheck(this, Draggable);++ var _this = _possibleConstructorReturn(this, (Draggable.__proto__ || Object.getPrototypeOf(Draggable)).call(this, props));++ _this.onDragStart = function (e, coreData) {+ (0, _log2.default)('Draggable: onDragStart: %j', coreData);++ // Short-circuit if user's callback killed it.+ var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_this, coreData));+ // Kills start event on core as well, so move handlers are never bound.+ if (shouldStart === false) return false;++ _this.setState({ dragging: true, dragged: true });+ };++ _this.onDrag = function (e, coreData) {+ if (!_this.state.dragging) return false;+ (0, _log2.default)('Draggable: onDrag: %j', coreData);++ var uiData = (0, _positionFns.createDraggableData)(_this, coreData);++ var newState /*: $Shape<DraggableState>*/ = {+ x: uiData.x,+ y: uiData.y+ };++ // Keep within bounds.+ if (_this.props.bounds) {+ // Save original x and y.+ var _x = newState.x,+ _y = newState.y;++ // Add slack to the values used to calculate bound position. This will ensure that if+ // we start removing slack, the element won't react to it right away until it's been+ // completely removed.++ newState.x += _this.state.slackX;+ newState.y += _this.state.slackY;++ // Get bound position. This will ceil/floor the x and y within the boundaries.+ // $FlowBug++ // Recalculate slack by noting how much was shaved by the boundPosition handler.+ var _getBoundPosition = (0, _positionFns.getBoundPosition)(_this, newState.x, newState.y);++ var _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2);++ newState.x = _getBoundPosition2[0];+ newState.y = _getBoundPosition2[1];+ newState.slackX = _this.state.slackX + (_x - newState.x);+ newState.slackY = _this.state.slackY + (_y - newState.y);++ // Update the event we fire to reflect what really happened after bounds took effect.+ uiData.x = _x;+ uiData.y = _y;+ uiData.deltaX = newState.x - _this.state.x;+ uiData.deltaY = newState.y - _this.state.y;+ }++ // Short-circuit if user's callback killed it.+ var shouldUpdate = _this.props.onDrag(e, uiData);+ if (shouldUpdate === false) return false;++ _this.setState(newState);+ };++ _this.onDragStop = function (e, coreData) {+ if (!_this.state.dragging) return false;++ // Short-circuit if user's callback killed it.+ var shouldStop = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_this, coreData));+ if (shouldStop === false) return false;++ (0, _log2.default)('Draggable: onDragStop: %j', coreData);++ var newState /*: $Shape<DraggableState>*/ = {+ dragging: false,+ slackX: 0,+ slackY: 0+ };++ // If this is a controlled component, the result of this operation will be to+ // revert back to the old position. We expect a handler on `onDragStop`, at the least.+ var controlled = Boolean(_this.props.position);+ if (controlled) {+ var _this$props$position = _this.props.position,+ _x2 = _this$props$position.x,+ _y2 = _this$props$position.y;++ newState.x = _x2;+ newState.y = _y2;+ }++ _this.setState(newState);+ };++ _this.state = {+ // Whether or not we are currently dragging.+ dragging: false,++ // Whether or not we have been dragged before.+ dragged: false,++ // Current transform x and y.+ x: props.position ? props.position.x : props.defaultPosition.x,+ y: props.position ? props.position.y : props.defaultPosition.y,++ // Used for compensating for out-of-bounds drags+ slackX: 0, slackY: 0,++ // Can only determine if SVG after mounting+ isElementSVG: false+ };+ return _this;+ }++ _createClass(Draggable, [{+ key: 'componentWillMount',+ value: function componentWillMount() {+ if (this.props.position && !(this.props.onDrag || this.props.onStop)) {+ // eslint-disable-next-line+ console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.');+ }+ }+ }, {+ key: 'componentDidMount',+ value: function componentDidMount() {+ // Check to see if the element passed is an instanceof SVGElement+ if (typeof SVGElement !== 'undefined' && _reactDom2.default.findDOMNode(this) instanceof SVGElement) {+ this.setState({ isElementSVG: true });+ }+ }+ }, {+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(nextProps /*: Object*/) {+ // Set x/y if position has changed+ if (nextProps.position && (!this.props.position || nextProps.position.x !== this.props.position.x || nextProps.position.y !== this.props.position.y)) {+ this.setState({ x: nextProps.position.x, y: nextProps.position.y });+ }+ }+ }, {+ key: 'componentWillUnmount',+ value: function componentWillUnmount() {+ this.setState({ dragging: false }); // prevents invariant if unmounted while dragging+ }+ }, {+ key: 'render',+ value: function render() /*: React.Element<any>*/ {+ var _classNames;++ var style = {},+ svgTransform = null;++ // If this is controlled, we don't want to move it - unless it's dragging.+ var controlled = Boolean(this.props.position);+ var draggable = !controlled || this.state.dragging;++ var position = this.props.position || this.props.defaultPosition;+ var transformOpts = {+ // Set left if horizontal drag is enabled+ x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : position.x,++ // Set top if vertical drag is enabled+ y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : position.y+ };++ // If this element was SVG, we use the `transform` attribute.+ if (this.state.isElementSVG) {+ svgTransform = (0, _domFns.createSVGTransform)(transformOpts);+ } else {+ // Add a CSS transform to move the element around. This allows us to move the element around+ // without worrying about whether or not it is relatively or absolutely positioned.+ // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable>+ // has a clean slate.+ style = (0, _domFns.createCSSTransform)(transformOpts);+ }++ var _props = this.props,+ defaultClassName = _props.defaultClassName,+ defaultClassNameDragging = _props.defaultClassNameDragging,+ defaultClassNameDragged = _props.defaultClassNameDragged;++ // Mark with class while dragging++ var className = (0, _classnames2.default)(this.props.children.props.className || '', defaultClassName, (_classNames = {}, _defineProperty(_classNames, defaultClassNameDragging, this.state.dragging), _defineProperty(_classNames, defaultClassNameDragged, this.state.dragged), _classNames));++ // Reuse the child provided+ // This makes it flexible to use whatever element is wanted (div, ul, etc)+ return _react2.default.createElement(+ _DraggableCore2.default,+ _extends({}, this.props, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }),+ _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {+ className: className,+ style: _extends({}, this.props.children.props.style, style),+ transform: svgTransform+ })+ );+ }+ }]);++ return Draggable;+ }(_react2.default.Component);++ Draggable.displayName = 'Draggable';+ Draggable.propTypes = _extends({}, _DraggableCore2.default.propTypes, {++ /**+ * `axis` determines which axis the draggable can move.+ *+ * Note that all callbacks will still return data as normal. This only+ * controls flushing to the DOM.+ *+ * 'both' allows movement horizontally and vertically.+ * 'x' limits movement to horizontal axis.+ * 'y' limits movement to vertical axis.+ * 'none' limits all movement.+ *+ * Defaults to 'both'.+ */+ axis: _react.PropTypes.oneOf(['both', 'x', 'y', 'none']),++ /**+ * `bounds` determines the range of movement available to the element.+ * Available values are:+ *+ * 'parent' restricts movement within the Draggable's parent node.+ *+ * Alternatively, pass an object with the following properties, all of which are optional:+ *+ * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}+ *+ * All values are in px.+ *+ * Example:+ *+ * ```jsx+ * let App = React.createClass({+ * render: function () {+ * return (+ * <Draggable bounds={{right: 300, bottom: 300}}>+ * <div>Content</div>+ * </Draggable>+ * );+ * }+ * });+ * ```+ */+ bounds: _react.PropTypes.oneOfType([_react.PropTypes.shape({+ left: _react.PropTypes.number,+ right: _react.PropTypes.number,+ top: _react.PropTypes.number,+ bottom: _react.PropTypes.number+ }), _react.PropTypes.string, _react.PropTypes.oneOf([false])]),++ defaultClassName: _react.PropTypes.string,+ defaultClassNameDragging: _react.PropTypes.string,+ defaultClassNameDragged: _react.PropTypes.string,++ /**+ * `defaultPosition` specifies the x and y that the dragged item should start at+ *+ * Example:+ *+ * ```jsx+ * let App = React.createClass({+ * render: function () {+ * return (+ * <Draggable defaultPosition={{x: 25, y: 25}}>+ * <div>I start with transformX: 25px and transformY: 25px;</div>+ * </Draggable>+ * );+ * }+ * });+ * ```+ */+ defaultPosition: _react.PropTypes.shape({+ x: _react.PropTypes.number,+ y: _react.PropTypes.number+ }),++ /**+ * `position`, if present, defines the current position of the element.+ *+ * This is similar to how form elements in React work - if no `position` is supplied, the component+ * is uncontrolled.+ *+ * Example:+ *+ * ```jsx+ * let App = React.createClass({+ * render: function () {+ * return (+ * <Draggable position={{x: 25, y: 25}}>+ * <div>I start with transformX: 25px and transformY: 25px;</div>+ * </Draggable>+ * );+ * }+ * });+ * ```+ */+ position: _react.PropTypes.shape({+ x: _react.PropTypes.number,+ y: _react.PropTypes.number+ }),++ /**+ * These properties should be defined on the child, not here.+ */+ className: _shims.dontSetMe,+ style: _shims.dontSetMe,+ transform: _shims.dontSetMe+ });+ Draggable.defaultProps = _extends({}, _DraggableCore2.default.defaultProps, {+ axis: 'both',+ bounds: false,+ defaultClassName: 'react-draggable',+ defaultClassNameDragging: 'react-draggable-dragging',+ defaultClassNameDragged: 'react-draggable-dragged',+ defaultPosition: { x: 0, y: 0 },+ position: null+ });+ exports.default = Draggable;++/***/ },+/* 2 */+/***/ function(module, exports) {++ module.exports = __WEBPACK_EXTERNAL_MODULE_2__;++/***/ },+/* 3 */+/***/ function(module, exports) {++ module.exports = __WEBPACK_EXTERNAL_MODULE_3__;++/***/ },+/* 4 */+/***/ function(module, exports, __webpack_require__) {++ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!+ Copyright (c) 2016 Jed Watson.+ Licensed under the MIT License (MIT), see+ http://jedwatson.github.io/classnames+ */+ /* global define */++ (function () {+ 'use strict';++ var hasOwn = {}.hasOwnProperty;++ function classNames () {+ var classes = [];++ for (var i = 0; i < arguments.length; i++) {+ var arg = arguments[i];+ if (!arg) continue;++ var argType = typeof arg;++ if (argType === 'string' || argType === 'number') {+ classes.push(arg);+ } else if (Array.isArray(arg)) {+ classes.push(classNames.apply(null, arg));+ } else if (argType === 'object') {+ for (var key in arg) {+ if (hasOwn.call(arg, key) && arg[key]) {+ classes.push(key);+ }+ }+ }+ }++ return classes.join(' ');+ }++ if (typeof module !== 'undefined' && module.exports) {+ module.exports = classNames;+ } else if (true) {+ // register as 'classnames', consistent with npm package name+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {+ return classNames;+ }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));+ } else {+ window.classNames = classNames;+ }+ }());+++/***/ },+/* 5 */+/***/ function(module, exports, __webpack_require__) {++ 'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });++ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };++ exports.matchesSelector = matchesSelector;+ exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo;+ exports.addEvent = addEvent;+ exports.removeEvent = removeEvent;+ exports.outerHeight = outerHeight;+ exports.outerWidth = outerWidth;+ exports.innerHeight = innerHeight;+ exports.innerWidth = innerWidth;+ exports.offsetXYFromParent = offsetXYFromParent;+ exports.createCSSTransform = createCSSTransform;+ exports.createSVGTransform = createSVGTransform;+ exports.getTouch = getTouch;+ exports.getTouchIdentifier = getTouchIdentifier;+ exports.addUserSelectStyles = addUserSelectStyles;+ exports.removeUserSelectStyles = removeUserSelectStyles;+ exports.styleHacks = styleHacks;++ var _shims = __webpack_require__(6);++ var _getPrefix = __webpack_require__(7);++ var _getPrefix2 = _interopRequireDefault(_getPrefix);++ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }++ /*:: import type {ControlPosition} from './types';*/+++ var matchesSelectorFunc = '';+ function matchesSelector(el /*: Node*/, selector /*: string*/) /*: boolean*/ {+ if (!matchesSelectorFunc) {+ matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) {+ // $FlowIgnore: Doesn't think elements are indexable+ return (0, _shims.isFunction)(el[method]);+ });+ }++ // $FlowIgnore: Doesn't think elements are indexable+ return el[matchesSelectorFunc].call(el, selector);+ }++ // Works up the tree to the draggable itself attempting to match selector.+ function matchesSelectorAndParentsTo(el /*: Node*/, selector /*: string*/, baseNode /*: Node*/) /*: boolean*/ {+ var node = el;+ do {+ if (matchesSelector(node, selector)) return true;+ if (node === baseNode) return false;+ node = node.parentNode;+ } while (node);++ return false;+ }++ function addEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {+ if (!el) {+ return;+ }+ if (el.attachEvent) {+ el.attachEvent('on' + event, handler);+ } else if (el.addEventListener) {+ el.addEventListener(event, handler, true);+ } else {+ // $FlowIgnore: Doesn't think elements are indexable+ el['on' + event] = handler;+ }+ }++ function removeEvent(el /*: ?Node*/, event /*: string*/, handler /*: Function*/) /*: void*/ {+ if (!el) {+ return;+ }+ if (el.detachEvent) {+ el.detachEvent('on' + event, handler);+ } else if (el.removeEventListener) {+ el.removeEventListener(event, handler, true);+ } else {+ // $FlowIgnore: Doesn't think elements are indexable+ el['on' + event] = null;+ }+ }++ function outerHeight(node /*: HTMLElement*/) /*: number*/ {+ // This is deliberately excluding margin for our calculations, since we are using+ // offsetTop which is including margin. See getBoundPosition+ var height = node.clientHeight;+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);+ height += (0, _shims.int)(computedStyle.borderTopWidth);+ height += (0, _shims.int)(computedStyle.borderBottomWidth);+ return height;+ }++ function outerWidth(node /*: HTMLElement*/) /*: number*/ {+ // This is deliberately excluding margin for our calculations, since we are using+ // offsetLeft which is including margin. See getBoundPosition+ var width = node.clientWidth;+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);+ width += (0, _shims.int)(computedStyle.borderLeftWidth);+ width += (0, _shims.int)(computedStyle.borderRightWidth);+ return width;+ }+ function innerHeight(node /*: HTMLElement*/) /*: number*/ {+ var height = node.clientHeight;+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);+ height -= (0, _shims.int)(computedStyle.paddingTop);+ height -= (0, _shims.int)(computedStyle.paddingBottom);+ return height;+ }++ function innerWidth(node /*: HTMLElement*/) /*: number*/ {+ var width = node.clientWidth;+ var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node);+ width -= (0, _shims.int)(computedStyle.paddingLeft);+ width -= (0, _shims.int)(computedStyle.paddingRight);+ return width;+ }++ // Get from offsetParent+ function offsetXYFromParent(evt /*: {clientX: number, clientY: number}*/, offsetParent /*: HTMLElement*/) /*: ControlPosition*/ {+ var isBody = offsetParent === offsetParent.ownerDocument.body;+ var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect();++ var x = evt.clientX + offsetParent.scrollLeft - offsetParentRect.left;+ var y = evt.clientY + offsetParent.scrollTop - offsetParentRect.top;++ return { x: x, y: y };+ }++ function createCSSTransform(_ref) /*: Object*/ {+ var x = _ref.x,+ y = _ref.y;++ // Replace unitless items with px+ return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix2.default), 'translate(' + x + 'px,' + y + 'px)');+ }++ function createSVGTransform(_ref3) /*: string*/ {+ var x = _ref3.x,+ y = _ref3.y;++ return 'translate(' + x + ',' + y + ')';+ }++ function getTouch(e /*: MouseTouchEvent*/, identifier /*: number*/) /*: ?{clientX: number, clientY: number}*/ {+ return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) {+ return identifier === t.identifier;+ }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) {+ return identifier === t.identifier;+ });+ }++ function getTouchIdentifier(e /*: MouseTouchEvent*/) /*: ?number*/ {+ if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;+ if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;+ }++ // User-select Hacks:+ //+ // Useful for preventing blue highlights all over everything when dragging.+ var userSelectPrefix = (0, _getPrefix.getPrefix)('user-select');+ var userSelect = (0, _getPrefix.browserPrefixToStyle)('user-select', userSelectPrefix);+ var userSelectStyle = ';' + userSelect + ': none;';+ var userSelectReplaceRegExp = new RegExp(';?' + userSelect + ': none;'); // leading ; not present on IE++ // Note we're passing `document` b/c we could be iframed+ function addUserSelectStyles(body /*: HTMLElement*/) {+ var style = body.getAttribute('style') || '';+ body.setAttribute('style', style + userSelectStyle);+ }++ function removeUserSelectStyles(body /*: HTMLElement*/) {+ var style = body.getAttribute('style') || '';+ body.setAttribute('style', style.replace(userSelectReplaceRegExp, ''));+ }++ function styleHacks() /*: Object*/ {+ var childStyle /*: Object*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};++ // Workaround IE pointer events; see #51+ // https://github.com/mzabriskie/react-draggable/issues/51#issuecomment-103488278+ return _extends({+ touchAction: 'none'+ }, childStyle);+ }++/***/ },+/* 6 */+/***/ function(module, exports) {++ 'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });+ exports.findInArray = findInArray;+ exports.isFunction = isFunction;+ exports.isNum = isNum;+ exports.int = int;+ exports.dontSetMe = dontSetMe;++ // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc+ function findInArray(array /*: Array<any> | TouchList*/, callback /*: Function*/) /*: any*/ {+ for (var i = 0, length = array.length; i < length; i++) {+ if (callback.apply(callback, [array[i], i, array])) return array[i];+ }+ }++ function isFunction(func /*: any*/) /*: boolean*/ {+ return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]';+ }++ function isNum(num /*: any*/) /*: boolean*/ {+ return typeof num === 'number' && !isNaN(num);+ }++ function int(a /*: string*/) /*: number*/ {+ return parseInt(a, 10);+ }++ function dontSetMe(props /*: Object*/, propName /*: string*/, componentName /*: string*/) {+ if (props[propName]) {+ return new Error('Invalid prop ' + propName + ' passed to ' + componentName + ' - do not set this, set it on the child.');+ }+ }++/***/ },+/* 7 */+/***/ function(module, exports) {++ 'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });+ exports.getPrefix = getPrefix;+ exports.browserPrefixToKey = browserPrefixToKey;+ exports.browserPrefixToStyle = browserPrefixToStyle;+ var prefixes = ['Moz', 'Webkit', 'O', 'ms'];+ function getPrefix() /*: string*/ {+ var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';++ // Checking specifically for 'window.document' is for pseudo-browser server-side+ // environments that define 'window' as the global context.+ // E.g. React-rails (see https://github.com/reactjs/react-rails/pull/84)+ if (typeof window === 'undefined' || typeof window.document === 'undefined') return '';++ var style = window.document.documentElement.style;++ if (prop in style) return '';++ for (var i = 0; i < prefixes.length; i++) {+ if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i];+ }++ return '';+ }++ function browserPrefixToKey(prop /*: string*/, prefix /*: string*/) /*: string*/ {+ return prefix ? '' + prefix + kebabToTitleCase(prop) : prop;+ }++ function browserPrefixToStyle(prop /*: string*/, prefix /*: string*/) /*: string*/ {+ return prefix ? '-' + prefix.toLowerCase() + '-' + prop : prop;+ }++ function kebabToTitleCase(str /*: string*/) /*: string*/ {+ var out = '';+ var shouldCapitalize = true;+ for (var i = 0; i < str.length; i++) {+ if (shouldCapitalize) {+ out += str[i].toUpperCase();+ shouldCapitalize = false;+ } else if (str[i] === '-') {+ shouldCapitalize = true;+ } else {+ out += str[i];+ }+ }+ return out;+ }++ // Default export is the prefix itself, like 'Moz', 'Webkit', etc+ // Note that you may have to re-test for certain things; for instance, Chrome 50+ // can handle unprefixed `transform`, but not unprefixed `user-select`+ exports.default = getPrefix();++/***/ },+/* 8 */+/***/ function(module, exports, __webpack_require__) {++ 'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });+ exports.getBoundPosition = getBoundPosition;+ exports.snapToGrid = snapToGrid;+ exports.canDragX = canDragX;+ exports.canDragY = canDragY;+ exports.getControlPosition = getControlPosition;+ exports.createCoreData = createCoreData;+ exports.createDraggableData = createDraggableData;++ var _shims = __webpack_require__(6);++ var _reactDom = __webpack_require__(3);++ var _reactDom2 = _interopRequireDefault(_reactDom);++ var _domFns = __webpack_require__(5);++ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++ /*:: import type Draggable from '../Draggable';*/+ /*:: import type {Bounds, ControlPosition, DraggableData} from './types';*/+ /*:: import type DraggableCore from '../DraggableCore';*/+ function getBoundPosition(draggable /*: Draggable*/, x /*: number*/, y /*: number*/) /*: [number, number]*/ {+ // If no bounds, short-circuit and move on+ if (!draggable.props.bounds) return [x, y];++ // Clone new bounds+ var bounds = draggable.props.bounds;++ bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds);+ var node = _reactDom2.default.findDOMNode(draggable);++ if (typeof bounds === 'string') {+ var ownerDocument = node.ownerDocument;++ var ownerWindow = ownerDocument.defaultView;+ var boundNode = void 0;+ if (bounds === 'parent') {+ boundNode = node.parentNode;+ } else {+ boundNode = ownerDocument.querySelector(bounds);+ if (!boundNode) throw new Error('Bounds selector "' + bounds + '" could not find an element.');+ }+ var nodeStyle = ownerWindow.getComputedStyle(node);+ var boundNodeStyle = ownerWindow.getComputedStyle(boundNode);+ // Compute bounds. This is a pain with padding and offsets but this gets it exactly right.+ bounds = {+ left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.borderLeftWidth) + (0, _shims.int)(nodeStyle.marginLeft),+ top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.borderTopWidth) + (0, _shims.int)(nodeStyle.marginTop),+ right: (0, _domFns.innerWidth)(boundNode) - (0, _domFns.outerWidth)(node) - node.offsetLeft,+ bottom: (0, _domFns.innerHeight)(boundNode) - (0, _domFns.outerHeight)(node) - node.offsetTop+ };+ }++ // Keep x and y below right and bottom limits...+ if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right);+ if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom);++ // But above left and top limits.+ if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left);+ if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top);++ return [x, y];+ }++ function snapToGrid(grid /*: [number, number]*/, pendingX /*: number*/, pendingY /*: number*/) /*: [number, number]*/ {+ var x = Math.round(pendingX / grid[0]) * grid[0];+ var y = Math.round(pendingY / grid[1]) * grid[1];+ return [x, y];+ }++ function canDragX(draggable /*: Draggable*/) /*: boolean*/ {+ return draggable.props.axis === 'both' || draggable.props.axis === 'x';+ }++ function canDragY(draggable /*: Draggable*/) /*: boolean*/ {+ return draggable.props.axis === 'both' || draggable.props.axis === 'y';+ }++ // Get {x, y} positions from event.+ function getControlPosition(e /*: MouseTouchEvent*/, touchIdentifier /*: ?number*/, draggableCore /*: DraggableCore*/) /*: ?ControlPosition*/ {+ var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null;+ if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch+ var node = _reactDom2.default.findDOMNode(draggableCore);+ // User can provide an offsetParent if desired.+ var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body;+ return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent);+ }++ // Create an data object exposed by <DraggableCore>'s events+ function createCoreData(draggable /*: DraggableCore*/, x /*: number*/, y /*: number*/) /*: DraggableData*/ {+ var state = draggable.state;+ var isStart = !(0, _shims.isNum)(state.lastX);++ if (isStart) {+ // If this is our first move, use the x and y as last coords.+ return {+ node: _reactDom2.default.findDOMNode(draggable),+ deltaX: 0, deltaY: 0,+ lastX: x, lastY: y,+ x: x, y: y+ };+ } else {+ // Otherwise calculate proper values.+ return {+ node: _reactDom2.default.findDOMNode(draggable),+ deltaX: x - state.lastX, deltaY: y - state.lastY,+ lastX: state.lastX, lastY: state.lastY,+ x: x, y: y+ };+ }+ }++ // Create an data exposed by <Draggable>'s events+ function createDraggableData(draggable /*: Draggable*/, coreData /*: DraggableData*/) /*: DraggableData*/ {+ return {+ node: coreData.node,+ x: draggable.state.x + coreData.deltaX,+ y: draggable.state.y + coreData.deltaY,+ deltaX: coreData.deltaX,+ deltaY: coreData.deltaY,+ lastX: draggable.state.x,+ lastY: draggable.state.y+ };+ }++ // A lot faster than stringify/parse+ function cloneBounds(bounds /*: Bounds*/) /*: Bounds*/ {+ return {+ left: bounds.left,+ top: bounds.top,+ right: bounds.right,+ bottom: bounds.bottom+ };+ }++/***/ },+/* 9 */+/***/ function(module, exports, __webpack_require__) {++ /* WEBPACK VAR INJECTION */(function(process) {'use strict';++ Object.defineProperty(exports, "__esModule", {+ value: true+ });++ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();++ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++ var _react = __webpack_require__(2);++ var _react2 = _interopRequireDefault(_react);++ var _reactDom = __webpack_require__(3);++ var _reactDom2 = _interopRequireDefault(_reactDom);++ var _domFns = __webpack_require__(5);++ var _positionFns = __webpack_require__(8);++ var _shims = __webpack_require__(6);++ var _log = __webpack_require__(11);++ var _log2 = _interopRequireDefault(_log);++ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }++ // Simple abstraction for dragging events names.+ /*:: import type {EventHandler} from './utils/types';*/+ var eventsFor = {+ touch: {+ start: 'touchstart',+ move: 'touchmove',+ stop: 'touchend'+ },+ mouse: {+ start: 'mousedown',+ move: 'mousemove',+ stop: 'mouseup'+ }+ };++ // Default to mouse events.+ var dragEventFor = eventsFor.mouse;++ //+ // Define <DraggableCore>.+ //+ // <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can+ // work well with libraries that require more control over the element.+ //++ /*:: type CoreState = {+ dragging: boolean,+ lastX: number,+ lastY: number,+ touchIdentifier: ?number+ };*/++ var DraggableCore = function (_React$Component) {+ _inherits(DraggableCore, _React$Component);++ function DraggableCore() {+ var _ref;++ var _temp, _this, _ret;++ _classCallCheck(this, DraggableCore);++ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {+ args[_key] = arguments[_key];+ }++ return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = DraggableCore.__proto__ || Object.getPrototypeOf(DraggableCore)).call.apply(_ref, [this].concat(args))), _this), _this.state = {+ dragging: false,+ // Used while dragging to determine deltas.+ lastX: NaN, lastY: NaN,+ touchIdentifier: null+ }, _this.handleDragStart = function (e) {+ // Make it possible to attach event handlers on top of this one.+ _this.props.onMouseDown(e);++ // Only accept left-clicks.+ if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false;++ // Get nodes. Be sure to grab relative document (could be iframed)+ var domNode = _reactDom2.default.findDOMNode(_this);+ var ownerDocument = domNode.ownerDocument;++ // Short circuit if handle or cancel prop was provided and selector doesn't match.++ if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, domNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, domNode)) {+ return;+ }++ // Set touch identifier in component state if this is a touch event. This allows us to+ // distinguish between individual touches on multitouch screens by identifying which+ // touchpoint was set to this element.+ var touchIdentifier = (0, _domFns.getTouchIdentifier)(e);+ _this.setState({ touchIdentifier: touchIdentifier });++ // Get the current drag point from the event. This is used as the offset.+ var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _this);+ if (position == null) return; // not possible but satisfies flow+ var x = position.x,+ y = position.y;++ // Create an event object with all the data parents need to make a decision here.++ var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);++ (0, _log2.default)('DraggableCore: handleDragStart: %j', coreEvent);++ // Call event handler. If it returns explicit false, cancel.+ (0, _log2.default)('calling', _this.props.onStart);+ var shouldUpdate = _this.props.onStart(e, coreEvent);+ if (shouldUpdate === false) return;++ // Add a style to the body to disable user-select. This prevents text from+ // being selected all over the page.+ if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument.body);++ // Initiate dragging. Set the current x and y as offsets+ // so we know how much we've moved during the drag. This allows us+ // to drag elements around even if they have been moved, without issue.+ _this.setState({+ dragging: true,++ lastX: x,+ lastY: y+ });++ // Add events to the document directly so we catch when the user's mouse/touch moves outside of+ // this element. We use different events depending on whether or not we have detected that this+ // is a touch-capable device.+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);+ (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);+ }, _this.handleDrag = function (e) {++ // Prevent scrolling on mobile devices, like ipad/iphone.+ if (e.type === 'touchmove') e.preventDefault();++ // Get the current drag point from the event. This is used as the offset.+ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);+ if (position == null) return;+ var x = position.x,+ y = position.y;++ // Snap to grid if prop has been provided++ if (x !== x) debugger;++ if (Array.isArray(_this.props.grid)) {+ var deltaX = x - _this.state.lastX,+ deltaY = y - _this.state.lastY;++ var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY);++ var _snapToGrid2 = _slicedToArray(_snapToGrid, 2);++ deltaX = _snapToGrid2[0];+ deltaY = _snapToGrid2[1];++ if (!deltaX && !deltaY) return; // skip useless drag+ x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY;+ }++ var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);++ (0, _log2.default)('DraggableCore: handleDrag: %j', coreEvent);++ // Call event handler. If it returns explicit false, trigger end.+ var shouldUpdate = _this.props.onDrag(e, coreEvent);+ if (shouldUpdate === false) {+ try {+ // $FlowIgnore+ _this.handleDragStop(new MouseEvent('mouseup'));+ } catch (err) {+ // Old browsers+ var event = ((document.createEvent('MouseEvents') /*: any*/) /*: MouseTouchEvent*/);+ // I see why this insanity was deprecated+ // $FlowIgnore+ event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);+ _this.handleDragStop(event);+ }+ return;+ }++ _this.setState({+ lastX: x,+ lastY: y+ });+ }, _this.handleDragStop = function (e) {+ if (!_this.state.dragging) return;++ var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _this);+ if (position == null) return;+ var x = position.x,+ y = position.y;++ var coreEvent = (0, _positionFns.createCoreData)(_this, x, y);++ var _ReactDOM$findDOMNode = _reactDom2.default.findDOMNode(_this),+ ownerDocument = _ReactDOM$findDOMNode.ownerDocument;++ // Remove user-select hack+++ if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument.body);++ (0, _log2.default)('DraggableCore: handleDragStop: %j', coreEvent);++ // Reset the el.+ _this.setState({+ dragging: false,+ lastX: NaN,+ lastY: NaN+ });++ // Call event handler+ _this.props.onStop(e, coreEvent);++ // Remove event handlers+ (0, _log2.default)('DraggableCore: Removing handlers');+ (0, _domFns.removeEvent)(ownerDocument, dragEventFor.move, _this.handleDrag);+ (0, _domFns.removeEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);+ }, _this.onMouseDown = function (e) {+ dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse++ return _this.handleDragStart(e);+ }, _this.onMouseUp = function (e) {+ dragEventFor = eventsFor.mouse;++ return _this.handleDragStop(e);+ }, _this.onTouchStart = function (e) {+ // We're on a touch device now, so change the event handlers+ dragEventFor = eventsFor.touch;++ return _this.handleDragStart(e);+ }, _this.onTouchEnd = function (e) {+ // We're on a touch device now, so change the event handlers+ dragEventFor = eventsFor.touch;++ return _this.handleDragStop(e);+ }, _temp), _possibleConstructorReturn(_this, _ret);+ }++ _createClass(DraggableCore, [{+ key: 'componentWillUnmount',+ value: function componentWillUnmount() {+ // Remove any leftover event handlers. Remove both touch and mouse handlers in case+ // some browser quirk caused a touch event to fire during a mouse move, or vice versa.+ var _ReactDOM$findDOMNode2 = _reactDom2.default.findDOMNode(this),+ ownerDocument = _ReactDOM$findDOMNode2.ownerDocument;++ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag);+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag);+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop);+ (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop);+ if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument.body);+ }++ // Same as onMouseDown (start drag), but now consider this a touch device.++ }, {+ key: 'render',+ value: function render() /*: React.Element<any>*/ {+ // Reuse the child provided+ // This makes it flexible to use whatever element is wanted (div, ul, etc)+ return _react2.default.cloneElement(_react2.default.Children.only(this.props.children), {+ style: (0, _domFns.styleHacks)(this.props.children.props.style),++ // Note: mouseMove handler is attached to document so it will still function+ // when the user drags quickly and leaves the bounds of the element.+ onMouseDown: this.onMouseDown,+ onTouchStart: this.onTouchStart,+ onMouseUp: this.onMouseUp,+ onTouchEnd: this.onTouchEnd+ });+ }+ }]);++ return DraggableCore;+ }(_react2.default.Component);++ DraggableCore.displayName = 'DraggableCore';+ DraggableCore.propTypes = {+ /**+ * `allowAnyClick` allows dragging using any mouse button.+ * By default, we only accept the left button.+ *+ * Defaults to `false`.+ */+ allowAnyClick: _react.PropTypes.bool,++ /**+ * `disabled`, if true, stops the <Draggable> from dragging. All handlers,+ * with the exception of `onMouseDown`, will not fire.+ */+ disabled: _react.PropTypes.bool,++ /**+ * By default, we add 'user-select:none' attributes to the document body+ * to prevent ugly text selection during drag. If this is causing problems+ * for your app, set this to `false`.+ */+ enableUserSelectHack: _react.PropTypes.bool,++ /**+ * `offsetParent`, if set, uses the passed DOM node to compute drag offsets+ * instead of using the parent node.+ */+ offsetParent: function offsetParent(props, propName) {+ if (process.browser && props[propName] && props[propName].nodeType !== 1) {+ throw new Error('Draggable\'s offsetParent must be a DOM Node.');+ }+ },++ /**+ * `grid` specifies the x and y that dragging should snap to.+ */+ grid: _react.PropTypes.arrayOf(_react.PropTypes.number),++ /**+ * `handle` specifies a selector to be used as the handle that initiates drag.+ *+ * Example:+ *+ * ```jsx+ * let App = React.createClass({+ * render: function () {+ * return (+ * <Draggable handle=".handle">+ * <div>+ * <div className="handle">Click me to drag</div>+ * <div>This is some other content</div>+ * </div>+ * </Draggable>+ * );+ * }+ * });+ * ```+ */+ handle: _react.PropTypes.string,++ /**+ * `cancel` specifies a selector to be used to prevent drag initialization.+ *+ * Example:+ *+ * ```jsx+ * let App = React.createClass({+ * render: function () {+ * return(+ * <Draggable cancel=".cancel">+ * <div>+ * <div className="cancel">You can't drag from here</div>+ * <div>Dragging here works fine</div>+ * </div>+ * </Draggable>+ * );+ * }+ * });+ * ```+ */+ cancel: _react.PropTypes.string,++ /**+ * Called when dragging starts.+ * If this function returns the boolean false, dragging will be canceled.+ */+ onStart: _react.PropTypes.func,++ /**+ * Called while dragging.+ * If this function returns the boolean false, dragging will be canceled.+ */+ onDrag: _react.PropTypes.func,++ /**+ * Called when dragging stops.+ * If this function returns the boolean false, the drag will remain active.+ */+ onStop: _react.PropTypes.func,++ /**+ * A workaround option which can be passed if onMouseDown needs to be accessed,+ * since it'll always be blocked (as there is internal use of onMouseDown)+ */+ onMouseDown: _react.PropTypes.func,++ /**+ * These properties should be defined on the child, not here.+ */+ className: _shims.dontSetMe,+ style: _shims.dontSetMe,+ transform: _shims.dontSetMe+ };+ DraggableCore.defaultProps = {+ allowAnyClick: false, // by default only accept left click+ cancel: null,+ disabled: false,+ enableUserSelectHack: true,+ offsetParent: null,+ handle: null,+ grid: null,+ transform: null,+ onStart: function onStart() {},+ onDrag: function onDrag() {},+ onStop: function onStop() {},+ onMouseDown: function onMouseDown() {}+ };+ exports.default = DraggableCore;+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10)))++/***/ },+/* 10 */+/***/ function(module, exports) {++ // shim for using process in browser+ var process = module.exports = {};++ // cached from whatever global is present so that test runners that stub it+ // don't break things. But we need to wrap it in a try catch in case it is+ // wrapped in strict mode code which doesn't define any globals. It's inside a+ // function because try/catches deoptimize in certain engines.++ var cachedSetTimeout;+ var cachedClearTimeout;++ function defaultSetTimout() {+ throw new Error('setTimeout has not been defined');+ }+ function defaultClearTimeout () {+ throw new Error('clearTimeout has not been defined');+ }+ (function () {+ try {+ if (typeof setTimeout === 'function') {+ cachedSetTimeout = setTimeout;+ } else {+ cachedSetTimeout = defaultSetTimout;+ }+ } catch (e) {+ cachedSetTimeout = defaultSetTimout;+ }+ try {+ if (typeof clearTimeout === 'function') {+ cachedClearTimeout = clearTimeout;+ } else {+ cachedClearTimeout = defaultClearTimeout;+ }+ } catch (e) {+ cachedClearTimeout = defaultClearTimeout;+ }+ } ())+ function runTimeout(fun) {+ if (cachedSetTimeout === setTimeout) {+ //normal enviroments in sane situations+ return setTimeout(fun, 0);+ }+ // if setTimeout wasn't available but was latter defined+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {+ cachedSetTimeout = setTimeout;+ return setTimeout(fun, 0);+ }+ try {+ // when when somebody has screwed with setTimeout but no I.E. maddness+ return cachedSetTimeout(fun, 0);+ } catch(e){+ try {+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally+ return cachedSetTimeout.call(null, fun, 0);+ } catch(e){+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error+ return cachedSetTimeout.call(this, fun, 0);+ }+ }+++ }+ function runClearTimeout(marker) {+ if (cachedClearTimeout === clearTimeout) {+ //normal enviroments in sane situations+ return clearTimeout(marker);+ }+ // if clearTimeout wasn't available but was latter defined+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {+ cachedClearTimeout = clearTimeout;+ return clearTimeout(marker);+ }+ try {+ // when when somebody has screwed with setTimeout but no I.E. maddness+ return cachedClearTimeout(marker);+ } catch (e){+ try {+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally+ return cachedClearTimeout.call(null, marker);+ } catch (e){+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout+ return cachedClearTimeout.call(this, marker);+ }+ }++++ }+ var queue = [];+ var draining = false;+ var currentQueue;+ var queueIndex = -1;++ function cleanUpNextTick() {+ if (!draining || !currentQueue) {+ return;+ }+ draining = false;+ if (currentQueue.length) {+ queue = currentQueue.concat(queue);+ } else {+ queueIndex = -1;+ }+ if (queue.length) {+ drainQueue();+ }+ }++ function drainQueue() {+ if (draining) {+ return;+ }+ var timeout = runTimeout(cleanUpNextTick);+ draining = true;++ var len = queue.length;+ while(len) {+ currentQueue = queue;+ queue = [];+ while (++queueIndex < len) {+ if (currentQueue) {+ currentQueue[queueIndex].run();+ }+ }+ queueIndex = -1;+ len = queue.length;+ }+ currentQueue = null;+ draining = false;+ runClearTimeout(timeout);+ }++ process.nextTick = function (fun) {+ var args = new Array(arguments.length - 1);+ if (arguments.length > 1) {+ for (var i = 1; i < arguments.length; i++) {+ args[i - 1] = arguments[i];+ }+ }+ queue.push(new Item(fun, args));+ if (queue.length === 1 && !draining) {+ runTimeout(drainQueue);+ }+ };++ // v8 likes predictible objects+ function Item(fun, array) {+ this.fun = fun;+ this.array = array;+ }+ Item.prototype.run = function () {+ this.fun.apply(null, this.array);+ };+ process.title = 'browser';+ process.browser = true;+ process.env = {};+ process.argv = [];+ process.version = ''; // empty string to avoid regexp issues+ process.versions = {};++ function noop() {}++ process.on = noop;+ process.addListener = noop;+ process.once = noop;+ process.off = noop;+ process.removeListener = noop;+ process.removeAllListeners = noop;+ process.emit = noop;++ process.binding = function (name) {+ throw new Error('process.binding is not supported');+ };++ process.cwd = function () { return '/' };+ process.chdir = function (dir) {+ throw new Error('process.chdir is not supported');+ };+ process.umask = function() { return 0; };+++/***/ },+/* 11 */+/***/ function(module, exports, __webpack_require__) {++ "use strict";++ Object.defineProperty(exports, "__esModule", {+ value: true+ });+ exports.default = log;++ /*eslint no-console:0*/+ function log() {+ var _console;++ if ((undefined)) (_console = console).log.apply(_console, arguments);+ }++/***/ }+/******/ ])+});+;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],2:[function(require,module,exports){+(function (global){+/**+ * @module InputRange+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();++var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }++function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _Slider = require('./Slider');++var _Slider2 = _interopRequireDefault(_Slider);++var _Track = require('./Track');++var _Track2 = _interopRequireDefault(_Track);++var _Label = require('./Label');++var _Label2 = _interopRequireDefault(_Label);++var _defaultClassNames = require('./defaultClassNames');++var _defaultClassNames2 = _interopRequireDefault(_defaultClassNames);++var _valueTransformer = require('./valueTransformer');++var _valueTransformer2 = _interopRequireDefault(_valueTransformer);++var _util = require('./util');++var _propTypes = require('./propTypes');++/**+ * A map for storing internal members+ * @const {WeakMap}+ */+var internals = new WeakMap();++/**+ * An object storing keyboard key codes+ * @const {Object.<string, number>}+ */+var KeyCode = {+ DOWN_ARROW: 40,+ LEFT_ARROW: 37,+ RIGHT_ARROW: 39,+ UP_ARROW: 38+};++/**+ * Check if values are within the max and min range of inputRange+ * @private+ * @param {InputRange} inputRange - React component+ * @param {Range} values - Min/max value of sliders+ * @return {boolean} True if within range+ */+function isWithinRange(inputRange, values) {+ var props = inputRange.props;++ if (inputRange.isMultiValue) {+ return values.min >= props.minValue && values.max <= props.maxValue && values.min < values.max;+ }++ return values.max >= props.minValue && values.max <= props.maxValue;+}++/**+ * Check if the difference between values and the current values of inputRange+ * is greater or equal to its step amount+ * @private+ * @param {InputRange} inputRange - React component+ * @param {Range} values - Min/max value of sliders+ * @return {boolean} True if difference is greater or equal to step amount+ */+function hasStepDifference(inputRange, values) {+ var props = inputRange.props;++ var currentValues = _valueTransformer2['default'].valuesFromProps(inputRange);++ return (0, _util.length)(values.min, currentValues.min) >= props.step || (0, _util.length)(values.max, currentValues.max) >= props.step;+}++/**+ * Check if inputRange should update with new values+ * @private+ * @param {InputRange} inputRange - React component+ * @param {Range} values - Min/max value of sliders+ * @return {boolean} True if inputRange should update+ */+function shouldUpdate(inputRange, values) {+ return isWithinRange(inputRange, values) && hasStepDifference(inputRange, values);+}++/**+ * Get the owner document of inputRange+ * @private+ * @param {InputRange} inputRange - React component+ * @return {Document} Document+ */+function getDocument(inputRange) {+ var ownerDocument = inputRange.refs.inputRange.ownerDocument;++ return ownerDocument;+}++/**+ * Get the class name(s) of inputRange based on its props+ * @private+ * @param {InputRange} inputRange - React component+ * @return {string} A list of class names delimited with spaces+ */+function getComponentClassName(inputRange) {+ var props = inputRange.props;++ if (!props.disabled) {+ return props.classNames.component;+ }++ return props.classNames.component + ' is-disabled';+}++/**+ * Get the key name of a slider+ * @private+ * @param {InputRange} inputRange - React component+ * @param {Slider} slider - React component+ * @return {string} Key name+ */+function getKeyFromSlider(inputRange, slider) {+ if (slider === inputRange.refs.sliderMin) {+ return 'min';+ }++ return 'max';+}++/**+ * Get all slider keys of inputRange+ * @private+ * @param {InputRange} inputRange - React component+ * @return {Array.<string>} Key names+ */+function getKeys(inputRange) {+ if (inputRange.isMultiValue) {+ return ['min', 'max'];+ }++ return ['max'];+}++/**+ * Get the key name of a slider that's the closest to a point+ * @private+ * @param {InputRange} inputRange - React component+ * @param {Point} position - x/y+ * @return {string} Key name+ */+function getKeyByPosition(inputRange, position) {+ var values = _valueTransformer2['default'].valuesFromProps(inputRange);+ var positions = _valueTransformer2['default'].positionsFromValues(inputRange, values);++ if (inputRange.isMultiValue) {+ var distanceToMin = (0, _util.distanceTo)(position, positions.min);+ var distanceToMax = (0, _util.distanceTo)(position, positions.max);++ if (distanceToMin < distanceToMax) {+ return 'min';+ }+ }++ return 'max';+}++/**+ * Get an array of slider HTML for rendering+ * @private+ * @param {InputRange} inputRange - React component+ * @return {Array.<string>} Array of HTML+ */+function renderSliders(inputRange) {+ var classNames = inputRange.props.classNames;++ var sliders = [];+ var keys = getKeys(inputRange);+ var values = _valueTransformer2['default'].valuesFromProps(inputRange);+ var percentages = _valueTransformer2['default'].percentagesFromValues(inputRange, values);++ var _iteratorNormalCompletion = true;+ var _didIteratorError = false;+ var _iteratorError = undefined;++ try {+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {+ var key = _step.value;++ var value = values[key];+ var percentage = percentages[key];+ var ref = 'slider' + (0, _util.captialize)(key);++ var _inputRange$props = inputRange.props;+ var maxValue = _inputRange$props.maxValue;+ var minValue = _inputRange$props.minValue;++ if (key === 'min') {+ maxValue = values.max;+ } else {+ minValue = values.min;+ }++ var slider = _react2['default'].createElement(_Slider2['default'], {+ ariaLabelledby: inputRange.props.ariaLabelledby,+ ariaControls: inputRange.props.ariaControls,+ classNames: classNames,+ formatLabel: inputRange.formatLabel,+ key: key,+ maxValue: maxValue,+ minValue: minValue,+ onSliderKeyDown: inputRange.handleSliderKeyDown,+ onSliderMouseMove: inputRange.handleSliderMouseMove,+ percentage: percentage,+ ref: ref,+ type: key,+ value: value });++ sliders.push(slider);+ }+ } catch (err) {+ _didIteratorError = true;+ _iteratorError = err;+ } finally {+ try {+ if (!_iteratorNormalCompletion && _iterator['return']) {+ _iterator['return']();+ }+ } finally {+ if (_didIteratorError) {+ throw _iteratorError;+ }+ }+ }++ return sliders;+}++/**+ * Get an array of hidden input HTML for rendering+ * @private+ * @param {InputRange} inputRange - React component+ * @return {Array.<string>} Array of HTML+ */+function renderHiddenInputs(inputRange) {+ var inputs = [];+ var keys = getKeys(inputRange);++ var _iteratorNormalCompletion2 = true;+ var _didIteratorError2 = false;+ var _iteratorError2 = undefined;++ try {+ for (var _iterator2 = keys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {+ var key = _step2.value;++ var _name = inputRange.isMultiValue ? '' + inputRange.props.name + (0, _util.captialize)(key) : inputRange.props.name;++ var input = _react2['default'].createElement('input', { type: 'hidden', name: _name });+ }+ } catch (err) {+ _didIteratorError2 = true;+ _iteratorError2 = err;+ } finally {+ try {+ if (!_iteratorNormalCompletion2 && _iterator2['return']) {+ _iterator2['return']();+ }+ } finally {+ if (_didIteratorError2) {+ throw _iteratorError2;+ }+ }+ }++ return inputs;+}++/**+ * InputRange React component+ * @class+ * @extends React.Component+ * @param {Object} props - React component props+ */++var InputRange = (function (_React$Component) {+ _inherits(InputRange, _React$Component);++ function InputRange(props) {+ _classCallCheck(this, InputRange);++ _get(Object.getPrototypeOf(InputRange.prototype), 'constructor', this).call(this, props);++ // Private+ internals.set(this, {});++ // Auto-bind+ (0, _util.autobind)(['formatLabel', 'handleInteractionEnd', 'handleInteractionStart', 'handleKeyDown', 'handleKeyUp', 'handleMouseDown', 'handleMouseUp', 'handleSliderKeyDown', 'handleSliderMouseMove', 'handleTouchStart', 'handleTouchEnd', 'handleTrackMouseDown'], this);+ }++ /**+ * Accepted propTypes of InputRange+ * @static {Object}+ * @property {Function} ariaLabelledby+ * @property {Function} ariaControls+ * @property {Function} classNames+ * @property {Function} defaultValue+ * @property {Function} disabled+ * @property {Function} formatLabel+ * @property {Function} labelPrefix+ * @property {Function} labelSuffix+ * @property {Function} maxValue+ * @property {Function} minValue+ * @property {Function} name+ * @property {Function} onChange+ * @property {Function} onChangeComplete+ * @property {Function} step+ * @property {Function} value+ */++ /**+ * Return the clientRect of the component's track+ * @member {ClientRect}+ */++ _createClass(InputRange, [{+ key: 'updatePosition',++ /**+ * Update the position of a slider by key+ * @param {string} key - min/max+ * @param {Point} position x/y+ */+ value: function updatePosition(key, position) {+ var values = _valueTransformer2['default'].valuesFromProps(this);+ var positions = _valueTransformer2['default'].positionsFromValues(this, values);++ positions[key] = position;++ this.updatePositions(positions);+ }++ /**+ * Update the position of sliders+ * @param {Object} positions+ * @param {Point} positions.min+ * @param {Point} positions.max+ */+ }, {+ key: 'updatePositions',+ value: function updatePositions(positions) {+ var values = {+ min: _valueTransformer2['default'].valueFromPosition(this, positions.min),+ max: _valueTransformer2['default'].valueFromPosition(this, positions.max)+ };++ var transformedValues = {+ min: _valueTransformer2['default'].stepValueFromValue(this, values.min),+ max: _valueTransformer2['default'].stepValueFromValue(this, values.max)+ };++ this.updateValues(transformedValues);+ }++ /**+ * Update the value of a slider by key+ * @param {string} key - max/min+ * @param {number} value - New value+ */+ }, {+ key: 'updateValue',+ value: function updateValue(key, value) {+ var values = _valueTransformer2['default'].valuesFromProps(this);++ values[key] = value;++ this.updateValues(values);+ }++ /**+ * Update the values of all sliders+ * @param {Object|number} values - Object if multi-value, number if single-value+ */+ }, {+ key: 'updateValues',+ value: function updateValues(values) {+ if (!shouldUpdate(this, values)) {+ return;+ }++ if (this.isMultiValue) {+ this.props.onChange(this, values);+ } else {+ this.props.onChange(this, values.max);+ }+ }++ /**+ * Increment the value of a slider by key name+ * @param {string} key - max/min+ */+ }, {+ key: 'incrementValue',+ value: function incrementValue(key) {+ var values = _valueTransformer2['default'].valuesFromProps(this);+ var value = values[key] + this.props.step;++ this.updateValue(key, value);+ }++ /**+ * Decrement the value of a slider by key name+ * @param {string} key - max/min+ */+ }, {+ key: 'decrementValue',+ value: function decrementValue(key) {+ var values = _valueTransformer2['default'].valuesFromProps(this);+ var value = values[key] - this.props.step;++ this.updateValue(key, value);+ }++ /**+ * Format label+ * @param {number} labelValue - Label value+ * @return {string} Formatted label value+ */+ }, {+ key: 'formatLabel',+ value: function formatLabel(labelValue) {+ var _props = this.props;+ var formatLabel = _props.formatLabel;+ var labelPrefix = _props.labelPrefix;+ var labelSuffix = _props.labelSuffix;++ if (formatLabel) {+ return formatLabel(labelValue, { labelPrefix: labelPrefix, labelSuffix: labelSuffix });+ }++ return '' + labelPrefix + labelValue + labelSuffix;+ }++ /**+ * Handle any mousemove event received by the slider+ * @param {SyntheticEvent} event - User event+ * @param {Slider} slider - React component+ */+ }, {+ key: 'handleSliderMouseMove',+ value: function handleSliderMouseMove(event, slider) {+ if (this.props.disabled) {+ return;+ }++ var key = getKeyFromSlider(this, slider);+ var position = _valueTransformer2['default'].positionFromEvent(this, event);++ this.updatePosition(key, position);+ }++ /**+ * Handle any keydown event received by the slider+ * @param {SyntheticEvent} event - User event+ * @param {Slider} slider - React component+ */+ }, {+ key: 'handleSliderKeyDown',+ value: function handleSliderKeyDown(event, slider) {+ if (this.props.disabled) {+ return;+ }++ var key = getKeyFromSlider(this, slider);++ switch (event.keyCode) {+ case KeyCode.LEFT_ARROW:+ case KeyCode.DOWN_ARROW:+ event.preventDefault();+ this.decrementValue(key);+ break;++ case KeyCode.RIGHT_ARROW:+ case KeyCode.UP_ARROW:+ event.preventDefault();+ this.incrementValue(key);+ break;++ default:+ break;+ }+ }++ /**+ * Handle any mousedown event received by the track+ * @param {SyntheticEvent} event - User event+ * @param {Slider} slider - React component+ * @param {Point} position - Mousedown position+ */+ }, {+ key: 'handleTrackMouseDown',+ value: function handleTrackMouseDown(event, track, position) {+ if (this.props.disabled) {+ return;+ }++ event.preventDefault();++ var key = getKeyByPosition(this, position);++ this.updatePosition(key, position);+ }++ /**+ * Handle the start of any user-triggered event+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleInteractionStart',+ value: function handleInteractionStart() {+ var _this = internals.get(this);++ if (!this.props.onChangeComplete || (0, _util.isDefined)(_this.startValue)) {+ return;+ }++ _this.startValue = this.props.value || this.props.defaultValue;+ }++ /**+ * Handle the end of any user-triggered event+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleInteractionEnd',+ value: function handleInteractionEnd() {+ var _this = internals.get(this);++ if (!this.props.onChangeComplete || !(0, _util.isDefined)(_this.startValue)) {+ return;+ }++ if (_this.startValue !== this.props.value) {+ this.props.onChangeComplete(this, this.props.value);+ }++ _this.startValue = null;+ }++ /**+ * Handle any keydown event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleKeyDown',+ value: function handleKeyDown(event) {+ this.handleInteractionStart(event);+ }++ /**+ * Handle any keyup event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleKeyUp',+ value: function handleKeyUp(event) {+ this.handleInteractionEnd(event);+ }++ /**+ * Handle any mousedown event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleMouseDown',+ value: function handleMouseDown(event) {+ var document = getDocument(this);++ this.handleInteractionStart(event);++ document.addEventListener('mouseup', this.handleMouseUp);+ }++ /**+ * Handle any mouseup event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleMouseUp',+ value: function handleMouseUp(event) {+ var document = getDocument(this);++ this.handleInteractionEnd(event);++ document.removeEventListener('mouseup', this.handleMouseUp);+ }++ /**+ * Handle any touchstart event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchStart',+ value: function handleTouchStart(event) {+ var document = getDocument(this);++ this.handleInteractionStart(event);++ document.addEventListener('touchend', this.handleTouchEnd);+ }++ /**+ * Handle any touchend event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchEnd',+ value: function handleTouchEnd(event) {+ var document = getDocument(this);++ this.handleInteractionEnd(event);++ document.removeEventListener('touchend', this.handleTouchEnd);+ }++ /**+ * Render method of the component+ * @return {string} Component JSX+ */+ }, {+ key: 'render',+ value: function render() {+ var classNames = this.props.classNames;++ var componentClassName = getComponentClassName(this);+ var values = _valueTransformer2['default'].valuesFromProps(this);+ var percentages = _valueTransformer2['default'].percentagesFromValues(this, values);++ return _react2['default'].createElement(+ 'div',+ {+ 'aria-disabled': this.props.disabled,+ ref: 'inputRange',+ className: componentClassName,+ onKeyDown: this.handleKeyDown,+ onKeyUp: this.handleKeyUp,+ onMouseDown: this.handleMouseDown,+ onTouchStart: this.handleTouchStart },+ _react2['default'].createElement(+ _Label2['default'],+ {+ className: classNames.labelMin,+ containerClassName: classNames.labelContainer,+ formatLabel: this.formatLabel },+ this.props.minValue+ ),+ _react2['default'].createElement(+ _Track2['default'],+ {+ classNames: classNames,+ ref: 'track',+ percentages: percentages,+ onTrackMouseDown: this.handleTrackMouseDown },+ renderSliders(this)+ ),+ _react2['default'].createElement(+ _Label2['default'],+ {+ className: classNames.labelMax,+ containerClassName: classNames.labelContainer,+ formatLabel: this.formatLabel },+ this.props.maxValue+ ),+ renderHiddenInputs(this)+ );+ }+ }, {+ key: 'trackClientRect',+ get: function get() {+ var track = this.refs.track;++ if (track) {+ return track.clientRect;+ }++ return {+ height: 0,+ left: 0,+ top: 0,+ width: 0+ };+ }++ /**+ * Return true if the component accepts a range of values+ * @member {boolean}+ */+ }, {+ key: 'isMultiValue',+ get: function get() {+ return (0, _util.isObject)(this.props.value) || (0, _util.isObject)(this.props.defaultValue);+ }+ }]);++ return InputRange;+})(_react2['default'].Component);++exports['default'] = InputRange;+InputRange.propTypes = {+ ariaLabelledby: _react2['default'].PropTypes.string,+ ariaControls: _react2['default'].PropTypes.string,+ classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),+ defaultValue: _propTypes.maxMinValuePropType,+ disabled: _react2['default'].PropTypes.bool,+ formatLabel: _react2['default'].PropTypes.func,+ labelPrefix: _react2['default'].PropTypes.string,+ labelSuffix: _react2['default'].PropTypes.string,+ maxValue: _propTypes.maxMinValuePropType,+ minValue: _propTypes.maxMinValuePropType,+ name: _react2['default'].PropTypes.string,+ onChange: _react2['default'].PropTypes.func.isRequired,+ onChangeComplete: _react2['default'].PropTypes.func,+ step: _react2['default'].PropTypes.number,+ value: _propTypes.maxMinValuePropType+};++/**+ * Default props of InputRange+ * @static {Object}+ * @property {Object.<string, string>} defaultClassNames+ * @property {Range|number} defaultValue+ * @property {boolean} disabled+ * @property {string} labelPrefix+ * @property {string} labelSuffix+ * @property {number} maxValue+ * @property {number} minValue+ * @property {number} step+ * @property {Range|number} value+ */+InputRange.defaultProps = {+ classNames: _defaultClassNames2['default'],+ defaultValue: 0,+ disabled: false,+ labelPrefix: '',+ labelSuffix: '',+ maxValue: 10,+ minValue: 0,+ step: 1,+ value: null+};+module.exports = exports['default'];+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"./Label":3,"./Slider":4,"./Track":5,"./defaultClassNames":6,"./propTypes":8,"./util":9,"./valueTransformer":10}],3:[function(require,module,exports){+(function (global){+/**+ * @module InputRange/Label+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();++var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }++function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++/**+ * Label React component+ * @class+ * @extends React.Component+ * @param {Object} props - React component props+ */++var Label = (function (_React$Component) {+ _inherits(Label, _React$Component);++ function Label() {+ _classCallCheck(this, Label);++ _get(Object.getPrototypeOf(Label.prototype), 'constructor', this).apply(this, arguments);+ }++ /**+ * Accepted propTypes of Label+ * @static {Object}+ * @property {Function} children+ * @property {Function} className+ * @property {Function} containerClassName+ * @property {Function} formatLabel+ */++ _createClass(Label, [{+ key: 'render',++ /**+ * Render method of the component+ * @return {string} Component JSX+ */+ value: function render() {+ var _props = this.props;+ var className = _props.className;+ var containerClassName = _props.containerClassName;++ var labelValue = this.props.formatLabel ? this.props.formatLabel(this.props.children) : this.props.children;++ return _react2['default'].createElement(+ 'span',+ { className: className },+ _react2['default'].createElement(+ 'span',+ { className: containerClassName },+ labelValue+ )+ );+ }+ }]);++ return Label;+})(_react2['default'].Component);++exports['default'] = Label;+Label.propTypes = {+ children: _react2['default'].PropTypes.node,+ className: _react2['default'].PropTypes.string,+ containerClassName: _react2['default'].PropTypes.string,+ formatLabel: _react2['default'].PropTypes.func+};+module.exports = exports['default'];+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],4:[function(require,module,exports){+(function (global){+/**+ * @module InputRange/Slider+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();++var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }++function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _Label = require('./Label');++var _Label2 = _interopRequireDefault(_Label);++var _util = require('./util');++/**+ * Get the owner document of slider+ * @private+ * @param {Slider} slider - React component+ * @return {Document} Document+ */+function getDocument(slider) {+ var ownerDocument = slider.refs.slider.ownerDocument;++ return ownerDocument;+}++/**+ * Get the style of slider based on its props+ * @private+ * @param {Slider} slider - React component+ * @return {Object} CSS styles+ */+function getStyle(slider) {+ var perc = (slider.props.percentage || 0) * 100;+ var style = {+ position: 'absolute',+ left: perc + '%'+ };++ return style;+}++/**+ * Slider React component+ * @class+ * @extends React.Component+ * @param {Object} props - React component props+ */++var Slider = (function (_React$Component) {+ _inherits(Slider, _React$Component);++ function Slider(props) {+ _classCallCheck(this, Slider);++ _get(Object.getPrototypeOf(Slider.prototype), 'constructor', this).call(this, props);++ // Auto-bind+ (0, _util.autobind)(['handleClick', 'handleMouseDown', 'handleMouseUp', 'handleMouseMove', 'handleTouchStart', 'handleTouchEnd', 'handleTouchMove', 'handleKeyDown'], this);+ }++ /**+ * Accepted propTypes of Slider+ * @static {Object}+ * @property {Function} ariaLabelledby+ * @property {Function} ariaControls+ * @property {Function} className+ * @property {Function} formatLabel+ * @property {Function} maxValue+ * @property {Function} minValue+ * @property {Function} onSliderKeyDown+ * @property {Function} onSliderMouseMove+ * @property {Function} percentage+ * @property {Function} type+ * @property {Function} value+ */++ /**+ * Handle any click event received by the component+ * @param {SyntheticEvent} event - User event+ */++ _createClass(Slider, [{+ key: 'handleClick',+ value: function handleClick(event) {+ event.preventDefault();+ }++ /**+ * Handle any mousedown event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleMouseDown',+ value: function handleMouseDown() {+ var document = getDocument(this);++ // Event+ document.addEventListener('mousemove', this.handleMouseMove);+ document.addEventListener('mouseup', this.handleMouseUp);+ }++ /**+ * Handle any mouseup event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleMouseUp',+ value: function handleMouseUp() {+ var document = getDocument(this);++ // Event+ document.removeEventListener('mousemove', this.handleMouseMove);+ document.removeEventListener('mouseup', this.handleMouseUp);+ }++ /**+ * Handle any mousemove event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleMouseMove',+ value: function handleMouseMove(event) {+ this.props.onSliderMouseMove(event, this);+ }++ /**+ * Handle any touchstart event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchStart',+ value: function handleTouchStart(event) {+ var document = getDocument(this);++ event.preventDefault();++ document.addEventListener('touchmove', this.handleTouchMove);+ document.addEventListener('touchend', this.handleTouchEnd);+ }++ /**+ * Handle any touchmove event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchMove',+ value: function handleTouchMove(event) {+ this.props.onSliderMouseMove(event, this);+ }++ /**+ * Handle any touchend event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchEnd',+ value: function handleTouchEnd(event) {+ var document = getDocument(this);++ event.preventDefault();++ document.removeEventListener('touchmove', this.handleTouchMove);+ document.removeEventListener('touchend', this.handleTouchEnd);+ }++ /**+ * Handle any keydown event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleKeyDown',+ value: function handleKeyDown(event) {+ this.props.onSliderKeyDown(event, this);+ }++ /**+ * Render method of the component+ * @return {string} Component JSX+ */+ }, {+ key: 'render',+ value: function render() {+ var classNames = this.props.classNames;+ var style = getStyle(this);++ return _react2['default'].createElement(+ 'span',+ {+ className: classNames.sliderContainer,+ ref: 'slider',+ style: style },+ _react2['default'].createElement(+ _Label2['default'],+ {+ className: classNames.labelValue,+ containerClassName: classNames.labelContainer,+ formatLabel: this.props.formatLabel },+ this.props.value+ ),+ _react2['default'].createElement('a', {+ 'aria-labelledby': this.props.ariaLabelledby,+ 'aria-controls': this.props.ariaControls,+ 'aria-valuemax': this.props.maxValue,+ 'aria-valuemin': this.props.minValue,+ 'aria-valuenow': this.props.formatLabel ? this.props.formatLabel(this.props.value) : this.props.value,+ className: classNames.slider,+ draggable: 'false',+ href: '#',+ onClick: this.handleClick,+ onKeyDown: this.handleKeyDown,+ onMouseDown: this.handleMouseDown,+ onTouchStart: this.handleTouchStart,+ role: 'slider' })+ );+ }+ }]);++ return Slider;+})(_react2['default'].Component);++exports['default'] = Slider;+Slider.propTypes = {+ ariaLabelledby: _react2['default'].PropTypes.string,+ ariaControls: _react2['default'].PropTypes.string,+ classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),+ formatLabel: _react2['default'].PropTypes.func,+ maxValue: _react2['default'].PropTypes.number,+ minValue: _react2['default'].PropTypes.number,+ onSliderKeyDown: _react2['default'].PropTypes.func.isRequired,+ onSliderMouseMove: _react2['default'].PropTypes.func.isRequired,+ percentage: _react2['default'].PropTypes.number.isRequired,+ type: _react2['default'].PropTypes.string.isRequired,+ value: _react2['default'].PropTypes.number.isRequired+};+module.exports = exports['default'];+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"./Label":3,"./util":9}],5:[function(require,module,exports){+(function (global){+/**+ * @module InputRange/Track+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();++var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }++function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _util = require('./util');++/**+ * Get the CSS styles for an active track+ * @private+ * @param {Track} track React component+ * @return {Object} CSS styles+ */+function getActiveTrackStyle(track) {+ var props = track.props;++ var width = (props.percentages.max - props.percentages.min) * 100 + '%';+ var left = props.percentages.min * 100 + '%';++ var activeTrackStyle = {+ left: left,+ width: width+ };++ return activeTrackStyle;+}++/**+ * Track React component+ * @class+ * @extends React.Component+ * @param {Object} props - React component props+ */++var Track = (function (_React$Component) {+ _inherits(Track, _React$Component);++ function Track(props) {+ _classCallCheck(this, Track);++ _get(Object.getPrototypeOf(Track.prototype), 'constructor', this).call(this, props);++ // Auto-bind+ (0, _util.autobind)(['handleMouseDown', 'handleTouchStart'], this);+ }++ /**+ * Accepted propTypes of Track+ * @static {Object}+ * @property {Function} children+ * @property {Function} classNames+ * @property {Function} onTrackMouseDown+ * @property {Function} percentages+ */++ /**+ * Return the clientRect of the component+ * @member {ClientRect}+ */++ _createClass(Track, [{+ key: 'handleMouseDown',++ /**+ * Handle any mousedown event received by the component+ * @param {SyntheticEvent} event - User event+ */+ value: function handleMouseDown(event) {+ var trackClientRect = this.clientRect;++ var _ref = event.touches ? event.touches[0] : event;++ var clientX = _ref.clientX;++ var position = {+ x: clientX - trackClientRect.left,+ y: 0+ };++ this.props.onTrackMouseDown(event, this, position);+ }++ /**+ * Handle any touchstart event received by the component+ * @param {SyntheticEvent} event - User event+ */+ }, {+ key: 'handleTouchStart',+ value: function handleTouchStart(event) {+ event.preventDefault();++ this.handleMouseDown(event);+ }++ /**+ * Render method of the component+ * @return {string} Component JSX+ */+ }, {+ key: 'render',+ value: function render() {+ var activeTrackStyle = getActiveTrackStyle(this);+ var classNames = this.props.classNames;++ return _react2['default'].createElement(+ 'div',+ {+ className: classNames.trackContainer,+ onMouseDown: this.handleMouseDown,+ onTouchStart: this.handleTouchStart,+ ref: 'track' },+ _react2['default'].createElement('div', {+ style: activeTrackStyle,+ className: classNames.trackActive }),+ this.props.children+ );+ }+ }, {+ key: 'clientRect',+ get: function get() {+ var track = this.refs.track;++ var clientRect = track.getBoundingClientRect();++ return clientRect;+ }+ }]);++ return Track;+})(_react2['default'].Component);++exports['default'] = Track;+Track.propTypes = {+ children: _react2['default'].PropTypes.node,+ classNames: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.string),+ onTrackMouseDown: _react2['default'].PropTypes.func.isRequired,+ percentages: _react2['default'].PropTypes.objectOf(_react2['default'].PropTypes.number).isRequired+};+module.exports = exports['default'];+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"./util":9}],6:[function(require,module,exports){+/**+ * @module InputRange/defaultClassNames+ */++/**+* An object containing class names+* @const {Object}+* @property {string} component+* @property {string} labelContainer+* @property {string} labelMax+* @property {string} labelMin+* @property {string} labelValue+* @property {string} slider+* @property {string} sliderContainer+* @property {string} trackActive+* @property {string} trackContainer+*/+'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});+exports['default'] = {+ component: 'InputRange',+ labelContainer: 'InputRange-labelContainer',+ labelMax: 'InputRange-label InputRange-label--max',+ labelMin: 'InputRange-label InputRange-label--min',+ labelValue: 'InputRange-label InputRange-label--value',+ slider: 'InputRange-slider',+ sliderContainer: 'InputRange-sliderContainer',+ trackActive: 'InputRange-track InputRange-track--active',+ trackContainer: 'InputRange-track InputRange-track--container'+};+module.exports = exports['default'];+},{}],7:[function(require,module,exports){+/**+ * @module InputRange+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }++var _InputRange = require('./InputRange');++var _InputRange2 = _interopRequireDefault(_InputRange);++/**+ * An object describing the position of a point+ * @typedef {Object} Point+ * @property {number} x - x value+ * @property {number} y - y value+ */++/**+ * An object describing a range of values+ * @typedef {Object} Range+ * @property {number} min - Min value+ * @property {number} max - Max value+ */++exports['default'] = _InputRange2['default'];+module.exports = exports['default'];+},{"./InputRange":2}],8:[function(require,module,exports){+/**+ * @module InputRange/maxMinValuePropType+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});+exports.maxMinValuePropType = maxMinValuePropType;++var _util = require('./util');++/**+ * A prop type accepting a range of numeric values or a single numeric value+ * @param {Object} props - React component props+ * @return {?Error} Return Error if validation fails+ */++function maxMinValuePropType(props) {+ var maxValue = props.maxValue;+ var minValue = props.minValue;+ var value = props.value;+ var defaultValue = props.defaultValue;+ var isValueNumber = (0, _util.isNumber)(value);+ var isDefaultValueNumber = (0, _util.isNumber)(defaultValue);+ var isValueNumberObject = (0, _util.objectOf)(value, _util.isNumber);+ var isDefaultValueNumberObject = (0, _util.objectOf)(defaultValue, _util.isNumber);++ if (value === undefined) {+ return new Error('`value` must be defined');+ }++ if (!isValueNumber && !isDefaultValueNumber && !isValueNumberObject && !isDefaultValueNumberObject) {+ return new Error('`value` or `defaultValue` must be a number or an array');+ }++ if (minValue >= maxValue) {+ return new Error('`minValue` must be smaller than `maxValue`');+ }++ if (maxValue <= minValue) {+ return new Error('`maxValue` must be larger than `minValue`');+ }++ if (value < minValue || value > maxValue) {+ return new Error('`value` must be within `minValue` and `maxValue`');+ }+}+},{"./util":9}],9:[function(require,module,exports){+/**+ * @module InputRange/util+ */++/**+ * @callback predicateFn+ * @param {*} value+ * @return {boolean}+ */++/**+ * Clamp a value between a min and max value+ * @static+ * @param {number} value+ * @param {number} min+ * @param {number} max+ * @return {number}+ */+'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});+exports.clamp = clamp;+exports.extend = extend;+exports.includes = includes;+exports.omit = omit;+exports.captialize = captialize;+exports.distanceTo = distanceTo;+exports.length = length;+exports.isNumber = isNumber;+exports.isObject = isObject;+exports.isDefined = isDefined;+exports.isEmpty = isEmpty;+exports.arrayOf = arrayOf;+exports.objectOf = objectOf;+exports.autobind = autobind;++function clamp(value, min, max) {+ return Math.min(Math.max(value, min), max);+}++/**+ * Extend an Object+ * @static+ * @param {Object} object - Destination object+ * @param {...Object} sources - Source objects+ * @return {Object} Destination object, extended with members from sources+ */++function extend() {+ return Object.assign.apply(Object, arguments);+}++/**+ * Check if a value is included in an array+ * @static+ * @param {Array} array+ * @param {number} value+ * @return {boolean}+ */++function includes(array, value) {+ return array.indexOf(value) > -1;+}++/**+ * Return a new object without the specified keys+ * @static+ * @param {Object} obj+ * @param {Array.<string>} omitKeys+ * @return {Object}+ */++function omit(obj, omitKeys) {+ var keys = Object.keys(obj);+ var outputObj = {};++ keys.forEach(function (key) {+ if (!includes(omitKeys, key)) {+ outputObj[key] = obj[key];+ }+ });++ return outputObj;+}++/**+ * Captialize a string+ * @static+ * @param {string} string+ * @return {string}+ */++function captialize(string) {+ return string.charAt(0).toUpperCase() + string.slice(1);+}++/**+ * Calculate the distance between pointA and pointB+ * @static+ * @param {Point} pointA+ * @param {Point} pointB+ * @return {number} Distance+ */++function distanceTo(pointA, pointB) {+ return Math.sqrt(Math.pow(pointB.x - pointA.x, 2) + Math.pow(pointB.y - pointA.y, 2));+}++/**+ * Calculate the absolute difference between two numbers+ * @static+ * @param {number} numA+ * @param {number} numB+ * @return {number}+ */++function length(numA, numB) {+ return Math.abs(numA - numB);+}++/**+ * Check if a value is a number+ * @static+ * @param {*} value+ * @return {Boolean}+ */++function isNumber(value) {+ return typeof value === 'number';+}++/**+ * Check if a value is an object+ * @static+ * @param {*} value+ * @return {Boolean}+ */++function isObject(value) {+ return value !== null && typeof value === 'object';+}++/**+ * Check if a value is defined+ * @static+ * @param {*} value+ * @return {Boolean}+ */++function isDefined(value) {+ return value !== undefined && value !== null;+}++/**+ * Check if an object is empty+ * @static+ * @param {Object|Array} obj+ * @return {Boolean}+ */++function isEmpty(obj) {+ if (!obj) {+ return true;+ }++ if (Array.isArray(obj)) {+ return obj.length === 0;+ }++ return Object.keys(obj).length === 0;+}++/**+ * Check if all items in an array match a predicate+ * @static+ * @param {Array} array+ * @param {predicateFn} predicate+ * @return {Boolean}+ */++function arrayOf(array, predicate) {+ if (!Array.isArray(array)) {+ return false;+ }++ for (var i = 0, len = array.length; i < len; i++) {+ if (!predicate(array[i])) {+ return false;+ }+ }++ return true;+}++/**+ * Check if all items in an object match a predicate+ * @static+ * @param {Object} object+ * @param {predicateFn} predicate+ * @param {Array.<string>} keys+ * @return {Boolean}+ */++function objectOf(object, predicate, keys) {+ if (!isObject(object)) {+ return false;+ }++ var props = keys || Object.keys(object);++ for (var i = 0, len = props.length; i < len; i++) {+ var prop = props[i];++ if (!predicate(object[prop])) {+ return false;+ }+ }++ return true;+}++/**+ * Bind all methods of an object to itself+ * @static+ * @param {Array.<Function>} methodNames+ * @param {Object} instance+ */++function autobind(methodNames, instance) {+ methodNames.forEach(function (methodName) {+ instance[methodName] = instance[methodName].bind(instance);+ });+}+},{}],10:[function(require,module,exports){+/**+ * @module InputRange/valueTransformer+ */++'use strict';++Object.defineProperty(exports, '__esModule', {+ value: true+});++var _util = require('./util');++/**+ * Convert position into percentage value+ * @static+ * @param {InputRange} inputRange+ * @param {Point} position+ * @return {number} Percentage value+ */+function percentageFromPosition(inputRange, position) {+ var length = inputRange.trackClientRect.width;+ var sizePerc = position.x / length;++ return sizePerc || 0;+}++/**+ * Convert position into model value+ * @static+ * @param {InputRange} inputRange+ * @param {Point} position+ * @return {number} Model value+ */+function valueFromPosition(inputRange, position) {+ var sizePerc = percentageFromPosition(inputRange, position);+ var valueDiff = inputRange.props.maxValue - inputRange.props.minValue;+ var value = inputRange.props.minValue + valueDiff * sizePerc;++ return value;+}++/**+ * Extract values from props+ * @static+ * @param {InputRange} inputRange+ * @param {Point} [props=inputRange.props]+ * @return {Range} Range values+ */+function valuesFromProps(inputRange) {+ var _ref = arguments.length <= 1 || arguments[1] === undefined ? inputRange : arguments[1];++ var props = _ref.props;+ return (function () {+ if (inputRange.isMultiValue) {+ var values = props.value;++ if ((0, _util.isEmpty)(values) || !(0, _util.objectOf)(values, _util.isNumber)) {+ values = props.defaultValue;+ }++ return Object.create(values);+ }++ var value = (0, _util.isNumber)(props.value) ? props.value : props.defaultValue;++ return {+ min: props.minValue,+ max: value+ };+ })();+}++/**+ * Convert value into percentage value+ * @static+ * @param {InputRange} inputRange+ * @param {number} value+ * @return {number} Percentage value+ */+function percentageFromValue(inputRange, value) {+ var validValue = (0, _util.clamp)(value, inputRange.props.minValue, inputRange.props.maxValue);+ var valueDiff = inputRange.props.maxValue - inputRange.props.minValue;+ var valuePerc = (validValue - inputRange.props.minValue) / valueDiff;++ return valuePerc || 0;+}++/**+ * Convert values into percentage values+ * @static+ * @param {InputRange} inputRange+ * @param {Range} values+ * @return {Range} Percentage values+ */+function percentagesFromValues(inputRange, values) {+ var percentages = {+ min: percentageFromValue(inputRange, values.min),+ max: percentageFromValue(inputRange, values.max)+ };++ return percentages;+}++/**+ * Convert value into position+ * @static+ * @param {InputRange} inputRange+ * @param {number} value+ * @return {Point} Position+ */+function positionFromValue(inputRange, value) {+ var length = inputRange.trackClientRect.width;+ var valuePerc = percentageFromValue(inputRange, value);+ var positionValue = valuePerc * length;++ return {+ x: positionValue,+ y: 0+ };+}++/**+ * Convert a range of values into positions+ * @static+ * @param {InputRange} inputRange+ * @param {Range} values+ * @return {Object.<string, Point>}+ */+function positionsFromValues(inputRange, values) {+ var positions = {+ min: positionFromValue(inputRange, values.min),+ max: positionFromValue(inputRange, values.max)+ };++ return positions;+}++/**+ * Extract a position from an event+ * @static+ * @param {InputRange} inputRange+ * @param {Event} event+ * @return {Point}+ */+function positionFromEvent(inputRange, event) {+ var trackClientRect = inputRange.trackClientRect;+ var length = trackClientRect.width;++ var _ref2 = event.touches ? event.touches[0] : event;++ var clientX = _ref2.clientX;++ var position = {+ x: (0, _util.clamp)(clientX - trackClientRect.left, 0, length),+ y: 0+ };++ return position;+}++/**+ * Convert a value into a step value+ * @static+ * @param {InputRange} inputRange+ * @param {number} value+ * @return {number} Step value+ */+function stepValueFromValue(inputRange, value) {+ return Math.round(value / inputRange.props.step) * inputRange.props.step;+}++exports['default'] = {+ percentageFromPosition: percentageFromPosition,+ percentageFromValue: percentageFromValue,+ percentagesFromValues: percentagesFromValues,+ positionFromEvent: positionFromEvent,+ positionFromValue: positionFromValue,+ positionsFromValues: positionsFromValues,+ stepValueFromValue: stepValueFromValue,+ valueFromPosition: valueFromPosition,+ valuesFromProps: valuesFromProps+};+module.exports = exports['default'];+},{"./util":9}],11:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _wv = require('../tooltip/wv.tooltip');++var _wv2 = _interopRequireDefault(_wv);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+var animWidgetHeader = function (_React$Component) {+ _inherits(animWidgetHeader, _React$Component);++ function animWidgetHeader(props) {+ _classCallCheck(this, animWidgetHeader);++ return _possibleConstructorReturn(this, (animWidgetHeader.__proto__ || Object.getPrototypeOf(animWidgetHeader)).call(this, props));+ }++ _createClass(animWidgetHeader, [{+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { className: 'wv-animation-widget-header' },+ 'Animate Map in ',+ _react2.default.createElement(_wv2.default, { text: this.props.text, onClick: this.props.onClick, dataArray: this.props.toolTipTextArray }),+ ' Increments'+ );+ }+ }]);++ return animWidgetHeader;+}(_react2.default.Component);++exports.default = animWidgetHeader;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../tooltip/wv.tooltip":22}],12:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _reactInputRange = require('react-input-range');++var _reactInputRange2 = _interopRequireDefault(_reactInputRange);++var _wv = require('../dateselector/wv.dateselector');++var _wv2 = _interopRequireDefault(_wv);++var _wv3 = require('./wv.loopbutton');++var _wv4 = _interopRequireDefault(_wv3);++var _wv5 = require('./wv.playbutton');++var _wv6 = _interopRequireDefault(_wv5);++var _wvAnimationWidget = require('./wv.animation.widget.header');++var _wvAnimationWidget2 = _interopRequireDefault(_wvAnimationWidget);++var _wv7 = require('../util/wv.googleAnalytics');++var _wv8 = _interopRequireDefault(_wv7);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+var AnimationWidget = function (_React$Component) {+ _inherits(AnimationWidget, _React$Component);++ function AnimationWidget(props) {+ _classCallCheck(this, AnimationWidget);++ var _this = _possibleConstructorReturn(this, (AnimationWidget.__proto__ || Object.getPrototypeOf(AnimationWidget)).call(this, props));++ _this.state = {+ value: props.sliderSpeed,+ looping: props.looping,+ startDate: props.startDate,+ endDate: props.endDate,+ header: props.header,+ incrementArray: props.incrementArray,+ increment: props.increment++ };+ return _this;+ }++ /*+ * Sets a new state value when a+ * when the slider is adjusted+ *+ * @method onSlide+ *+ * @param {Object} component - slider react+ * component+ * @param {number} value - Value of the slider+ * selection+ *+ * @return {void}+ */+++ _createClass(AnimationWidget, [{+ key: 'onSlide',+ value: function onSlide(component, value) {+ this.props.onSlide(value);+ this.setState({+ value: value+ });+ }++ /*+ * calls the callback, passing the+ * current state elements as parameters+ *+ * @method play+ *+ * @return {void}+ */++ }, {+ key: 'play',+ value: function play() {+ this.props.onPushPlay();+ this.setState({+ playing: true+ });+ }+ }, {+ key: 'pause',+ value: function pause() {+ this.props.onPushPause();+ this.setState({+ playing: false+ });+ }+ /*+ * Sets a new state to say whether or not+ * the animation should loop+ *+ * @method onLoop+ *+ * @param {Object} component - slider react+ * component+ * @param {number} value - Value of the slider+ * selection+ *+ * @return {void}+ */++ }, {+ key: 'onLoop',+ value: function onLoop() {+ var loop = true;+ if (this.state.looping) {+ loop = false;+ }+ this.setState({+ looping: loop+ });+ this.props.onPushLoop(loop);+ }+ }, {+ key: 'onDateChange',+ value: function onDateChange(id, date) {+ if (id === 'start') {+ this.setState({+ startDate: date+ });+ this.props.onDateChange(date, this.state.endDate);+ } else {+ this.setState({+ endDate: date+ });+ this.props.onDateChange(this.state.startDate, date);+ }+ }+ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { id: 'wv-animation-widget', className: 'wv-animation-widget' },+ _react2.default.createElement(_wvAnimationWidget2.default, {+ text: this.state.increment,+ toolTipTextArray: this.state.incrementArray,+ onClick: this.props.onZoomSelect }),+ _react2.default.createElement(_wv6.default, { playing: this.state.playing, play: this.play.bind(this), pause: this.pause.bind(this) }),+ _react2.default.createElement(_wv4.default, { looping: this.state.looping, onLoop: this.onLoop.bind(this) }),+ _react2.default.createElement(+ 'div',+ { className: 'wv-slider-case' },+ _react2.default.createElement(_reactInputRange2.default, { maxValue: 10, minValue: 1, value: this.state.value, onChange: this.onSlide.bind(this) }),+ _react2.default.createElement(+ 'span',+ { className: 'wv-slider-label' },+ this.props.sliderLabel+ )+ ),+ _react2.default.createElement(+ 'a',+ { href: 'javascript:void(null)',+ title: 'Create Animated GIF',+ className: 'wv-icon-case',+ onClick: this.props.onPushGIF+ },+ _react2.default.createElement('i', { className: 'fa fa-file-video-o wv-animation-widget-icon' })+ ),+ _react2.default.createElement(+ 'div',+ { className: 'wv-anim-dates-case' },+ _react2.default.createElement(_wv2.default, {+ width: '120',+ height: '30',+ date: this.state.startDate,+ id: 'start',+ onDateChange: this.onDateChange.bind(this),+ maxDate: this.state.endDate,+ minDate: this.props.minDate+ }),+ _react2.default.createElement(+ 'div',+ { className: 'thru-label' },+ 'To'+ ),+ _react2.default.createElement(_wv2.default, {+ width: '120',+ height: '30',+ date: this.state.endDate,+ id: 'end',+ onDateChange: this.onDateChange.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.state.startDate+ })+ ),+ _react2.default.createElement('i', {+ className: 'fa fa-close wv-close',+ onClick: this.props.onClose+ })+ );+ }+ }]);++ return AnimationWidget;+}(_react2.default.Component);++exports.default = AnimationWidget;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../dateselector/wv.dateselector":18,"../util/wv.googleAnalytics":23,"./wv.animation.widget.header":11,"./wv.loopbutton":13,"./wv.playbutton":14,"react-input-range":7}],13:[function(require,module,exports){+(function (global){+"use strict";++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+var LoopButton = function (_React$Component) {+ _inherits(LoopButton, _React$Component);++ function LoopButton(props) {+ _classCallCheck(this, LoopButton);++ return _possibleConstructorReturn(this, (LoopButton.__proto__ || Object.getPrototypeOf(LoopButton)).call(this, props));+ }++ _createClass(LoopButton, [{+ key: "render",+ value: function render() {+ return _react2.default.createElement(+ "a",+ { href: "javascript:void(null)",+ title: this.props.looping ? "Stop Loop" : "Loop video",+ className: this.props.looping ? 'wv-loop-icon-case wv-icon-case active' : 'wv-loop-icon-case wv-icon-case',+ onClick: this.props.onLoop+ },+ _react2.default.createElement("i", { className: "fa fa-retweet wv-animation-widget-icon" })+ );+ }+ }]);++ return LoopButton;+}(_react2.default.Component);++exports.default = LoopButton;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],14:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+var PlayButton = function (_React$Component) {+ _inherits(PlayButton, _React$Component);++ function PlayButton(props) {+ _classCallCheck(this, PlayButton);++ return _possibleConstructorReturn(this, (PlayButton.__proto__ || Object.getPrototypeOf(PlayButton)).call(this, props));+ }++ _createClass(PlayButton, [{+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'a',+ { href: 'javascript:void(null)', title: this.props.playing ? 'Pause video' : 'Play video',+ className: 'wv-anim-play-case wv-icon-case',+ onClick: this.props.playing ? this.props.pause : this.props.play+ },+ _react2.default.createElement('i', { className: this.props.playing ? 'fa fa-pause wv-animation-widget-icon' : 'fa fa-play wv-animation-widget-icon' })+ );+ }+ }]);++ return PlayButton;+}(_react2.default.Component);++exports.default = PlayButton;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],15:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _wvDateselector = require('./wv.dateselector.input');++var _wvDateselector2 = _interopRequireDefault(_wvDateselector);++var _wv = require('../util/wv.utils');++var _wv2 = _interopRequireDefault(_wv);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++var util = new _wv2.default();++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */++var dateSelector = function (_React$Component) {+ _inherits(dateSelector, _React$Component);++ /*+ * @constructor+ */+ function dateSelector(props) {+ _classCallCheck(this, dateSelector);++ var _this = _possibleConstructorReturn(this, (dateSelector.__proto__ || Object.getPrototypeOf(dateSelector)).call(this, props));++ _this.state = {+ date: props.date,+ maxDate: props.maxDate,+ minDate: props.minDate,+ tab: null+ };+ return _this;+ }++ _createClass(dateSelector, [{+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(props) {+ this.setState({+ date: props.date,+ maxDate: props.maxDate,+ minDate: props.minDate+ });+ }+ }, {+ key: 'blur',+ value: function blur() {+ this.setState({ tab: null });+ }+ }, {+ key: 'nextTab',+ value: function nextTab(index) {+ var nextTab;+ if (index < 3) {+ nextTab = index + 1;+ } else {+ nextTab = 1;+ }+ this.setState({+ tab: nextTab+ });+ }+ }, {+ key: 'updateDate',+ value: function updateDate(date) {+ this.setState({+ date: date+ });+ this.props.onDateChange(this.props.id, date);+ }+ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { className: 'wv-date-selector-widget' },+ _react2.default.createElement(_wvDateselector2.default, { startDate: new Date(2000),+ today: new Date(),+ date: this.state.date,+ value: this.state.date.getUTCFullYear(),+ type: 'year',+ height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ tabIndex: 1,+ focused: this.state.tab == 1,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ }),+ _react2.default.createElement(_wvDateselector2.default, {+ startDate: new Date(2000),+ today: new Date(), date: this.state.date,+ type: 'month', height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ value: util.monthStringArray[this.state.date.getUTCMonth()],+ tabIndex: 2,+ focused: this.state.tab == 2,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ }),+ _react2.default.createElement(_wvDateselector2.default, {+ startDate: new Date(2000),+ today: new Date(),+ date: this.state.date,+ type: 'day',+ height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ value: util.pad(this.state.date.getUTCDate(), 2, '0'),+ tabIndex: 3,+ focused: this.state.tab == 3,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ })+ );+ }+ }]);++ return dateSelector;+}(_react2.default.Component);++exports.default = dateSelector;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../util/wv.utils":24,"./wv.dateselector.input":16}],16:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _reactDom = (typeof window !== "undefined" ? window['ReactDOM'] : typeof global !== "undefined" ? global['ReactDOM'] : null);++var _reactDom2 = _interopRequireDefault(_reactDom);++var _wv = require('../util/wv.utils');++var _wv2 = _interopRequireDefault(_wv);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++var util = new _wv2.default();++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */++var DateInputColumn = function (_React$Component) {+ _inherits(DateInputColumn, _React$Component);++ /*+ * @constructor+ */+ function DateInputColumn(props) {+ _classCallCheck(this, DateInputColumn);++ var _this = _possibleConstructorReturn(this, (DateInputColumn.__proto__ || Object.getPrototypeOf(DateInputColumn)).call(this, props));++ _this.state = {+ value: _this.props.value,+ valid: true+ };+ return _this;+ }++ _createClass(DateInputColumn, [{+ key: 'componentDidUpdate',+ value: function componentDidUpdate() {+ if (this.props.focused) {+ _reactDom2.default.findDOMNode(this.refs['input-' + this.props.tabIndex]).focus();+ }+ }+ }, {+ key: 'componentWillMount',+ value: function componentWillMount() {+ var size;+ var type;+ type = this.props.type;+ if (type === 'year') {+ size = '4';+ } else if (type === 'day') {+ size = 2;+ } else {+ size = 3;+ }+ this.size = size;+ }+ }, {+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(props) {+ this.setState({ value: props.value });+ }+ }, {+ key: 'onKeyPress',+ value: function onKeyPress(e) {+ var kc = e.keyCode;+ if (kc === 9 || // tab+ kc === 13) {+ //enter+ e.preventDefault();+ e.stopPropagation();+ }+ }+ }, {+ key: 'onKeyUp',+ value: function onKeyUp(e) {+ var keyCode = e.keyCode;+ var value = e.target.value;+ var newDate;+ var entered = keyCode == 13 || keyCode == 9;+ if (keyCode === 38) {+ //up+ e.preventDefault();+ this.onClickUp();+ return;+ }+ if (keyCode === 40) {+ // down+ e.preventDefault();+ this.onClickDown();+ return;+ }+ if (e.type == 'focusout' || entered) {+ if (this.props.type == 'year' || this.props.type == 'day') {+ if (!(keyCode >= 48 && keyCode <= 57 || entered || keyCode == 8)) {+ return;+ }+ }+ switch (this.props.type) {+ case 'year':+ newDate = this.yearValidation(value);+ break;+ case 'day':+ newDate = this.dayValidation(value);+ break;+ case 'month':+ newDate = this.monthValidation(value);+ break;+ }+ if (newDate) {+ this.props.updateDate(newDate);+ if (entered) {+ //if enetered or tabbed+ this.nextTab();+ }+ } else if (entered) {+ this.setState({+ valid: false+ });+ }+ }+ }+ }, {+ key: 'onClickUp',+ value: function onClickUp() {+ this.rollDate(1);+ this.setState({+ valid: true+ });+ }+ }, {+ key: 'onClickDown',+ value: function onClickDown() {+ this.rollDate(-1);+ this.setState({+ valid: true+ });+ }+ }, {+ key: 'yearValidation',+ value: function yearValidation(input) {+ var newDate;+ if (input > 1000 && input < 9999) {+ newDate = new Date(new Date(this.props.date).setUTCFullYear(input));+ return this.validateDate(newDate);+ }+ }+ }, {+ key: 'dayValidation',+ value: function dayValidation(input) {+ var newDate;+ var maxDate;+ var currentDate = this.props.date;++ maxDate = new Date(currentDate.getYear(), currentDate.getMonth() + 1, 0).getDate();++ if (input > 0 && input <= maxDate) {+ newDate = new Date(new Date(currentDate).setUTCDate(input));+ return this.validateDate(newDate);+ }+ }+ }, {+ key: 'rollDate',+ value: function rollDate(amt) {+ var newDate = util.rollDate(this.props.date, this.props.type, amt, this.props.minDate, this.props.maxDate);+ this.props.updateDate(newDate);+ }+ }, {+ key: 'monthValidation',+ value: function monthValidation(input) {+ var newDate;+ if (!isNaN(input) && input < 13 && input > 0) {+ newDate = new Date(new Date(this.props.date).setUTCMonth(input - 1));+ if (newDate) {+ this.setState({+ value: util.monthStringArray[input - 1]+ });+ return this.validateDate(newDate);+ }+ } else {+ var realMonth = void 0;+ realMonth = util.stringInArray(util.monthStringArray, input);+ if (realMonth !== false) {+ newDate = new Date(new Date(this.props.date).setUTCMonth(realMonth));+ return this.validateDate(newDate);+ } else {+ return false;+ }+ }+ }+ }, {+ key: 'blur',+ value: function blur() {+ this.setState({+ value: this.props.value,+ valid: true+ });++ this.props.blur();+ }+ }, {+ key: 'onChange',+ value: function onChange(e) {+ this.setState({+ value: e.target.value.toUpperCase()+ });+ }+ }, {+ key: 'nextTab',+ value: function nextTab() {+ this.props.nextTab(this.props.tabIndex);+ }+ }, {+ key: 'validateDate',+ value: function validateDate(date) {+ if (date > this.props.minDate && date <= this.props.maxDate) {+ this.setState({+ valid: true+ });+ return date;+ }+ return false;+ }+ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { className: 'input-wrapper', style: this.state.valid ? {} : { borderColor: '#ff0000' } },+ _react2.default.createElement(+ 'div',+ { onClick: this.onClickUp.bind(this), className: 'date-arrows date-arrow-up', 'data-interval': this.props.type },+ _react2.default.createElement(+ 'svg',+ { width: '25', height: '8' },+ _react2.default.createElement('path', { d: 'M 12.5,0 25,8 0,8 z', className: 'uparrow' })+ )+ ),+ _react2.default.createElement('input', {+ type: 'text',+ ref: 'input-' + this.props.tabIndex,+ size: this.size,+ maxLength: this.size,+ className: 'button-input-group',+ id: this.props.type + '-input-group',+ value: this.state.value,+ tabIndex: this.props.tabIndex,+ onKeyUp: this.onKeyUp.bind(this),+ onKeyDown: this.onKeyPress.bind(this) //currently not working+ , onChange: this.onChange.bind(this),+ style: { fontSize: this.props.height / 2 + 'px' },+ onBlur: this.blur.bind(this)+ }),+ _react2.default.createElement(+ 'div',+ { onClick: this.onClickDown.bind(this), className: 'date-arrows date-arrow-down', 'data-interval': this.props.type },+ _react2.default.createElement(+ 'svg',+ { width: '25', height: '8' },+ _react2.default.createElement('path', { d: 'M 12.5,0 25,8 0,8 z', className: 'downarrow' })+ )+ )+ );+ }+ }]);++ return DateInputColumn;+}(_react2.default.Component);++exports.default = DateInputColumn;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../util/wv.utils":24}],17:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _reactDom = (typeof window !== "undefined" ? window['ReactDOM'] : typeof global !== "undefined" ? global['ReactDOM'] : null);++var _reactDom2 = _interopRequireDefault(_reactDom);++var _wv = require('../util/wv.utils');++var _wv2 = _interopRequireDefault(_wv);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++var util = new _wv2.default();++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */++var DateInputColumn = function (_React$Component) {+ _inherits(DateInputColumn, _React$Component);++ /*+ * @constructor+ */+ function DateInputColumn(props) {+ _classCallCheck(this, DateInputColumn);++ var _this = _possibleConstructorReturn(this, (DateInputColumn.__proto__ || Object.getPrototypeOf(DateInputColumn)).call(this, props));++ _this.state = {+ value: _this.props.value,+ valid: true+ };+ return _this;+ }++ _createClass(DateInputColumn, [{+ key: 'componentDidUpdate',+ value: function componentDidUpdate() {+ if (this.props.focused) {+ _reactDom2.default.findDOMNode(this.refs['input-' + this.props.tabIndex]).focus();+ }+ }+ }, {+ key: 'componentWillMount',+ value: function componentWillMount() {+ var size;+ var type;+ type = this.props.type;+ if (type === 'year') {+ size = '4';+ } else if (type === 'day') {+ size = 2;+ } else {+ size = 3;+ }+ this.size = size;+ }+ }, {+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(props) {+ this.setState({ value: props.value });+ }+ }, {+ key: 'onKeyPress',+ value: function onKeyPress(e) {+ var kc = e.keyCode;+ if (kc === 9 || // tab+ kc === 13) {+ //enter+ e.preventDefault();+ e.stopPropagation();+ }+ }+ }, {+ key: 'onKeyUp',+ value: function onKeyUp(e) {+ var keyCode = e.keyCode;+ var value = e.target.value;+ var newDate;+ var entered = keyCode == 13 || keyCode == 9;+ if (keyCode === 38) {+ //up+ e.preventDefault();+ this.onClickUp();+ return;+ }+ if (keyCode === 40) {+ // down+ e.preventDefault();+ this.onClickDown();+ return;+ }+ if (e.type == 'focusout' || entered) {+ if (this.props.type == 'year' || this.props.type == 'day') {+ if (!(keyCode >= 48 && keyCode <= 57 || entered || keyCode == 8)) {+ return;+ }+ }+ switch (this.props.type) {+ case 'year':+ newDate = this.yearValidation(value);+ break;+ case 'day':+ newDate = this.dayValidation(value);+ break;+ case 'month':+ newDate = this.monthValidation(value);+ break;+ }+ if (newDate) {+ this.props.updateDate(newDate);+ if (entered) {+ //if enetered or tabbed+ this.nextTab();+ }+ } else if (entered) {+ this.setState({+ valid: false+ });+ }+ }+ }+ }, {+ key: 'onClickUp',+ value: function onClickUp() {+ this.rollDate(1);+ this.setState({+ valid: true+ });+ }+ }, {+ key: 'onClickDown',+ value: function onClickDown() {+ this.rollDate(-1);+ this.setState({+ valid: true+ });+ }+ }, {+ key: 'yearValidation',+ value: function yearValidation(input) {+ var newDate;+ if (input > 1000 && input < 9999) {+ newDate = new Date(new Date(this.props.date).setUTCFullYear(input));+ return this.validateDate(newDate);+ }+ }+ }, {+ key: 'dayValidation',+ value: function dayValidation(input) {+ var newDate;+ var maxDate;+ var currentDate = this.props.date;++ maxDate = new Date(currentDate.getYear(), currentDate.getMonth() + 1, 0).getDate();++ if (input > 0 && input <= maxDate) {+ newDate = new Date(new Date(currentDate).setUTCDate(input));+ return this.validateDate(newDate);+ }+ }+ }, {+ key: 'rollDate',+ value: function rollDate(amt) {+ var newDate = util.rollDate(this.props.date, this.props.type, amt, this.props.minDate, this.props.maxDate);+ this.props.updateDate(newDate);+ }+ }, {+ key: 'monthValidation',+ value: function monthValidation(input) {+ var newDate;+ if (!isNaN(input) && input < 13 && input > 0) {+ newDate = new Date(new Date(this.props.date).setUTCMonth(input - 1));+ if (newDate) {+ this.setState({+ value: util.monthStringArray[input - 1]+ });+ return this.validateDate(newDate);+ }+ } else {+ var realMonth = void 0;+ realMonth = util.stringInArray(util.monthStringArray, input);+ if (realMonth !== false) {+ newDate = new Date(new Date(this.props.date).setUTCMonth(realMonth));+ return this.validateDate(newDate);+ } else {+ return false;+ }+ }+ }+ }, {+ key: 'blur',+ value: function blur() {+ this.setState({+ value: this.props.value,+ valid: true+ });++ this.props.blur();+ }+ }, {+ key: 'onChange',+ value: function onChange(e) {+ this.setState({+ value: e.target.value.toUpperCase()+ });+ }+ }, {+ key: 'nextTab',+ value: function nextTab() {+ this.props.nextTab(this.props.tabIndex);+ }+ }, {+ key: 'validateDate',+ value: function validateDate(date) {+ if (date > this.props.minDate && date <= this.props.maxDate) {+ this.setState({+ valid: true+ });+ return date;+ }+ return false;+ }+ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { className: 'input-wrapper', style: this.state.valid ? {} : { borderColor: '#ff0000' } },+ _react2.default.createElement(+ 'div',+ { onClick: this.onClickUp.bind(this), className: 'date-arrows date-arrow-up', 'data-interval': this.props.type },+ _react2.default.createElement(+ 'svg',+ { width: '25', height: '8' },+ _react2.default.createElement('path', { d: 'M 12.5,0 25,8 0,8 z', className: 'uparrow' })+ )+ ),+ _react2.default.createElement('input', {+ type: 'text',+ ref: 'input-' + this.props.tabIndex,+ size: this.size,+ maxLength: this.size,+ className: 'button-input-group',+ id: this.props.type + '-input-group',+ value: this.state.value,+ tabIndex: this.props.tabIndex,+ onKeyUp: this.onKeyUp.bind(this),+ onKeyDown: this.onKeyPress.bind(this) //currently not working+ , onChange: this.onChange.bind(this),+ style: { fontSize: this.props.height / 2 + 'px' },+ onBlur: this.blur.bind(this)+ }),+ _react2.default.createElement(+ 'div',+ { onClick: this.onClickDown.bind(this), className: 'date-arrows date-arrow-down', 'data-interval': this.props.type },+ _react2.default.createElement(+ 'svg',+ { width: '25', height: '8' },+ _react2.default.createElement('path', { d: 'M 12.5,0 25,8 0,8 z', className: 'downarrow' })+ )+ )+ );+ }+ }]);++ return DateInputColumn;+}(_react2.default.Component);++exports.default = DateInputColumn;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../util/wv.utils":24}],18:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _wvDateselector = require('./wv.dateselector.input');++var _wvDateselector2 = _interopRequireDefault(_wvDateselector);++var _wv = require('../util/wv.utils');++var _wv2 = _interopRequireDefault(_wv);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++var util = new _wv2.default();++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */++var dateSelector = function (_React$Component) {+ _inherits(dateSelector, _React$Component);++ /*+ * @constructor+ */+ function dateSelector(props) {+ _classCallCheck(this, dateSelector);++ var _this = _possibleConstructorReturn(this, (dateSelector.__proto__ || Object.getPrototypeOf(dateSelector)).call(this, props));++ _this.state = {+ date: props.date,+ maxDate: props.maxDate,+ minDate: props.minDate,+ tab: null+ };+ return _this;+ }++ _createClass(dateSelector, [{+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(props) {+ this.setState({+ date: props.date,+ maxDate: props.maxDate,+ minDate: props.minDate+ });+ }+ }, {+ key: 'blur',+ value: function blur() {+ this.setState({ tab: null });+ }+ }, {+ key: 'nextTab',+ value: function nextTab(index) {+ var nextTab;+ if (index < 3) {+ nextTab = index + 1;+ } else {+ nextTab = 1;+ }+ this.setState({+ tab: nextTab+ });+ }+ }, {+ key: 'updateDate',+ value: function updateDate(date) {+ this.setState({+ date: date+ });+ this.props.onDateChange(this.props.id, date);+ }+ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'div',+ { className: 'wv-date-selector-widget' },+ _react2.default.createElement(_wvDateselector2.default, { startDate: new Date(2000),+ today: new Date(),+ date: this.state.date,+ value: this.state.date.getUTCFullYear(),+ type: 'year',+ height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ tabIndex: 1,+ focused: this.state.tab == 1,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ }),+ _react2.default.createElement(_wvDateselector2.default, {+ startDate: new Date(2000),+ today: new Date(), date: this.state.date,+ type: 'month', height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ value: util.monthStringArray[this.state.date.getUTCMonth()],+ tabIndex: 2,+ focused: this.state.tab == 2,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ }),+ _react2.default.createElement(_wvDateselector2.default, {+ startDate: new Date(2000),+ today: new Date(),+ date: this.state.date,+ type: 'day',+ height: this.props.height,+ width: this.props.width,+ updateDate: this.updateDate.bind(this),+ value: util.pad(this.state.date.getUTCDate(), 2, '0'),+ tabIndex: 3,+ focused: this.state.tab == 3,+ nextTab: this.nextTab.bind(this),+ maxDate: this.props.maxDate,+ minDate: this.props.minDate,+ blur: this.blur.bind(this)+ })+ );+ }+ }]);++ return dateSelector;+}(_react2.default.Component);++exports.default = dateSelector;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"../util/wv.utils":24,"./wv.dateselector.input":17}],19:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _reactDraggable = require('react-draggable');++var _reactDraggable2 = _interopRequireDefault(_reactDraggable);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, is a draggable svg+ * group+ *+ * @class TimelineDragger+ * @extends React.Component+ */+var TimelineDragger = function (_React$Component) {+ _inherits(TimelineDragger, _React$Component);++ /*+ * @constructor+ */+ function TimelineDragger(props) {+ _classCallCheck(this, TimelineDragger);++ return _possibleConstructorReturn(this, (TimelineDragger.__proto__ || Object.getPrototypeOf(TimelineDragger)).call(this, props));+ }++ _createClass(TimelineDragger, [{+ key: 'checkVisibility',+ value: function checkVisibility() {+ var visibility = 'visible';+ if (this.props.position < 0 || this.props.position > this.props.max) {+ visibility = 'hidden';+ }+ this.state = {+ visibility: visibility+ };+ }+ /*+ * When the component is dragged,+ * this function passes the id+ * and change-in-x of the drag+ * to onDrag callback+ *+ * @method handleDrag+ *+ * @return {void}+ */++ }, {+ key: 'handleDrag',+ value: function handleDrag(e, d) {+ e.stopPropagation();+ this.props.onDrag(d.deltaX, this.props.id);+ }++ /*+ * @method render+ */++ }, {+ key: 'render',+ value: function render() {+ this.checkVisibility();+ return _react2.default.createElement(+ _reactDraggable2.default,+ {+ onDrag: this.handleDrag.bind(this),+ position: { x: this.props.position, y: 0 },+ onStop: this.props.onStop,+ axis: 'x'+ },+ _react2.default.createElement(+ 'g',+ null,+ _react2.default.createElement('rect', {+ width: this.props.width,+ height: this.props.height,+ style: {+ fill: this.props.color,+ visibility: this.state.visibility+ }+ }),+ _react2.default.createElement('polygon', {+ points: '0,0,' + this.props.height / 1.5 + ',0 ' + this.props.height / 3 + ', ' + this.props.height / 1.5,+ transform: 'translate(' + -(this.props.width * 2.45) + ', ' + -(this.props.height / 2) + ')',+ style: {+ fill: this.props.triangleColor,+ visibility: this.state.visibility,+ stroke: '#000',+ cursor: 'pointer'+ }+ })+ )+ );+ }+ }]);++ return TimelineDragger;+}(_react2.default.Component);++exports.default = TimelineDragger;++TimelineDragger.defaultProps = {+ visible: true+};++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"react-draggable":1}],20:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, is a draggable svg+ * rect element+ *+ * @class TimelineDraggerRange+ */+var TimelineDraggerRange = function (_React$Component) {+ _inherits(TimelineDraggerRange, _React$Component);++ /*+ * @constructor+ */+ function TimelineDraggerRange(props) {+ _classCallCheck(this, TimelineDraggerRange);++ var _this = _possibleConstructorReturn(this, (TimelineDraggerRange.__proto__ || Object.getPrototypeOf(TimelineDraggerRange)).call(this, props));++ _this.opacity = {+ fillOpacity: _this.props.opacity+ };+ return _this;+ }++ _createClass(TimelineDraggerRange, [{+ key: 'checkWidth',+ value: function checkWidth() {+ var start = this.props.startLocation;+ var end = this.props.endLocation;+ var max = this.props.max;+ var width;++ if (start < 0) {+ start = 0;+ }+ if (end > max) {+ end = max;+ }+ width = end - start;+ if (width < 0) {+ width = 0;+ }+ this.state = {+ width: width,+ startLocation: start+ };+ }+ /*+ * When the component is dragged,+ * this function passes the id+ * and change in x of the drag+ * to onDrag property+ *+ * @method handleDrag+ *+ * @return {void}+ */++ }, {+ key: 'handleDrag',+ value: function handleDrag(e, d) {+ e.stopPropagation();+ this.props.onDrag(d.deltaX);+ }++ /*+ * @method render+ */++ }, {+ key: 'render',+ value: function render() {+ this.checkWidth();+ return _react2.default.createElement('rect', {+ x: this.state.startLocation,+ fill: this.props.color,+ width: this.state.width,+ style: this.opacity,+ height: this.props.height,+ className: 'dragger-range',+ onClick: this.props.onClick+ });+ }+ }]);++ return TimelineDraggerRange;+}(_react2.default.Component);++exports.default = TimelineDraggerRange;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],21:[function(require,module,exports){+(function (global){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++var _wvTimelineDragger = require('./wv.timeline.dragger.js');++var _wvTimelineDragger2 = _interopRequireDefault(_wvTimelineDragger);++var _wvTimelineDraggerrange = require('./wv.timeline.draggerrange.js');++var _wvTimelineDraggerrange2 = _interopRequireDefault(_wvTimelineDraggerrange);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, is a draggable svg+ * group. It is a parent component that+ * rerenders when child elements are dragged+ *+ * @class TimelineRangeSelector+ */+var TimelineRangeSelector = function (_React$Component) {+ _inherits(TimelineRangeSelector, _React$Component);++ /*+ * @constructor+ */+ function TimelineRangeSelector(props) {+ _classCallCheck(this, TimelineRangeSelector);++ var _this = _possibleConstructorReturn(this, (TimelineRangeSelector.__proto__ || Object.getPrototypeOf(TimelineRangeSelector)).call(this, props));++ _this.state = {+ startLocation: props.startLocation,+ endLocation: props.endLocation,+ max: props.max+ };+ return _this;+ }++ _createClass(TimelineRangeSelector, [{+ key: 'componentWillReceiveProps',+ value: function componentWillReceiveProps(props) {+ this.setState({+ startLocation: props.startLocation,+ endLocation: props.endLocation,+ max: props.max+ });+ }+ /*+ * When a child component is dragged,+ * this function is called to determine+ * the correct location for each of the+ * child elements after the drag+ *+ * @method handleDrag+ *+ * @param {number} deltaX - change in x+ * @param {string} id - Identifier used to+ * distinguish between the child elements+ *+ * @return {void}+ */++ }, {+ key: 'onItemDrag',+ value: function onItemDrag(deltaX, id) {+ var startX;+ var endX;++ if (id === 'start') {+ startX = deltaX + this.state.startLocation;+ endX = this.state.endLocation;+ if (startX < 0 || startX > endX) {+ return;+ }+ if (startX + 2 * this.props.pinWidth >= endX) {+ endX = startX + this.props.pinWidth;+ }+ } else if (id === 'end') {+ startX = this.state.startLocation;+ endX = deltaX + this.state.endLocation;+ if (endX > this.state.max || startX > endX) {+ return;+ }+ if (startX + 2 * this.props.pinWidth >= endX) {+ startX = endX - this.props.pinWidth;+ }+ } else {+ startX = deltaX + this.state.startLocation;+ endX = deltaX + this.state.endLocation;+ if (endX >= this.state.max || startX < 0) {+ return;+ }+ }+ this.props.onDrag(startX, endX);++ this.setState({+ startLocation: startX,+ endLocation: endX+ });+ }++ /*+ * Send callback with new locations on+ * Drag Stop+ *+ * @method onDragStop+ *+ * @return {void}+ */++ }, {+ key: 'onDragStop',+ value: function onDragStop() {+ this.props.onDrag(this.state.startLocation, this.state.endLocation);+ }+ }, {+ key: 'onRangeClick',+ value: function onRangeClick(d) {+ this.props.onRangeClick(d.nativeEvent);+ }+ /*+ * @method render+ */++ }, {+ key: 'render',+ value: function render() {+ return _react2.default.createElement(+ 'svg',+ { id: 'wv-timeline-range-selector', className: 'wv-timeline-range-selector' },+ _react2.default.createElement(_wvTimelineDraggerrange2.default, {+ width: this.props.pinWidth,+ endLocation: this.state.endLocation,+ opacity: this.props.rangeOpacity,+ color: this.props.rangeColor,+ height: this.props.height,+ startLocation: this.state.startLocation + this.props.pinWidth,+ onClick: this.onRangeClick.bind(this),+ max: this.state.max,+ id: 'range' }),+ _react2.default.createElement(_wvTimelineDragger2.default, {+ position: this.state.startLocation,+ color: this.props.startColor,+ width: this.props.pinWidth,+ height: this.props.height,+ onDrag: this.onItemDrag.bind(this),+ onStop: this.onDragStop.bind(this),+ max: this.state.max,+ triangleColor: this.props.startTriangleColor,+ first: true,+ id: 'start' }),+ _react2.default.createElement(_wvTimelineDragger2.default, {+ max: this.state.max,+ position: this.state.endLocation,+ color: this.props.endColor,+ width: this.props.pinWidth,+ height: this.props.height,+ first: false,+ onDrag: this.onItemDrag.bind(this),+ onStop: this.onDragStop.bind(this),+ triangleColor: this.props.endTriangleColor,+ id: 'end' })+ );+ }+ }]);++ return TimelineRangeSelector;+}(_react2.default.Component);++exports.default = TimelineRangeSelector;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{"./wv.timeline.dragger.js":19,"./wv.timeline.draggerrange.js":20}],22:[function(require,module,exports){+(function (global){+"use strict";++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);++var _react2 = _interopRequireDefault(_react);++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }++function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++/*+ * A react component, Builds a rather specific+ * interactive widget+ *+ * @class AnimationWidget+ * @extends React.Component+ */+var Tooltip = function (_React$Component) {+ _inherits(Tooltip, _React$Component);++ function Tooltip(props) {+ _classCallCheck(this, Tooltip);++ var _this = _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, props));++ _this.state = {+ hovered: false+ };+ return _this;+ }++ _createClass(Tooltip, [{+ key: "mouseOver",+ value: function mouseOver() {+ this.setState({+ hovered: true+ });+ }+ }, {+ key: "mouseOut",+ value: function mouseOut() {+ this.setState({+ hovered: false+ });+ }+ }, {+ key: "onClick",+ value: function onClick(str) {+ this.props.onClick(str);+ }+ }, {+ key: "render",+ value: function render() {+ var _this2 = this;++ return _react2.default.createElement(+ "div",+ {+ onMouseEnter: this.mouseOver.bind(this),+ onMouseLeave: this.mouseOut.bind(this),+ className: "wv-tooltip-case" },+ _react2.default.createElement(+ "span",+ null,+ this.props.text+ ),+ _react2.default.createElement(+ "div",+ { className: "wv-tooltip", style: this.state.hovered ? { visibility: 'visible' } : {} },+ _react2.default.createElement(+ "ul",+ null,+ this.props.dataArray.map(function (dataEl, i) {+ return _react2.default.createElement(+ "li",+ { key: 'tooltip-' + dataEl + '-' + i, id: dataEl, onClick: _this2.onClick.bind(_this2, dataEl) },+ dataEl+ );+ })+ )+ )+ );+ }+ }]);++ return Tooltip;+}(_react2.default.Component);++exports.default = Tooltip;++}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})++},{}],23:[function(require,module,exports){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});+/*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ */++/* global ga:true */++exports.default = {+ /**+ * Initialize GA tracking if tracking+ * code is present+ *+ * @func init+ * @static+ *+ * @param Category {id} GA tracking code+ *+ * @return {void}+ */+ init: function init(id) {+ if (id) {+ (function (i, s, o, g, r, a, m) {+ i['GoogleAnalyticsObject'] = r;+ i[r] = i[r] || function () {+ (i[r].q = i[r].q || []).push(arguments);+ }, i[r].l = 1 * new Date();+ a = s.createElement(o), m = s.getElementsByTagName(o)[0];+ a.async = 1;+ a.src = g;+ m.parentNode.insertBefore(a, m);+ })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');+ ga('create', id, 'auto');+ ga('send', 'pageview');+ }+ },++ /**+ * @func TrackEventGA+ * @static+ *+ * @param Category {string} Event group name+ * @param Action {string} Type of user interaction+ * @param Label {string} Optional string for better+ * verification of the event+ * @param Value {number} Optional number to associate+ * with event+ *+ * @return {void}+ */+ event: function event(category, action, label, value) {+ if (typeof ga !== "undefined") {+ ga('send', 'event', category, action, label, value);+ }+ }+};++},{}],24:[function(require,module,exports){+"use strict";++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();++function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }++/*+ * NASA Worldview+ *+ * This code was originally developed at NASA/Goddard Space Flight Center for+ * the Earth Science Data and Information System (ESDIS) project.+ *+ * Copyright (C) 2013 - 2016 United States Government as represented by the+ * Administrator of the National Aeronautics and Space Administration.+ * All Rights Reserved.+ *+ * Licensed under the NASA Open Source Agreement, Version 1.3+ * http://opensource.gsfc.nasa.gov/nosa.php+ */++var Utils = function () {+ /*+ * @constructor+ */+ function Utils() {+ _classCallCheck(this, Utils);++ this.monthStringArray = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];+ }+ /**+ * Gets the current day. Use this instead of the Date methods to allow+ * debugging alternate "now" times.+ *+ * @method today+ * @static+ * @return {Date} The current time with the UTC hours, minutes, and seconds+ * fields set to zero or an overriden value.+ */+++ _createClass(Utils, [{+ key: "today",+ value: function today() {+ return this.clearTimeUTC(this.now());+ }++ /**+ * Sets a date to UTC midnight.+ *+ * @method clearTimeUTC+ * @static+ * @param date {Date} date to set the UTC hours, minutes, and seconds+ * to zero.+ * @return {Date} the date object+ */++ }, {+ key: "clearTimeUTC",+ value: function clearTimeUTC(date) {+ date.setUTCHours(0);+ date.setUTCMinutes(0);+ date.setUTCSeconds(0);+ date.setUTCMilliseconds(0);+ return date;+ }+ }, {+ key: "clamp",+ value: function clamp(val, min, max) {+ if (val < min) {+ return min;+ }+ if (val > max) {+ return max;+ }+ return val;+ }+ }, {+ key: "daysInMonth",+ value: function daysInMonth(d) {+ var y;+ var m;+ if (d.getUTCFullYear) {+ y = d.getUTCFullYear();+ m = d.getUTCMonth();+ } else {+ y = d.year;+ m = d.month;+ }+ var lastDay = new Date(Date.UTC(y, m + 1, 0));+ return lastDay.getUTCDate();+ }+ /**+ * Gets the current time. Use this instead of the Date methods to allow+ * debugging alternate "now" times.+ *+ * @method now+ * @static+ * @return {Date} The current time or an overriden value.+ */++ }, {+ key: "now",+ value: function now() {+ return new Date();+ }+ }, {+ key: "stringInArray",+ value: function stringInArray(arra, value) {+ for (var i = 0, len = arra.length; i < len; i++) {+ if (arra[i] === value) {+ return i;+ }+ }+ return false;+ }+ }, {+ key: "minDate",+ value: function minDate() {+ return new Date(Date.UTC(1000, 0, 1));+ }+ }, {+ key: "maxDate",+ value: function maxDate() {+ return new Date(Date.UTC(3000, 11, 31));+ }+ /**+ * Parses a UTC ISO 8601 date.+ *+ * @method parseDateUTC+ * @static+ * @param str {string} Date to parse in the form of ``YYYY-MM-DD``.+ * @return {Date} converted string as a date object, throws an exception if+ * the string is invalid+ */+ // NOTE: Older Safari doesn't like Date.parse++ }, {+ key: "parseDateUTC",+ value: function parseDateUTC(dateAsString) {+ var dateTimeArr = dateAsString.split(/T/);+ var yyyymmdd = dateTimeArr[0].split('-');++ // Parse elements of date and time+ var year = yyyymmdd[0];+ var month = yyyymmdd[1] - 1;+ var day = yyyymmdd[2];++ var hour = 0;+ var minute = 0;+ var second = 0;+ var millisecond = 0;++ // Use default of midnight if time is not specified+ if (dateTimeArr.length > 1) {+ var hhmmss = dateTimeArr[1].split(/[:\.Z]/);+ hour = hhmmss[0] || 0;+ minute = hhmmss[1] || 0;+ second = hhmmss[2] || 0;+ millisecond = hhmmss[3] || 0;+ }+ var date = new Date(Date.UTC(year, month, day, hour, minute, second, millisecond));+ if (isNaN(date.getTime())) {+ throw new Error('Invalid date: ' + dateAsString);+ }+ return date;+ }+ }, {+ key: "repeat",+ value: function repeat(value, length) {+ var result = "";+ for (var i = 0; i < length; i++) {+ result += value;+ }+ return result;+ }+ }, {+ key: "roll",+ value: function roll(val, min, max) {+ if (val < min) {+ return max - (min - val) + 1;+ }+ if (val > max) {+ return min + (val - max) - 1;+ }+ return val;+ }+ }, {+ key: "rollRange",+ value: function rollRange(date, interval, minDate, maxDate) {+ var y = date.getUTCFullYear();+ var m = date.getUTCMonth();+ var first, last;+ switch (interval) {+ case "day":+ var firstDay = new Date(Date.UTC(y, m, 1));+ var lastDay = new Date(Date.UTC(y, m, this.daysInMonth(date)));+ first = new Date(Math.max(firstDay, minDate)).getUTCDate();+ last = new Date(Math.min(lastDay, maxDate)).getUTCDate();+ break;+ case "month":+ var firstMonth = new Date(Date.UTC(y, 0, 1));+ var lastMonth = new Date(Date.UTC(y, 11, 31));+ first = new Date(Math.max(firstMonth, minDate)).getUTCMonth();+ last = new Date(Math.min(lastMonth, maxDate)).getUTCMonth();+ break;+ case "year":+ var firstYear = this.minDate();+ var lastYear = this.maxDate();+ first = new Date(Math.max(firstYear, minDate)).getUTCFullYear();+ last = new Date(Math.min(lastYear, maxDate)).getUTCFullYear();+ break;+ }+ return { first: first, last: last };+ }+ }, {+ key: "rollDate",+ value: function rollDate(date, interval, amount, minDate, maxDate) {+ minDate = minDate || this.minDate();+ maxDate = maxDate || this.maxDate();+ var range = this.rollRange(date, interval, minDate, maxDate);+ var min = range.first;+ var max = range.last;+ var day = date.getUTCDate();+ var month = date.getUTCMonth();+ var year = date.getUTCFullYear();+ switch (interval) {+ case "day":+ day = this.roll(day + amount, min, max);+ break;+ case "month":+ month = this.roll(month + amount, min, max);+ break;+ case "year":+ year = this.roll(year + amount, min, max);+ break;+ default:+ throw new Error("[rollDate] Invalid interval: " + interval);+ }+ var daysInMonth = this.daysInMonth({ year: year, month: month });+ if (day > daysInMonth) {+ day = daysInMonth;+ }+ var newDate = new Date(Date.UTC(year, month, day));+ newDate = new Date(this.clamp(newDate, minDate, maxDate));+ return newDate;+ }+ }, {+ key: "pad",+ value: function pad(value, width, padding) {+ value = "" + value;+ if (value.length < width) {+ var add = width - value.length;+ value = this.repeat(padding, add) + value;+ }+ return value;+ }+ }]);++ return Utils;+}();++exports.default = Utils;++},{}],25:[function(require,module,exports){+'use strict';++Object.defineProperty(exports, "__esModule", {+ value: true+});++var _wvAnimationWidget = require('./components/animationwidget/wv.animation.widget.js');++Object.defineProperty(exports, 'AnimationWidget', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvAnimationWidget).default;+ }+});++var _wvTimelineRangeselection = require('./components/rangeselection/wv.timeline.rangeselection.js');++Object.defineProperty(exports, 'RangeSelector', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvTimelineRangeselection).default;+ }+});++var _wvDateSelector = require('./components/dateSelector/wv.dateSelector.js');++Object.defineProperty(exports, 'DateSelector', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvDateSelector).default;+ }+});++var _wvTooltip = require('./components/tooltip/wv.tooltip.js');++Object.defineProperty(exports, 'ToolTip', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvTooltip).default;+ }+});++var _wvUtils = require('./components/util/wv.utils.js');++Object.defineProperty(exports, 'Utils', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvUtils).default;+ }+});++var _wvGoogleAnalytics = require('./components/util/wv.googleAnalytics.js');++Object.defineProperty(exports, 'GA', {+ enumerable: true,+ get: function get() {+ return _interopRequireDefault(_wvGoogleAnalytics).default;+ }+});++function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }++},{"./components/animationwidget/wv.animation.widget.js":12,"./components/dateSelector/wv.dateSelector.js":15,"./components/rangeselection/wv.timeline.rangeselection.js":21,"./components/tooltip/wv.tooltip.js":22,"./components/util/wv.googleAnalytics.js":23,"./components/util/wv.utils.js":24}]},{},[25])(25)+});++//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvcmVhY3QtZHJhZ2dhYmxlL2Rpc3QvcmVhY3QtZHJhZ2dhYmxlLmpzIiwibm9kZV9tb2R1bGVzL3JlY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cm9tVmFsdWVzKHRoaXMsIHZhbHVlcyk7XG5cbiAgICAgIHJldHVybiBfcmVhY3QyWydkZWZhdWx0J10uY3JlYXRlRWxlbWVudChcbiAgICAgICAgJ2RpdicsXG4gICAgICAgIHtcbiAgICAgICAgICAnYXJpYS1kaXNhYmxlZCc6IHRoaXMucHJvcHMuZGlzYWJsZWQsXG4gICAgICAgICAgcmVmOiAnaW5wdXRSYW5nZScsXG4gICAgICAgICAgY2xhc3NOYW1lOiBjb21wb25lbnRDbGFzc05hbWUsXG4gICAgICAgICAgb25LZXlEb3duOiB0aGlzLmhhbmRsZUtleURvd24sXG4gICAgICAgICAgb25LZXlVcDogdGhpcy5oYW5kbGVLZXlVcCxcbiAgICAgICAgICBvbk1vdXNlRG93bjogdGhpcy5oYW5kbGVNb3VzZURvd24sXG4gICAgICAgICAgb25Ub3VjaFN0YXJ0OiB0aGlzLmhhbmRsZVRvdWNoU3RhcnQgfSxcbiAgICAgICAgX3JlYWN0MlsnZGVmYXVsdCddLmNyZWF0ZUVsZW1lbnQoXG4gICAgICAgICAgX0xhYmVsMlsnZGVmYXVsdCddLFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGNsYXNzTmFtZTogY2xhc3NOYW1lcy5sYWJlbE1pbixcbiAgICAgICAgICAgIGNvbnRhaW5lckNsYXNzTmFtZTogY2xhc3NOYW1lcy5sYWJlbENvbnRhaW5lcixcbiAgICAgICAgICAgIGZvcm1hdExhYmVsOiB0aGlzLmZvcm1hdExhYmVsIH0sXG4gICAgICAgICAgdGhpcy5wcm9wcy5taW5WYWx1ZVxuICAgICAgICApLFxuICAgICAgICBfcmVhY3QyWydkZWZhdWx0J10uY3JlYXRlRWxlbWVudChcbiAgICAgICAgICBfVHJhY2syWydkZWZhdWx0J10sXG4gICAgICAgICAge1xuICAgICAgICAgICAgY2xhc3NOYW1lczogY2xhc3NOYW1lcyxcbiAgICAgICAgICAgIHJlZjogJ3RyYWNrJyxcbiAgICAgICAgICAgIHBlcmNlbnRhZ2VzOiBwZXJjZW50YWdlcyxcbiAgICAgICAgICAgIG9uVHJhY2tNb3VzZURvd246IHRoaXMuaGFuZGxlVHJhY2tNb3VzZURvd24gfSxcbiAgICAgICAgICByZW5kZXJTbGlkZXJzKHRoaXMpXG4gICAgICAgICksXG4gICAgICAgIF9yZWFjdDJbJ2RlZmF1bHQnXS5jcmVhdGVFbGVtZW50KFxuICAgICAgICAgIF9MYWJlbDJbJ2RlZmF1bHQnXSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBjbGFzc05hbWU6IGNsYXNzTmFtZXMubGFiZWxNYXgsXG4gICAgICAgICAgICBjb250YWluZXJDbGFzc05hbWU6IGNsYXNzTmFtZXMubGFiZWxDb250YWluZXIsXG4gICAgICAgICAgICBmb3JtYXRMYWJlbDogdGhpcy5mb3JtYXRMYWJlbCB9LFxuICAgICAgICAgIHRoaXMucHJvcHMubWF4VmFsdWVcbiAgICAgICAgKSxcbiAgICAgICAgcmVuZGVySGlkZGVuSW5wdXRzKHRoaXMpXG4gICAgICApO1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogJ3RyYWNrQ2xpZW50UmVjdCcsXG4gICAgZ2V0OiBmdW5jdGlvbiBnZXQoKSB7XG4gICAgICB2YXIgdHJhY2sgPSB0aGlzLnJlZnMudHJhY2s7XG5cbiAgICAgIGlmICh0cmFjaykge1xuICAgICAgICByZXR1cm4gdHJhY2suY2xpZW50UmVjdDtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgaGVpZ2h0OiAwLFxuICAgICAgICBsZWZ0OiAwLFxuICAgICAgICB0b3A6IDAsXG4gICAgICAgIHdpZHRoOiAwXG4gICAgICB9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJldHVybiB0cnVlIGlmIHRoZSBjb21wb25lbnQgYWNjZXB0cyBhIHJhbmdlIG9mIHZhbHVlc1xuICAgICAqIEBtZW1iZXIge2Jvb2xlYW59XG4gICAgICovXG4gIH0sIHtcbi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IGV2ZW50O1xuXG4gICAgICB2YXIgY2xpZW50WCA9IF9yZWYuY2xpZW50WDtcblxuICAgICAgdmFyIHBvc2l0aW9uID0ge1xuICAgICAgICB4OiBjbGllbnRYIC0gdHJhY2tDbGllbnRSZWN0LmxlZnQsXG4gICAgICAgIHk6IDBcbiAgICAgIH07XG5cbiAgICAgIHRoaXMucHJvcHMub25UcmFja01vdXNlRG93bihldmVudCwgdGhpcywgcG9zaXRpb24pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEhhbmRsZSBhbnkgdG91Y2hzdGFydCBldmVudCByZWNlaXZlZCBieSB0aGUgY29tcG9uZW50XG4gICAgICogQHBhcmFtIHtTeW50aGV0aWNFdmVudH0gZXZlbnQgLSBVc2VyIGV2ZW50XG4gICAgICovXG4gIH0sIHtcbiAgICBrZXk6ICdoYW5kbGVUb3VjaFN0YXJ0JyxcbiAgICB2YWx1ZTogZnVuY3Rpb24gaGFuZGxlVG91Y2hTdGFydChldmVudCkge1xuICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgdGhpcy5oYW5kbGVNb3VzZURvd24oZXZlbnQpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFJlbmRlciBtZXRob2Qgb2YgdGhlIGNvbXBvbmVudFxuICAgICAqIEByZXR1cm4ge3N0cmluZ30gQ29tcG9uZW50IEpTWFxuICAgICAqL1xuICB9LCB7XG4gICAga2V5OiAncmVuZGVyJyxcbiAgICB2YWx1ZTogZnVuY3Rpb24gcmVuZGVyKCkge1xuICAgICAgdmFyIGFjdGl2ZVRyYWNrU3R5bGUgPSBnZXRBY3RpdmVUcmFja1N0eWxlKHRoaXMpO1xuICAgICAgdmFyIGNsYXNzTmFtZXMgPSB0aGlzLnByb3BzLmNsYXNzTmFtZXM7XG5cbiAgICAgIHJldHVybiBfcmVhY3QyWydkZWZhdWx0J10uY3JlYXRlRWxlbWVudChcbiAgICAgICAgJ2RpdicsXG4gICAgICAgIHtcbiAgICA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b3NpdGlvbj17e3g6dGhpcy5wcm9wcy5wb3NpdGlvbiwgeTowfX1cbiAgICAgICAgb25TdG9wPXt0aGlzLnByb3BzLm9uU3RvcH1cbiAgICAgICAgYXhpcz1cInhcIlxuICAgICAgPlxuICAgICAgICA8Zz5cbiAgICAgICAgICA8cmVjdFxuICAgICAgICAgICAgd2lkdGg9e3RoaXMucHJvcHMud2lkdGh9XG4gICAgICAgICAgICBoZWlnaHQ9e3RoaXMucHJvcHMuaGVpZ2h0fVxuICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgZmlsbDp0aGlzLnByb3BzLmNvbG9yLFxuICAgICAgICAgICAgICB2aXNpYmlsaXR5OiB0aGlzLnN0YXRlLnZpc2liaWxpdHlcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgLz5cbiAgICAgICAgICB7XG4gICAgICAgICAgIC8qXG4gICAgICAgICAgICAqIHRoaXMgcG9seWdvbiBlbGVtZW50IGJ1aWxkcyBhIHRyaWFuZ2xlXG4gICAgICAgICAgICAqIGJhc2VkIG9uIHRoZSB3aWR0aCBhbmQgaGVpZ2h0IG9mIHRoZVxuICAgICAgICAgICAgKiByZWN0YW5nbGUgZWxlbWVudFxuICAgICAgICAgICAgKi9cbiAgICAgICAgICB9XG4gICAgICAgICAgPHBvbHlnb25cbiAgICAgICAgICAgIHBvaW50cz17JzAsMCwnICsgdGhpcy5wcm9wcy5oZWlnaHQgLyAxLjUgKyAnLDAgJyArIHRoaXMucHJvcHMuaGVpZ2h0IC8gMyArICcsICcgK3RoaXMucHJvcHMuaGVpZ2h0IC8gMS41IH1cbiAgICAgICAgICAgIHRyYW5zZm9ybT17J3RyYW5zbGF0ZSgnICsgKC0odGhpcy5wcm9wcy53aWR0aCAqIDIuNDUpKSArICcsICcgKyAoLSh0aGlzLnByb3BzLmhlaWdodCAvIDIpKSArJyknfVxuICAgICAgICAgICAgc3R5bGU9e3tcbiAgICAgICAgICAgICAgZmlsbDogdGhpcy5wcm9wcy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Wx0IGFzIEFuaW1hdGlvbldpZGdldH0gZnJvbSAnLi9jb21wb25lbnRzL2FuaW1hdGlvbndpZGdldC93di5hbmltYXRpb24ud2lkZ2V0LmpzJztcbmV4cG9ydCB7ZGVmYXVsdCBhcyBSYW5nZVNlbGVjdG9yfSBmcm9tICcuL2NvbXBvbmVudHMvcmFuZ2VzZWxlY3Rpb24vd3YudGltZWxpbmUucmFuZ2VzZWxlY3Rpb24uanMnO1xuZXhwb3J0IHtkZWZhdWx0IGFzIERhdGVTZWxlY3Rvcn0gZnJvbSAnLi9jb21wb25lbnRzL2RhdGVTZWxlY3Rvci93di5kYXRlU2VsZWN0b3IuanMnO1xuZXhwb3J0IHtkZWZhdWx0IGFzIFRvb2xUaXB9IGZyb20gJy4vY29tcG9uZW50cy90b29sdGlwL3d2LnRvb2x0aXAuanMnO1xuZXhwb3J0IHtkZWZhdWx0IGFzIFV0aWxzfSBmcm9tICcuL2NvbXBvbmVudHMvdXRpbC93di51dGlscy5qcyc7XG5leHBvcnQge2RlZmF1bHQgYXMgR0F9IGZyb20gJy4vY29tcG9uZW50cy91dGlsL3d2Lmdvb2dsZUFuYWx5dGljcy5qcyc7XG4iXX0=\ No newline at end of filediff --git a/web/ext/node_modules/worldview-components/browser/wvc.min.js b/web/ext/node_modules/worldview-components/browser/wvc.min.jsnew file mode 100644index 000000000..515de8906--- /dev/null+++ b/web/ext/node_modules/worldview-components/browser/wvc.min.js@@ -0,0 +1,3 @@+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.WVC=e()}}(function(){var e;return function e(t,n,o){function a(i,s){if(!n[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(r)return r(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var p=n[i]={exports:{}};t[i][0].call(p.exports,function(e){var n=t[i][1][e];return a(n?n:e)},p,p.exports,e,t,n,o)}return n[i].exports}for(var r="function"==typeof require&&require,i=0;i<o.length;i++)a(o[i]);return a}({1:[function(t,n,o){(function(t){!function(a,r){"object"==typeof o&&"object"==typeof n?n.exports=r("undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,"undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof t?t.ReactDOM:null):"function"==typeof e&&e.amd?e(["react","react-dom"],r):"object"==typeof o?o.ReactDraggable=r("undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,"undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof t?t.ReactDOM:null):a.ReactDraggable=r(a.React,a.ReactDOM)}(this,function(e,t){return function(e){function t(o){if(n[o])return n[o].exports;var a=n[o]={exports:{},id:o,loaded:!1};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=n(1).default,e.exports.DraggableCore=n(9).default},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},l=function(){function e(e,t){var n=[],o=!0,a=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{!o&&s.return&&s.return()}finally{if(a)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),f=n(2),c=o(f),d=n(3),h=o(d),y=n(4),v=o(y),m=n(5),b=n(8),g=n(6),w=n(9),D=o(w),T=n(11),O=o(T),P=function(e){function t(e){r(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onDragStart=function(e,t){(0,O.default)("Draggable: onDragStart: %j",t);var o=n.props.onStart(e,(0,b.createDraggableData)(n,t));return o!==!1&&void n.setState({dragging:!0,dragged:!0})},n.onDrag=function(e,t){if(!n.state.dragging)return!1;(0,O.default)("Draggable: onDrag: %j",t);var o=(0,b.createDraggableData)(n,t),a={x:o.x,y:o.y};if(n.props.bounds){var r=a.x,i=a.y;a.x+=n.state.slackX,a.y+=n.state.slackY;var s=(0,b.getBoundPosition)(n,a.x,a.y),u=l(s,2);a.x=u[0],a.y=u[1],a.slackX=n.state.slackX+(r-a.x),a.slackY=n.state.slackY+(i-a.y),o.x=r,o.y=i,o.deltaX=a.x-n.state.x,o.deltaY=a.y-n.state.y}var p=n.props.onDrag(e,o);return p!==!1&&void n.setState(a)},n.onDragStop=function(e,t){if(!n.state.dragging)return!1;var o=n.props.onStop(e,(0,b.createDraggableData)(n,t));if(o===!1)return!1;(0,O.default)("Draggable: onDragStop: %j",t);var a={dragging:!1,slackX:0,slackY:0},r=Boolean(n.props.position);if(r){var i=n.props.position,s=i.x,u=i.y;a.x=s,a.y=u}n.setState(a)},n.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,slackX:0,slackY:0,isElementSVG:!1},n}return s(t,e),p(t,[{key:"componentWillMount",value:function(){!this.props.position||this.props.onDrag||this.props.onStop||console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}},{key:"componentDidMount",value:function(){"undefined"!=typeof SVGElement&&h.default.findDOMNode(this)instanceof SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillReceiveProps",value:function(e){!e.position||this.props.position&&e.position.x===this.props.position.x&&e.position.y===this.props.position.y||this.setState({x:e.position.x,y:e.position.y})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"render",value:function(){var e,t={},n=null,o=Boolean(this.props.position),r=!o||this.state.dragging,i=this.props.position||this.props.defaultPosition,s={x:(0,b.canDragX)(this)&&r?this.state.x:i.x,y:(0,b.canDragY)(this)&&r?this.state.y:i.y};this.state.isElementSVG?n=(0,m.createSVGTransform)(s):t=(0,m.createCSSTransform)(s);var l=this.props,p=l.defaultClassName,f=l.defaultClassNameDragging,d=l.defaultClassNameDragged,h=(0,v.default)(this.props.children.props.className||"",p,(e={},a(e,f,this.state.dragging),a(e,d,this.state.dragged),e));return c.default.createElement(D.default,u({},this.props,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),c.default.cloneElement(c.default.Children.only(this.props.children),{className:h,style:u({},this.props.children.props.style,t),transform:n}))}}]),t}(c.default.Component);P.displayName="Draggable",P.propTypes=u({},D.default.propTypes,{axis:f.PropTypes.oneOf(["both","x","y","none"]),bounds:f.PropTypes.oneOfType([f.PropTypes.shape({left:f.PropTypes.number,right:f.PropTypes.number,top:f.PropTypes.number,bottom:f.PropTypes.number}),f.PropTypes.string,f.PropTypes.oneOf([!1])]),defaultClassName:f.PropTypes.string,defaultClassNameDragging:f.PropTypes.string,defaultClassNameDragged:f.PropTypes.string,defaultPosition:f.PropTypes.shape({x:f.PropTypes.number,y:f.PropTypes.number}),position:f.PropTypes.shape({x:f.PropTypes.number,y:f.PropTypes.number}),className:g.dontSetMe,style:g.dontSetMe,transform:g.dontSetMe}),P.defaultProps=u({},D.default.defaultProps,{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},position:null}),t.default=P},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){var o,a;!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var o=arguments[t];if(o){var a=typeof o;if("string"===a||"number"===a)e.push(o);else if(Array.isArray(o))e.push(n.apply(null,o));else if("object"===a)for(var i in o)r.call(o,i)&&o[i]&&e.push(i)}}return e.join(" ")}var r={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=n:(o=[],a=function(){return n}.apply(t,o),!(void 0!==a&&(e.exports=a)))}()},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){return x||(x=(0,T.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(t){return(0,T.isFunction)(e[t])})),e[x].call(e,t)}function i(e,t,n){var o=e;do{if(r(o,t))return!0;if(o===n)return!1;o=o.parentNode}while(o);return!1}function s(e,t,n){e&&(e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener?e.addEventListener(t,n,!0):e["on"+t]=n)}function u(e,t,n){e&&(e.detachEvent?e.detachEvent("on"+t,n):e.removeEventListener?e.removeEventListener(t,n,!0):e["on"+t]=null)}function l(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,T.int)(n.borderTopWidth),t+=(0,T.int)(n.borderBottomWidth)}function p(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,T.int)(n.borderLeftWidth),t+=(0,T.int)(n.borderRightWidth)}function f(e){var t=e.clientHeight,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,T.int)(n.paddingTop),t-=(0,T.int)(n.paddingBottom)}function c(e){var t=e.clientWidth,n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,T.int)(n.paddingLeft),t-=(0,T.int)(n.paddingRight)}function d(e,t){var n=t===t.ownerDocument.body,o=n?{left:0,top:0}:t.getBoundingClientRect(),a=e.clientX+t.scrollLeft-o.left,r=e.clientY+t.scrollTop-o.top;return{x:a,y:r}}function h(e){var t=e.x,n=e.y;return a({},(0,O.browserPrefixToKey)("transform",P.default),"translate("+t+"px,"+n+"px)")}function y(e){var t=e.x,n=e.y;return"translate("+t+","+n+")"}function v(e,t){return e.targetTouches&&(0,T.findInArray)(e.targetTouches,function(e){return t===e.identifier})||e.changedTouches&&(0,T.findInArray)(e.changedTouches,function(e){return t===e.identifier})}function m(e){return e.targetTouches&&e.targetTouches[0]?e.targetTouches[0].identifier:e.changedTouches&&e.changedTouches[0]?e.changedTouches[0].identifier:void 0}function b(e){var t=e.getAttribute("style")||"";e.setAttribute("style",t+C)}function g(e){var t=e.getAttribute("style")||"";e.setAttribute("style",t.replace(S,""))}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return D({touchAction:"none"},e)}Object.defineProperty(t,"__esModule",{value:!0});var D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};t.matchesSelector=r,t.matchesSelectorAndParentsTo=i,t.addEvent=s,t.removeEvent=u,t.outerHeight=l,t.outerWidth=p,t.innerHeight=f,t.innerWidth=c,t.offsetXYFromParent=d,t.createCSSTransform=h,t.createSVGTransform=y,t.getTouch=v,t.getTouchIdentifier=m,t.addUserSelectStyles=b,t.removeUserSelectStyles=g,t.styleHacks=w;var T=n(6),O=n(7),P=o(O),x="",k=(0,O.getPrefix)("user-select"),_=(0,O.browserPrefixToStyle)("user-select",k),C=";"+_+": none;",S=new RegExp(";?"+_+": none;")},function(e,t){"use strict";function n(e,t){for(var n=0,o=e.length;n<o;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function o(e){return"function"==typeof e||"[object Function]"===Object.prototype.toString.call(e)}function a(e){return"number"==typeof e&&!isNaN(e)}function r(e){return parseInt(e,10)}function i(e,t,n){if(e[t])return new Error("Invalid prop "+t+" passed to "+n+" - do not set this, set it on the child.")}Object.defineProperty(t,"__esModule",{value:!0}),t.findInArray=n,t.isFunction=o,t.isNum=a,t.int=r,t.dontSetMe=i},function(e,t){"use strict";function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window||"undefined"==typeof window.document)return"";var t=window.document.documentElement.style;if(e in t)return"";for(var n=0;n<i.length;n++)if(o(e,i[n])in t)return i[n];return""}function o(e,t){return t?""+t+r(e):e}function a(e,t){return t?"-"+t.toLowerCase()+"-"+e:e}function r(e){for(var t="",n=!0,o=0;o<e.length;o++)n?(t+=e[o].toUpperCase(),n=!1):"-"===e[o]?n=!0:t+=e[o];return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getPrefix=n,t.browserPrefixToKey=o,t.browserPrefixToStyle=a;var i=["Moz","Webkit","O","ms"];t.default=n()},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){if(!e.props.bounds)return[t,n];var o=e.props.bounds;o="string"==typeof o?o:f(o);var a=h.default.findDOMNode(e);if("string"==typeof o){var r=a.ownerDocument,i=r.defaultView,s=void 0;if("parent"===o)s=a.parentNode;else if(s=r.querySelector(o),!s)throw new Error('Bounds selector "'+o+'" could not find an element.');var u=i.getComputedStyle(a),l=i.getComputedStyle(s);o={left:-a.offsetLeft+(0,c.int)(l.paddingLeft)+(0,c.int)(u.borderLeftWidth)+(0,c.int)(u.marginLeft),top:-a.offsetTop+(0,c.int)(l.paddingTop)+(0,c.int)(u.borderTopWidth)+(0,c.int)(u.marginTop),right:(0,y.innerWidth)(s)-(0,y.outerWidth)(a)-a.offsetLeft,bottom:(0,y.innerHeight)(s)-(0,y.outerHeight)(a)-a.offsetTop}}return(0,c.isNum)(o.right)&&(t=Math.min(t,o.right)),(0,c.isNum)(o.bottom)&&(n=Math.min(n,o.bottom)),(0,c.isNum)(o.left)&&(t=Math.max(t,o.left)),(0,c.isNum)(o.top)&&(n=Math.max(n,o.top)),[t,n]}function r(e,t,n){var o=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[o,a]}function i(e){return"both"===e.props.axis||"x"===e.props.axis}function s(e){return"both"===e.props.axis||"y"===e.props.axis}function u(e,t,n){var o="number"==typeof t?(0,y.getTouch)(e,t):null;if("number"==typeof t&&!o)return null;var a=h.default.findDOMNode(n),r=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,y.offsetXYFromParent)(o||e,r)}function l(e,t,n){var o=e.state,a=!(0,c.isNum)(o.lastX);return a?{node:h.default.findDOMNode(e),deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:h.default.findDOMNode(e),deltaX:t-o.lastX,deltaY:n-o.lastY,lastX:o.lastX,lastY:o.lastY,x:t,y:n}}function p(e,t){return{node:t.node,x:e.state.x+t.deltaX,y:e.state.y+t.deltaY,deltaX:t.deltaX,deltaY:t.deltaY,lastX:e.state.x,lastY:e.state.y}}function f(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=a,t.snapToGrid=r,t.canDragX=i,t.canDragY=s,t.getControlPosition=u,t.createCoreData=l,t.createDraggableData=p;var c=n(6),d=n(3),h=o(d),y=n(5)},function(e,t,n){(function(e){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],o=!0,a=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(o=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{!o&&s.return&&s.return()}finally{if(a)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=n(2),p=o(l),f=n(3),c=o(f),d=n(5),h=n(8),y=n(6),v=n(11),m=o(v),b={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},g=b.mouse,w=function(e){function t(){var e,n,o,i;a(this,t);for(var u=arguments.length,l=Array(u),p=0;p<u;p++)l[p]=arguments[p];return n=o=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),o.state={dragging:!1,lastX:NaN,lastY:NaN,touchIdentifier:null},o.handleDragStart=function(e){if(o.props.onMouseDown(e),!o.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;var t=c.default.findDOMNode(o),n=t.ownerDocument;if(!(o.props.disabled||!(e.target instanceof n.defaultView.Node)||o.props.handle&&!(0,d.matchesSelectorAndParentsTo)(e.target,o.props.handle,t)||o.props.cancel&&(0,d.matchesSelectorAndParentsTo)(e.target,o.props.cancel,t))){var a=(0,d.getTouchIdentifier)(e);o.setState({touchIdentifier:a});var r=(0,h.getControlPosition)(e,a,o);if(null!=r){var i=r.x,s=r.y,u=(0,h.createCoreData)(o,i,s);(0,m.default)("DraggableCore: handleDragStart: %j",u),(0,m.default)("calling",o.props.onStart);var l=o.props.onStart(e,u);l!==!1&&(o.props.enableUserSelectHack&&(0,d.addUserSelectStyles)(n.body),o.setState({dragging:!0,lastX:i,lastY:s}),(0,d.addEvent)(n,g.move,o.handleDrag),(0,d.addEvent)(n,g.stop,o.handleDragStop))}}},o.handleDrag=function(e){"touchmove"===e.type&&e.preventDefault();var t=(0,h.getControlPosition)(e,o.state.touchIdentifier,o);if(null!=t){var n=t.x,a=t.y;if(Array.isArray(o.props.grid)){var r=n-o.state.lastX,i=a-o.state.lastY,u=(0,h.snapToGrid)(o.props.grid,r,i),l=s(u,2);if(r=l[0],i=l[1],!r&&!i)return;n=o.state.lastX+r,a=o.state.lastY+i}var p=(0,h.createCoreData)(o,n,a);(0,m.default)("DraggableCore: handleDrag: %j",p);var f=o.props.onDrag(e,p);if(f!==!1)o.setState({lastX:n,lastY:a});else try{o.handleDragStop(new MouseEvent("mouseup"))}catch(e){var c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),o.handleDragStop(c)}}},o.handleDragStop=function(e){if(o.state.dragging){var t=(0,h.getControlPosition)(e,o.state.touchIdentifier,o);if(null!=t){var n=t.x,a=t.y,r=(0,h.createCoreData)(o,n,a),i=c.default.findDOMNode(o),s=i.ownerDocument;o.props.enableUserSelectHack&&(0,d.removeUserSelectStyles)(s.body),(0,m.default)("DraggableCore: handleDragStop: %j",r),o.setState({dragging:!1,lastX:NaN,lastY:NaN}),o.props.onStop(e,r),(0,m.default)("DraggableCore: Removing handlers"),(0,d.removeEvent)(s,g.move,o.handleDrag),(0,d.removeEvent)(s,g.stop,o.handleDragStop)}}},o.onMouseDown=function(e){return g=b.mouse,o.handleDragStart(e)},o.onMouseUp=function(e){return g=b.mouse,o.handleDragStop(e)},o.onTouchStart=function(e){return g=b.touch,o.handleDragStart(e)},o.onTouchEnd=function(e){return g=b.touch,o.handleDragStop(e)},i=n,r(o,i)}return i(t,e),u(t,[{key:"componentWillUnmount",value:function(){var e=c.default.findDOMNode(this),t=e.ownerDocument;(0,d.removeEvent)(t,b.mouse.move,this.handleDrag),(0,d.removeEvent)(t,b.touch.move,this.handleDrag),(0,d.removeEvent)(t,b.mouse.stop,this.handleDragStop),(0,d.removeEvent)(t,b.touch.stop,this.handleDragStop),this.props.enableUserSelectHack&&(0,d.removeUserSelectStyles)(t.body)}},{key:"render",value:function(){return p.default.cloneElement(p.default.Children.only(this.props.children),{style:(0,d.styleHacks)(this.props.children.props.style),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),t}(p.default.Component);w.displayName="DraggableCore",w.propTypes={allowAnyClick:l.PropTypes.bool,disabled:l.PropTypes.bool,enableUserSelectHack:l.PropTypes.bool,offsetParent:function(t,n){if(e.browser&&t[n]&&1!==t[n].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:l.PropTypes.arrayOf(l.PropTypes.number),handle:l.PropTypes.string,cancel:l.PropTypes.string,onStart:l.PropTypes.func,onDrag:l.PropTypes.func,onStop:l.PropTypes.func,onMouseDown:l.PropTypes.func,className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe},w.defaultProps={allowAnyClick:!1,cancel:null,disabled:!1,enableUserSelectHack:!0,offsetParent:null,handle:null,grid:null,transform:null,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){}},t.default=w}).call(t,n(10))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(p===setTimeout)return setTimeout(e,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(e,0);try{return p(e,0)}catch(t){try{return p.call(null,e,0)}catch(t){return p.call(this,e,0)}}}function r(e){if(f===clearTimeout)return clearTimeout(e);if((f===o||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function i(){y&&d&&(y=!1,d.length?h=d.concat(h):v=-1,h.length&&s())}function s(){if(!y){var e=a(i);y=!0;for(var t=h.length;t;){for(d=h,h=[];++v<t;)d&&d[v].run();v=-1,t=h.length}d=null,y=!1,r(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var p,f,c=e.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:n}catch(e){p=n}try{f="function"==typeof clearTimeout?clearTimeout:o}catch(e){f=o}}();var d,h=[],y=!1,v=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||y||a(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=l,c.addListener=l,c.once=l,c.off=l,c.removeListener=l,c.removeAllListeners=l,c.emit=l,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},function(e,t,n){"use strict";function o(){}Object.defineProperty(t,"__esModule",{value:!0}),t.default=o}])})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){(function(o){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e,t){var n=e.props;return e.isMultiValue?t.min>=n.minValue&&t.max<=n.maxValue&&t.min<t.max:t.max>=n.minValue&&t.max<=n.maxValue}function u(e,t){var n=e.props,o=M.default.valuesFromProps(e);return(0,E.length)(t.min,o.min)>=n.step||(0,E.length)(t.max,o.max)>=n.step}function l(e,t){return s(e,t)&&u(e,t)}function p(e){var t=e.refs.inputRange.ownerDocument;return t}function f(e){var t=e.props;return t.disabled?t.classNames.component+" is-disabled":t.classNames.component}function c(e,t){return t===e.refs.sliderMin?"min":"max"}function d(e){return e.isMultiValue?["min","max"]:["max"]}function h(e,t){var n=M.default.valuesFromProps(e),o=M.default.positionsFromValues(e,n);if(e.isMultiValue){var a=(0,E.distanceTo)(t,o.min),r=(0,E.distanceTo)(t,o.max);if(a<r)return"min"}return"max"}function y(e){var t=e.props.classNames,n=[],o=d(e),a=M.default.valuesFromProps(e),r=M.default.percentagesFromValues(e,a),i=!0,s=!1,u=void 0;try{for(var l,p=o[Symbol.iterator]();!(i=(l=p.next()).done);i=!0){var f=l.value,c=a[f],h=r[f],y="slider"+(0,E.captialize)(f),v=e.props,m=v.maxValue,b=v.minValue;"min"===f?m=a.max:b=a.min;var g=w.default.createElement(T.default,{ariaLabelledby:e.props.ariaLabelledby,ariaControls:e.props.ariaControls,classNames:t,formatLabel:e.formatLabel,key:f,maxValue:m,minValue:b,onSliderKeyDown:e.handleSliderKeyDown,onSliderMouseMove:e.handleSliderMouseMove,percentage:h,ref:y,type:f,value:c});n.push(g)}}catch(e){s=!0,u=e}finally{try{!i&&p.return&&p.return()}finally{if(s)throw u}}return n}function v(e){var t=[],n=d(e),o=!0,a=!1,r=void 0;try{for(var i,s=n[Symbol.iterator]();!(o=(i=s.next()).done);o=!0){var u=i.value,l=e.isMultiValue?""+e.props.name+(0,E.captialize)(u):e.props.name;w.default.createElement("input",{type:"hidden",name:l})}}catch(e){a=!0,r=e}finally{try{!o&&s.return&&s.return()}finally{if(a)throw r}}return t}Object.defineProperty(n,"__esModule",{value:!0});var m=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),b=function(e,t,n){for(var o=!0;o;){var a=e,r=t,i=n;o=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,r);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(i)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=r,n=i,o=!0,s=l=void 0}},g="undefined"!=typeof window?window.React:"undefined"!=typeof o?o.React:null,w=a(g),D=e("./Slider"),T=a(D),O=e("./Track"),P=a(O),x=e("./Label"),k=a(x),_=e("./defaultClassNames"),C=a(_),S=e("./valueTransformer"),M=a(S),E=e("./util"),j=e("./propTypes"),R=new WeakMap,N={DOWN_ARROW:40,LEFT_ARROW:37,RIGHT_ARROW:39,UP_ARROW:38},V=function(e){function t(e){r(this,t),b(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),R.set(this,{}),(0,E.autobind)(["formatLabel","handleInteractionEnd","handleInteractionStart","handleKeyDown","handleKeyUp","handleMouseDown","handleMouseUp","handleSliderKeyDown","handleSliderMouseMove","handleTouchStart","handleTouchEnd","handleTrackMouseDown"],this)}return i(t,e),m(t,[{key:"updatePosition",value:function(e,t){var n=M.default.valuesFromProps(this),o=M.default.positionsFromValues(this,n);o[e]=t,this.updatePositions(o)}},{key:"updatePositions",value:function(e){var t={min:M.default.valueFromPosition(this,e.min),max:M.default.valueFromPosition(this,e.max)},n={min:M.default.stepValueFromValue(this,t.min),max:M.default.stepValueFromValue(this,t.max)};this.updateValues(n)}},{key:"updateValue",value:function(e,t){var n=M.default.valuesFromProps(this);n[e]=t,this.updateValues(n)}},{key:"updateValues",value:function(e){l(this,e)&&(this.isMultiValue?this.props.onChange(this,e):this.props.onChange(this,e.max))}},{key:"incrementValue",value:function(e){var t=M.default.valuesFromProps(this),n=t[e]+this.props.step;this.updateValue(e,n)}},{key:"decrementValue",value:function(e){var t=M.default.valuesFromProps(this),n=t[e]-this.props.step;this.updateValue(e,n)}},{key:"formatLabel",value:function e(t){var n=this.props,e=n.formatLabel,o=n.labelPrefix,a=n.labelSuffix;return e?e(t,{labelPrefix:o,labelSuffix:a}):""+o+t+a}},{key:"handleSliderMouseMove",value:function(e,t){if(!this.props.disabled){var n=c(this,t),o=M.default.positionFromEvent(this,e);this.updatePosition(n,o)}}},{key:"handleSliderKeyDown",value:function(e,t){if(!this.props.disabled){var n=c(this,t);switch(e.keyCode){case N.LEFT_ARROW:case N.DOWN_ARROW:e.preventDefault(),this.decrementValue(n);break;case N.RIGHT_ARROW:case N.UP_ARROW:e.preventDefault(),this.incrementValue(n)}}}},{key:"handleTrackMouseDown",value:function(e,t,n){if(!this.props.disabled){e.preventDefault();var o=h(this,n);this.updatePosition(o,n)}}},{key:"handleInteractionStart",value:function(){var e=R.get(this);this.props.onChangeComplete&&!(0,E.isDefined)(e.startValue)&&(e.startValue=this.props.value||this.props.defaultValue)}},{key:"handleInteractionEnd",value:function(){var e=R.get(this);this.props.onChangeComplete&&(0,E.isDefined)(e.startValue)&&(e.startValue!==this.props.value&&this.props.onChangeComplete(this,this.props.value),e.startValue=null)}},{key:"handleKeyDown",value:function(e){this.handleInteractionStart(e)}},{key:"handleKeyUp",value:function(e){this.handleInteractionEnd(e)}},{key:"handleMouseDown",value:function(e){var t=p(this);this.handleInteractionStart(e),t.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(e){var t=p(this);this.handleInteractionEnd(e),t.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleTouchStart",value:function(e){var t=p(this);this.handleInteractionStart(e),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchEnd",value:function(e){var t=p(this);this.handleInteractionEnd(e),t.removeEventListener("touchend",this.handleTouchEnd)}},{key:"render",value:function(){var e=this.props.classNames,t=f(this),n=M.default.valuesFromProps(this),o=M.default.percentagesFromValues(this,n);return w.default.createElement("div",{"aria-disabled":this.props.disabled,ref:"inputRange",className:t,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart},w.default.createElement(k.default,{className:e.labelMin,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.minValue),w.default.createElement(P.default,{classNames:e,ref:"track",percentages:o,onTrackMouseDown:this.handleTrackMouseDown},y(this)),w.default.createElement(k.default,{className:e.labelMax,containerClassName:e.labelContainer,formatLabel:this.formatLabel},this.props.maxValue),v(this))}},{key:"trackClientRect",get:function(){var e=this.refs.track;return e?e.clientRect:{height:0,left:0,top:0,width:0}}},{key:"isMultiValue",get:function(){return(0,E.isObject)(this.props.value)||(0,E.isObject)(this.props.defaultValue)}}]),t}(w.default.Component);n.default=V,V.propTypes={ariaLabelledby:w.default.PropTypes.string,ariaControls:w.default.PropTypes.string,classNames:w.default.PropTypes.objectOf(w.default.PropTypes.string),defaultValue:j.maxMinValuePropType,disabled:w.default.PropTypes.bool,formatLabel:w.default.PropTypes.func,labelPrefix:w.default.PropTypes.string,labelSuffix:w.default.PropTypes.string,maxValue:j.maxMinValuePropType,minValue:j.maxMinValuePropType,name:w.default.PropTypes.string,onChange:w.default.PropTypes.func.isRequired,onChangeComplete:w.default.PropTypes.func,step:w.default.PropTypes.number,value:j.maxMinValuePropType},V.defaultProps={classNames:C.default,defaultValue:0,disabled:!1,labelPrefix:"",labelSuffix:"",maxValue:10,minValue:0,step:1,value:null},t.exports=n.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":3,"./Slider":4,"./Track":5,"./defaultClassNames":6,"./propTypes":8,"./util":9,"./valueTransformer":10}],3:[function(e,t,n){(function(e){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s=function(e,t,n){for(var o=!0;o;){var a=e,r=t,i=n;o=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,r);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(i)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=r,n=i,o=!0,s=l=void 0}},u="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,l=o(u),p=function(e){function t(){a(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).apply(this,arguments)}return r(t,e),i(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.containerClassName,o=this.props.formatLabel?this.props.formatLabel(this.props.children):this.props.children;return l.default.createElement("span",{className:t},l.default.createElement("span",{className:n},o))}}]),t}(l.default.Component);n.default=p,p.propTypes={children:l.default.PropTypes.node,className:l.default.PropTypes.string,containerClassName:l.default.PropTypes.string,formatLabel:l.default.PropTypes.func},t.exports=n.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,n){(function(o){"use strict";function a(e){return e&&e.__esModule?e:{+default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.refs.slider.ownerDocument;return t}function u(e){var t=100*(e.props.percentage||0),n={position:"absolute",left:t+"%"};return n}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),p=function(e,t,n){for(var o=!0;o;){var a=e,r=t,i=n;o=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,r);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(i)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=r,n=i,o=!0,s=l=void 0}},f="undefined"!=typeof window?window.React:"undefined"!=typeof o?o.React:null,c=a(f),d=e("./Label"),h=a(d),y=e("./util"),v=function(e){function t(e){r(this,t),p(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,y.autobind)(["handleClick","handleMouseDown","handleMouseUp","handleMouseMove","handleTouchStart","handleTouchEnd","handleTouchMove","handleKeyDown"],this)}return i(t,e),l(t,[{key:"handleClick",value:function(e){e.preventDefault()}},{key:"handleMouseDown",value:function(){var e=s(this);e.addEventListener("mousemove",this.handleMouseMove),e.addEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseUp",value:function(){var e=s(this);e.removeEventListener("mousemove",this.handleMouseMove),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"handleMouseMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchStart",value:function(e){var t=s(this);e.preventDefault(),t.addEventListener("touchmove",this.handleTouchMove),t.addEventListener("touchend",this.handleTouchEnd)}},{key:"handleTouchMove",value:function(e){this.props.onSliderMouseMove(e,this)}},{key:"handleTouchEnd",value:function(e){var t=s(this);e.preventDefault(),t.removeEventListener("touchmove",this.handleTouchMove),t.removeEventListener("touchend",this.handleTouchEnd)}},{key:"handleKeyDown",value:function(e){this.props.onSliderKeyDown(e,this)}},{key:"render",value:function(){var e=this.props.classNames,t=u(this);return c.default.createElement("span",{className:e.sliderContainer,ref:"slider",style:t},c.default.createElement(h.default,{className:e.labelValue,containerClassName:e.labelContainer,formatLabel:this.props.formatLabel},this.props.value),c.default.createElement("a",{"aria-labelledby":this.props.ariaLabelledby,"aria-controls":this.props.ariaControls,"aria-valuemax":this.props.maxValue,"aria-valuemin":this.props.minValue,"aria-valuenow":this.props.formatLabel?this.props.formatLabel(this.props.value):this.props.value,className:e.slider,draggable:"false",href:"#",onClick:this.handleClick,onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,role:"slider"}))}}]),t}(c.default.Component);n.default=v,v.propTypes={ariaLabelledby:c.default.PropTypes.string,ariaControls:c.default.PropTypes.string,classNames:c.default.PropTypes.objectOf(c.default.PropTypes.string),formatLabel:c.default.PropTypes.func,maxValue:c.default.PropTypes.number,minValue:c.default.PropTypes.number,onSliderKeyDown:c.default.PropTypes.func.isRequired,onSliderMouseMove:c.default.PropTypes.func.isRequired,percentage:c.default.PropTypes.number.isRequired,type:c.default.PropTypes.string.isRequired,value:c.default.PropTypes.number.isRequired},t.exports=n.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Label":3,"./util":9}],5:[function(e,t,n){(function(o){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=e.props,n=100*(t.percentages.max-t.percentages.min)+"%",o=100*t.percentages.min+"%",a={left:o,width:n};return a}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),l=function(e,t,n){for(var o=!0;o;){var a=e,r=t,i=n;o=!1,null===a&&(a=Function.prototype);var s=Object.getOwnPropertyDescriptor(a,r);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(i)}var l=Object.getPrototypeOf(a);if(null===l)return;e=l,t=r,n=i,o=!0,s=l=void 0}},p="undefined"!=typeof window?window.React:"undefined"!=typeof o?o.React:null,f=a(p),c=e("./util"),d=function(e){function t(e){r(this,t),l(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),(0,c.autobind)(["handleMouseDown","handleTouchStart"],this)}return i(t,e),u(t,[{key:"handleMouseDown",value:function(e){var t=this.clientRect,n=e.touches?e.touches[0]:e,o=n.clientX,a={x:o-t.left,y:0};this.props.onTrackMouseDown(e,this,a)}},{key:"handleTouchStart",value:function(e){e.preventDefault(),this.handleMouseDown(e)}},{key:"render",value:function(){var e=s(this),t=this.props.classNames;return f.default.createElement("div",{className:t.trackContainer,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,ref:"track"},f.default.createElement("div",{style:e,className:t.trackActive}),this.props.children)}},{key:"clientRect",get:function(){var e=this.refs.track,t=e.getBoundingClientRect();return t}}]),t}(f.default.Component);n.default=d,d.propTypes={children:f.default.PropTypes.node,classNames:f.default.PropTypes.objectOf(f.default.PropTypes.string),onTrackMouseDown:f.default.PropTypes.func.isRequired,percentages:f.default.PropTypes.objectOf(f.default.PropTypes.number).isRequired},t.exports=n.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util":9}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={component:"InputRange",labelContainer:"InputRange-labelContainer",labelMax:"InputRange-label InputRange-label--max",labelMin:"InputRange-label InputRange-label--min",labelValue:"InputRange-label InputRange-label--value",slider:"InputRange-slider",sliderContainer:"InputRange-sliderContainer",trackActive:"InputRange-track InputRange-track--active",trackContainer:"InputRange-track InputRange-track--container"},t.exports=n.default},{}],7:[function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var a=e("./InputRange"),r=o(a);n.default=r.default,t.exports=n.default},{"./InputRange":2}],8:[function(e,t,n){"use strict";function o(e){var t=e.maxValue,n=e.minValue,o=e.value,r=e.defaultValue,i=(0,a.isNumber)(o),s=(0,a.isNumber)(r),u=(0,a.objectOf)(o,a.isNumber),l=(0,a.objectOf)(r,a.isNumber);return void 0===o?new Error("`value` must be defined"):i||s||u||l?n>=t?new Error("`minValue` must be smaller than `maxValue`"):t<=n?new Error("`maxValue` must be larger than `minValue`"):o<n||o>t?new Error("`value` must be within `minValue` and `maxValue`"):void 0:new Error("`value` or `defaultValue` must be a number or an array")}Object.defineProperty(n,"__esModule",{value:!0}),n.maxMinValuePropType=o;var a=e("./util")},{"./util":9}],9:[function(e,t,n){"use strict";function o(e,t,n){return Math.min(Math.max(e,t),n)}function a(){return Object.assign.apply(Object,arguments)}function r(e,t){return e.indexOf(t)>-1}function i(e,t){var n=Object.keys(e),o={};return n.forEach(function(n){r(t,n)||(o[n]=e[n])}),o}function s(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function l(e,t){return Math.abs(e-t)}function p(e){return"number"==typeof e}function f(e){return null!==e&&"object"==typeof e}function c(e){return void 0!==e&&null!==e}function d(e){return!e||(Array.isArray(e)?0===e.length:0===Object.keys(e).length)}function h(e,t){if(!Array.isArray(e))return!1;for(var n=0,o=e.length;n<o;n++)if(!t(e[n]))return!1;return!0}function y(e,t,n){if(!f(e))return!1;for(var o=n||Object.keys(e),a=0,r=o.length;a<r;a++){var i=o[a];if(!t(e[i]))return!1}return!0}function v(e,t){e.forEach(function(e){t[e]=t[e].bind(t)})}Object.defineProperty(n,"__esModule",{value:!0}),n.clamp=o,n.extend=a,n.includes=r,n.omit=i,n.captialize=s,n.distanceTo=u,n.length=l,n.isNumber=p,n.isObject=f,n.isDefined=c,n.isEmpty=d,n.arrayOf=h,n.objectOf=y,n.autobind=v},{}],10:[function(e,t,n){"use strict";function o(e,t){var n=e.trackClientRect.width,o=t.x/n;return o||0}function a(e,t){var n=o(e,t),a=e.props.maxValue-e.props.minValue,r=e.props.minValue+a*n;return r}function r(e){var t=arguments.length<=1||void 0===arguments[1]?e:arguments[1],n=t.props;return function(){if(e.isMultiValue){var t=n.value;return!(0,c.isEmpty)(t)&&(0,c.objectOf)(t,c.isNumber)||(t=n.defaultValue),Object.create(t)}var o=(0,c.isNumber)(n.value)?n.value:n.defaultValue;return{min:n.minValue,max:o}}()}function i(e,t){var n=(0,c.clamp)(t,e.props.minValue,e.props.maxValue),o=e.props.maxValue-e.props.minValue,a=(n-e.props.minValue)/o;return a||0}function s(e,t){var n={min:i(e,t.min),max:i(e,t.max)};return n}function u(e,t){var n=e.trackClientRect.width,o=i(e,t),a=o*n;return{x:a,y:0}}function l(e,t){var n={min:u(e,t.min),max:u(e,t.max)};return n}function p(e,t){var n=e.trackClientRect,o=n.width,a=t.touches?t.touches[0]:t,r=a.clientX,i={x:(0,c.clamp)(r-n.left,0,o),y:0};return i}function f(e,t){return Math.round(t/e.props.step)*e.props.step}Object.defineProperty(n,"__esModule",{value:!0});var c=e("./util");n.default={percentageFromPosition:o,percentageFromValue:i,percentagesFromValues:s,positionFromEvent:p,positionFromValue:u,positionsFromValues:l,stepValueFromValue:f,valueFromPosition:a,valuesFromProps:r},t.exports=n.default},{"./util":9}],11:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("../tooltip/wv.tooltip"),f=o(p),c=function(e){function t(e){return a(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),s(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"wv-animation-widget-header"},"Animate Map in ",l.default.createElement(f.default,{text:this.props.text,onClick:this.props.onClick,dataArray:this.props.toolTipTextArray})," Increments")}}]),t}(l.default.Component);n.default=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../tooltip/wv.tooltip":22}],12:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("react-input-range"),f=o(p),c=e("../dateselector/wv.dateselector"),d=o(c),h=e("./wv.loopbutton"),y=o(h),v=e("./wv.playbutton"),m=o(v),b=e("./wv.animation.widget.header"),g=o(b),w=e("../util/wv.googleAnalytics"),D=(o(w),function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={value:e.sliderSpeed,looping:e.looping,startDate:e.startDate,endDate:e.endDate,header:e.header,incrementArray:e.incrementArray,increment:e.increment},n}return i(t,e),s(t,[{key:"onSlide",value:function(e,t){this.props.onSlide(t),this.setState({value:t})}},{key:"play",value:function(){this.props.onPushPlay(),this.setState({playing:!0})}},{key:"pause",value:function(){this.props.onPushPause(),this.setState({playing:!1})}},{key:"onLoop",value:function(){var e=!0;this.state.looping&&(e=!1),this.setState({looping:e}),this.props.onPushLoop(e)}},{key:"onDateChange",value:function(e,t){"start"===e?(this.setState({startDate:t}),this.props.onDateChange(t,this.state.endDate)):(this.setState({endDate:t}),this.props.onDateChange(this.state.startDate,t))}},{key:"render",value:function(){return l.default.createElement("div",{id:"wv-animation-widget",className:"wv-animation-widget"},l.default.createElement(g.default,{text:this.state.increment,toolTipTextArray:this.state.incrementArray,onClick:this.props.onZoomSelect}),l.default.createElement(m.default,{playing:this.state.playing,play:this.play.bind(this),pause:this.pause.bind(this)}),l.default.createElement(y.default,{looping:this.state.looping,onLoop:this.onLoop.bind(this)}),l.default.createElement("div",{className:"wv-slider-case"},l.default.createElement(f.default,{maxValue:10,minValue:1,value:this.state.value,onChange:this.onSlide.bind(this)}),l.default.createElement("span",{className:"wv-slider-label"},this.props.sliderLabel)),l.default.createElement("a",{href:"javascript:void(null)",title:"Create Animated GIF",className:"wv-icon-case",onClick:this.props.onPushGIF},l.default.createElement("i",{className:"fa fa-file-video-o wv-animation-widget-icon"})),l.default.createElement("div",{className:"wv-anim-dates-case"},l.default.createElement(d.default,{width:"120",height:"30",date:this.state.startDate,id:"start",onDateChange:this.onDateChange.bind(this),maxDate:this.state.endDate,minDate:this.props.minDate}),l.default.createElement("div",{className:"thru-label"},"To"),l.default.createElement(d.default,{width:"120",height:"30",date:this.state.endDate,id:"end",onDateChange:this.onDateChange.bind(this),maxDate:this.props.maxDate,minDate:this.state.startDate})),l.default.createElement("i",{className:"fa fa-close wv-close",onClick:this.props.onClose}))}}]),t}(l.default.Component));n.default=D}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../dateselector/wv.dateselector":18,"../util/wv.googleAnalytics":23,"./wv.animation.widget.header":11,"./wv.loopbutton":13,"./wv.playbutton":14,"react-input-range":7}],13:[function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=t(s),l=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),i(t,[{key:"render",value:function(){return u.default.createElement("a",{href:"javascript:void(null)",title:this.props.looping?"Stop Loop":"Loop video",className:this.props.looping?"wv-loop-icon-case wv-icon-case active":"wv-loop-icon-case wv-icon-case",onClick:this.props.onLoop},u.default.createElement("i",{className:"fa fa-retweet wv-animation-widget-icon"}))}}]),t}(u.default.Component);n.default=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=t(s),l=function(e){function t(e){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return r(t,e),i(t,[{key:"render",value:function(){return u.default.createElement("a",{href:"javascript:void(null)",title:this.props.playing?"Pause video":"Play video",className:"wv-anim-play-case wv-icon-case",onClick:this.props.playing?this.props.pause:this.props.play},u.default.createElement("i",{className:this.props.playing?"fa fa-pause wv-animation-widget-icon":"fa fa-play wv-animation-widget-icon"}))}}]),t}(u.default.Component);n.default=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("./wv.dateselector.input"),f=o(p),c=e("../util/wv.utils"),d=o(c),h=new d.default,y=function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={date:e.date,maxDate:e.maxDate,minDate:e.minDate,tab:null},n}return i(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({date:e.date,maxDate:e.maxDate,minDate:e.minDate})}},{key:"blur",value:function(){this.setState({tab:null})}},{key:"nextTab",value:function e(t){var e;e=t<3?t+1:1,this.setState({tab:e})}},{key:"updateDate",value:function(e){this.setState({date:e}),this.props.onDateChange(this.props.id,e)}},{key:"render",value:function(){return l.default.createElement("div",{className:"wv-date-selector-widget"},l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,value:this.state.date.getUTCFullYear(),type:"year",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),tabIndex:1,focused:1==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}),l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,type:"month",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),value:h.monthStringArray[this.state.date.getUTCMonth()],tabIndex:2,focused:2==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}),l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,type:"day",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),value:h.pad(this.state.date.getUTCDate(),2,"0"),tabIndex:3,focused:3==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}))}}]),t}(l.default.Component);n.default=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util/wv.utils":24,"./wv.dateselector.input":16}],16:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof t?t.ReactDOM:null,f=o(p),c=e("../util/wv.utils"),d=o(c),h=new d.default,y=function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={value:n.props.value,valid:!0},n}return i(t,e),s(t,[{key:"componentDidUpdate",value:function(){this.props.focused&&f.default.findDOMNode(this.refs["input-"+this.props.tabIndex]).focus()}},{key:"componentWillMount",value:function(){var e,t;t=this.props.type,e="year"===t?"4":"day"===t?2:3,this.size=e}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"onKeyPress",value:function(e){var t=e.keyCode;9!==t&&13!==t||(e.preventDefault(),e.stopPropagation())}},{key:"onKeyUp",value:function(e){var t,n=e.keyCode,o=e.target.value,a=13==n||9==n;if(38===n)return e.preventDefault(),void this.onClickUp();if(40===n)return e.preventDefault(),void this.onClickDown();if("focusout"==e.type||a){if(("year"==this.props.type||"day"==this.props.type)&&!(n>=48&&n<=57||a||8==n))return;switch(this.props.type){case"year":t=this.yearValidation(o);break;case"day":t=this.dayValidation(o);break;case"month":t=this.monthValidation(o)}t?(this.props.updateDate(t),a&&this.nextTab()):a&&this.setState({valid:!1})}}},{key:"onClickUp",value:function(){this.rollDate(1),this.setState({valid:!0})}},{key:"onClickDown",value:function(){this.rollDate(-1),this.setState({valid:!0})}},{key:"yearValidation",value:function(e){var t;if(e>1e3&&e<9999)return t=new Date(new Date(this.props.date).setUTCFullYear(e)),this.validateDate(t)}},{key:"dayValidation",value:function(e){var t,n,o=this.props.date;if(n=new Date(o.getYear(),o.getMonth()+1,0).getDate(),e>0&&e<=n)return t=new Date(new Date(o).setUTCDate(e)),this.validateDate(t)}},{key:"rollDate",value:function(e){var t=h.rollDate(this.props.date,this.props.type,e,this.props.minDate,this.props.maxDate);this.props.updateDate(t)}},{key:"monthValidation",value:function(e){var t;if(!(!isNaN(e)&&e<13&&e>0)){var n=void 0;return n=h.stringInArray(h.monthStringArray,e),n!==!1&&(t=new Date(new Date(this.props.date).setUTCMonth(n)),this.validateDate(t))}if(t=new Date(new Date(this.props.date).setUTCMonth(e-1)))return this.setState({value:h.monthStringArray[e-1]}),this.validateDate(t)}},{key:"blur",value:function(){this.setState({value:this.props.value,valid:!0}),this.props.blur()}},{key:"onChange",value:function(e){this.setState({value:e.target.value.toUpperCase()})}},{key:"nextTab",value:function(){this.props.nextTab(this.props.tabIndex)}},{key:"validateDate",value:function(e){return e>this.props.minDate&&e<=this.props.maxDate&&(this.setState({valid:!0}),e)}},{key:"render",value:function(){return l.default.createElement("div",{className:"input-wrapper",style:this.state.valid?{}:{borderColor:"#ff0000"}},l.default.createElement("div",{onClick:this.onClickUp.bind(this),className:"date-arrows date-arrow-up","data-interval":this.props.type},l.default.createElement("svg",{width:"25",height:"8"},l.default.createElement("path",{d:"M 12.5,0 25,8 0,8 z",className:"uparrow"}))),l.default.createElement("input",{type:"text",ref:"input-"+this.props.tabIndex,size:this.size,maxLength:this.size,className:"button-input-group",id:this.props.type+"-input-group",value:this.state.value,tabIndex:this.props.tabIndex,onKeyUp:this.onKeyUp.bind(this),onKeyDown:this.onKeyPress.bind(this),onChange:this.onChange.bind(this),style:{fontSize:this.props.height/2+"px"},onBlur:this.blur.bind(this)}),l.default.createElement("div",{onClick:this.onClickDown.bind(this),className:"date-arrows date-arrow-down","data-interval":this.props.type},l.default.createElement("svg",{width:"25",height:"8"},l.default.createElement("path",{d:"M 12.5,0 25,8 0,8 z",className:"downarrow"}))))}}]),t}(l.default.Component);n.default=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util/wv.utils":24}],17:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p="undefined"!=typeof window?window.ReactDOM:"undefined"!=typeof t?t.ReactDOM:null,f=o(p),c=e("../util/wv.utils"),d=o(c),h=new d.default,y=function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={value:n.props.value,valid:!0},n}return i(t,e),s(t,[{key:"componentDidUpdate",value:function(){this.props.focused&&f.default.findDOMNode(this.refs["input-"+this.props.tabIndex]).focus()}},{key:"componentWillMount",value:function(){var e,t;t=this.props.type,e="year"===t?"4":"day"===t?2:3,this.size=e}},{key:"componentWillReceiveProps",value:function(e){this.setState({value:e.value})}},{key:"onKeyPress",value:function(e){var t=e.keyCode;9!==t&&13!==t||(e.preventDefault(),e.stopPropagation())}},{key:"onKeyUp",value:function(e){var t,n=e.keyCode,o=e.target.value,a=13==n||9==n;if(38===n)return e.preventDefault(),void this.onClickUp();if(40===n)return e.preventDefault(),void this.onClickDown();if("focusout"==e.type||a){if(("year"==this.props.type||"day"==this.props.type)&&!(n>=48&&n<=57||a||8==n))return;switch(this.props.type){case"year":t=this.yearValidation(o);break;case"day":t=this.dayValidation(o);break;case"month":t=this.monthValidation(o)}t?(this.props.updateDate(t),a&&this.nextTab()):a&&this.setState({valid:!1})}}},{key:"onClickUp",value:function(){this.rollDate(1),this.setState({valid:!0})}},{key:"onClickDown",value:function(){this.rollDate(-1),this.setState({valid:!0})}},{key:"yearValidation",value:function(e){var t;if(e>1e3&&e<9999)return t=new Date(new Date(this.props.date).setUTCFullYear(e)),this.validateDate(t)}},{key:"dayValidation",value:function(e){var t,n,o=this.props.date;if(n=new Date(o.getYear(),o.getMonth()+1,0).getDate(),e>0&&e<=n)return t=new Date(new Date(o).setUTCDate(e)),this.validateDate(t)}},{key:"rollDate",value:function(e){var t=h.rollDate(this.props.date,this.props.type,e,this.props.minDate,this.props.maxDate);this.props.updateDate(t)}},{key:"monthValidation",value:function(e){var t;if(!(!isNaN(e)&&e<13&&e>0)){var n=void 0;return n=h.stringInArray(h.monthStringArray,e),n!==!1&&(t=new Date(new Date(this.props.date).setUTCMonth(n)),this.validateDate(t))}if(t=new Date(new Date(this.props.date).setUTCMonth(e-1)))return this.setState({value:h.monthStringArray[e-1]}),this.validateDate(t)}},{key:"blur",value:function(){this.setState({value:this.props.value,valid:!0}),this.props.blur()}},{key:"onChange",value:function(e){this.setState({value:e.target.value.toUpperCase()})}},{key:"nextTab",value:function(){this.props.nextTab(this.props.tabIndex)}},{key:"validateDate",value:function(e){return e>this.props.minDate&&e<=this.props.maxDate&&(this.setState({valid:!0}),e)}},{key:"render",value:function(){return l.default.createElement("div",{className:"input-wrapper",style:this.state.valid?{}:{borderColor:"#ff0000"}},l.default.createElement("div",{onClick:this.onClickUp.bind(this),className:"date-arrows date-arrow-up","data-interval":this.props.type},l.default.createElement("svg",{width:"25",height:"8"},l.default.createElement("path",{+d:"M 12.5,0 25,8 0,8 z",className:"uparrow"}))),l.default.createElement("input",{type:"text",ref:"input-"+this.props.tabIndex,size:this.size,maxLength:this.size,className:"button-input-group",id:this.props.type+"-input-group",value:this.state.value,tabIndex:this.props.tabIndex,onKeyUp:this.onKeyUp.bind(this),onKeyDown:this.onKeyPress.bind(this),onChange:this.onChange.bind(this),style:{fontSize:this.props.height/2+"px"},onBlur:this.blur.bind(this)}),l.default.createElement("div",{onClick:this.onClickDown.bind(this),className:"date-arrows date-arrow-down","data-interval":this.props.type},l.default.createElement("svg",{width:"25",height:"8"},l.default.createElement("path",{d:"M 12.5,0 25,8 0,8 z",className:"downarrow"}))))}}]),t}(l.default.Component);n.default=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util/wv.utils":24}],18:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("./wv.dateselector.input"),f=o(p),c=e("../util/wv.utils"),d=o(c),h=new d.default,y=function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={date:e.date,maxDate:e.maxDate,minDate:e.minDate,tab:null},n}return i(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({date:e.date,maxDate:e.maxDate,minDate:e.minDate})}},{key:"blur",value:function(){this.setState({tab:null})}},{key:"nextTab",value:function e(t){var e;e=t<3?t+1:1,this.setState({tab:e})}},{key:"updateDate",value:function(e){this.setState({date:e}),this.props.onDateChange(this.props.id,e)}},{key:"render",value:function(){return l.default.createElement("div",{className:"wv-date-selector-widget"},l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,value:this.state.date.getUTCFullYear(),type:"year",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),tabIndex:1,focused:1==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}),l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,type:"month",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),value:h.monthStringArray[this.state.date.getUTCMonth()],tabIndex:2,focused:2==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}),l.default.createElement(f.default,{startDate:new Date(2e3),today:new Date,date:this.state.date,type:"day",height:this.props.height,width:this.props.width,updateDate:this.updateDate.bind(this),value:h.pad(this.state.date.getUTCDate(),2,"0"),tabIndex:3,focused:3==this.state.tab,nextTab:this.nextTab.bind(this),maxDate:this.props.maxDate,minDate:this.props.minDate,blur:this.blur.bind(this)}))}}]),t}(l.default.Component);n.default=y}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../util/wv.utils":24,"./wv.dateselector.input":17}],19:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("react-draggable"),f=o(p),c=function(e){function t(e){return a(this,t),r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e))}return i(t,e),s(t,[{key:"checkVisibility",value:function(){var e="visible";(this.props.position<0||this.props.position>this.props.max)&&(e="hidden"),this.state={visibility:e}}},{key:"handleDrag",value:function(e,t){e.stopPropagation(),this.props.onDrag(t.deltaX,this.props.id)}},{key:"render",value:function(){return this.checkVisibility(),l.default.createElement(f.default,{onDrag:this.handleDrag.bind(this),position:{x:this.props.position,y:0},onStop:this.props.onStop,axis:"x"},l.default.createElement("g",null,l.default.createElement("rect",{width:this.props.width,height:this.props.height,style:{fill:this.props.color,visibility:this.state.visibility}}),l.default.createElement("polygon",{points:"0,0,"+this.props.height/1.5+",0 "+this.props.height/3+", "+this.props.height/1.5,transform:"translate("+-(2.45*this.props.width)+", "+-(this.props.height/2)+")",style:{fill:this.props.triangleColor,visibility:this.state.visibility,stroke:"#000",cursor:"pointer"}})))}}]),t}(l.default.Component);n.default=c,c.defaultProps={visible:!0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"react-draggable":1}],20:[function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=t(s),l=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.opacity={fillOpacity:n.props.opacity},n}return r(t,e),i(t,[{key:"checkWidth",value:function(){var e,t=this.props.startLocation,n=this.props.endLocation,o=this.props.max;t<0&&(t=0),n>o&&(n=o),e=n-t,e<0&&(e=0),this.state={width:e,startLocation:t}}},{key:"handleDrag",value:function(e,t){e.stopPropagation(),this.props.onDrag(t.deltaX)}},{key:"render",value:function(){return this.checkWidth(),u.default.createElement("rect",{x:this.state.startLocation,fill:this.props.color,width:this.state.width,style:this.opacity,height:this.props.height,className:"dragger-range",onClick:this.props.onClick})}}]),t}(u.default.Component);n.default=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(e,t,n){(function(t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),u="undefined"!=typeof window?window.React:"undefined"!=typeof t?t.React:null,l=o(u),p=e("./wv.timeline.dragger.js"),f=o(p),c=e("./wv.timeline.draggerrange.js"),d=o(c),h=function(e){function t(e){a(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={startLocation:e.startLocation,endLocation:e.endLocation,max:e.max},n}return i(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.setState({startLocation:e.startLocation,endLocation:e.endLocation,max:e.max})}},{key:"onItemDrag",value:function(e,t){var n,o;if("start"===t){if(n=e+this.state.startLocation,o=this.state.endLocation,n<0||n>o)return;n+2*this.props.pinWidth>=o&&(o=n+this.props.pinWidth)}else if("end"===t){if(n=this.state.startLocation,o=e+this.state.endLocation,o>this.state.max||n>o)return;n+2*this.props.pinWidth>=o&&(n=o-this.props.pinWidth)}else if(n=e+this.state.startLocation,o=e+this.state.endLocation,o>=this.state.max||n<0)return;this.props.onDrag(n,o),this.setState({startLocation:n,endLocation:o})}},{key:"onDragStop",value:function(){this.props.onDrag(this.state.startLocation,this.state.endLocation)}},{key:"onRangeClick",value:function(e){this.props.onRangeClick(e.nativeEvent)}},{key:"render",value:function(){return l.default.createElement("svg",{id:"wv-timeline-range-selector",className:"wv-timeline-range-selector"},l.default.createElement(d.default,{width:this.props.pinWidth,endLocation:this.state.endLocation,opacity:this.props.rangeOpacity,color:this.props.rangeColor,height:this.props.height,startLocation:this.state.startLocation+this.props.pinWidth,onClick:this.onRangeClick.bind(this),max:this.state.max,id:"range"}),l.default.createElement(f.default,{position:this.state.startLocation,color:this.props.startColor,width:this.props.pinWidth,height:this.props.height,onDrag:this.onItemDrag.bind(this),onStop:this.onDragStop.bind(this),max:this.state.max,triangleColor:this.props.startTriangleColor,first:!0,id:"start"}),l.default.createElement(f.default,{max:this.state.max,position:this.state.endLocation,color:this.props.endColor,width:this.props.pinWidth,height:this.props.height,first:!1,onDrag:this.onItemDrag.bind(this),onStop:this.onDragStop.bind(this),triangleColor:this.props.endTriangleColor,id:"end"}))}}]),t}(l.default.Component);n.default=h}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./wv.timeline.dragger.js":19,"./wv.timeline.draggerrange.js":20}],22:[function(e,t,n){(function(e){"use strict";function t(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),s="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=t(s),l=function(e){function t(e){o(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.state={hovered:!1},n}return r(t,e),i(t,[{key:"mouseOver",value:function(){this.setState({hovered:!0})}},{key:"mouseOut",value:function(){this.setState({hovered:!1})}},{key:"onClick",value:function(e){this.props.onClick(e)}},{key:"render",value:function(){var e=this;return u.default.createElement("div",{onMouseEnter:this.mouseOver.bind(this),onMouseLeave:this.mouseOut.bind(this),className:"wv-tooltip-case"},u.default.createElement("span",null,this.props.text),u.default.createElement("div",{className:"wv-tooltip",style:this.state.hovered?{visibility:"visible"}:{}},u.default.createElement("ul",null,this.props.dataArray.map(function(t,n){return u.default.createElement("li",{key:"tooltip-"+t+"-"+n,id:t,onClick:e.onClick.bind(e,t)},t)}))))}}]),t}(u.default.Component);n.default=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default={init:function(e){e&&(!function(e,t,n,o,a,r,i){e.GoogleAnalyticsObject=a,e[a]=e[a]||function(){(e[a].q=e[a].q||[]).push(arguments)},e[a].l=1*new Date,r=t.createElement(n),i=t.getElementsByTagName(n)[0],r.async=1,r.src=o,i.parentNode.insertBefore(r,i)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga"),ga("create",e,"auto"),ga("send","pageview"))},event:function(e,t,n,o){"undefined"!=typeof ga&&ga("send","event",e,t,n,o)}}},{}],24:[function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=function(){function e(){o(this,e),this.monthStringArray=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]}return a(e,[{key:"today",value:function(){return this.clearTimeUTC(this.now())}},{key:"clearTimeUTC",value:function(e){return e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),e}},{key:"clamp",value:function(e,t,n){return e<t?t:e>n?n:e}},{key:"daysInMonth",value:function(e){var t,n;e.getUTCFullYear?(t=e.getUTCFullYear(),n=e.getUTCMonth()):(t=e.year,n=e.month);var o=new Date(Date.UTC(t,n+1,0));return o.getUTCDate()}},{key:"now",value:function(){return new Date}},{key:"stringInArray",value:function(e,t){for(var n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return!1}},{key:"minDate",value:function(){return new Date(Date.UTC(1e3,0,1))}},{key:"maxDate",value:function(){return new Date(Date.UTC(3e3,11,31))}},{key:"parseDateUTC",value:function(e){var t=e.split(/T/),n=t[0].split("-"),o=n[0],a=n[1]-1,r=n[2],i=0,s=0,u=0,l=0;if(t.length>1){var p=t[1].split(/[:\.Z]/);i=p[0]||0,s=p[1]||0,u=p[2]||0,l=p[3]||0}var f=new Date(Date.UTC(o,a,r,i,s,u,l));if(isNaN(f.getTime()))throw new Error("Invalid date: "+e);return f}},{key:"repeat",value:function(e,t){for(var n="",o=0;o<t;o++)n+=e;return n}},{key:"roll",value:function(e,t,n){return e<t?n-(t-e)+1:e>n?t+(e-n)-1:e}},{key:"rollRange",value:function(e,t,n,o){var a,r,i=e.getUTCFullYear(),s=e.getUTCMonth();switch(t){case"day":var u=new Date(Date.UTC(i,s,1)),l=new Date(Date.UTC(i,s,this.daysInMonth(e)));a=new Date(Math.max(u,n)).getUTCDate(),r=new Date(Math.min(l,o)).getUTCDate();break;case"month":var p=new Date(Date.UTC(i,0,1)),f=new Date(Date.UTC(i,11,31));a=new Date(Math.max(p,n)).getUTCMonth(),r=new Date(Math.min(f,o)).getUTCMonth();break;case"year":var c=this.minDate(),d=this.maxDate();a=new Date(Math.max(c,n)).getUTCFullYear(),r=new Date(Math.min(d,o)).getUTCFullYear()}return{first:a,last:r}}},{key:"rollDate",value:function(e,t,n,o,a){o=o||this.minDate(),a=a||this.maxDate();var r=this.rollRange(e,t,o,a),i=r.first,s=r.last,u=e.getUTCDate(),l=e.getUTCMonth(),p=e.getUTCFullYear();switch(t){case"day":u=this.roll(u+n,i,s);break;case"month":l=this.roll(l+n,i,s);break;case"year":p=this.roll(p+n,i,s);break;default:throw new Error("[rollDate] Invalid interval: "+t)}var f=this.daysInMonth({year:p,month:l});u>f&&(u=f);var c=new Date(Date.UTC(p,l,u));return c=new Date(this.clamp(c,o,a))}},{key:"pad",value:function(e,t,n){if(e=""+e,e.length<t){var o=t-e.length;e=this.repeat(n,o)+e}return e}}]),e}();n.default=r},{}],25:[function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var a=e("./components/animationwidget/wv.animation.widget.js");Object.defineProperty(n,"AnimationWidget",{enumerable:!0,get:function(){return o(a).default}});var r=e("./components/rangeselection/wv.timeline.rangeselection.js");Object.defineProperty(n,"RangeSelector",{enumerable:!0,get:function(){return o(r).default}});var i=e("./components/dateSelector/wv.dateSelector.js");Object.defineProperty(n,"DateSelector",{enumerable:!0,get:function(){return o(i).default}});var s=e("./components/tooltip/wv.tooltip.js");Object.defineProperty(n,"ToolTip",{enumerable:!0,get:function(){return o(s).default}});var u=e("./components/util/wv.utils.js");Object.defineProperty(n,"Utils",{enumerable:!0,get:function(){return o(u).default}});var l=e("./components/util/wv.googleAnalytics.js");Object.defineProperty(n,"GA",{enumerable:!0,get:function(){return o(l).default}})},{"./components/animationwidget/wv.animation.widget.js":12,"./components/dateSelector/wv.dateSelector.js":15,"./components/rangeselection/wv.timeline.rangeselection.js":21,"./components/tooltip/wv.tooltip.js":22,"./components/util/wv.googleAnalytics.js":23,"./components/util/wv.utils.js":24}]},{},[25])(25)});\ No newline at end of file